]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ARM: UniPhier: move DDR related configuration to Kconfig
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Thu, 6 Nov 2014 11:16:42 +0000 (20:16 +0900)
committerMasahiro Yamada <yamada.m@jp.panasonic.com>
Tue, 11 Nov 2014 15:16:08 +0000 (00:16 +0900)
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
arch/arm/cpu/armv7/uniphier/Kconfig
arch/arm/cpu/armv7/uniphier/dram_init.c
arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile
arch/arm/cpu/armv7/uniphier/ph1-ld4/umc_init.c
arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile
arch/arm/cpu/armv7/uniphier/ph1-pro4/umc_init.c
arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile
arch/arm/cpu/armv7/uniphier/ph1-sld8/umc_init.c
include/configs/ph1_ld4.h
include/configs/ph1_pro4.h
include/configs/ph1_sld8.h

index f013dc3cadd3d2f139c5f1ae2ecaa4bdf95c60a1..011c6d9f2d6d561b86308a2d1bae757ec17e5273 100644 (file)
@@ -32,4 +32,27 @@ config CMD_PINMON
          The boot mode pins are latched when the system reset is deasserted
          and determine which device the system should load a boot image from.
 
+config DRAM_INIT
+       bool
+       default SPL_BUILD
+
+choice
+       prompt "DDR3 Frequency select"
+       depends on DRAM_INIT
+
+config DDR_FREQ_1600
+       bool "DDR3 1600"
+       depends on MACH_PH1_PRO4 || MACH_PH1_LD4
+
+config DDR_FREQ_1333
+       bool "DDR3 1333"
+       depends on MACH_PH1_LD4 || MACH_PH1_SLD8
+
+endchoice
+
+config DDR_FREQ
+       int
+       default 1333 if DDR_FREQ_1333
+       default 1600 if DDR_FREQ_1600
+
 endmenu
index 5465a0e6bf6bf97d4dbdabc1c7b746b0cffdc510..7de657b7af91d53bddd4639cc77b8603f0548d60 100644 (file)
@@ -16,7 +16,7 @@ int dram_init(void)
        DECLARE_GLOBAL_DATA_PTR;
        gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
 
-#if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)
+#ifdef CONFIG_DRAM_INIT
        led_write(B, 4, , );
 
        {
index 781b511a97b499090b4485f78a57d60070b10673..5722ee2928580dbe859ad4d9c62ec8827f000906 100644 (file)
@@ -7,5 +7,4 @@ obj-y += platdevice.o
 obj-y += boot-mode.o
 obj-$(CONFIG_BOARD_POSTCLK_INIT) += board_postclk_init.o bcu_init.o \
                sbc_init.o sg_init.o pll_init.o clkrst_init.o pinctrl.o
-obj-$(CONFIG_SPL_BUILD) += pll_spectrum.o \
-       umc_init.o
+obj-$(CONFIG_DRAM_INIT) += pll_spectrum.o umc_init.o
index 1344ac1caab2576441fa8bd90d17c6d2055d79a7..ebcbaabf65a6df050efb9d618a11a635b19ea15e 100644 (file)
@@ -149,10 +149,6 @@ int umc_init(void)
                                        CONFIG_SDRAM1_SIZE / 0x08000000);
 }
 
-#if CONFIG_DDR_FREQ != 1333 && CONFIG_DDR_FREQ != 1600
-#error Unsupported DDR Frequency.
-#endif
-
 #if (CONFIG_SDRAM0_SIZE == 0x08000000 || CONFIG_SDRAM0_SIZE == 0x10000000) && \
     (CONFIG_SDRAM1_SIZE == 0x08000000 || CONFIG_SDRAM1_SIZE == 0x10000000) && \
     CONFIG_DDR_NUM_CH0 == 1 && CONFIG_DDR_NUM_CH1 == 1
