]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ARM: UniPhier: do not compile unnecessary objects
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Thu, 5 Feb 2015 05:42:58 +0000 (14:42 +0900)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 10:59:08 +0000 (12:59 +0200)
It is true that unused functions are removed from the ELF image
by the compiler's garbage collection but relying on it too much
does not look nice.
Currently, the build is taking more than it should.

Refactor the makefiles to compile only files that are really needed.
CONFIG_SOC_INIT and CONFIG_DRAM_INIT are no longer needed by the
optimization.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
arch/arm/cpu/armv7/uniphier/Kconfig
arch/arm/cpu/armv7/uniphier/Makefile
arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile
arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile
arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile

index 0556e4b3509e6b1e8b50d69bb98add96c1fef4f0..5c5a84fe56c4fc0da0f68f8cc028fa672ed90a01 100644 (file)
@@ -50,21 +50,12 @@ endchoice
 
 config CMD_PINMON
        bool "Enable boot mode pins monitor command"
-       depends on !SPL_BUILD
        default y
        help
          The command "pinmon" shows the state of the boot mode pins.
          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 SOC_INIT
-       bool
-       default SPL_BUILD
-
-config DRAM_INIT
-       bool
-       default SPL_BUILD
-
 config CMD_DDRPHY_DUMP
        bool "Enable dump command of DDR PHY parameters"
        depends on !SPL_BUILD
@@ -74,7 +65,7 @@ config CMD_DDRPHY_DUMP
 
 choice
        prompt "DDR3 Frequency select"
-       depends on DRAM_INIT
+       depends on SPL_BUILD
 
 config DDR_FREQ_1600
        bool "DDR3 1600"
index 713a0d74ed2217da10394f1cbe9f353cde673eab..df418dd3c4b8104c11ae1acfdfb36d7e19d2c6ab 100644 (file)
@@ -2,24 +2,32 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(CONFIG_SPL_BUILD) += lowlevel_init.o init_page_table.o
-obj-$(CONFIG_SPL_BUILD) += spl.o
+ifdef CONFIG_SPL_BUILD
+
+obj-y += lowlevel_init.o
+obj-y += init_page_table.o
+obj-y += spl.o
+obj-y += ddrphy_training.o
+
+else
 
-obj-y += timer.o
-obj-y += reset.o
-obj-y += cache_uniphier.o
-obj-y += dram_init.o
-obj-$(CONFIG_DRAM_INIT) += ddrphy_training.o
 obj-$(CONFIG_BOARD_EARLY_INIT_F) += board_early_init_f.o
 obj-$(CONFIG_DISPLAY_CPUINFO) += cpu_info.o
 obj-$(CONFIG_MISC_INIT_F) += print_misc_info.o
+obj-y += dram_init.o
+obj-y += board_common.o
 obj-$(CONFIG_BOARD_EARLY_INIT_R) += board_early_init_r.o
 obj-$(CONFIG_BOARD_LATE_INIT) += board_late_init.o
+obj-y += reset.o
+obj-y += cache_uniphier.o
 obj-$(CONFIG_UNIPHIER_SMP) += smp.o
 obj-$(CONFIG_CMD_PINMON) += cmd_pinmon.o
 obj-$(CONFIG_CMD_DDRPHY_DUMP) += cmd_ddrphy.o
 
-obj-y += board_common.o
+endif
+
+obj-y += timer.o
+
 obj-$(CONFIG_PFC_MICRO_SUPPORT_CARD) += support_card.o
 obj-$(CONFIG_DCC_MICRO_SUPPORT_CARD) += support_card.o
 
index bef1b8ae9142a4f97d80292d860e5301ee8831f8..72f46636fd5d60aa39f689c9f3f2c3a5807b1147 100644 (file)
@@ -2,10 +2,13 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o
-obj-y += boot-mode.o
+ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_DEBUG_LL) += lowlevel_debug.o
-obj-$(CONFIG_SOC_INIT) += bcu_init.o sbc_init.o sg_init.o pll_init.o \
-                                                               clkrst_init.o
+obj-y += bcu_init.o sbc_init.o sg_init.o pll_init.o clkrst_init.o \
+       pll_spectrum.o umc_init.o ddrphy_init.o
+else
 obj-$(CONFIG_BOARD_EARLY_INIT_F) += pinctrl.o
-obj-$(CONFIG_DRAM_INIT) += pll_spectrum.o umc_init.o ddrphy_init.o
+obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o
+endif
+
+obj-y += boot-mode.o
index 484e978e2de11b5cdbc8703395c5f88f786ef2eb..e330fda1ed44a7f420744011525c98b59cf33b9e 100644 (file)
@@ -2,9 +2,13 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o
-obj-y += boot-mode.o
+ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_DEBUG_LL) += lowlevel_debug.o
-obj-$(CONFIG_SOC_INIT) += sbc_init.o sg_init.o pll_init.o clkrst_init.o
+obj-y += sbc_init.o sg_init.o pll_init.o clkrst_init.o \
+       pll_spectrum.o umc_init.o ddrphy_init.o
+else
 obj-$(CONFIG_BOARD_EARLY_INIT_F) += pinctrl.o
-obj-$(CONFIG_DRAM_INIT) += pll_spectrum.o umc_init.o ddrphy_init.o
+obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o
+endif
+
+obj-y += boot-mode.o
index bef1b8ae9142a4f97d80292d860e5301ee8831f8..72f46636fd5d60aa39f689c9f3f2c3a5807b1147 100644 (file)
@@ -2,10 +2,13 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o
-obj-y += boot-mode.o
+ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_DEBUG_LL) += lowlevel_debug.o
-obj-$(CONFIG_SOC_INIT) += bcu_init.o sbc_init.o sg_init.o pll_init.o \
-                                                               clkrst_init.o
+obj-y += bcu_init.o sbc_init.o sg_init.o pll_init.o clkrst_init.o \
+       pll_spectrum.o umc_init.o ddrphy_init.o
+else
 obj-$(CONFIG_BOARD_EARLY_INIT_F) += pinctrl.o
-obj-$(CONFIG_DRAM_INIT) += pll_spectrum.o umc_init.o ddrphy_init.o
+obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o
+endif
+
+obj-y += boot-mode.o