ARM: i.MX: Add ZII SCU2 Mezz Board
Subsystems (3)
PATCH 1/2 ARM: i.MX: Add ZII SCU2 Mezz Board
Add ZII SCU2 Mezz Board. Which is a i.MX51 based board that is similar enough to RDU1 that they both can be handled by a single image (type can be detected at runtime).
Signed-off-by Andrey Smirnov <[email protected]>
--- arch/arm/boards/zii-imx51-rdu1/board.c | 9 ++- arch/arm/boards/zii-imx51-rdu1/lowlevel.c | 71 ++++++++++++++++++++++- arch/arm/dts/Makefile | 4 +- arch/arm/dts/imx51-zii-scu2-mezz.dts | 11 ++++ 4 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 arch/arm/dts/imx51-zii-scu2-mezz.dts
arch/arm/boards/zii-imx51-rdu1/board.c +7 -2
@@ -23,12 +23,17 @@static int zii_rdu1_init (void ) { -if (!of_machine_is_compatible ("zii,imx51-rdu1" )) +const char *hostname; + +if (!of_machine_is_compatible ("zii,imx51-rdu1" ) && + !of_machine_is_compatible ("zii,imx51-scu2-mezz" ))return 0 ; + hostname =of_get_machine_compatible () +strlen ("imx51-" ); +imx51_babbage_power_init (); -barebox_set_hostname ("rdu1" ); +barebox_set_hostname (hostname);imx51_bbu_internal_mmcboot_register_handler ("eMMC" ,"/dev/mmc0" ,0 ); imx51_bbu_internal_spi_i2c_register_handler("SPI",
arch/arm/boards/zii-imx51-rdu1/lowlevel.c +69 -2
87 lines not on this page · raw message
arch/arm/dts/Makefile +3 -1
@@ -103,7 +103,9 @@ pbl-dtb-$(CONFIG_MACH_VEXPRESS) += vexpress-v2p-ca15.dtb.o pbl-dtb-$(CONFIG_MACH_VSCOM_BALTOS) += am335x-baltos-minimal.dtb.o pbl-dtb-$(CONFIG_MACH_WARP7) += imx7s-warp.dtb.o pbl-dtb-$(CONFIG_MACH_VF610_TWR) += vf610-twr.dtb.o -pbl-dtb-$(CONFIG_MACH_ZII_RDU1) += imx51-zii-rdu1.dtb.o +pbl-dtb-$(CONFIG_MACH_ZII_RDU1) += \ + imx51-zii-rdu1.dtb.o \ + imx51-zii-scu2-mezz.dtb.o pbl-dtb-$(CONFIG_MACH_ZII_RDU2) += imx6q-zii-rdu2.dtb.o imx6qp-zii-rdu2.dtb.o pbl-dtb-$(CONFIG_MACH_ZII_VF610_DEV) += \ vf610-zii-dev-rev-b.dtb.o \
arch/arm/dts/imx51-zii-scu2-mezz.dts new file +11 -0
@@ -0,0 +1,11 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/* + * Copyright (C) 2018 Zodiac Inflight Innovations + */ + +#include <arm/imx51-zii-scu2-mezz.dts> + +&iim { + barebox,provide-mac-address = <&fec 1 9>; +};
Signature · 7 lines
2.17.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/2 ARM: i.MX: Add ZII SCU3 ESB board
Add ZII SCU3 ESB board, which is i.MX51 based and similar enought to RDU1 that it can be handled by the same image (different DT).
Signed-off-by Andrey Smirnov <[email protected]>
--- arch/arm/boards/zii-imx51-rdu1/board.c | 3 ++- arch/arm/boards/zii-imx51-rdu1/lowlevel.c | 4 ++++ arch/arm/dts/Makefile | 3 ++- arch/arm/dts/imx51-zii-scu3-esb.dts | 12 ++++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 arch/arm/dts/imx51-zii-scu3-esb.dts
arch/arm/boards/zii-imx51-rdu1/board.c +2 -1
@@ -26,7 +26,8 @@ static int zii_rdu1_init(void)const char *hostname;if (!of_machine_is_compatible ("zii,imx51-rdu1" ) && - !of_machine_is_compatible ("zii,imx51-scu2-mezz" )) + !of_machine_is_compatible ("zii,imx51-scu2-mezz" ) && + !of_machine_is_compatible ("zii,imx51-scu3-esb" ))return 0 ; hostname =of_get_machine_compatible () +strlen ("imx51-" );
arch/arm/boards/zii-imx51-rdu1/lowlevel.c +4 -0
@@ -70,6 +70,7 @@ static unsigned int get_system_type(void)extern char __dtb_imx51_zii_rdu1_start[];extern char __dtb_imx51_zii_scu2_mezz_start[]; +extern char __dtb_imx51_zii_scu3_esb_start[]; ENTRY_FUNCTION(start_imx51_zii_rdu1, r0, r1, r2) {
@@ -107,6 +108,9 @@ ENTRY_FUNCTION(start_imx51_zii_rdu1, r0, r1, r2)case ZII_PLATFORM_IMX51_SCU2_MEZZ : fdt = __dtb_imx51_zii_scu2_mezz_start;break ; +case ZII_PLATFORM_IMX51_SCU3_ESB : + fdt = __dtb_imx51_zii_scu3_esb_start; +break ; }imx51_barebox_entry (fdt +get_runtime_offset ());
arch/arm/dts/Makefile +2 -1
@@ -105,7 +105,8 @@ pbl-dtb-$(CONFIG_MACH_WARP7) += imx7s-warp.dtb.o pbl-dtb-$(CONFIG_MACH_VF610_TWR) += vf610-twr.dtb.o pbl-dtb-$(CONFIG_MACH_ZII_RDU1) += \ imx51-zii-rdu1.dtb.o \ - imx51-zii-scu2-mezz.dtb.o + imx51-zii-scu2-mezz.dtb.o \ + imx51-zii-scu3-esb.dtb.o pbl-dtb-$(CONFIG_MACH_ZII_RDU2) += imx6q-zii-rdu2.dtb.o imx6qp-zii-rdu2.dtb.o pbl-dtb-$(CONFIG_MACH_ZII_VF610_DEV) += \ vf610-zii-dev-rev-b.dtb.o \
arch/arm/dts/imx51-zii-scu3-esb.dts new file +12 -0
@@ -0,0 +1,12 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/* + * Copyright (C) 2018 Zodiac Inflight Innovations + */ + + +#include <arm/imx51-zii-scu3-esb.dts> + +&iim { + barebox,provide-mac-address = <&fec 1 9>; +};
Signature · 7 lines
2.17.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 4 lines · Andrey Smirnov
Add ZII SCU2 Mezz Board. Which is a i.MX51 based board that is similar enough to RDU1 that they both can be handled by a single image (type can be detected at runtime).
Quoted 8 lines
Signed-off-by Andrey Smirnov <[email protected]>--- arch/arm/boards/zii-imx51-rdu1/board.c | 9 ++- arch/arm/boards/zii-imx51-rdu1/lowlevel.c | 71 ++++++++++++++++++++++- arch/arm/dts/Makefile | 4 +- arch/arm/dts/imx51-zii-scu2-mezz.dts | 11 ++++ 4 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 arch/arm/dts/imx51-zii-scu2-mezz.dts
Applied, thanks
Sascha
Quoted 158 lines
arch/arm/boards/zii-imx51-rdu1/board.c +7
-2@@ -23,12 +23,17 @@static int zii_rdu1_init (void ) { -if (!of_machine_is_compatible ("zii,imx51-rdu1" )) +const char *hostname; + +if (!of_machine_is_compatible ("zii,imx51-rdu1" ) && + !of_machine_is_compatible ("zii,imx51-scu2-mezz" ))return 0 ; + hostname =of_get_machine_compatible () +strlen ("imx51-" ); +imx51_babbage_power_init (); -barebox_set_hostname ("rdu1" ); +barebox_set_hostname (hostname);imx51_bbu_internal_mmcboot_register_handler ("eMMC" ,"/dev/mmc0" ,0 ); imx51_bbu_internal_spi_i2c_register_handler("SPI",arch/arm/boards/zii-imx51-rdu1/lowlevel.c +69
-2@@ -29,18 +29,85 @@ static inline void setup_uart(void)putc_ll ('>' ); } +enum zii_platform_imx51_type { +ZII_PLATFORM_IMX51_RDU_REV_B =0b0000 , +ZII_PLATFORM_IMX51_SCU2_ESB =0b0001 , +ZII_PLATFORM_IMX51_SCU_MEZZ =0b0010 , +ZII_PLATFORM_IMX51_NIU_REV =0b0011 , +ZII_PLATFORM_IMX51_SCU2_MEZZ =0b0100 , +ZII_PLATFORM_IMX51_SCU3_ESB =0b0101 , +ZII_PLATFORM_IMX51_RDU_REV_C =0b1101 , +}; + +static unsigned int get_system_type (void ) +{ +#define GPIO_DR 0x000 +#define GPIO_GDIR 0x004 +#define SYSTEM_TYPE GENMASK(6, 3) + +u32 gdir, dr; +void __iomem *gpio4 =IOMEM (MX51_GPIO4_BASE_ADDR ); +void __iomem *iomuxbase =IOMEM (MX51_IOMUXC_BASE_ADDR ); + +/* +* System type is encoded as a 4-bit number specified by the +* following pins (pulled up or down with resistors on the +* board). +*/ +imx_setup_pad (iomuxbase,MX51_PAD_NANDF_D2__GPIO4_6 ); +imx_setup_pad (iomuxbase,MX51_PAD_NANDF_D3__GPIO4_5 ); +imx_setup_pad (iomuxbase,MX51_PAD_NANDF_D4__GPIO4_4 ); +imx_setup_pad (iomuxbase,MX51_PAD_NANDF_D5__GPIO4_3 ); + + gdir =readl (gpio4 +GPIO_GDIR ); + gdir &= ~SYSTEM_TYPE ; +writel (gdir, gpio4 +GPIO_GDIR ); + + dr =readl (gpio4 +GPIO_DR ); + +return FIELD_GET (SYSTEM_TYPE , dr); +} +extern char __dtb_imx51_zii_rdu1_start[]; +extern char __dtb_imx51_zii_scu2_mezz_start[]; ENTRY_FUNCTION(start_imx51_zii_rdu1, r0, r1, r2) {void *fdt; +const unsigned int system_type =get_system_type ();imx5_cpu_lowlevel_init ();if (IS_ENABLED (CONFIG_DEBUG_LL ))setup_uart (); - fdt = __dtb_imx51_zii_rdu1_start +get_runtime_offset (); +switch (system_type) { +default : +/* +* see similar code in +* arch/arm/boards/zii-vf610-dev/lowlevel.c for +* reasoning for placing barrier() below. +*/ +barrier (); + +if (IS_ENABLED (CONFIG_DEBUG_LL )) { +relocate_to_current_adr (); +setup_c (); +puts_ll ("\n*********************************\n" ); +puts_ll ("* Unknown system type: " ); +puthex_ll (system_type); +puts_ll ("\n* Assuming RDU1\n" ); +puts_ll ("*********************************\n" ); + } +/* FALLTHROUGH */ +case ZII_PLATFORM_IMX51_RDU_REV_B : +case ZII_PLATFORM_IMX51_RDU_REV_C : + fdt = __dtb_imx51_zii_rdu1_start; +break ; +case ZII_PLATFORM_IMX51_SCU2_MEZZ : + fdt = __dtb_imx51_zii_scu2_mezz_start; +break ; + } -imx51_barebox_entry (fdt); +imx51_barebox_entry (fdt +get_runtime_offset ()); }arch/arm/dts/Makefile +3
-1@@ -103,7 +103,9 @@ pbl-dtb-$(CONFIG_MACH_VEXPRESS) += vexpress-v2p-ca15.dtb.o pbl-dtb-$(CONFIG_MACH_VSCOM_BALTOS) += am335x-baltos-minimal.dtb.o pbl-dtb-$(CONFIG_MACH_WARP7) += imx7s-warp.dtb.o pbl-dtb-$(CONFIG_MACH_VF610_TWR) += vf610-twr.dtb.o -pbl-dtb-$(CONFIG_MACH_ZII_RDU1) += imx51-zii-rdu1.dtb.o +pbl-dtb-$(CONFIG_MACH_ZII_RDU1) += \ + imx51-zii-rdu1.dtb.o \ + imx51-zii-scu2-mezz.dtb.o pbl-dtb-$(CONFIG_MACH_ZII_RDU2) += imx6q-zii-rdu2.dtb.o imx6qp-zii-rdu2.dtb.o pbl-dtb-$(CONFIG_MACH_ZII_VF610_DEV) += \ vf610-zii-dev-rev-b.dtb.o \arch/arm/dts/imx51-zii-scu2-mezz.dts new file +11
-0@@ -0,0 +1,11 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/* + * Copyright (C) 2018 Zodiac Inflight Innovations + */ + +#include <arm/imx51-zii-scu2-mezz.dts> + +&iim { + barebox,provide-mac-address = <&fec 1 9>; +};Signature · 7 lines
2.17.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
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