clk: msm: osm: support PLL droop detector workaround
Add the architectural space register programming required to workaround the droop detector and OSM PLL lock detect interaction. In particular the workaround prevents the OSM sequence and FSMs from waiting indefinitely for PLL lock in certain scenarios when the droop detector is active. In addition, the new sequencer is compatible with 3 levels of ACC settings, thus update the driver to reflect this. CRs-Fixed: 1021659 Change-Id: I178fb226f4eec4c188f11e9e868a575c70ad58ae Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
This commit is contained in:
parent
4ba4c5041b
commit
d1565c45eb
1 changed files with 60 additions and 45 deletions
|
@ -75,8 +75,7 @@ enum clk_osm_trace_packet_id {
|
|||
#define MEM_ACC_SEQ_REG_CFG_START(n) (SEQ_REG(12 + (n)))
|
||||
#define MEM_ACC_SEQ_CONST(n) (n)
|
||||
#define MEM_ACC_INSTR_COMP(n) (0x67 + ((n) * 0x40))
|
||||
#define MEM_ACC_SEQ_REG_VAL_START(n) \
|
||||
((n) < 8 ? SEQ_REG(4 + (n)) : SEQ_REG(60 + (n) - 8))
|
||||
#define MEM_ACC_SEQ_REG_VAL_START(n) (SEQ_REG(60 + (n)))
|
||||
|
||||
#define OSM_TABLE_SIZE 40
|
||||
#define MAX_CLUSTER_CNT 2
|
||||
|
@ -184,11 +183,11 @@ enum clk_osm_trace_packet_id {
|
|||
#define MAX_INSTRUCTIONS 256
|
||||
#define MAX_BR_INSTRUCTIONS 49
|
||||
|
||||
#define MAX_MEM_ACC_LEVELS 4
|
||||
#define MAX_MEM_ACC_LEVELS 3
|
||||
#define MAX_MEM_ACC_VAL_PER_LEVEL 3
|
||||
#define MAX_MEM_ACC_VALUES (MAX_MEM_ACC_LEVELS * \
|
||||
MAX_MEM_ACC_VAL_PER_LEVEL)
|
||||
#define MEM_ACC_READ_MASK 0x7
|
||||
#define MEM_ACC_READ_MASK 0xff
|
||||
|
||||
#define TRACE_CTRL 0x1F38
|
||||
#define TRACE_CTRL_EN_MASK BIT(0)
|
||||
|
@ -203,6 +202,11 @@ enum clk_osm_trace_packet_id {
|
|||
#define PERIODIC_TRACE_MAX_NS 21474836475
|
||||
#define PERIODIC_TRACE_DEFAULT_NS 1000000
|
||||
|
||||
#define PLL_DD_USER_CTL_LO_ENABLE 0x0f04c408
|
||||
#define PLL_DD_USER_CTL_LO_DISABLE 0x1f04c41f
|
||||
#define PLL_DD_D0_USER_CTL_LO 0x17916208
|
||||
#define PLL_DD_D1_USER_CTL_LO 0x17816208
|
||||
|
||||
static void __iomem *virt_base;
|
||||
|
||||
#define lmh_lite_clk_src_source_val 1
|
||||
|
@ -222,50 +226,51 @@ static void __iomem *virt_base;
|
|||
|
||||
static u32 seq_instr[] = {
|
||||
0xc2005000, 0x2c9e3b21, 0xc0ab2cdc, 0xc2882525, 0x359dc491,
|
||||
0x700a500b, 0x70005001, 0x390938c8, 0xcb44c833, 0xce56cd54,
|
||||
0x341336e0, 0xadba0000, 0x10004000, 0x70005001, 0x1000500c,
|
||||
0xc792c5a1, 0x501625e1, 0x3da335a2, 0x50170006, 0x50150006,
|
||||
0xafb9c633, 0xacb31000, 0xacb41000, 0x1000c422, 0x500baefc,
|
||||
0x5001700a, 0xaefd7000, 0x700b5010, 0x700c5012, 0xadb9ad41,
|
||||
0x181b0000, 0x500f500c, 0x34135011, 0x84b9181b, 0xbd808539,
|
||||
0x2ba40003, 0x0006a001, 0x10007105, 0x1000500e, 0x1c0a500c,
|
||||
0x3b181c01, 0x3b431c06, 0x10001c07, 0x39831c06, 0x500c1c07,
|
||||
0x1c0a1c02, 0x10000000, 0x70015002, 0x10000000, 0x50038103,
|
||||
0x50047002, 0x10007003, 0x39853b44, 0x50038104, 0x40037002,
|
||||
0x70095005, 0xb1c0a146, 0x238b0003, 0x10004005, 0x848b8308,
|
||||
0x1000850c, 0x848e830d, 0x1000850c, 0x3a4c5006, 0x3a8f39cd,
|
||||
0x40063ad0, 0x50071000, 0x2c127006, 0x4007a00f, 0x71050006,
|
||||
0x1000700d, 0x1c1aa964, 0x700d4007, 0x50071000, 0x1c167006,
|
||||
0x50125010, 0x40072411, 0x4007700d, 0xa00f1000, 0x0006a821,
|
||||
0x40077105, 0x500c700d, 0x1c1591ad, 0x5011500f, 0x10000000,
|
||||
0x500c2bd4, 0x0006a00f, 0x10007105, 0xa821a00f, 0x70050006,
|
||||
0x91ad500c, 0x500f1c15, 0x10005011, 0x1c162bce, 0x50125010,
|
||||
0xa82aa022, 0x71050006, 0x1c1591a6, 0x5011500f, 0x5014500c,
|
||||
0x0006a00f, 0x00007105, 0x91a41000, 0x22175013, 0x1c1aa963,
|
||||
0x22171000, 0x1c1aa963, 0x50081000, 0x40087007, 0x1c1aa963,
|
||||
0x70085009, 0x10004009, 0x850c848e, 0x0003b1c0, 0x400d2b99,
|
||||
0x500d1000, 0xabaf1000, 0x853184b0, 0x0003bb80, 0xa0371000,
|
||||
0x71050006, 0x85481000, 0xbf8084c3, 0x2ba80003, 0xbf8084c2,
|
||||
0x2ba70003, 0xbf8084c1, 0x2ba60003, 0x8ec71000, 0xc6dd8dc3,
|
||||
0x8c1625ec, 0x8d498c97, 0x8ec61c00, 0xc6dd8dc2, 0x8c1325ec,
|
||||
0x8d158c94, 0x8ec51c00, 0xc6dd8dc1, 0x8c1025ec, 0x8d128c91,
|
||||
0x8dc01c00, 0x182cc633, 0x84c08548, 0x0003bf80, 0x84c12ba9,
|
||||
0x0003bf80, 0x84c22baa, 0x0003bf80, 0x10002bab, 0x8dc08ec4,
|
||||
0x25ecc6dd, 0x8c948c13, 0x1c008d15, 0x8dc18ec5, 0x25ecc6dd,
|
||||
0x8c978c16, 0x1c008d49, 0x8dc28ec6, 0x25ecc6dd, 0x8ccb8c4a,
|
||||
0x1c008d4c, 0xc6338dc3, 0x1000af9b, 0xa759a79a, 0x1000a718,
|
||||
0x700a500b, 0x5001aefc, 0xaefd7000, 0x390938c8, 0xcb44c833,
|
||||
0xce56cd54, 0x341336e0, 0xa4baadba, 0xb480a493, 0x10004000,
|
||||
0x70005001, 0x1000500c, 0xc792c5a1, 0x501625e1, 0x3da335a2,
|
||||
0x50170006, 0x50150006, 0xafb9c633, 0xacb31000, 0xacb41000,
|
||||
0x1000c422, 0x500baefc, 0x5001700a, 0xaefd7000, 0x700b5010,
|
||||
0x700c5012, 0xadb9ad41, 0x500c181b, 0x5011500f, 0x181b3413,
|
||||
0x853984b9, 0x0003bd80, 0xa0012ba4, 0x72050006, 0x500e1000,
|
||||
0x500c1000, 0x1c011c0a, 0x1c063b18, 0x336c3b6b, 0x10001c07,
|
||||
0x39831c06, 0x500c1c07, 0x1c0a1c02, 0x8ed61000, 0xc8dd0000,
|
||||
0x10003e03, 0x70015002, 0x81031000, 0x70025003, 0x70035004,
|
||||
0x1000a503, 0x84848548, 0x0003b500, 0x3b8423ae, 0x39853b44,
|
||||
0x50038155, 0x40037002, 0x70095005, 0xb1c0a146, 0x238b0003,
|
||||
0x10004005, 0x848b8308, 0x1000850c, 0x848e830d, 0x1000850c,
|
||||
0x3a4c5006, 0x3a8f39cd, 0x40063ad0, 0x50071000, 0x2c127006,
|
||||
0x4007a00f, 0x72050006, 0x700daefc, 0x1000aefd, 0x1c1aa964,
|
||||
0xaefc4007, 0xaefd700d, 0x50071000, 0x1c167006, 0x50125010,
|
||||
0x40072411, 0x700daefc, 0x1000aefd, 0xa821a00f, 0x72050006,
|
||||
0xaefc4007, 0xaefd700d, 0x91ad500c, 0x500f1c15, 0x10005011,
|
||||
0x500c2bd4, 0x0006a00f, 0x10007205, 0xa00fa9d1, 0x0006a821,
|
||||
0xa9d07005, 0x91ad500c, 0x500f1c15, 0x10005011, 0x1c162bce,
|
||||
0x50125010, 0x0006a022, 0xa82a7205, 0x1c1591a6, 0x5011500f,
|
||||
0x5014500c, 0x0006a00f, 0x10007205, 0x501391a4, 0x22172217,
|
||||
0x70075008, 0xa9634008, 0x1c1a0006, 0x70085009, 0x10004009,
|
||||
0x850c848e, 0x0003b1c0, 0x400d2b99, 0x500d1000, 0xabaf1000,
|
||||
0x853184b0, 0x0003bb80, 0x1000239f, 0x0006a037, 0x10007205,
|
||||
0x84c28548, 0x0003bf80, 0x84c12ba7, 0x0003bf80, 0x10002ba6,
|
||||
0x8dc28ec6, 0x25eac6dd, 0x8ccd8c4c, 0x1c008d4e, 0x8dc18ec5,
|
||||
0x25eac6dd, 0x8cca8c49, 0x1c008d4b, 0xc6338dc0, 0x8548182a,
|
||||
0xbf8084c0, 0x2ba80003, 0xbf8084c1, 0x2ba90003, 0x8ec41000,
|
||||
0xc6dd8dc0, 0x8c4c25ea, 0x8d4e8ccd, 0x8ec51c00, 0xc6dd8dc1,
|
||||
0x8c4f25ea, 0x8d518cd0, 0x8dc21c00, 0xaf9bc633, 0x10001000,
|
||||
0xa759a79a, 0x1000a718,
|
||||
};
|
||||
|
||||
static u32 seq_br_instr[] = {
|
||||
0x28c, 0x1e6, 0x238, 0xd0, 0xec,
|
||||
0xf4, 0xbc, 0xc4, 0x9c, 0xac,
|
||||
0xfc, 0xe2, 0x154, 0x174, 0x17c,
|
||||
0x10a, 0x126, 0x13a, 0x11c, 0x98,
|
||||
0x160, 0x1a6, 0x19a, 0x1ae, 0x1c0,
|
||||
0x1ce, 0x1d2, 0x30, 0x60, 0x86,
|
||||
0x7c, 0x1d8, 0x34, 0x3c, 0x56,
|
||||
0x5a, 0x1de, 0x2e, 0x222, 0x212,
|
||||
0x202, 0x254, 0x264, 0x274, 0x288,
|
||||
0x280, 0x208, 0x242, 0xec, 0x108,
|
||||
0x110, 0xcc, 0xd2, 0xa2, 0xb4,
|
||||
0x118, 0xfe, 0x17c, 0x1a0, 0x1a8,
|
||||
0x126, 0x14a, 0x160, 0x13c, 0x9e,
|
||||
0x188, 0x1ca, 0x1c4, 0x1cc, 0x1e0,
|
||||
0x1ee, 0x1f2, 0x32, 0x68, 0x8c,
|
||||
0x82, 0x1f8, 0x3c, 0x44, 0x5e,
|
||||
0x62, 0x200, 0x30, 0x22c, 0x21c,
|
||||
0x256, 0x266, 0x27a, 0xc2, 0xe0,
|
||||
0x0, 0x27e,
|
||||
};
|
||||
|
||||
DEFINE_EXT_CLK(xo_ao, NULL);
|
||||
|
@ -1518,10 +1523,20 @@ static void clk_osm_setup_osm_was(struct clk_osm *c)
|
|||
clk_osm_write_reg(c, 0x0, SEQ_REG(45));
|
||||
clk_osm_write_reg(c, c->pbases[OSM_BASE] + PDN_FSM_CTRL_REG,
|
||||
SEQ_REG(46));
|
||||
|
||||
/* Droop detector PLL lock detect workaround */
|
||||
clk_osm_write_reg(c, PLL_DD_USER_CTL_LO_ENABLE, SEQ_REG(4));
|
||||
clk_osm_write_reg(c, PLL_DD_USER_CTL_LO_DISABLE, SEQ_REG(5));
|
||||
clk_osm_write_reg(c, c->cluster_num == 0 ? PLL_DD_D0_USER_CTL_LO
|
||||
: PLL_DD_D1_USER_CTL_LO, SEQ_REG(21));
|
||||
} else {
|
||||
scm_io_write(c->pbases[OSM_BASE] + SEQ_REG(47), val);
|
||||
val &= ~IGNORE_PLL_LOCK_MASK;
|
||||
scm_io_write(c->pbases[OSM_BASE] + SEQ_REG(48), val);
|
||||
|
||||
/* Droop detector PLL lock detect workaround */
|
||||
scm_io_write(c->pbases[OSM_BASE] + SEQ_REG(4),
|
||||
PLL_DD_USER_CTL_LO_ENABLE);
|
||||
}
|
||||
|
||||
if (c->cluster_num == 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue