summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2026-03-18 08:37:03 -0600
committerTom Rini <[email protected]>2026-03-18 08:37:03 -0600
commitfac5bce2a1ef7d237d536ccbe8a887c29e53a87a (patch)
treed789d479df9130d988feb005c80205a285675e2a /board
parenta27980786cfb3c430aa1c05da8e79180c584d221 (diff)
parentb51e59c8b34c780e28728bc0cb58783855c7ffbf (diff)
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-riscv into next
CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/29548 - board: starfive: Add Xunlong OrangePi RV - board: starfive: Add VisionFive 2 Lite - board: beagle: Add BeagleV-Fire
Diffstat (limited to 'board')
-rw-r--r--board/beagle/beaglev_fire/Kconfig43
-rw-r--r--board/beagle/beaglev_fire/MAINTAINERS7
-rw-r--r--board/beagle/beaglev_fire/Makefile6
-rw-r--r--board/beagle/beaglev_fire/beaglev_fire.c117
-rw-r--r--board/starfive/visionfive2/spl.c6
-rw-r--r--board/starfive/visionfive2/starfive_visionfive2.c4
-rw-r--r--board/starfive/visionfive2/visionfive2-i2c-eeprom.c64
7 files changed, 222 insertions, 25 deletions
diff --git a/board/beagle/beaglev_fire/Kconfig b/board/beagle/beaglev_fire/Kconfig
new file mode 100644
index 00000000000..7a8ecac8703
--- /dev/null
+++ b/board/beagle/beaglev_fire/Kconfig
@@ -0,0 +1,43 @@
+if TARGET_BEAGLEBOARD_BEAGLEVFIRE
+
+config SYS_BOARD
+ default "beaglev_fire"
+
+config SYS_VENDOR
+ default "beagle"
+
+config SYS_CPU
+ default "mpfs"
+
+config SYS_CONFIG_NAME
+ default "beaglev_fire"
+
+config TEXT_BASE
+ default 0x80000000 if !RISCV_SMODE
+ default 0x80200000 if RISCV_SMODE
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+ def_bool y
+ select MICROCHIP_MPFS
+ select BOARD_EARLY_INIT_F
+ select BOARD_LATE_INIT
+ imply SMP
+ imply CMD_DHCP
+ imply CMD_EXT2
+ imply CMD_EXT4
+ imply CMD_FAT
+ imply CMD_FS_GENERIC
+ imply CMD_NET
+ imply CMD_PING
+ imply CMD_MMC
+ imply DOS_PARTITION
+ imply EFI_PARTITION
+ imply IP_DYN
+ imply ISO_PARTITION
+ imply PHY_LIB
+ imply PHY_VITESSE
+ imply DM_MAILBOX
+ imply MPFS_MBOX
+ imply MISC
+ imply MPFS_SYSCONTROLLER
+endif
diff --git a/board/beagle/beaglev_fire/MAINTAINERS b/board/beagle/beaglev_fire/MAINTAINERS
new file mode 100644
index 00000000000..a5dad93ee99
--- /dev/null
+++ b/board/beagle/beaglev_fire/MAINTAINERS
@@ -0,0 +1,7 @@
+BeagleBoard MPFS BeagleV-Fire
+M: Cyril Jean <[email protected]>
+M: Jamie Gibbons <[email protected]>
+S: Maintained
+F: board/beagle/beaglev_fire/
+F: include/configs/beaglev_fire.h
+F: configs/beaglev_fire_defconfig \ No newline at end of file
diff --git a/board/beagle/beaglev_fire/Makefile b/board/beagle/beaglev_fire/Makefile
new file mode 100644
index 00000000000..a4109a8aad4
--- /dev/null
+++ b/board/beagle/beaglev_fire/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2023 Microchip Technology Inc.
+#
+
+obj-y += beaglev_fire.o \ No newline at end of file
diff --git a/board/beagle/beaglev_fire/beaglev_fire.c b/board/beagle/beaglev_fire/beaglev_fire.c
new file mode 100644
index 00000000000..b2f18c455b7
--- /dev/null
+++ b/board/beagle/beaglev_fire/beaglev_fire.c
@@ -0,0 +1,117 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019-2023 Microchip Technology Inc.
+ */
+
+#include <dm.h>
+#include <dm/devres.h>
+#include <env.h>
+#include <asm/global_data.h>
+#include <asm/io.h>
+#include <linux/compat.h>
+#include <mpfs-mailbox.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define MPFS_SYSREG_SOFT_RESET ((unsigned int *)0x20002088)
+#define PERIPH_RESET_VALUE 0x800001e8u
+
+#if IS_ENABLED(CONFIG_MPFS_SYSCONTROLLER)
+static unsigned char mac_addr[6];
+#endif
+
+int board_init(void)
+{
+ /* For now nothing to do here. */
+
+ return 0;
+}
+
+int board_early_init_f(void)
+{
+ unsigned int val;
+
+ /* Reset uart, mmc peripheral */
+ val = readl(MPFS_SYSREG_SOFT_RESET);
+ val = (val & ~(PERIPH_RESET_VALUE));
+ writel(val, MPFS_SYSREG_SOFT_RESET);
+
+ return 0;
+}
+
+int board_late_init(void)
+{
+#if IS_ENABLED(CONFIG_MPFS_SYSCONTROLLER)
+ u32 ret;
+ int node;
+ u8 device_serial_number[16] = {0};
+ void *blob = (void *)gd->fdt_blob;
+ struct udevice *dev;
+ struct mpfs_sys_serv *sys_serv_priv;
+
+ ret = uclass_get_device_by_name(UCLASS_MISC, "syscontroller", &dev);
+ if (ret) {
+ debug("%s: system controller setup failed\n", __func__);
+ return ret;
+ }
+
+ sys_serv_priv = devm_kzalloc(dev, sizeof(*sys_serv_priv), GFP_KERNEL);
+ if (!sys_serv_priv)
+ return -ENOMEM;
+
+ sys_serv_priv->dev = dev;
+
+ sys_serv_priv->sys_controller = mpfs_syscontroller_get(dev);
+ ret = IS_ERR(sys_serv_priv->sys_controller);
+ if (ret) {
+ debug("%s: Failed to register system controller sub device ret=%d\n", __func__, ret);
+ return -ENODEV;
+ }
+
+ ret = mpfs_syscontroller_read_sernum(sys_serv_priv, device_serial_number);
+ if (ret) {
+ printf("Cannot read device serial number\n");
+ return -EINVAL;
+ }
+
+ /* Update MAC address with device serial number */
+ mac_addr[0] = 0x00;
+ mac_addr[1] = 0x04;
+ mac_addr[2] = 0xA3;
+ mac_addr[3] = device_serial_number[2];
+ mac_addr[4] = device_serial_number[1];
+ mac_addr[5] = device_serial_number[0];
+
+ node = fdt_path_offset(blob, "/soc/ethernet@20110000");
+ if (node >= 0) {
+ ret = fdt_setprop(blob, node, "local-mac-address", mac_addr, 6);
+ if (ret) {
+ printf("Error setting local-mac-address property for ethernet@20110000\n");
+ return -ENODEV;
+ }
+ }
+
+ mpfs_syscontroller_process_dtbo(sys_serv_priv);
+#endif
+
+ return 0;
+}
+
+int ft_board_setup(void *blob, struct bd_info *bd)
+{
+#if IS_ENABLED(CONFIG_MPFS_SYSCONTROLLER)
+ u32 ret;
+ int node;
+
+ node = fdt_path_offset(blob, "/soc/ethernet@20110000");
+ if (node >= 0) {
+ ret = fdt_setprop(blob, node, "local-mac-address", mac_addr, 6);
+ if (ret) {
+ printf("Error setting local-mac-address property for ethernet@20110000\n");
+ return -ENODEV;
+ }
+ }
+#endif
+
+ return 0;
+} \ No newline at end of file
diff --git a/board/starfive/visionfive2/spl.c b/board/starfive/visionfive2/spl.c
index 2d9431d2976..e231467f2a1 100644
--- a/board/starfive/visionfive2/spl.c
+++ b/board/starfive/visionfive2/spl.c
@@ -131,6 +131,9 @@ int board_fit_config_name_match(const char *name)
!strncmp(get_product_id_from_eeprom(), "MARC", 4) &&
!get_mmc_size_from_eeprom()) {
return 0;
+ } else if (!strcmp(name, "starfive/jh7110-orangepi-rv") &&
+ !strncmp(get_product_id_from_eeprom(), "XOPIRV", 6)) {
+ return 0;
} else if (!strcmp(name, "starfive/jh7110-pine64-star64") &&
!strncmp(get_product_id_from_eeprom(), "STAR64", 6)) {
return 0;
@@ -140,6 +143,9 @@ int board_fit_config_name_match(const char *name)
} else if (!strcmp(name, "starfive/jh7110-starfive-visionfive-2-v1.3b") &&
!strncmp(get_product_id_from_eeprom(), "VF7110B", 7)) {
return 0;
+ } else if (!strcmp(name, "starfive/jh7110-starfive-visionfive-2-lite") &&
+ !strncmp(get_product_id_from_eeprom(), "VF7110SL", 8)) {
+ return 0;
}
return -EINVAL;
diff --git a/board/starfive/visionfive2/starfive_visionfive2.c b/board/starfive/visionfive2/starfive_visionfive2.c
index 6c39fd4af35..1a76f745ec8 100644
--- a/board/starfive/visionfive2/starfive_visionfive2.c
+++ b/board/starfive/visionfive2/starfive_visionfive2.c
@@ -63,12 +63,16 @@ static void set_fdtfile(void)
} else {
fdtfile = "starfive/jh7110-milkv-marscm-lite.dtb";
}
+ } else if (!strncmp(get_product_id_from_eeprom(), "XOPIRV", 6)) {
+ fdtfile = "starfive/jh7110-orangepi-rv.dtb";
} else if (!strncmp(get_product_id_from_eeprom(), "STAR64", 6)) {
fdtfile = "starfive/jh7110-pine64-star64.dtb";
} else if (!strncmp(get_product_id_from_eeprom(), "VF7110A", 7)) {
fdtfile = "starfive/jh7110-starfive-visionfive-2-v1.2a.dtb";
} else if (!strncmp(get_product_id_from_eeprom(), "VF7110B", 7)) {
fdtfile = "starfive/jh7110-starfive-visionfive-2-v1.3b.dtb";
+ } else if (!strncmp(get_product_id_from_eeprom(), "VF7110SL", 8)) {
+ fdtfile = "starfive/jh7110-starfive-visionfive-2-lite.dtb";
} else {
log_err("Unknown product\n");
return;
diff --git a/board/starfive/visionfive2/visionfive2-i2c-eeprom.c b/board/starfive/visionfive2/visionfive2-i2c-eeprom.c
index 17a44020bcf..b9197cdd34f 100644
--- a/board/starfive/visionfive2/visionfive2-i2c-eeprom.c
+++ b/board/starfive/visionfive2/visionfive2-i2c-eeprom.c
@@ -105,7 +105,8 @@ struct eeprom_atom4_data {
u8 bom_revision; /* BOM version */
u8 mac0_addr[MAC_ADDR_BYTES]; /* Ethernet0 MAC */
u8 mac1_addr[MAC_ADDR_BYTES]; /* Ethernet1 MAC */
- u8 reserved[2];
+ u8 onboard_module; /* Onboard module flag: bit7-1: reserved, bit0: WIFI/BT */
+ u8 reserved;
};
struct starfive_eeprom_atom4 {
@@ -176,7 +177,7 @@ static void show_eeprom(void)
printf("Vendor : %s\n", pbuf.eeprom.atom1.data.vstr);
printf("Product full SN: %s\n", pbuf.eeprom.atom1.data.pstr);
printf("data version: 0x%x\n", pbuf.eeprom.atom4.data.version);
- if (pbuf.eeprom.atom4.data.version == 2) {
+ if (pbuf.eeprom.atom4.data.version == 2 || pbuf.eeprom.atom4.data.version == 3) {
printf("PCB revision: 0x%x\n", pbuf.eeprom.atom4.data.pcb_revision);
printf("BOM revision: %c\n", pbuf.eeprom.atom4.data.bom_revision);
printf("Ethernet MAC0 address: %02x:%02x:%02x:%02x:%02x:%02x\n",
@@ -187,6 +188,14 @@ static void show_eeprom(void)
pbuf.eeprom.atom4.data.mac1_addr[0], pbuf.eeprom.atom4.data.mac1_addr[1],
pbuf.eeprom.atom4.data.mac1_addr[2], pbuf.eeprom.atom4.data.mac1_addr[3],
pbuf.eeprom.atom4.data.mac1_addr[4], pbuf.eeprom.atom4.data.mac1_addr[5]);
+ if (pbuf.eeprom.atom4.data.version == 3) {
+ char str[25] = "Onboard module: ";
+
+ if (pbuf.eeprom.atom4.data.onboard_module & BIT(0))
+ strcat(str, "WIFI/BT");
+
+ printf("%s\n", str);
+ }
} else {
printf("Custom data v%d is not Supported\n", pbuf.eeprom.atom4.data.version);
dump_raw_eeprom();
@@ -260,6 +269,7 @@ static void init_local_copy(void)
pbuf.eeprom.atom4.data.bom_revision = BOM_VERSION;
set_mac_address(STARFIVE_DEFAULT_MAC0, 0);
set_mac_address(STARFIVE_DEFAULT_MAC1, 1);
+ pbuf.eeprom.atom4.data.onboard_module = 0;
}
/**
@@ -386,6 +396,23 @@ static void set_bom_revision(char *string)
}
/**
+ * set_onboard_module() - stores a StarFive onboard module flag into the local EEPROM copy
+ *
+ * Takes a pointer to a string representing the numeric onboard module flag in
+ * Hexadecimal ("0" - "FF"), stores it in the onboard_module field of the
+ * EEPROM local copy, and updates the CRC of the local copy.
+ */
+static void set_onboard_module(char *string)
+{
+ u8 onboard_module;
+
+ onboard_module = simple_strtoul(string, &string, 16);
+ pbuf.eeprom.atom4.data.onboard_module = onboard_module;
+
+ update_crc();
+}
+
+/**
* set_product_id() - stores a StarFive product ID into the local EEPROM copy
*
* Takes a pointer to a string representing the numeric product ID in
@@ -478,6 +505,9 @@ int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
} else if (!strcmp(cmd, "bom_revision")) {
set_bom_revision(argv[2]);
return 0;
+ } else if (!strcmp(cmd, "onboard_module")) {
+ set_onboard_module(argv[2]);
+ return 0;
} else if (!strcmp(cmd, "product_id")) {
set_product_id(argv[2]);
return 0;
@@ -535,38 +565,20 @@ int mac_read_from_eeprom(void)
return 0;
}
-/**
- * get_pcb_revision_from_eeprom - get the PCB revision
- *
- * 1.2A return 'A'/'a', 1.3B return 'B'/'b',other values are illegal
- */
u8 get_pcb_revision_from_eeprom(void)
{
- u8 pv = 0xFF;
-
if (read_eeprom())
- return pv;
+ return 0;
- return pbuf.eeprom.atom1.data.pstr[6];
+ return pbuf.eeprom.atom4.data.pcb_revision;
}
-/**
- * get_ddr_size_from_eeprom - get the DDR size
- * pstr: VF7110A1-2228-D008E000-00000001
- * VF7110A1/VF7110B1 : VisionFive JH7110A /VisionFive JH7110B
- * D008: 8GB LPDDR4
- * E000: No emmc device, ECxx: include emmc device, xx: Capacity size[GB]
- * return: the field of 'D008E000'
- */
-
-u32 get_ddr_size_from_eeprom(void)
+u8 get_ddr_size_from_eeprom(void)
{
- u32 pv = 0xFFFFFFFF;
-
if (read_eeprom())
- return pv;
+ return 0;
- return hextoul(&pbuf.eeprom.atom1.data.pstr[14], NULL);
+ return (hextoul(&pbuf.eeprom.atom1.data.pstr[14], NULL) >> 16) & 0xFF;
}
u32 get_mmc_size_from_eeprom(void)
@@ -603,6 +615,8 @@ U_BOOT_LONGHELP(mac,
" - stores a StarFive PCB revision into the local EEPROM copy\n"
"mac bom_revision <A>\n"
" - stores a StarFive BOM revision into the local EEPROM copy\n"
+ "mac onboard_module <?>\n"
+ " - stores a StarFive onboard module flag into the local EEPROM copy\n"
"mac product_id <VF7110A1-2228-D008E000-xxxxxxxx>\n"
" - stores a StarFive product ID into the local EEPROM copy\n"
"mac vendor <Vendor Name>\n"