Skip to contentSkip to conversation

arm: imx6: move imx6_init_lowlevel to single initcall

PATCH In review Lucas Stach 3 participants 8 messages Jun 24, 2014 – Jul 1, 2014

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 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.

---
 arch/arm/boards/boundarydevices-nitrogen6x/board.c | 16 ++----------
 arch/arm/boards/datamodul-edm-qmx6/board.c         | 13 +---------
 arch/arm/boards/embest-riotboard/board.c           | 13 +---------
 arch/arm/boards/freescale-mx6-sabrelite/board.c    | 13 +---------
 arch/arm/boards/freescale-mx6-sabresd/board.c      | 14 +---------
 arch/arm/boards/gk802/board.c                      | 13 +---------
 arch/arm/boards/guf-santaro/board.c                | 11 --------
 arch/arm/boards/phytec-phycard-imx6/board.c        | 11 --------
 arch/arm/boards/phytec-phyflex-imx6/board.c        | 11 --------
 arch/arm/boards/solidrun-hummingboard/board.c      | 15 ++---------
 arch/arm/boards/tqma6x/board.c                     | 13 ++--------
 arch/arm/boards/udoo/board.c                       | 14 +---------
 arch/arm/boards/variscite-mx6/board.c              | 13 ----------
 arch/arm/mach-imx/Makefile                         |  2 +-
 arch/arm/mach-imx/imx6-of-initcalls.c              | 30 ++++++++++++++++++++++
 15 files changed, 43 insertions(+), 159 deletions(-)
 create mode 100644 arch/arm/mach-imx/imx6-of-initcalls.c
arch/arm/boards/boundarydevices-nitrogen6x/board.c +2 -14
index 95c8567..347fd91 100644
@@ -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);
arch/arm/boards/datamodul-edm-qmx6/board.c +1 -12
index 26757eb..e388e28 100644
@@ -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);
arch/arm/boards/embest-riotboard/board.c +1 -12
index 3c28aa1..3f5b4de 100644
@@ -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);
arch/arm/boards/freescale-mx6-sabrelite/board.c +1 -12
index 178fed6..1f26548 100644
@@ -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);
arch/arm/boards/freescale-mx6-sabresd/board.c +1 -13
index 4e4ce7a..53aada7 100644
@@ -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);
arch/arm/boards/gk802/board.c +1 -12
index facb923..9dd2253 100644
@@ -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);
arch/arm/boards/guf-santaro/board.c +0 -11
index 9b5d09d..8fbfe26 100644
@@ -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;
arch/arm/boards/phytec-phycard-imx6/board.c +0 -11
index 6ed431a..d425b48 100644
@@ -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);
arch/arm/boards/phytec-phyflex-imx6/board.c +0 -11
index c11f4c4..59e3f24 100644
@@ -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);
arch/arm/boards/solidrun-hummingboard/board.c +2 -13
index 25b3c94..4b0ea32 100644
@@ -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);
arch/arm/boards/tqma6x/board.c +2 -11
index 6c574ea..2118fb2 100644
@@ -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);
arch/arm/boards/udoo/board.c +1 -13
index 3846d4b..d2f558e 100644
@@ -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);
arch/arm/boards/variscite-mx6/board.c +0 -13
index 592b111..ce1284f 100644
@@ -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);
arch/arm/mach-imx/Makefile +1 -1
index 03e5b10..f8796a2 100644
@@ -9,7 +9,7 @@ obj-$(CONFIG_ARCH_IMX51) += imx51.o imx5.o clk-imx5.o
 pbl-$(CONFIG_ARCH_IMX51) += imx51.o imx5.o
 obj-$(CONFIG_ARCH_IMX53) += imx53.o imx5.o clk-imx5.o esdctl-v4.o
 pbl-$(CONFIG_ARCH_IMX53) += imx53.o imx5.o esdctl-v4.o
-obj-$(CONFIG_ARCH_IMX6) += imx6.o usb-imx6.o clk-imx6.o
+obj-$(CONFIG_ARCH_IMX6) += imx6.o usb-imx6.o clk-imx6.o imx6-of-initcalls.o
 lwl-$(CONFIG_ARCH_IMX6) += imx6-mmdc.o
 obj-$(CONFIG_IMX_IIM)	+= iim.o
 obj-$(CONFIG_IMX_OCOTP)	+= ocotp.o
arch/arm/mach-imx/imx6-of-initcalls.c new file +30 -0
new file mode 100644
index 0000000..297b964
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2014 Lucas Stach <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <common.h>
+#include <init.h>
+#include <mach/imx6.h>
+#include <of.h>
+
+static int imx6_postcore_init(void)
+{
+	if (!of_machine_is_compatible("fsl,imx6dl") &&
+	    !of_machine_is_compatible("fsl,imx6q"))
+		return 0;
+
+	imx6_init_lowlevel();
+
+	return 0;
+}
+postcore_initcall(imx6_postcore_init);
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 2/3 arm: imx6: rename hummingboard directory to microsom

The rule in barebox is to name the directories after the modules. As hummingboard is just one of the carriers for the MicroSOM module, name the directory accordingly.

---
 arch/arm/boards/Makefile                                            | 2 +-
 .../boards/{solidrun-hummingboard => solidrun-microsom}/Makefile    | 0
 .../arm/boards/{solidrun-hummingboard => solidrun-microsom}/board.c | 0
 .../flash-header-solidrun-hummingboard.imxcfg                       | 0
 .../boards/{solidrun-hummingboard => solidrun-microsom}/lowlevel.c  | 0
 arch/arm/configs/imx_v7_defconfig                                   | 2 +-
 arch/arm/dts/Makefile                                               | 2 +-
 arch/arm/mach-imx/Kconfig                                           | 4 ++--
 images/Makefile.imx                                                 | 6 +++---
 9 files changed, 8 insertions(+), 8 deletions(-)
 rename arch/arm/boards/{solidrun-hummingboard => solidrun-microsom}/Makefile (100%)
 rename arch/arm/boards/{solidrun-hummingboard => solidrun-microsom}/board.c (100%)
 rename arch/arm/boards/{solidrun-hummingboard => solidrun-microsom}/flash-header-solidrun-hummingboard.imxcfg (100%)
 rename arch/arm/boards/{solidrun-hummingboard => solidrun-microsom}/lowlevel.c (100%)
arch/arm/boards/Makefile +1 -1
index 4eccc92..b8bfb84 100644
@@ -88,7 +88,7 @@ obj-$(CONFIG_MACH_SAMA5D3_XPLAINED)		+= sama5d3_xplained/
 obj-$(CONFIG_MACH_SCB9328)			+= scb9328/
 obj-$(CONFIG_MACH_SOCFPGA_EBV_SOCRATES)		+= ebv-socrates/
 obj-$(CONFIG_MACH_SOCFPGA_TERASIC_SOCKIT)	+= terasic-sockit/
-obj-$(CONFIG_MACH_SOLIDRUN_HUMMINGBOARD)	+= solidrun-hummingboard/
+obj-$(CONFIG_MACH_SOLIDRUN_MICROSOM)		+= solidrun-microsom/
 obj-$(CONFIG_MACH_TNY_A9260)			+= tny-a926x/
 obj-$(CONFIG_MACH_TNY_A9263)			+= tny-a926x/
 obj-$(CONFIG_MACH_TNY_A9G20)			+= tny-a926x/
arch/arm/boards/solidrun-microsom/Makefile renamed from arch/arm/boards/solidrun-hummingboard/Makefile +0 -0
similarity index 100%
rename from arch/arm/boards/solidrun-hummingboard/Makefile
rename to arch/arm/boards/solidrun-microsom/Makefile
arch/arm/boards/solidrun-microsom/board.c renamed from arch/arm/boards/solidrun-hummingboard/board.c +0 -0
similarity index 100%
rename from arch/arm/boards/solidrun-hummingboard/board.c
rename to arch/arm/boards/solidrun-microsom/board.c
arch/arm/boards/solidrun-microsom/flash-header-solidrun-hummingboard.imxcfg renamed from arch/arm/boards/solidrun-hummingboard/flash-header-solidrun-hummingboard.imxcfg +0 -0
similarity index 100%
rename from arch/arm/boards/solidrun-hummingboard/flash-header-solidrun-hummingboard.imxcfg
rename to arch/arm/boards/solidrun-microsom/flash-header-solidrun-hummingboard.imxcfg
arch/arm/boards/solidrun-microsom/lowlevel.c renamed from arch/arm/boards/solidrun-hummingboard/lowlevel.c +0 -0
similarity index 100%
rename from arch/arm/boards/solidrun-hummingboard/lowlevel.c
rename to arch/arm/boards/solidrun-microsom/lowlevel.c
arch/arm/configs/imx_v7_defconfig +1 -1
index 8e0508e..66fc123 100644
@@ -15,7 +15,7 @@ CONFIG_MACH_TQMA6X=y
 CONFIG_MACH_SABRELITE=y
 CONFIG_MACH_SABRESD=y
 CONFIG_MACH_NITROGEN6X=y
-CONFIG_MACH_SOLIDRUN_HUMMINGBOARD=y
+CONFIG_MACH_SOLIDRUN_MICROSOM=y
 CONFIG_MACH_EMBEST_RIOTBOARD=y
 CONFIG_MACH_UDOO=y
 CONFIG_MACH_VARISCITE_MX6=y
arch/arm/dts/Makefile +1 -1
index bb6c622..e2f5288 100644
@@ -67,7 +67,7 @@ pbl-$(CONFIG_MACH_TX25) += imx25-karo-tx25.dtb.o
 pbl-$(CONFIG_MACH_RADXA_ROCK) += rk3188-radxarock.dtb.o
 pbl-$(CONFIG_MACH_SOCFPGA_EBV_SOCRATES) += socfpga_cyclone5_socrates.dtb.o
 pbl-$(CONFIG_MACH_SOCFPGA_TERASIC_SOCKIT) += socfpga_cyclone5_sockit.dtb.o
-pbl-$(CONFIG_MACH_SOLIDRUN_HUMMINGBOARD) += imx6dl-hummingboard.dtb.o
+pbl-$(CONFIG_MACH_SOLIDRUN_MICROSOM) += imx6dl-hummingboard.dtb.o
 pbl-$(CONFIG_MACH_SABRELITE) += imx6q-sabrelite.dtb.o imx6dl-sabrelite.dtb.o
 pbl-$(CONFIG_MACH_SABRESD) += imx6q-sabresd.dtb.o
 pbl-$(CONFIG_MACH_GUF_SANTARO) += imx6q-guf-santaro.dtb.o
arch/arm/mach-imx/Kconfig +2 -2
index 3b85f45..dfaaeec 100644
@@ -260,8 +260,8 @@ config MACH_NITROGEN6X
 	bool "BoundaryDevices Nitrogen6x"
 	select ARCH_IMX6
 
-config MACH_SOLIDRUN_HUMMINGBOARD
-	bool "SolidRun Hummingboard"
+config MACH_SOLIDRUN_MICROSOM
+	bool "SolidRun MicroSOM based devices"
 	select ARCH_IMX6
 
 config MACH_EMBEST_RIOTBOARD
images/Makefile.imx +3 -3
index 5085a55..0e96c1f 100644
@@ -146,10 +146,10 @@ CFG_start_imx6q_sabresd.pblx.imximg = $(board)/freescale-mx6-sabresd/flash-heade
 FILE_barebox-freescale-imx6q-sabresd.img = start_imx6q_sabresd.pblx.imximg
 image-$(CONFIG_MACH_SABRESD) += barebox-freescale-imx6q-sabresd.img
 
-pblx-$(CONFIG_MACH_SOLIDRUN_HUMMINGBOARD) += start_imx6dl_hummingboard
-CFG_start_imx6dl_hummingboard.pblx.imximg = $(board)/solidrun-hummingboard/flash-header-solidrun-hummingboard.imxcfg
+pblx-$(CONFIG_MACH_SOLIDRUN_MICROSOM) += start_imx6dl_hummingboard
+CFG_start_imx6dl_hummingboard.pblx.imximg = $(board)/solidrun-microsom/flash-header-solidrun-hummingboard.imxcfg
 FILE_barebox-solidrun-imx6dl-hummingboard.img = start_imx6dl_hummingboard.pblx.imximg
-image-$(CONFIG_MACH_SOLIDRUN_HUMMINGBOARD) += barebox-solidrun-imx6dl-hummingboard.img
+image-$(CONFIG_MACH_SOLIDRUN_MICROSOM) += barebox-solidrun-imx6dl-hummingboard.img
 
 pblx-$(CONFIG_MACH_NITROGEN6X) += start_imx6q_nitrogen6x_1g
 CFG_start_imx6q_nitrogen6x_1g.pblx.imximg = $(board)/boundarydevices-nitrogen6x/flash-header-nitrogen6x-1g.imxcfg
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 3/3 scripts: tegra: add gitignore

In reply to Lucas Stach

Keep the git status area clean of generated binaries.

---
 scripts/tegra/.gitignore | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 scripts/tegra/.gitignore
scripts/tegra/.gitignore new file +1 -0
new file mode 100644
index 0000000..5d5891b
@@ -0,0 +1 @@
+cbootimage
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
maintainer
#3 lore raw
In reply to Lucas Stach
Quoted 11 lines · Lucas Stach

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.

You could also call imx6_init_lowlevel from imx6_init which is also called at postcore_initcall time.

At the moment are boards are free to:

- replace imx6_init_lowlevel with their own version
- Call imx6_init_lowlevel earlier

I hope we won't regret this change when we get some special board.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

Hmm, I have removed the imx6_init_lowlevel() from my (out-of-tree) board.c file. Still I get this warning:

__request_region: 0x10000000:0x4fffffff conflicts with 0x10000000:0x4fffffff

Could this be related to your patchset? In the log below, the text " ahs2_postcore_init, after barebox_set_hostname()" is a printf() directly before the return of that function.

Switch to console [cs0]
in ahs2_postcore_init
ahs2_postcore_init, after barebox_set_hostname()
detected i.MX6 Quad revision 1.2
Switch to console [cs0]
in ahs2_postcore_init
ahs2_postcore_init, after barebox_set_hostname()
detected i.MX6 Quad revision 1.2
__request_region: 0x10000000:0x4fffffff conflicts with 0x10000000:0x4fffffff
mdio_bus: miibus0: probed
m25p80 spiflash@00: n25q512 (65536 Kbytes)
imx-esdhc 2194000.usdhc: registered as 2194000.usdhc
imx-esdhc 219c000.usdhc: registered as 219c000.usdhc

When I remove

    memory {
      reg = <0x10000000 0x40000000>;
    };

from my DTS, then the error vanishes, but how could some other part in barebox possible know how much memory my board has?

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

maintainer
#5 lore raw
Quoted 24 lines · Holger Schurig

Hmm, I have removed the imx6_init_lowlevel() from my (out-of-tree) board.c file. Still I get this warning:

__request_region: 0x10000000:0x4fffffff conflicts with 0x10000000:0x4fffffff

Could this be related to your patchset? In the log below, the text " ahs2_postcore_init, after barebox_set_hostname()" is a printf() directly before the return of that function.

Switch to console [cs0]
in ahs2_postcore_init
ahs2_postcore_init, after barebox_set_hostname()
detected i.MX6 Quad revision 1.2
Switch to console [cs0]
in ahs2_postcore_init
ahs2_postcore_init, after barebox_set_hostname()
detected i.MX6 Quad revision 1.2
__request_region: 0x10000000:0x4fffffff conflicts with 0x10000000:0x4fffffff
mdio_bus: miibus0: probed
m25p80 spiflash@00: n25q512 (65536 Kbytes)
imx-esdhc 2194000.usdhc: registered as 2194000.usdhc
imx-esdhc 219c000.usdhc: registered as 219c000.usdhc

Quoted 8 lines

When I remove

    memory {
      reg = <0x10000000 0x40000000>;
    };

from my DTS, then the error vanishes, but how could some other part in barebox possible know how much memory my board has?

The values are read back from the SDRAM controller, see arch/arm/mach-imx/esdctl.c.

The idea was that the SDRAM should be used from the SDRAM controller or the DTS. That worked well and nobody noticed until the warning about conflicting resources was introduced...

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
maintainer
#7 lore raw
In reply to Sascha Hauer
Quoted 7 lines · Sascha Hauer
Quoted 6 lines · Lucas Stach

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.

Quoted 8 lines
Quoted 5 lines

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.

You could also call imx6_init_lowlevel from imx6_init which is also called at postcore_initcall time.

Applied this series with this change.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox