summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-06-20 14:40:59 -0400
committerTom Rini <trini@konsulko.com>2022-06-20 14:40:59 -0400
commit52af0101be55da74a32e9b169864508101f886fe (patch)
tree0027962a3a4e43a1e29fa7411934501b75fe811b /board
parent78533a1ce87786d2ba9be70e657b09cded1267e1 (diff)
parent568a226f87655fd5339514f66413c2ad72f65d6f (diff)
Merge branch 'master' into next
Merge in v2022.07-rc5.
Diffstat (limited to 'board')
-rw-r--r--board/cssi/MAINTAINERS4
-rw-r--r--board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its15
-rw-r--r--board/freescale/common/Kconfig1
-rw-r--r--board/solidrun/mx6cuboxi/mx6cuboxi.c78
-rw-r--r--board/ti/am335x/board.c2
-rw-r--r--board/toradex/apalis-imx8/apalis-imx8.c81
-rw-r--r--board/toradex/apalis-tk1/apalis-tk1.c19
-rw-r--r--board/toradex/apalis_t30/apalis_t30.c20
-rw-r--r--board/toradex/colibri_t20/colibri_t20.c20
-rw-r--r--board/toradex/colibri_t30/colibri_t30.c20
-rw-r--r--board/toradex/common/tdx-cfg-block.c18
-rw-r--r--board/toradex/common/tdx-cfg-block.h1
-rw-r--r--board/xilinx/common/board.c4
13 files changed, 274 insertions, 9 deletions
diff --git a/board/cssi/MAINTAINERS b/board/cssi/MAINTAINERS
index cbf1406a54..7d237b0b20 100644
--- a/board/cssi/MAINTAINERS
+++ b/board/cssi/MAINTAINERS
@@ -1,5 +1,5 @@
-BOARDS from CS Systemes d'Information
-M: Christophe Leroy <christophe.leroy@c-s.fr>
+BOARDS from CS GROUP France
+M: Christophe Leroy <christophe.leroy@csgroup.eu>
S: Maintained
F: board/cssi/
F: include/configs/MCR3000.h
diff --git a/board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its b/board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its
index 0ea10a1497..de7dcb317f 100644
--- a/board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its
+++ b/board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its
@@ -23,6 +23,14 @@
arch = "arm";
compression = "none";
};
+
+ fdt-2 {
+ description = ".dtb";
+ data = /incbin/("arch/arm/dts/stm32mp15xx-dhcor-drc-compact.dtb");
+ type = "flat_dt";
+ arch = "arm";
+ compression = "none";
+ };
};
configurations {
@@ -35,6 +43,13 @@
fdt = "fdt-1";
};
+ config-2 {
+ /* DT+SoM+board model */
+ description = "dh,stm32mp15xx-dhcor-drc-compact_somrev0_boardrev0";
+ firmware = "uboot";
+ fdt = "fdt-2";
+ };
+
/* Add 586-200..586-400 with fdt-2..fdt-4 here */
};
};
diff --git a/board/freescale/common/Kconfig b/board/freescale/common/Kconfig
index 6553bf63bf..b0e6e43f4f 100644
--- a/board/freescale/common/Kconfig
+++ b/board/freescale/common/Kconfig
@@ -3,6 +3,7 @@ config CHAIN_OF_TRUST
imply CMD_BLOB
imply CMD_HASH if ARM
select FSL_CAAM
+ select ARCH_MISC_INIT
select SPL_BOARD_INIT if (ARM && SPL)
select SPL_HASH if (ARM && SPL)
select SHA_HW_ACCEL
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c
index 6207bf8253..42aa5cb63c 100644
--- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
+++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
@@ -1,5 +1,7 @@
// SPDX-License-Identifier: GPL-2.0+
/*
+ * Copyright (C) 2022 Josua Mayer <josua@solid-run.com>
+ *
* Copyright (C) 2015 Freescale Semiconductor, Inc.
*
* Author: Fabio Estevam <fabio.estevam@freescale.com>
@@ -39,6 +41,8 @@
#include <spl.h>
#include <usb.h>
#include <usb/ehci-ci.h>
+#include <netdev.h>
+#include <phy.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -407,6 +411,80 @@ out:
return 0;
}
+static int find_ethernet_phy(void)
+{
+ struct mii_dev *bus = NULL;
+ struct phy_device *phydev = NULL;
+ int phy_addr = -ENOENT;
+
+#ifdef CONFIG_FEC_MXC
+ bus = fec_get_miibus(ENET_BASE_ADDR, -1);
+ if (!bus)
+ return -ENOENT;
+
+ // scan address 0, 1, 4
+ phydev = phy_find_by_mask(bus, 0b00010011);
+ if (!phydev) {
+ free(bus);
+ return -ENOENT;
+ }
+ pr_debug("%s: detected ethernet phy at address %d\n", __func__, phydev->addr);
+ phy_addr = phydev->addr;
+
+ free(phydev);
+#endif
+
+ return phy_addr;
+}
+
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+/*
+ * Configure the correct ethernet PHYs nodes in device-tree:
+ * - AR8035 at addresses 0 or 4: Cubox
+ * - AR8035 at address 0: HummingBoard, HummingBoard 2
+ * - ADIN1300 at address 1: since SoM rev 1.9
+ */
+int ft_board_setup(void *fdt, struct bd_info *bd)
+{
+ int node_phy0, node_phy1, node_phy4;
+ int ret, phy;
+ bool enable_phy0 = false, enable_phy1 = false, enable_phy4 = false;
+
+ // detect phy
+ phy = find_ethernet_phy();
+ if (phy == 0 || phy == 4) {
+ enable_phy0 = true;
+ switch (board_type()) {
+ case CUBOXI:
+ case UNKNOWN:
+ default:
+ enable_phy4 = true;
+ }
+ } else if (phy == 1) {
+ enable_phy1 = true;
+ } else {
+ pr_err("%s: couldn't detect ethernet phy, not patching dtb!\n", __func__);
+ return 0;
+ }
+
+ // update all phy nodes status
+ node_phy0 = fdt_path_offset(fdt, "/soc/bus@2100000/ethernet@2188000/mdio/ethernet-phy@0");
+ ret = fdt_setprop_string(fdt, node_phy0, "status", enable_phy0 ? "okay" : "disabled");
+ if (ret < 0 && enable_phy0)
+ pr_err("%s: failed to enable ethernet phy at address 0 in dtb!\n", __func__);
+ node_phy1 = fdt_path_offset(fdt, "/soc/bus@2100000/ethernet@2188000/mdio/ethernet-phy@1");
+ ret = fdt_setprop_string(fdt, node_phy1, "status", enable_phy1 ? "okay" : "disabled");
+ if (ret < 0 && enable_phy1)
+ pr_err("%s: failed to enable ethernet phy at address 1 in dtb!\n", __func__);
+ node_phy4 = fdt_path_offset(fdt, "/soc/bus@2100000/ethernet@2188000/mdio/ethernet-phy@4");
+ ret = fdt_setprop_string(fdt, node_phy4, "status", enable_phy4 ? "okay" : "disabled");
+ if (ret < 0 && enable_phy4)
+ pr_err("%s: failed to enable ethernet phy at address 4 in dtb!\n", __func__);
+
+ return 0;
+}
+#endif
+
/* Override the default implementation, DT model is not accurate */
int show_board_info(void)
{
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 7c0545892c..2cb5b1cb3f 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -902,7 +902,7 @@ int board_late_init(void)
#endif
/* CPSW plat */
-#if !CONFIG_IS_ENABLED(OF_CONTROL)
+#if CONFIG_IS_ENABLED(NET) && !CONFIG_IS_ENABLED(OF_CONTROL)
struct cpsw_slave_data slave_data[] = {
{
.slave_reg_ofs = CPSW_SLAVE0_OFFSET,
diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c
index 04877fcd94..408198843f 100644
--- a/board/toradex/apalis-imx8/apalis-imx8.c
+++ b/board/toradex/apalis-imx8/apalis-imx8.c
@@ -18,6 +18,7 @@
#include <env.h>
#include <errno.h>
#include <linux/libfdt.h>
+#include <linux/bitops.h>
#include "../common/tdx-cfg-block.h"
@@ -28,22 +29,75 @@ DECLARE_GLOBAL_DATA_PTR;
(SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
(SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
+#define TDX_USER_FUSE_BLOCK1_A 276
+#define TDX_USER_FUSE_BLOCK1_B 277
+#define TDX_USER_FUSE_BLOCK2_A 278
+#define TDX_USER_FUSE_BLOCK2_B 279
+
static iomux_cfg_t uart1_pads[] = {
SC_P_UART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
SC_P_UART1_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
};
+struct tdx_user_fuses {
+ u16 pid4;
+ u16 vers;
+ u8 ramid;
+};
+
static void setup_iomux_uart(void)
{
imx8_iomux_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
}
+static uint32_t do_get_tdx_user_fuse(int a, int b)
+{
+ sc_err_t sciErr;
+ u32 val_a = 0;
+ u32 val_b = 0;
+
+ sciErr = sc_misc_otp_fuse_read(-1, a, &val_a);
+ if (sciErr != SC_ERR_NONE) {
+ printf("Error reading out user fuse %d\n", a);
+ return 0;
+ }
+
+ sciErr = sc_misc_otp_fuse_read(-1, b, &val_b);
+ if (sciErr != SC_ERR_NONE) {
+ printf("Error reading out user fuse %d\n", b);
+ return 0;
+ }
+
+ return ((val_a & 0xffff) << 16) | (val_b & 0xffff);
+}
+
+static void get_tdx_user_fuse(struct tdx_user_fuses *tdxuserfuse)
+{
+ u32 fuse_block;
+
+ fuse_block = do_get_tdx_user_fuse(TDX_USER_FUSE_BLOCK2_A,
+ TDX_USER_FUSE_BLOCK2_B);
+
+ /*
+ * Fuse block 2 acts as a backup area, if this reads 0 we want to
+ * use fuse block 1
+ */
+ if (fuse_block == 0)
+ fuse_block = do_get_tdx_user_fuse(TDX_USER_FUSE_BLOCK1_A,
+ TDX_USER_FUSE_BLOCK1_B);
+
+ tdxuserfuse->pid4 = (fuse_block >> 18) & GENMASK(13, 0);
+ tdxuserfuse->vers = (fuse_block >> 4) & GENMASK(13, 0);
+ tdxuserfuse->ramid = fuse_block & GENMASK(3, 0);
+}
+
void board_mem_get_layout(u64 *phys_sdram_1_start,
u64 *phys_sdram_1_size,
u64 *phys_sdram_2_start,
u64 *phys_sdram_2_size)
{
u32 is_quadplus = 0, val = 0;
+ struct tdx_user_fuses tdxramfuses;
sc_err_t scierr = sc_misc_otp_fuse_read(-1, 6, &val);
if (scierr == SC_ERR_NONE) {
@@ -51,14 +105,33 @@ void board_mem_get_layout(u64 *phys_sdram_1_start,
is_quadplus = ((val >> 4) & 0x3) != 0x0;
}
+ get_tdx_user_fuse(&tdxramfuses);
+
*phys_sdram_1_start = PHYS_SDRAM_1;
*phys_sdram_1_size = PHYS_SDRAM_1_SIZE;
*phys_sdram_2_start = PHYS_SDRAM_2;
- if (is_quadplus)
- /* Our QP based SKUs only have 2 GB RAM (PHYS_SDRAM_1_SIZE) */
+
+ switch (tdxramfuses.ramid) {
+ case 1:
+ *phys_sdram_2_size = SZ_2G;
+ break;
+ case 2:
*phys_sdram_2_size = 0x0UL;
- else
- *phys_sdram_2_size = PHYS_SDRAM_2_SIZE;
+ break;
+ case 3:
+ *phys_sdram_2_size = SZ_2G;
+ break;
+ case 4:
+ *phys_sdram_2_size = SZ_4G + SZ_2G;
+ break;
+ default:
+ if (is_quadplus)
+ /* Our QP based SKUs only have 2 GB RAM (PHYS_SDRAM_1_SIZE) */
+ *phys_sdram_2_size = 0x0UL;
+ else
+ *phys_sdram_2_size = PHYS_SDRAM_2_SIZE;
+ break;
+ }
}
int board_early_init_f(void)
diff --git a/board/toradex/apalis-tk1/apalis-tk1.c b/board/toradex/apalis-tk1/apalis-tk1.c
index ccf665b211..86b10400ff 100644
--- a/board/toradex/apalis-tk1/apalis-tk1.c
+++ b/board/toradex/apalis-tk1/apalis-tk1.c
@@ -14,6 +14,7 @@
#include <asm/arch/gpio.h>
#include <asm/arch/pinmux.h>
#include <env_internal.h>
+#include <fdt_support.h>
#include <pci_tegra.h>
#include <linux/delay.h>
#include <power/as3722.h>
@@ -99,6 +100,24 @@ int checkboard(void)
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
int ft_board_setup(void *blob, struct bd_info *bd)
{
+ u8 enetaddr[6];
+
+ /* MAC addr */
+ if (eth_env_get_enetaddr("ethaddr", enetaddr)) {
+ int err = fdt_find_and_setprop(blob,
+ "/pcie@1003000/pci@2,0/ethernet@0,0",
+ "local-mac-address", enetaddr, 6, 0);
+
+ /* Older device trees might have used a different node name */
+ if (err < 0)
+ err = fdt_find_and_setprop(blob,
+ "/pcie@1003000/pci@2,0/pcie@0",
+ "local-mac-address", enetaddr, 6, 0);
+
+ if (err >= 0)
+ puts(" MAC address updated...\n");
+ }
+
return ft_common_board_setup(blob, bd);
}
#endif
diff --git a/board/toradex/apalis_t30/apalis_t30.c b/board/toradex/apalis_t30/apalis_t30.c
index 0396eea56b..ef71270d9f 100644
--- a/board/toradex/apalis_t30/apalis_t30.c
+++ b/board/toradex/apalis_t30/apalis_t30.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <env.h>
#include <init.h>
#include <log.h>
#include <asm/arch/gp_padctrl.h>
@@ -16,6 +17,7 @@
#include <asm/io.h>
#include <dm.h>
#include <i2c.h>
+#include <fdt_support.h>
#include <pci_tegra.h>
#include <linux/delay.h>
#include "../common/tdx-common.h"
@@ -54,6 +56,24 @@ int checkboard(void)
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
int ft_board_setup(void *blob, struct bd_info *bd)
{
+ u8 enetaddr[6];
+
+ /* MAC addr */
+ if (eth_env_get_enetaddr("ethaddr", enetaddr)) {
+ int err = fdt_find_and_setprop(blob,
+ "/pcie@3000/pci@3,0/ethernet@0,0",
+ "local-mac-address", enetaddr, 6, 0);
+
+ /* Older device trees might have used a different node name */
+ if (err < 0)
+ err = fdt_find_and_setprop(blob,
+ "/pcie@3000/pci@3,0/pcie@0",
+ "local-mac-address", enetaddr, 6, 0);
+
+ if (err >= 0)
+ puts(" MAC address updated...\n");
+ }
+
return ft_common_board_setup(blob, bd);
}
#endif
diff --git a/board/toradex/colibri_t20/colibri_t20.c b/board/toradex/colibri_t20/colibri_t20.c
index 73ef4d2db3..1df9697b97 100644
--- a/board/toradex/colibri_t20/colibri_t20.c
+++ b/board/toradex/colibri_t20/colibri_t20.c
@@ -4,6 +4,8 @@
*/
#include <common.h>
+#include <env.h>
+#include <fdt_support.h>
#include <init.h>
#include <log.h>
#include <asm/arch/clock.h>
@@ -81,6 +83,24 @@ int checkboard(void)
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
int ft_board_setup(void *blob, struct bd_info *bd)
{
+ u8 enetaddr[6];
+
+ /* MAC addr */
+ if (eth_env_get_enetaddr("ethaddr", enetaddr)) {
+ int err = fdt_find_and_setprop(blob,
+ "/usb@7d004000/ethernet@1",
+ "local-mac-address", enetaddr, 6, 0);
+
+ /* Older device trees might have used a different node name */
+ if (err < 0)
+ err = fdt_find_and_setprop(blob,
+ "/usb@7d004000/asix@1",
+ "local-mac-address", enetaddr, 6, 0);
+
+ if (err >= 0)
+ puts(" MAC address updated...\n");
+ }
+
return ft_common_board_setup(blob, bd);
}
#endif
diff --git a/board/toradex/colibri_t30/colibri_t30.c b/board/toradex/colibri_t30/colibri_t30.c
index 20cbb75a36..b6b004669c 100644
--- a/board/toradex/colibri_t30/colibri_t30.c
+++ b/board/toradex/colibri_t30/colibri_t30.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <env.h>
#include <init.h>
#include <asm/arch/gp_padctrl.h>
#include <asm/arch/pinmux.h>
@@ -12,6 +13,7 @@
#include <asm/arch-tegra/tegra.h>
#include <asm/gpio.h>
#include <asm/io.h>
+#include <fdt_support.h>
#include <i2c.h>
#include <linux/delay.h>
#include "pinmux-config-colibri_t30.h"
@@ -36,6 +38,24 @@ int checkboard(void)
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
int ft_board_setup(void *blob, struct bd_info *bd)
{
+ u8 enetaddr[6];
+
+ /* MAC addr */
+ if (eth_env_get_enetaddr("ethaddr", enetaddr)) {
+ int err = fdt_find_and_setprop(blob,
+ "/usb@7d004000/ethernet@1",
+ "local-mac-address", enetaddr, 6, 0);
+
+ /* Older device trees might have used a different node name */
+ if (err < 0)
+ err = fdt_find_and_setprop(blob,
+ "/usb@7d004000/asix@1",
+ "local-mac-address", enetaddr, 6, 0);
+
+ if (err >= 0)
+ puts(" MAC address updated...\n");
+ }
+
return ft_common_board_setup(blob, bd);
}
#endif
diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c
index 9c87289ae9..6c8cf4592d 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -144,6 +144,7 @@ const char * const toradex_modules[] = {
[64] = "Verdin iMX8M Plus Quad 2GB Wi-Fi / BT IT",
[65] = "Verdin iMX8M Plus QuadLite 1GB IT",
[66] = "Verdin iMX8M Plus Quad 8GB Wi-Fi / BT",
+ [67] = "Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT",
};
const char * const toradex_carrier_boards[] = {
@@ -359,6 +360,7 @@ static int get_cfgblock_interactive(void)
char *soc;
char it = 'n';
char wb = 'n';
+ char mem8g = 'n';
int len = 0;
/* Unknown module by default */
@@ -377,6 +379,14 @@ static int get_cfgblock_interactive(void)
sprintf(message, "Does the module have Wi-Fi / Bluetooth? [y/N] ");
len = cli_readline(message);
wb = console_buffer[0];
+
+#if defined(CONFIG_TARGET_APALIS_IMX8)
+ if ((wb == 'y' || wb == 'Y') && (it == 'y' || it == 'Y')) {
+ sprintf(message, "Does your module have 8GB of RAM? [y/N] ");
+ len = cli_readline(message);
+ mem8g = console_buffer[0];
+ }
+#endif
#endif
soc = env_get("soc");
@@ -430,8 +440,12 @@ static int get_cfgblock_interactive(void)
tdx_hw_tag.prodid = COLIBRI_IMX7S;
else if (is_cpu_type(MXC_CPU_IMX8QM)) {
if (it == 'y' || it == 'Y') {
- if (wb == 'y' || wb == 'Y')
- tdx_hw_tag.prodid = APALIS_IMX8QM_WIFI_BT_IT;
+ if (wb == 'y' || wb == 'Y') {
+ if (mem8g == 'y' || mem8g == 'Y')
+ tdx_hw_tag.prodid = APALIS_IMX8QM_8GB_WIFI_BT_IT;
+ else
+ tdx_hw_tag.prodid = APALIS_IMX8QM_WIFI_BT_IT;
+ }
else
tdx_hw_tag.prodid = APALIS_IMX8QM_IT;
} else {
diff --git a/board/toradex/common/tdx-cfg-block.h b/board/toradex/common/tdx-cfg-block.h
index ddcf699748..43e662e41d 100644
--- a/board/toradex/common/tdx-cfg-block.h
+++ b/board/toradex/common/tdx-cfg-block.h
@@ -87,6 +87,7 @@ enum {
VERDIN_IMX8MPQ_2GB_WIFI_BT_IT,
VERDIN_IMX8MPQL_IT, /* 65 */
VERDIN_IMX8MPQ_8GB_WIFI_BT,
+ APALIS_IMX8QM_8GB_WIFI_BT_IT,
};
enum {
diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
index 5be3090c31..629a6ee036 100644
--- a/board/xilinx/common/board.c
+++ b/board/xilinx/common/board.c
@@ -245,6 +245,10 @@ static int xilinx_read_eeprom_fru(struct udevice *dev, char *name,
}
strncpy(desc->revision, (char *)fru_data.brd.rev,
sizeof(desc->revision));
+ for (i = 0; i < sizeof(desc->revision); i++) {
+ if (desc->revision[i] == ' ')
+ desc->revision[i] = '\0';
+ }
strncpy(desc->serial, (char *)fru_data.brd.serial_number,
sizeof(desc->serial));