aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2011-07-20 19:35:46 -0400
committerKevin Hilman <khilman@ti.com>2011-09-15 15:09:22 -0400
commit5876c940c0dee298e38fbf47ce67c9e220b0572c (patch)
treef4f9773abbc985e427b6c9892402064a473e9ba6
parent6a62b78d9aa6661cae1a7d30b574daf435a14c47 (diff)
OMAP2+: VC: more registers are per-channel starting with OMAP5
Starting with OMAP5, the following registers are per-channel and not common to a all VC channels: - SMPS I2C slave address - SMPS voltage register address offset - SMPS cmd/value register address offset - VC channel configuration register Move these from the channel-common struct into the per-channel struct to support OMAP5. Signed-off-by: Kevin Hilman <khilman@ti.com>
-rw-r--r--arch/arm/mach-omap2/vc.c8
-rw-r--r--arch/arm/mach-omap2/vc.h16
-rw-r--r--arch/arm/mach-omap2/vc3xxx_data.c12
-rw-r--r--arch/arm/mach-omap2/vc44xx_data.c16
4 files changed, 32 insertions, 20 deletions
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c
index 6e586767a904..031d116fbf10 100644
--- a/arch/arm/mach-omap2/vc.c
+++ b/arch/arm/mach-omap2/vc.c
@@ -94,7 +94,7 @@ static int omap_vc_config_channel(struct voltagedomain *voltdm)
94 94
95 voltdm->rmw(CFG_CHANNEL_MASK << vc->cfg_channel_sa_shift, 95 voltdm->rmw(CFG_CHANNEL_MASK << vc->cfg_channel_sa_shift,
96 vc->cfg_channel << vc->cfg_channel_sa_shift, 96 vc->cfg_channel << vc->cfg_channel_sa_shift,
97 vc->common->cfg_channel_reg); 97 vc->cfg_channel_reg);
98 98
99 return 0; 99 return 0;
100} 100}
@@ -319,7 +319,7 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm)
319 /* Configure the i2c slave address for this VC */ 319 /* Configure the i2c slave address for this VC */
320 voltdm->rmw(vc->smps_sa_mask, 320 voltdm->rmw(vc->smps_sa_mask,
321 vc->i2c_slave_addr << __ffs(vc->smps_sa_mask), 321 vc->i2c_slave_addr << __ffs(vc->smps_sa_mask),
322 vc->common->smps_sa_reg); 322 vc->smps_sa_reg);
323 vc->cfg_channel |= vc_cfg_bits->sa; 323 vc->cfg_channel |= vc_cfg_bits->sa;
324 324
325 /* 325 /*
@@ -327,13 +327,13 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm)
327 */ 327 */
328 voltdm->rmw(vc->smps_volra_mask, 328 voltdm->rmw(vc->smps_volra_mask,
329 vc->volt_reg_addr << __ffs(vc->smps_volra_mask), 329 vc->volt_reg_addr << __ffs(vc->smps_volra_mask),
330 vc->common->smps_volra_reg); 330 vc->smps_volra_reg);
331 vc->cfg_channel |= vc_cfg_bits->rav; 331 vc->cfg_channel |= vc_cfg_bits->rav;
332 332
333 if (vc->cmd_reg_addr) { 333 if (vc->cmd_reg_addr) {
334 voltdm->rmw(vc->smps_cmdra_mask, 334 voltdm->rmw(vc->smps_cmdra_mask,
335 vc->cmd_reg_addr << __ffs(vc->smps_cmdra_mask), 335 vc->cmd_reg_addr << __ffs(vc->smps_cmdra_mask),
336 vc->common->smps_cmdra_reg); 336 vc->smps_cmdra_reg);
337 vc->cfg_channel |= vc_cfg_bits->rac | vc_cfg_bits->racen; 337 vc->cfg_channel |= vc_cfg_bits->rac | vc_cfg_bits->racen;
338 } 338 }
339 339
diff --git a/arch/arm/mach-omap2/vc.h b/arch/arm/mach-omap2/vc.h
index 7ed70e07becf..478bf6b432c4 100644
--- a/arch/arm/mach-omap2/vc.h
+++ b/arch/arm/mach-omap2/vc.h
@@ -25,9 +25,6 @@ struct voltagedomain;
25 * struct omap_vc_common - per-VC register/bitfield data 25 * struct omap_vc_common - per-VC register/bitfield data
26 * @cmd_on_mask: ON bitmask in PRM_VC_CMD_VAL* register 26 * @cmd_on_mask: ON bitmask in PRM_VC_CMD_VAL* register
27 * @valid: VALID bitmask in PRM_VC_BYPASS_VAL register 27 * @valid: VALID bitmask in PRM_VC_BYPASS_VAL register
28 * @smps_sa_reg: Offset of PRM_VC_SMPS_SA reg from PRM start
29 * @smps_volra_reg: Offset of PRM_VC_SMPS_VOL_RA reg from PRM start
30 * @smps_cmdra_reg: Offset of PRM_VC_SMPS_CMD_RA reg from PRM start
31 * @bypass_val_reg: Offset of PRM_VC_BYPASS_VAL reg from PRM start 28 * @bypass_val_reg: Offset of PRM_VC_BYPASS_VAL reg from PRM start
32 * @data_shift: DATA field shift in PRM_VC_BYPASS_VAL register 29 * @data_shift: DATA field shift in PRM_VC_BYPASS_VAL register
33 * @slaveaddr_shift: SLAVEADDR field shift in PRM_VC_BYPASS_VAL register 30 * @slaveaddr_shift: SLAVEADDR field shift in PRM_VC_BYPASS_VAL register
@@ -36,7 +33,6 @@ struct voltagedomain;
36 * @cmd_onlp_shift: ONLP field shift in PRM_VC_CMD_VAL_* register 33 * @cmd_onlp_shift: ONLP field shift in PRM_VC_CMD_VAL_* register
37 * @cmd_ret_shift: RET field shift in PRM_VC_CMD_VAL_* register 34 * @cmd_ret_shift: RET field shift in PRM_VC_CMD_VAL_* register
38 * @cmd_off_shift: OFF field shift in PRM_VC_CMD_VAL_* register 35 * @cmd_off_shift: OFF field shift in PRM_VC_CMD_VAL_* register
39 * @cfg_channel_reg: VC channel configuration register
40 * @i2c_cfg_reg: I2C configuration register offset 36 * @i2c_cfg_reg: I2C configuration register offset
41 * @i2c_cfg_hsen_mask: high-speed mode bit field mask in I2C config register 37 * @i2c_cfg_hsen_mask: high-speed mode bit field mask in I2C config register
42 * @i2c_mcode_mask: MCODE field mask for I2C config register 38 * @i2c_mcode_mask: MCODE field mask for I2C config register
@@ -47,9 +43,6 @@ struct voltagedomain;
47struct omap_vc_common { 43struct omap_vc_common {
48 u32 cmd_on_mask; 44 u32 cmd_on_mask;
49 u32 valid; 45 u32 valid;
50 u8 smps_sa_reg;
51 u8 smps_volra_reg;
52 u8 smps_cmdra_reg;
53 u8 bypass_val_reg; 46 u8 bypass_val_reg;
54 u8 data_shift; 47 u8 data_shift;
55 u8 slaveaddr_shift; 48 u8 slaveaddr_shift;
@@ -58,7 +51,6 @@ struct omap_vc_common {
58 u8 cmd_onlp_shift; 51 u8 cmd_onlp_shift;
59 u8 cmd_ret_shift; 52 u8 cmd_ret_shift;
60 u8 cmd_off_shift; 53 u8 cmd_off_shift;
61 u8 cfg_channel_reg;
62 u8 i2c_cfg_reg; 54 u8 i2c_cfg_reg;
63 u8 i2c_cfg_hsen_mask; 55 u8 i2c_cfg_hsen_mask;
64 u8 i2c_mcode_mask; 56 u8 i2c_mcode_mask;
@@ -82,6 +74,10 @@ struct omap_vc_common {
82 * @smps_volra_mask: VOLRA* bitmask in the PRM_VC_VOL_RA register 74 * @smps_volra_mask: VOLRA* bitmask in the PRM_VC_VOL_RA register
83 * @smps_cmdra_mask: CMDRA* bitmask in the PRM_VC_CMD_RA register 75 * @smps_cmdra_mask: CMDRA* bitmask in the PRM_VC_CMD_RA register
84 * @cmdval_reg: register for on/ret/off voltage level values for this channel 76 * @cmdval_reg: register for on/ret/off voltage level values for this channel
77 * @smps_sa_reg: Offset of PRM_VC_SMPS_SA reg from PRM start
78 * @smps_volra_reg: Offset of PRM_VC_SMPS_VOL_RA reg from PRM start
79 * @smps_cmdra_reg: Offset of PRM_VC_SMPS_CMD_RA reg from PRM start
80 * @cfg_channel_reg: VC channel configuration register
85 * @cfg_channel_sa_shift: bit shift for slave address cfg_channel register 81 * @cfg_channel_sa_shift: bit shift for slave address cfg_channel register
86 * @flags: VC channel-specific flags (optional) 82 * @flags: VC channel-specific flags (optional)
87 */ 83 */
@@ -100,6 +96,10 @@ struct omap_vc_channel {
100 u32 smps_volra_mask; 96 u32 smps_volra_mask;
101 u32 smps_cmdra_mask; 97 u32 smps_cmdra_mask;
102 u8 cmdval_reg; 98 u8 cmdval_reg;
99 u8 smps_sa_reg;
100 u8 smps_volra_reg;
101 u8 smps_cmdra_reg;
102 u8 cfg_channel_reg;
103 u8 cfg_channel_sa_shift; 103 u8 cfg_channel_sa_shift;
104 u8 flags; 104 u8 flags;
105}; 105};
diff --git a/arch/arm/mach-omap2/vc3xxx_data.c b/arch/arm/mach-omap2/vc3xxx_data.c
index 95d7701300cb..cfe348e1af0e 100644
--- a/arch/arm/mach-omap2/vc3xxx_data.c
+++ b/arch/arm/mach-omap2/vc3xxx_data.c
@@ -30,9 +30,6 @@
30 * XXX This stuff presumably belongs in the vc3xxx.c or vc.c file. 30 * XXX This stuff presumably belongs in the vc3xxx.c or vc.c file.
31 */ 31 */
32static struct omap_vc_common omap3_vc_common = { 32static struct omap_vc_common omap3_vc_common = {
33 .smps_sa_reg = OMAP3_PRM_VC_SMPS_SA_OFFSET,
34 .smps_volra_reg = OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET,
35 .smps_cmdra_reg = OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET,
36 .bypass_val_reg = OMAP3_PRM_VC_BYPASS_VAL_OFFSET, 33 .bypass_val_reg = OMAP3_PRM_VC_BYPASS_VAL_OFFSET,
37 .data_shift = OMAP3430_DATA_SHIFT, 34 .data_shift = OMAP3430_DATA_SHIFT,
38 .slaveaddr_shift = OMAP3430_SLAVEADDR_SHIFT, 35 .slaveaddr_shift = OMAP3430_SLAVEADDR_SHIFT,
@@ -43,7 +40,6 @@ static struct omap_vc_common omap3_vc_common = {
43 .cmd_onlp_shift = OMAP3430_VC_CMD_ONLP_SHIFT, 40 .cmd_onlp_shift = OMAP3430_VC_CMD_ONLP_SHIFT,
44 .cmd_ret_shift = OMAP3430_VC_CMD_RET_SHIFT, 41 .cmd_ret_shift = OMAP3430_VC_CMD_RET_SHIFT,
45 .cmd_off_shift = OMAP3430_VC_CMD_OFF_SHIFT, 42 .cmd_off_shift = OMAP3430_VC_CMD_OFF_SHIFT,
46 .cfg_channel_reg = OMAP3_PRM_VC_CH_CONF_OFFSET,
47 .i2c_cfg_hsen_mask = OMAP3430_HSEN_MASK, 43 .i2c_cfg_hsen_mask = OMAP3430_HSEN_MASK,
48 .i2c_cfg_reg = OMAP3_PRM_VC_I2C_CFG_OFFSET, 44 .i2c_cfg_reg = OMAP3_PRM_VC_I2C_CFG_OFFSET,
49 .i2c_mcode_mask = OMAP3430_MCODE_MASK, 45 .i2c_mcode_mask = OMAP3430_MCODE_MASK,
@@ -51,6 +47,10 @@ static struct omap_vc_common omap3_vc_common = {
51 47
52struct omap_vc_channel omap3_vc_mpu = { 48struct omap_vc_channel omap3_vc_mpu = {
53 .common = &omap3_vc_common, 49 .common = &omap3_vc_common,
50 .smps_sa_reg = OMAP3_PRM_VC_SMPS_SA_OFFSET,
51 .smps_volra_reg = OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET,
52 .smps_cmdra_reg = OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET,
53 .cfg_channel_reg = OMAP3_PRM_VC_CH_CONF_OFFSET,
54 .cmdval_reg = OMAP3_PRM_VC_CMD_VAL_0_OFFSET, 54 .cmdval_reg = OMAP3_PRM_VC_CMD_VAL_0_OFFSET,
55 .smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA0_MASK, 55 .smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA0_MASK,
56 .smps_volra_mask = OMAP3430_VOLRA0_MASK, 56 .smps_volra_mask = OMAP3430_VOLRA0_MASK,
@@ -60,6 +60,10 @@ struct omap_vc_channel omap3_vc_mpu = {
60 60
61struct omap_vc_channel omap3_vc_core = { 61struct omap_vc_channel omap3_vc_core = {
62 .common = &omap3_vc_common, 62 .common = &omap3_vc_common,
63 .smps_sa_reg = OMAP3_PRM_VC_SMPS_SA_OFFSET,
64 .smps_volra_reg = OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET,
65 .smps_cmdra_reg = OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET,
66 .cfg_channel_reg = OMAP3_PRM_VC_CH_CONF_OFFSET,
63 .cmdval_reg = OMAP3_PRM_VC_CMD_VAL_1_OFFSET, 67 .cmdval_reg = OMAP3_PRM_VC_CMD_VAL_1_OFFSET,
64 .smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA1_MASK, 68 .smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA1_MASK,
65 .smps_volra_mask = OMAP3430_VOLRA1_MASK, 69 .smps_volra_mask = OMAP3430_VOLRA1_MASK,
diff --git a/arch/arm/mach-omap2/vc44xx_data.c b/arch/arm/mach-omap2/vc44xx_data.c
index 0a4fc37877cc..2740a968145e 100644
--- a/arch/arm/mach-omap2/vc44xx_data.c
+++ b/arch/arm/mach-omap2/vc44xx_data.c
@@ -31,9 +31,6 @@
31 * XXX This stuff presumably belongs in the vc3xxx.c or vc.c file. 31 * XXX This stuff presumably belongs in the vc3xxx.c or vc.c file.
32 */ 32 */
33static const struct omap_vc_common omap4_vc_common = { 33static const struct omap_vc_common omap4_vc_common = {
34 .smps_sa_reg = OMAP4_PRM_VC_SMPS_SA_OFFSET,
35 .smps_volra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET,
36 .smps_cmdra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_CMD_OFFSET,
37 .bypass_val_reg = OMAP4_PRM_VC_VAL_BYPASS_OFFSET, 34 .bypass_val_reg = OMAP4_PRM_VC_VAL_BYPASS_OFFSET,
38 .data_shift = OMAP4430_DATA_SHIFT, 35 .data_shift = OMAP4430_DATA_SHIFT,
39 .slaveaddr_shift = OMAP4430_SLAVEADDR_SHIFT, 36 .slaveaddr_shift = OMAP4430_SLAVEADDR_SHIFT,
@@ -44,7 +41,6 @@ static const struct omap_vc_common omap4_vc_common = {
44 .cmd_onlp_shift = OMAP4430_ONLP_SHIFT, 41 .cmd_onlp_shift = OMAP4430_ONLP_SHIFT,
45 .cmd_ret_shift = OMAP4430_RET_SHIFT, 42 .cmd_ret_shift = OMAP4430_RET_SHIFT,
46 .cmd_off_shift = OMAP4430_OFF_SHIFT, 43 .cmd_off_shift = OMAP4430_OFF_SHIFT,
47 .cfg_channel_reg = OMAP4_PRM_VC_CFG_CHANNEL_OFFSET,
48 .i2c_cfg_reg = OMAP4_PRM_VC_CFG_I2C_MODE_OFFSET, 44 .i2c_cfg_reg = OMAP4_PRM_VC_CFG_I2C_MODE_OFFSET,
49 .i2c_cfg_hsen_mask = OMAP4430_HSMODEEN_MASK, 45 .i2c_cfg_hsen_mask = OMAP4430_HSMODEEN_MASK,
50 .i2c_mcode_mask = OMAP4430_HSMCODE_MASK, 46 .i2c_mcode_mask = OMAP4430_HSMCODE_MASK,
@@ -54,6 +50,10 @@ static const struct omap_vc_common omap4_vc_common = {
54struct omap_vc_channel omap4_vc_mpu = { 50struct omap_vc_channel omap4_vc_mpu = {
55 .flags = OMAP_VC_CHANNEL_DEFAULT | OMAP_VC_CHANNEL_CFG_MUTANT, 51 .flags = OMAP_VC_CHANNEL_DEFAULT | OMAP_VC_CHANNEL_CFG_MUTANT,
56 .common = &omap4_vc_common, 52 .common = &omap4_vc_common,
53 .smps_sa_reg = OMAP4_PRM_VC_SMPS_SA_OFFSET,
54 .smps_volra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET,
55 .smps_cmdra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_CMD_OFFSET,
56 .cfg_channel_reg = OMAP4_PRM_VC_CFG_CHANNEL_OFFSET,
57 .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_MPU_L_OFFSET, 57 .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_MPU_L_OFFSET,
58 .smps_sa_mask = OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_MASK, 58 .smps_sa_mask = OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_MASK,
59 .smps_volra_mask = OMAP4430_VOLRA_VDD_MPU_L_MASK, 59 .smps_volra_mask = OMAP4430_VOLRA_VDD_MPU_L_MASK,
@@ -63,6 +63,10 @@ struct omap_vc_channel omap4_vc_mpu = {
63 63
64struct omap_vc_channel omap4_vc_iva = { 64struct omap_vc_channel omap4_vc_iva = {
65 .common = &omap4_vc_common, 65 .common = &omap4_vc_common,
66 .smps_sa_reg = OMAP4_PRM_VC_SMPS_SA_OFFSET,
67 .smps_volra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET,
68 .smps_cmdra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_CMD_OFFSET,
69 .cfg_channel_reg = OMAP4_PRM_VC_CFG_CHANNEL_OFFSET,
66 .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_IVA_L_OFFSET, 70 .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_IVA_L_OFFSET,
67 .smps_sa_mask = OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_MASK, 71 .smps_sa_mask = OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_MASK,
68 .smps_volra_mask = OMAP4430_VOLRA_VDD_IVA_L_MASK, 72 .smps_volra_mask = OMAP4430_VOLRA_VDD_IVA_L_MASK,
@@ -72,6 +76,10 @@ struct omap_vc_channel omap4_vc_iva = {
72 76
73struct omap_vc_channel omap4_vc_core = { 77struct omap_vc_channel omap4_vc_core = {
74 .common = &omap4_vc_common, 78 .common = &omap4_vc_common,
79 .smps_sa_reg = OMAP4_PRM_VC_SMPS_SA_OFFSET,
80 .smps_volra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET,
81 .smps_cmdra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_CMD_OFFSET,
82 .cfg_channel_reg = OMAP4_PRM_VC_CFG_CHANNEL_OFFSET,
75 .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_CORE_L_OFFSET, 83 .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_CORE_L_OFFSET,
76 .smps_sa_mask = OMAP4430_SA_VDD_CORE_L_0_6_MASK, 84 .smps_sa_mask = OMAP4430_SA_VDD_CORE_L_0_6_MASK,
77 .smps_volra_mask = OMAP4430_VOLRA_VDD_CORE_L_MASK, 85 .smps_volra_mask = OMAP4430_VOLRA_VDD_CORE_L_MASK,