diff options
Diffstat (limited to 'arch/arm/boards')
-rw-r--r-- | arch/arm/boards/zii-common/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/boards/zii-common/board.c | 4 | ||||
-rw-r--r-- | arch/arm/boards/zii-common/defaultenv-zii-common/boot/net (renamed from arch/arm/boards/zii-imx51-rdu1/defaultenv-rdu1/boot/net) | 9 | ||||
-rw-r--r-- | arch/arm/boards/zii-common/switch-cmd.c | 49 | ||||
-rw-r--r-- | arch/arm/boards/zii-imx51-rdu1/board.c | 1 | ||||
-rw-r--r-- | arch/arm/boards/zii-imx6q-rdu2/board.c | 11 | ||||
-rw-r--r-- | arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net | 24 | ||||
-rw-r--r-- | arch/arm/boards/zii-imx7d-dev/board.c | 14 | ||||
-rw-r--r-- | arch/arm/boards/zii-imx8mq-dev/board.c | 16 | ||||
-rw-r--r-- | arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net | 24 | ||||
-rw-r--r-- | arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/network/eth0-discover | 4 | ||||
-rw-r--r-- | arch/arm/boards/zii-vf610-dev/board.c | 11 |
12 files changed, 102 insertions, 66 deletions
diff --git a/arch/arm/boards/zii-common/Makefile b/arch/arm/boards/zii-common/Makefile index fcc5cdf97d..90bdf21e77 100644 --- a/arch/arm/boards/zii-common/Makefile +++ b/arch/arm/boards/zii-common/Makefile @@ -1 +1,2 @@ obj-y += board.o switch-cmd.o pn-fixup.o +bbenv-y += defaultenv-zii-common diff --git a/arch/arm/boards/zii-common/board.c b/arch/arm/boards/zii-common/board.c index 7bd3a6cabc..08e2f8b9bd 100644 --- a/arch/arm/boards/zii-common/board.c +++ b/arch/arm/boards/zii-common/board.c @@ -104,6 +104,8 @@ static int rdu_networkconfig(void) } late_initcall(rdu_networkconfig); +#ifdef CONFIG_PCI_IMX6 + #define I210_CFGWORD_PCIID_157B 0x157b1a11 static int rdu_i210_invm(void) { @@ -136,3 +138,5 @@ static int rdu_i210_invm(void) return 0; } late_initcall(rdu_i210_invm); + +#endif diff --git a/arch/arm/boards/zii-imx51-rdu1/defaultenv-rdu1/boot/net b/arch/arm/boards/zii-common/defaultenv-zii-common/boot/net index 4be8e1e2d7..8b07cbbc99 100644 --- a/arch/arm/boards/zii-imx51-rdu1/defaultenv-rdu1/boot/net +++ b/arch/arm/boards/zii-common/defaultenv-zii-common/boot/net @@ -2,8 +2,13 @@ path="/mnt/tftp" -# clear seat network config -global.linux.bootargs.rdu_network= +# +# Clear seat network config. Some boards don't have that config, so +# check that it is set first +# +if [ -n ${global.linux.bootargs.rdu_network} ]; then + global.linux.bootargs.rdu_network= +fi global.bootm.image="${path}/${global.user}-linux-${global.hostname}" diff --git a/arch/arm/boards/zii-common/switch-cmd.c b/arch/arm/boards/zii-common/switch-cmd.c index 2b9c34bfac..cf5554e2e9 100644 --- a/arch/arm/boards/zii-common/switch-cmd.c +++ b/arch/arm/boards/zii-common/switch-cmd.c @@ -18,23 +18,53 @@ static int do_rdu2_switch_reset(void) { - struct i2c_client client; + struct device_node *np; + struct i2c_client *client; + int ret; u8 reg; - client.adapter = i2c_get_adapter(1); - if (!client.adapter) + np = of_find_compatible_node(NULL, NULL, "zii,rave-wdt"); + if (!np) { + pr_err("No switch watchdog node found\n"); return -ENODEV; + } + + if (!of_device_is_available(np)) { + /* + * If switch watchdog device is not available assume + * it was removed for a reason and switch reset + * command should be a no-op + */ + return 0; + } + + client = of_find_i2c_device_by_node(np); + if (!client) { + pr_err("No switch watchdog I2C device found\n"); + return -ENODEV; + } - /* address of the switch watchdog microcontroller */ - client.addr = 0x38; reg = 0x78; + /* set switch reset time to 100ms */ - i2c_write_reg(&client, 0x0a, ®, 1); + ret = i2c_write_reg(client, 0x0a, ®, 1); + if (ret < 0) { + pr_err("Failed to set switch reset time\n"); + return ret; + } /* reset the switch */ reg = 0x01; - i2c_write_reg(&client, 0x0d, ®, 1); + ret = i2c_write_reg(client, 0x0d, ®, 1); + if (ret < 0) { + pr_err("Failed to reset the switch\n"); + return ret; + } /* issue dummy command to work around firmware bug */ - i2c_read_reg(&client, 0x01, ®, 1); + ret = i2c_read_reg(client, 0x01, ®, 1); + if (ret < 0) { + pr_err("Failed to issue a dummy command\n"); + return ret; + } return 0; } @@ -57,7 +87,8 @@ static int do_rdu1_switch_reset(void) static int do_rave_switch_reset(int argc, char *argv[]) { if (of_machine_is_compatible("zii,imx6q-zii-rdu2") || - of_machine_is_compatible("zii,imx6qp-zii-rdu2")) + of_machine_is_compatible("zii,imx6qp-zii-rdu2") || + of_machine_is_compatible("zii,imx8mq-ultra")) return do_rdu2_switch_reset(); if (of_machine_is_compatible("zii,imx51-rdu1")) diff --git a/arch/arm/boards/zii-imx51-rdu1/board.c b/arch/arm/boards/zii-imx51-rdu1/board.c index 640bb0d1b7..8fdcb76260 100644 --- a/arch/arm/boards/zii-imx51-rdu1/board.c +++ b/arch/arm/boards/zii-imx51-rdu1/board.c @@ -50,6 +50,7 @@ static int zii_rdu1_init(void) BBU_HANDLER_FLAG_DEFAULT | IMX_BBU_FLAG_PARTITION_STARTS_AT_HEADER); + defaultenv_append_directory(defaultenv_zii_common); defaultenv_append_directory(defaultenv_rdu1); return 0; diff --git a/arch/arm/boards/zii-imx6q-rdu2/board.c b/arch/arm/boards/zii-imx6q-rdu2/board.c index d41609bfae..0f298d6a42 100644 --- a/arch/arm/boards/zii-imx6q-rdu2/board.c +++ b/arch/arm/boards/zii-imx6q-rdu2/board.c @@ -128,8 +128,11 @@ static int rdu2_devices_init(void) { struct i2c_client client; - if (!of_machine_is_compatible("zii,imx6q-zii-rdu2") && - !of_machine_is_compatible("zii,imx6qp-zii-rdu2")) + if (of_machine_is_compatible("zii,imx6q-zii-rdu2")) + barebox_set_hostname("rdu2"); + else if (of_machine_is_compatible("zii,imx6qp-zii-rdu2")) + barebox_set_hostname("rdu2p"); + else return 0; client.adapter = i2c_get_adapter(1); @@ -147,13 +150,13 @@ static int rdu2_devices_init(void) i2c_write_reg(&client, 0x2e, ®, 1); } - barebox_set_hostname("rdu2"); - imx6_bbu_internal_spi_i2c_register_handler("SPI", "/dev/m25p0.barebox", BBU_HANDLER_FLAG_DEFAULT); imx6_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc3", 0); + imx6_bbu_internal_mmc_register_handler("SD", "/dev/mmc1", 0); + defaultenv_append_directory(defaultenv_zii_common); defaultenv_append_directory(defaultenv_rdu2); return 0; diff --git a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net deleted file mode 100644 index 4090c2f4a9..0000000000 --- a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -path="/mnt/tftp" - -# clear seat network config -global.linux.bootargs.rdu_network= - -global.bootm.image="${path}/${global.user}-linux-${global.hostname}" - -oftree="${path}/${global.user}-oftree-${global.hostname}" -if [ -f "${oftree}" ]; then - global.bootm.oftree="$oftree" -fi - -nfsroot="/home/${global.user}/nfsroot/${global.hostname}" - -ip_route_get -b ${global.net.server} global.linux.bootargs.dyn.ip - -initramfs="${path}/${global.user}-initramfs-${global.hostname}" -if [ -f "${initramfs}" ]; then - global.bootm.initrd="$initramfs" -else - global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp" -fi
\ No newline at end of file diff --git a/arch/arm/boards/zii-imx7d-dev/board.c b/arch/arm/boards/zii-imx7d-dev/board.c index 89f0515306..6b409e23b7 100644 --- a/arch/arm/boards/zii-imx7d-dev/board.c +++ b/arch/arm/boards/zii-imx7d-dev/board.c @@ -33,7 +33,7 @@ static void zii_imx7d_rpu2_init_fec(void) static int zii_imx7d_rpu2_coredevices_init(void) { - if (!of_machine_is_compatible("zii,imx7d-zii-rpu2") && + if (!of_machine_is_compatible("zii,imx7d-rpu2") && !of_machine_is_compatible("zii,imx7d-rmu2")) return 0; @@ -48,3 +48,15 @@ static int zii_imx7d_rpu2_coredevices_init(void) } coredevice_initcall(zii_imx7d_rpu2_coredevices_init); +static int zii_imx7d_dev_init(void) +{ + if (of_machine_is_compatible("zii,imx7d-rpu2")) + barebox_set_hostname("rpu2"); + else if (of_machine_is_compatible("zii,imx7d-rmu2")) + barebox_set_hostname("rmu2"); + + defaultenv_append_directory(defaultenv_zii_common); + + return 0; +} +late_initcall(zii_imx7d_dev_init); diff --git a/arch/arm/boards/zii-imx8mq-dev/board.c b/arch/arm/boards/zii-imx8mq-dev/board.c index ac455990b0..cfe879c201 100644 --- a/arch/arm/boards/zii-imx8mq-dev/board.c +++ b/arch/arm/boards/zii-imx8mq-dev/board.c @@ -26,16 +26,21 @@ static int zii_imx8mq_dev_init(void) if (!of_machine_is_compatible("zii,imx8mq-ultra")) return 0; - barebox_set_hostname("imx8mq-zii-rdu3"); + if (of_machine_is_compatible("zii,imx8mq-ultra-zest")) + barebox_set_hostname("zest"); + if (of_machine_is_compatible("zii,imx8mq-ultra-rmb3")) + barebox_set_hostname("rmb3"); imx8mq_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc0", BBU_HANDLER_FLAG_DEFAULT); + imx8mq_bbu_internal_mmc_register_handler("SD", "/dev/mmc1", 0); if (bootsource_get_instance() == 0) of_device_enable_path("/chosen/environment-emmc"); else of_device_enable_path("/chosen/environment-sd"); + defaultenv_append_directory(defaultenv_zii_common); defaultenv_append_directory(defaultenv_imx8mq_zii_dev); return 0; @@ -110,6 +115,15 @@ static int zii_imx8mq_dev_fixup_deb_internal(void) /* Refresh the internal aliases list from the patched DT */ of_alias_scan(); + /* + * Disable switch watchdog to make rave_reset_switch a no-op + */ + np = of_find_compatible_node(NULL, NULL, "zii,rave-wdt"); + if (!np) + return -ENODEV; + + of_device_disable(np); + return 0; } diff --git a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net deleted file mode 100644 index 4090c2f4a9..0000000000 --- a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -path="/mnt/tftp" - -# clear seat network config -global.linux.bootargs.rdu_network= - -global.bootm.image="${path}/${global.user}-linux-${global.hostname}" - -oftree="${path}/${global.user}-oftree-${global.hostname}" -if [ -f "${oftree}" ]; then - global.bootm.oftree="$oftree" -fi - -nfsroot="/home/${global.user}/nfsroot/${global.hostname}" - -ip_route_get -b ${global.net.server} global.linux.bootargs.dyn.ip - -initramfs="${path}/${global.user}-initramfs-${global.hostname}" -if [ -f "${initramfs}" ]; then - global.bootm.initrd="$initramfs" -else - global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp" -fi
\ No newline at end of file diff --git a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/network/eth0-discover b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/network/eth0-discover new file mode 100644 index 0000000000..00f3120115 --- /dev/null +++ b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/network/eth0-discover @@ -0,0 +1,4 @@ +#!/bin/sh + +# reset switch to clear DSA config +rave_reset_switch diff --git a/arch/arm/boards/zii-vf610-dev/board.c b/arch/arm/boards/zii-vf610-dev/board.c index 1d10f12f63..6445025b2e 100644 --- a/arch/arm/boards/zii-vf610-dev/board.c +++ b/arch/arm/boards/zii-vf610-dev/board.c @@ -141,6 +141,7 @@ static int zii_vf610_dev_set_hostname(void) } } + defaultenv_append_directory(defaultenv_zii_common); defaultenv_append_directory(defaultenv_zii_vf610_dev); return 0; } @@ -161,6 +162,14 @@ static int zii_vf610_dev_register_bbu(void) return ret; } + ret = vf610_bbu_internal_mmc_register_handler("SD", + "/dev/mmc1", + 0); + if (ret) { + pr_err("Failed to register SD BBU handler\n"); + return ret; + } + return 0; } late_initcall(zii_vf610_dev_register_bbu); @@ -185,4 +194,4 @@ static int zii_vf610_register_emmc_bbu(void) return 0; } -late_initcall(zii_vf610_register_emmc_bbu);
\ No newline at end of file +late_initcall(zii_vf610_register_emmc_bbu); |