index e11f4f6d8b3f36c44d340f5bafdf9d8fd4858b12..25a12027ff7cd4e94840fefe1c2ccdbeccefc58b 100644 (file)
@@ -7,5 +7,4 @@ obj-y += platdevice.o
 obj-y += boot-mode.o
 obj-$(CONFIG_BOARD_POSTCLK_INIT) += board_postclk_init.o sbc_init.o \
                                sg_init.o pll_init.o clkrst_init.o pinctrl.o
-obj-$(CONFIG_SPL_BUILD) += pll_spectrum.o \
-       umc_init.o
+obj-$(CONFIG_DRAM_INIT) += pll_spectrum.o umc_init.o
index dd462875bb7a51feb72586498b3f8bc7344e7479..328b2f4d9ab1dd35780f5358c5360be3bb3ba003 100644 (file)
@@ -122,10 +122,6 @@ int umc_init(void)
                                        CONFIG_SDRAM1_SIZE / 0x08000000);
 }
 
-#if CONFIG_DDR_FREQ != 1600
-#error Unsupported DDR frequency.
-#endif
-
 #if ((CONFIG_SDRAM0_SIZE == 0x20000000 && CONFIG_DDR_NUM_CH0 == 2) || \
      (CONFIG_SDRAM0_SIZE == 0x10000000 && CONFIG_DDR_NUM_CH0 == 1)) && \
     ((CONFIG_SDRAM1_SIZE == 0x20000000 && CONFIG_DDR_NUM_CH1 == 2) || \
index 781b511a97b499090b4485f78a57d60070b10673..5722ee2928580dbe859ad4d9c62ec8827f000906 100644 (file)
@@ -7,5 +7,4 @@ obj-y += platdevice.o
 obj-y += boot-mode.o
 obj-$(CONFIG_BOARD_POSTCLK_INIT) += board_postclk_init.o bcu_init.o \
                sbc_init.o sg_init.o pll_init.o clkrst_init.o pinctrl.o
-obj-$(CONFIG_SPL_BUILD) += pll_spectrum.o \
-       umc_init.o
+obj-$(CONFIG_DRAM_INIT) += pll_spectrum.o umc_init.o
index ff2dcb1640eef11cf4b215acd25222edc9b10831..a44f999fbf67c38137149042f6afddb889063c74 100644 (file)
@@ -129,10 +129,6 @@ int umc_init(void)
                                        CONFIG_SDRAM1_SIZE / 0x08000000);
 }
 
-#if CONFIG_DDR_FREQ != 1333
-#error Unsupported DDR frequency.
-#endif
-
 #if (CONFIG_SDRAM0_SIZE == 0x08000000 || CONFIG_SDRAM0_SIZE == 0x10000000) && \
     (CONFIG_SDRAM1_SIZE == 0x08000000 || CONFIG_SDRAM1_SIZE == 0x10000000) && \
     CONFIG_DDR_NUM_CH0 == 1 && CONFIG_DDR_NUM_CH1 == 1
index 005a853f56822b3d8630cedb51f044c96c81662b..73a95e615ec9b2679d7513dce504926956fc0728 100644 (file)
@@ -37,8 +37,6 @@
 #define CONFIG_DDR_NUM_CH0 1
 #define CONFIG_DDR_NUM_CH1 1
 
-#define CONFIG_DDR_FREQ 1600
-
 /*
  * Memory Size & Mapping
  */
index 7dd6fd2a9292d8bdd73c33b5371218f25b07f128..fc5132d1ccf7689e326e254136e70e276734e7e4 100644 (file)
@@ -37,8 +37,6 @@
 #define CONFIG_DDR_NUM_CH0 2
 #define CONFIG_DDR_NUM_CH1 2
 
-#define CONFIG_DDR_FREQ 1600
-
 #define CONFIG_UNIPHIER_SMP
 
 /*
index 1062aace38a7970772e6f16ed68f8a66c664ee10..e2f1102003d20a7cb4e0ccaeeab348ce82c7d087 100644 (file)
@@ -37,8 +37,6 @@
 #define CONFIG_DDR_NUM_CH0 1
 #define CONFIG_DDR_NUM_CH1 1
 
-#define CONFIG_DDR_FREQ 1333
-
 /* #define CONFIG_DDR_STANDARD */
 
 /*