aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
Diffstat (limited to 'board')
-rw-r--r--board/Arcturus/ucp1020/spl.c2
-rw-r--r--board/Arcturus/ucp1020/spl_minimal.c6
-rw-r--r--board/Synology/ds109/ds109.c9
-rw-r--r--board/armltd/integrator/integrator.c6
-rw-r--r--board/armltd/total_compute/total_compute.c6
-rw-r--r--board/armltd/vexpress64/vexpress64.c6
-rw-r--r--board/bluewater/gurnard/gurnard.c8
-rw-r--r--board/bluewater/snapper9260/snapper9260.c6
-rw-r--r--board/cadence/xtfpga/xtfpga.c6
-rw-r--r--board/cavium/thunderx/thunderx.c12
-rw-r--r--board/compulab/cm_fx6/cm_fx6.c6
-rw-r--r--board/davinci/da8xxevm/omapl138_lcdk.c12
-rw-r--r--board/dhelectronics/dh_stm32mp1/board.c6
-rw-r--r--board/emulation/common/Kconfig15
-rw-r--r--board/emulation/common/Makefile5
-rw-r--r--board/emulation/common/qemu_capsule.c48
-rw-r--r--board/emulation/common/qemu_dfu.c68
-rw-r--r--board/emulation/common/qemu_mtdparts.c82
-rw-r--r--board/emulation/qemu-arm/Kconfig8
-rw-r--r--board/emulation/qemu-arm/qemu-arm.c5
-rw-r--r--board/freescale/ls1012afrdm/eth.c8
-rw-r--r--board/freescale/ls1012aqds/eth.c8
-rw-r--r--board/freescale/ls1012ardb/eth.c8
-rw-r--r--board/freescale/lx2160a/lx2160a.c12
-rw-r--r--board/freescale/mpc8313erdb/mpc8313erdb.c6
-rw-r--r--board/freescale/mpc8315erdb/mpc8315erdb.c6
-rw-r--r--board/freescale/mx6sabresd/mx6sabresd.c6
-rw-r--r--board/freescale/p1010rdb/spl.c2
-rw-r--r--board/freescale/p1010rdb/spl_minimal.c8
-rw-r--r--board/freescale/p1_p2_rdb_pc/spl.c2
-rw-r--r--board/freescale/p1_p2_rdb_pc/spl_minimal.c8
-rw-r--r--board/freescale/t102xrdb/spl.c2
-rw-r--r--board/freescale/t104xrdb/spl.c2
-rw-r--r--board/freescale/t208xqds/spl.c2
-rw-r--r--board/freescale/t208xrdb/spl.c2
-rw-r--r--board/freescale/t4rdb/spl.c2
-rw-r--r--board/gateworks/gw_ventana/gw_ventana.c6
-rw-r--r--board/ge/bx50v3/bx50v3.c51
-rw-r--r--board/google/chromebook_coral/coral.c4
-rw-r--r--board/google/gru/gru.c2
-rw-r--r--board/hisilicon/hikey/hikey.c10
-rw-r--r--board/hisilicon/hikey960/hikey960.c6
-rw-r--r--board/hisilicon/poplar/poplar.c6
-rw-r--r--board/intel/galileo/galileo.c2
-rw-r--r--board/isee/igep00x0/igep00x0.c4
-rw-r--r--board/keymile/common/common.c44
-rw-r--r--board/keymile/common/ivm.c84
-rw-r--r--board/keymile/km_arm/fpga_config.c16
-rw-r--r--board/keymile/km_arm/km_arm.c41
-rw-r--r--board/kontron/sl28/Kconfig33
-rw-r--r--board/kontron/sl28/Makefile6
-rw-r--r--board/kontron/sl28/sl28.c7
-rw-r--r--board/kontron/sl28/spl_atf.c54
-rw-r--r--board/lg/sniper/sniper.c6
-rw-r--r--board/liebherr/xea/spl_xea.c2
-rw-r--r--board/nokia/rx51/rx51.c8
-rw-r--r--board/nvidia/jetson-tk1/jetson-tk1.c2
-rw-r--r--board/nvidia/nyan-big/nyan-big.c2
-rw-r--r--board/renesas/ulcb/cpld.c4
-rw-r--r--board/sandbox/sandbox.c6
-rw-r--r--board/siemens/corvus/board.c6
-rw-r--r--board/sifive/fu540/fu540.c2
-rw-r--r--board/st/common/cmd_stboard.c2
-rw-r--r--board/st/common/stm32mp_dfu.c4
-rw-r--r--board/st/common/stpmic1.c4
-rw-r--r--board/st/common/stusb160x.c2
-rw-r--r--board/st/stm32mp1/stm32mp1.c12
-rw-r--r--board/st/stv0991/stv0991.c6
-rw-r--r--board/sunxi/MAINTAINERS5
-rw-r--r--board/sunxi/board.c145
-rw-r--r--board/synopsys/hsdk/clk-lib.c2
-rw-r--r--board/sysam/amcore/amcore.c6
-rw-r--r--board/ti/am335x/board.c18
-rw-r--r--board/ti/j721e/evm.c4
-rw-r--r--board/timll/devkit8000/devkit8000.c4
-rw-r--r--board/toradex/apalis-imx8x/MAINTAINERS2
-rw-r--r--board/toradex/apalis-tk1/apalis-tk1.c4
-rw-r--r--board/toradex/apalis_imx6/MAINTAINERS2
-rw-r--r--board/toradex/apalis_imx6/apalis_imx6.c6
-rw-r--r--board/toradex/colibri-imx6ull/MAINTAINERS2
-rw-r--r--board/toradex/colibri-imx6ull/colibri-imx6ull.c6
-rw-r--r--board/toradex/colibri_imx6/MAINTAINERS2
-rw-r--r--board/toradex/colibri_imx6/colibri_imx6.c6
-rw-r--r--board/toradex/colibri_imx7/MAINTAINERS2
-rw-r--r--board/toradex/colibri_pxa270/colibri_pxa270.c12
-rw-r--r--board/toradex/colibri_t20/MAINTAINERS2
-rw-r--r--board/toradex/colibri_t30/MAINTAINERS2
-rw-r--r--board/toradex/colibri_vf/MAINTAINERS2
-rw-r--r--board/toradex/verdin-imx8mm/MAINTAINERS2
-rw-r--r--board/variscite/dart_6ul/dart_6ul.c104
-rw-r--r--board/xilinx/common/fru_ops.c2
-rw-r--r--board/xilinx/microblaze-generic/MAINTAINERS1
-rw-r--r--board/xilinx/microblaze-generic/microblaze-generic.c5
-rw-r--r--board/xilinx/versal/MAINTAINERS1
-rw-r--r--board/xilinx/versal/board.c12
-rw-r--r--board/xilinx/zynq/MAINTAINERS1
-rw-r--r--board/xilinx/zynqmp/MAINTAINERS1
-rw-r--r--board/xilinx/zynqmp/zynqmp.c12
98 files changed, 853 insertions, 372 deletions
diff --git a/board/Arcturus/ucp1020/spl.c b/board/Arcturus/ucp1020/spl.c
index 0fd9532..4ed06a8 100644
--- a/board/Arcturus/ucp1020/spl.c
+++ b/board/Arcturus/ucp1020/spl.c
@@ -58,7 +58,7 @@ void board_init_f(ulong bootflag)
bus_clk = CONFIG_SYS_CLK_FREQ * plat_ratio;
gd->bus_clk = bus_clk;
- NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
+ ns16550_init((struct ns16550 *)CONFIG_SYS_NS16550_COM1,
bus_clk / 16 / CONFIG_BAUDRATE);
#ifdef CONFIG_SPL_MMC_BOOT
puts("\nSD boot...\n");
diff --git a/board/Arcturus/ucp1020/spl_minimal.c b/board/Arcturus/ucp1020/spl_minimal.c
index cd0022a..90abec9 100644
--- a/board/Arcturus/ucp1020/spl_minimal.c
+++ b/board/Arcturus/ucp1020/spl_minimal.c
@@ -34,7 +34,7 @@ void board_init_f(ulong bootflag)
plat_ratio >>= 1;
gd->bus_clk = CONFIG_SYS_CLK_FREQ * plat_ratio;
- NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
+ ns16550_init((struct ns16550 *)CONFIG_SYS_NS16550_COM1,
gd->bus_clk / 16 / CONFIG_BAUDRATE);
puts("\nNAND boot... ");
@@ -55,9 +55,9 @@ void board_init_r(gd_t *gd, ulong dest_addr)
void putc(char c)
{
if (c == '\n')
- NS16550_putc((NS16550_t)CONFIG_SYS_NS16550_COM1, '\r');
+ ns16550_putc((struct ns16550 *)CONFIG_SYS_NS16550_COM1, '\r');
- NS16550_putc((NS16550_t)CONFIG_SYS_NS16550_COM1, c);
+ ns16550_putc((struct ns16550 *)CONFIG_SYS_NS16550_COM1, c);
}
void puts(const char *str)
diff --git a/board/Synology/ds109/ds109.c b/board/Synology/ds109/ds109.c
index aa2987d..fe3b0eb 100644
--- a/board/Synology/ds109/ds109.c
+++ b/board/Synology/ds109/ds109.c
@@ -106,10 +106,11 @@ void reset_misc(void)
printf("Synology reset...");
udelay(50000);
- b_d = ns16550_calc_divisor((NS16550_t)CONFIG_SYS_NS16550_COM2,
- CONFIG_SYS_NS16550_CLK, 9600);
- NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM2, b_d);
- NS16550_putc((NS16550_t)CONFIG_SYS_NS16550_COM2, SOFTWARE_REBOOT);
+ b_d = ns16550_calc_divisor((struct ns16550 *)CONFIG_SYS_NS16550_COM2,
+ CONFIG_SYS_NS16550_CLK, 9600);
+ ns16550_init((struct ns16550 *)CONFIG_SYS_NS16550_COM2, b_d);
+ ns16550_putc((struct ns16550 *)CONFIG_SYS_NS16550_COM2,
+ SOFTWARE_REBOOT);
}
/* Support old kernels */
diff --git a/board/armltd/integrator/integrator.c b/board/armltd/integrator/integrator.c
index 19871be..3c56fa1 100644
--- a/board/armltd/integrator/integrator.c
+++ b/board/armltd/integrator/integrator.c
@@ -32,7 +32,7 @@
DECLARE_GLOBAL_DATA_PTR;
-static const struct pl01x_serial_platdata serial_platdata = {
+static const struct pl01x_serial_plat serial_plat = {
.base = 0x16000000,
#ifdef CONFIG_ARCH_CINTEGRATOR
.type = TYPE_PL011,
@@ -43,9 +43,9 @@ static const struct pl01x_serial_platdata serial_platdata = {
#endif
};
-U_BOOT_DEVICE(integrator_serials) = {
+U_BOOT_DRVINFO(integrator_serials) = {
.name = "serial_pl01x",
- .platdata = &serial_platdata,
+ .plat = &serial_plat,
};
void peripheral_power_enable (void);
diff --git a/board/armltd/total_compute/total_compute.c b/board/armltd/total_compute/total_compute.c
index 0be6435..da24b32 100644
--- a/board/armltd/total_compute/total_compute.c
+++ b/board/armltd/total_compute/total_compute.c
@@ -9,15 +9,15 @@
#include <dm/platform_data/serial_pl01x.h>
#include <asm/armv8/mmu.h>
-static const struct pl01x_serial_platdata serial_platdata = {
+static const struct pl01x_serial_plat serial_plat = {
.base = UART0_BASE,
.type = TYPE_PL011,
.clock = CONFIG_PL011_CLOCK,
};
-U_BOOT_DEVICE(total_compute_serials) = {
+U_BOOT_DRVINFO(total_compute_serials) = {
.name = "serial_pl01x",
- .platdata = &serial_platdata,
+ .plat = &serial_plat,
};
static struct mm_region total_compute_mem_map[] = {
diff --git a/board/armltd/vexpress64/vexpress64.c b/board/armltd/vexpress64/vexpress64.c
index 52ada0f..bd66d52 100644
--- a/board/armltd/vexpress64/vexpress64.c
+++ b/board/armltd/vexpress64/vexpress64.c
@@ -20,15 +20,15 @@
DECLARE_GLOBAL_DATA_PTR;
-static const struct pl01x_serial_platdata serial_platdata = {
+static const struct pl01x_serial_plat serial_plat = {
.base = V2M_UART0,
.type = TYPE_PL011,
.clock = CONFIG_PL011_CLOCK,
};
-U_BOOT_DEVICE(vexpress_serials) = {
+U_BOOT_DRVINFO(vexpress_serials) = {
.name = "serial_pl01x",
- .platdata = &serial_platdata,
+ .plat = &serial_plat,
};
static struct mm_region vexpress64_mem_map[] = {
diff --git a/board/bluewater/gurnard/gurnard.c b/board/bluewater/gurnard/gurnard.c
index dc9871d..17ecdb6 100644
--- a/board/bluewater/gurnard/gurnard.c
+++ b/board/bluewater/gurnard/gurnard.c
@@ -348,7 +348,7 @@ int board_init(void)
uclass_find_first_device(UCLASS_VIDEO, &dev);
if (dev) {
- struct atmel_lcd_platdata *plat = dev_get_platdata(dev);
+ struct atmel_lcd_plat *plat = dev_get_plat(dev);
plat->timing_index = 1;
}
@@ -416,11 +416,11 @@ void reset_phy(void)
{
}
-static struct atmel_serial_platdata at91sam9260_serial_plat = {
+static struct atmel_serial_plat at91sam9260_serial_plat = {
.base_addr = ATMEL_BASE_DBGU,
};
-U_BOOT_DEVICE(at91sam9260_serial) = {
+U_BOOT_DRVINFO(at91sam9260_serial) = {
.name = "serial_atmel",
- .platdata = &at91sam9260_serial_plat,
+ .plat = &at91sam9260_serial_plat,
};
diff --git a/board/bluewater/snapper9260/snapper9260.c b/board/bluewater/snapper9260/snapper9260.c
index 9b0a75a..58fab15 100644
--- a/board/bluewater/snapper9260/snapper9260.c
+++ b/board/bluewater/snapper9260/snapper9260.c
@@ -143,11 +143,11 @@ void reset_phy(void)
{
}
-static struct atmel_serial_platdata at91sam9260_serial_plat = {
+static struct atmel_serial_plat at91sam9260_serial_plat = {
.base_addr = ATMEL_BASE_DBGU,
};
-U_BOOT_DEVICE(at91sam9260_serial) = {
+U_BOOT_DRVINFO(at91sam9260_serial) = {
.name = "serial_atmel",
- .platdata = &at91sam9260_serial_plat,
+ .plat = &at91sam9260_serial_plat,
};
diff --git a/board/cadence/xtfpga/xtfpga.c b/board/cadence/xtfpga/xtfpga.c
index 5811c43..c26793d 100644
--- a/board/cadence/xtfpga/xtfpga.c
+++ b/board/cadence/xtfpga/xtfpga.c
@@ -93,7 +93,7 @@ int misc_init_r(void)
return 0;
}
-U_BOOT_DEVICE(sysreset) = {
+U_BOOT_DRVINFO(sysreset) = {
.name = "xtfpga_sysreset",
};
@@ -104,7 +104,7 @@ static struct ethoc_eth_pdata ethoc_pdata = {
.packet_base = CONFIG_SYS_ETHOC_BUFFER_ADDR,
};
-U_BOOT_DEVICE(ethoc) = {
+U_BOOT_DRVINFO(ethoc) = {
.name = "ethoc",
- .platdata = &ethoc_pdata,
+ .plat = &ethoc_pdata,
};
diff --git a/board/cavium/thunderx/thunderx.c b/board/cavium/thunderx/thunderx.c
index f8c2913..fd23472 100644
--- a/board/cavium/thunderx/thunderx.c
+++ b/board/cavium/thunderx/thunderx.c
@@ -18,28 +18,28 @@
#if !CONFIG_IS_ENABLED(OF_CONTROL)
#include <dm/platform_data/serial_pl01x.h>
-static const struct pl01x_serial_platdata serial0 = {
+static const struct pl01x_serial_plat serial0 = {
.base = CONFIG_SYS_SERIAL0,
.type = TYPE_PL011,
.clock = 0,
.skip_init = true,
};
-U_BOOT_DEVICE(thunderx_serial0) = {
+U_BOOT_DRVINFO(thunderx_serial0) = {
.name = "serial_pl01x",
- .platdata = &serial0,
+ .plat = &serial0,
};
-static const struct pl01x_serial_platdata serial1 = {
+static const struct pl01x_serial_plat serial1 = {
.base = CONFIG_SYS_SERIAL1,
.type = TYPE_PL011,
.clock = 0,
.skip_init = true,
};
-U_BOOT_DEVICE(thunderx_serial1) = {
+U_BOOT_DRVINFO(thunderx_serial1) = {
.name = "serial_pl01x",
- .platdata = &serial1,
+ .plat = &serial1,
};
#endif
diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
index e271268..7520e96 100644
--- a/board/compulab/cm_fx6/cm_fx6.c
+++ b/board/compulab/cm_fx6/cm_fx6.c
@@ -724,13 +724,13 @@ u32 get_board_rev(void)
return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS);
}
-static struct mxc_serial_platdata cm_fx6_mxc_serial_plat = {
+static struct mxc_serial_plat cm_fx6_mxc_serial_plat = {
.reg = (struct mxc_uart *)UART4_BASE,
};
-U_BOOT_DEVICE(cm_fx6_serial) = {
+U_BOOT_DRVINFO(cm_fx6_serial) = {
.name = "serial_mxc",
- .platdata = &cm_fx6_mxc_serial_plat,
+ .plat = &cm_fx6_mxc_serial_plat,
};
#if CONFIG_IS_ENABLED(AHCI)
diff --git a/board/davinci/da8xxevm/omapl138_lcdk.c b/board/davinci/da8xxevm/omapl138_lcdk.c
index 6bab7b1..a088585 100644
--- a/board/davinci/da8xxevm/omapl138_lcdk.c
+++ b/board/davinci/da8xxevm/omapl138_lcdk.c
@@ -356,19 +356,19 @@ int board_mmc_init(struct bd_info *bis)
#endif
#ifdef CONFIG_SPL_BUILD
-static const struct ns16550_platdata serial_pdata = {
+static const struct ns16550_plat serial_pdata = {
.base = DAVINCI_UART2_BASE,
.reg_shift = 2,
.clock = 228000000,
.fcr = UART_FCR_DEFVAL,
};
-U_BOOT_DEVICE(omapl138_uart) = {
+U_BOOT_DRVINFO(omapl138_uart) = {
.name = "ns16550_serial",
- .platdata = &serial_pdata,
+ .plat = &serial_pdata,
};
-static const struct davinci_mmc_plat mmc_platdata = {
+static const struct davinci_mmc_plat mmc_plat = {
.reg_base = (struct davinci_mmc_regs *)DAVINCI_MMC_SD0_BASE,
.cfg = {
.f_min = 200000,
@@ -379,9 +379,9 @@ static const struct davinci_mmc_plat mmc_platdata = {
.name = "da830-mmc",
},
};
-U_BOOT_DEVICE(omapl138_mmc) = {
+U_BOOT_DRVINFO(omapl138_mmc) = {
.name = "ti_da830_mmc",
- .platdata = &mmc_platdata,
+ .plat = &mmc_plat,
};
void spl_board_init(void)
diff --git a/board/dhelectronics/dh_stm32mp1/board.c b/board/dhelectronics/dh_stm32mp1/board.c
index f42d395..35669c2 100644
--- a/board/dhelectronics/dh_stm32mp1/board.c
+++ b/board/dhelectronics/dh_stm32mp1/board.c
@@ -343,7 +343,7 @@ int g_dnl_board_usb_cable_connected(void)
int ret;
ret = uclass_get_device_by_driver(UCLASS_USB_GADGET_GENERIC,
- DM_GET_DRIVER(dwc2_udc_otg),
+ DM_DRIVER_GET(dwc2_udc_otg),
&dwc2_udc_otg);
if (!ret)
debug("dwc2_udc_otg init failed\n");
@@ -475,11 +475,11 @@ static void sysconf_init(void)
* but this value need to be consistent with board design
*/
ret = uclass_get_device_by_driver(UCLASS_PMIC,
- DM_GET_DRIVER(stm32mp_pwr_pmic),
+ DM_DRIVER_GET(stm32mp_pwr_pmic),
&pwr_dev);
if (!ret) {
ret = uclass_get_device_by_driver(UCLASS_MISC,
- DM_GET_DRIVER(stm32mp_bsec),
+ DM_DRIVER_GET(stm32mp_bsec),
&dev);
if (ret) {
pr_err("Can't find stm32mp_bsec driver\n");
diff --git a/board/emulation/common/Kconfig b/board/emulation/common/Kconfig
new file mode 100644
index 0000000..4c15c8b
--- /dev/null
+++ b/board/emulation/common/Kconfig
@@ -0,0 +1,15 @@
+config MTDPARTS_NOR0
+ string "mtd boot partition for nor0"
+ default "64m(u-boot)" if TARGET_QEMU_ARM_64BIT && !TFABOOT
+ depends on SYS_MTDPARTS_RUNTIME
+ help
+ This define the partition of nor0 used to build mtparts dynamically
+ for boot from nor0.
+
+config MTDPARTS_NOR1
+ string "mtd u-boot env partition for nor1"
+ default "64m(u-boot-env)" if TARGET_QEMU_ARM_64BIT && !TFABOOT
+ depends on SYS_MTDPARTS_RUNTIME
+ help
+ This define the partition of nor1 used to build mtparts dynamically
+ for the u-boot env stored on nor1.
diff --git a/board/emulation/common/Makefile b/board/emulation/common/Makefile
new file mode 100644
index 0000000..7ed447a
--- /dev/null
+++ b/board/emulation/common/Makefile
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+obj-$(CONFIG_SYS_MTDPARTS_RUNTIME) += qemu_mtdparts.o
+obj-$(CONFIG_SET_DFU_ALT_INFO) += qemu_dfu.o
+obj-$(CONFIG_EFI_CAPSULE_FIRMWARE_MANAGEMENT) += qemu_capsule.o
diff --git a/board/emulation/common/qemu_capsule.c b/board/emulation/common/qemu_capsule.c
new file mode 100644
index 0000000..f1d4035
--- /dev/null
+++ b/board/emulation/common/qemu_capsule.c
@@ -0,0 +1,48 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2020 Linaro Limited
+ */
+
+#include <common.h>
+#include <efi_api.h>
+#include <efi_loader.h>
+#include <env.h>
+#include <fdtdec.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int efi_get_public_key_data(void **pkey, efi_uintn_t *pkey_len)
+{
+ const void *fdt_blob = gd->fdt_blob;
+ const void *blob;
+ const char *cnode_name = "capsule-key";
+ const char *snode_name = "signature";
+ int sig_node;
+ int len;
+
+ sig_node = fdt_subnode_offset(fdt_blob, 0, snode_name);
+ if (sig_node < 0) {
+ EFI_PRINT("Unable to get signature node offset\n");
+ return -FDT_ERR_NOTFOUND;
+ }
+
+ blob = fdt_getprop(fdt_blob, sig_node, cnode_name, &len);
+
+ if (!blob || len < 0) {
+ EFI_PRINT("Unable to get capsule-key value\n");
+ *pkey = NULL;
+ *pkey_len = 0;
+ return -FDT_ERR_NOTFOUND;
+ }
+
+ *pkey = (void *)blob;
+ *pkey_len = len;
+
+ return 0;
+}
+
+bool efi_capsule_auth_enabled(void)
+{
+ return env_get("capsule_authentication_enabled") != NULL ?
+ true : false;
+}
diff --git a/board/emulation/common/qemu_dfu.c b/board/emulation/common/qemu_dfu.c
new file mode 100644
index 0000000..62234a7
--- /dev/null
+++ b/board/emulation/common/qemu_dfu.c
@@ -0,0 +1,68 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2020 Linaro Limited
+ */
+
+#include <common.h>
+#include <dfu.h>
+#include <env.h>
+#include <memalign.h>
+#include <mtd.h>
+
+#define DFU_ALT_BUF_LEN SZ_1K
+
+static void board_get_alt_info(struct mtd_info *mtd, char *buf)
+{
+ struct mtd_info *part;
+ bool first = true;
+ const char *name;
+ int len, partnum = 0;
+
+ name = mtd->name;
+ len = strlen(buf);
+
+ if (buf[0] != '\0')
+ len += snprintf(buf + len, DFU_ALT_BUF_LEN - len, "&");
+ len += snprintf(buf + len, DFU_ALT_BUF_LEN - len,
+ "mtd %s=", name);
+
+ list_for_each_entry(part, &mtd->partitions, node) {
+ partnum++;
+ if (!first)
+ len += snprintf(buf + len, DFU_ALT_BUF_LEN - len, ";");
+ first = false;
+
+ len += snprintf(buf + len, DFU_ALT_BUF_LEN - len,
+ "%s part %d",
+ part->name, partnum);
+ }
+}
+
+void set_dfu_alt_info(char *interface, char *devstr)
+{
+ struct mtd_info *mtd;
+
+ ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN);
+
+ if (env_get("dfu_alt_info"))
+ return;
+
+ memset(buf, 0, sizeof(buf));
+
+ /*
+ * Currently dfu_alt_info is needed on Qemu ARM64 for
+ * capsule updates
+ */
+ if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_MANAGEMENT) &&
+ IS_ENABLED(CONFIG_TARGET_QEMU_ARM_64BIT)) {
+ /* probe all MTD devices */
+ mtd_probe_devices();
+
+ mtd = get_mtd_device_nm("nor0");
+ if (!IS_ERR_OR_NULL(mtd))
+ board_get_alt_info(mtd, buf);
+ }
+
+ env_set("dfu_alt_info", buf);
+ printf("dfu_alt_info set\n");
+}
diff --git a/board/emulation/common/qemu_mtdparts.c b/board/emulation/common/qemu_mtdparts.c
new file mode 100644
index 0000000..60212e9
--- /dev/null
+++ b/board/emulation/common/qemu_mtdparts.c
@@ -0,0 +1,82 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2020 Linaro Limited
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <mtd.h>
+
+#include <linux/string.h>
+
+#define MTDPARTS_LEN 256
+#define MTDIDS_LEN 128
+
+static void board_get_mtdparts(const char *dev, const char *partition,
+ char *mtdids, char *mtdparts)
+{
+ /* mtdids: "<dev>=<dev>, ...." */
+ if (mtdids[0] != '\0')
+ strcat(mtdids, ",");
+ strcat(mtdids, dev);
+ strcat(mtdids, "=");
+ strcat(mtdids, dev);
+
+ /* mtdparts: "mtdparts=<dev>:<mtdparts_<dev>>;..." */
+ if (mtdparts[0] != '\0')
+ strncat(mtdparts, ";", MTDPARTS_LEN);
+ else
+ strcat(mtdparts, "mtdparts=");
+
+ strncat(mtdparts, dev, MTDPARTS_LEN);
+ strncat(mtdparts, ":", MTDPARTS_LEN);
+ strncat(mtdparts, partition, MTDPARTS_LEN);
+}
+
+void board_mtdparts_default(const char **mtdids, const char **mtdparts)
+{
+ struct mtd_info *mtd;
+ struct udevice *dev;
+ const char *mtd_partition;
+ static char parts[3 * MTDPARTS_LEN + 1];
+ static char ids[MTDIDS_LEN + 1];
+ static bool mtd_initialized;
+
+ if (mtd_initialized) {
+ *mtdids = ids;
+ *mtdparts = parts;
+ return;
+ }
+
+ memset(parts, 0, sizeof(parts));
+ memset(ids, 0, sizeof(ids));
+
+ /* Currently mtdparts is needed on Qemu ARM64 for capsule updates */
+ if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_MANAGEMENT) &&
+ IS_ENABLED(CONFIG_TARGET_QEMU_ARM_64BIT)) {
+ /* probe all MTD devices */
+ for (uclass_first_device(UCLASS_MTD, &dev); dev;
+ uclass_next_device(&dev)) {
+ debug("mtd device = %s\n", dev->name);
+ }
+
+ mtd = get_mtd_device_nm("nor0");
+ if (!IS_ERR_OR_NULL(mtd)) {
+ mtd_partition = CONFIG_MTDPARTS_NOR0;
+ board_get_mtdparts("nor0", mtd_partition, ids, parts);
+ put_mtd_device(mtd);
+ }
+
+ mtd = get_mtd_device_nm("nor1");
+ if (!IS_ERR_OR_NULL(mtd)) {
+ mtd_partition = CONFIG_MTDPARTS_NOR1;
+ board_get_mtdparts("nor1", mtd_partition, ids, parts);
+ put_mtd_device(mtd);
+ }
+ }
+
+ mtd_initialized = true;
+ *mtdids = ids;
+ *mtdparts = parts;
+ debug("%s:mtdids=%s & mtdparts=%s\n", __func__, ids, parts);
+}
diff --git a/board/emulation/qemu-arm/Kconfig b/board/emulation/qemu-arm/Kconfig
index 02ae4d9..fb8d38f 100644
--- a/board/emulation/qemu-arm/Kconfig
+++ b/board/emulation/qemu-arm/Kconfig
@@ -11,3 +11,11 @@ config BOARD_SPECIFIC_OPTIONS # dummy
imply VIRTIO_BLK
endif
+
+if TARGET_QEMU_ARM_64BIT && !TFABOOT
+config BOARD_SPECIFIC_OPTIONS
+ imply SYS_MTDPARTS_RUNTIME
+ imply SET_DFU_ALT_INFO
+
+source "board/emulation/common/Kconfig"
+endif
diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c
index f18f2ed..aa68bef 100644
--- a/board/emulation/qemu-arm/qemu-arm.c
+++ b/board/emulation/qemu-arm/qemu-arm.c
@@ -65,6 +65,11 @@ struct mm_region *mem_map = qemu_arm64_mem_map;
int board_init(void)
{
+ return 0;
+}
+
+int board_late_init(void)
+{
/*
* Make sure virtio bus is enumerated so that peripherals
* on the virtio bus can be discovered by their drivers
diff --git a/board/freescale/ls1012afrdm/eth.c b/board/freescale/ls1012afrdm/eth.c
index eaea1c4..d2df935 100644
--- a/board/freescale/ls1012afrdm/eth.c
+++ b/board/freescale/ls1012afrdm/eth.c
@@ -114,12 +114,12 @@ static struct pfe_eth_pdata pfe_pdata1 = {
},
};
-U_BOOT_DEVICE(ls1012a_pfe0) = {
+U_BOOT_DRVINFO(ls1012a_pfe0) = {
.name = "pfe_eth",
- .platdata = &pfe_pdata0,
+ .plat = &pfe_pdata0,
};
-U_BOOT_DEVICE(ls1012a_pfe1) = {
+U_BOOT_DRVINFO(ls1012a_pfe1) = {
.name = "pfe_eth",
- .platdata = &pfe_pdata1,
+ .plat = &pfe_pdata1,
};
diff --git a/board/freescale/ls1012aqds/eth.c b/board/freescale/ls1012aqds/eth.c
index b4ef607..8189f41 100644
--- a/board/freescale/ls1012aqds/eth.c
+++ b/board/freescale/ls1012aqds/eth.c
@@ -298,12 +298,12 @@ static struct pfe_eth_pdata pfe_pdata1 = {
},
};
-U_BOOT_DEVICE(ls1012a_pfe0) = {
+U_BOOT_DRVINFO(ls1012a_pfe0) = {
.name = "pfe_eth",
- .platdata = &pfe_pdata0,
+ .plat = &pfe_pdata0,
};
-U_BOOT_DEVICE(ls1012a_pfe1) = {
+U_BOOT_DRVINFO(ls1012a_pfe1) = {
.name = "pfe_eth",
- .platdata = &pfe_pdata1,
+ .plat = &pfe_pdata1,
};
diff --git a/board/freescale/ls1012ardb/eth.c b/board/freescale/ls1012ardb/eth.c
index a65ff4d..2241d06 100644
--- a/board/freescale/ls1012ardb/eth.c
+++ b/board/freescale/ls1012ardb/eth.c
@@ -160,12 +160,12 @@ static struct pfe_eth_pdata pfe_pdata1 = {
},
};
-U_BOOT_DEVICE(ls1012a_pfe0) = {
+U_BOOT_DRVINFO(ls1012a_pfe0) = {
.name = "pfe_eth",
- .platdata = &pfe_pdata0,
+ .plat = &pfe_pdata0,
};
-U_BOOT_DEVICE(ls1012a_pfe1) = {
+U_BOOT_DRVINFO(ls1012a_pfe1) = {
.name = "pfe_eth",
- .platdata = &pfe_pdata1,
+ .plat = &pfe_pdata1,
};
diff --git a/board/freescale/lx2160a/lx2160a.c b/board/freescale/lx2160a/lx2160a.c
index 222906f..ea027be 100644
--- a/board/freescale/lx2160a/lx2160a.c
+++ b/board/freescale/lx2160a/lx2160a.c
@@ -52,7 +52,7 @@
DECLARE_GLOBAL_DATA_PTR;
-static struct pl01x_serial_platdata serial0 = {
+static struct pl01x_serial_plat serial0 = {
#if CONFIG_CONS_INDEX == 0
.base = CONFIG_SYS_SERIAL0,
#elif CONFIG_CONS_INDEX == 1
@@ -63,19 +63,19 @@ static struct pl01x_serial_platdata serial0 = {
.type = TYPE_PL011,
};
-U_BOOT_DEVICE(nxp_serial0) = {
+U_BOOT_DRVINFO(nxp_serial0) = {
.name = "serial_pl01x",
- .platdata = &serial0,
+ .plat = &serial0,
};
-static struct pl01x_serial_platdata serial1 = {
+static struct pl01x_serial_plat serial1 = {
.base = CONFIG_SYS_SERIAL1,
.type = TYPE_PL011,
};
-U_BOOT_DEVICE(nxp_serial1) = {
+U_BOOT_DRVINFO(nxp_serial1) = {
.name = "serial_pl01x",
- .platdata = &serial1,
+ .plat = &serial1,
};
int select_i2c_ch_pca9547(u8 ch)
diff --git a/board/freescale/mpc8313erdb/mpc8313erdb.c b/board/freescale/mpc8313erdb/mpc8313erdb.c
index 65a10c3..7e1a31f 100644
--- a/board/freescale/mpc8313erdb/mpc8313erdb.c
+++ b/board/freescale/mpc8313erdb/mpc8313erdb.c
@@ -132,7 +132,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
void board_init_f(ulong bootflag)
{
board_early_init_f();
- NS16550_init((NS16550_t)(CONFIG_SYS_IMMR + 0x4500),
+ ns16550_init((struct ns16550 *)(CONFIG_SYS_IMMR + 0x4500),
CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE);
puts("NAND boot... ");
timer_init();
@@ -152,8 +152,8 @@ void putc(char c)
return;
if (c == '\n')
- NS16550_putc((NS16550_t)(CONFIG_SYS_IMMR + 0x4500), '\r');
+ ns16550_putc((struct ns16550 *)(CONFIG_SYS_IMMR + 0x4500), '\r');
- NS16550_putc((NS16550_t)(CONFIG_SYS_IMMR + 0x4500), c);
+ ns16550_putc((struct ns16550 *)(CONFIG_SYS_IMMR + 0x4500), c);
}
#endif
diff --git a/board/freescale/mpc8315erdb/mpc8315erdb.c b/board/freescale/mpc8315erdb/mpc8315erdb.c
index f8e4599..05b983a 100644
--- a/board/freescale/mpc8315erdb/mpc8315erdb.c
+++ b/board/freescale/mpc8315erdb/mpc8315erdb.c
@@ -220,7 +220,7 @@ int checkboard(void)
void board_init_f(ulong bootflag)
{
board_early_init_f();
- NS16550_init((NS16550_t)(CONFIG_SYS_IMMR + 0x4500),
+ ns16550_init((struct ns16550 *)(CONFIG_SYS_IMMR + 0x4500),
CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE);
puts("NAND boot... ");
timer_init();
@@ -240,9 +240,9 @@ void putc(char c)
return;
if (c == '\n')
- NS16550_putc((NS16550_t)(CONFIG_SYS_IMMR + 0x4500), '\r');
+ ns16550_putc((struct ns16550 *)(CONFIG_SYS_IMMR + 0x4500), '\r');
- NS16550_putc((NS16550_t)(CONFIG_SYS_IMMR + 0x4500), c);
+ ns16550_putc((struct ns16550 *)(CONFIG_SYS_IMMR + 0x4500), c);
}
#endif /* CONFIG_NAND_SPL */
diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c
index 0d343da..9a176f4 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -575,12 +575,6 @@ int board_late_init(void)
return 0;
}
-int checkboard(void)
-{
- puts("Board: MX6-SabreSD\n");
- return 0;
-}
-
#ifdef CONFIG_SPL_BUILD
#include <asm/arch/mx6-ddr.h>
#include <spl.h>
diff --git a/board/freescale/p1010rdb/spl.c b/board/freescale/p1010rdb/spl.c
index fbaa6a6..35b95e0 100644
--- a/board/freescale/p1010rdb/spl.c
+++ b/board/freescale/p1010rdb/spl.c
@@ -44,7 +44,7 @@ void board_init_f(ulong bootflag)
plat_ratio >>= 1;
gd->bus_clk = CONFIG_SYS_CLK_FREQ * plat_ratio;
- NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
+ ns16550_init((struct ns16550 *)CONFIG_SYS_NS16550_COM1,
gd->bus_clk / 16 / CONFIG_BAUDRATE);
#ifdef CONFIG_SPL_MMC_BOOT
diff --git a/board/freescale/p1010rdb/spl_minimal.c b/board/freescale/p1010rdb/spl_minimal.c
index 0bb2c83..989c5b1 100644
--- a/board/freescale/p1010rdb/spl_minimal.c
+++ b/board/freescale/p1010rdb/spl_minimal.c
@@ -31,8 +31,8 @@ void board_init_f(ulong bootflag)
plat_ratio >>= 1;
gd->bus_clk = CONFIG_SYS_CLK_FREQ * plat_ratio;
- NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
- gd->bus_clk / 16 / CONFIG_BAUDRATE);
+ ns16550_init((struct ns16550 *)CONFIG_SYS_NS16550_COM1,
+ gd->bus_clk / 16 / CONFIG_BAUDRATE);
puts("\nNAND boot... ");
@@ -53,9 +53,9 @@ void board_init_r(gd_t *gd, ulong dest_addr)
void putc(char c)
{
if (c == '\n')
- NS16550_putc((NS16550_t)CONFIG_SYS_NS16550_COM1, '\r');
+ ns16550_putc((struct ns16550 *)CONFIG_SYS_NS16550_COM1, '\r');
- NS16550_putc((NS16550_t)CONFIG_SYS_NS16550_COM1, c);
+ ns16550_putc((struct ns16550 *)CONFIG_SYS_NS16550_COM1, c);
}
void puts(const char *str)
diff --git a/board/freescale/p1_p2_rdb_pc/spl.c b/board/freescale/p1_p2_rdb_pc/spl.c
index 8aceceb..b16f701 100644
--- a/board/freescale/p1_p2_rdb_pc/spl.c
+++ b/board/freescale/p1_p2_rdb_pc/spl.c
@@ -50,7 +50,7 @@ void board_init_f(ulong bootflag)
bus_clk = CONFIG_SYS_CLK_FREQ * plat_ratio;
gd->bus_clk = bus_clk;
- NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
+ ns16550_init((struct ns16550 *)CONFIG_SYS_NS16550_COM1,
bus_clk / 16 / CONFIG_BAUDRATE);
#ifdef CONFIG_SPL_MMC_BOOT
puts("\nSD boot...\n");
diff --git a/board/freescale/p1_p2_rdb_pc/spl_minimal.c b/board/freescale/p1_p2_rdb_pc/spl_minimal.c
index ced5f3c..eb3f2c8 100644
--- a/board/freescale/p1_p2_rdb_pc/spl_minimal.c
+++ b/board/freescale/p1_p2_rdb_pc/spl_minimal.c
@@ -30,8 +30,8 @@ void board_init_f(ulong bootflag)
plat_ratio >>= 1;
gd->bus_clk = CONFIG_SYS_CLK_FREQ * plat_ratio;
- NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
- gd->bus_clk / 16 / CONFIG_BAUDRATE);
+ ns16550_init((struct ns16550 *)CONFIG_SYS_NS16550_COM1,
+ gd->bus_clk / 16 / CONFIG_BAUDRATE);
puts("\nNAND boot... ");
@@ -51,9 +51,9 @@ void board_init_r(gd_t *gd, ulong dest_addr)
void putc(char c)
{
if (c == '\n')
- NS16550_putc((NS16550_t)CONFIG_SYS_NS16550_COM1, '\r');
+ ns16550_putc((struct ns16550 *)CONFIG_SYS_NS16550_COM1, '\r');
- NS16550_putc((NS16550_t)CONFIG_SYS_NS16550_COM1, c);
+ ns16550_putc((struct ns16550 *)CONFIG_SYS_NS16550_COM1, c);
}
void puts(const char *str)
diff --git a/board/freescale/t102xrdb/spl.c b/board/freescale/t102xrdb/spl.c
index 09dd88a..66d2f3b 100644
--- a/board/freescale/t102xrdb/spl.c
+++ b/board/freescale/t102xrdb/spl.c
@@ -82,7 +82,7 @@ void board_init_f(ulong bootflag)
plat_ratio = (in_be32(&gur->rcwsr[0]) >> 25) & 0x1f;
ccb_clk = sys_clk * plat_ratio / 2;
- NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
+ ns16550_init((struct ns16550 *)CONFIG_SYS_NS16550_COM1,
ccb_clk / 16 / CONFIG_BAUDRATE);
#if defined(CONFIG_SPL_MMC_BOOT)
diff --git a/board/freescale/t104xrdb/spl.c b/board/freescale/t104xrdb/spl.c
index e792295..28ac12a 100644
--- a/board/freescale/t104xrdb/spl.c
+++ b/board/freescale/t104xrdb/spl.c
@@ -81,7 +81,7 @@ void board_init_f(ulong bootflag)
plat_ratio = (in_be32(&gur->rcwsr[0]) >> 25) & 0x1f;
uart_clk = sys_clk * plat_ratio / 2;
- NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
+ ns16550_init((struct ns16550 *)CONFIG_SYS_NS16550_COM1,
uart_clk / 16 / CONFIG_BAUDRATE);
relocate_code(CONFIG_SPL_RELOC_STACK, (gd_t *)CONFIG_SPL_GD_ADDR, 0x0);
diff --git a/board/freescale/t208xqds/spl.c b/board/freescale/t208xqds/spl.c
index d8c2bbe..13e61f0 100644
--- a/board/freescale/t208xqds/spl.c
+++ b/board/freescale/t208xqds/spl.c
@@ -81,7 +81,7 @@ void board_init_f(ulong bootflag)
plat_ratio = (in_be32(&gur->rcwsr[0]) >> 25) & 0x1f;
ccb_clk = sys_clk * plat_ratio / 2;
- NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
+ ns16550_init((struct ns16550 *)CONFIG_SYS_NS16550_COM1,
ccb_clk / 16 / CONFIG_BAUDRATE);
#if defined(CONFIG_SPL_MMC_BOOT)
diff --git a/board/freescale/t208xrdb/spl.c b/board/freescale/t208xrdb/spl.c
index c64bd87..2bba94d 100644
--- a/board/freescale/t208xrdb/spl.c
+++ b/board/freescale/t208xrdb/spl.c
@@ -51,7 +51,7 @@ void board_init_f(ulong bootflag)
plat_ratio = (in_be32(&gur->rcwsr[0]) >> 25) & 0x1f;
ccb_clk = sys_clk * plat_ratio / 2;
- NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
+ ns16550_init((struct ns16550 *)CONFIG_SYS_NS16550_COM1,
ccb_clk / 16 / CONFIG_BAUDRATE);
#if defined(CONFIG_SPL_MMC_BOOT)
diff --git a/board/freescale/t4rdb/spl.c b/board/freescale/t4rdb/spl.c
index 9aa0a9b..fc624ef 100644
--- a/board/freescale/t4rdb/spl.c
+++ b/board/freescale/t4rdb/spl.c
@@ -60,7 +60,7 @@ void board_init_f(ulong bootflag)
plat_ratio = (in_be32(&gur->rcwsr[0]) >> 25) & 0x1f;
ccb_clk = sys_clk * plat_ratio / 2;
- NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
+ ns16550_init((struct ns16550 *)CONFIG_SYS_NS16550_COM1,
ccb_clk / 16 / CONFIG_BAUDRATE);
puts("\nSD boot...\n");
diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c
index 9f043d8..048f624 100644
--- a/board/gateworks/gw_ventana/gw_ventana.c
+++ b/board/gateworks/gw_ventana/gw_ventana.c
@@ -1371,11 +1371,11 @@ int ft_board_setup(void *blob, struct bd_info *bd)
}
#endif /* CONFIG_OF_BOARD_SETUP */
-static struct mxc_serial_platdata ventana_mxc_serial_plat = {
+static struct mxc_serial_plat ventana_mxc_serial_plat = {
.reg = (struct mxc_uart *)UART2_BASE,
};
-U_BOOT_DEVICE(ventana_serial) = {
+U_BOOT_DRVINFO(ventana_serial) = {
.name = "serial_mxc",
- .platdata = &ventana_mxc_serial_plat,
+ .plat = &ventana_mxc_serial_plat,
};
diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c
index 4754647..3ea9425 100644
--- a/board/ge/bx50v3/bx50v3.c
+++ b/board/ge/bx50v3/bx50v3.c
@@ -47,6 +47,10 @@ DECLARE_GLOBAL_DATA_PTR;
#define VPD_PRODUCT_B650 2
#define VPD_PRODUCT_B450 3
+#define AR8033_DBG_REG_ADDR 0x1d
+#define AR8033_DBG_REG_DATA 0x1e
+#define AR8033_SERDES_REG 0x5
+
static int productid; /* Default to generic. */
static struct vpd_cache vpd;
@@ -61,31 +65,16 @@ int dram_init(void)
return 0;
}
-static int mx6_rgmii_rework(struct phy_device *phydev)
-{
- /* Configure AR8033 to ouput a 125MHz clk from CLK_25M */
- /* set device address 0x7 */
- phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x7);
- /* offset 0x8016: CLK_25M Clock Select */
- phy_write(phydev, MDIO_DEVAD_NONE, 0xe, 0x8016);
- /* enable register write, no post increment, address 0x7 */
- phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x4007);
- /* set to 125 MHz from local PLL source */
- phy_write(phydev, MDIO_DEVAD_NONE, 0xe, 0x18);
-
- /* rgmii tx clock delay enable */
- /* set debug port address: SerDes Test and System Mode Control */
- phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x05);
- /* enable rgmii tx clock delay */
- /* set the reserved bits to avoid board specific voltage peak issue*/
- phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x3D47);
-
- return 0;
-}
-
int board_phy_config(struct phy_device *phydev)
{
- mx6_rgmii_rework(phydev);
+ /*
+ * Set reserved bits to avoid board specific voltage peak issue. The
+ * value is a magic number provided directly by Qualcomm. Note, that
+ * PHY driver will take control of BIT(8) in this register to control
+ * TX clock delay, so we do not initialize that bit here.
+ */
+ phy_write(phydev, MDIO_DEVAD_NONE, AR8033_DBG_REG_ADDR, AR8033_SERDES_REG);
+ phy_write(phydev, MDIO_DEVAD_NONE, AR8033_DBG_REG_DATA, 0x3c47);
if (phydev->drv->config)
phydev->drv->config(phydev);
@@ -356,15 +345,12 @@ static void process_vpd(struct vpd_cache *vpd)
switch (vpd->product_id) {
case VPD_PRODUCT_B450:
- env_set("confidx", "1");
i210_index = 1;
break;
case VPD_PRODUCT_B650:
- env_set("confidx", "2");
i210_index = 1;
break;
case VPD_PRODUCT_B850:
- env_set("confidx", "3");
i210_index = 2;
break;
}
@@ -554,16 +540,23 @@ int ft_board_setup(void *blob, struct bd_info *bd)
int board_fit_config_name_match(const char *name)
{
+ const char *machine = name;
+
if (!vpd.is_read)
return strcmp(name, "imx6q-bx50v3");
+ if (!strncmp(machine, "Boot ", 5))
+ machine += 5;
+ if (!strncmp(machine, "imx6q-", 6))
+ machine += 6;
+
switch (vpd.product_id) {
case VPD_PRODUCT_B450:
- return strcmp(name, "imx6q-b450v3");
+ return strcasecmp(machine, "b450v3");
case VPD_PRODUCT_B650:
- return strcmp(name, "imx6q-b650v3");
+ return strcasecmp(machine, "b650v3");
case VPD_PRODUCT_B850:
- return strcmp(name, "imx6q-b850v3");
+ return strcasecmp(machine, "b850v3");
default:
return -1;
}
diff --git a/board/google/chromebook_coral/coral.c b/board/google/chromebook_coral/coral.c
index b8b923c..34b2c2a 100644
--- a/board/google/chromebook_coral/coral.c
+++ b/board/google/chromebook_coral/coral.c
@@ -143,14 +143,16 @@ struct acpi_ops coral_acpi_ops = {
.inject_dsdt = chromeos_acpi_gpio_generate,
};
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
static const struct udevice_id coral_ids[] = {
{ .compatible = "google,coral" },
{ }
};
+#endif
U_BOOT_DRIVER(coral_drv) = {
.name = "coral",
.id = UCLASS_SYSINFO,
- .of_match = coral_ids,
+ .of_match = of_match_ptr(coral_ids),
ACPI_OPS_PTR(&coral_acpi_ops)
};
diff --git a/board/google/gru/gru.c b/board/google/gru/gru.c
index 441a1a3..23080c1 100644
--- a/board/google/gru/gru.c
+++ b/board/google/gru/gru.c
@@ -45,7 +45,7 @@ int board_early_init_r(void)
* setting up.
*/
ret = uclass_get_device_by_driver(UCLASS_CLK,
- DM_GET_DRIVER(clk_rk3399), &clk);
+ DM_DRIVER_GET(clk_rk3399), &clk);
if (ret) {
debug("%s: CLK init failed: %d\n", __func__, ret);
return ret;
diff --git a/board/hisilicon/hikey/hikey.c b/board/hisilicon/hikey/hikey.c
index e89ff1a..65a8179 100644
--- a/board/hisilicon/hikey/hikey.c
+++ b/board/hisilicon/hikey/hikey.c
@@ -26,7 +26,7 @@
#include <asm/armv8/mmu.h>
/*TODO drop this table in favour of device tree */
-static const struct hikey_gpio_platdata hi6220_gpio[] = {
+static const struct hikey_gpio_plat hi6220_gpio[] = {
{ 0, HI6220_GPIO_BASE(0)},
{ 1, HI6220_GPIO_BASE(1)},
{ 2, HI6220_GPIO_BASE(2)},
@@ -50,7 +50,7 @@ static const struct hikey_gpio_platdata hi6220_gpio[] = {
};
-U_BOOT_DEVICES(hi6220_gpios) = {
+U_BOOT_DRVINFOS(hi6220_gpios) = {
{ "gpio_hi6220", &hi6220_gpio[0] },
{ "gpio_hi6220", &hi6220_gpio[1] },
{ "gpio_hi6220", &hi6220_gpio[2] },
@@ -77,7 +77,7 @@ DECLARE_GLOBAL_DATA_PTR;
#if !CONFIG_IS_ENABLED(OF_CONTROL)
-static const struct pl01x_serial_platdata serial_platdata = {
+static const struct pl01x_serial_plat serial_plat = {
#if CONFIG_CONS_INDEX == 1
.base = HI6220_UART0_BASE,
#elif CONFIG_CONS_INDEX == 4
@@ -89,9 +89,9 @@ static const struct pl01x_serial_platdata serial_platdata = {
.clock = 19200000
};
-U_BOOT_DEVICE(hikey_seriala) = {
+U_BOOT_DRVINFO(hikey_seriala) = {
.name = "serial_pl01x",
- .platdata = &serial_platdata,
+ .plat = &serial_plat,
};
#endif
diff --git a/board/hisilicon/hikey960/hikey960.c b/board/hisilicon/hikey960/hikey960.c
index db485db..3fe4c60 100644
--- a/board/hisilicon/hikey960/hikey960.c
+++ b/board/hisilicon/hikey960/hikey960.c
@@ -26,15 +26,15 @@ DECLARE_GLOBAL_DATA_PTR;
#if !CONFIG_IS_ENABLED(OF_CONTROL)
#include <dm/platform_data/serial_pl01x.h>
-static const struct pl01x_serial_platdata serial_platdata = {
+static const struct pl01x_serial_plat serial_plat = {
.base = HI3660_UART6_BASE,
.type = TYPE_PL011,
.clock = 19200000
};
-U_BOOT_DEVICE(hikey960_serial0) = {
+U_BOOT_DRVINFO(hikey960_serial0) = {
.name = "serial_pl01x",
- .platdata = &serial_platdata,
+ .plat = &serial_plat,
};
#endif
diff --git a/board/hisilicon/poplar/poplar.c b/board/hisilicon/poplar/poplar.c
index 371c3c3..bfb2c66 100644
--- a/board/hisilicon/poplar/poplar.c
+++ b/board/hisilicon/poplar/poplar.c
@@ -40,15 +40,15 @@ static struct mm_region poplar_mem_map[] = {
struct mm_region *mem_map = poplar_mem_map;
#if !CONFIG_IS_ENABLED(OF_CONTROL)
-static const struct pl01x_serial_platdata serial_platdata = {
+static const struct pl01x_serial_plat serial_plat = {
.base = REG_BASE_UART0,
.type = TYPE_PL010,
.clock = 75000000,
};
-U_BOOT_DEVICE(poplar_serial) = {
+U_BOOT_DRVINFO(poplar_serial) = {
.name = "serial_pl01x",
- .platdata = &serial_platdata,
+ .plat = &serial_plat,
};
#endif
diff --git a/board/intel/galileo/galileo.c b/board/intel/galileo/galileo.c
index 720350d..341b627 100644
--- a/board/intel/galileo/galileo.c
+++ b/board/intel/galileo/galileo.c
@@ -12,7 +12,7 @@
* Intel Galileo gen2 board uses GPIO Resume Well bank pin0 as the PERST# pin.
*
* We cannot use any public GPIO APIs in <asm-generic/gpio.h> to control this
- * pin, as these APIs will eventually call into gpio_ich6_ofdata_to_platdata()
+ * pin, as these APIs will eventually call into gpio_ich6_of_to_plat()
* in the Intel ICH6 GPIO driver where it calls PCI configuration space access
* APIs which will trigger PCI enumeration process.
*
diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c
index e0ca3c2..0932f62 100644
--- a/board/isee/igep00x0/igep00x0.c
+++ b/board/isee/igep00x0/igep00x0.c
@@ -29,14 +29,14 @@
#include <fdt_support.h>
#include "igep00x0.h"
-static const struct ns16550_platdata igep_serial = {
+static const struct ns16550_plat igep_serial = {
.base = OMAP34XX_UART3,
.reg_shift = 2,
.clock = V_NS16550_CLK,
.fcr = UART_FCR_DEFVAL,
};
-U_BOOT_DEVICE(igep_uart) = {
+U_BOOT_DRVINFO(igep_uart) = {
"ns16550_serial",
&igep_serial
};
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 03c7ce9..df507e2 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -56,7 +56,7 @@ int set_km_env(void)
/* try to read rootfssize (ram image) from environment */
p = env_get("rootfssize");
- if (p != NULL)
+ if (p)
strict_strtoul(p, 16, &rootfssize);
pram = (rootfssize + CONFIG_KM_RESERVED_PRAM + CONFIG_KM_PHRAM +
CONFIG_KM_PNVRAM) / 0x400;
@@ -165,7 +165,7 @@ static int do_setboardid(struct cmd_tbl *cmdtp, int flag, int argc,
char *p;
p = get_local_var("IVM_BoardId");
- if (p == NULL) {
+ if (!p) {
printf("can't get the IVM_Boardid\n");
return 1;
}
@@ -174,7 +174,7 @@ static int do_setboardid(struct cmd_tbl *cmdtp, int flag, int argc,
printf("set boardid=%s\n", buf);
p = get_local_var("IVM_HWKey");
- if (p == NULL) {
+ if (!p) {
printf("can't get the IVM_HWKey\n");
return 1;
}
@@ -186,8 +186,8 @@ static int do_setboardid(struct cmd_tbl *cmdtp, int flag, int argc,
return 0;
}
-U_BOOT_CMD(km_setboardid, 1, 0, do_setboardid, "setboardid", "read out bid and "
- "hwkey from IVM and set in environment");
+U_BOOT_CMD(km_setboardid, 1, 0, do_setboardid, "setboardid",
+ "read out bid and hwkey from IVM and set in environment");
/*
* command km_checkbidhwk
@@ -218,14 +218,14 @@ static int do_checkboardidhwk(struct cmd_tbl *cmdtp, int flag, int argc,
* already stored in the local hush variables
*/
p = get_local_var("IVM_BoardId");
- if (p == NULL) {
+ if (!p) {
printf("can't get the IVM_Boardid\n");
return 1;
}
rc = strict_strtoul(p, 16, &ivmbid);
p = get_local_var("IVM_HWKey");
- if (p == NULL) {
+ if (!p) {
printf("can't get the IVM_HWKey\n");
return 1;
}
@@ -238,10 +238,10 @@ static int do_checkboardidhwk(struct cmd_tbl *cmdtp, int flag, int argc,
/* now try to read values from environment if available */
p = env_get("boardid");
- if (p != NULL)
+ if (p)
rc = strict_strtoul(p, 16, &envbid);
p = env_get("hwkey");
- if (p != NULL)
+ if (p)
rc = strict_strtoul(p, 16, &envhwkey);
if (rc != 0) {
@@ -263,9 +263,8 @@ static int do_checkboardidhwk(struct cmd_tbl *cmdtp, int flag, int argc,
if (verbose) {
printf("IVM_BoardId: %ld, IVM_HWKey=%ld\n",
- ivmbid, ivmhwkey);
- printf("boardIdHwKeyList: %s\n",
- bidhwklist);
+ ivmbid, ivmhwkey);
+ printf("boardIdHwKeyList: %s\n", bidhwklist);
}
while (!found) {
/* loop over each bid/hwkey pair in the list */
@@ -291,13 +290,13 @@ static int do_checkboardidhwk(struct cmd_tbl *cmdtp, int flag, int argc,
while (*rest && !isxdigit(*rest))
rest++;
}
- if ((!bid) || (!hwkey)) {
+ if (!bid || !hwkey) {
/* end of list */
break;
}
if (verbose) {
printf("trying bid=0x%lX, hwkey=%ld\n",
- bid, hwkey);
+ bid, hwkey);
}
/*
* Compare the values of the found entry in the
@@ -305,7 +304,7 @@ static int do_checkboardidhwk(struct cmd_tbl *cmdtp, int flag, int argc,
* in the inventory eeprom. If they are equal
* set the values in environment variables.
*/
- if ((bid == ivmbid) && (hwkey == ivmhwkey)) {
+ if (bid == ivmbid && hwkey == ivmhwkey) {
char buf[10];
found = 1;
@@ -321,12 +320,12 @@ static int do_checkboardidhwk(struct cmd_tbl *cmdtp, int flag, int argc,
}
/* compare now the values */
- if ((ivmbid == envbid) && (ivmhwkey == envhwkey)) {
+ if (ivmbid == envbid && ivmhwkey == envhwkey) {
printf("boardid=0x%3lX, hwkey=%ld\n", envbid, envhwkey);
rc = 0; /* match */
} else {
printf("Error: env boardid=0x%3lX, hwkey=%ld\n", envbid,
- envhwkey);
+ envhwkey);
printf(" IVM bId=0x%3lX, hwKey=%ld\n", ivmbid, ivmhwkey);
rc = 1; /* don't match */
}
@@ -334,10 +333,8 @@ static int do_checkboardidhwk(struct cmd_tbl *cmdtp, int flag, int argc,
}
U_BOOT_CMD(km_checkbidhwk, 2, 0, do_checkboardidhwk,
- "check boardid and hwkey",
- "[v]\n - check environment parameter "\
- "\"boardIdListHex\" against stored boardid and hwkey "\
- "from the IVM\n v: verbose output"
+ "check boardid and hwkey",
+ "[v]\n - check environment parameter \"boardIdListHex\" against stored boardid and hwkey from the IVM\n v: verbose output"
);
/*
@@ -356,6 +353,7 @@ static int do_checktestboot(struct cmd_tbl *cmdtp, int flag, int argc,
#if defined(CONFIG_POST)
testpin = post_hotkeys_pressed();
#endif
+
s = env_get("test_bank");
/* when test_bank is not set, act as if testpin is not asserted */
testboot = (testpin != 0) && (s);
@@ -370,6 +368,6 @@ static int do_checktestboot(struct cmd_tbl *cmdtp, int flag, int argc,
}
U_BOOT_CMD(km_checktestboot, 2, 0, do_checktestboot,
- "check if testpin is asserted",
- "[v]\n v - verbose output"
+ "check if testpin is asserted",
+ "[v]\n v - verbose output"
);
diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c
index 60b89fe..e989bf6 100644
--- a/board/keymile/common/ivm.c
+++ b/board/keymile/common/ivm.c
@@ -46,28 +46,27 @@ static int ivm_set_value(char *name, char *value)
{
char tempbuf[256];
- if (value != NULL) {
+ if (value) {
sprintf(tempbuf, "%s=%s", name, value);
return set_local_var(tempbuf, 0);
- } else {
- unset_local_var(name);
}
+ unset_local_var(name);
return 0;
}
static int ivm_get_value(unsigned char *buf, int len, char *name, int off,
- int check)
+ int check)
{
unsigned short val;
unsigned char valbuf[30];
- if ((buf[off + 0] != buf[off + 2]) &&
- (buf[off + 2] != buf[off + 4])) {
+ if (buf[off + 0] != buf[off + 2] &&
+ buf[off + 2] != buf[off + 4]) {
printf("%s Error corrupted %s\n", __func__, name);
val = -1;
} else {
val = buf[off + 0] + (buf[off + 1] << 8);
- if ((val == 0) && (check == 1))
+ if (val == 0 && check == 1)
val = -1;
}
sprintf((char *)valbuf, "%x", val);
@@ -98,9 +97,9 @@ static char convert_char(char c)
}
static int ivm_findinventorystring(int type,
- unsigned char *const string,
- unsigned long maxlen,
- unsigned char *buf)
+ unsigned char *const string,
+ unsigned long maxlen,
+ unsigned char *buf)
{
int xcode = 0;
unsigned long cr = 0;
@@ -133,12 +132,12 @@ static int ivm_findinventorystring(int type,
*/
if (addr < INVENTORYDATASIZE) {
/* Copy the IVM string in the corresponding string */
- for (; (buf[addr] != '\r') &&
- ((buf[addr] != ';') || (!stop)) &&
- (size < (maxlen - 1) &&
- (addr < INVENTORYDATASIZE)); addr++) {
+ for (; (buf[addr] != '\r') &&
+ ((buf[addr] != ';') || (!stop)) &&
+ (size < (maxlen - 1) &&
+ (addr < INVENTORYDATASIZE)); addr++) {
size += sprintf((char *)string + size, "%c",
- convert_char (buf[addr]));
+ convert_char (buf[addr]));
}
/*
@@ -176,12 +175,12 @@ static int ivm_check_crc(unsigned char *buf, int block)
unsigned long crceeprom;
crc = ivm_calc_crc(buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN - 2);
- crceeprom = (buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN - 1] + \
+ crceeprom = (buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN - 1] +
buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN - 2] * 256);
if (crc != crceeprom) {
if (block == 0)
- printf("Error CRC Block: %d EEprom: calculated: \
- %lx EEprom: %lx\n", block, crc, crceeprom);
+ printf("Error CRC Block: %d EEprom: calculated: %lx EEprom: %lx\n",
+ block, crc, crceeprom);
return -1;
}
return 0;
@@ -189,7 +188,7 @@ static int ivm_check_crc(unsigned char *buf, int block)
/* take care of the possible MAC address offset and the IVM content offset */
static int process_mac(unsigned char *valbuf, unsigned char *buf,
- int offset, bool unique)
+ int offset, bool unique)
{
unsigned char mac[6];
unsigned long val = (buf[4] << 16) + (buf[5] << 8) + buf[6];
@@ -197,9 +196,9 @@ static int process_mac(unsigned char *valbuf, unsigned char *buf,
/* use an intermediate buffer, to not change IVM content
* MAC address is at offset 1
*/
- memcpy(mac, buf+1, 6);
+ memcpy(mac, buf + 1, 6);
- /* MAC adress can be set to locally administred, this is only allowed
+ /* MAC address can be set to locally administred, this is only allowed
* for interfaces which have now connection to the outside. For these
* addresses we need to set the second bit in the first byte.
*/
@@ -222,7 +221,7 @@ static int ivm_analyze_block2(unsigned char *buf, int len)
unsigned char valbuf[MAC_STR_SZ];
unsigned long count;
- /* IVM_MAC Adress begins at offset 1 */
+ /* IVM_MAC Address begins at offset 1 */
sprintf((char *)valbuf, "%pM", buf + 1);
ivm_set_value("IVM_MacAddress", (char *)valbuf);
/* IVM_MacCount */
@@ -247,9 +246,9 @@ int ivm_analyze_eeprom(unsigned char *buf, int len)
return -1;
ivm_get_value(buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN,
- "IVM_BoardId", 0, 1);
+ "IVM_BoardId", 0, 1);
val = ivm_get_value(buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN,
- "IVM_HWKey", 6, 1);
+ "IVM_HWKey", 6, 1);
if (val != 0xffff) {
sprintf((char *)valbuf, "%x", ((val / 100) % 10));
ivm_set_value("IVM_HWVariant", (char *)valbuf);
@@ -257,7 +256,7 @@ int ivm_analyze_eeprom(unsigned char *buf, int len)
ivm_set_value("IVM_HWVersion", (char *)valbuf);
}
ivm_get_value(buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN,
- "IVM_Functions", 12, 0);
+ "IVM_Functions", 12, 0);
GET_STRING("IVM_Symbol", IVM_POS_SYMBOL_ONLY, 8)
GET_STRING("IVM_DeviceName", IVM_POS_SHORT_TEXT, 64)
@@ -269,7 +268,7 @@ int ivm_analyze_eeprom(unsigned char *buf, int len)
while (i < len) {
if (tmp[i] == ';') {
ivm_set_value("IVM_ShortText",
- (char *)&tmp[i + 1]);
+ (char *)&tmp[i + 1]);
break;
}
i++;
@@ -292,7 +291,7 @@ int ivm_analyze_eeprom(unsigned char *buf, int len)
if (ivm_check_crc(&buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN * 2], 2) != 0)
return 0;
ivm_analyze_block2(&buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN * 2],
- CONFIG_SYS_IVM_EEPROM_PAGE_LEN);
+ CONFIG_SYS_IVM_EEPROM_PAGE_LEN);
return 0;
}
@@ -305,22 +304,23 @@ static int ivm_populate_env(unsigned char *buf, int len, int mac_address_offset)
/* do we have the page 2 filled ? if not return */
if (ivm_check_crc(buf, 2))
return 0;
- page2 = &buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN*2];
+ page2 = &buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN * 2];
-#ifndef CONFIG_KMTEGR1
- /* if an offset is defined, add it */
- process_mac(valbuf, page2, mac_address_offset, true);
- env_set((char *)"ethaddr", (char *)valbuf);
-#else
-/* KMTEGR1 has a special setup. eth0 has no connection to the outside and
- * gets an locally administred MAC address, eth1 is the debug interface and
- * gets the official MAC address from the IVM
- */
- process_mac(valbuf, page2, mac_address_offset, false);
- env_set((char *)"ethaddr", (char *)valbuf);
- process_mac(valbuf, page2, mac_address_offset, true);
- env_set((char *)"eth1addr", (char *)valbuf);
-#endif
+ if (!IS_ENABLED(CONFIG_KMTEGR1)) {
+ /* if an offset is defined, add it */
+ process_mac(valbuf, page2, mac_address_offset, true);
+ env_set((char *)"ethaddr", (char *)valbuf);
+ } else {
+ /* KMTEGR1 has a special setup. eth0 has no connection to the
+ * outside and gets an locally administred MAC address, eth1 is
+ * the debug interface and gets the official MAC address from
+ * the IVM
+ */
+ process_mac(valbuf, page2, mac_address_offset, false);
+ env_set((char *)"ethaddr", (char *)valbuf);
+ process_mac(valbuf, page2, mac_address_offset, true);
+ env_set((char *)"eth1addr", (char *)valbuf);
+ }
return 0;
}
diff --git a/board/keymile/km_arm/fpga_config.c b/board/keymile/km_arm/fpga_config.c
index abb5b7d..839b162 100644
--- a/board/keymile/km_arm/fpga_config.c
+++ b/board/keymile/km_arm/fpga_config.c
@@ -40,14 +40,14 @@ static int boco_clear_bits(u8 reg, u8 flags)
ret = i2c_read(BOCO_ADDR, reg, 1, &regval, 1);
if (ret) {
printf("%s: error reading the BOCO @%#x !!\n",
- __func__, reg);
+ __func__, reg);
return ret;
}
regval &= ~flags;
ret = i2c_write(BOCO_ADDR, reg, 1, &regval, 1);
if (ret) {
printf("%s: error writing the BOCO @%#x !!\n",
- __func__, reg);
+ __func__, reg);
return ret;
}
@@ -63,14 +63,14 @@ static int boco_set_bits(u8 reg, u8 flags)
ret = i2c_read(BOCO_ADDR, reg, 1, &regval, 1);
if (ret) {
printf("%s: error reading the BOCO @%#x !!\n",
- __func__, reg);
+ __func__, reg);
return ret;
}
regval |= flags;
ret = i2c_write(BOCO_ADDR, reg, 1, &regval, 1);
if (ret) {
printf("%s: error writing the BOCO @%#x !!\n",
- __func__, reg);
+ __func__, reg);
return ret;
}
@@ -113,7 +113,8 @@ int trigger_fpga_config(void)
skip = 0;
#ifndef CONFIG_KM_FPGA_FORCE_CONFIG
/* if the FPGA is already configured, we do not want to
- * reconfigure it */
+ * reconfigure it
+ */
skip = 0;
if (fpga_done()) {
printf("PCIe FPGA config: skipped\n");
@@ -179,7 +180,7 @@ int wait_for_fpga_config(void)
ret = i2c_read(BOCO_ADDR, SPI_REG, 1, &spictrl, 1);
if (ret) {
printf("%s: error reading the BOCO spictrl !!\n",
- __func__);
+ __func__);
return ret;
}
if (timeout-- == 0) {
@@ -235,7 +236,8 @@ int fpga_reset(void)
#endif
/* the FPGA was configured, we configure the BOCO2 so that the EEPROM
- * is available from the Bobcat SPI bus */
+ * is available from the Bobcat SPI bus
+ */
int toggle_eeprom_spi_bus(void)
{
int ret = 0;
diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index 7d191ab..60187bd 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -53,9 +53,9 @@ DECLARE_GLOBAL_DATA_PTR;
#define PHY_MARVELL_88E1118R_LED_CTRL_REG 0x0010
#define PHY_MARVELL_88E1118R_LED_CTRL_RESERVED 0x1000
-#define PHY_MARVELL_88E1118R_LED_CTRL_LED0_1000MB (0x7<<0)
-#define PHY_MARVELL_88E1118R_LED_CTRL_LED1_ACT (0x3<<4)
-#define PHY_MARVELL_88E1118R_LED_CTRL_LED2_LINK (0x0<<8)
+#define PHY_MARVELL_88E1118R_LED_CTRL_LED0_1000MB (0x7 << 0)
+#define PHY_MARVELL_88E1118R_LED_CTRL_LED1_ACT (0x3 << 4)
+#define PHY_MARVELL_88E1118R_LED_CTRL_LED2_LINK (0x0 << 8)
/* I/O pin to erase flash RGPP09 = MPP43 */
#define KM_FLASH_ERASE_ENABLE 43
@@ -169,6 +169,7 @@ static void set_bootcount_addr(void)
{
uchar buf[32];
unsigned int bootcountaddr;
+
bootcountaddr = gd->ram_size - BOOTCOUNT_ADDR;
sprintf((char *)buf, "0x%x", bootcountaddr);
env_set("bootcountaddr", (char *)buf);
@@ -192,7 +193,7 @@ int board_early_init_f(void)
/* set the 2 bitbang i2c pins as output gpios */
tmp = readl(MVEBU_GPIO0_BASE + 4);
- writel(tmp & (~KM_KIRKWOOD_SOFT_I2C_GPIOS) , MVEBU_GPIO0_BASE + 4);
+ writel(tmp & (~KM_KIRKWOOD_SOFT_I2C_GPIOS), MVEBU_GPIO0_BASE + 4);
#endif
/* adjust SDRAM size for bank 0 */
mvebu_sdram_size_adjust(0);
@@ -292,11 +293,11 @@ int mvebu_board_spi_release_bus(struct udevice *dev)
#define PHY_LED_SEL_REG 0x18
#define PHY_LED0_LINK (0x5)
-#define PHY_LED1_ACT (0x8<<4)
-#define PHY_LED2_INT (0xe<<8)
+#define PHY_LED1_ACT (0x8 << 4)
+#define PHY_LED2_INT (0xe << 8)
#define PHY_SPEC_CTRL_REG 0x1c
-#define PHY_RGMII_CLK_STABLE (0x1<<10)
-#define PHY_CLSA (0x1<<1)
+#define PHY_RGMII_CLK_STABLE (0x1 << 10)
+#define PHY_CLSA (0x1 << 1)
/* Configure and enable MV88E3018 PHY */
void reset_phy(void)
@@ -407,8 +408,8 @@ void reset_phy(void)
return;
/* check for Marvell 88E1118R Gigabit PHY (PIGGY3) */
- if ((oui == PHY_MARVELL_OUI) &&
- (model == PHY_MARVELL_88E1118R_MODEL)) {
+ if (oui == PHY_MARVELL_OUI &&
+ model == PHY_MARVELL_88E1118R_MODEL) {
/* set page register to 3 */
if (miiphy_write(name, CONFIG_PHY_BASE_ADR,
PHY_MARVELL_PAGE_REG,
@@ -438,7 +439,6 @@ void reset_phy(void)
}
#endif
-
#if defined(CONFIG_HUSH_INIT_VAR)
int hush_init_var(void)
{
@@ -478,22 +478,23 @@ int get_scl(void)
int post_hotkeys_pressed(void)
{
-#if defined(CONFIG_KM_COGE5UN)
- return kw_gpio_get_value(KM_POST_EN_L);
-#else
- return !kw_gpio_get_value(KM_POST_EN_L);
-#endif
+ if (IS_ENABLED(CONFIG_KM_COGE5UN))
+ return kw_gpio_get_value(KM_POST_EN_L);
+ else
+ return !kw_gpio_get_value(KM_POST_EN_L);
}
ulong post_word_load(void)
{
- void* addr = (void *) (gd->ram_size - BOOTCOUNT_ADDR + POST_WORD_OFF);
+ void *addr = (void *)(gd->ram_size - BOOTCOUNT_ADDR + POST_WORD_OFF);
+
return in_le32(addr);
}
void post_word_store(ulong value)
{
- void* addr = (void *) (gd->ram_size - BOOTCOUNT_ADDR + POST_WORD_OFF);
+ void *addr = (void *)(gd->ram_size - BOOTCOUNT_ADDR + POST_WORD_OFF);
+
out_le32(addr, value);
}
@@ -502,14 +503,14 @@ int arch_memory_test_prepare(u32 *vstart, u32 *size, phys_addr_t *phys_offset)
*vstart = CONFIG_SYS_SDRAM_BASE;
/* we go up to relocation plus a 1 MB margin */
- *size = CONFIG_SYS_TEXT_BASE - (1<<20);
+ *size = CONFIG_SYS_TEXT_BASE - (1 << 20);
return 0;
}
#endif
#if defined(CONFIG_SYS_EEPROM_WREN)
-int eeprom_write_enable(unsigned dev_addr, int state)
+int eeprom_write_enable(unsigned int dev_addr, int state)
{
kw_gpio_set_value(KM_KIRKWOOD_ENV_WP, !state);
diff --git a/board/kontron/sl28/Kconfig b/board/kontron/sl28/Kconfig
index cdec39b..4078ef1 100644
--- a/board/kontron/sl28/Kconfig
+++ b/board/kontron/sl28/Kconfig
@@ -15,4 +15,37 @@ config SYS_CONFIG_NAME
config SYS_TEXT_BASE
default 0x96000000
+config SL28_SPL_LOADS_ATF_BL31
+ bool "SPL loads BL31 of the ARM Trusted Firmware"
+ select SPL_ATF
+ select SPL_ATF_LOAD_IMAGE_V2
+ select ARMV8_SEC_FIRMWARE_SUPPORT
+ select SEC_FIRMWARE_ARMV8_PSCI
+ help
+ Enable this to load a BL31 image by the SPL. You have to
+ provde a bl31.bin in u-boot's root directory.
+
+if SL28_SPL_LOADS_ATF_BL31
+
+config SL28_BL31_ENTRY_ADDR
+ hex "Entry point of the BL31 image"
+ default 0xfbe00000
+
+endif
+
+config SL28_SPL_LOADS_OPTEE_BL32
+ bool "SPL loads OP-TEE Trusted OS as BL32"
+ depends on SL28_SPL_LOADS_ATF_BL31
+ help
+ Enable this to load a BL32 image by the SPL. You have to
+ provde a tee.bin in u-boot's root directory.
+
+if SL28_SPL_LOADS_OPTEE_BL32
+
+config SL28_BL32_ENTRY_ADDR
+ hex "Entry point of the BL32 image"
+ default 0xfc000000
+
+endif
+
endif
diff --git a/board/kontron/sl28/Makefile b/board/kontron/sl28/Makefile
index 74d8012..5d220f0 100644
--- a/board/kontron/sl28/Makefile
+++ b/board/kontron/sl28/Makefile
@@ -5,4 +5,8 @@ obj-y += sl28.o cmds.o
endif
obj-y += common.o ddr.o
-obj-$(CONFIG_SPL_BUILD) += spl.o
+
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o
+obj-$(CONFIG_SPL_ATF) += spl_atf.o
+endif
diff --git a/board/kontron/sl28/sl28.c b/board/kontron/sl28/sl28.c
index b18127c..34f17b4 100644
--- a/board/kontron/sl28/sl28.c
+++ b/board/kontron/sl28/sl28.c
@@ -50,6 +50,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
u64 base[CONFIG_NR_DRAM_BANKS];
u64 size[CONFIG_NR_DRAM_BANKS];
int nbanks = CONFIG_NR_DRAM_BANKS;
+ int node;
int i;
ft_cpu_setup(blob, bd);
@@ -64,5 +65,11 @@ int ft_board_setup(void *blob, struct bd_info *bd)
fdt_fixup_icid(blob);
+ if (CONFIG_IS_ENABLED(SL28_SPL_LOADS_OPTEE_BL32)) {
+ node = fdt_node_offset_by_compatible(blob, -1, "linaro,optee-tz");
+ if (node)
+ fdt_set_node_status(blob, node, FDT_STATUS_OKAY, 0);
+ }
+
return 0;
}
diff --git a/board/kontron/sl28/spl_atf.c b/board/kontron/sl28/spl_atf.c
new file mode 100644
index 0000000..5438b52
--- /dev/null
+++ b/board/kontron/sl28/spl_atf.c
@@ -0,0 +1,54 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * LS1028A TF-A calling support
+ *
+ * Copyright (c) 2020 Michael Walle <michael@walle.cc>
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <atf_common.h>
+#include <spl.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct region_info {
+ u64 addr;
+ u64 size;
+};
+
+struct dram_regions_info {
+ u64 num_dram_regions;
+ u64 total_dram_size;
+ struct region_info region[CONFIG_NR_DRAM_BANKS];
+};
+
+struct bl_params *bl2_plat_get_bl31_params_v2(uintptr_t bl32_entry,
+ uintptr_t bl33_entry,
+ uintptr_t fdt_addr)
+{
+ static struct dram_regions_info dram_regions_info = { 0 };
+ struct bl_params *bl_params;
+ struct bl_params_node *node;
+ void *dcfg_ccsr = (void *)DCFG_BASE;
+ int i;
+
+ dram_regions_info.num_dram_regions = CONFIG_NR_DRAM_BANKS;
+ for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
+ dram_regions_info.region[i].addr = gd->bd->bi_dram[i].start;
+ dram_regions_info.region[i].size = gd->bd->bi_dram[i].size;
+ dram_regions_info.total_dram_size += gd->bd->bi_dram[i].size;
+ }
+
+ bl_params = bl2_plat_get_bl31_params_v2_default(bl32_entry, bl33_entry,
+ fdt_addr);
+
+ for_each_bl_params_node(bl_params, node) {
+ if (node->image_id == ATF_BL31_IMAGE_ID) {
+ node->ep_info->args.arg3 = (uintptr_t)&dram_regions_info;
+ node->ep_info->args.arg4 = in_le32(dcfg_ccsr + DCFG_PORSR1);
+ }
+ }
+
+ return bl_params;
+}
diff --git a/board/lg/sniper/sniper.c b/board/lg/sniper/sniper.c
index dff1590..118ab26 100644
--- a/board/lg/sniper/sniper.c
+++ b/board/lg/sniper/sniper.c
@@ -30,16 +30,16 @@ const omap3_sysinfo sysinfo = {
.nand_string = "MMC"
};
-static const struct ns16550_platdata serial_omap_platdata = {
+static const struct ns16550_plat serial_omap_plat = {
.base = OMAP34XX_UART3,
.reg_shift = 2,
.clock = V_NS16550_CLK,
.fcr = UART_FCR_DEFVAL,
};
-U_BOOT_DEVICE(sniper_serial) = {
+U_BOOT_DRVINFO(sniper_serial) = {
.name = "ns16550_serial",
- .platdata = &serial_omap_platdata
+ .plat = &serial_omap_plat
};
static struct musb_hdrc_config musb_config = {
diff --git a/board/liebherr/xea/spl_xea.c b/board/liebherr/xea/spl_xea.c
index d88b75b..192f68f 100644
--- a/board/liebherr/xea/spl_xea.c
+++ b/board/liebherr/xea/spl_xea.c
@@ -20,7 +20,7 @@
#include <asm/arch/sys_proto.h>
#define MUX_CONFIG_LCD (MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_NOPULL)
-#define MUX_CONFIG_BOOT (MXS_PAD_3V3 | MXS_PAD_PULLUP)
+#define MUX_CONFIG_BOOT (MXS_PAD_3V3)
#define MUX_CONFIG_TSC (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP)
#define MUX_CONFIG_SSP0 (MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_PULLUP)
#define MUX_CONFIG_SSP2 (MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_PULLUP)
diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
index 3d62b5d..ceb4317 100644
--- a/board/nokia/rx51/rx51.c
+++ b/board/nokia/rx51/rx51.c
@@ -703,13 +703,13 @@ void board_mmc_power_init(void)
twl4030_power_mmc_init(1);
}
-static const struct omap_i2c_platdata rx51_i2c[] = {
- { I2C_BASE1, 2200000, OMAP_I2C_REV_V1 },
+static const struct omap_i2c_plat rx51_i2c[] = {
+ { I2C_BASE1, 100000, OMAP_I2C_REV_V1 },
{ I2C_BASE2, 100000, OMAP_I2C_REV_V1 },
- { I2C_BASE3, 400000, OMAP_I2C_REV_V1 },
+ { I2C_BASE3, 100000, OMAP_I2C_REV_V1 },
};
-U_BOOT_DEVICES(rx51_i2c) = {
+U_BOOT_DRVINFOS(rx51_i2c) = {
{ "i2c_omap", &rx51_i2c[0] },
{ "i2c_omap", &rx51_i2c[1] },
{ "i2c_omap", &rx51_i2c[2] },
diff --git a/board/nvidia/jetson-tk1/jetson-tk1.c b/board/nvidia/jetson-tk1/jetson-tk1.c
index 9eccdc4..d349531 100644
--- a/board/nvidia/jetson-tk1/jetson-tk1.c
+++ b/board/nvidia/jetson-tk1/jetson-tk1.c
@@ -60,7 +60,7 @@ int tegra_pcie_board_init(void)
int ret;
ret = uclass_get_device_by_driver(UCLASS_PMIC,
- DM_GET_DRIVER(pmic_as3722), &dev);
+ DM_DRIVER_GET(pmic_as3722), &dev);
if (ret) {
debug("%s: Failed to find PMIC\n", __func__);
return ret;
diff --git a/board/nvidia/nyan-big/nyan-big.c b/board/nvidia/nyan-big/nyan-big.c
index 71c71ed..06a36f8 100644
--- a/board/nvidia/nyan-big/nyan-big.c
+++ b/board/nvidia/nyan-big/nyan-big.c
@@ -52,7 +52,7 @@ int tegra_lcd_pmic_init(int board_id)
int ret;
ret = uclass_get_device_by_driver(UCLASS_PMIC,
- DM_GET_DRIVER(pmic_as3722), &dev);
+ DM_DRIVER_GET(pmic_as3722), &dev);
if (ret) {
debug("%s: Failed to find PMIC\n", __func__);
return ret;
diff --git a/board/renesas/ulcb/cpld.c b/board/renesas/ulcb/cpld.c
index a20a34a..ebb2d6f 100644
--- a/board/renesas/ulcb/cpld.c
+++ b/board/renesas/ulcb/cpld.c
@@ -91,7 +91,7 @@ static int do_cpld(struct cmd_tbl *cmdtp, int flag, int argc,
int ret;
ret = uclass_get_device_by_driver(UCLASS_SYSRESET,
- DM_GET_DRIVER(sysreset_renesas_ulcb),
+ DM_DRIVER_GET(sysreset_renesas_ulcb),
&dev);
if (ret)
return ret;
@@ -188,5 +188,5 @@ U_BOOT_DRIVER(sysreset_renesas_ulcb) = {
.ops = &renesas_ulcb_sysreset,
.probe = renesas_ulcb_sysreset_probe,
.of_match = renesas_ulcb_sysreset_ids,
- .priv_auto_alloc_size = sizeof(struct renesas_ulcb_sysreset_priv),
+ .priv_auto = sizeof(struct renesas_ulcb_sysreset_priv),
};
diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c
index 18a605d..d152703 100644
--- a/board/sandbox/sandbox.c
+++ b/board/sandbox/sandbox.c
@@ -23,15 +23,11 @@ gd_t *gd;
#if !CONFIG_IS_ENABLED(OF_PLATDATA)
/* Add a simple GPIO device */
-U_BOOT_DEVICE(gpio_sandbox) = {
+U_BOOT_DRVINFO(gpio_sandbox) = {
.name = "sandbox_gpio",
};
#endif
-void flush_cache(unsigned long start, unsigned long size)
-{
-}
-
#ifndef CONFIG_TIMER
/* system timer offset in ms */
static unsigned long sandbox_timer_offset;
diff --git a/board/siemens/corvus/board.c b/board/siemens/corvus/board.c
index eed055a..25d85a8 100644
--- a/board/siemens/corvus/board.c
+++ b/board/siemens/corvus/board.c
@@ -314,11 +314,11 @@ void spi_cs_deactivate(struct spi_slave *slave)
}
}
-static struct atmel_serial_platdata at91sam9260_serial_plat = {
+static struct atmel_serial_plat at91sam9260_serial_plat = {
.base_addr = ATMEL_BASE_DBGU,
};
-U_BOOT_DEVICE(at91sam9260_serial) = {
+U_BOOT_DRVINFO(at91sam9260_serial) = {
.name = "serial_atmel",
- .platdata = &at91sam9260_serial_plat,
+ .plat = &at91sam9260_serial_plat,
};
diff --git a/board/sifive/fu540/fu540.c b/board/sifive/fu540/fu540.c
index 54e5a4c..a4e7822 100644
--- a/board/sifive/fu540/fu540.c
+++ b/board/sifive/fu540/fu540.c
@@ -58,7 +58,7 @@ static u32 fu540_read_serialnum(void)
/* init OTP */
ret = uclass_get_device_by_driver(UCLASS_MISC,
- DM_GET_DRIVER(sifive_otp), &dev);
+ DM_DRIVER_GET(sifive_otp), &dev);
if (ret) {
debug("%s: could not find otp device\n", __func__);
diff --git a/board/st/common/cmd_stboard.c b/board/st/common/cmd_stboard.c
index e103861..2fba383 100644
--- a/board/st/common/cmd_stboard.c
+++ b/board/st/common/cmd_stboard.c
@@ -85,7 +85,7 @@ static int do_stboard(struct cmd_tbl *cmdtp, int flag, int argc,
return CMD_RET_USAGE;
ret = uclass_get_device_by_driver(UCLASS_MISC,
- DM_GET_DRIVER(stm32mp_bsec),
+ DM_DRIVER_GET(stm32mp_bsec),
&dev);
ret = misc_read(dev, STM32_BSEC_OTP(BSEC_OTP_BOARD),
diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c
index aab7d74..9c3d115 100644
--- a/board/st/common/stm32mp_dfu.c
+++ b/board/st/common/stm32mp_dfu.c
@@ -163,7 +163,7 @@ static int dfu_otp_read(u64 offset, u8 *buffer, long *size)
int ret;
ret = uclass_get_device_by_driver(UCLASS_MISC,
- DM_GET_DRIVER(stm32mp_bsec),
+ DM_DRIVER_GET(stm32mp_bsec),
&dev);
if (ret)
return ret;
@@ -184,7 +184,7 @@ static int dfu_pmic_read(u64 offset, u8 *buffer, long *size)
struct udevice *dev;
ret = uclass_get_device_by_driver(UCLASS_MISC,
- DM_GET_DRIVER(stpmic1_nvm),
+ DM_DRIVER_GET(stpmic1_nvm),
&dev);
if (ret)
return ret;
diff --git a/board/st/common/stpmic1.c b/board/st/common/stpmic1.c
index 3aa379e..a313b81 100644
--- a/board/st/common/stpmic1.c
+++ b/board/st/common/stpmic1.c
@@ -20,7 +20,7 @@ int board_ddr_power_init(enum ddr_type ddr_type)
u32 buck2;
ret = uclass_get_device_by_driver(UCLASS_PMIC,
- DM_GET_DRIVER(pmic_stpmic1), &dev);
+ DM_DRIVER_GET(pmic_stpmic1), &dev);
if (ret)
/* No PMIC on board */
return 0;
@@ -187,7 +187,7 @@ void stpmic1_init(u32 voltage_mv)
struct udevice *dev;
if (uclass_get_device_by_driver(UCLASS_PMIC,
- DM_GET_DRIVER(pmic_stpmic1), &dev))
+ DM_DRIVER_GET(pmic_stpmic1), &dev))
return;
/* update VDDCORE = BUCK1 */
diff --git a/board/st/common/stusb160x.c b/board/st/common/stusb160x.c
index f1197f9..e0a2b76 100644
--- a/board/st/common/stusb160x.c
+++ b/board/st/common/stusb160x.c
@@ -22,7 +22,7 @@ int stusb160x_cable_connected(void)
int ret;
ret = uclass_get_device_by_driver(UCLASS_I2C_GENERIC,
- DM_GET_DRIVER(stusb160x),
+ DM_DRIVER_GET(stusb160x),
&dev);
if (ret < 0)
return ret;
diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
index d3cffdd..df353cb 100644
--- a/board/st/stm32mp1/stm32mp1.c
+++ b/board/st/stm32mp1/stm32mp1.c
@@ -116,7 +116,7 @@ int checkboard(void)
/* display the STMicroelectronics board identification */
if (CONFIG_IS_ENABLED(CMD_STBOARD)) {
ret = uclass_get_device_by_driver(UCLASS_MISC,
- DM_GET_DRIVER(stm32mp_bsec),
+ DM_DRIVER_GET(stm32mp_bsec),
&dev);
if (!ret)
ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_BOARD),
@@ -196,7 +196,7 @@ int g_dnl_board_usb_cable_connected(void)
return ret;
ret = uclass_get_device_by_driver(UCLASS_USB_GADGET_GENERIC,
- DM_GET_DRIVER(dwc2_udc_otg),
+ DM_DRIVER_GET(dwc2_udc_otg),
&dwc2_udc_otg);
if (!ret)
debug("dwc2_udc_otg init failed\n");
@@ -464,11 +464,11 @@ static void sysconf_init(void)
* but this value need to be consistent with board design
*/
ret = uclass_get_device_by_driver(UCLASS_PMIC,
- DM_GET_DRIVER(stm32mp_pwr_pmic),
+ DM_DRIVER_GET(stm32mp_pwr_pmic),
&pwr_dev);
if (!ret && IS_ENABLED(CONFIG_DM_REGULATOR)) {
ret = uclass_get_device_by_driver(UCLASS_MISC,
- DM_GET_DRIVER(stm32mp_bsec),
+ DM_DRIVER_GET(stm32mp_bsec),
&dev);
if (ret) {
pr_err("Can't find stm32mp_bsec driver\n");
@@ -618,7 +618,7 @@ static void board_ev1_init(void)
struct udevice *dev;
/* configure IRQ line on EV1 for touchscreen before LCD reset */
- uclass_get_device_by_driver(UCLASS_NOP, DM_GET_DRIVER(goodix), &dev);
+ uclass_get_device_by_driver(UCLASS_NOP, DM_DRIVER_GET(goodix), &dev);
}
/* board dependent setup after realloc */
@@ -680,7 +680,7 @@ int board_late_init(void)
}
}
ret = uclass_get_device_by_driver(UCLASS_MISC,
- DM_GET_DRIVER(stm32mp_bsec),
+ DM_DRIVER_GET(stm32mp_bsec),
&dev);
if (!ret)
diff --git a/board/st/stv0991/stv0991.c b/board/st/stv0991/stv0991.c
index 8c827ad..95e203f 100644
--- a/board/st/stv0991/stv0991.c
+++ b/board/st/stv0991/stv0991.c
@@ -24,15 +24,15 @@ struct gpio_regs *const gpioa_regs =
(struct gpio_regs *) GPIOA_BASE_ADDR;
#ifndef CONFIG_OF_CONTROL
-static const struct pl01x_serial_platdata serial_platdata = {
+static const struct pl01x_serial_plat serial_plat = {
.base = 0x80406000,
.type = TYPE_PL011,
.clock = 2700 * 1000,
};
-U_BOOT_DEVICE(stv09911_serials) = {
+U_BOOT_DRVINFO(stv09911_serials) = {
.name = "serial_pl01x",
- .platdata = &serial_platdata,
+ .plat = &serial_plat,
};
#endif
diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS
index d3755ae..735801a 100644
--- a/board/sunxi/MAINTAINERS
+++ b/board/sunxi/MAINTAINERS
@@ -440,6 +440,11 @@ M: Vasily Khoruzhick <anarsoul@gmail.com>
S: Maintained
F: configs/pinebook_defconfig
+PINECUBE BOARD:
+M: Icenowy Zheng <icenowy@aosc.io>
+S: Maintained
+F: configs/pinecube_defconfig
+
PINE64 BOARDS
M: Andre Przywara <andre.przywara@arm.com>
S: Maintained
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 708a27e..4f05895 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -39,6 +39,7 @@
#include <u-boot/crc.h>
#include <env_internal.h>
#include <linux/libfdt.h>
+#include <fdt_support.h>
#include <nand.h>
#include <net.h>
#include <spl.h>
@@ -789,6 +790,38 @@ static void parse_spl_header(const uint32_t spl_addr)
env_set_hex("fel_scriptaddr", spl->fel_script_address);
}
+static bool get_unique_sid(unsigned int *sid)
+{
+ if (sunxi_get_sid(sid) != 0)
+ return false;
+
+ if (!sid[0])
+ return false;
+
+ /*
+ * The single words 1 - 3 of the SID have quite a few bits
+ * which are the same on many models, so we take a crc32
+ * of all 3 words, to get a more unique value.
+ *
+ * Note we only do this on newer SoCs as we cannot change
+ * the algorithm on older SoCs since those have been using
+ * fixed mac-addresses based on only using word 3 for a
+ * long time and changing a fixed mac-address with an
+ * u-boot update is not good.
+ */
+#if !defined(CONFIG_MACH_SUN4I) && !defined(CONFIG_MACH_SUN5I) && \
+ !defined(CONFIG_MACH_SUN6I) && !defined(CONFIG_MACH_SUN7I) && \
+ !defined(CONFIG_MACH_SUN8I_A23) && !defined(CONFIG_MACH_SUN8I_A33)
+ sid[3] = crc32(0, (unsigned char *)&sid[1], 12);
+#endif
+
+ /* Ensure the NIC specific bytes of the mac are not all 0 */
+ if ((sid[3] & 0xffffff) == 0)
+ sid[3] |= 0x800000;
+
+ return true;
+}
+
/*
* Note this function gets called multiple times.
* It must not make any changes to env variables which already exist.
@@ -799,61 +832,40 @@ static void setup_environment(const void *fdt)
unsigned int sid[4];
uint8_t mac_addr[6];
char ethaddr[16];
- int i, ret;
-
- ret = sunxi_get_sid(sid);
- if (ret == 0 && sid[0] != 0) {
- /*
- * The single words 1 - 3 of the SID have quite a few bits
- * which are the same on many models, so we take a crc32
- * of all 3 words, to get a more unique value.
- *
- * Note we only do this on newer SoCs as we cannot change
- * the algorithm on older SoCs since those have been using
- * fixed mac-addresses based on only using word 3 for a
- * long time and changing a fixed mac-address with an
- * u-boot update is not good.
- */
-#if !defined(CONFIG_MACH_SUN4I) && !defined(CONFIG_MACH_SUN5I) && \
- !defined(CONFIG_MACH_SUN6I) && !defined(CONFIG_MACH_SUN7I) && \
- !defined(CONFIG_MACH_SUN8I_A23) && !defined(CONFIG_MACH_SUN8I_A33)
- sid[3] = crc32(0, (unsigned char *)&sid[1], 12);
-#endif
+ int i;
- /* Ensure the NIC specific bytes of the mac are not all 0 */
- if ((sid[3] & 0xffffff) == 0)
- sid[3] |= 0x800000;
+ if (!get_unique_sid(sid))
+ return;
- for (i = 0; i < 4; i++) {
- sprintf(ethaddr, "ethernet%d", i);
- if (!fdt_get_alias(fdt, ethaddr))
- continue;
+ for (i = 0; i < 4; i++) {
+ sprintf(ethaddr, "ethernet%d", i);
+ if (!fdt_get_alias(fdt, ethaddr))
+ continue;
- if (i == 0)
- strcpy(ethaddr, "ethaddr");
- else
- sprintf(ethaddr, "eth%daddr", i);
+ if (i == 0)
+ strcpy(ethaddr, "ethaddr");
+ else
+ sprintf(ethaddr, "eth%daddr", i);
- if (env_get(ethaddr))
- continue;
+ if (env_get(ethaddr))
+ continue;
- /* Non OUI / registered MAC address */
- mac_addr[0] = (i << 4) | 0x02;
- mac_addr[1] = (sid[0] >> 0) & 0xff;
- mac_addr[2] = (sid[3] >> 24) & 0xff;
- mac_addr[3] = (sid[3] >> 16) & 0xff;
- mac_addr[4] = (sid[3] >> 8) & 0xff;
- mac_addr[5] = (sid[3] >> 0) & 0xff;
+ /* Non OUI / registered MAC address */
+ mac_addr[0] = (i << 4) | 0x02;
+ mac_addr[1] = (sid[0] >> 0) & 0xff;
+ mac_addr[2] = (sid[3] >> 24) & 0xff;
+ mac_addr[3] = (sid[3] >> 16) & 0xff;
+ mac_addr[4] = (sid[3] >> 8) & 0xff;
+ mac_addr[5] = (sid[3] >> 0) & 0xff;
- eth_env_set_enetaddr(ethaddr, mac_addr);
- }
+ eth_env_set_enetaddr(ethaddr, mac_addr);
+ }
- if (!env_get("serial#")) {
- snprintf(serial_string, sizeof(serial_string),
- "%08x%08x", sid[0], sid[3]);
+ if (!env_get("serial#")) {
+ snprintf(serial_string, sizeof(serial_string),
+ "%08x%08x", sid[0], sid[3]);
- env_set("serial#", serial_string);
- }
+ env_set("serial#", serial_string);
}
}
@@ -890,6 +902,11 @@ int misc_init_r(void)
setup_environment(gd->fdt_blob);
+ return 0;
+}
+
+int board_late_init(void)
+{
#ifdef CONFIG_USB_ETHER
usb_ether_init();
#endif
@@ -897,6 +914,38 @@ int misc_init_r(void)
return 0;
}
+static void bluetooth_dt_fixup(void *blob)
+{
+ /* Some devices ship with a Bluetooth controller default address.
+ * Set a valid address through the device tree.
+ */
+ uchar tmp[ETH_ALEN], bdaddr[ETH_ALEN];
+ unsigned int sid[4];
+ int i;
+
+ if (!CONFIG_BLUETOOTH_DT_DEVICE_FIXUP[0])
+ return;
+
+ if (eth_env_get_enetaddr("bdaddr", tmp)) {
+ /* Convert between the binary formats of the corresponding stacks */
+ for (i = 0; i < ETH_ALEN; ++i)
+ bdaddr[i] = tmp[ETH_ALEN - i - 1];
+ } else {
+ if (!get_unique_sid(sid))
+ return;
+
+ bdaddr[0] = ((sid[3] >> 0) & 0xff) ^ 1;
+ bdaddr[1] = (sid[3] >> 8) & 0xff;
+ bdaddr[2] = (sid[3] >> 16) & 0xff;
+ bdaddr[3] = (sid[3] >> 24) & 0xff;
+ bdaddr[4] = (sid[0] >> 0) & 0xff;
+ bdaddr[5] = 0x02;
+ }
+
+ do_fixup_by_compat(blob, CONFIG_BLUETOOTH_DT_DEVICE_FIXUP,
+ "local-bd-address", bdaddr, ETH_ALEN, 1);
+}
+
int ft_board_setup(void *blob, struct bd_info *bd)
{
int __maybe_unused r;
@@ -907,6 +956,8 @@ int ft_board_setup(void *blob, struct bd_info *bd)
*/
setup_environment(blob);
+ bluetooth_dt_fixup(blob);
+
#ifdef CONFIG_VIDEO_DT_SIMPLEFB
r = sunxi_simplefb_setup(blob);
if (r)
diff --git a/board/synopsys/hsdk/clk-lib.c b/board/synopsys/hsdk/clk-lib.c
index 1c74bfb..bd43179 100644
--- a/board/synopsys/hsdk/clk-lib.c
+++ b/board/synopsys/hsdk/clk-lib.c
@@ -23,8 +23,8 @@ int soc_clk_ctl(const char *name, ulong *rate, enum clk_ctl_ops ctl)
/* Dummy fmeas device, just to be able to use standard clk_* api */
struct udevice fmeas = {
.name = "clk-fmeas",
- .node = ofnode_path("/clk-fmeas"),
};
+ dev_set_ofnode(&fmeas, ofnode_path("/clk-fmeas"));
ret = clk_get_by_name(&fmeas, name, &clk);
if (ret) {
diff --git a/board/sysam/amcore/amcore.c b/board/sysam/amcore/amcore.c
index 4502005..65fc60e 100644
--- a/board/sysam/amcore/amcore.c
+++ b/board/sysam/amcore/amcore.c
@@ -107,13 +107,13 @@ int dram_init(void)
return 0;
}
-static struct coldfire_serial_platdata mcf5307_serial_plat = {
+static struct coldfire_serial_plat mcf5307_serial_plat = {
.base = CONFIG_SYS_UART_BASE,
.port = 0,
.baudrate = CONFIG_BAUDRATE,
};
-U_BOOT_DEVICE(coldfire_serial) = {
+U_BOOT_DRVINFO(coldfire_serial) = {
.name = "serial_coldfire",
- .platdata = &mcf5307_serial_plat,
+ .plat = &mcf5307_serial_plat,
};
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 984cc5e..40d2e02 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -885,7 +885,7 @@ int board_late_init(void)
}
#endif
-/* CPSW platdata */
+/* CPSW plat */
#if !CONFIG_IS_ENABLED(OF_CONTROL)
struct cpsw_slave_data slave_data[] = {
{
@@ -927,9 +927,9 @@ struct eth_pdata cpsw_pdata = {
.priv_pdata = &am335_eth_data,
};
-U_BOOT_DEVICE(am335x_eth) = {
+U_BOOT_DRVINFO(am335x_eth) = {
.name = "eth_cpsw",
- .platdata = &cpsw_pdata,
+ .plat = &cpsw_pdata,
};
#endif
@@ -963,7 +963,7 @@ void board_fit_image_post_process(void **p_image, size_t *p_size)
#endif
#if !CONFIG_IS_ENABLED(OF_CONTROL)
-static const struct omap_hsmmc_plat am335x_mmc0_platdata = {
+static const struct omap_hsmmc_plat am335x_mmc0_plat = {
.base_addr = (struct hsmmc *)OMAP_HSMMC1_BASE,
.cfg.host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_4BIT,
.cfg.f_min = 400000,
@@ -972,12 +972,12 @@ static const struct omap_hsmmc_plat am335x_mmc0_platdata = {
.cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT,
};
-U_BOOT_DEVICE(am335x_mmc0) = {
+U_BOOT_DRVINFO(am335x_mmc0) = {
.name = "omap_hsmmc",
- .platdata = &am335x_mmc0_platdata,
+ .plat = &am335x_mmc0_plat,
};
-static const struct omap_hsmmc_plat am335x_mmc1_platdata = {
+static const struct omap_hsmmc_plat am335x_mmc1_plat = {
.base_addr = (struct hsmmc *)OMAP_HSMMC2_BASE,
.cfg.host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_8BIT,
.cfg.f_min = 400000,
@@ -986,8 +986,8 @@ static const struct omap_hsmmc_plat am335x_mmc1_platdata = {
.cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT,
};
-U_BOOT_DEVICE(am335x_mmc1) = {
+U_BOOT_DRVINFO(am335x_mmc1) = {
.name = "omap_hsmmc",
- .platdata = &am335x_mmc1_platdata,
+ .plat = &am335x_mmc1_plat,
};
#endif
diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index d8711eb..44969e8 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -411,7 +411,7 @@ void spl_board_init(void)
#ifdef CONFIG_ESM_K3
if (board_ti_k3_is("J721EX-PM2-SOM")) {
ret = uclass_get_device_by_driver(UCLASS_MISC,
- DM_GET_DRIVER(k3_esm), &dev);
+ DM_DRIVER_GET(k3_esm), &dev);
if (ret)
printf("ESM init failed: %d\n", ret);
}
@@ -420,7 +420,7 @@ void spl_board_init(void)
#ifdef CONFIG_ESM_PMIC
if (board_ti_k3_is("J721EX-PM2-SOM")) {
ret = uclass_get_device_by_driver(UCLASS_MISC,
- DM_GET_DRIVER(pmic_esm),
+ DM_DRIVER_GET(pmic_esm),
&dev);
if (ret)
printf("ESM PMIC init failed: %d\n", ret);
diff --git a/board/timll/devkit8000/devkit8000.c b/board/timll/devkit8000/devkit8000.c
index 2420c28..0731fb7 100644
--- a/board/timll/devkit8000/devkit8000.c
+++ b/board/timll/devkit8000/devkit8000.c
@@ -47,14 +47,14 @@ static u32 gpmc_net_config[GPMC_MAX_REG] = {
0
};
-static const struct ns16550_platdata devkit8000_serial = {
+static const struct ns16550_plat devkit8000_serial = {
.base = OMAP34XX_UART3,
.reg_shift = 2,
.clock = V_NS16550_CLK,
.fcr = UART_FCR_DEFVAL,
};
-U_BOOT_DEVICE(devkit8000_uart) = {
+U_BOOT_DRVINFO(devkit8000_uart) = {
"ns16550_serial",
&devkit8000_serial
};
diff --git a/board/toradex/apalis-imx8x/MAINTAINERS b/board/toradex/apalis-imx8x/MAINTAINERS
index fbf9379..5272154 100644
--- a/board/toradex/apalis-imx8x/MAINTAINERS
+++ b/board/toradex/apalis-imx8x/MAINTAINERS
@@ -1,5 +1,5 @@
Apalis iMX8X
-M: Igor Opaniuk <igor.opaniuk@toradex.com>
+M: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
W: http://developer.toradex.com/software/linux/linux-software
S: Maintained
F: arch/arm/dts/fsl-imx8x-apalis.dts
diff --git a/board/toradex/apalis-tk1/apalis-tk1.c b/board/toradex/apalis-tk1/apalis-tk1.c
index e7a2186..b97617c 100644
--- a/board/toradex/apalis-tk1/apalis-tk1.c
+++ b/board/toradex/apalis-tk1/apalis-tk1.c
@@ -155,7 +155,7 @@ int tegra_pcie_board_init(void)
int ret;
ret = uclass_get_device_by_driver(UCLASS_PMIC,
- DM_GET_DRIVER(pmic_as3722), &dev);
+ DM_DRIVER_GET(pmic_as3722), &dev);
if (ret) {
pr_err("failed to find AS3722 PMIC: %d\n", ret);
return ret;
@@ -194,7 +194,7 @@ void tegra_pcie_board_port_reset(struct tegra_pcie_port *port)
int ret;
ret = uclass_get_device_by_driver(UCLASS_PMIC,
- DM_GET_DRIVER(pmic_as3722),
+ DM_DRIVER_GET(pmic_as3722),
&dev);
if (ret) {
debug("%s: Failed to find PMIC\n", __func__);
diff --git a/board/toradex/apalis_imx6/MAINTAINERS b/board/toradex/apalis_imx6/MAINTAINERS
index 4a2707e..fde4d92 100644
--- a/board/toradex/apalis_imx6/MAINTAINERS
+++ b/board/toradex/apalis_imx6/MAINTAINERS
@@ -1,5 +1,5 @@
Apalis iMX6
-M: Igor Opaniuk <igor.opaniuk@toradex.com>
+M: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
W: http://developer.toradex.com/software/linux/linux-software
W: https://www.toradex.com/community
S: Maintained
diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c
index 3961c4d..5ae5274 100644
--- a/board/toradex/apalis_imx6/apalis_imx6.c
+++ b/board/toradex/apalis_imx6/apalis_imx6.c
@@ -1144,12 +1144,12 @@ void reset_cpu(ulong addr)
#endif /* CONFIG_SPL_BUILD */
-static struct mxc_serial_platdata mxc_serial_plat = {
+static struct mxc_serial_plat mxc_serial_plat = {
.reg = (struct mxc_uart *)UART1_BASE,
.use_dte = true,
};
-U_BOOT_DEVICE(mxc_serial) = {
+U_BOOT_DRVINFO(mxc_serial) = {
.name = "serial_mxc",
- .platdata = &mxc_serial_plat,
+ .plat = &mxc_serial_plat,
};
diff --git a/board/toradex/colibri-imx6ull/MAINTAINERS b/board/toradex/colibri-imx6ull/MAINTAINERS
index 4107d29..899b1ff 100644
--- a/board/toradex/colibri-imx6ull/MAINTAINERS
+++ b/board/toradex/colibri-imx6ull/MAINTAINERS
@@ -1,5 +1,5 @@
Colibri iMX6ULL
-M: Igor Opaniuk <igor.opaniuk@toradex.com>
+M: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
W: http://developer.toradex.com/software/linux/linux-software
W: https://www.toradex.com/community
S: Maintained
diff --git a/board/toradex/colibri-imx6ull/colibri-imx6ull.c b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
index 45f8da3..6ff55ce 100644
--- a/board/toradex/colibri-imx6ull/colibri-imx6ull.c
+++ b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
@@ -203,12 +203,12 @@ int ft_board_setup(void *blob, struct bd_info *bd)
}
#endif
-static struct mxc_serial_platdata mxc_serial_plat = {
+static struct mxc_serial_plat mxc_serial_plat = {
.reg = (struct mxc_uart *)UART1_BASE,
.use_dte = 1,
};
-U_BOOT_DEVICE(mxc_serial) = {
+U_BOOT_DRVINFO(mxc_serial) = {
.name = "serial_mxc",
- .platdata = &mxc_serial_plat,
+ .plat = &mxc_serial_plat,
};
diff --git a/board/toradex/colibri_imx6/MAINTAINERS b/board/toradex/colibri_imx6/MAINTAINERS
index 76f9446..2cbf654 100644
--- a/board/toradex/colibri_imx6/MAINTAINERS
+++ b/board/toradex/colibri_imx6/MAINTAINERS
@@ -1,5 +1,5 @@
Colibri iMX6
-M: Igor Opaniuk <igor.opaniuk@toradex.com>
+M: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
W: http://developer.toradex.com/software/linux/linux-software
W: https://www.toradex.com/community
S: Maintained
diff --git a/board/toradex/colibri_imx6/colibri_imx6.c b/board/toradex/colibri_imx6/colibri_imx6.c
index a416b5e..57d3e52 100644
--- a/board/toradex/colibri_imx6/colibri_imx6.c
+++ b/board/toradex/colibri_imx6/colibri_imx6.c
@@ -1086,12 +1086,12 @@ void reset_cpu(ulong addr)
#endif /* CONFIG_SPL_BUILD */
-static struct mxc_serial_platdata mxc_serial_plat = {
+static struct mxc_serial_plat mxc_serial_plat = {
.reg = (struct mxc_uart *)UART1_BASE,
.use_dte = true,
};
-U_BOOT_DEVICE(mxc_serial) = {
+U_BOOT_DRVINFO(mxc_serial) = {
.name = "serial_mxc",
- .platdata = &mxc_serial_plat,
+ .plat = &mxc_serial_plat,
};
diff --git a/board/toradex/colibri_imx7/MAINTAINERS b/board/toradex/colibri_imx7/MAINTAINERS
index 61a5044..3d7d010 100644
--- a/board/toradex/colibri_imx7/MAINTAINERS
+++ b/board/toradex/colibri_imx7/MAINTAINERS
@@ -1,5 +1,5 @@
Colibri iMX7
-M: Igor Opaniuk <igor.opaniuk@toradex.com>
+M: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
W: http://developer.toradex.com/software/linux/linux-software
W: https://www.toradex.com/community
S: Maintained
diff --git a/board/toradex/colibri_pxa270/colibri_pxa270.c b/board/toradex/colibri_pxa270/colibri_pxa270.c
index 273a17f..645751a 100644
--- a/board/toradex/colibri_pxa270/colibri_pxa270.c
+++ b/board/toradex/colibri_pxa270/colibri_pxa270.c
@@ -129,24 +129,24 @@ int board_mmc_init(struct bd_info *bis)
return 0;
}
#else /* !CONFIG_IS_ENABLED(DM_MMC) */
-static const struct pxa_mmc_plat mmc_platdata = {
+static const struct pxa_mmc_plat mmc_plat = {
.base = (struct pxa_mmc_regs *)MMC0_BASE,
};
-U_BOOT_DEVICE(pxa_mmcs) = {
+U_BOOT_DRVINFO(pxa_mmcs) = {
.name = "pxa_mmc",
- .platdata = &mmc_platdata,
+ .plat = &mmc_plat,
};
#endif /* !CONFIG_IS_ENABLED(DM_MMC) */
#endif
-static const struct pxa_serial_platdata serial_platdata = {
+static const struct pxa_serial_plat serial_plat = {
.base = (struct pxa_uart_regs *)FFUART_BASE,
.port = FFUART_INDEX,
.baudrate = CONFIG_BAUDRATE,
};
-U_BOOT_DEVICE(pxa_serials) = {
+U_BOOT_DRVINFO(pxa_serials) = {
.name = "serial_pxa",
- .platdata = &serial_platdata,
+ .plat = &serial_plat,
};
diff --git a/board/toradex/colibri_t20/MAINTAINERS b/board/toradex/colibri_t20/MAINTAINERS
index 2a8e6fb..61fbd2c 100644
--- a/board/toradex/colibri_t20/MAINTAINERS
+++ b/board/toradex/colibri_t20/MAINTAINERS
@@ -1,5 +1,5 @@
COLIBRI_T20
-M: Igor Opaniuk <igor.opaniuk@toradex.com>
+M: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
S: Maintained
F: board/toradex/colibri_t20/
F: include/configs/colibri_t20.h
diff --git a/board/toradex/colibri_t30/MAINTAINERS b/board/toradex/colibri_t30/MAINTAINERS
index 00c03c8..ded9e28 100644
--- a/board/toradex/colibri_t30/MAINTAINERS
+++ b/board/toradex/colibri_t30/MAINTAINERS
@@ -1,5 +1,5 @@
Colibri T30
-M: Igor Opaniuk <igor.opaniuk@toradex.com>
+M: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
S: Maintained
F: board/toradex/colibri_t30/
F: include/configs/colibri_t30.h
diff --git a/board/toradex/colibri_vf/MAINTAINERS b/board/toradex/colibri_vf/MAINTAINERS
index f94cc0f..c662765 100644
--- a/board/toradex/colibri_vf/MAINTAINERS
+++ b/board/toradex/colibri_vf/MAINTAINERS
@@ -1,5 +1,5 @@
Colibri VFxx
-M: Igor Opaniuk <igor.opaniuk@toradex.com>
+M: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
W: http://developer.toradex.com/software/linux/linux-software
W: https://www.toradex.com/community
S: Maintained
diff --git a/board/toradex/verdin-imx8mm/MAINTAINERS b/board/toradex/verdin-imx8mm/MAINTAINERS
index 2495696..08c3701 100644
--- a/board/toradex/verdin-imx8mm/MAINTAINERS
+++ b/board/toradex/verdin-imx8mm/MAINTAINERS
@@ -1,5 +1,5 @@
Verdin iMX8M Mini
-M: Igor Opaniuk <igor.opaniuk@toradex.com>
+M: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
W: https://www.toradex.com/computer-on-modules/verdin-arm-family/nxp-imx-8m-mini
S: Maintained
F: arch/arm/dts/imx8mm-verdin.dts
diff --git a/board/variscite/dart_6ul/dart_6ul.c b/board/variscite/dart_6ul/dart_6ul.c
index d8e383d..360be75 100644
--- a/board/variscite/dart_6ul/dart_6ul.c
+++ b/board/variscite/dart_6ul/dart_6ul.c
@@ -12,8 +12,11 @@
#include <asm/arch/sys_proto.h>
#include <asm/mach-imx/iomux-v3.h>
#include <asm/mach-imx/mxc_i2c.h>
+#include <dm.h>
#include <fsl_esdhc_imx.h>
+#include <i2c_eeprom.h>
#include <linux/bitops.h>
+#include <malloc.h>
#include <miiphy.h>
#include <netdev.h>
#include <usb.h>
@@ -222,9 +225,108 @@ int board_init(void)
return 0;
}
+/* length of strings stored in the eeprom */
+#define DART6UL_PN_LEN 16
+#define DART6UL_ASSY_LEN 16
+#define DART6UL_DATE_LEN 12
+
+/* eeprom content, 512 bytes */
+struct dart6ul_info {
+ u32 magic;
+ u8 partnumber[DART6UL_PN_LEN];
+ u8 assy[DART6UL_ASSY_LEN];
+ u8 date[DART6UL_DATE_LEN];
+ u32 custom_addr_val[32];
+ struct cmd {
+ u8 addr;
+ u8 index;
+ } custom_cmd[150];
+ u8 res[33];
+ u8 som_info;
+ u8 ddr_size;
+ u8 crc;
+} __attribute__ ((__packed__));
+
+#define DART6UL_INFO_STORAGE_GET(n) ((n) & 0x3)
+#define DART6UL_INFO_WIFI_GET(n) ((n) >> 2 & 0x1)
+#define DART6UL_INFO_REV_GET(n) ((n) >> 3 & 0x3)
+#define DART6UL_DDRSIZE_IN_MIB(n) ((n) << 8)
+#define DART6UL_INFO_MAGIC 0x32524156
+
+static const char *som_info_storage_to_str(u8 som_info)
+{
+ switch (DART6UL_INFO_STORAGE_GET(som_info)) {
+ case 0x0: return "none (SD only)";
+ case 0x1: return "NAND";
+ case 0x2: return "eMMC";
+ default: return "unknown";
+ }
+}
+
+static const char *som_info_rev_to_str(u8 som_info)
+{
+ switch (DART6UL_INFO_REV_GET(som_info)) {
+ case 0x0: return "2.4G";
+ case 0x1: return "5G";
+ default: return "unknown";
+ }
+}
+
int checkboard(void)
{
- puts("Board: Variscite DART-6UL Evaluation Kit\n");
+ const char *path = "eeprom0";
+ struct dart6ul_info *info;
+ struct udevice *dev;
+ int ret, off;
+
+ off = fdt_path_offset(gd->fdt_blob, path);
+ if (off < 0) {
+ printf("%s: fdt_path_offset() failed: %d\n", __func__, off);
+ return off;
+ }
+
+ ret = uclass_get_device_by_of_offset(UCLASS_I2C_EEPROM, off, &dev);
+ if (ret) {
+ printf("%s: uclass_get_device_by_of_offset() failed: %d\n", __func__, ret);
+ return ret;
+ }
+
+ info = malloc(sizeof(struct dart6ul_info));
+ if (!info)
+ return -ENOMEM;
+
+ ret = i2c_eeprom_read(dev, 0, (uint8_t *)info,
+ sizeof(struct dart6ul_info));
+ if (ret) {
+ printf("%s: i2c_eeprom_read() failed: %d\n", __func__, ret);
+ free(info);
+ return ret;
+ }
+
+ if (info->magic != DART6UL_INFO_MAGIC) {
+ printf("Board: Invalid board info magic: 0x%08x, expected 0x%08x\n",
+ info->magic, DART6UL_INFO_MAGIC);
+ /* do not fail if the content is invalid */
+ free(info);
+ return 0;
+ }
+
+ /* make sure strings are null terminated */
+ info->partnumber[DART6UL_PN_LEN - 1] = '\0';
+ info->assy[DART6UL_ASSY_LEN - 1] = '\0';
+ info->date[DART6UL_DATE_LEN - 1] = '\0';
+
+ printf("Board: PN: %s, Assy: %s, Date: %s\n"
+ " Storage: %s, Wifi: %s, DDR: %d MiB, Rev: %s\n",
+ info->partnumber,
+ info->assy,
+ info->date,
+ som_info_storage_to_str(info->som_info),
+ DART6UL_INFO_WIFI_GET(info->som_info) ? "yes" : "no",
+ DART6UL_DDRSIZE_IN_MIB(info->ddr_size),
+ som_info_rev_to_str(info->som_info));
+
+ free(info);
return 0;
}
diff --git a/board/xilinx/common/fru_ops.c b/board/xilinx/common/fru_ops.c
index b4cd3d4..44f0913 100644
--- a/board/xilinx/common/fru_ops.c
+++ b/board/xilinx/common/fru_ops.c
@@ -170,7 +170,7 @@ static int fru_parse_board(unsigned long addr)
data = (u8 *)&fru_data.brd.manufacturer_type_len;
/* Record max structure limit not to write data over allocated space */
- limit = data + sizeof(struct fru_board_data);
+ limit = (u8 *)&fru_data.brd + sizeof(struct fru_board_data);
for (i = 0; ; i++, data += FRU_BOARD_MAX_LEN) {
len = fru_check_type_len(*(u8 *)addr, fru_data.brd.lang_code,
diff --git a/board/xilinx/microblaze-generic/MAINTAINERS b/board/xilinx/microblaze-generic/MAINTAINERS
index 6796d4d..9a42a8b 100644
--- a/board/xilinx/microblaze-generic/MAINTAINERS
+++ b/board/xilinx/microblaze-generic/MAINTAINERS
@@ -1,6 +1,7 @@
MICROBLAZE-GENERIC BOARD
M: Michal Simek <monstr@monstr.eu>
S: Maintained
+T: git https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze.git
F: board/xilinx/microblaze-generic/
F: include/configs/microblaze-generic.h
F: configs/microblaze-generic_defconfig
diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c
index e590999..d4095c0 100644
--- a/board/xilinx/microblaze-generic/microblaze-generic.c
+++ b/board/xilinx/microblaze-generic/microblaze-generic.c
@@ -67,7 +67,10 @@ int board_late_init(void)
status |= env_set_hex("ramdisk_addr_r",
gd->ram_base + SZ_32M + SZ_4M + SZ_2M);
-
+ if (IS_ENABLED(CONFIG_MTD_NOR_FLASH))
+ status |= env_set_hex("script_offset_nor",
+ gd->bd->bi_flashstart +
+ CONFIG_BOOT_SCRIPT_OFFSET);
if (status)
printf("%s: Saving run time variables FAILED\n", __func__);
diff --git a/board/xilinx/versal/MAINTAINERS b/board/xilinx/versal/MAINTAINERS
index 2d2b808..0d40196 100644
--- a/board/xilinx/versal/MAINTAINERS
+++ b/board/xilinx/versal/MAINTAINERS
@@ -1,6 +1,7 @@
XILINX_VERSAL BOARDS
M: Michal Simek <michal.simek@xilinx.com>
S: Maintained
+T: git https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze.git
F: arch/arm/dts/versal*
F: board/xilinx/versal/
F: include/configs/xilinx_versal*
diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c
index 912c114..2782a34 100644
--- a/board/xilinx/versal/board.c
+++ b/board/xilinx/versal/board.c
@@ -153,9 +153,9 @@ int board_late_init(void)
puts("Boot from EMMC but without SD1 enabled!\n");
return -1;
}
- debug("mmc1 device found at %p, seq %d\n", dev, dev->seq);
+ debug("mmc1 device found at %p, seq %d\n", dev, dev_seq(dev));
mode = "mmc";
- bootseq = dev->seq;
+ bootseq = dev_seq(dev);
break;
case SD_MODE:
puts("SD_MODE\n");
@@ -164,10 +164,10 @@ int board_late_init(void)
puts("Boot from SD0 but without SD0 enabled!\n");
return -1;
}
- debug("mmc0 device found at %p, seq %d\n", dev, dev->seq);
+ debug("mmc0 device found at %p, seq %d\n", dev, dev_seq(dev));
mode = "mmc";
- bootseq = dev->seq;
+ bootseq = dev_seq(dev);
break;
case SD1_LSHFT_MODE:
puts("LVL_SHFT_");
@@ -179,10 +179,10 @@ int board_late_init(void)
puts("Boot from SD1 but without SD1 enabled!\n");
return -1;
}
- debug("mmc1 device found at %p, seq %d\n", dev, dev->seq);
+ debug("mmc1 device found at %p, seq %d\n", dev, dev_seq(dev));
mode = "mmc";
- bootseq = dev->seq;
+ bootseq = dev_seq(dev);
break;
default:
mode = "";
diff --git a/board/xilinx/zynq/MAINTAINERS b/board/xilinx/zynq/MAINTAINERS
index 78bcd84..ce760ab 100644
--- a/board/xilinx/zynq/MAINTAINERS
+++ b/board/xilinx/zynq/MAINTAINERS
@@ -1,6 +1,7 @@
ZYNQ BOARD
M: Michal Simek <monstr@monstr.eu>
S: Maintained
+T: git https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze.git
F: arch/arm/dts/zynq-*
F: board/xilinx/zynq/
F: include/configs/zynq*.h
diff --git a/board/xilinx/zynqmp/MAINTAINERS b/board/xilinx/zynqmp/MAINTAINERS
index 9cd4f3f..a631b38 100644
--- a/board/xilinx/zynqmp/MAINTAINERS
+++ b/board/xilinx/zynqmp/MAINTAINERS
@@ -1,6 +1,7 @@
XILINX_ZYNQMP BOARDS
M: Michal Simek <michal.simek@xilinx.com>
S: Maintained
+T: git https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze.git
F: arch/arm/dts/zynqmp-*
F: arch/arm/dts/avnet-ultra96*
F: board/xilinx/common/
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index 731285a..047b070 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -596,10 +596,10 @@ int board_late_init(void)
puts("Boot from EMMC but without SD0 enabled!\n");
return -1;
}
- debug("mmc0 device found at %p, seq %d\n", dev, dev->seq);
+ debug("mmc0 device found at %p, seq %d\n", dev, dev_seq(dev));
mode = "mmc";
- bootseq = dev->seq;
+ bootseq = dev_seq(dev);
break;
case SD_MODE:
puts("SD_MODE\n");
@@ -610,10 +610,10 @@ int board_late_init(void)
puts("Boot from SD0 but without SD0 enabled!\n");
return -1;
}
- debug("mmc0 device found at %p, seq %d\n", dev, dev->seq);
+ debug("mmc0 device found at %p, seq %d\n", dev, dev_seq(dev));
mode = "mmc";
- bootseq = dev->seq;
+ bootseq = dev_seq(dev);
env_set("modeboot", "sdboot");
break;
case SD1_LSHFT_MODE:
@@ -628,10 +628,10 @@ int board_late_init(void)
puts("Boot from SD1 but without SD1 enabled!\n");
return -1;
}
- debug("mmc1 device found at %p, seq %d\n", dev, dev->seq);
+ debug("mmc1 device found at %p, seq %d\n", dev, dev_seq(dev));
mode = "mmc";
- bootseq = dev->seq;
+ bootseq = dev_seq(dev);
env_set("modeboot", "sdboot");
break;
case NAND_MODE: