Support for Voipac X53-DMM-668 module and Voipac Baseboard
Subsystems (5)
cover Support for Voipac X53-DMM-668 module and Voipac Baseboard
The first patch modifies the general imx53.dtsi file. The reason is to make it possible to add Devicetree definition for the board (later in this patch) as a copy from the Linux kernel -- such a DTS can be used also to boot Linux kernel.
I am not sure if this should be in a separate patch or if this file (imx53.dtsi) is being regularly mirrored from the Linux kernel.
The second patch modifies the IMX FEC driver to make it possible to parse the gpio reset pin from the Devicetree and perform the reset in the driver (thus saving unnecessary code duplication in different board.c files). The added code is very similar to one in Linux kernel driver.
The 3rd patch adds the Devicetree definition for the Voipac x53-dmm-668 module (equipped with i.mx53 CPU) and Voipac Baseboard. More info about the module might be found at:
http://www.voipac.com/#X53-DMM-668
The DTS files have already been accepted to Linux kernel (waiting in linux-next). The rest is the necessary hardware initialization etc. The devices successfully initialized (and tested) are uart0 and Ethernet.
Rostislav Lisovy (3):
ARM: dts: i.mx53: Internal keyboard controller + i2c pinmux
ARM: i.mx53: Parse Reset GPIO pin in FEC driver from Devicetree
ARM: i.mx53: Support for Voipac board. Device definition is read from
Devicetree
arch/arm/boards/Makefile | 1 + arch/arm/boards/freescale-mx53-vmx53/Makefile | 3 + arch/arm/boards/freescale-mx53-vmx53/board.c | 42 +++++ arch/arm/boards/freescale-mx53-vmx53/env/config | 46 +++++ .../arm/boards/freescale-mx53-vmx53/flash_header.c | 103 ++++++++++ arch/arm/boards/freescale-mx53-vmx53/lowlevel.c | 9 + arch/arm/dts/Makefile | 4 +- arch/arm/dts/imx53-voipac-bsb.dts | 135 ++++++++++++++ arch/arm/dts/imx53-voipac-dmm-668.dtsi | 196 ++++++++++++++++++++ arch/arm/dts/imx53.dtsi | 15 ++ arch/arm/mach-imx/Kconfig | 9 + drivers/net/fec_imx.c | 21 +++ 12 files changed, 583 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boards/freescale-mx53-vmx53/Makefile create mode 100644 arch/arm/boards/freescale-mx53-vmx53/board.c create mode 100644 arch/arm/boards/freescale-mx53-vmx53/env/config create mode 100644 arch/arm/boards/freescale-mx53-vmx53/flash_header.c create mode 100644 arch/arm/boards/freescale-mx53-vmx53/lowlevel.c create mode 100644 arch/arm/dts/imx53-voipac-bsb.dts create mode 100644 arch/arm/dts/imx53-voipac-dmm-668.dtsi
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/3 ARM: dts: i.mx53: Internal keyboard controller + i2c pinmux
arch/arm/dts/imx53.dtsi +15 -0
@@ -269,6 +269,14 @@ #interrupt-cells = <2>; }; + kpp: kpp@53f94000 { + compatible = "fsl,imx53-kpp", "fsl,imx21-kpp"; + reg = <0x53f94000 0x4000>; + interrupts = <60>; + clocks = <&clks 0>; + status = "disabled"; + }; + wdog1: wdog@53f98000 { compatible = "fsl,imx53-wdt", "fsl,imx21-wdt"; reg = <0x53f98000 0x4000>;
@@ -587,6 +595,13 @@ MX53_PAD_GPIO_5__I2C3_SCL 0xc0000000 >; }; + + pinctrl_i2c3_2: i2c3grp-2 { + fsl,pins = < + MX53_PAD_GPIO_3__I2C3_SCL 0xc0000000 + MX53_PAD_GPIO_6__I2C3_SDA 0xc0000000 + >; + }; }; ipu_disp0 {
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/3 ARM: i.mx53: Parse Reset GPIO pin in FEC driver from Devicetree
In reply to Rostislav Lisovydrivers/net/fec_imx.c +21 -0
@@ -27,6 +27,8 @@#include <linux/clk.h> #include <linux/err.h> #include <of_net.h> +#include <of_gpio.h> +#include <gpio.h> #include <asm/mmu.h>
@@ -643,6 +645,9 @@ static int fec_probe(struct device_d *dev)void *base;int ret;enum fec_type type; +#ifdef CONFIG_OFDEVICE +int phy_reset; +#endif ret =dev_get_drvdata (dev, (unsigned long *)&type);if (ret)
@@ -671,6 +676,22 @@ static int fec_probe(struct device_d *dev) fec->regs =dev_request_mem_region (dev,0 ); +#ifdef CONFIG_OFDEVICE + phy_reset =of_get_named_gpio (dev->device_node,"phy-reset-gpios" ,0 ); +if (!gpio_is_valid (phy_reset)) + goto err_free; + + ret =gpio_request (phy_reset,"phy-reset" ); +if (ret) { +pr_err ("Can not request gpio %d (phy-reset): %d\n" , phy_reset, ret); + goto err_free; + } + +gpio_direction_output (phy_reset,0 ); +udelay (10 ); +gpio_set_value (phy_reset,1 ); +#endif +/* Reset chip. */ writel (FEC_ECNTRL_RESET , fec->regs +FEC_ECNTRL );while (readl (fec->regs +FEC_ECNTRL ) &1 ) {
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/3] ARM: i.mx53: Parse Reset GPIO pin in FEC driver from Devicetree
Quoted 26 lines · Rostislav Lisovy
Signed-off-by Rostislav Lisovy <[email protected]>drivers/net/fec_imx.c +5
-0@@ -27,6 +27,8 @@#include <linux/clk.h> #include <linux/err.h> #include <of_net.h> +#include <of_gpio.h> +#include <gpio.h> #include <asm/mmu.h> @@ -643,6 +645,9 @@ static int fec_probe(struct device_d *dev)void *base;int ret;enum fec_type type; +#ifdef CONFIG_OFDEVICE +int phy_reset; +#endif ret =dev_get_drvdata (dev, (unsigned long *)&type);if (ret)
drivers/net/fec_imx.c static int fec_probe(struct device_d *dev) · line 679
Quoted 4 lines
drivers/net/fec_imx.c +1
-0@@ -671,6 +676,22 @@ static int fec_probe(struct device_d *dev) fec->regs =dev_request_mem_region (dev,0 ); +#ifdef CONFIG_OFDEVICE
use if (IS_ENABLED(CONFIG_OFDEVICE))
so we can improve the code coverage
drivers/net/fec_imx.c static int fec_probe(struct device_d *dev) · line 690
Quoted 11 lines
drivers/net/fec_imx.c +11
-0+ phy_reset =of_get_named_gpio (dev->device_node,"phy-reset-gpios" ,0 ); +if (!gpio_is_valid (phy_reset)) + goto err_free; + + ret =gpio_request (phy_reset,"phy-reset" ); +if (ret) { +pr_err ("Can not request gpio %d (phy-reset): %d\n" , phy_reset, ret); + goto err_free; + } + +gpio_direction_output (phy_reset,0 );
you need to check the return too
Quoted 15 lines
drivers/net/fec_imx.c +4
-0+udelay (10 ); +gpio_set_value (phy_reset,1 ); +#endif +/* Reset chip. */ writel (FEC_ECNTRL_RESET , fec->regs +FEC_ECNTRL );while (readl (fec->regs +FEC_ECNTRL ) &1 ) {Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/3] ARM: i.mx53: Parse Reset GPIO pin in FEC driver from Devicetree
Hello Jean-Christophe and Rosta,
Quoted 11 lines · On Tuesday 05 of November 2013 17:15:16 Jean-Christophe PLAGNIOL-VILLARD wrote:
Quoted 10 lines · Rostislav Lisovy
Signed-off-by Rostislav Lisovy <[email protected]>drivers/net/fec_imx.c +0
-0@@ -671,6 +676,22 @@ static int fec_probe(struct device_d *dev) fec->regs =dev_request_mem_region (dev,0 );
Quoted 7 lines
drivers/net/fec_imx.c static int fec_probe(struct device_d *dev) · line 679
Quoted 1 line
drivers/net/fec_imx.c +1
-0+#ifdef CONFIG_OFDEVICE use if (
IS_ENABLED(CONFIG_OFDEVICE))so we can improve the code coverage
drivers/net/fec_imx.c static int fec_probe(struct device_d *dev) · line 680
Quoted 1 line
drivers/net/fec_imx.c +1
-0+ phy_reset =of_get_named_gpio (dev->device_node,"phy-reset-gpios" ,0 );
I have question if the missing definition of reset pin should/must lead to whole ethernet interface removal/initialization abort.
I think, that there can be design where PHY reset is not controlled by MCU pin (it is usually possible even reset device through MDIO) and then it would be better to check if "phy-reset-gpios" is present and if not then skip whole attempt to manipulate GPIO.
On the other hand if "phy-reset-gpios", it is required to configure it, because default pin state can/should lead to PHY reset.
I.e.
if (IS_ENABLED(CONFIG_OFDEVICE))
phy_reset = of_get_named_gpio(dev->device_node, "phy-reset-gpios", 0);
if(phy_reset < 0) {
print info ("\"phy-reset-gpios\" is not used for i.MX fec, skipping forced
reset\n")
} else {Quoted 13 lines
drivers/net/fec_imx.c static int fec_probe(struct device_d *dev) · line 690
Quoted 10 lines
drivers/net/fec_imx.c +10
-0+if (!gpio_is_valid (phy_reset)) + goto err_free; + + ret =gpio_request (phy_reset,"phy-reset" ); +if (ret) { +pr_err ("Can not request gpio %d (phy-reset): %d\n" , phy_reset, ret); + goto err_free; + } + +gpio_direction_output (phy_reset,0 );you need to check the return too
Quoted 2 lines
drivers/net/fec_imx.c static int fec_probe(struct device_d *dev) · line 692
Quoted 2 lines
drivers/net/fec_imx.c +2
-0+udelay (10 ); +gpio_set_value (phy_reset,1 );
}
}
Quoted 4 lines
drivers/net/fec_imx.c static int fec_probe(struct device_d *dev) · line 697
Quoted 4 lines
drivers/net/fec_imx.c +1
-0+/* Reset chip. */ writel (FEC_ECNTRL_RESET , fec->regs +FEC_ECNTRL );while (readl (fec->regs +FEC_ECNTRL ) &1 ) {
Best wishes,
Pavel
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
maintainerRe: [PATCH 2/3] ARM: i.mx53: Parse Reset GPIO pin in FEC driver from Devicetree
Hi Pavel,
Quoted 19 lines · Pavel Pisa
Hello Jean-Christophe and Rosta,
Quoted 15 lines · On Tuesday 05 of November 2013 17:15:16 Jean-Christophe PLAGNIOL-VILLARD wrote:
drivers/net/fec_imx.c static int fec_probe(struct device_d *dev) · line 679
Quoted 11 lines · Rostislav Lisovy
Signed-off-by Rostislav Lisovy <[email protected]>drivers/net/fec_imx.c +1
-0@@ -671,6 +676,22 @@ static int fec_probe(struct device_d *dev) fec->regs =dev_request_mem_region (dev,0 ); +#ifdef CONFIG_OFDEVICE use if (
IS_ENABLED(CONFIG_OFDEVICE))
Quoted 6 lines
Quoted 3 lines
so we can improve the code coverage
drivers/net/fec_imx.c static int fec_probe(struct device_d *dev) · line 680
Quoted 1 line
drivers/net/fec_imx.c +1
-0+ phy_reset =of_get_named_gpio (dev->device_node,"phy-reset-gpios" ,0 );I have question if the missing definition of reset pin should/must lead to whole ethernet interface removal/initialization abort.
Thanks for spotting. The gpio pin should indeed be optional. The driver should only fail if the gpio is specified, but not working. It should not fail if there's no gpio specified at all.
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
PATCH 3/3 ARM: i.mx53: Support for Voipac board. Device definition is read from Devicetree
In reply to Rostislav Lisovycreate mode 100644 arch/arm/boards/freescale-mx53-vmx53/Makefile create mode 100644 arch/arm/boards/freescale-mx53-vmx53/board.c create mode 100644 arch/arm/boards/freescale-mx53-vmx53/env/config create mode 100644 arch/arm/boards/freescale-mx53-vmx53/flash_header.c create mode 100644 arch/arm/boards/freescale-mx53-vmx53/lowlevel.c create mode 100644 arch/arm/dts/imx53-voipac-bsb.dts create mode 100644 arch/arm/dts/imx53-voipac-dmm-668.dtsi
arch/arm/boards/Makefile +1 -0
@@ -36,6 +36,7 @@ obj-$(CONFIG_MACH_FREESCALE_MX35_3STACK) += freescale-mx35-3-stack/ obj-$(CONFIG_MACH_FREESCALE_MX51_PDK) += freescale-mx51-pdk/ obj-$(CONFIG_MACH_FREESCALE_MX53_LOCO) += freescale-mx53-loco/ obj-$(CONFIG_MACH_FREESCALE_MX53_SMD) += freescale-mx53-smd/ +obj-$(CONFIG_MACH_FREESCALE_MX53_VMX53) += freescale-mx53-vmx53/ obj-$(CONFIG_MACH_GE863) += telit-evk-pro3/ obj-$(CONFIG_MACH_GK802) += gk802/ obj-$(CONFIG_MACH_GUF_CUPID) += guf-cupid/
arch/arm/boards/freescale-mx53-vmx53/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +obj-y += board.o +lwl-y += flash_header.o +lwl-y += lowlevel.o
arch/arm/boards/freescale-mx53-vmx53/board.c new file +42 -0
42 lines not on this page · raw message
arch/arm/boards/freescale-mx53-vmx53/env/config new file +46 -0
46 lines not on this page · raw message
arch/arm/boards/freescale-mx53-vmx53/flash_header.c new file +103 -0
103 lines not on this page · raw message
arch/arm/boards/freescale-mx53-vmx53/lowlevel.c new file +9 -0
@@ -0,0 +1,9 @@ +#include <common.h> +#include <mach/esdctl.h> +#include <asm/barebox-arm-head.h> + +void __naked barebox_arm_reset_vector (void ) +{ +arm_cpu_lowlevel_init (); +imx53_barebox_entry (0 ); +}
arch/arm/dts/Makefile +3 -1
@@ -1,6 +1,7 @@ dtb-$(CONFIG_ARCH_IMX51) += imx51-babbage.dtb \ imx51-genesi-efika-sb.dtb -dtb-$(CONFIG_ARCH_IMX53) += imx53-qsb.dtb +dtb-$(CONFIG_ARCH_IMX53) += imx53-qsb.dtb \ + imx53-voipac-bsb.dtb dtb-$(CONFIG_ARCH_IMX6) += imx6q-gk802.dtb \ imx6dl-dfi-fs700-m60-6s.dtb \ imx6q-dfi-fs700-m60-6q.dtb \
@@ -23,6 +24,7 @@ obj-$(CONFIG_BUILTIN_DTB) += $(BUILTIN_DTB).dtb.o pbl-$(CONFIG_MACH_EFIKA_MX_SMARTBOOK) += imx51-genesi-efika-sb.dtb.o pbl-$(CONFIG_MACH_FREESCALE_MX51_PDK) += imx51-babbage.dtb.o pbl-$(CONFIG_MACH_FREESCALE_MX53_LOCO) += imx53-qsb.dtb.o +pbl-$(CONFIG_MACH_FREESCALE_MX53_VMX53) += imx53-voipac-bsb.dtb.o pbl-$(CONFIG_MACH_DFI_FS700_M60) += imx6q-dfi-fs700-m60-6q.dtb.o imx6dl-dfi-fs700-m60-6s.dtb.o pbl-$(CONFIG_MACH_PHYTEC_PFLA02) += imx6q-phytec-pbab01.dtb.o pbl-$(CONFIG_MACH_REALQ7) += imx6q-dmo-realq7.dtb.o
arch/arm/dts/imx53-voipac-bsb.dts new file +135 -0
135 lines not on this page · raw message
arch/arm/dts/imx53-voipac-dmm-668.dtsi new file +196 -0
196 lines not on this page · raw message
arch/arm/mach-imx/Kconfig +9 -0
@@ -20,6 +20,7 @@ config ARCH_TEXT_BASE default 0x97f00000 if MACH_FREESCALE_MX51_PDK default 0x7ff00000 if MACH_FREESCALE_MX53_LOCO default 0x7ff00000 if MACH_FREESCALE_MX53_SMD + default 0x7ff00000 if MACH_FREESCALE_MX53_VMX53 default 0x87f00000 if MACH_GUF_CUPID default 0x93d00000 if MACH_TX25 default 0x7ff00000 if MACH_TQMA53
@@ -426,6 +427,14 @@ config MACH_FREESCALE_MX53_SMD bool "Freescale i.MX53 SMD" select ARCH_IMX53 +config MACH_FREESCALE_MX53_VMX53 + bool "Voipac i.MX53" + select ARCH_IMX53 + select HAVE_DEFAULT_ENVIRONMENT_NEW + help + Say Y here if you are using the Voipac Technologies VMX53 module + equipped with a Freescale i.MX53 Processor + config MACH_TQMA53 bool "TQ i.MX53 TQMa53" select ARCH_IMX53
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
maintainerRe: [PATCH 3/3] ARM: i.mx53: Support for Voipac board. Device definition is read from Devicetree
Hi Rostislav,
arch/arm/boards/freescale-mx53-vmx53/env/config
Quoted 7 lines · Rostislav Lisovy
Signed-off-by Rostislav Lisovy <[email protected]>arch/arm/boards/freescale-mx53-vmx53/env/config new file +0
-0
Why not use defenv-2?
arch/arm/boards/freescale-mx53-vmx53/flash_header.c
Quoted 5 lines
arch/arm/boards/freescale-mx53-vmx53/flash_header.c new file +0
-0
I'm currently generating the flash images for new boards using the imx-image tool and also generate multi board images. This is a very flexible, though maybe hard to understand mechanism. Is this the reason you haven't used it or were you not aware of it?
I would rather see this board taking part in this new mechanism. Are you willing to port this over? Otherwise I could try and convert this patch, but I would depend on you testing the result.
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
Re: [PATCH 3/3] ARM: i.mx53: Support for Voipac board. Device definition is read from Devicetree
Hello Sascha;
Quoted 5 lines · Sascha Hauer
Hi Rostislav,
Quoted 2 lines · Rostislav Lisovy
Signed-off-by Rostislav Lisovy <[email protected]>
Quoted 7 lines
arch/arm/boards/freescale-mx53-vmx53/env/config
Quoted 5 lines
arch/arm/boards/freescale-mx53-vmx53/env/config new file +0
-0Why not use defenv-2?
Ok; I will use it;
Quoted 14 lines
arch/arm/boards/freescale-mx53-vmx53/flash_header.c
Quoted 6 lines
arch/arm/boards/freescale-mx53-vmx53/flash_header.c new file +0
-0I'm currently generating the flash images for new boards using the imx-image tool and also generate multi board images. This is a very flexible, though maybe hard to understand mechanism. Is this the reason you haven't used it or were you not aware of it?
I would rather see this board taking part in this new mechanism. Are you willing to port this over? Otherwise I could try and convert this patch, but I would depend on you testing the result.
I was investigating how the imx53-loco support is done, however I was not sure if the 'multiboard' is the preferred way.
I found your patchset
http://www.spinics.net/lists/u-boot-v2/msg15296.html shortly describing the functionality of the multiboard barebox -- I still do not understand the concept. The final binary has to hold just one particular 'flash_header', thus be able to boot just on one particular board. I do understand the flexibility of the devicetree, however something like the SDRAM configuration can not be chosen 'on the fly' by the PBL? It will save me (and probably others) a lot of time if you could quickly explain the functionality.
I do agree the flash-header-imx53-loco.imxcfg looks much cleaner. I will try to write the flash_header for the Voipac board in the same way.
Regards;
Rostislav
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
maintainerRe: [PATCH 3/3] ARM: i.mx53: Support for Voipac board. Device definition is read from Devicetree
Quoted 33 lines · Rostislav Lisovy
Hello Sascha;
Quoted 5 lines · Sascha Hauer
Hi Rostislav,
Quoted 2 lines · Rostislav Lisovy
Signed-off-by Rostislav Lisovy <[email protected]>Quoted 7 lines
arch/arm/boards/freescale-mx53-vmx53/env/config
Quoted 5 lines
arch/arm/boards/freescale-mx53-vmx53/env/config new file +0
-0Why not use defenv-2?
Ok; I will use it;
Quoted 14 lines
arch/arm/boards/freescale-mx53-vmx53/flash_header.c
Quoted 6 lines
arch/arm/boards/freescale-mx53-vmx53/flash_header.c new file +0
-0I'm currently generating the flash images for new boards using the imx-image tool and also generate multi board images. This is a very flexible, though maybe hard to understand mechanism. Is this the reason you haven't used it or were you not aware of it?
I would rather see this board taking part in this new mechanism. Are you willing to port this over? Otherwise I could try and convert this patch, but I would depend on you testing the result.
Quoted 7 lines
I was investigating how the imx53-loco support is done, however I was not sure if the 'multiboard' is the preferred way.
I found your patchset
http://www.spinics.net/lists/u-boot-v2/msg15296.html shortly describing the functionality of the multiboard barebox -- I still do not understand the concept. The final binary has to hold just one particular 'flash_header', thus be able to boot just on one particular board.
The multi image support (I think multi image is more appropriate than multi board) doesn't mean that the same image is being run on multiple boards, it instead means that the same binary is used to generate multiple images. Each of these images is for a particular board. The advantage over the traditional mechanism is that you can have a single config for multiple boards. Of course this could be used to have a single config for completely different SoCs/Boards. This gives you a better compile coverage with less compilation. A more real life scenario might be that you have two boards which differ only in the amount of SDRAM. Instead of maintaining two configs for it you could use a single config and generate two images from it.
Quoted 3 lines
I do
understand the flexibility of the devicetree, however something like the SDRAM configuration can not be chosen 'on the fly' by the PBL?
The basic trick with the multi image support is that we compile multiple entry points (ENTRY_FUNCTION()). Which one is used for a particular image is later specified with the -e option to ld. So each image has one entry function specified with ENTRY_FUNCTION(). What you then do in this entry function is up to you. If your boards offer some possibility to detect the SDRAM setup then you can use it to dynamically detect and configure SDRAM. Then you would be able to use a single binary image on multiple boards with different SDRAM configuration.
On i.MX with the DCD header format the DCD is normally used to setup SDRAM. In this case it's not possible to have the same image for multiple boards. However, you could remove the SDRAM setup from DCD data and configure the flash header to load to the i.MX internal SRAM. then when in SRAM you could determine your board and setup the SDRAM from early code. This way a single image for multiple boards would be possible on i.MX aswell.
With multi image support we shift away from "compiling for a single board". Instead a board is simply an additional option. If this option makes a new image necessary, then this image will be generated along with images for other boards.
My vision is that we should not have defconfigs for particular boards. Instead we should have defconfigs which enable a certain feature set, for example:
- arm_full_defconfig: All features and all boards enabled, huge binary nobody uses in projects, but is useful for compile testing and development
- imx_defconfig: All i.MX boards enabled and all features necessary for i.MX. More practical in real life.
- noninteractive_defconfig: Do not prompt users, just boot.
- $VENDOR_defconfig: supports all boards from a vendor
- $PROJECT_defconfig: supports all boards for a particular project which uses different boards or variants of boards.
I hope this makes it a bit more clearer.
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
Re: [PATCH 3/3] ARM: i.mx53: Support for Voipac board. Device definition is read from Devicetree
Quoted 93 lines · Sascha Hauer
Quoted 33 lines · Rostislav Lisovy
Hello Sascha;
Quoted 5 lines · Sascha Hauer
Hi Rostislav,
Quoted 2 lines · Rostislav Lisovy
Signed-off-by Rostislav Lisovy <[email protected]>Quoted 7 lines
arch/arm/boards/freescale-mx53-vmx53/env/config
Quoted 5 lines
arch/arm/boards/freescale-mx53-vmx53/env/config new file +0
-0Why not use defenv-2?
Ok; I will use it;
Quoted 14 lines
arch/arm/boards/freescale-mx53-vmx53/flash_header.c
Quoted 6 lines
arch/arm/boards/freescale-mx53-vmx53/flash_header.c new file +0
-0I'm currently generating the flash images for new boards using the imx-image tool and also generate multi board images. This is a very flexible, though maybe hard to understand mechanism. Is this the reason you haven't used it or were you not aware of it?
I would rather see this board taking part in this new mechanism. Are you willing to port this over? Otherwise I could try and convert this patch, but I would depend on you testing the result.Quoted 7 lines
I was investigating how the imx53-loco support is done, however I was not sure if the 'multiboard' is the preferred way.
I found your patchset
http://www.spinics.net/lists/u-boot-v2/msg15296.html shortly describing the functionality of the multiboard barebox -- I still do not understand the concept. The final binary has to hold just one particular 'flash_header', thus be able to boot just on one particular board.The multi image support (I think multi image is more appropriate than multi board) doesn't mean that the same image is being run on multiple boards, it instead means that the same binary is used to generate multiple images. Each of these images is for a particular board. The advantage over the traditional mechanism is that you can have a single config for multiple boards. Of course this could be used to have a single config for completely different SoCs/Boards. This gives you a better compile coverage with less compilation. A more real life scenario might be that you have two boards which differ only in the amount of SDRAM. Instead of maintaining two configs for it you could use a single config and generate two images from it.
Quoted 3 lines
I do
understand the flexibility of the devicetree, however something like the SDRAM configuration can not be chosen 'on the fly' by the PBL?The basic trick with the multi image support is that we compile multiple entry points (
ENTRY_FUNCTION()). Which one is used for a particular image is later specified with the -e option to ld. So each image has one entry function specified withENTRY_FUNCTION(). What you then do in this entry function is up to you. If your boards offer some possibility to detect the SDRAM setup then you can use it to dynamically detect and configure SDRAM. Then you would be able to use a single binary image on multiple boards with different SDRAM configuration.On i.MX with the DCD header format the DCD is normally used to setup SDRAM. In this case it's not possible to have the same image for multiple boards. However, you could remove the SDRAM setup from DCD data and configure the flash header to load to the i.MX internal SRAM. then when in SRAM you could determine your board and setup the SDRAM from early code. This way a single image for multiple boards would be possible on i.MX aswell.
With multi image support we shift away from "compiling for a single board". Instead a board is simply an additional option. If this option makes a new image necessary, then this image will be generated along with images for other boards.
My vision is that we should not have defconfigs for particular boards. Instead we should have defconfigs which enable a certain feature set, for example:-
arm_full_defconfig: All features and all boards enabled, huge binary nobody uses in projects, but is useful for compile testing and development
-imx_defconfig: All i.MX boards enabled and all features necessary for i.MX. More practical in real life.
-noninteractive_defconfig: Do not prompt users, just boot.
- $VENDOR_defconfig: supports all boards from a vendor
- $PROJECT_defconfig: supports all boards for a particular project which uses different boards or variants of boards.
Quoted 4 lines
I hope this makes it a bit more clearer.
Sascha
Thank you for the explanation. I just resent the patch-set for the 'multi-board/multi-image' support.
Regards;
Rostislav
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox