[U-Boot] [PATCH 0/4] ARM: uniphier: some more updates for UniPhier SoCs

Masahiro Yamada (4): ARM: uniphier: introduce CONFIG_ARM_UNIPHIER_{32,64}BIT ARM: uniphier: move CONFIG_ARMV8_MULTIENTRY to Kconfig ARM: uniphier: reserve memory for DRAM PHY training on PH1-LD20 ARM: uniphier: use the default CONFIG_BOOTDELAY=2
arch/arm/Kconfig | 1 + arch/arm/mach-uniphier/Kconfig | 25 ++++++++++++++-------- arch/arm/mach-uniphier/dram_init.c | 40 ++++++++++++++++++++++++++++++++++++ configs/uniphier_ld11_defconfig | 1 - configs/uniphier_ld20_defconfig | 1 - configs/uniphier_ld4_sld8_defconfig | 1 - configs/uniphier_pro4_defconfig | 1 - configs/uniphier_pxs2_ld6b_defconfig | 1 - configs/uniphier_sld3_defconfig | 1 - include/configs/uniphier.h | 1 - 10 files changed, 58 insertions(+), 15 deletions(-)

This will make it easier to select config options specific to particular ARM processor generation.
Signed-off-by: Masahiro Yamada yamada.masahiro@socionext.com ---
arch/arm/mach-uniphier/Kconfig | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-uniphier/Kconfig b/arch/arm/mach-uniphier/Kconfig index ae763ad..175c9f7 100644 --- a/arch/arm/mach-uniphier/Kconfig +++ b/arch/arm/mach-uniphier/Kconfig @@ -3,35 +3,42 @@ if ARCH_UNIPHIER config SYS_CONFIG_NAME default "uniphier"
+config ARCH_UNIPHIER_32BIT + bool + select CPU_V7 + +config ARCH_UNIPHIER_64BIT + bool + select ARM64 + select SPL_SEPARATE_BSS + choice prompt "UniPhier SoC select" default ARCH_UNIPHIER_PRO4
config ARCH_UNIPHIER_SLD3 bool "UniPhier PH1-sLD3 SoC" - select CPU_V7 + select ARCH_UNIPHIER_32BIT
config ARCH_UNIPHIER_LD4_SLD8 bool "UniPhier PH1-LD4/PH1-sLD8 SoC" - select CPU_V7 + select ARCH_UNIPHIER_32BIT
config ARCH_UNIPHIER_PRO4 bool "UniPhier PH1-Pro4 SoC" - select CPU_V7 + select ARCH_UNIPHIER_32BIT
config ARCH_UNIPHIER_PRO5_PXS2_LD6B bool "UniPhier PH1-Pro5/ProXstream2/PH1-LD6b SoC" - select CPU_V7 + select ARCH_UNIPHIER_32BIT
config ARCH_UNIPHIER_LD11 bool "UniPhier PH1-LD11 SoC" - select ARM64 - select SPL_SEPARATE_BSS + select ARCH_UNIPHIER_64BIT
config ARCH_UNIPHIER_LD20 bool "UniPhier PH1-LD20 SoC" - select ARM64 - select SPL_SEPARATE_BSS + select ARCH_UNIPHIER_64BIT
endchoice

I just did not notice this option had an entry in Kconfig.
Signed-off-by: Masahiro Yamada yamada.masahiro@socionext.com ---
arch/arm/mach-uniphier/Kconfig | 1 + include/configs/uniphier.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-uniphier/Kconfig b/arch/arm/mach-uniphier/Kconfig index 175c9f7..89be0b3 100644 --- a/arch/arm/mach-uniphier/Kconfig +++ b/arch/arm/mach-uniphier/Kconfig @@ -11,6 +11,7 @@ config ARCH_UNIPHIER_64BIT bool select ARM64 select SPL_SEPARATE_BSS + select ARMV8_MULTIENTRY
choice prompt "UniPhier SoC select" diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h index 68f6c9f..77057d0 100644 --- a/include/configs/uniphier.h +++ b/include/configs/uniphier.h @@ -99,7 +99,6 @@ #define CONFIG_SYS_MMC_ENV_PART 1
#ifdef CONFIG_ARM64 -#define CONFIG_ARMV8_MULTIENTRY #define CPU_RELEASE_ADDR 0x80000000 #define COUNTER_FREQUENCY 50000000 #define CONFIG_GICV3

The DRAM PHY layer on PH1-LD20 is able to calibrate PHY parameters periodically. This compensates for the voltage and temperature deviation and improves the PHY parameter adjustment. Instead, it requires 64 byte scratch memory in each DRAM channel for the dynamic training. The memory regions must be reserved in DT before jumping to the kernel.
The scratch area can be anywhere in each DRAM channel, but the DRAM init code in SPL currently assigns it at the end of each channel. So, it makes sense to reserve the regions on run-time by U-Boot instead of statically embedding it in the DT in Linux. Anyway, a boot-loader should know much more about memory initialization than the kernel.
Signed-off-by: Masahiro Yamada yamada.masahiro@socionext.com ---
arch/arm/Kconfig | 1 + arch/arm/mach-uniphier/Kconfig | 1 + arch/arm/mach-uniphier/dram_init.c | 40 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index e75c4c0..5aaae96 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -801,6 +801,7 @@ config ARCH_UNIPHIER select SPL select OF_CONTROL select SPL_OF_CONTROL + select OF_LIBFDT select DM select SPL_DM select DM_GPIO diff --git a/arch/arm/mach-uniphier/Kconfig b/arch/arm/mach-uniphier/Kconfig index 89be0b3..e256eeb 100644 --- a/arch/arm/mach-uniphier/Kconfig +++ b/arch/arm/mach-uniphier/Kconfig @@ -40,6 +40,7 @@ config ARCH_UNIPHIER_LD11 config ARCH_UNIPHIER_LD20 bool "UniPhier PH1-LD20 SoC" select ARCH_UNIPHIER_64BIT + select OF_BOARD_SETUP
endchoice
diff --git a/arch/arm/mach-uniphier/dram_init.c b/arch/arm/mach-uniphier/dram_init.c index ef0e2e8..489366c 100644 --- a/arch/arm/mach-uniphier/dram_init.c +++ b/arch/arm/mach-uniphier/dram_init.c @@ -9,6 +9,9 @@ #include <fdtdec.h> #include <linux/err.h>
+#include "init.h" +#include "soc-info.h" + DECLARE_GLOBAL_DATA_PTR;
static const void *get_memory_reg_prop(const void *fdt, int *lenp) @@ -81,3 +84,40 @@ void dram_init_banksize(void) (unsigned long)gd->bd->bi_dram[i].size); } } + +#ifdef CONFIG_OF_BOARD_SETUP +/* + * The DRAM PHY requires 64 byte scratch area in each DRAM channel + * for its dynamic PHY training feature. + */ +int ft_board_setup(void *fdt, bd_t *bd) +{ + const struct uniphier_board_data *param; + unsigned long rsv_addr; + const unsigned long rsv_size = 64; + int ch, ret; + + if (uniphier_get_soc_type() != SOC_UNIPHIER_LD20) + return 0; + + param = uniphier_get_board_param(); + if (!param) { + printf("failed to get board parameter\n"); + return -ENODEV; + } + + for (ch = 0; ch < param->dram_nr_ch; ch++) { + rsv_addr = param->dram_ch[ch].base + param->dram_ch[ch].size; + rsv_addr -= rsv_size; + + ret = fdt_add_mem_rsv(fdt, rsv_addr, rsv_size); + if (ret) + return -ENOSPC; + + printf(" Reserved memory region for DRAM PHY training: addr=%lx size=%lx\n", + rsv_addr, rsv_size); + } + + return 0; +} +#endif

