arm: omap: Introduce vcores_init function
cover arm: omap: Introduce vcores_init function
The series Introduces vcores_init function to update am57xx information after the board detection. Fixes assigning wrong value to to omap_vcores over riding the vcores_init function for am572x-idk and does a minor alignment correction.
This series is on top of the series:
http://marc.info/?l=u-boot&m=146402916631764&w=2
Boot tested on beagle-x15, am572x-idk and dra7-evm.
Checked for the correct PMIC voltages using i2c reads on PMIC registers.
Keerthy (3):
arm: omap: Introduce vcores_init function
arm: am57xx: Fix omap_vcores assignment for am572x-idk
arm: am57xx: Fix alignment where necessary
arch/arm/cpu/armv7/omap-common/hwinit-common.c | 11 ++ arch/arm/include/asm/arch-omap5/sys_proto.h | 1 + board/ti/am57xx/board.c | 135 ++++++++++++++++--------- 3 files changed, 101 insertions(+), 46 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/3 arm: omap: Introduce vcores_init function
The pmic registers for variants of am57xx boards are different hence we need to assign them carefully based on the board type. Add a function to assign omap_vcores after the board detection.
--- arch/arm/cpu/armv7/omap-common/hwinit-common.c | 11 +++++++++++ arch/arm/include/asm/arch-omap5/sys_proto.h | 1 + 2 files changed, 12 insertions(+)
arch/arm/cpu/armv7/omap-common/hwinit-common.c +11 -0
@@ -94,6 +94,16 @@ void __weak do_board_detect(void) { } +/** +* vcores_init() - Assign omap_vcores based on board +* +* Function to pick the vcores based on board. This is expected to be +* overridden in the SoC family board file where desired. +*/ +void __weak vcores_init (void ) +{ +} +void s_init (void ) { }
@@ -131,6 +141,7 @@ void early_system_init(void)#endif setup_early_clocks ();do_board_detect (); +vcores_init ();prcm_init (); }
arch/arm/include/asm/arch-omap5/sys_proto.h +1 -0
@@ -51,6 +51,7 @@ void sdelay(unsigned long);void setup_early_clocks (void );void prcm_init (void );void do_board_detect (void ); +void vcores_init (void );void bypass_dpll (u32 const base);void freq_update_core (void );u32 get_sys_clk_freq (void );
Signature · 1 line
1.9.1
PATCH 2/3 arm: am57xx: Fix omap_vcores assignment for am572x-idk
In reply to KeerthyCurrently omap_vcores is wrongly assigned a default value of beagle_x15_volts. Hence populating a new structure for am572x-idk and assigning it to omap_vcores in the vcores_init function.
--- board/ti/am57xx/board.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-)
board/ti/am57xx/board.c +44 -1
@@ -251,6 +251,42 @@ struct vcores_data beagle_x15_volts = { .iva.abb_tx_done_mask = OMAP_ABB_IVA_TXDONE_MASK, }; +struct vcores_data am572x_idk_volts = { + .mpu.value =VDD_MPU_DRA7 , + .mpu.efuse.reg =STD_FUSE_OPP_VMIN_MPU , + .mpu.efuse.reg_bits =DRA752_EFUSE_REGBITS , + .mpu.addr =TPS659038_REG_ADDR_SMPS12 , + .mpu.pmic = &tps659038, + .mpu.abb_tx_done_mask =OMAP_ABB_MPU_TXDONE_MASK , + + .eve.value =VDD_EVE_DRA7 , + .eve.efuse.reg =STD_FUSE_OPP_VMIN_DSPEVE , + .eve.efuse.reg_bits =DRA752_EFUSE_REGBITS , + .eve.addr =TPS659038_REG_ADDR_SMPS45 , + .eve.pmic = &tps659038, + .eve.abb_tx_done_mask =OMAP_ABB_EVE_TXDONE_MASK , + + .gpu.value =VDD_GPU_DRA7 , + .gpu.efuse.reg =STD_FUSE_OPP_VMIN_GPU , + .gpu.efuse.reg_bits =DRA752_EFUSE_REGBITS , + .gpu.addr =TPS659038_REG_ADDR_SMPS6 , + .gpu.pmic = &tps659038, + .gpu.abb_tx_done_mask =OMAP_ABB_GPU_TXDONE_MASK , + + .core.value =VDD_CORE_DRA7 , + .core.efuse.reg =STD_FUSE_OPP_VMIN_CORE , + .core.efuse.reg_bits =DRA752_EFUSE_REGBITS , + .core.addr =TPS659038_REG_ADDR_SMPS7 , + .core.pmic = &tps659038, + + .iva.value =VDD_IVA_DRA7 , + .iva.efuse.reg =STD_FUSE_OPP_VMIN_IVA , + .iva.efuse.reg_bits =DRA752_EFUSE_REGBITS , + .iva.addr =TPS659038_REG_ADDR_SMPS8 , + .iva.pmic = &tps659038, + .iva.abb_tx_done_mask =OMAP_ABB_IVA_TXDONE_MASK , +}; +#ifdef CONFIG_SPL_BUILD /* No env to setup for SPL */ static inline void setup_board_eeprom_env (void ) { }
@@ -315,11 +351,18 @@ invalid_eeprom:#endif /* CONFIG_SPL_BUILD */ +void vcores_init (void ) +{ +if (board_is_am572x_idk ()) + *omap_vcores = &am572x_idk_volts; +else + *omap_vcores = &beagle_x15_volts; +} +void hw_data_init (void ) { *prcm = &dra7xx_prcm; *dplls_data = &dra7xx_dplls; - *omap_vcores = &beagle_x15_volts; *ctrl = &dra7xx_ctrl; }
Signature · 1 line
1.9.1
PATCH 3/3 arm: am57xx: Fix alignment where necessary
In reply to KeerthyThis just fixes alignment for better readability.
--- board/ti/am57xx/board.c | 90 ++++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 45 deletions(-)
board/ti/am57xx/board.c +45 -45
@@ -63,28 +63,28 @@ void emif_get_dmm_regs(const struct dmm_lisa_map_regs **dmm_lisa_regs) }static const struct emif_regs beagle_x15_emif1_ddr3_532mhz_emif_regs = { - .sdram_config_init =0x61851b32 , - .sdram_config =0x61851b32 , - .sdram_config2 =0x08000000 , - .ref_ctrl =0x000040F1 , - .ref_ctrl_final =0x00001035 , - .sdram_tim1 =0xcccf36ab , - .sdram_tim2 =0x308f7fda , - .sdram_tim3 =0x409f88a8 , - .read_idle_ctrl =0x00050000 , - .zq_config =0x5007190b , - .temp_alert_config =0x00000000 , - .emif_ddr_phy_ctlr_1_init =0x0024400b , - .emif_ddr_phy_ctlr_1 =0x0e24400b , - .emif_ddr_ext_phy_ctrl_1 =0x10040100 , - .emif_ddr_ext_phy_ctrl_2 =0x00910091 , - .emif_ddr_ext_phy_ctrl_3 =0x00950095 , - .emif_ddr_ext_phy_ctrl_4 =0x009b009b , - .emif_ddr_ext_phy_ctrl_5 =0x009e009e , - .emif_rd_wr_lvl_rmp_win =0x00000000 , - .emif_rd_wr_lvl_rmp_ctl =0x80000000 , - .emif_rd_wr_lvl_ctl =0x00000000 , - .emif_rd_wr_exec_thresh =0x00000305 + .sdram_config_init =0x61851b32 , + .sdram_config =0x61851b32 , + .sdram_config2 =0x08000000 , + .ref_ctrl =0x000040F1 , + .ref_ctrl_final =0x00001035 , + .sdram_tim1 =0xcccf36ab , + .sdram_tim2 =0x308f7fda , + .sdram_tim3 =0x409f88a8 , + .read_idle_ctrl =0x00050000 , + .zq_config =0x5007190b , + .temp_alert_config =0x00000000 , + .emif_ddr_phy_ctlr_1_init =0x0024400b , + .emif_ddr_phy_ctlr_1 =0x0e24400b , + .emif_ddr_ext_phy_ctrl_1 =0x10040100 , + .emif_ddr_ext_phy_ctrl_2 =0x00910091 , + .emif_ddr_ext_phy_ctrl_3 =0x00950095 , + .emif_ddr_ext_phy_ctrl_4 =0x009b009b , + .emif_ddr_ext_phy_ctrl_5 =0x009e009e , + .emif_rd_wr_lvl_rmp_win =0x00000000 , + .emif_rd_wr_lvl_rmp_ctl =0x80000000 , + .emif_rd_wr_lvl_ctl =0x00000000 , + .emif_rd_wr_exec_thresh =0x00000305 };/* Ext phy ctrl regs 1-35 */
@@ -127,28 +127,28 @@ static const u32 beagle_x15_emif1_ddr3_ext_phy_ctrl_const_regs[] = { };static const struct emif_regs beagle_x15_emif2_ddr3_532mhz_emif_regs = { - .sdram_config_init =0x61851b32 , - .sdram_config =0x61851b32 , - .sdram_config2 =0x08000000 , - .ref_ctrl =0x000040F1 , - .ref_ctrl_final =0x00001035 , - .sdram_tim1 =0xcccf36b3 , - .sdram_tim2 =0x308f7fda , - .sdram_tim3 =0x407f88a8 , - .read_idle_ctrl =0x00050000 , - .zq_config =0x5007190b , - .temp_alert_config =0x00000000 , - .emif_ddr_phy_ctlr_1_init =0x0024400b , - .emif_ddr_phy_ctlr_1 =0x0e24400b , - .emif_ddr_ext_phy_ctrl_1 =0x10040100 , - .emif_ddr_ext_phy_ctrl_2 =0x00910091 , - .emif_ddr_ext_phy_ctrl_3 =0x00950095 , - .emif_ddr_ext_phy_ctrl_4 =0x009b009b , - .emif_ddr_ext_phy_ctrl_5 =0x009e009e , - .emif_rd_wr_lvl_rmp_win =0x00000000 , - .emif_rd_wr_lvl_rmp_ctl =0x80000000 , - .emif_rd_wr_lvl_ctl =0x00000000 , - .emif_rd_wr_exec_thresh =0x00000305 + .sdram_config_init =0x61851b32 , + .sdram_config =0x61851b32 , + .sdram_config2 =0x08000000 , + .ref_ctrl =0x000040F1 , + .ref_ctrl_final =0x00001035 , + .sdram_tim1 =0xcccf36b3 , + .sdram_tim2 =0x308f7fda , + .sdram_tim3 =0x407f88a8 , + .read_idle_ctrl =0x00050000 , + .zq_config =0x5007190b , + .temp_alert_config =0x00000000 , + .emif_ddr_phy_ctlr_1_init =0x0024400b , + .emif_ddr_phy_ctlr_1 =0x0e24400b , + .emif_ddr_ext_phy_ctrl_1 =0x10040100 , + .emif_ddr_ext_phy_ctrl_2 =0x00910091 , + .emif_ddr_ext_phy_ctrl_3 =0x00950095 , + .emif_ddr_ext_phy_ctrl_4 =0x009b009b , + .emif_ddr_ext_phy_ctrl_5 =0x009e009e , + .emif_rd_wr_lvl_rmp_win =0x00000000 , + .emif_rd_wr_lvl_rmp_ctl =0x80000000 , + .emif_rd_wr_lvl_ctl =0x00000000 , + .emif_rd_wr_exec_thresh =0x00000305 };static const u32 beagle_x15_emif2_ddr3_ext_phy_ctrl_const_regs[] = {
@@ -221,7 +221,7 @@ struct vcores_data beagle_x15_volts = { .mpu.efuse.reg_bits = DRA752_EFUSE_REGBITS, .mpu.addr = TPS659038_REG_ADDR_SMPS12, .mpu.pmic = &tps659038, - .mpu.abb_tx_done_mask = OMAP_ABB_MPU_TXDONE_MASK, + .mpu.abb_tx_done_mask = OMAP_ABB_MPU_TXDONE_MASK, .eve.value = VDD_EVE_DRA7, .eve.efuse.reg = STD_FUSE_OPP_VMIN_DSPEVE,
Signature · 1 line
1.9.1
PATCH 1/3 arm: omap: Introduce vcores_init function
In reply to KeerthyQuoted 5 lines · Keerthy
The pmic registers for variants of am57xx boards are different hence we need to assign them carefully based on the board type. Add a function to assign
omap_vcoresafter the board detection.Signed-off-by Keerthy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160603/15e889af/attachment.sig>
PATCH 2/3 arm: am57xx: Fix omap_vcores assignment for am572x-idk
In reply to KeerthyQuoted 7 lines · Keerthy
Currently
omap_vcoresis wrongly assigned a default value ofbeagle_x15_volts. Hence populating a new structure for am572x-idk and assigning it toomap_vcoresin thevcores_initfunction.Fixes c020d355c45ed40fe12a ("board: ti: am57xx: Add support for am572x idk in SPL")Reported-by Suman Anna <[email protected]>Signed-off-by Keerthy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160603/f3382194/attachment.sig>
PATCH 3/3 arm: am57xx: Fix alignment where necessary
In reply to KeerthyQuoted 3 lines · Keerthy
This just fixes alignment for better readability.
Signed-off-by Keerthy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160603/fd77277b/attachment.sig>