Fix SPI read and Enable required configs for Exynos5
Subsystems (2)
v3 cover Fix SPI read and Enable required configs for Exynos5
This patch set intends to -
1. Fix SPI flash reading.
2. Enable saving environment at the end of flash.
3. Increase SPL size.
4. Enable USB booting for all Exynos5 Socs.
Changes since v2:
- Added "Acked-by" & "Tested-by".
- Changed assignment for *rxp in 1/5.
Changes since v1:
- Added check for step in 1/5.
- Added new config for SPI flash size in 2/5.
- Made spl footprint 30 KB instead of 32 in 3/5.
- Added "Acked-by" in 4/5.
- Introduced new patch 5/5.
Akshay Saraswat (4):
Exynos: SPI: Fix reading data from SPI flash
Exynos5: Config: Place environment at the end of SPI flash
Exynos5: Config: Increase SPL footprint for Exynos5420
Exynos5: Config: Enable USB boot mode for all Exynos5 SoCs
Michael Pratt (1):
Exynos: Split 5250 and 5420 memory bank configuration
drivers/spi/exynos_spi.c | 5 +++++ include/configs/exynos5-dt.h | 15 ++++++++++----- include/configs/exynos5250-dt.h | 13 +++++++------ include/configs/exynos5420.h | 6 ++++++ 4 files changed, 28 insertions(+), 11 deletions(-)
Signature · 1 line
1.7.12.4
PATCH v3 1/5 Exynos: SPI: Fix reading data from SPI flash
SPI recieve and transfer code in exynos_spi driver has a logical bug. We read data in a variable which can hold an integer. Then we assign this integer 32 bit value to another variable which has data type uchar. Latter represents a unit of our recieve buffer. Everytime when we write a value to our recieve buffer we step ahead by 4 units when actually we wrote to one unit. This results in the loss of 3 bytes out of every 4 bytes recieved. This patch intends to fix this bug.
---
Changes since v2:
- Added "Acked-by" & "Tested-by".
- Changed assignment for *rxp.
Changes since v1:
- Added check for step.
drivers/spi/exynos_spi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/spi/exynos_spi.c +4 -1
@@ -302,7 +302,10 @@ static int spi_rx_tx(struct exynos_spi_slave *spi_slave, int todo, } }else {if (rxp || stopping) { - *rxp = temp; +if (step ==4 ) + *(uint32_t *)rxp = temp; +else + *rxp = temp; rxp += step; } in_bytes -= step;
Signature · 1 line
1.7.12.4
PATCH v3 2/5 Exynos5: Config: Place environment at the end of SPI flash
In reply to Akshay SaraswatCurrently environment resides at the location where BL2 ends. This may hold good in case there is an empty space at this position. But what if this place already has a binary or is expected to have one. To avoid such scenarios it is better to save environment at the end of the flash.
---
Changes since v2:
- Added "Acked-by" & "Tested-by".
Changes since v1:
- Added new config for SPI flash size.
include/configs/exynos5-dt.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
include/configs/exynos5-dt.h +4 -1
@@ -207,7 +207,10 @@#define CONFIG_BL1_OFFSET (CONFIG_RES_BLOCK_SIZE + CONFIG_SEC_FW_SIZE)#define CONFIG_BL2_OFFSET (CONFIG_BL1_OFFSET + CONFIG_BL1_SIZE) -#define CONFIG_ENV_OFFSET (CONFIG_BL2_OFFSET + CONFIG_BL2_SIZE) + +/* Store environment at the end of a 4 MB SPI flash */ +#define FLASH_SIZE (0x4 << 20) +#define CONFIG_ENV_OFFSET (FLASH_SIZE - CONFIG_BL2_SIZE)/* U-boot copy size from boot Media to DRAM.*/ #define BL2_START_OFFSET (CONFIG_BL2_OFFSET/512)
Signature · 1 line
1.7.12.4
PATCH v3 3/5 Exynos5: Config: Increase SPL footprint for Exynos5420
In reply to Akshay SaraswatMax footprint for SPL in both Exynos 5250 and 5420 is limited to 14 KB. For Exynos5250 we need to keep it 14 KB because BL1 supports only fixed size SPL downloading. But in case of Exynos5420 we need not restrict it to 14 KB. And also, the SPL size for Exynos5420 is expected to increase with the upcoming patches and the patches under review right now.
---
Changes since v2:
- Added "Acked-by" & "Tested-by".
Changes since v1:
- Changed 5420 SPL footprint from 32 to 30 KB.
include/configs/exynos5-dt.h | 2 -- include/configs/exynos5250-dt.h | 2 ++ include/configs/exynos5420.h | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-)
include/configs/exynos5-dt.h +0 -2
@@ -144,8 +144,6 @@/* specific .lds file */ #define CONFIG_SPL_LDSCRIPT "board/samsung/common/exynos-uboot-spl.lds" -#define CONFIG_SPL_MAX_FOOTPRINT (14 * 1024) -/* Miscellaneous configurable options */ #define CONFIG_SYS_LONGHELP /* undef to save memory */
include/configs/exynos5250-dt.h +2 -0
@@ -20,6 +20,8 @@#define MACH_TYPE_SMDK5250 3774#define CONFIG_MACH_TYPE MACH_TYPE_SMDK5250 +#define CONFIG_SPL_MAX_FOOTPRINT (14 * 1024) +/* USB */ #define CONFIG_CMD_USB #define CONFIG_USB_XHCI
include/configs/exynos5420.h +2 -0
@@ -25,6 +25,8 @@#endif #define CONFIG_IRAM_TOP 0x02074000 +#define CONFIG_SPL_MAX_FOOTPRINT (30 * 1024) +#define CONFIG_DEVICE_TREE_LIST "exynos5420-peach-pit exynos5420-smdk5420"#define CONFIG_MAX_I2C_NUM 11
Signature · 1 line
1.7.12.4
PATCH v3 4/5 Exynos5: Config: Enable USB boot mode for all Exynos5 SoCs
In reply to Akshay SaraswatRight now USB booting is enabled for Exynos5250 only. Moving all the configs for USB boot mode from exynos5250-dt.h to exynos5-dt.h in order to enableUSB booting for all Exynos5 SoCs.
---
Changes since v2:
- Added "Acked-by" & "Tested-by".
Changes since v1:
- Added "Acked-by".
include/configs/exynos5-dt.h | 6 ++++++ include/configs/exynos5250-dt.h | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-)
include/configs/exynos5-dt.h +6 -0
@@ -291,4 +291,10 @@#define CONFIG_CMD_GPIO +/* USB boot mode */ +#define CONFIG_USB_BOOTING +#define EXYNOS_COPY_USB_FNPTR_ADDR 0x02020070 +#define EXYNOS_USB_SECONDARY_BOOT 0xfeed0002 +#define EXYNOS_IRAM_SECONDARY_BASE 0x02020018 +#endif /* __CONFIG_H */
include/configs/exynos5250-dt.h +0 -6
@@ -29,12 +29,6 @@#define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2#define CONFIG_USB_STORAGE -/* USB boot mode */ -#define CONFIG_USB_BOOTING -#define EXYNOS_COPY_USB_FNPTR_ADDR 0x02020070 -#define EXYNOS_USB_SECONDARY_BOOT 0xfeed0002 -#define EXYNOS_IRAM_SECONDARY_BASE 0x02020018 -#define CONFIG_SPL_TEXT_BASE 0x02023400#define CONFIG_BOOTCOMMAND "mmc read 40007000 451 2000; bootm 40007000"
Signature · 1 line
1.7.12.4
PATCH v3 5/5 Exynos: Split 5250 and 5420 memory bank configuration
In reply to Akshay SaraswatFrom: Michael Pratt <[email protected]>
Since snow has a different memory configuration than peach, split the configuration between the 5250 and 5420. Exynos 5420 supports runtime memory configuration detection, and can make the determination between 4 and 7 banks at runtime.
Include the bank size with the number of banks for context to make the number of banks meaningful.
---
Changes since v2:
- Added "Acked-by" & "Tested-by".
Changes since v1:
- New patch.
include/configs/exynos5-dt.h | 2 -- include/configs/exynos5250-dt.h | 5 +++++ include/configs/exynos5420.h | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-)
include/configs/exynos5-dt.h +0 -2
@@ -161,8 +161,6 @@#define CONFIG_RD_LVL -#define CONFIG_NR_DRAM_BANKS 8 -#define SDRAM_BANK_SIZE (256UL << 20UL)/* 256 MB */ #define PHYS_SDRAM_1 CONFIG_SYS_SDRAM_BASE#define PHYS_SDRAM_1_SIZE SDRAM_BANK_SIZE#define PHYS_SDRAM_2 (CONFIG_SYS_SDRAM_BASE + SDRAM_BANK_SIZE)
include/configs/exynos5250-dt.h +5 -0
@@ -65,4 +65,9 @@#define LCD_YRES 1600#define LCD_BPP LCD_COLOR16#endif + +/* DRAM Memory Banks */ +#define CONFIG_NR_DRAM_BANKS 8 +#define SDRAM_BANK_SIZE (256UL << 20UL)/* 256 MB */ +#endif /* __CONFIG_5250_H */
include/configs/exynos5420.h +4 -0
@@ -45,4 +45,8 @@*/ #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_IRAM_TOP - 0x800) +/* DRAM Memory Banks */ +#define CONFIG_NR_DRAM_BANKS 7 +#define SDRAM_BANK_SIZE (512UL << 20UL)/* 512 MB */ +#endif /* __CONFIG_EXYNOS5420_H */
Signature · 1 line
1.7.12.4
PATCH v3 5/5 Exynos: Split 5250 and 5420 memory bank configuration
Dear Akshay Saraswat,
Quoted 6 lines · Akshay Saraswat
From: Michael Pratt <[email protected]>
Since snow has a different memory configuration than peach, split the configuration between the 5250 and 5420. Exynos 5420 supports runtime memory configuration detection, and can make the determination between 4 and 7 banks at runtime.
I think this patch should be included to your peach-pit patchset.
And I think, the number of banks and the size of bank seems to board specific feature. Can you guarantee if it uses same SoC then have same memory banks?
Quoted 52 lines
Include the bank size with the number of banks for context to make the number of banks meaningful.
Signed-off-by Michael Pratt <[email protected]>Signed-off-by Akshay Saraswat <[email protected]>Acked-by Simon Glass <[email protected]>Tested-by Simon Glass <[email protected]>---
Changes since v2:
- Added "Acked-by" & "Tested-by".
Changes since v1:
- New patch.include/configs/exynos5-dt.h | 2 -- include/configs/exynos5250-dt.h | 5 +++++ include/configs/exynos5420.h | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-)include/configs/exynos5-dt.h +0
-2@@ -161,8 +161,6 @@#define CONFIG_RD_LVL -#define CONFIG_NR_DRAM_BANKS 8 -#define SDRAM_BANK_SIZE (256UL << 20UL)/* 256 MB */ #define PHYS_SDRAM_1 CONFIG_SYS_SDRAM_BASE#define PHYS_SDRAM_1_SIZE SDRAM_BANK_SIZE#define PHYS_SDRAM_2 (CONFIG_SYS_SDRAM_BASE + SDRAM_BANK_SIZE)include/configs/exynos5250-dt.h +5
-0@@ -65,4 +65,9 @@#define LCD_YRES 1600#define LCD_BPP LCD_COLOR16#endif + +/* DRAM Memory Banks */ +#define CONFIG_NR_DRAM_BANKS 8 +#define SDRAM_BANK_SIZE (256UL << 20UL)/* 256 MB */ +#endif /* __CONFIG_5250_H */ include/configs/exynos5420.h +0
-0
include/configs/exynos5420.h line 52
Quoted 8 lines
include/configs/exynos5420.h +4
-0@@ -45,4 +45,8 @@*/ #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_IRAM_TOP - 0x800) +/* DRAM Memory Banks */ +#define CONFIG_NR_DRAM_BANKS 7 +#define SDRAM_BANK_SIZE (512UL << 20UL)/* 512 MB */ +#endif /* __CONFIG_EXYNOS5420_H */
Thanks,
Minkyu Kang.
PATCH v3 5/5 Exynos: Split 5250 and 5420 memory bank configuration
Hi Minkyu,
Quoted 5 lines · Minkyu Kang
Dear Akshay Saraswat,
Quoted 2 lines · Akshay Saraswat
From: Michael Pratt <[email protected]>
Quoted 8 lines
Quoted 4 lines
Since snow has a different memory configuration than peach, split the configuration between the 5250 and 5420. Exynos 5420 supports runtime memory configuration detection, and can make the determination between 4 and 7 banks at runtime.
I think this patch should be included to your peach-pit patchset.
And I think, the number of banks and the size of bank seems to board specific feature. Can you guarantee if it uses same SoC then have same memory banks?
I think this is better than what we have there at present. There is a patch from Chromium that puts this in the device tree, but it is probably best dealt with when more patches have landed.
Regards,
Simon
PATCH v3 5/5 Exynos: Split 5250 and 5420 memory bank configuration
Quoted 13 lines · Simon Glass
Hi Minkyu,
Quoted 10 lines · Minkyu Kang
Dear Akshay Saraswat,
Quoted 6 lines · Akshay Saraswat
From: Michael Pratt <[email protected]>
Since snow has a different memory configuration than peach, split the configuration between the 5250 and 5420. Exynos 5420 supports runtime memory configuration detection, and can make the determination between 4 and 7 banks at runtime.
Quoted 8 lines
Quoted 3 lines
I think this patch should be included to your peach-pit patchset.
And I think, the number of banks and the size of bank seems to board specific feature. Can you guarantee if it uses same SoC then have same memory banks?I think this is better than what we have there at present. There is a patch from Chromium that puts this in the device tree, but it is probably best dealt with when more patches have landed.
I didn't deny this patch.
My comment is about present state.
If you can not guarantee that have same memory banks then please split this configuration to each board's configs.
Thanks,
Minkyu Kang.
PATCH v3 5/5 Exynos: Split 5250 and 5420 memory bank configuration
Hi Minkyu,
Quoted 23 lines · Minkyu Kang
Quoted 13 lines · Simon Glass
Hi Minkyu,
Quoted 10 lines · Minkyu Kang
Dear Akshay Saraswat,
Quoted 6 lines · Akshay Saraswat
From: Michael Pratt <[email protected]>
Since snow has a different memory configuration than peach, split the configuration between the 5250 and 5420. Exynos 5420 supports runtime memory configuration detection, and can make the determination between 4 and 7 banks at runtime.
Quoted 8 lines
Quoted 3 lines
I think this patch should be included to your peach-pit patchset.
And I think, the number of banks and the size of bank seems to board specific feature. Can you guarantee if it uses same SoC then have same memory banks?I think this is better than what we have there at present. There is a patch from Chromium that puts this in the device tree, but it is probably best dealt with when more patches have landed.
Quoted 4 lines
I didn't deny this patch.
My comment is about present state.
If you can not guarantee that have same memory banks then please split this configuration to each board's configs.
For Pit which can support 2GB or 4GB, U-Boot detects the correct size at run-time. So the setting in the config file is the *maximum* memory supported by that SOC, which is indeed fixed by the SOC and has nothing to do with the board.
But i maybe misunderstand what you are getting at?
Regards,
Simon
PATCH v3 5/5 Exynos: Split 5250 and 5420 memory bank configuration
Dear Simon Glass,
Quoted 31 lines · Simon Glass
Hi Minkyu,
Quoted 23 lines · Minkyu Kang
Quoted 13 lines · Simon Glass
Hi Minkyu,
Quoted 10 lines · Minkyu Kang
Dear Akshay Saraswat,
Quoted 6 lines · Akshay Saraswat
From: Michael Pratt <[email protected]>
Since snow has a different memory configuration than peach, split the configuration between the 5250 and 5420. Exynos 5420 supports runtime memory configuration detection, and can make the determination between 4 and 7 banks at runtime.
Quoted 8 lines
Quoted 3 lines
I think this patch should be included to your peach-pit patchset.
And I think, the number of banks and the size of bank seems to board specific feature. Can you guarantee if it uses same SoC then have same memory banks?I think this is better than what we have there at present. There is a patch from Chromium that puts this in the device tree, but it is probably best dealt with when more patches have landed.
Quoted 4 lines
I didn't deny this patch.
My comment is about present state.
If you can not guarantee that have same memory banks then please split this configuration to each board's configs.
Quoted 4 lines
For Pit which can support 2GB or 4GB, U-Boot detects the correct size at run-time. So the setting in the config file is the *maximum* memory supported by that SOC, which is indeed fixed by the SOC and has nothing to do with the board.
I see.
Then looks good to me.
Thanks,
Minkyu Kang.