I do not insist on CONFIG_BOOTDELAY=3. The default value in Kconfig, CONFIG_BOOTDELAY=2, is just fine for these boards.
Signed-off-by: Masahiro Yamada yamada.masahiro@socionext.com ---
configs/uniphier_ld11_defconfig | 1 - configs/uniphier_ld20_defconfig | 1 - configs/uniphier_ld4_sld8_defconfig | 1 - configs/uniphier_pro4_defconfig | 1 - configs/uniphier_pxs2_ld6b_defconfig | 1 - configs/uniphier_sld3_defconfig | 1 - 6 files changed, 6 deletions(-)
diff --git a/configs/uniphier_ld11_defconfig b/configs/uniphier_ld11_defconfig index e7f9b15..ffcac79 100644 --- a/configs/uniphier_ld11_defconfig +++ b/configs/uniphier_ld11_defconfig @@ -5,7 +5,6 @@ CONFIG_ARCH_UNIPHIER_LD11=y CONFIG_MICRO_SUPPORT_CARD=y CONFIG_SYS_TEXT_BASE=0x84000000 CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-ld11-ref" -CONFIG_BOOTDELAY=3 CONFIG_HUSH_PARSER=y # CONFIG_CMD_XIMG is not set # CONFIG_CMD_ENV_EXISTS is not set diff --git a/configs/uniphier_ld20_defconfig b/configs/uniphier_ld20_defconfig index d073e3d..cbc65dd 100644 --- a/configs/uniphier_ld20_defconfig +++ b/configs/uniphier_ld20_defconfig @@ -5,7 +5,6 @@ CONFIG_ARCH_UNIPHIER_LD20=y CONFIG_MICRO_SUPPORT_CARD=y CONFIG_SYS_TEXT_BASE=0x84000000 CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-ld20-ref" -CONFIG_BOOTDELAY=3 CONFIG_HUSH_PARSER=y # CONFIG_CMD_XIMG is not set # CONFIG_CMD_ENV_EXISTS is not set diff --git a/configs/uniphier_ld4_sld8_defconfig b/configs/uniphier_ld4_sld8_defconfig index 04d651d..22615a6 100644 --- a/configs/uniphier_ld4_sld8_defconfig +++ b/configs/uniphier_ld4_sld8_defconfig @@ -5,7 +5,6 @@ CONFIG_ARCH_UNIPHIER_LD4_SLD8=y CONFIG_MICRO_SUPPORT_CARD=y CONFIG_SYS_TEXT_BASE=0x84000000 CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-ld4-ref" -CONFIG_BOOTDELAY=3 CONFIG_HUSH_PARSER=y CONFIG_CMD_BOOTZ=y # CONFIG_CMD_XIMG is not set diff --git a/configs/uniphier_pro4_defconfig b/configs/uniphier_pro4_defconfig index d5fc138..18f4caf 100644 --- a/configs/uniphier_pro4_defconfig +++ b/configs/uniphier_pro4_defconfig @@ -4,7 +4,6 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_MICRO_SUPPORT_CARD=y CONFIG_SYS_TEXT_BASE=0x84000000 CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-pro4-ref" -CONFIG_BOOTDELAY=3 CONFIG_HUSH_PARSER=y CONFIG_CMD_BOOTZ=y # CONFIG_CMD_XIMG is not set diff --git a/configs/uniphier_pxs2_ld6b_defconfig b/configs/uniphier_pxs2_ld6b_defconfig index 285ea98..cf6d3e4 100644 --- a/configs/uniphier_pxs2_ld6b_defconfig +++ b/configs/uniphier_pxs2_ld6b_defconfig @@ -5,7 +5,6 @@ CONFIG_ARCH_UNIPHIER_PRO5_PXS2_LD6B=y CONFIG_MICRO_SUPPORT_CARD=y CONFIG_SYS_TEXT_BASE=0x84000000 CONFIG_DEFAULT_DEVICE_TREE="uniphier-proxstream2-vodka" -CONFIG_BOOTDELAY=3 CONFIG_HUSH_PARSER=y CONFIG_CMD_BOOTZ=y # CONFIG_CMD_XIMG is not set diff --git a/configs/uniphier_sld3_defconfig b/configs/uniphier_sld3_defconfig index 13f3147..0965019 100644 --- a/configs/uniphier_sld3_defconfig +++ b/configs/uniphier_sld3_defconfig @@ -4,7 +4,6 @@ CONFIG_ARCH_UNIPHIER_SLD3=y CONFIG_MICRO_SUPPORT_CARD=y CONFIG_SYS_TEXT_BASE=0x84000000 CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-sld3-ref" -CONFIG_BOOTDELAY=3 CONFIG_HUSH_PARSER=y CONFIG_CMD_BOOTZ=y # CONFIG_CMD_XIMG is not set

2016-06-17 19:24 GMT+09:00 Masahiro Yamada yamada.masahiro@socionext.com:
Masahiro Yamada (4): ARM: uniphier: introduce CONFIG_ARM_UNIPHIER_{32,64}BIT ARM: uniphier: move CONFIG_ARMV8_MULTIENTRY to Kconfig ARM: uniphier: reserve memory for DRAM PHY training on PH1-LD20 ARM: uniphier: use the default CONFIG_BOOTDELAY=2
Applied to u-boot-uniphier/master.
participants (1)
-
Masahiro Yamada