ARM: keystone2: Miscellaneous fixes
Nishanth Menon
maintainercover ARM: keystone2: Miscellaneous fixes
Hi,
Please find various fixes for DDR, DSP and speed grade operations w.r.t Keystone devices
Based on master 52dd704bf8ed Merge branch 'master' of http://git.denx.de/u-boot-sunxi
Lokesh Vutla (2):
ARM: keystone2: Allow for board specific speed definitions
ARM: keystone2: K2G: Add support for different arm/device speeds
Suman Anna (2):
ARM: keystone2: Use macro for DSP GEM power domain
ARM: keystone2: K2G: power-off DSP during boot
Vitaly Andrianov (2):
ARM: keystone2: use SPD info to configure K2HK and K2E DDR3
ARM: keystone2: use detected ddr3a size
arch/arm/mach-keystone/Makefile | 2 + arch/arm/mach-keystone/clock.c | 19 +- arch/arm/mach-keystone/ddr3_spd.c | 466 +++++++++++++++++++++ arch/arm/mach-keystone/include/mach/clock-k2g.h | 4 +- arch/arm/mach-keystone/include/mach/clock.h | 8 +- arch/arm/mach-keystone/include/mach/ddr3.h | 9 + arch/arm/mach-keystone/include/mach/hardware-k2g.h | 7 +- arch/arm/mach-keystone/include/mach/hardware-k2l.h | 7 + arch/arm/mach-keystone/include/mach/hardware.h | 1 + arch/arm/mach-keystone/keystone.c | 2 +- board/ti/ks2_evm/Makefile | 4 +- board/ti/ks2_evm/board.c | 4 +- board/ti/ks2_evm/board_k2e.c | 2 +- board/ti/ks2_evm/board_k2g.c | 50 ++- board/ti/ks2_evm/board_k2hk.c | 4 +- board/ti/ks2_evm/board_k2l.c | 4 +- board/ti/ks2_evm/ddr3_cfg.c | 159 +------ board/ti/ks2_evm/ddr3_cfg.h | 11 +- board/ti/ks2_evm/ddr3_k2e.c | 51 +-- board/ti/ks2_evm/ddr3_k2hk.c | 97 ++--- include/configs/k2e_evm.h | 2 + include/configs/k2hk_evm.h | 2 + 22 files changed, 628 insertions(+), 287 deletions(-) create mode 100644 arch/arm/mach-keystone/ddr3_spd.c
Signature · 1 line
2.7.0
Nishanth Menon
maintainerPATCH 1/6 ARM: keystone2: Use macro for DSP GEM power domain
From: Suman Anna <[email protected]>
Define a macro for the DSP GEM power domain id number and use it instead of a hard-coded number in the code that disables all the DSPs on various Keystone2 SoCs.
--- arch/arm/mach-keystone/include/mach/hardware.h | 1 + arch/arm/mach-keystone/keystone.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-keystone/include/mach/hardware.h +1 -0
@@ -160,6 +160,7 @@ typedef volatile unsigned int *dv_reg_p;#define KS2_LPSC_GEM_0 15#define KS2_LPSC_TETRIS 52#define KS2_TETRIS_PWR_DOMAIN 31 +#define KS2_GEM_0_PWR_DOMAIN 8/* Chip configuration unlock codes and registers */ #define KS2_KICK0 (KS2_DEVICE_STATE_CTRL_BASE + 0x38)
arch/arm/mach-keystone/keystone.c +1 -1
@@ -54,7 +54,7 @@ static void turn_off_all_dsps(int num_dsps)if (psc_disable_module (i +KS2_LPSC_GEM_0 ))printf ("Cannot disable module for #%d DSP" , i); -if (psc_disable_domain (i +8 )) +if (psc_disable_domain (i +KS2_GEM_0_PWR_DOMAIN ))printf ("Cannot disable domain for #%d DSP" , i); } }
Signature · 1 line
2.7.0
PATCH 1/6 ARM: keystone2: Use macro for DSP GEM power domain
Quoted 8 lines · Nishanth Menon
From: Suman Anna <[email protected]>
Define a macro for the DSP GEM power domain id number and use it instead of a hard-coded number in the code that disables all the DSPs on various Keystone2 SoCs.
Signed-off-by Suman Anna <[email protected]>Signed-off-by Nishanth Menon <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160226/4928e9da/attachment.sig>
Nishanth Menon
maintainerPATCH 2/6 ARM: keystone2: K2G: power-off DSP during boot
In reply to Nishanth MenonFrom: Suman Anna <[email protected]>
The DSPs are powered on by default upon a Power ON reset, and they are powered off on current Keystone 2 SoCs - K2HK, K2L, K2E during the boot in u-boot. This is not functional on K2G though. Extend the existing DSP power-off support to the only DSP present on K2G. Do note that the PSC clock domain module id for DSP on K2G differs from that of previous Keystone2 SoCs.
--- arch/arm/mach-keystone/include/mach/hardware-k2g.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
arch/arm/mach-keystone/include/mach/hardware-k2g.h +5 -2
@@ -10,7 +10,7 @@#ifndef __ASM_ARCH_HARDWARE_K2G_H#define __ASM_ARCH_HARDWARE_K2G_H -#define KS2_NUM_DSPS 0 +#define KS2_NUM_DSPS 1/* Power and Sleep Controller (PSC) Domains */ #define KS2_LPSC_ALWAYSON 0
@@ -30,7 +30,10 @@#define KS2_LPSC_MCASP 15#define KS2_LPSC_SR 16#define KS2_LPSC_MSMC 17 -#define KS2_LPSC_GEM 18 +#ifdef KS2_LPSC_GEM_0 +#undef KS2_LPSC_GEM_0 +#endif +#define KS2_LPSC_GEM_0 18#define KS2_LPSC_ARM 19#define KS2_LPSC_ASRC 20#define KS2_LPSC_ICSS 21
Signature · 1 line
2.7.0
PATCH 2/6 ARM: keystone2: K2G: power-off DSP during boot
Quoted 11 lines · Nishanth Menon
From: Suman Anna <[email protected]>
The DSPs are powered on by default upon a Power ON reset, and they are powered off on current Keystone 2 SoCs - K2HK, K2L, K2E during the boot in u-boot. This is not functional on K2G though. Extend the existing DSP power-off support to the only DSP present on K2G. Do note that the PSC clock domain module id for DSP on K2G differs from that of previous Keystone2 SoCs.
Signed-off-by Suman Anna <[email protected]>Signed-off-by Nishanth Menon <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160226/0efbf414/attachment.sig>
Nishanth Menon
maintainerPATCH 3/6 ARM: keystone2: Allow for board specific speed definitions
In reply to Nishanth MenonFrom: Lokesh Vutla <[email protected]>
Its not compulsory that speed definition should be same on EFUSE_BOOTROM register for all keystone 2 devices. So, allow for board specific speed definitions.
--- arch/arm/mach-keystone/clock.c | 12 ++++++------ arch/arm/mach-keystone/include/mach/clock.h | 4 ++-- board/ti/ks2_evm/board_k2e.c | 2 +- board/ti/ks2_evm/board_k2hk.c | 4 ++-- board/ti/ks2_evm/board_k2l.c | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-)
arch/arm/mach-keystone/clock.c +6 -6
@@ -228,14 +228,14 @@ void init_plls(void) } } -static int get_max_speed (u32 val,u32 speed_supported) +static int get_max_speed (u32 val,u32 speed_supported,int *spds) {int speed;/* Left most setbit gives the speed */ for (speed =DEVSPEED_NUMSPDS ; speed >=0 ; speed--) {if ((val &BIT (speed)) & speed_supported) -return speeds[speed]; +return spds[speed]; }/* If no bit is set, use SPD800 */
@@ -250,24 +250,24 @@ static inline u32 read_efuse_bootrom(void)return __raw_readl (KS2_EFUSE_BOOTROM ); } -int get_max_arm_speed (void ) +int get_max_arm_speed (int *spds) {u32 armspeed =read_efuse_bootrom (); armspeed = (armspeed &DEVSPEED_ARMSPEED_MASK ) >>DEVSPEED_ARMSPEED_SHIFT ; -return get_max_speed (armspeed,ARM_SUPPORTED_SPEEDS ); +return get_max_speed (armspeed,ARM_SUPPORTED_SPEEDS , spds); } -int get_max_dev_speed (void ) +int get_max_dev_speed (int *spds) {u32 devspeed =read_efuse_bootrom (); devspeed = (devspeed &DEVSPEED_DEVSPEED_MASK ) >>DEVSPEED_DEVSPEED_SHIFT ; -return get_max_speed (devspeed,DEV_SUPPORTED_SPEEDS ); +return get_max_speed (devspeed,DEV_SUPPORTED_SPEEDS , spds); }/**
arch/arm/mach-keystone/include/mach/clock.h +2 -2
@@ -124,8 +124,8 @@ struct pll_init_data *get_pll_init_data(int pll);unsigned long clk_get_rate (unsigned int clk);unsigned long clk_round_rate (unsigned int clk,unsigned long hz);int clk_set_rate (unsigned int clk,unsigned long hz); -int get_max_dev_speed (void ); -int get_max_arm_speed (void ); +int get_max_dev_speed (int *spds); +int get_max_arm_speed (int *spds);void pll_pa_clk_sel (void );#endif
board/ti/ks2_evm/board_k2e.c +1 -1
@@ -61,7 +61,7 @@ struct pll_init_data *get_pll_init_data(int pll)switch (pll) {case MAIN_PLL : - speed =get_max_dev_speed (); + speed =get_max_dev_speed (speeds); data = &core_pll_config[speed];break ;case PASS_PLL :
board/ti/ks2_evm/board_k2hk.c +2 -2
@@ -51,11 +51,11 @@ struct pll_init_data *get_pll_init_data(int pll)switch (pll) {case MAIN_PLL : - speed =get_max_dev_speed (); + speed =get_max_dev_speed (speeds); data = &core_pll_config[speed];break ;case TETRIS_PLL : - speed =get_max_arm_speed (); + speed =get_max_arm_speed (speeds); data = &tetris_pll_config[speed];break ;case PASS_PLL :
board/ti/ks2_evm/board_k2l.c +2 -2
@@ -50,11 +50,11 @@ struct pll_init_data *get_pll_init_data(int pll)switch (pll) {case MAIN_PLL : - speed =get_max_dev_speed (); + speed =get_max_dev_speed (speeds); data = &core_pll_config[speed];break ;case TETRIS_PLL : - speed =get_max_arm_speed (); + speed =get_max_arm_speed (speeds); data = &tetris_pll_config[speed];break ;case PASS_PLL :
Signature · 1 line
2.7.0
PATCH 3/6 ARM: keystone2: Allow for board specific speed definitions
Quoted 8 lines · Nishanth Menon
From: Lokesh Vutla <[email protected]>
Its not compulsory that speed definition should be same on
EFUSE_BOOTROMregister for all keystone 2 devices. So, allow for board specific speed definitions.Signed-off-by Lokesh Vutla <[email protected]>Signed-off-by Nishanth Menon <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160226/35b0b3b1/attachment.sig>
Nishanth Menon
maintainerPATCH 4/6 ARM: keystone2: K2G: Add support for different arm/device speeds
In reply to Nishanth MenonFrom: Lokesh Vutla <[email protected]>
The maximum device and arm speeds can be determined by reading EFUSE_BOOTROM register. As there is already a framework for reading this register, adding support for all possible speeds on k2g devices.
--- arch/arm/mach-keystone/clock.c | 7 +++- arch/arm/mach-keystone/include/mach/clock-k2g.h | 4 +- arch/arm/mach-keystone/include/mach/clock.h | 4 ++ board/ti/ks2_evm/board_k2g.c | 50 +++++++++++++++++++++++-- 4 files changed, 57 insertions(+), 8 deletions(-)
arch/arm/mach-keystone/clock.c +5 -2
@@ -238,8 +238,11 @@ static int get_max_speed(u32 val, u32 speed_supported, int *spds)return spds[speed]; } -/* If no bit is set, use SPD800 */ -return SPD800 ; +/* If no bit is set, return minimum speed */ +if (cpu_is_k2g ()) +return SPD200 ; +else +return SPD800 ; }static inline u32 read_efuse_bootrom (void )
arch/arm/mach-keystone/include/mach/clock-k2g.h +2 -2
@@ -12,8 +12,8 @@#define PLLSET_CMD_LIST "<pa|arm|ddr3>" -#define DEV_SUPPORTED_SPEEDS 0xfff -#define ARM_SUPPORTED_SPEEDS 0xfff +#define DEV_SUPPORTED_SPEEDS 0x1ff +#define ARM_SUPPORTED_SPEEDS 0xff#define KS2_CLK1_6 sys_clk0_6_clk
arch/arm/mach-keystone/include/mach/clock.h +4 -0
@@ -63,8 +63,12 @@#define CLOCK_INDEXES_LIST CLK_LIST(GENERATE_INDX_STR)enum { +SPD200 , +SPD400 , +SPD600 ,SPD800 ,SPD850 , +SPD900 ,SPD1000 ,SPD1200 ,SPD1250 ,
board/ti/ks2_evm/board_k2g.c +46 -4
68 lines not on this page · raw message
Signature · 1 line
2.7.0
PATCH 4/6 ARM: keystone2: K2G: Add support for different arm/device speeds
Quoted 8 lines · Nishanth Menon
From: Lokesh Vutla <[email protected]>
The maximum device and arm speeds can be determined by reading
EFUSE_BOOTROMregister. As there is already a framework for reading this register, adding support for all possible speeds on k2g devices.Signed-off-by Lokesh Vutla <[email protected]>Signed-off-by Nishanth Menon <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160226/fec49a5a/attachment.sig>
Nishanth Menon
maintainerPATCH 5/6 ARM: keystone2: use SPD info to configure K2HK and K2E DDR3
In reply to Nishanth MenonFrom: Vitaly Andrianov <[email protected]>
This commit replaces hard-coded EMIF and PHY DDR3 configurations for predefined SODIMMs to a calculated configuration. The SODIMM parameters are read from SODIMM's SPD and used to calculated the configuration.
The current commit supports calculation for DDR3 with 1600MHz and 1333MHz only.
--- arch/arm/mach-keystone/Makefile | 2 + arch/arm/mach-keystone/ddr3_spd.c | 456 +++++++++++++++++++++++++++++ arch/arm/mach-keystone/include/mach/ddr3.h | 8 + board/ti/ks2_evm/Makefile | 4 +- board/ti/ks2_evm/ddr3_cfg.c | 159 +--------- board/ti/ks2_evm/ddr3_cfg.h | 11 +- board/ti/ks2_evm/ddr3_k2e.c | 51 ++-- board/ti/ks2_evm/ddr3_k2hk.c | 97 +++--- include/configs/k2e_evm.h | 2 + include/configs/k2hk_evm.h | 2 + 10 files changed, 532 insertions(+), 260 deletions(-) create mode 100644 arch/arm/mach-keystone/ddr3_spd.c
arch/arm/mach-keystone/Makefile +2 -0
@@ -13,3 +13,5 @@ obj-y += cmd_mon.o obj-y += msmc.o obj-y += ddr3.o cmd_ddr3.o obj-y += keystone.o +obj-$(CONFIG_K2E_EVM) += ddr3_spd.o +obj-$(CONFIG_K2HK_EVM) += ddr3_spd.o
arch/arm/mach-keystone/ddr3_spd.c new file +456 -0
456 lines not on this page · raw message
arch/arm/mach-keystone/include/mach/ddr3.h +8 -0
@@ -48,6 +48,14 @@ struct ddr3_emif_config {unsigned int sdrfc; }; +struct ddr3_spd_cb { +char dimm_name[32 ]; +struct ddr3_phy_config phy_cfg; +struct ddr3_emif_config emif_cfg; +unsigned int ddrspdclock; +int ddr_size_gbyte; +}; +u32 ddr3_init (void );void ddr3_reset_ddrphy (void );void ddr3_init_ecc (u32 base,u32 ddr3_size);
board/ti/ks2_evm/Makefile +2 -2
@@ -1,17 +1,17 @@ # # KS2-EVM: board Makefile -# (C) Copyright 2012-2014 +# (C) Copyright 2012-2015 # Texas Instruments Incorporated, <www.ti.com> # SPDX-License-Identifier: GPL-2.0+ # obj-y += board.o -obj-y += ddr3_cfg.o obj-$(CONFIG_K2HK_EVM) += board_k2hk.o obj-$(CONFIG_K2HK_EVM) += ddr3_k2hk.o obj-$(CONFIG_K2E_EVM) += board_k2e.o obj-$(CONFIG_K2E_EVM) += ddr3_k2e.o obj-$(CONFIG_K2L_EVM) += board_k2l.o obj-$(CONFIG_K2L_EVM) += ddr3_k2l.o +obj-$(CONFIG_K2L_EVM) += ddr3_cfg.o obj-$(CONFIG_K2G_EVM) += board_k2g.o obj-$(CONFIG_K2G_EVM) += ddr3_k2g.o
board/ti/ks2_evm/ddr3_cfg.c +1 -158
169 lines not on this page · raw message
board/ti/ks2_evm/ddr3_cfg.h +2 -9
@@ -10,18 +10,11 @@#ifndef __DDR3_CFG_H#define __DDR3_CFG_H -extern struct ddr3_phy_config ddr3phy_1600_8g; -extern struct ddr3_emif_config ddr3_1600_8g; - -extern struct ddr3_phy_config ddr3phy_1333_2g; -extern struct ddr3_emif_config ddr3_1333_2g; - -extern struct ddr3_phy_config ddr3phy_1600_4g; -extern struct ddr3_emif_config ddr3_1600_4g; +#include <asm/arch/ddr3.h> extern struct ddr3_phy_config ddr3phy_1600_2g;extern struct ddr3_emif_config ddr3_1600_2g; -int ddr3_get_dimm_params (char *dimm_name); +int ddr3_get_dimm_params_from_spd (struct ddr3_spd_cb *spd_cb);#endif /* __DDR3_CFG_H */
board/ti/ks2_evm/ddr3_k2e.c +23 -28
72 lines not on this page · raw message
board/ti/ks2_evm/ddr3_k2hk.c +34 -63
111 lines not on this page · raw message
include/configs/k2e_evm.h +2 -0
@@ -38,4 +38,6 @@#define CONFIG_KSNET_CPSW_NUM_PORTS 9#define CONFIG_KSNET_MDIO_PHY_CONFIG_ENABLE +#define CONFIG_DDR_SPD +#endif /* __CONFIG_K2E_EVM_H */
include/configs/k2hk_evm.h +2 -0
@@ -37,4 +37,6 @@#define CONFIG_KSNET_NETCP_V1_0 #define CONFIG_KSNET_CPSW_NUM_PORTS 5 +#define CONFIG_DDR_SPD +#endif /* __CONFIG_K2HK_EVM_H */
Signature · 1 line
2.7.0
PATCH 5/6 ARM: keystone2: use SPD info to configure K2HK and K2E DDR3
Quoted 12 lines · Nishanth Menon
From: Vitaly Andrianov <[email protected]>
This commit replaces hard-coded EMIF and PHY DDR3 configurations for predefined SODIMMs to a calculated configuration. The SODIMM parameters are read from SODIMM's SPD and used to calculated the configuration.
The current commit supports calculation for DDR3 with 1600MHz and 1333MHz only.
Signed-off-by Vitaly Andrianov <[email protected]>Signed-off-by Lokesh Vutla <[email protected]>Signed-off-by Nishanth Menon <[email protected]>
[snip]
arch/arm/mach-keystone/ddr3_spd.c line 18
Quoted 2 lines
arch/arm/mach-keystone/ddr3_spd.c new file +2
-0+#ifdef DUMP_DDR_CONFIG +static void dump_phy_config (struct ddr3_phy_config *ptr)
Please figure out how to do this with debug() instead.
[snip]
arch/arm/mach-keystone/ddr3_spd.c line 193
Quoted 1 line
arch/arm/mach-keystone/ddr3_spd.c new file +1
-0+puts ("DDR3A Speed will be configured for 1333 Operation.\n" );
Just printf, always, it's fine, really.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160226/e4d71068/attachment.sig>
Nishanth Menon
maintainerPATCH 5/6 ARM: keystone2: use SPD info to configure K2HK and K2E DDR3
Quoted 20 lines · Tom Rini
Quoted 12 lines · Nishanth Menon
From: Vitaly Andrianov <[email protected]>
This commit replaces hard-coded EMIF and PHY DDR3 configurations for predefined SODIMMs to a calculated configuration. The SODIMM parameters are read from SODIMM's SPD and used to calculated the configuration.
The current commit supports calculation for DDR3 with 1600MHz and 1333MHz only.
Signed-off-by Vitaly Andrianov <[email protected]>Signed-off-by Lokesh Vutla <[email protected]>Signed-off-by Nishanth Menon <[email protected]>[snip]
arch/arm/mach-keystone/ddr3_spd.c line 18
Quoted 2 lines
arch/arm/mach-keystone/ddr3_spd.c new file +2
-0+#ifdef DUMP_DDR_CONFIG +static void dump_phy_config (struct ddr3_phy_config *ptr)Please figure out how to do this with
debug()instead.
Quoted 5 lines
[snip]
Quoted 1 line
+
puts("DDR3A Speed will be configured for 1333 Operation.\n");Just printf, always, it's fine, really.
Thank you for the review. Will try to do that and repost.
Signature · 3 lines
--- Regards, Nishanth Menon
Nishanth Menon
maintainerPATCH 6/6 ARM: keystone2: use detected ddr3a size
In reply to Nishanth MenonFrom: Vitaly Andrianov <[email protected]>
Because KS2 u-boot works in 32 bit address space the existing ram_size global data field cannot be used. The maximum, which the get_ram_size() can detect is 2GB only. The ft_board_setup() needs the actual ddr3 size to fix up dtb.
This commit introduces the ddr3_get_size() which uses SPD data to calculate the ddr3 size. This function replaces the "ddr3_size" environment variable, which was used to get the SODIMM size.
For platforms, which don't have SODIMM with SPD and ddr3 is populated to a board a simple ddr3_get_size function that returns ddr3 size has to be implemented. See hardware-k2l.h
--- arch/arm/mach-keystone/ddr3_spd.c | 10 ++++++++++ arch/arm/mach-keystone/include/mach/ddr3.h | 1 + arch/arm/mach-keystone/include/mach/hardware-k2l.h | 7 +++++++ board/ti/ks2_evm/board.c | 4 +--- 4 files changed, 19 insertions(+), 3 deletions(-)
arch/arm/mach-keystone/ddr3_spd.c +10 -0
@@ -427,6 +427,16 @@ static int ddr3_read_spd(ddr3_spd_eeprom_t *spd_params)return 0 ; } +int ddr3_get_size (void ) +{ +ddr3_spd_eeprom_t spd_params; + +if (ddr3_read_spd (&spd_params)) +return 0 ; + +return ddr3_get_size_in_mb (&spd_params) /1024 ; +} +int ddr3_get_dimm_params_from_spd (struct ddr3_spd_cb *spd_cb) {struct ddr3_sodimm spd;
arch/arm/mach-keystone/include/mach/ddr3.h +1 -0
@@ -66,5 +66,6 @@ void ddr3_err_reset_workaround(void);void ddr3_enable_ecc (u32 base,int test);void ddr3_init_ddrphy (u32 base,struct ddr3_phy_config *phy_cfg);void ddr3_init_ddremif (u32 base,struct ddr3_emif_config *emif_cfg); +int ddr3_get_size (void );#endif
arch/arm/mach-keystone/include/mach/hardware-k2l.h +7 -0
@@ -105,4 +105,11 @@/* NETCP */ #define KS2_NETCP_BASE 0x26000000 +#ifndef __ASSEMBLY__ +static inline int ddr3_get_size (void ) +{ +return 2 ; +} +#endif +#endif /* __ASM_ARCH_HARDWARE_K2L_H */
board/ti/ks2_evm/board.c +1 -3
@@ -146,9 +146,7 @@ int ft_board_setup(void *blob, bd_t *bd) ddr3a_size =0 ;if (lpae) { - env =getenv ("ddr3a_size" ); -if (env) - ddr3a_size =simple_strtol (env,NULL ,10 ); + ddr3a_size =ddr3_get_size ();if ((ddr3a_size !=8 ) && (ddr3a_size !=4 )) ddr3a_size =0 ; }
Signature · 1 line
2.7.0
PATCH 6/6 ARM: keystone2: use detected ddr3a size
Quoted 11 lines · Nishanth Menon
From: Vitaly Andrianov <[email protected]>
Because KS2 u-boot works in 32 bit address space the existing
ram_sizeglobal data field cannot be used. The maximum, which theget_ram_size()can detect is 2GB only. Theft_board_setup()needs the actual ddr3 size to fix up dtb.This commit introduces the
ddr3_get_size()which uses SPD data to calculate the ddr3 size. This function replaces the "ddr3_size" environment variable, which was used to get the SODIMM size.
Quoted 6 lines
For platforms, which don't have SODIMM with SPD and ddr3 is populated to a board a simple
ddr3_get_sizefunction that returns ddr3 size has to be implemented. Seehardware-k2l.hSigned-off-by Vitaly Andrianov <[email protected]>Signed-off-by Nishanth Menon <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160226/3cf7298e/attachment.sig>