summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/boards')
-rw-r--r--arch/arm/boards/Makefile2
-rw-r--r--arch/arm/boards/datamodul-edm-qmx6/board.c2
-rw-r--r--arch/arm/boards/efika-mx-smartbook/board.c1
-rw-r--r--arch/arm/boards/embedsky-e9/board.c1
-rw-r--r--arch/arm/boards/freescale-mx51-babbage/board.c1
-rw-r--r--arch/arm/boards/freescale-mx6-sabrelite/board.c1
-rw-r--r--arch/arm/boards/freescale-mx6-sabresd/board.c1
-rw-r--r--arch/arm/boards/freescale-mx6sx-sabresdb/board.c2
-rw-r--r--arch/arm/boards/guf-vincell/board.c2
-rw-r--r--arch/arm/boards/karo-tx25/board.c6
-rw-r--r--arch/arm/boards/karo-tx53/board.c1
-rw-r--r--arch/arm/boards/lxa-mc1/board.c13
-rw-r--r--arch/arm/boards/phytec-phycard-imx27/pca100.c1
-rw-r--r--arch/arm/boards/phytec-phycore-imx27/pcm038.c4
-rw-r--r--arch/arm/boards/protonic-mecsbc/Makefile3
-rw-r--r--arch/arm/boards/protonic-mecsbc/board.c180
-rw-r--r--arch/arm/boards/protonic-mecsbc/lowlevel.c33
-rw-r--r--arch/arm/boards/radxa-cm3/board.c6
-rw-r--r--arch/arm/boards/radxa-rock3/board.c4
-rw-r--r--arch/arm/boards/radxa-rock5/board.c4
-rw-r--r--arch/arm/boards/raspberry-pi/rpi-common.c51
-rw-r--r--arch/arm/boards/rockchip-rk3568-bpi-r2pro/board.c5
-rw-r--r--arch/arm/boards/rockchip-rk3568-evb/board.c5
-rw-r--r--arch/arm/boards/scb9328/scb9328.c1
-rw-r--r--arch/arm/boards/skov-imx8mp/board.c15
-rw-r--r--arch/arm/boards/tqma6x/board.c2
-rw-r--r--arch/arm/boards/udoo/board.c1
-rw-r--r--arch/arm/boards/variscite-mx6/board.c1
-rw-r--r--arch/arm/boards/wolfvision-pf5/.gitignore1
-rw-r--r--arch/arm/boards/wolfvision-pf5/Makefile3
-rw-r--r--arch/arm/boards/wolfvision-pf5/board.c88
-rw-r--r--arch/arm/boards/wolfvision-pf5/lowlevel.c36
32 files changed, 438 insertions, 39 deletions
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index 05fbcca175..98eab17af2 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -109,6 +109,7 @@ obj-$(CONFIG_MACH_PM9G45) += pm9g45/
obj-$(CONFIG_MACH_POLYHEX_DEBIX) += polyhex-debix/
obj-$(CONFIG_MACH_PROTONIC_IMX6) += protonic-imx6/
obj-$(CONFIG_MACH_PROTONIC_IMX8M) += protonic-imx8m/
+obj-$(CONFIG_MACH_PROTONIC_MECSBC) += protonic-mecsbc/
obj-$(CONFIG_MACH_PROTONIC_STM32MP1) += protonic-stm32mp1/
obj-$(CONFIG_MACH_QIL_A9260) += qil-a926x/
obj-$(CONFIG_MACH_QIL_A9G20) += qil-a926x/
@@ -203,3 +204,4 @@ obj-$(CONFIG_MACH_RADXA_ROCK5) += radxa-rock5/
obj-$(CONFIG_MACH_VARISCITE_DT8MCUSTOMBOARD_IMX8MP) += variscite-dt8mcustomboard-imx8mp/
obj-$(CONFIG_MACH_RADXA_CM3) += radxa-cm3/
obj-$(CONFIG_MACH_TQMA93XX) += tqma93xx/
+obj-$(CONFIG_MACH_WOLFVISION_PF5) += wolfvision-pf5/
diff --git a/arch/arm/boards/datamodul-edm-qmx6/board.c b/arch/arm/boards/datamodul-edm-qmx6/board.c
index 8680485de2..93abce33af 100644
--- a/arch/arm/boards/datamodul-edm-qmx6/board.c
+++ b/arch/arm/boards/datamodul-edm-qmx6/board.c
@@ -12,13 +12,13 @@
#include <of.h>
#include <linux/mdio.h>
+#include <linux/phy.h>
#include <linux/micrel_phy.h>
#include <mfd/stmpe-i2c.h>
#include <asm/armlinux.h>
#include <asm/io.h>
-#include <mach/imx/devices-imx6.h>
#include <mach/imx/imx6-regs.h>
#include <mach/imx/iomux-mx6.h>
#include <mach/imx/generic.h>
diff --git a/arch/arm/boards/efika-mx-smartbook/board.c b/arch/arm/boards/efika-mx-smartbook/board.c
index f5a3f3cec4..5101e3a558 100644
--- a/arch/arm/boards/efika-mx-smartbook/board.c
+++ b/arch/arm/boards/efika-mx-smartbook/board.c
@@ -19,7 +19,6 @@
#include <asm/armlinux.h>
-#include <mach/imx/devices-imx51.h>
#include <mach/imx/imx51-regs.h>
#include <mach/imx/iomux-mx51.h>
#include <mach/imx/revision.h>
diff --git a/arch/arm/boards/embedsky-e9/board.c b/arch/arm/boards/embedsky-e9/board.c
index afc9e3d27e..6052805b8a 100644
--- a/arch/arm/boards/embedsky-e9/board.c
+++ b/arch/arm/boards/embedsky-e9/board.c
@@ -23,7 +23,6 @@
#include <linux/sizes.h>
#include <net.h>
#include <mach/imx/imx6.h>
-#include <mach/imx/devices-imx6.h>
#include <mach/imx/iomux-mx6.h>
#include <spi/spi.h>
#include <mach/imx/spi.h>
diff --git a/arch/arm/boards/freescale-mx51-babbage/board.c b/arch/arm/boards/freescale-mx51-babbage/board.c
index 76bdc78b02..1d4fb2d8c6 100644
--- a/arch/arm/boards/freescale-mx51-babbage/board.c
+++ b/arch/arm/boards/freescale-mx51-babbage/board.c
@@ -24,7 +24,6 @@
#include <mach/imx/spi.h>
#include <mach/imx/generic.h>
#include <mach/imx/iomux-mx51.h>
-#include <mach/imx/devices-imx51.h>
#include <mach/imx/revision.h>
#define MX51_CCM_CACRR 0x10
diff --git a/arch/arm/boards/freescale-mx6-sabrelite/board.c b/arch/arm/boards/freescale-mx6-sabrelite/board.c
index 0f5306cde8..fe47743540 100644
--- a/arch/arm/boards/freescale-mx6-sabrelite/board.c
+++ b/arch/arm/boards/freescale-mx6-sabrelite/board.c
@@ -23,7 +23,6 @@
#include <net.h>
#include <linux/micrel_phy.h>
#include <mach/imx/imx6.h>
-#include <mach/imx/devices-imx6.h>
#include <mach/imx/iomux-mx6.h>
#include <spi/spi.h>
#include <mach/imx/spi.h>
diff --git a/arch/arm/boards/freescale-mx6-sabresd/board.c b/arch/arm/boards/freescale-mx6-sabresd/board.c
index 2b1d005cf2..1db52736f9 100644
--- a/arch/arm/boards/freescale-mx6-sabresd/board.c
+++ b/arch/arm/boards/freescale-mx6-sabresd/board.c
@@ -20,7 +20,6 @@
#include <linux/sizes.h>
#include <net.h>
#include <mach/imx/imx6.h>
-#include <mach/imx/devices-imx6.h>
#include <mach/imx/iomux-mx6.h>
#include <spi/spi.h>
#include <mach/imx/spi.h>
diff --git a/arch/arm/boards/freescale-mx6sx-sabresdb/board.c b/arch/arm/boards/freescale-mx6sx-sabresdb/board.c
index 4749981265..22163a4864 100644
--- a/arch/arm/boards/freescale-mx6sx-sabresdb/board.c
+++ b/arch/arm/boards/freescale-mx6sx-sabresdb/board.c
@@ -6,6 +6,7 @@
#include <environment.h>
#include <common.h>
#include <linux/sizes.h>
+#include <linux/phy.h>
#include <gpio.h>
#include <init.h>
#include <io.h>
@@ -15,7 +16,6 @@
#include <asm/armlinux.h>
-#include <mach/imx/devices-imx6.h>
#include <mach/imx/imx6-regs.h>
#include <mach/imx/iomux-mx6.h>
#include <mach/imx/generic.h>
diff --git a/arch/arm/boards/guf-vincell/board.c b/arch/arm/boards/guf-vincell/board.c
index 00a343ef99..50439b5b78 100644
--- a/arch/arm/boards/guf-vincell/board.c
+++ b/arch/arm/boards/guf-vincell/board.c
@@ -11,11 +11,11 @@
#include <io.h>
#include <linux/clk.h>
-#include <mach/imx/devices-imx53.h>
#include <mach/imx/generic.h>
#include <mach/imx/iim.h>
#include <mach/imx/bbu.h>
#include <mach/imx/imx5.h>
+#include <mach/imx/imx53-regs.h>
static int vincell_devices_init(void)
{
diff --git a/arch/arm/boards/karo-tx25/board.c b/arch/arm/boards/karo-tx25/board.c
index f58767a7a3..7e8691ef93 100644
--- a/arch/arm/boards/karo-tx25/board.c
+++ b/arch/arm/boards/karo-tx25/board.c
@@ -19,8 +19,8 @@
#include <mach/imx/iomux-mx25.h>
#include <mach/imx/generic.h>
#include <mach/imx/iim.h>
+#include <platform_data/imxfb.h>
#include <linux/err.h>
-#include <mach/imx/devices-imx25.h>
#include <mach/imx/bbu.h>
#include <asm/mmu.h>
@@ -164,8 +164,8 @@ static int tx25_init_fb(void)
mxc_iomux_v3_setup_multiple_pads(tx25_lcdc_gpios,
ARRAY_SIZE(tx25_lcdc_gpios));
- imx25_add_fb(&tx25_fb_data);
-
+ add_generic_device("imxfb", -1, NULL, (resource_size_t)MX25_LCDC_BASE_ADDR, 0x1000,
+ IORESOURCE_MEM, &tx25_fb_data);
return 0;
}
device_initcall(tx25_init_fb);
diff --git a/arch/arm/boards/karo-tx53/board.c b/arch/arm/boards/karo-tx53/board.c
index f5450def4c..e00378746c 100644
--- a/arch/arm/boards/karo-tx53/board.c
+++ b/arch/arm/boards/karo-tx53/board.c
@@ -18,7 +18,6 @@
#include <mach/imx/imx53-regs.h>
#include <mach/imx/iomux-mx53.h>
-#include <mach/imx/devices-imx53.h>
#include <mach/imx/generic.h>
#include <mach/imx/imx-nand.h>
#include <mach/imx/iim.h>
diff --git a/arch/arm/boards/lxa-mc1/board.c b/arch/arm/boards/lxa-mc1/board.c
index b377d4323e..8be265b0fc 100644
--- a/arch/arm/boards/lxa-mc1/board.c
+++ b/arch/arm/boards/lxa-mc1/board.c
@@ -31,6 +31,7 @@ static int of_fixup_regulator_supply_disable(struct device_node *root, void *pat
static int mc1_probe(struct device *dev)
{
+ struct device_node *state_node, *state_backend;
int flags;
flags = bootsource_get_instance() == 0 ? BBU_HANDLER_FLAG_DEFAULT : 0;
@@ -40,10 +41,18 @@ static int mc1_probe(struct device *dev)
stm32mp_bbu_mmc_register_handler("emmc", "/dev/mmc1.ssbl", flags);
- if (bootsource_get_instance() == 0)
+ if (bootsource_get_instance() == 0) {
of_device_enable_path("/chosen/environment-sd");
- else
+ state_backend = of_find_node_by_alias(NULL, "mmc0");
+ } else {
of_device_enable_path("/chosen/environment-emmc");
+ state_backend = of_find_node_by_alias(NULL, "mmc1");
+ }
+
+ state_node = of_find_node_by_alias(NULL, "state");
+ if (state_node)
+ of_property_write_u32(state_node, "backend",
+ of_node_create_phandle(state_backend));
barebox_set_hostname("lxa-mc1");
diff --git a/arch/arm/boards/phytec-phycard-imx27/pca100.c b/arch/arm/boards/phytec-phycard-imx27/pca100.c
index 2d0ae7cf80..d3a5598e96 100644
--- a/arch/arm/boards/phytec-phycard-imx27/pca100.c
+++ b/arch/arm/boards/phytec-phycard-imx27/pca100.c
@@ -23,7 +23,6 @@
#include <linux/usb/ulpi.h>
#include <mach/imx/bbu.h>
#include <mach/imx/iomux-mx27.h>
-#include <mach/imx/devices-imx27.h>
#if defined(CONFIG_USB) && defined(CONFIG_USB_ULPI)
static void pca100_usb_register(void)
diff --git a/arch/arm/boards/phytec-phycore-imx27/pcm038.c b/arch/arm/boards/phytec-phycore-imx27/pcm038.c
index 69a0458f05..879e94293c 100644
--- a/arch/arm/boards/phytec-phycore-imx27/pcm038.c
+++ b/arch/arm/boards/phytec-phycore-imx27/pcm038.c
@@ -11,7 +11,6 @@
#include <notifier.h>
#include <linux/sizes.h>
#include <envfs.h>
-#include <mach/imx/devices-imx27.h>
#include <mach/imx/imx-pll.h>
#include <mach/imx/imx27-regs.h>
#include <platform_data/imxfb.h>
@@ -106,7 +105,8 @@ static int pcm038_init(void)
for (i = 0; i < ARRAY_SIZE(pcm038_pins); i++)
imx27_gpio_mode(pcm038_pins[i]);
- imx27_add_fb(&pcm038_fb_data);
+ add_generic_device("imxfb", -1, NULL, (resource_size_t)MX27_LCDC_BASE_ADDR, 0x1000,
+ IORESOURCE_MEM, &pcm038_fb_data);
switch (bootsource_get()) {
case BOOTSOURCE_NAND:
diff --git a/arch/arm/boards/protonic-mecsbc/Makefile b/arch/arm/boards/protonic-mecsbc/Makefile
new file mode 100644
index 0000000000..b37b6c870b
--- /dev/null
+++ b/arch/arm/boards/protonic-mecsbc/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/protonic-mecsbc/board.c b/arch/arm/boards/protonic-mecsbc/board.c
new file mode 100644
index 0000000000..56f7ca393a
--- /dev/null
+++ b/arch/arm/boards/protonic-mecsbc/board.c
@@ -0,0 +1,180 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#define pr_fmt(fmt) "MECSBC: " fmt
+
+#include <bootsource.h>
+#include <common.h>
+#include <deep-probe.h>
+#include <init.h>
+#include <mach/rockchip/bbu.h>
+#include <environment.h>
+#include <param.h>
+#include <of_device.h>
+#include <aiodev.h>
+#include <globalvar.h>
+
+struct mecsbc_model {
+ const char *name;
+ const char *shortname;
+};
+
+struct mecsbc_priv {
+ int hw_id;
+ int hw_rev;
+};
+
+static struct mecsbc_priv mecsbc_data;
+
+static int saradc_get_value(const char *chan)
+{
+ int ret, voltage;
+
+ ret = aiochannel_name_get_value(chan, &voltage);
+ if (ret) {
+ pr_warn_once("Cannot read ADC %s: %pe\n", chan, ERR_PTR(ret));
+ return 0;
+ }
+
+ return voltage;
+}
+
+static int mecsbc_get_vin_mv(void)
+{
+ return saradc_get_value("aiodev0.in_value2_mV") * 22;
+}
+
+static bool mecsbc_get_usb_boot(void)
+{
+ return saradc_get_value("aiodev0.in_value0_mV") < 74;
+}
+
+static int mecsbc_adc_id_values[] = {
+ 1800, 1662, 1521, 1354, 1214, 1059, 900, 742, 335, 589, 278, 137, 0
+};
+
+static int mecsbc_get_adc_id(const char *chan)
+{
+ int val;
+ unsigned int t;
+
+ val = saradc_get_value(chan) + 74;
+
+ for (t = 0; t < ARRAY_SIZE(mecsbc_adc_id_values); t++) {
+ if (val > mecsbc_adc_id_values[t])
+ return t;
+ }
+
+ return t;
+}
+
+static void mecsbc_process_adc(struct device *dev)
+{
+ mecsbc_data.hw_id = mecsbc_get_adc_id("aiodev0.in_value1_mV");
+ mecsbc_data.hw_rev = mecsbc_get_adc_id("aiodev0.in_value3_mV");
+
+ dev_add_param_uint32_ro(dev, "boardrev", &mecsbc_data.hw_rev, "%u");
+ dev_add_param_uint32_ro(dev, "boardid", &mecsbc_data.hw_id, "%u");
+
+ /* Check if we need to enable the USB gadget instead of booting */
+ if (mecsbc_get_usb_boot()) {
+ globalvar_add_simple("boot.default", "net");
+ globalvar_add_simple("usbgadget.acm", "1");
+ globalvar_add_simple("usbgadget.autostart", "1");
+ globalvar_add_simple("system.partitions", "/dev/mmc0(mmc0)");
+ pr_info("MECSBC: Enter USB recovery\n");
+ } else {
+ globalvar_add_simple("boot.default", "bootchooser");
+ }
+
+ pr_info("Board id: %d, revision %d\n", mecsbc_data.hw_id, mecsbc_data.hw_rev);
+ pr_info("VIN = %d V\n", mecsbc_get_vin_mv() / 1000);
+}
+
+static int mecsbc_sd_of_fixup(struct device_node *root, void *context)
+{
+ struct device *dev = context;
+ struct device_node *np;
+
+ dev_info(dev, "Fixing up /regulator-sd\n");
+
+ np = of_find_node_by_path_from(root, "/regulator-sd");
+ if (!np) {
+ dev_err(dev, "Cannot find /regulator-sd node\n");
+ return 0;
+ }
+
+ of_property_write_u32(np, "regulator-min-microvolt", 3300000);
+
+ return 0;
+}
+
+static int mecsbc_of_fixup_hwrev(struct device *dev)
+{
+ const char *compat;
+ char *buf;
+
+ compat = of_device_get_match_compatible(dev);
+
+ buf = xasprintf("%s-m%u-r%u", compat, mecsbc_data.hw_id,
+ mecsbc_data.hw_rev);
+ barebox_set_of_machine_compatible(buf);
+
+ free(buf);
+
+ if (mecsbc_data.hw_id == 0 && mecsbc_data.hw_rev == 0)
+ of_register_fixup(mecsbc_sd_of_fixup, dev);
+
+ return 0;
+}
+
+static int mecsbc_probe(struct device *dev)
+{
+ int ret = 0;
+ enum bootsource bootsource = bootsource_get();
+ int instance = bootsource_get_instance();
+ const struct mecsbc_model *model;
+ struct device_node *np;
+
+ np = of_find_node_by_name_address(NULL, "saradc@fe720000");
+ of_device_ensure_probed(np);
+
+ model = device_get_match_data(dev);
+
+ barebox_set_model(model->name);
+ barebox_set_hostname(model->shortname);
+
+ if (bootsource == BOOTSOURCE_MMC && instance == 1)
+ of_device_enable_path("/chosen/environment-sd");
+ else
+ of_device_enable_path("/chosen/environment-emmc");
+
+ rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
+ rk3568_bbu_mmc_register("sd", 0, "/dev/mmc1");
+
+ mecsbc_process_adc(dev);
+ mecsbc_of_fixup_hwrev(dev);
+
+ return ret;
+}
+
+static const struct mecsbc_model mecsbc = {
+ .name = "Protonic MECSBC board",
+ .shortname = "mecsbc",
+};
+
+static const struct of_device_id mecsbc_of_match[] = {
+ {
+ .compatible = "prt,mecsbc",
+ .data = &mecsbc,
+ },
+ { /* sentinel */ },
+};
+
+static struct driver mecsbc_board_driver = {
+ .name = "board-mecsbc",
+ .probe = mecsbc_probe,
+ .of_compatible = mecsbc_of_match,
+};
+coredevice_platform_driver(mecsbc_board_driver);
+
+BAREBOX_DEEP_PROBE_ENABLE(mecsbc_of_match);
diff --git a/arch/arm/boards/protonic-mecsbc/lowlevel.c b/arch/arm/boards/protonic-mecsbc/lowlevel.c
new file mode 100644
index 0000000000..830d708b6e
--- /dev/null
+++ b/arch/arm/boards/protonic-mecsbc/lowlevel.c
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <common.h>
+#include <asm/barebox-arm.h>
+#include <mach/rockchip/hardware.h>
+#include <mach/rockchip/atf.h>
+#include <debug_ll.h>
+
+extern char __dtb_rk3568_mecsbc_start[];
+
+ENTRY_FUNCTION(start_mecsbc, r0, r1, r2)
+{
+ /*
+ * MECSBC IO domain voltages are all +3.3V, except VCCIO4 and VCCIO6
+ * Both GMAC interfaces need this to work properly.
+ * FIXME: This is done by the io-domain driver as well, but there
+ * currently is no mechanism to make sure the driver gets probed
+ * before its consumers. Remove this setup once this issue is
+ * resolved.
+ */
+ writel(RK_SETBITS(0x50), 0xfdc20140);
+
+ putc_ll('>');
+
+ if (current_el() == 3)
+ relocate_to_adr_full(RK3568_BAREBOX_LOAD_ADDRESS);
+ else
+ relocate_to_current_adr();
+
+ setup_c();
+
+ rk3568_barebox_entry(__dtb_rk3568_mecsbc_start);
+}
diff --git a/arch/arm/boards/radxa-cm3/board.c b/arch/arm/boards/radxa-cm3/board.c
index 14b6784179..19d37e31d9 100644
--- a/arch/arm/boards/radxa-cm3/board.c
+++ b/arch/arm/boards/radxa-cm3/board.c
@@ -26,9 +26,9 @@ static int cm3_probe(struct device *dev)
else
of_device_enable_path("/chosen/environment-emmc");
- rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT,
- "/dev/mmc0");
- rk3568_bbu_mmc_register("sd", 0, "/dev/mmc1");
+ rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT,
+ "/dev/mmc0");
+ rockchip_bbu_mmc_register("sd", 0, "/dev/mmc1");
return 0;
}
diff --git a/arch/arm/boards/radxa-rock3/board.c b/arch/arm/boards/radxa-rock3/board.c
index 0d425e2667..df99eded2c 100644
--- a/arch/arm/boards/radxa-rock3/board.c
+++ b/arch/arm/boards/radxa-rock3/board.c
@@ -26,8 +26,8 @@ static int rock3_probe(struct device *dev)
else
of_device_enable_path("/chosen/environment-emmc");
- rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
- rk3568_bbu_mmc_register("sd", 0, "/dev/mmc1");
+ rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
+ rockchip_bbu_mmc_register("sd", 0, "/dev/mmc1");
return 0;
}
diff --git a/arch/arm/boards/radxa-rock5/board.c b/arch/arm/boards/radxa-rock5/board.c
index 6ea6ffeaaf..eab0c01040 100644
--- a/arch/arm/boards/radxa-rock5/board.c
+++ b/arch/arm/boards/radxa-rock5/board.c
@@ -23,8 +23,8 @@ static int rock5_probe(struct device *dev)
else
of_device_enable_path("/chosen/environment-emmc");
- rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
- rk3568_bbu_mmc_register("sd", 0, "/dev/mmc1");
+ rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
+ rockchip_bbu_mmc_register("sd", 0, "/dev/mmc1");
return 0;
}
diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c
index 7c82c740e2..628f657ea2 100644
--- a/arch/arm/boards/raspberry-pi/rpi-common.c
+++ b/arch/arm/boards/raspberry-pi/rpi-common.c
@@ -60,6 +60,11 @@ struct rpi_priv {
const char *name;
};
+struct rpi_property_fixup_data {
+ const struct device_node* vc_node;
+ const char *propname;
+};
+
static void rpi_set_usbethaddr(void)
{
u8 mac[ETH_ALEN];
@@ -192,6 +197,7 @@ static int rpi_env_init(void)
int ret;
device_detect_by_name("mci0");
+ device_detect_by_name("mci1");
diskdev = "/dev/disk0.0";
ret = stat(diskdev, &s);
@@ -301,6 +307,47 @@ static struct device_node *register_vc_fixup(struct device_node *root,
return ret;
}
+static int rpi_vc_fdt_fixup_property(struct device_node *root, void *data)
+{
+ const struct rpi_property_fixup_data *fixup = data;
+ struct device_node *node;
+ struct property *prop;
+
+ node = of_create_node(root, fixup->vc_node->full_name);
+ if (!node)
+ return -ENOMEM;
+
+ prop = of_find_property(fixup->vc_node, fixup->propname, NULL);
+ if (!prop)
+ return -ENOENT;
+
+ return of_set_property(node, prop->name,
+ of_property_get_value(prop), prop->length, 1);
+}
+
+static int register_vc_property_fixup(struct device_node *root,
+ const char *path, const char *propname)
+{
+ struct device_node *node, *tmp;
+ struct rpi_property_fixup_data* fixup_data;
+
+ node = of_find_node_by_path_from(root, path);
+ if (node) {
+ tmp = of_dup(node);
+ tmp->full_name = xstrdup(node->full_name);
+ fixup_data = xzalloc(sizeof(*fixup_data));
+ fixup_data->vc_node = tmp;
+ fixup_data->propname = xstrdup(propname);
+
+ of_register_fixup(rpi_vc_fdt_fixup_property, fixup_data);
+ } else {
+ pr_info("no '%s' node found in vc fdt\n", path);
+ return -ENOENT;
+ }
+
+ return 0;
+}
+
static u32 rpi_boot_mode, rpi_boot_part;
/* Extract useful information from the VideoCore FDT we got.
* Some parameters are defined here:
@@ -326,8 +373,10 @@ static void rpi_vc_fdt_parse(struct device_node *root)
register_vc_fixup(root, "/system");
register_vc_fixup(root, "/axi");
- register_vc_fixup(root, "/reserved-memory");
+ register_vc_property_fixup(root, "/reserved-memory/nvram@0", "reg");
+ register_vc_property_fixup(root, "/reserved-memory/nvram@0", "status");
register_vc_fixup(root, "/hat");
+ register_vc_property_fixup(root, "/emmc2bus", "dma-ranges");
register_vc_fixup(root, "/chosen/bootloader");
chosen = register_vc_fixup(root, "/chosen");
if (!chosen) {
diff --git a/arch/arm/boards/rockchip-rk3568-bpi-r2pro/board.c b/arch/arm/boards/rockchip-rk3568-bpi-r2pro/board.c
index 94d1dac2c2..7178c02d8f 100644
--- a/arch/arm/boards/rockchip-rk3568-bpi-r2pro/board.c
+++ b/arch/arm/boards/rockchip-rk3568-bpi-r2pro/board.c
@@ -28,9 +28,8 @@ static int rk3568_bpi_r2pro_probe(struct device *dev)
else
of_device_enable_path("/chosen/environment-emmc");
- rk3568_bbu_mmc_register("sd", 0, "/dev/mmc0");
- rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT,
- "/dev/mmc1");
+ rockchip_bbu_mmc_register("sd", 0, "/dev/mmc0");
+ rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc1");
return 0;
}
diff --git a/arch/arm/boards/rockchip-rk3568-evb/board.c b/arch/arm/boards/rockchip-rk3568-evb/board.c
index f404af217b..9659bd69c5 100644
--- a/arch/arm/boards/rockchip-rk3568-evb/board.c
+++ b/arch/arm/boards/rockchip-rk3568-evb/board.c
@@ -28,9 +28,8 @@ static int rk3568_evb_probe(struct device *dev)
else
of_device_enable_path("/chosen/environment-emmc");
- rk3568_bbu_mmc_register("sd", 0, "/dev/mmc0");
- rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT,
- "/dev/mmc1");
+ rockchip_bbu_mmc_register("sd", 0, "/dev/mmc0");
+ rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc1");
return 0;
}
diff --git a/arch/arm/boards/scb9328/scb9328.c b/arch/arm/boards/scb9328/scb9328.c
index 4c57f47996..c2475476fd 100644
--- a/arch/arm/boards/scb9328/scb9328.c
+++ b/arch/arm/boards/scb9328/scb9328.c
@@ -13,7 +13,6 @@
#include <fs.h>
#include <envfs.h>
#include <mach/imx/iomux-mx1.h>
-#include <mach/imx/devices-imx1.h>
static int scb9328_devices_init(void)
{
diff --git a/arch/arm/boards/skov-imx8mp/board.c b/arch/arm/boards/skov-imx8mp/board.c
index 3b6eb7b080..3cb7a8752a 100644
--- a/arch/arm/boards/skov-imx8mp/board.c
+++ b/arch/arm/boards/skov-imx8mp/board.c
@@ -83,6 +83,13 @@ static const struct board_description imx8mp_variants[] = {
.dts_compatible_hdmi = "skov,imx8mp-skov-revb-hdmi",
.flags = SKOV_IMX8MP_HAS_HDMI,
},
+ [2] = {
+ .dts_compatible = "skov,imx8mp-skov-revc-bd500",
+ },
+};
+
+static const struct board_description imx8mp_basic_variant = {
+ .dts_compatible = "skov,imx8mp-skov-basic",
};
static int skov_imx8mp_fixup(struct device_node *root, void *data)
@@ -171,12 +178,12 @@ static int skov_imx8mp_init_variant(struct skov_imx8mp_priv *priv)
priv->variant_id = v;
if (v >= ARRAY_SIZE(imx8mp_variants)) {
- dev_err(dev, "Invalid variant %u\n", v);
- return -EINVAL;
+ dev_warn(dev, "Unsupported variant %u. Fall back to basic variant\n", v);
+ variant = &imx8mp_basic_variant;
+ } else {
+ variant = &imx8mp_variants[v];
}
- variant = &imx8mp_variants[v];
-
if (variant->flags & SKOV_IMX8MP_HAS_HDMI) {
ret = skov_imx8mp_get_hdmi(dev);
if (ret < 0)
diff --git a/arch/arm/boards/tqma6x/board.c b/arch/arm/boards/tqma6x/board.c
index 1c1ccdf888..a2363913e2 100644
--- a/arch/arm/boards/tqma6x/board.c
+++ b/arch/arm/boards/tqma6x/board.c
@@ -12,13 +12,13 @@
#include <of.h>
#include <linux/mdio.h>
+#include <linux/phy.h>
#include <linux/micrel_phy.h>
#include <mfd/stmpe-i2c.h>
#include <asm/armlinux.h>
#include <asm/io.h>
-#include <mach/imx/devices-imx6.h>
#include <mach/imx/imx6-regs.h>
#include <mach/imx/iomux-mx6.h>
#include <mach/imx/generic.h>
diff --git a/arch/arm/boards/udoo/board.c b/arch/arm/boards/udoo/board.c
index b7ab908427..f27e5a3c0b 100644
--- a/arch/arm/boards/udoo/board.c
+++ b/arch/arm/boards/udoo/board.c
@@ -20,7 +20,6 @@
#include <net.h>
#include <linux/micrel_phy.h>
#include <mach/imx/imx6.h>
-#include <mach/imx/devices-imx6.h>
#include <mach/imx/iomux-mx6.h>
#include <spi/spi.h>
#include <mach/imx/spi.h>
diff --git a/arch/arm/boards/variscite-mx6/board.c b/arch/arm/boards/variscite-mx6/board.c
index 53a453dfa0..9eb3202528 100644
--- a/arch/arm/boards/variscite-mx6/board.c
+++ b/arch/arm/boards/variscite-mx6/board.c
@@ -22,7 +22,6 @@
#include <mach/imx/generic.h>
#include <linux/sizes.h>
#include <mach/imx/imx6.h>
-#include <mach/imx/devices-imx6.h>
#include <mach/imx/iomux-mx6.h>
#include <spi/spi.h>
#include <mach/imx/spi.h>
diff --git a/arch/arm/boards/wolfvision-pf5/.gitignore b/arch/arm/boards/wolfvision-pf5/.gitignore
new file mode 100644
index 0000000000..f458f794b5
--- /dev/null
+++ b/arch/arm/boards/wolfvision-pf5/.gitignore
@@ -0,0 +1 @@
+sdram-init.bin
diff --git a/arch/arm/boards/wolfvision-pf5/Makefile b/arch/arm/boards/wolfvision-pf5/Makefile
new file mode 100644
index 0000000000..b37b6c870b
--- /dev/null
+++ b/arch/arm/boards/wolfvision-pf5/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/wolfvision-pf5/board.c b/arch/arm/boards/wolfvision-pf5/board.c
new file mode 100644
index 0000000000..797f51bc2e
--- /dev/null
+++ b/arch/arm/boards/wolfvision-pf5/board.c
@@ -0,0 +1,88 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Board code for the WolfVision PF5 mainboard.
+ *
+ * Copyright (C) 2024 WolfVision GmbH.
+ */
+#include <common.h>
+#include <deep-probe.h>
+#include <globalvar.h>
+#include <init.h>
+
+#include <boards/wolfvision/common.h>
+#include <mach/rockchip/bbu.h>
+
+#define PF5_IO_EXPANDER_FILENAME "rk3568-wolfvision-pf5-io-expander.dtbo"
+#define PF5_IO_EXPANDER_DATA __dtbo_rk3568_wolfvision_pf5_io_expander_start
+
+enum {
+ PF5_HWID_CHANNEL_MAINBOARD = 1,
+ PF5_HWID_CHANNEL_MODULE = 2,
+};
+
+extern char PF5_IO_EXPANDER_DATA[];
+
+static const struct wv_rk3568_extension pf5_extensions[] = {
+ {
+ .adc_chan = PF5_HWID_CHANNEL_MAINBOARD,
+ .name = "mainboard",
+ .overlays = {
+ [0] = { .name = "PF5 DC V1.0 A", },
+ [4] = { .name = "PF5 DC V1.1 A", },
+ },
+ },
+ {
+ .adc_chan = PF5_HWID_CHANNEL_MODULE,
+ .name = "module",
+ .overlays = {
+ [0] = { .name = "PF5 IO Expander V1.0 A",
+ .filename = PF5_IO_EXPANDER_FILENAME,
+ .data = PF5_IO_EXPANDER_DATA,
+ },
+ [16] = { .name = "no", },
+ },
+ },
+};
+
+static int pf5_probe(struct device *dev)
+{
+ char *pf5_overlays = NULL;
+ int ret;
+
+ barebox_set_model("WolfVision PF5");
+ barebox_set_hostname("PF5");
+
+ ret = wolfvision_register_ethaddr();
+ if (ret)
+ pr_warning("failed to register MAC addresses\n");
+
+ rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
+
+ ret = wolfvision_rk3568_detect_hw(
+ pf5_extensions, ARRAY_SIZE(pf5_extensions), &pf5_overlays);
+ if (ret)
+ pr_warning("failed to detect HW\n");
+
+ if (pf5_overlays)
+ globalvar_set("of.overlay.filepattern", pf5_overlays);
+
+ free(pf5_overlays);
+
+ return 0;
+}
+
+static const struct of_device_id pf5_of_match[] = {
+ {
+ .compatible = "wolfvision,rk3568-pf5",
+ },
+ { /* sentinel */ },
+};
+
+static struct driver_d pf5_board_driver = {
+ .name = "board-wolfvision-pf5",
+ .probe = pf5_probe,
+ .of_compatible = pf5_of_match,
+};
+coredevice_platform_driver(pf5_board_driver);
+
+BAREBOX_DEEP_PROBE_ENABLE(pf5_of_match);
diff --git a/arch/arm/boards/wolfvision-pf5/lowlevel.c b/arch/arm/boards/wolfvision-pf5/lowlevel.c
new file mode 100644
index 0000000000..c20ca4ae13
--- /dev/null
+++ b/arch/arm/boards/wolfvision-pf5/lowlevel.c
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include <common.h>
+#include <linux/sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/rockchip/hardware.h>
+#include <mach/rockchip/atf.h>
+#include <debug_ll.h>
+#include <mach/rockchip/rockchip.h>
+
+extern char __dtb_rk3568_wolfvision_pf5_start[];
+
+ENTRY_FUNCTION(start_rk3568_wolfvision_pf5, r0, r1, r2)
+{
+ /*
+ * Enable vccio4 1.8V and vccio5 1.8V
+ * FIXME: This is done by the io-domain driver as well, but there
+ * currently is no mechanism to make sure the driver gets probed
+ * before its consumers. Remove this setup once this issue is
+ * resolved.
+ */
+ writel(RK_SETBITS(0x30), 0xfdc20140);
+
+ /*
+ * Image execution starts at 0x0, but this is used for ATF and
+ * OP-TEE later, so move away from here.
+ */
+ if (current_el() == 3)
+ relocate_to_adr_full(RK3568_BAREBOX_LOAD_ADDRESS);
+ else
+ relocate_to_current_adr();
+
+ setup_c();
+
+ rk3568_barebox_entry(__dtb_rk3568_wolfvision_pf5_start);
+}