summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2014-06-24 08:33:14 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-07-01 08:41:44 +0200
commit691211c8bbf3ff861443963554eac8063b01d650 (patch)
tree105dc20c1a7762bf73855102be3245e9fae2aa70 /arch
parent14552dddce4b6c623cca01f55025d1fa039080b0 (diff)
downloadbarebox-691211c8bbf3ff861443963554eac8063b01d650.tar.gz
barebox-691211c8bbf3ff861443963554eac8063b01d650.tar.xz
arm: imx6: move imx6_init_lowlevel to single initcall
Instead of repeating the same lowlevel init for every board move it to it's own initcall. Avoids code bloat and shaves off almost 1.5kB of uncompressed barebox size for a default imx_v7_defconfig build. For boards wherethe hostname setup was done in the postcore initcall we move this to a device initcall to get it out of the way. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boards/boundarydevices-nitrogen6x/board.c16
-rw-r--r--arch/arm/boards/datamodul-edm-qmx6/board.c13
-rw-r--r--arch/arm/boards/embest-riotboard/board.c13
-rw-r--r--arch/arm/boards/freescale-mx6-arm2/board.c2
-rw-r--r--arch/arm/boards/freescale-mx6-sabrelite/board.c13
-rw-r--r--arch/arm/boards/freescale-mx6-sabresd/board.c14
-rw-r--r--arch/arm/boards/gk802/board.c13
-rw-r--r--arch/arm/boards/guf-santaro/board.c11
-rw-r--r--arch/arm/boards/phytec-phycard-imx6/board.c11
-rw-r--r--arch/arm/boards/phytec-phyflex-imx6/board.c11
-rw-r--r--arch/arm/boards/solidrun-hummingboard/board.c15
-rw-r--r--arch/arm/boards/tqma6x/board.c13
-rw-r--r--arch/arm/boards/udoo/board.c14
-rw-r--r--arch/arm/boards/variscite-mx6/board.c13
-rw-r--r--arch/arm/mach-imx/imx6.c2
15 files changed, 14 insertions, 160 deletions
diff --git a/arch/arm/boards/boundarydevices-nitrogen6x/board.c b/arch/arm/boards/boundarydevices-nitrogen6x/board.c
index 95c8567673..347fd9128b 100644
--- a/arch/arm/boards/boundarydevices-nitrogen6x/board.c
+++ b/arch/arm/boards/boundarydevices-nitrogen6x/board.c
@@ -29,6 +29,8 @@ static int nitrogen6x_devices_init(void)
imx6_bbu_internal_spi_i2c_register_handler("spiflash", "/dev/m25p0.barebox",
BBU_HANDLER_FLAG_DEFAULT);
+ barebox_set_hostname("nitrogen6x");
+
return 0;
}
device_initcall(nitrogen6x_devices_init);
@@ -61,17 +63,3 @@ static int nitrogen6x_coredevices_init(void)
return 0;
}
coredevice_initcall(nitrogen6x_coredevices_init);
-
-static int nitrogen6x_postcore_init(void)
-{
- if (!of_machine_is_compatible("fsl,imx6dl-nitrogen6x") &&
- !of_machine_is_compatible("fsl,imx6q-nitrogen6x"))
- return 0;
-
- imx6_init_lowlevel();
-
- barebox_set_hostname("nitrogen6x");
-
- return 0;
-}
-postcore_initcall(nitrogen6x_postcore_init);
diff --git a/arch/arm/boards/datamodul-edm-qmx6/board.c b/arch/arm/boards/datamodul-edm-qmx6/board.c
index 26757eb29a..e388e28168 100644
--- a/arch/arm/boards/datamodul-edm-qmx6/board.c
+++ b/arch/arm/boards/datamodul-edm-qmx6/board.c
@@ -135,19 +135,8 @@ static int realq7_device_init(void)
break;
}
- return 0;
-}
-device_initcall(realq7_device_init);
-
-static int realq7_postcore_init(void)
-{
- if (!of_machine_is_compatible("dmo,imx6q-edmqmx6"))
- return 0;
-
barebox_set_hostname("eDM-QMX6");
- imx6_init_lowlevel();
-
return 0;
}
-postcore_initcall(realq7_postcore_init);
+device_initcall(realq7_device_init);
diff --git a/arch/arm/boards/embest-riotboard/board.c b/arch/arm/boards/embest-riotboard/board.c
index 3c28aa16ea..3f5b4dec51 100644
--- a/arch/arm/boards/embest-riotboard/board.c
+++ b/arch/arm/boards/embest-riotboard/board.c
@@ -72,19 +72,8 @@ static int riotboard_device_init(void)
imx6_bbu_internal_mmc_register_handler("emmc", "/dev/mmc3.barebox",
BBU_HANDLER_FLAG_DEFAULT);
- return 0;
-}
-device_initcall(riotboard_device_init);
-
-static int riotboard_lwl_init(void)
-{
- if (!of_machine_is_compatible("embest,riotboard"))
- return 0;
-
barebox_set_hostname("riotboard");
- imx6_init_lowlevel();
-
return 0;
}
-postcore_initcall(riotboard_lwl_init);
+device_initcall(riotboard_device_init);
diff --git a/arch/arm/boards/freescale-mx6-arm2/board.c b/arch/arm/boards/freescale-mx6-arm2/board.c
index 6bae6ba9ea..7a78400f2e 100644
--- a/arch/arm/boards/freescale-mx6-arm2/board.c
+++ b/arch/arm/boards/freescale-mx6-arm2/board.c
@@ -147,8 +147,6 @@ static int arm2_console_init(void)
{
mxc_iomux_v3_setup_multiple_pads(arm2_pads, ARRAY_SIZE(arm2_pads));
- imx6_init_lowlevel();
-
barebox_set_model("Freescale i.MX6 Armadillo2");
barebox_set_hostname("armadillo2");
diff --git a/arch/arm/boards/freescale-mx6-sabrelite/board.c b/arch/arm/boards/freescale-mx6-sabrelite/board.c
index 178fed6fd2..1f26548058 100644
--- a/arch/arm/boards/freescale-mx6-sabrelite/board.c
+++ b/arch/arm/boards/freescale-mx6-sabrelite/board.c
@@ -179,20 +179,9 @@ static int sabrelite_coredevices_init(void)
phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
ksz9021rn_phy_fixup);
- return 0;
-}
-coredevice_initcall(sabrelite_coredevices_init);
-
-static int sabrelite_postcore_init(void)
-{
- if (!of_machine_is_compatible("fsl,imx6q-sabrelite") &&
- !of_machine_is_compatible("fsl,imx6dl-sabrelite"))
- return 0;
-
- imx6_init_lowlevel();
barebox_set_hostname("sabrelite");
return 0;
}
-postcore_initcall(sabrelite_postcore_init);
+coredevice_initcall(sabrelite_coredevices_init);
diff --git a/arch/arm/boards/freescale-mx6-sabresd/board.c b/arch/arm/boards/freescale-mx6-sabresd/board.c
index 4e4ce7a015..53aada7bba 100644
--- a/arch/arm/boards/freescale-mx6-sabresd/board.c
+++ b/arch/arm/boards/freescale-mx6-sabresd/board.c
@@ -69,6 +69,7 @@ static int sabresd_devices_init(void)
return 0;
armlinux_set_architecture(3980);
+ barebox_set_hostname("sabresd");
return 0;
}
@@ -89,16 +90,3 @@ static int sabresd_coredevices_init(void)
* gpios are available.
*/
coredevice_initcall(sabresd_coredevices_init);
-
-static int sabresd_postcore_init(void)
-{
- if (!of_machine_is_compatible("fsl,imx6q-sabresd"))
- return 0;
-
- imx6_init_lowlevel();
-
- barebox_set_hostname("sabresd");
-
- return 0;
-}
-postcore_initcall(sabresd_postcore_init);
diff --git a/arch/arm/boards/gk802/board.c b/arch/arm/boards/gk802/board.c
index facb92384f..9dd22533fc 100644
--- a/arch/arm/boards/gk802/board.c
+++ b/arch/arm/boards/gk802/board.c
@@ -69,19 +69,8 @@ static int gk802_env_init(void)
devfs_add_partition(bootsource_name, 0x00000, SZ_512K, DEVFS_PARTITION_FIXED, barebox_name);
devfs_add_partition(bootsource_name, SZ_512K, SZ_512K, DEVFS_PARTITION_FIXED, default_environment_name);
- return 0;
-}
-late_initcall(gk802_env_init);
-
-static int gk802_console_init(void)
-{
- if (!of_machine_is_compatible("zealz,imx6q-gk802"))
- return 0;
-
barebox_set_hostname("gk802");
- imx6_init_lowlevel();
-
return 0;
}
-postcore_initcall(gk802_console_init);
+late_initcall(gk802_env_init);
diff --git a/arch/arm/boards/guf-santaro/board.c b/arch/arm/boards/guf-santaro/board.c
index 9b5d09d678..8fbfe269b0 100644
--- a/arch/arm/boards/guf-santaro/board.c
+++ b/arch/arm/boards/guf-santaro/board.c
@@ -26,17 +26,6 @@
#include <mach/bbu.h>
#include <mach/imx6.h>
-static int santaro_postcore_init(void)
-{
- if (!of_machine_is_compatible("guf,imx6q-santaro"))
- return 0;
-
- imx6_init_lowlevel();
-
- return 0;
-}
-postcore_initcall(santaro_postcore_init);
-
static int santaro_device_init(void)
{
uint32_t flag_sd = 0, flag_emmc = 0;
diff --git a/arch/arm/boards/phytec-phycard-imx6/board.c b/arch/arm/boards/phytec-phycard-imx6/board.c
index 6ed431adcd..d425b48347 100644
--- a/arch/arm/boards/phytec-phycard-imx6/board.c
+++ b/arch/arm/boards/phytec-phycard-imx6/board.c
@@ -47,14 +47,3 @@ static int phytec_pcaaxl3_init(void)
return 0;
}
device_initcall(phytec_pcaaxl3_init);
-
-static int phytec_pcaaxl3_core_init(void)
-{
- if (!of_machine_is_compatible("phytec,imx6q-pcaaxl3"))
- return 0;
-
- imx6_init_lowlevel();
-
- return 0;
-}
-postcore_initcall(phytec_pcaaxl3_core_init);
diff --git a/arch/arm/boards/phytec-phyflex-imx6/board.c b/arch/arm/boards/phytec-phyflex-imx6/board.c
index c11f4c46ba..59e3f24c3c 100644
--- a/arch/arm/boards/phytec-phyflex-imx6/board.c
+++ b/arch/arm/boards/phytec-phyflex-imx6/board.c
@@ -71,14 +71,3 @@ static int phytec_pfla02_init(void)
return 0;
}
device_initcall(phytec_pfla02_init);
-
-static int phytec_pfla02_core_init(void)
-{
- if (!of_machine_is_compatible("phytec,imx6x-pbab01"))
- return 0;
-
- imx6_init_lowlevel();
-
- return 0;
-}
-postcore_initcall(phytec_pfla02_core_init);
diff --git a/arch/arm/boards/solidrun-hummingboard/board.c b/arch/arm/boards/solidrun-hummingboard/board.c
index 25b3c94560..4b0ea32040 100644
--- a/arch/arm/boards/solidrun-hummingboard/board.c
+++ b/arch/arm/boards/solidrun-hummingboard/board.c
@@ -72,6 +72,8 @@ static int hummingboard_device_init(void)
gpio_direction_output(IMX_GPIO_NR(3, 22), 1);
gpio_direction_output(IMX_GPIO_NR(1, 0), 1);
+ barebox_set_hostname("hummingboard");
+
return 0;
}
device_initcall(hummingboard_device_init);
@@ -87,16 +89,3 @@ static int hummingboard_late_init(void)
return 0;
}
late_initcall(hummingboard_late_init);
-
-static int hummingboard_lwl_init(void)
-{
- if (!of_machine_is_compatible("solidrun,hummingboard"))
- return 0;
-
- barebox_set_hostname("hummingboard");
-
- imx6_init_lowlevel();
-
- return 0;
-}
-postcore_initcall(hummingboard_lwl_init);
diff --git a/arch/arm/boards/tqma6x/board.c b/arch/arm/boards/tqma6x/board.c
index 6c574eaf2c..2118fb2721 100644
--- a/arch/arm/boards/tqma6x/board.c
+++ b/arch/arm/boards/tqma6x/board.c
@@ -113,17 +113,8 @@ static int tqma6x_env_init(void)
default_environment_path_set("/dev/mmc2.boot1");
- return 0;
-}
-late_initcall(tqma6x_env_init);
-
-static int tqma6x_core_init(void)
-{
- if (!of_machine_is_compatible("tq,mba6x"))
- return 0;
-
- imx6_init_lowlevel();
+ barebox_set_hostname("mba6x");
return 0;
}
-postcore_initcall(tqma6x_core_init);
+late_initcall(tqma6x_env_init);
diff --git a/arch/arm/boards/udoo/board.c b/arch/arm/boards/udoo/board.c
index 3846d4b1b8..d2f558e7f4 100644
--- a/arch/arm/boards/udoo/board.c
+++ b/arch/arm/boards/udoo/board.c
@@ -164,6 +164,7 @@ static int udoo_devices_init(void)
udoo_epit_init();
armlinux_set_bootparams((void *)0x10000100);
+ barebox_set_hostname("udoo");
return 0;
}
@@ -179,16 +180,3 @@ static int udoo_coredevices_init(void)
return 0;
}
coredevice_initcall(udoo_coredevices_init);
-
-static int udoo_postcore_init(void)
-{
- if (!of_machine_is_compatible("udoo,imx6qdl-udoo"))
- return 0;
-
- imx6_init_lowlevel();
-
- barebox_set_hostname("udoo");
-
- return 0;
-}
-postcore_initcall(udoo_postcore_init);
diff --git a/arch/arm/boards/variscite-mx6/board.c b/arch/arm/boards/variscite-mx6/board.c
index 592b1116e7..ce1284ff78 100644
--- a/arch/arm/boards/variscite-mx6/board.c
+++ b/arch/arm/boards/variscite-mx6/board.c
@@ -120,16 +120,3 @@ static int variscite_custom_init(void)
return 0;
}
device_initcall(variscite_custom_init);
-
-static int variscite_custom_core_init(void)
-{
- if (!of_machine_is_compatible("variscite,imx6q-custom"))
- return 0;
-
- imx6_init_lowlevel();
-
- pr_debug("Completing custom_core_init()\n");
-
- return 0;
-}
-postcore_initcall(variscite_custom_core_init);
diff --git a/arch/arm/mach-imx/imx6.c b/arch/arm/mach-imx/imx6.c
index fabc1614a3..ec5e1416f3 100644
--- a/arch/arm/mach-imx/imx6.c
+++ b/arch/arm/mach-imx/imx6.c
@@ -114,6 +114,8 @@ int imx6_init(void)
u32 rev;
u32 mx6_silicon_revision;
+ imx6_init_lowlevel();
+
imx6_boot_save_loc((void *)MX6_SRC_BASE_ADDR);
rev = readl(MX6_ANATOP_BASE_ADDR + SI_REV);