U-Boot
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
July 2022
- 182 participants
- 613 discussions
Fix multiple issues in ubifs distroboot code:
U-Boot supports attaching only one MTD device as UBI at the time. So
always call 'ubifsmount ubi0:${bootubivol}' for mounting UBI volume
${bootubivol}. Usage of 'ubi${devnum}' is incorrect as 'ubi part'
command attach MTD device always as UBI device ubi0.
Set distroboot ${bootfstype} variable to ubifs in ubifs_boot command.
Distroboot scripts require ${bootfstype} variable to be properly set and it
is already set for all other boot types.
Set distroboot ${distro_bootpart} variable to ${bootubivol} value. UBI
device does not have partitions, but has volumes. Distroboot scripts
require something to be set in ${distro_bootpart} variable, so set it to
the UBI volume which is currently mounted by ubifs.
Set distroboot ${devnum} variable to fixed string "ubi0". ubifs code
differs from the other partition code that it requires "ubi" prefix before
number.
Explicitly unmount ubifs volume after loading all data from it. This allows
to detach UBI device from MTD device.
Move definition of MTD device with UBI and UBI volume with ubifs filesystem
from global env variables ${bootubipart} and ${bootubivol} into the
distroboot "func" macro, defined in board include config files. UBIFS
distroboot macros then set ${bootubipart} and ${bootubivol} local variables
for compatibility with existing distroboot scripts.
This last change allows to define more UBIFS target devices and make it
clear what is boot MTD/UBI device.
All board include config files are adjusted to use this new scheme of
specifying boot MTD/UBI device.
Signed-off-by: Pali Rohár <pali(a)kernel.org>
---
CI test passed on https://github.com/u-boot/u-boot/pull/179
---
include/config_distro_bootcmd.h | 27 ++++++++++++++++-----------
include/configs/am335x_guardian.h | 3 +--
include/configs/colibri-imx6ull.h | 1 -
include/configs/colibri_imx7.h | 1 -
include/configs/kontron-sl-mx6ul.h | 2 +-
include/configs/mys_6ulx.h | 2 +-
include/configs/npi_imx6ull.h | 2 +-
include/configs/omap3_beagle.h | 4 +---
include/configs/omap3_evm.h | 4 +---
include/configs/pcl063.h | 2 +-
include/configs/stm32mp15_common.h | 2 +-
include/configs/uniphier.h | 2 +-
12 files changed, 25 insertions(+), 27 deletions(-)
diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index c55023889cab..c6e9c497413d 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -70,18 +70,23 @@
#ifdef CONFIG_CMD_UBIFS
#define BOOTENV_SHARED_UBIFS \
"ubifs_boot=" \
- "env exists bootubipart || " \
- "env set bootubipart UBI; " \
- "env exists bootubivol || " \
- "env set bootubivol boot; " \
"if ubi part ${bootubipart} && " \
- "ubifsmount ubi${devnum}:${bootubivol}; " \
+ "ubifsmount ubi0:${bootubivol}; " \
"then " \
"devtype=ubi; " \
+ "devnum=ubi0; " \
+ "bootfstype=ubifs; " \
+ "distro_bootpart=${bootubivol}; " \
"run scan_dev_for_boot; " \
+ "ubifsumount; " \
"fi\0"
-#define BOOTENV_DEV_UBIFS BOOTENV_DEV_BLKDEV
-#define BOOTENV_DEV_NAME_UBIFS BOOTENV_DEV_NAME_BLKDEV
+#define BOOTENV_DEV_UBIFS(devtypeu, devtypel, instance, bootubipart, bootubivol) \
+ "bootcmd_ubifs" #instance "=" \
+ "bootubipart=" #bootubipart "; " \
+ "bootubivol=" #bootubivol "; " \
+ "run ubifs_boot\0"
+#define BOOTENV_DEV_NAME_UBIFS(devtypeu, devtypel, instance, bootubipart, bootubivol) \
+ #devtypel #instance " "
#else
#define BOOTENV_SHARED_UBIFS
#define BOOTENV_DEV_UBIFS \
@@ -411,13 +416,13 @@
BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE
#endif
-#define BOOTENV_DEV_NAME(devtypeu, devtypel, instance) \
- BOOTENV_DEV_NAME_##devtypeu(devtypeu, devtypel, instance)
+#define BOOTENV_DEV_NAME(devtypeu, devtypel, instance, ...) \
+ BOOTENV_DEV_NAME_##devtypeu(devtypeu, devtypel, instance, ## __VA_ARGS__)
#define BOOTENV_BOOT_TARGETS \
"boot_targets=" BOOT_TARGET_DEVICES(BOOTENV_DEV_NAME) "\0"
-#define BOOTENV_DEV(devtypeu, devtypel, instance) \
- BOOTENV_DEV_##devtypeu(devtypeu, devtypel, instance)
+#define BOOTENV_DEV(devtypeu, devtypel, instance, ...) \
+ BOOTENV_DEV_##devtypeu(devtypeu, devtypel, instance, ## __VA_ARGS__)
#define BOOTENV \
BOOTENV_SHARED_HOST \
BOOTENV_SHARED_MMC \
diff --git a/include/configs/am335x_guardian.h b/include/configs/am335x_guardian.h
index b92703205cde..340715dad5c6 100644
--- a/include/configs/am335x_guardian.h
+++ b/include/configs/am335x_guardian.h
@@ -29,7 +29,7 @@
"ramdisk_addr_r=0x88080000\0" \
#define BOOT_TARGET_DEVICES(func) \
- func(UBIFS, ubifs, 0)
+ func(UBIFS, ubifs, 0, UBI, rootfs)
#define AM335XX_BOARD_FDTFILE "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0"
@@ -54,7 +54,6 @@
GUARDIAN_DEFAULT_PROD_ENV \
"autoload=no\0" \
"backlight_brightness=50\0" \
- "bootubivol=rootfs\0" \
"distro_bootcmd=" \
"setenv rootflags \"bulk_read,chk_data_crc\"; " \
"setenv ethact usb_ether; " \
diff --git a/include/configs/colibri-imx6ull.h b/include/configs/colibri-imx6ull.h
index 9e5212acb2ee..a0a0e1767fe0 100644
--- a/include/configs/colibri-imx6ull.h
+++ b/include/configs/colibri-imx6ull.h
@@ -91,7 +91,6 @@
UBI_BOOTCMD \
UBOOT_UPDATE \
"boot_script_dhcp=boot.scr\0" \
- "bootubipart=ubi\0" \
"console=ttymxc0\0" \
"defargs=user_debug=30\0" \
"fdt_board=eval-v3\0" \
diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h
index 3dba7bcef258..3cad17777975 100644
--- a/include/configs/colibri_imx7.h
+++ b/include/configs/colibri_imx7.h
@@ -131,7 +131,6 @@
UBOOT_UPDATE \
"boot_file=zImage\0" \
"boot_script_dhcp=boot.scr\0" \
- "bootubipart=ubi\0" \
"console=ttymxc0\0" \
"defargs=\0" \
"fdt_board=eval-v3\0" \
diff --git a/include/configs/kontron-sl-mx6ul.h b/include/configs/kontron-sl-mx6ul.h
index 7bc402d578e8..b4808d2bbf75 100644
--- a/include/configs/kontron-sl-mx6ul.h
+++ b/include/configs/kontron-sl-mx6ul.h
@@ -45,7 +45,7 @@
#define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 1) \
func(MMC, mmc, 0) \
- func(UBIFS, ubifs, 0) \
+ func(UBIFS, ubifs, 0, UBI, boot) \
func(USB, usb, 0) \
func(PXE, pxe, na) \
func(DHCP, dhcp, na)
diff --git a/include/configs/mys_6ulx.h b/include/configs/mys_6ulx.h
index 6801fc109eae..663820177a3e 100644
--- a/include/configs/mys_6ulx.h
+++ b/include/configs/mys_6ulx.h
@@ -59,7 +59,7 @@
#define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 0) \
- func(UBIFS, ubifs, 0) \
+ func(UBIFS, ubifs, 0, UBI, boot) \
func(PXE, pxe, na) \
func(DHCP, dhcp, na)
diff --git a/include/configs/npi_imx6ull.h b/include/configs/npi_imx6ull.h
index c250fa650603..ebb887544e08 100644
--- a/include/configs/npi_imx6ull.h
+++ b/include/configs/npi_imx6ull.h
@@ -67,7 +67,7 @@
#define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 0) \
- func(UBIFS, ubifs, 0) \
+ func(UBIFS, ubifs, 0, UBI, boot) \
func(PXE, pxe, na) \
func(DHCP, dhcp, na)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 158773acedb9..f5da08cf3359 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -65,7 +65,7 @@
#define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 0) \
func(LEGACY_MMC, legacy_mmc, 0) \
- func(UBIFS, ubifs, 0) \
+ func(UBIFS, ubifs, 0, rootfs, rootfs) \
func(NAND, nand, 0)
#else /* !CONFIG_MTD_RAW_NAND */
@@ -87,8 +87,6 @@
"bootenv=uEnv.txt\0" \
"bootfile=zImage\0" \
"bootpart=0:2\0" \
- "bootubivol=rootfs\0" \
- "bootubipart=rootfs\0" \
"usbtty=cdc_acm\0" \
"mpurate=auto\0" \
"buddy=none\0" \
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index eeb9ef8c741a..cc98e03096ab 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -60,7 +60,7 @@
#define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 0) \
func(LEGACY_MMC, legacy_mmc, 0) \
- func(UBIFS, ubifs, 0) \
+ func(UBIFS, ubifs, 0, rootfs, rootfs) \
func(NAND, nand, 0)
#else /* !CONFIG_MTD_RAW_NAND */
@@ -88,8 +88,6 @@
"bootenv=uEnv.txt\0" \
"bootfile=zImage\0" \
"bootpart=0:2\0" \
- "bootubivol=rootfs\0" \
- "bootubipart=rootfs\0" \
"optargs=\0" \
"nandroot=ubi0:rootfs ubi.mtd=rootfs rw noinitrd\0" \
"nandrootfstype=ubifs rootwait\0" \
diff --git a/include/configs/pcl063.h b/include/configs/pcl063.h
index 31b7d07a24cd..c3f7e7eb2c4b 100644
--- a/include/configs/pcl063.h
+++ b/include/configs/pcl063.h
@@ -71,7 +71,7 @@
#define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 0) \
- func(UBIFS, ubifs, 0) \
+ func(UBIFS, ubifs, 0, UBI, boot) \
func(PXE, pxe, na) \
func(DHCP, dhcp, na)
diff --git a/include/configs/stm32mp15_common.h b/include/configs/stm32mp15_common.h
index 6b40cdb01779..68ea56e69c98 100644
--- a/include/configs/stm32mp15_common.h
+++ b/include/configs/stm32mp15_common.h
@@ -77,7 +77,7 @@
#endif
#ifdef CONFIG_CMD_UBIFS
-#define BOOT_TARGET_UBIFS(func) func(UBIFS, ubifs, 0)
+#define BOOT_TARGET_UBIFS(func) func(UBIFS, ubifs, 0, UBI, boot)
#else
#define BOOT_TARGET_UBIFS(func)
#endif
diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
index f813f88cdd7a..640a29067d85 100644
--- a/include/configs/uniphier.h
+++ b/include/configs/uniphier.h
@@ -20,7 +20,7 @@
#endif
#ifdef CONFIG_CMD_UBIFS
-#define BOOT_TARGET_DEVICE_UBIFS(func) func(UBIFS, ubifs, 0)
+#define BOOT_TARGET_DEVICE_UBIFS(func) func(UBIFS, ubifs, 0, UBI, boot)
#else
#define BOOT_TARGET_DEVICE_UBIFS(func)
#endif
--
2.20.1
4
10
Original ubifs code was designed that after ubifs_umount() call it is
required to also call ubi_close_volume() which closes underlying UBI
volume. But U-Boot ubifs modification have not implemented it properly
which caused that ubifsumount command contains resource leak. It can be
observed by calling simple sequence of commands:
=> ubi part mtd2
ubi0: attaching mtd2
...
=> ubifsmount ubi0
=> ubifsumount
Unmounting UBIFS volume rootfs!
=> ubi detach
ubi0 error: ubi_detach_mtd_dev: ubi0 reference count 1, destroy anyway
ubi0: detaching mtd2
ubi0: mtd2 is detached
Fix this issue by calling ubi_close_volume() and mutex_unlock() in
directly in ubifs_umount() function before freeing U-Boot's global
ubifs_sb. And remove duplicate calls of these two functions in remaining
places. With this change ubifsumount command does not throw that error
anymore.
=> ubi part rootfs
ubi0: attaching mtd2
...
=> ubifsmount ubi0
=> ubifsumount
Unmounting UBIFS volume rootfs!
=> ubi detach
ubi0: detaching mtd2
ubi0: mtd2 is detached
Signed-off-by: Pali Rohár <pali(a)kernel.org>
---
fs/ubifs/super.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index e3a4c0bca270..7677dcc2a140 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1757,6 +1757,8 @@ void ubifs_umount(struct ubifs_info *c)
kfree(c->bottom_up_buf);
ubifs_debugging_exit(c);
#ifdef __UBOOT__
+ ubi_close_volume(c->ubi);
+ mutex_unlock(&c->umount_mutex);
/* Finally free U-Boot's global copy of superblock */
if (ubifs_sb != NULL) {
free(ubifs_sb->s_fs_info);
@@ -2058,9 +2060,9 @@ static void ubifs_put_super(struct super_block *sb)
ubifs_umount(c);
#ifndef __UBOOT__
bdi_destroy(&c->bdi);
-#endif
ubi_close_volume(c->ubi);
mutex_unlock(&c->umount_mutex);
+#endif
}
#endif
@@ -2328,13 +2330,13 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
out_umount:
ubifs_umount(c);
out_unlock:
- mutex_unlock(&c->umount_mutex);
#ifndef __UBOOT__
+ mutex_unlock(&c->umount_mutex);
out_bdi:
bdi_destroy(&c->bdi);
out_close:
-#endif
ubi_close_volume(c->ubi);
+#endif
out:
return err;
}
--
2.20.1
2
2
Hi
This updated version of the patch fixes a problem noticed
by Stefan Roese where the CI build fails for the
dra7xx_hs_evm_usb_defconfig target if this patch is included
Let me know if any other changes are needed.
Thanks and regards
Rogier
2
2
We need to calculate the ecc parameters in a way that are the same
in uboot and spl. The parameters are connected to the onfi
computation. We need to assign all the value of chip in order
to have same ecc strength parameters before calling
mxs_nand_set_geometry that calculate the ecc layout
/* use the legacy bch setting by default */
if ((!nand_info->use_minimum_ecc && mtd->oobsize < 1024) ||
!(chip->ecc_strength_ds > 0 && chip->ecc_step_ds > 0)) {
dev_dbg(mtd->dev, "use legacy bch geometry\n");
err = mxs_nand_legacy_calc_ecc_layout(geo, mtd);
if (!err)
return 0;
}
Signed-off-by: Michael Trimarchi <michael(a)amarulasolutions.com>
---
drivers/mtd/nand/raw/mxs_nand_spl.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/mtd/nand/raw/mxs_nand_spl.c b/drivers/mtd/nand/raw/mxs_nand_spl.c
index 3daacbb330..683071c1cb 100644
--- a/drivers/mtd/nand/raw/mxs_nand_spl.c
+++ b/drivers/mtd/nand/raw/mxs_nand_spl.c
@@ -139,6 +139,10 @@ static int mxs_flash_onfi_ident(struct mtd_info *mtd)
mtd->writesize = le32_to_cpu(p->byte_per_page);
mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
+ if (p->ecc_bits != 0xff) {
+ chip->ecc_strength_ds = p->ecc_bits;
+ chip->ecc_step_ds = 512;
+ }
chip->chipsize = le32_to_cpu(p->blocks_per_lun);
chip->chipsize *= (uint64_t)mtd->erasesize * p->lun_count;
/* Calculate the address shift from the page size */
@@ -152,6 +156,8 @@ static int mxs_flash_onfi_ident(struct mtd_info *mtd)
debug("writesize=%d (>>%d)\n", mtd->writesize, chip->page_shift);
debug("oobsize=%d\n", mtd->oobsize);
debug("chipsize=%lld\n", chip->chipsize);
+ debug("ecc_strength_ds=%d\n", chip->ecc_strength_ds);
+ debug("ecc_step_ds = %d\n", chip->ecc_step_ds);
return 0;
}
--
2.34.1
1
1

08 Jul '22
Introduce BSH SystemMaster (SMM) M2 board family, which consists of:
imx6ulz SMM M2 and imx6ulz SMM M2 PRO boards.
Add support for imx6ulz BSH SMM M2 board:
- 128 MiB DDR3 RAM
- 256MiB Nand
- USBOTG1 peripheral - fastboot.
Signed-off-by: Michael Trimarchi <michael(a)amarulasolutions.com>
---
arch/arm/dts/Makefile | 1 +
arch/arm/dts/imx6ulz-bsh-smm-m2-u-boot.dtsi | 35 +++++
arch/arm/dts/imx6ulz-bsh-smm-m2.dts | 146 ++++++++++++++++++++
arch/arm/mach-imx/mx6/Kconfig | 12 ++
board/bsh/imx6ulz_smm_m2/Kconfig | 12 ++
board/bsh/imx6ulz_smm_m2/MAINTAINERS | 6 +
board/bsh/imx6ulz_smm_m2/Makefile | 6 +
board/bsh/imx6ulz_smm_m2/imx6ulz_smm_m2.c | 53 +++++++
board/bsh/imx6ulz_smm_m2/spl.c | 130 +++++++++++++++++
configs/imx6ulz_smm_m2_defconfig | 75 ++++++++++
include/configs/imx6ulz_smm_m2.h | 89 ++++++++++++
11 files changed, 565 insertions(+)
create mode 100644 arch/arm/dts/imx6ulz-bsh-smm-m2-u-boot.dtsi
create mode 100644 arch/arm/dts/imx6ulz-bsh-smm-m2.dts
create mode 100644 board/bsh/imx6ulz_smm_m2/Kconfig
create mode 100644 board/bsh/imx6ulz_smm_m2/MAINTAINERS
create mode 100644 board/bsh/imx6ulz_smm_m2/Makefile
create mode 100644 board/bsh/imx6ulz_smm_m2/imx6ulz_smm_m2.c
create mode 100644 board/bsh/imx6ulz_smm_m2/spl.c
create mode 100644 configs/imx6ulz_smm_m2_defconfig
create mode 100644 include/configs/imx6ulz_smm_m2.h
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index a7e0d9f6c0..37525d61e7 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -888,6 +888,7 @@ dtb-$(CONFIG_MX6ULL) += \
imx6ull-phytec-segin-ff-rdk-emmc.dtb \
imx6ull-dart-6ul.dtb \
imx6ull-somlabs-visionsom.dtb \
+ imx6ulz-bsh-smm-m2.dtb \
imx6ulz-14x14-evk.dtb
dtb-$(CONFIG_ARCH_MX6) += \
diff --git a/arch/arm/dts/imx6ulz-bsh-smm-m2-u-boot.dtsi b/arch/arm/dts/imx6ulz-bsh-smm-m2-u-boot.dtsi
new file mode 100644
index 0000000000..75dbf6ed78
--- /dev/null
+++ b/arch/arm/dts/imx6ulz-bsh-smm-m2-u-boot.dtsi
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2022 BSH Hausgeraete GmbH
+ *
+ * Author: Michael Trimarchi <michael(a)amarulasolutions.com>
+ */
+
+&{/soc} {
+ u-boot,dm-pre-reloc;
+};
+
+&aips2 {
+ u-boot,dm-pre-reloc;
+};
+
+&iomuxc {
+ u-boot,dm-pre-reloc;
+};
+
+&iomuxc_snvs {
+ u-boot,dm-pre-reloc;
+};
+
+&uart4 {
+ u-boot,dm-pre-reloc;
+};
+
+&pinctrl_uart4 {
+ u-boot,dm-pre-reloc;
+};
+
+&gpmi {
+ u-boot,dm-spl;
+ u-boot,dm-pre-reloc;
+};
diff --git a/arch/arm/dts/imx6ulz-bsh-smm-m2.dts b/arch/arm/dts/imx6ulz-bsh-smm-m2.dts
new file mode 100644
index 0000000000..59bcfc9a6b
--- /dev/null
+++ b/arch/arm/dts/imx6ulz-bsh-smm-m2.dts
@@ -0,0 +1,146 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2021 BSH Hausgeraete GmbH
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/input/input.h>
+#include "imx6ulz.dtsi"
+
+/ {
+ model = "BSH SMM M2";
+ compatible = "bsh,imx6ulz-bsh-smm-m2", "fsl,imx6ull", "fsl,imx6ulz";
+
+ chosen {
+ stdout-path = &uart4;
+ };
+
+ usdhc2_pwrseq: usdhc2-pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ reset-gpios = <&gpio2 21 GPIO_ACTIVE_LOW>;
+ };
+};
+
+&gpmi {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_gpmi_nand>;
+ nand-on-flash-bbt;
+ status = "okay";
+};
+
+&uart3 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_uart3>;
+ uart-has-rtscts;
+ status = "okay";
+
+ bluetooth {
+ compatible = "brcm,bcm4330-bt";
+ max-speed = <3000000>;
+ shutdown-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
+ device-wakeup-gpios = <&gpio2 17 GPIO_ACTIVE_HIGH>;
+ host-wakeup-gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>;
+ };
+};
+
+&uart4 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_uart4>;
+ status = "okay";
+};
+
+&usbotg1 {
+ dr_mode = "peripheral";
+ srp-disable;
+ hnp-disable;
+ adp-disable;
+ status = "okay";
+};
+
+&usbphy1 {
+ fsl,tx-d-cal = <106>;
+};
+
+&usdhc2 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_wlan>;
+ bus-width = <4>;
+ no-1-8-v;
+ non-removable;
+ cap-power-off-card;
+ keep-power-in-suspend;
+ cap-sdio-irq;
+ mmc-pwrseq = <&usdhc2_pwrseq>;
+ status = "okay";
+
+ brcmf: wifi@1 {
+ reg = <1>;
+ compatible = "brcm,bcm4329-fmac";
+ interrupt-parent = <&gpio1>;
+ interrupts = <18 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "host-wake";
+ };
+};
+
+&wdog1 {
+ status = "okay";
+};
+
+&iomuxc {
+ pinctrl_gpmi_nand: gpmi-nand {
+ fsl,pins = <
+ MX6UL_PAD_NAND_CLE__RAWNAND_CLE 0xb0b1
+ MX6UL_PAD_NAND_ALE__RAWNAND_ALE 0xb0b1
+ MX6UL_PAD_NAND_WP_B__RAWNAND_WP_B 0xb0b1
+ MX6UL_PAD_NAND_READY_B__RAWNAND_READY_B 0xb000
+ MX6UL_PAD_NAND_CE0_B__RAWNAND_CE0_B 0xb0b1
+ MX6UL_PAD_NAND_RE_B__RAWNAND_RE_B 0xb0b1
+ MX6UL_PAD_NAND_WE_B__RAWNAND_WE_B 0xb0b1
+ MX6UL_PAD_NAND_DATA00__RAWNAND_DATA00 0xb0b1
+ MX6UL_PAD_NAND_DATA01__RAWNAND_DATA01 0xb0b1
+ MX6UL_PAD_NAND_DATA02__RAWNAND_DATA02 0xb0b1
+ MX6UL_PAD_NAND_DATA03__RAWNAND_DATA03 0xb0b1
+ MX6UL_PAD_NAND_DATA04__RAWNAND_DATA04 0xb0b1
+ MX6UL_PAD_NAND_DATA05__RAWNAND_DATA05 0xb0b1
+ MX6UL_PAD_NAND_DATA06__RAWNAND_DATA06 0xb0b1
+ MX6UL_PAD_NAND_DATA07__RAWNAND_DATA07 0xb0b1
+ >;
+ };
+
+ pinctrl_uart3: uart3grp {
+ fsl,pins = <
+ MX6UL_PAD_UART3_TX_DATA__UART3_DCE_TX 0x1b0b1
+ MX6UL_PAD_UART3_RX_DATA__UART3_DCE_RX 0x1b099
+ MX6UL_PAD_UART3_RTS_B__UART3_DCE_RTS 0x1b0b1
+ MX6UL_PAD_UART3_CTS_B__UART3_DCE_CTS 0x1b099
+ MX6UL_PAD_GPIO1_IO01__GPIO1_IO01 0x79 /* BT_REG_ON */
+ MX6UL_PAD_SD1_CLK__GPIO2_IO17 0x100b1 /* BT_DEV_WAKE out */
+ MX6UL_PAD_ENET2_TX_EN__GPIO2_IO13 0x1b0b0 /* BT_HOST_WAKE in */
+ >;
+ };
+
+ pinctrl_uart4: uart4grp {
+ fsl,pins = <
+ MX6UL_PAD_UART4_TX_DATA__UART4_DCE_TX 0x1b0b1
+ MX6UL_PAD_UART4_RX_DATA__UART4_DCE_RX 0x1b0b1
+ >;
+ };
+
+ pinctrl_wlan: wlangrp {
+ fsl,pins = <
+ MX6UL_PAD_CSI_HSYNC__USDHC2_CMD 0x17059
+ MX6UL_PAD_CSI_VSYNC__USDHC2_CLK 0x10059
+ MX6UL_PAD_CSI_DATA00__USDHC2_DATA0 0x17059
+ MX6UL_PAD_CSI_DATA01__USDHC2_DATA1 0x17059
+ MX6UL_PAD_CSI_DATA02__USDHC2_DATA2 0x17059
+ MX6UL_PAD_CSI_DATA03__USDHC2_DATA3 0x17059
+ MX6UL_PAD_SD1_DATA3__GPIO2_IO21 0x79 /* WL_REG_ON */
+ MX6UL_PAD_UART2_CTS_B__GPIO1_IO22 0x100b1 /* WL_DEV_WAKE - WiFi_GPIO_4 - WiFi FW UART */
+ MX6UL_PAD_UART1_CTS_B__GPIO1_IO18 0x1b0b1 /* WL_HOST_WAKE - WIFI_GPIO_0 - OOB IRQ */
+ MX6UL_PAD_ENET1_RX_EN__OSC32K_32K_OUT 0x4001b031 /* OSC 32Khz wifi clk in */
+ >;
+ };
+};
diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
index eceb730856..28c6d05e2d 100644
--- a/arch/arm/mach-imx/mx6/Kconfig
+++ b/arch/arm/mach-imx/mx6/Kconfig
@@ -466,6 +466,17 @@ config TARGET_MX6ULL_14X14_EVK
select DM_THERMAL
imply CMD_DM
+config TARGET_MX6ULZ_SMM_M2
+ bool "Support imx6ulz_smm_m2"
+ depends on MX6ULL
+ select DM
+ select DM_GPIO
+ select DM_I2C
+ select DM_SERIAL
+ select DM_MTD
+ select DM_THERMAL
+ select SUPPORT_SPL
+
config TARGET_MYS_6ULX
bool "MYiR MYS-6ULX"
depends on MX6ULL
@@ -685,6 +696,7 @@ source "board/ge/b1x5v2/Kconfig"
source "board/aristainetos/Kconfig"
source "board/armadeus/opos6uldev/Kconfig"
source "board/boundary/nitrogen6x/Kconfig"
+source "board/bsh/imx6ulz_smm_m2/Kconfig"
source "board/bticino/mamoj/Kconfig"
source "board/compulab/cm_fx6/Kconfig"
source "board/dhelectronics/dh_imx6/Kconfig"
diff --git a/board/bsh/imx6ulz_smm_m2/Kconfig b/board/bsh/imx6ulz_smm_m2/Kconfig
new file mode 100644
index 0000000000..e38df7ce5c
--- /dev/null
+++ b/board/bsh/imx6ulz_smm_m2/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_MX6ULZ_SMM_M2
+
+config SYS_BOARD
+ default "imx6ulz_smm_m2"
+
+config SYS_VENDOR
+ default "bsh"
+
+config SYS_CONFIG_NAME
+ default "imx6ulz_smm_m2"
+
+endif
diff --git a/board/bsh/imx6ulz_smm_m2/MAINTAINERS b/board/bsh/imx6ulz_smm_m2/MAINTAINERS
new file mode 100644
index 0000000000..8f3d79dbb8
--- /dev/null
+++ b/board/bsh/imx6ulz_smm_m2/MAINTAINERS
@@ -0,0 +1,6 @@
+MX6ULZ_SMM_M2 BOARD
+M: Michael Trimarchi <michael(a)amarulasolutions.com>
+S: Maintained
+F: board/bsh/mx6ulz_smm_m2/
+F: include/configs/imx6ulz_smm_m2.h
+F: configs/imx6ulz_smm_m2_defconfig
diff --git a/board/bsh/imx6ulz_smm_m2/Makefile b/board/bsh/imx6ulz_smm_m2/Makefile
new file mode 100644
index 0000000000..b761bbb2f9
--- /dev/null
+++ b/board/bsh/imx6ulz_smm_m2/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+# (C) Copyright 2021 Amarula Solutions B.V.
+
+obj-y := imx6ulz_smm_m2.o
+obj-$(CONFIG_SPL_BUILD) += spl.o
+
diff --git a/board/bsh/imx6ulz_smm_m2/imx6ulz_smm_m2.c b/board/bsh/imx6ulz_smm_m2/imx6ulz_smm_m2.c
new file mode 100644
index 0000000000..c82eabbfbe
--- /dev/null
+++ b/board/bsh/imx6ulz_smm_m2/imx6ulz_smm_m2.c
@@ -0,0 +1,53 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ *
+ * Copyright (C) 2021 BSH Hausgeraete GmbH
+ */
+
+#include <init.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/iomux.h>
+#include <asm/arch/imx-regs.h>
+#include <asm/arch/crm_regs.h>
+#include <asm/arch/mx6-pins.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/mach-imx/boot_mode.h>
+#include <asm/global_data.h>
+#include <asm/gpio.h>
+#include <common.h>
+#include <env.h>
+#include <linux/sizes.h>
+
+static void setup_gpmi_nand(void)
+{
+ setup_gpmi_io_clk((MXC_CCM_CS2CDR_ENFC_CLK_PODF(0) |
+ MXC_CCM_CS2CDR_ENFC_CLK_PRED(3) |
+ MXC_CCM_CS2CDR_ENFC_CLK_SEL(3)));
+};
+
+int dram_init(void)
+{
+ gd->ram_size = imx_ddr_size();
+
+ return 0;
+}
+
+int board_init(void)
+{
+ /* Address of boot parameters */
+ gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
+
+ setup_gpmi_nand();
+
+ return 0;
+}
+
+int board_late_init(void)
+{
+ if (is_boot_from_usb()) {
+ env_set("bootcmd", "run bootcmd_mfg");
+ env_set("bootdelay", "0");
+ }
+
+ return 0;
+}
diff --git a/board/bsh/imx6ulz_smm_m2/spl.c b/board/bsh/imx6ulz_smm_m2/spl.c
new file mode 100644
index 0000000000..a524e7f225
--- /dev/null
+++ b/board/bsh/imx6ulz_smm_m2/spl.c
@@ -0,0 +1,130 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include <common.h>
+#include <cpu_func.h>
+#include <hang.h>
+#include <init.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/iomux.h>
+#include <asm/arch/imx-regs.h>
+#include <asm/arch/crm_regs.h>
+#include <asm/arch/mx6ull_pins.h>
+#include <asm/arch/mx6-pins.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/gpio.h>
+#include <asm/mach-imx/iomux-v3.h>
+#include <asm/mach-imx/boot_mode.h>
+#include <linux/libfdt.h>
+#include <spl.h>
+#include <asm/arch/mx6-ddr.h>
+
+#define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
+ PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \
+ PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS)
+
+static iomux_v3_cfg_t const uart4_pads[] = {
+ MX6_PAD_UART4_TX_DATA__UART4_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
+ MX6_PAD_UART4_RX_DATA__UART4_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
+};
+
+static void setup_iomux_uart(void)
+{
+ imx_iomux_v3_setup_multiple_pads(uart4_pads, ARRAY_SIZE(uart4_pads));
+}
+
+static struct mx6ul_iomux_grp_regs mx6_grp_ioregs = {
+ .grp_addds = 0x00000028,
+ .grp_ddrmode_ctl = 0x00020000,
+ .grp_b0ds = 0x00000028,
+ .grp_ctlds = 0x00000028,
+ .grp_b1ds = 0x00000028,
+ .grp_ddrpke = 0x00000000,
+ .grp_ddrmode = 0x00020000,
+ .grp_ddr_type = 0x000c0000,
+};
+
+static struct mx6ul_iomux_ddr_regs mx6_ddr_ioregs = {
+ .dram_dqm0 = 0x00000028,
+ .dram_dqm1 = 0x00000028,
+ .dram_ras = 0x00000028,
+ .dram_cas = 0x00000028,
+ .dram_odt0 = 0x00000028,
+ .dram_odt1 = 0x00000028,
+ .dram_sdba2 = 0x00000000,
+ .dram_sdclk_0 = 0x00000028,
+ .dram_sdqs0 = 0x00000028,
+ .dram_sdqs1 = 0x00000028,
+ .dram_reset = 0x000c0028,
+};
+
+static struct mx6_mmdc_calibration mx6_mmcd_calib = {
+ .p0_mpwldectrl0 = 0x00000000,
+ .p0_mpwldectrl1 = 0x00100010,
+ .p0_mpdgctrl0 = 0x414c014c,
+ .p0_mpdgctrl1 = 0x00000000,
+ .p0_mprddlctl = 0x40403a42,
+ .p0_mpwrdlctl = 0x4040342e,
+};
+
+static struct mx6_ddr_sysinfo ddr_sysinfo = {
+ .dsize = 0,
+ .cs1_mirror = 0,
+ .cs_density = 32,
+ .ncs = 1,
+ .bi_on = 1,
+ .rtt_nom = 1,
+ .rtt_wr = 0,
+ .ralat = 5,
+ .walat = 1,
+ .mif3_mode = 3,
+ .rst_to_cke = 0x23, /* 33 cycles (JEDEC value for DDR3) - total of 500 us */
+ .sde_to_rst = 0x10, /* 14 cycles (JEDEC value for DDR3) - total of 200 us */
+ .refsel = 1,
+ .refr = 3,
+};
+
+static struct mx6_ddr3_cfg mem_ddr = {
+ .mem_speed = 1333,
+ .density = 2,
+ .width = 16,
+ .banks = 8,
+ .rowaddr = 13,
+ .coladdr = 10,
+ .pagesz = 2,
+ .trcd = 1350,
+ .trcmin = 4950,
+ .trasmin = 3600,
+};
+
+static void ccgr_init(void)
+{
+ struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+
+ writel(0xFFFFFFFF, &ccm->CCGR0);
+ writel(0xFFFFFFFF, &ccm->CCGR1);
+ writel(0xFFFFFFFF, &ccm->CCGR2);
+ writel(0xFFFFFFFF, &ccm->CCGR3);
+ writel(0xFFFFFFFF, &ccm->CCGR4);
+ writel(0xFFFFFFFF, &ccm->CCGR5);
+ writel(0xFFFFFFFF, &ccm->CCGR6);
+}
+
+static void imx6ul_spl_dram_cfg(void)
+{
+ mx6ul_dram_iocfg(mem_ddr.width, &mx6_ddr_ioregs, &mx6_grp_ioregs);
+ mx6_dram_cfg(&ddr_sysinfo, &mx6_mmcd_calib, &mem_ddr);
+}
+
+void board_init_f(ulong dummy)
+{
+ ccgr_init();
+ arch_cpu_init();
+ timer_init();
+ setup_iomux_uart();
+ preloader_console_init();
+ imx6ul_spl_dram_cfg();
+}
+
+void reset_cpu(void)
+{
+}
diff --git a/configs/imx6ulz_smm_m2_defconfig b/configs/imx6ulz_smm_m2_defconfig
new file mode 100644
index 0000000000..b1daef8d75
--- /dev/null
+++ b/configs/imx6ulz_smm_m2_defconfig
@@ -0,0 +1,75 @@
+CONFIG_ARM=y
+CONFIG_ARCH_MX6=y
+CONFIG_SYS_TEXT_BASE=0x87800000
+CONFIG_SYS_MALLOC_LEN=0x1000000
+CONFIG_SPL_GPIO=y
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x400000
+CONFIG_MX6ULL=y
+CONFIG_TARGET_MX6ULZ_SMM_M2=y
+CONFIG_DEFAULT_DEVICE_TREE="imx6ulz-bsh-smm-m2"
+CONFIG_SPL_TEXT_BASE=0x00908000
+CONFIG_SPL_SERIAL=y
+CONFIG_SPL=y
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_FIT=y
+CONFIG_FIT_SIGNATURE=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_LEGACY_IMAGE_FORMAT=y
+CONFIG_BOOTDELAY=3
+CONFIG_BOARD_LATE_INIT=y
+CONFIG_SPL_DMA=y
+CONFIG_SPL_MTD_SUPPORT=y
+CONFIG_SPL_NAND_SUPPORT=y
+CONFIG_SPL_USB_HOST=y
+CONFIG_SPL_USB_GADGET=y
+CONFIG_SPL_USB_SDP_SUPPORT=y
+CONFIG_SPL_WATCHDOG=y
+CONFIG_CMD_DM=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_USB_SDP=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nand0=gpmi-nand"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=gpmi-nand:4m(nandboot),1m(env),8m(kernel),1m(nanddtb),-(rootfs)"
+CONFIG_CMD_UBI=y
+# CONFIG_ISO_PARTITION is not set
+CONFIG_OF_CONTROL=y
+CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_IN_NAND=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+# CONFIG_NET is not set
+CONFIG_BOUNCE_BUFFER=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x82000000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_UUU_SUPPORT=y
+CONFIG_FASTBOOT_FLASH_NAND=y
+CONFIG_SYS_I2C_MXC=y
+# CONFIG_MMC is not set
+CONFIG_MTD=y
+CONFIG_MTD_RAW_NAND=y
+CONFIG_NAND_MXS=y
+CONFIG_SYS_NAND_ONFI_DETECTION=y
+CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
+CONFIG_SYS_NAND_U_BOOT_OFFS=0x111400
+CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND=0x291400
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX6=y
+CONFIG_DM_PMIC=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_MXC_UART=y
+CONFIG_IMX_THERMAL=y
+CONFIG_USB=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="BSH"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
+CONFIG_CI_UDC=y
+CONFIG_SDP_LOADADDR=0x877fffc0
diff --git a/include/configs/imx6ulz_smm_m2.h b/include/configs/imx6ulz_smm_m2.h
new file mode 100644
index 0000000000..ddb2d6af29
--- /dev/null
+++ b/include/configs/imx6ulz_smm_m2.h
@@ -0,0 +1,89 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2021 Amarula Solutions B.V.
+ *
+ * Configuration settings for the Freescale i.MX6UL 14x14 EVK board.
+ */
+#ifndef __IMX6ULZ_SMM_M2_CONFIG_H
+#define __IMX6ULZ_SMM_M2_CONFIG_H
+
+#include "mx6_common.h"
+
+#include <asm/arch/imx-regs.h>
+#include <linux/sizes.h>
+#include <linux/stringify.h>
+
+/* SPL options */
+#include "imx6_spl.h"
+
+#define CONFIG_MXC_UART_BASE UART4_BASE
+
+#ifndef CONFIG_SPL_BUILD
+
+#define BOOT_TARGET_DEVICES(func) \
+ func(NAND, nand, 0) \
+
+#include <config_distro_bootcmd.h>
+
+#endif /* !CONFIG_SPL_BUILD */
+
+#define MEM_LAYOUT_ENV_SETTINGS \
+ "scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+ "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+ "ramdisk_addr_r=0x43800000\0" \
+ "fdt_addr_r=0x43000000\0" \
+ "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
+ "bootcmd_mfg=echo Running fastboot mode; fastboot usb 0\0" \
+
+#define NANDARGS \
+ "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
+ "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
+ "nandargs=setenv bootargs " \
+ "${optargs} " \
+ "mtdparts=${mtdparts} " \
+ "root=${nandroot} " \
+ "rootfstype=${nandrootfstype}\0" \
+ "nandroot=ubi0:root rw ubi.mtd=nandrootfs\0" \
+ "nandrootfstype=ubifs rootwait=1\0" \
+ "nandboot=echo Booting from nand ...; " \
+ "run nandargs; " \
+ "nand read ${fdt_addr_r} nanddtb; " \
+ "nand read ${loadaddr} nandkernel; " \
+ "booti ${loadaddr} - ${fdt_addr_r}\0"
+
+#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
+ "bootcmd_" #devtypel #instance "=" \
+ "run nandboot\0"
+
+#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
+ #devtypel #instance " "
+
+/* Initial environment variables */
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ MEM_LAYOUT_ENV_SETTINGS \
+ NANDARGS \
+ BOOTENV
+
+/* Miscellaneous configurable options */
+#define CONFIG_SYS_HZ 1000
+
+/* Physical Memory Map */
+#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
+#define PHYS_SDRAM_SIZE SZ_128M
+
+#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
+#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
+#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
+
+#define CONFIG_SYS_INIT_SP_OFFSET \
+ (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR \
+ (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
+
+
+/* NAND */
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+
+#define CONFIG_SYS_NAND_BASE 0x20000000
+
+#endif
--
2.34.1
1
0
This series will add support for MediaTek MT7621 SoC with two reference boards
and related drivers.
The MediaTek MT7621 is a network processor integrating a dual-core
dual-threaded MIPS 1004Kc processor running at a normal frequency of 880MHz.
This chip can be found in many wireless routers.
This series add all basic drivers which are useful in u-boot, like usb, sdxc,
ethernet, spi, nand and serial.
Building the u-boot requires external binary blob which is described in
doc/board/mediatek/mt7621.rst
Thanks,
Weijie
v6 changes:
- Use FIELD_GET/FIELD_PREP for register fields instead of shift opertations
- Rename fixed clock node name in mt7621.dtsi
- Panic if dram binary blob is wrong in spl
- Remove redundant nop's if noreorder is not used
- Use execution_hazard_barrier() in tpl
v5 changes:
- Adjust mt7621.dtsi, clkctrl node moved to sysc, pinctrl default states moved
to board dts files
- Modify clk driver due to its node changed in mt7621.dtsi
- Minor fixes
v4 changes:
- Add full support for booting from flash
v3 changes:
- Rewrite clk driver to follow definitions from upstream kernel
- Implement noncached_alloc() for MIPS platform
- Update register remap for mtk-eth driver needed by mt7621
v2 changes:
- Add a kconfig for max supported ram size
- Remove network configs from default config file
- Add config file for mt7621-rfb boards
Weijie Gao (25):
mips: add asm/mipsmtregs.h for MIPS multi-threading
mips: add more definitions for asm/cm.h
mips: add __image_copy_len for SPL linker script
mips: add support for noncached_alloc()
mips: mtmips: add support for MediaTek MT7621 SoC
mips: mtmips: add two reference boards for mt7621
doc: mediatek: add documentation for mt7621 reference boards
clk: mtmips: add clock driver for MediaTek MT7621 SoC
reset: mtmips: add reset controller support for MediaTek MT7621 SoC
pinctrl: mtmips: add support for MediaTek MT7621 SoC
usb: xhci-mtk: add support for MediaTek MT7621 SoC
phy: mtk-tphy: add support for MediaTek MT7621 SoC
spi: add support for MediaTek MT7621 SoC
gpio: add support for MediaTek MT7621 SoC
watchdog: add support for MediaTek MT7621 SoC
mmc: mediatek: add support for MediaTek MT7621 SoC
net: mediatek: remap iobase address
net: mediatek: use regmap api to modify ethsys registers
net: mediatek: add support for MediaTek MT7621 SoC
nand: raw: add support for MediaTek MT7621 SoC
spl: allow using nand base without standard nand driver
spl: spl_legacy: fix the use of SPL_COPY_PAYLOAD_ONLY
spl: nand: support loading legacy image with payload compressed
tools: mtk_image: add support for MT7621 NAND images
MAINTAINERS: update maintainer for MediaTek MIPS platform
MAINTAINERS | 8 +
arch/mips/cpu/u-boot-spl.lds | 3 +
arch/mips/dts/Makefile | 2 +
arch/mips/dts/mediatek,mt7621-nand-rfb.dts | 67 +
arch/mips/dts/mediatek,mt7621-rfb.dts | 82 ++
arch/mips/dts/mt7621-u-boot.dtsi | 111 ++
arch/mips/dts/mt7621.dtsi | 349 +++++
arch/mips/include/asm/cm.h | 67 +
arch/mips/include/asm/mipsmtregs.h | 142 ++
arch/mips/include/asm/system.h | 20 +
arch/mips/lib/cache.c | 43 +
arch/mips/mach-mtmips/Kconfig | 49 +-
arch/mips/mach-mtmips/Makefile | 4 +
arch/mips/mach-mtmips/cpu.c | 2 +-
arch/mips/mach-mtmips/mt7621/Kconfig | 115 ++
arch/mips/mach-mtmips/mt7621/Makefile | 14 +
arch/mips/mach-mtmips/mt7621/init.c | 246 ++++
arch/mips/mach-mtmips/mt7621/mt7621.h | 229 ++++
arch/mips/mach-mtmips/mt7621/serial.c | 23 +
arch/mips/mach-mtmips/mt7621/spl/Makefile | 9 +
arch/mips/mach-mtmips/mt7621/spl/cps.c | 153 +++
arch/mips/mach-mtmips/mt7621/spl/dram.c | 153 +++
arch/mips/mach-mtmips/mt7621/spl/dram.h | 39 +
arch/mips/mach-mtmips/mt7621/spl/launch.c | 100 ++
arch/mips/mach-mtmips/mt7621/spl/launch.h | 52 +
arch/mips/mach-mtmips/mt7621/spl/launch_ll.S | 339 +++++
arch/mips/mach-mtmips/mt7621/spl/serial.c | 24 +
arch/mips/mach-mtmips/mt7621/spl/spl.c | 95 ++
arch/mips/mach-mtmips/mt7621/spl/start.S | 226 ++++
arch/mips/mach-mtmips/mt7621/sram_init.S | 22 +
arch/mips/mach-mtmips/mt7621/tpl/Makefile | 4 +
arch/mips/mach-mtmips/mt7621/tpl/start.S | 161 +++
arch/mips/mach-mtmips/mt7621/tpl/tpl.c | 144 ++
board/mediatek/mt7621/MAINTAINERS | 8 +
board/mediatek/mt7621/Makefile | 3 +
board/mediatek/mt7621/board.c | 6 +
common/spl/Kconfig | 2 +-
common/spl/spl_legacy.c | 21 +-
common/spl/spl_nand.c | 27 +
configs/mt7621_nand_rfb_defconfig | 83 ++
configs/mt7621_rfb_defconfig | 82 ++
doc/board/mediatek/mt7621.rst | 48 +
drivers/clk/mtmips/Makefile | 1 +
drivers/clk/mtmips/clk-mt7621.c | 288 ++++
drivers/gpio/Kconfig | 2 +-
drivers/mmc/mtk-sd.c | 13 +
drivers/mtd/nand/raw/Kconfig | 17 +-
drivers/mtd/nand/raw/Makefile | 2 +
drivers/mtd/nand/raw/mt7621_nand.c | 1205 +++++++++++++++++
drivers/mtd/nand/raw/mt7621_nand.h | 29 +
drivers/mtd/nand/raw/mt7621_nand_spl.c | 237 ++++
drivers/net/mtk_eth.c | 45 +-
drivers/phy/Kconfig | 2 +-
drivers/pinctrl/mtmips/Kconfig | 9 +
drivers/pinctrl/mtmips/Makefile | 1 +
drivers/pinctrl/mtmips/pinctrl-mt7621.c | 306 +++++
.../pinctrl/mtmips/pinctrl-mtmips-common.c | 4 +-
.../pinctrl/mtmips/pinctrl-mtmips-common.h | 12 +
drivers/spi/Kconfig | 2 +-
drivers/usb/host/Kconfig | 2 +-
drivers/watchdog/Kconfig | 2 +-
include/configs/mt7621.h | 67 +
include/dt-bindings/clock/mt7621-clk.h | 46 +
include/dt-bindings/reset/mt7621-reset.h | 38 +
tools/mtk_image.c | 182 +++
tools/mtk_image.h | 24 +
66 files changed, 5877 insertions(+), 36 deletions(-)
create mode 100644 arch/mips/dts/mediatek,mt7621-nand-rfb.dts
create mode 100644 arch/mips/dts/mediatek,mt7621-rfb.dts
create mode 100644 arch/mips/dts/mt7621-u-boot.dtsi
create mode 100644 arch/mips/dts/mt7621.dtsi
create mode 100644 arch/mips/include/asm/mipsmtregs.h
create mode 100644 arch/mips/mach-mtmips/mt7621/Kconfig
create mode 100644 arch/mips/mach-mtmips/mt7621/Makefile
create mode 100644 arch/mips/mach-mtmips/mt7621/init.c
create mode 100644 arch/mips/mach-mtmips/mt7621/mt7621.h
create mode 100644 arch/mips/mach-mtmips/mt7621/serial.c
create mode 100644 arch/mips/mach-mtmips/mt7621/spl/Makefile
create mode 100644 arch/mips/mach-mtmips/mt7621/spl/cps.c
create mode 100644 arch/mips/mach-mtmips/mt7621/spl/dram.c
create mode 100644 arch/mips/mach-mtmips/mt7621/spl/dram.h
create mode 100644 arch/mips/mach-mtmips/mt7621/spl/launch.c
create mode 100644 arch/mips/mach-mtmips/mt7621/spl/launch.h
create mode 100644 arch/mips/mach-mtmips/mt7621/spl/launch_ll.S
create mode 100644 arch/mips/mach-mtmips/mt7621/spl/serial.c
create mode 100644 arch/mips/mach-mtmips/mt7621/spl/spl.c
create mode 100644 arch/mips/mach-mtmips/mt7621/spl/start.S
create mode 100644 arch/mips/mach-mtmips/mt7621/sram_init.S
create mode 100644 arch/mips/mach-mtmips/mt7621/tpl/Makefile
create mode 100644 arch/mips/mach-mtmips/mt7621/tpl/start.S
create mode 100644 arch/mips/mach-mtmips/mt7621/tpl/tpl.c
create mode 100644 board/mediatek/mt7621/MAINTAINERS
create mode 100644 board/mediatek/mt7621/Makefile
create mode 100644 board/mediatek/mt7621/board.c
create mode 100644 configs/mt7621_nand_rfb_defconfig
create mode 100644 configs/mt7621_rfb_defconfig
create mode 100644 doc/board/mediatek/mt7621.rst
create mode 100644 drivers/clk/mtmips/clk-mt7621.c
create mode 100644 drivers/mtd/nand/raw/mt7621_nand.c
create mode 100644 drivers/mtd/nand/raw/mt7621_nand.h
create mode 100644 drivers/mtd/nand/raw/mt7621_nand_spl.c
create mode 100644 drivers/pinctrl/mtmips/pinctrl-mt7621.c
create mode 100644 include/configs/mt7621.h
create mode 100644 include/dt-bindings/clock/mt7621-clk.h
create mode 100644 include/dt-bindings/reset/mt7621-reset.h
--
2.17.1
4
30
From: T Karthik Reddy <t.karthik.reddy(a)xilinx.com>
When usb PHY initialization is done, the PHY need to be reset.
Signed-off-by: T Karthik Reddy <t.karthik.reddy(a)xilinx.com>
Signed-off-by: Michal Simek <michal.simek(a)amd.com>
---
Changes in v3:
- Fix compilation issues reported by CI and Marek
- Use CONFIG_IS_ENABLED(DM_GPIO) and remove Kconfig dependency
Changes in v2:
- Remove EBUSY checking which is not needed. Reported by Bin
The patch depends on
https://lore.kernel.org/all/152354d05f56c57a21a6306745051a0961ea3c66.165727…
---
drivers/usb/dwc3/dwc3-generic.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index c5310e465cbf..466b25a0c38e 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -26,6 +26,7 @@
#include <reset.h>
#include <clk.h>
#include <usb/xhci.h>
+#include <asm/gpio.h>
struct dwc3_glue_data {
struct clk_bulk clks;
@@ -43,6 +44,7 @@ struct dwc3_generic_priv {
void *base;
struct dwc3 dwc3;
struct phy_bulk phys;
+ struct gpio_desc ulpi_reset;
};
struct dwc3_generic_host_priv {
@@ -78,6 +80,27 @@ static int dwc3_generic_probe(struct udevice *dev,
if (rc && rc != -ENOTSUPP)
return rc;
+ if (CONFIG_IS_ENABLED(DM_GPIO) &&
+ device_is_compatible(dev->parent, "xlnx,zynqmp-dwc3")) {
+ rc = gpio_request_by_name(dev->parent, "reset-gpios", 0,
+ &priv->ulpi_reset, GPIOD_ACTIVE_LOW);
+ if (rc)
+ return rc;
+
+ /* Toggle ulpi to reset the phy. */
+ rc = dm_gpio_set_value(&priv->ulpi_reset, 1);
+ if (rc)
+ return rc;
+
+ mdelay(5);
+
+ rc = dm_gpio_set_value(&priv->ulpi_reset, 0);
+ if (rc)
+ return rc;
+
+ mdelay(5);
+ }
+
if (device_is_compatible(dev->parent, "rockchip,rk3399-dwc3"))
reset_deassert_bulk(&glue->resets);
@@ -99,6 +122,13 @@ static int dwc3_generic_remove(struct udevice *dev,
{
struct dwc3 *dwc3 = &priv->dwc3;
+ if (CONFIG_IS_ENABLED(DM_GPIO) &&
+ device_is_compatible(dev->parent, "xlnx,zynqmp-dwc3")) {
+ struct gpio_desc *ulpi_reset = &priv->ulpi_reset;
+
+ dm_gpio_free(ulpi_reset->dev, ulpi_reset);
+ }
+
dwc3_remove(dwc3);
dwc3_shutdown_phy(dev, &priv->phys);
unmap_physmem(dwc3->regs, MAP_NOCACHE);
--
2.36.1
2
2
From: Johan Jonker <jbx6244(a)gmail.com>
Add Rockchip IDB device for U-boot.
On Rockchip SoCs with a NAND as boot device the information data base (IDB) loaded
by the boot ROM is stored at the beginning of several erase blocks.
Rewriting NAND blocks makes them wear out, so some spare blocks and a writing strategy
are required. A closed source usbplug uses block: 2,3,4,5,6 for example.
Block 0 and 1 is in use for other data.
For compatible reasons this device follows this approach in line with other
Rockchip products and modules for now.
The Rockchip boot ROM requires a particular file format for booting from NAND:
It starts with 512-byte (IDB sector 0), RC4 encoded header and is aligned to NAND page size.
Rockchip fills sector 1,2 and 3 here with more data structures, but that is not required
by the boot ROM. It just makes it easier to identify the IDB date and version.
Then 2KB pieces (4 x 512 byte sectors) of spl and tpl data aligned to the NAND page size in a
fixed pattern with empty pages.
Size of spl and tpl must be aligned to 2KB.
Empty NAND pages/sectors not in use should fill with 0xFF padding to increase NAND durability.
Create a IDB image for the flash tools below with:
#### For RK30 with NAND only ####
printf "RK30" > tplspl.bin
dd if=u-boot-tpl.bin >> tplspl.bin
truncate -s %2048 tplspl.bin
truncate -s %2048 u-boot-spl.bin
./mkimage -v -n rk3066 -T rksd -d ./tplspl.bin:./u-boot-spl.bin out
#### For other Rockchip SoCs with NAND ####
./mkimage -v -n rk3188 -T rksd -d ./u-boot-tpl.bin:./u-boot-spl.bin out
or if more data structures for IDB sector 1, 2 (RC4) and 3 (RC4) are needed then use a custom
image tool as mainline only has basic support for IDB sector 0.
In order to transfer data from a host (PC) via USB existing methods are used.
This driver creates an GPT EFI block driver to work with the
U-boot commands "rockusb" and "ums".
IDB data is inserted 'on the fly' as if it were a normal disk in blocks with 512 byte.
Changing disk parameters is not allowed.
The IDB device driver looks for block driver sector 64 to start with and calculates the IDB size.
When the last sector is received it erases a NAND block and writes IDB sectors to NAND in a pattern.
Written data is verified. If not identical that NAND erase block is freed.
As last thing the remaining IDB blocks are scanned and made available for reading.
Normal U-boot operation contains 2 steps:
1 - start IDB device
2 - start USB gadget (rockusb or ums)
U-boot IDB commands:
idb start - start IDB device
idb stop - stop IDB blk device
idb info - show IDB device info
Host (PC) tool commands combinations that work:
U-boot linux
rockusb 0 idb 0
upgrade_tool pl
upgrade_tool wl 64 upgrade_tool_wl_64.bin
upgrade_tool rl 64 512 upgrade_tool_rl_64_512.bin
upgrade_tool rd
rkdeveloptool ppt
rkdeveloptool wlx loader1 rkdeveloptool_wlx_loader1.bin
rkdeveloptool wl 64 rkdeveloptool_wl_64.bin
rkdeveloptool rl 64 512 rkdeveloptool_rl_64_512.bin
rkdeveloptool rd
rkflashtool w 64 512 < rkflashtool_w_64_512.bin
rkflashtool r 64 512 > rkflashtool_r_64_512.bin
ums 0 idb 0
dd if=ums_0_idb_0_wr.bin of=/dev/sda1
dd if=/dev/sda1 of=ums_0_idb_0_rd.bin
Tested with:
MK808 rk3066
Not tested:
nfc type V8, V9
TODO:
Looking for advice on what needs to be done to make it fit for mainline. Thanks!
This is placed in the mach-rockchip directory,
so we can re-use/combine the source with a usbplug or RK NAND FTL driver
with no MTD frame work bloatware ;) in a Makefile.
IDB header V2
Writing strategy improvement
etc, etc
Johan Jonker (6):
rockchip: block: add Rockchip IDB block device
rockchip: spl: allow more boot devices
rockchip: rk3066: add Rockchip IDB block device as boot action
arm: dts: rockchip: sync rk3066/rk3188 DT files from Linux
arm: dts: rockchip: enable nfc node in spl for rk3066 mk808
rockchip: configs: mk808: add idb configs
arch/arm/dts/rk3066a-mk808-u-boot.dtsi | 8 +
arch/arm/dts/rk3066a-mk808.dts | 18 +
arch/arm/dts/rk3066a.dtsi | 3 +-
arch/arm/dts/rk3188-radxarock.dts | 3 +-
arch/arm/dts/rk3188.dtsi | 24 +-
arch/arm/dts/rk3xxx-u-boot.dtsi | 4 +
arch/arm/mach-rockchip/Kconfig | 12 +
arch/arm/mach-rockchip/Makefile | 1 +
arch/arm/mach-rockchip/rk3066/rk3066.c | 11 +
arch/arm/mach-rockchip/rockchip_idb.c | 1694 ++++++++++++++++++++++++
arch/arm/mach-rockchip/spl.c | 5 +-
configs/mk808_defconfig | 4 +
drivers/block/blk-uclass.c | 2 +
include/blk.h | 1 +
include/dm/uclass-id.h | 1 +
include/efi_loader.h | 4 +
lib/efi_loader/efi_device_path.c | 30 +
17 files changed, 1812 insertions(+), 13 deletions(-)
create mode 100644 arch/arm/mach-rockchip/rockchip_idb.c
--
2.20.1
2
1

CVE-2022-2347 - Unchecked Download Size and Direction in U-Boot USB DFU
by Eduardo' Vela" <Nava> 08 Jul '22
by Eduardo' Vela" <Nava> 08 Jul '22
08 Jul '22
```
Vendor: DENX Software Engineering
Vendor URL: https://www.denx.de/wiki/U-Boot
Versions affected: v2012.10-rc1 to <version of fix>
Systems Affected: All systems with CONFIG_DFU_OVER_USB or CONFIG_SPL_DFU
enabled
Author: <Sultan Qasim Khan> <sultan.qasimkhan(a)nccgroup.com>
Advisory URL / CVE Identifier: CVE-2022-2347
Risk: 7.7 AV:P/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
```
**Summary**
U-Boot is a popular and feature-rich bootloader for embedded systems.
It includes optional support for the USB Device Firmware Update (DFU)
protocol, which can be used by devices to download new firmware, or upload
their current firmware.
The U-Boot DFU implementation does not bound the length field in USB
DFU download setup packets, and it does not verify that the transfer
direction corresponds to the specified command. Consequently, if a physical
attacker crafts a USB DFU download setup packet with a `wLength `greater
than 4096 bytes, they can write beyond the heap-allocated request buffer.
It is also possible to read its content (and beyond it) if the direction
bit for the setup packet indicates a device to host direction.
**Location**
```
drivers/usb/gadget/f_dfu.c
```
Functions `dfu_handle, state_dfu_idle, state_dfu_dnload_idle,
handle_dnload`
**Impact**
Data beyond the heap-allocated `req->buf `buffer may be corrupted or
read by a connected USB host when a device running U-Boot is in DFU mode.
This may enable a malicious host to gain code execution on the device
running U-Boot, or read sensitive data from the device.
**Details**
USB DFU setup packets are handled by the `dfu_handle `function. The DFU
command is specified by the `ctrl->bRequest `field, and the transfer
direction for the data phase is specified by the direction bit
`ctrl->bRequestType & USB_DIR_IN`. The `dfu_handle `function calls
state-specific handlers such as `state_dfu_idle `or
`state_dfu_dnload_idle`, and uses the value returned by the state handler
as the length for the data phase of the transfer. The buffer that will be
written to or read from in the data phase of the transfer is `req->buf`,
which is heap allocated as 4096 (`USB_BUFSIZ`) bytes in `composite_bind `of
[drivers/usb/gadget/composite.c](
https://source.denx.de/u-boot/u-boot/-/blob/4df50f89f5769732c6cce67f9563711…
).
The request structure that is set up is then queued with the USB
controller driver via a call to `usb_ep_queue`. There are several USB
controllers supported by U-Boot, such as the popular Designware DWC2 whose
support is implemented in <code>[drivers/usb/gadget/dwc2_udc_otg.c](
https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/usb/gadget/dwc2_…)
</code>and <code>[drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c](
https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/usb/gadget/dwc2_…)</code>.
These drivers are unaware of the allocated size for the request buffer
(<code>req->buf</code>), and assume the supplied length field (<code>req-
>length</code>) is safe for the allocated buffer.
```
static int
dfu_handle(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
{
struct usb_gadget *gadget = f->config->cdev->gadget;
struct usb_request *req = f->config->cdev->req;
struct f_dfu *f_dfu = f->config->cdev->req->context;
…
if (req_type == USB_TYPE_STANDARD) {
…
} else /* DFU specific request */
value = dfu_state[f_dfu->dfu_state] (f_dfu, ctrl, gadget, req);
if (value >= 0) {
req->length = value;
req->zero = value < len;
value = usb_ep_queue(gadget->ep0, req, 0);
if (value < 0) {
debug("ep_queue --> %d\n", value);
req->status = 0;
}
}
return value;
}
```
The DFU state handlers which support the download command
(`state_dfu_idle` and `state_dfu_dnload_idle`) return the value returned
by `handle_dnload` when `ctrl->bRequest `is `USB_REQ_DFU_DNLOAD`. No
checking of the transfer direction is performed; DFU download requests are
assumed to always be OUT transfers (host to device). However, a malicious
or compromised host could issue a download request setup packet with the
`USB_DIR_IN `bit set (device to host). A DFU download request with the
`USB_DIR_IN `bit set would cause data in req->buf to be sent to the host,
rather than filling the buffer with data received from the host.
The `handle_dnload `function simply returns the length argument passed
to it without any bounds checking. Both state handlers that call
`handle_dnload `pass it the `wLength `field of the setup packet without
any bounds checks. Consequently, a malicious host that sends a DFU setup
packet with a length longer than 4096 bytes would result in a read or write
beyond `req->buf`. The DFU functional descriptor does declare a maximum
`wTransferSize `of `DFU_USB_BUFSIZ `(4096 bytes), and compliant hosts
would abide by not sending setup packets specifying lengths longer than
this. However, a malicious or non-compliant host may send a DFU setup
packet for a transfer longer than this.
```
static int handle_dnload(struct usb_gadget *gadget, u16 len)
{
struct usb_composite_dev *cdev = get_gadget_data(gad get);
struct usb_request *req = cdev->req;
struct f_dfu *f_dfu = req->context;
if (len == 0)
f_dfu->dfu_state = DFU_STATE_dfuMANIFEST_SYNC;
req->complete = dnload_request_complete;
return len;
}
```
```
static int state_dfu_idle(struct f_dfu *f_dfu,
const struct usb_ctrlrequest *ctrl,
struct usb_gadget *gadget,
struct usb_request *req)
{
u16 w_value = le16_to_cpu(ctrl->wValue);
u16 len = le16_to_cpu(ctrl->wLength);
int value = 0;
switch (ctrl->bRequest) {
case USB_REQ_DFU_DNLOAD:
if (len == 0) {
f_dfu->dfu_state = DFU_STATE_dfuERROR;
value = RET_STALL;
break;
}
f_dfu->dfu_state = DFU_STATE_dfuDNLOAD_SYNC;
f_dfu->blk_seq_num = w_value;
value = handle_dnload(gadget, len);
break;
…
}
return value;
}
```
**Recommendation **
Limit USB transfer lengths to a maximum of `DFU_USB_BUFSIZ `before
adding them to the endpoint transfer queue in `dfu_handle`. In every DFU
setup packet handler, also verify that the direction bit
`ctrl->bRequestType & USB_DIR_IN `matches the request type (such as upload
or download).
**Vendor Communication **
1. Feb 27 2022 - Initial email to security(a)denx.de (this was the wrong
email)
2. April 30 2022 - Follow up (60 days)
3. June 3 2022 - Email to wd(a)denx.de (bounced but provided alternative
contacts)
4. June 7 2022 - Discussion to post to the public mailing list
5. July 8 2022 - Public disclosure
**Written by: **Sultan Qasim Khan from NCC Group
https://www.nccgroup.com/
1
0
This converts the following to Kconfig:
CONFIG_SYS_OHCI_SWAP_REG_ACCESS
CONFIG_SYS_USB_OHCI_CPU_INIT
CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS
CONFIG_SYS_USB_OHCI_SLOT_NAME
CONFIG_USB_ATMEL
CONFIG_USB_ATMEL_CLK_SEL_PLLB
CONFIG_USB_ATMEL_CLK_SEL_UPLL
CONFIG_USB_OHCI_LPC32XX
CONFIG_USB_OHCI_NEW
Signed-off-by: Tom Rini <trini(a)konsulko.com>
---
arch/arm/include/asm/arch-lpc32xx/config.h | 4 --
configs/at91sam9260ek_dataflash_cs0_defconfig | 3 ++
configs/at91sam9260ek_dataflash_cs1_defconfig | 3 ++
configs/at91sam9260ek_nandflash_defconfig | 3 ++
configs/at91sam9261ek_dataflash_cs0_defconfig | 3 ++
configs/at91sam9261ek_dataflash_cs3_defconfig | 3 ++
configs/at91sam9261ek_nandflash_defconfig | 3 ++
configs/at91sam9263ek_dataflash_cs0_defconfig | 3 ++
configs/at91sam9263ek_dataflash_defconfig | 3 ++
configs/at91sam9263ek_nandflash_defconfig | 3 ++
configs/at91sam9263ek_norflash_boot_defconfig | 3 ++
configs/at91sam9263ek_norflash_defconfig | 3 ++
configs/at91sam9g10ek_dataflash_cs0_defconfig | 3 ++
configs/at91sam9g10ek_dataflash_cs3_defconfig | 3 ++
configs/at91sam9g10ek_nandflash_defconfig | 3 ++
configs/at91sam9g20ek_2mmc_defconfig | 3 ++
.../at91sam9g20ek_2mmc_nandflash_defconfig | 3 ++
configs/at91sam9g20ek_dataflash_cs0_defconfig | 3 ++
configs/at91sam9g20ek_dataflash_cs1_defconfig | 3 ++
configs/at91sam9g20ek_nandflash_defconfig | 3 ++
configs/at91sam9xeek_dataflash_cs0_defconfig | 3 ++
configs/at91sam9xeek_dataflash_cs1_defconfig | 3 ++
configs/at91sam9xeek_nandflash_defconfig | 3 ++
configs/axs103_defconfig | 1 +
configs/chromebook_bob_defconfig | 1 +
configs/chromebook_kevin_defconfig | 1 +
configs/comtrend_ar5315u_ram_defconfig | 2 +
configs/comtrend_ar5387un_ram_defconfig | 2 +
configs/comtrend_ct5361_ram_defconfig | 2 +
configs/comtrend_vr3032u_ram_defconfig | 2 +
configs/comtrend_wap5813n_ram_defconfig | 2 +
configs/da850evm_defconfig | 1 +
configs/da850evm_direct_nor_defconfig | 1 +
configs/da850evm_nand_defconfig | 1 +
configs/devkit3250_defconfig | 3 ++
configs/elgin-rv1108_defconfig | 1 +
configs/evb-rk3128_defconfig | 1 +
configs/evb-rk3328_defconfig | 1 +
configs/evb-rv1108_defconfig | 1 +
configs/hsdk_4xd_defconfig | 1 +
configs/hsdk_defconfig | 1 +
configs/huawei_hg556a_ram_defconfig | 2 +
configs/khadas-edge-captain-rk3399_defconfig | 1 +
configs/khadas-edge-rk3399_defconfig | 1 +
configs/khadas-edge-v-rk3399_defconfig | 1 +
configs/nanopi-r2s-rk3328_defconfig | 1 +
configs/netgear_dgnd3700v2_ram_defconfig | 2 +
configs/omapl138_lcdk_defconfig | 1 +
configs/pinebook-pro-rk3399_defconfig | 1 +
configs/pm9261_defconfig | 3 ++
configs/pm9263_defconfig | 3 ++
configs/roc-cc-rk3328_defconfig | 1 +
configs/rock-pi-e-rk3328_defconfig | 1 +
configs/rock64-rk3328_defconfig | 1 +
configs/rock960-rk3399_defconfig | 1 +
configs/rockpro64-rk3399_defconfig | 1 +
configs/sama5d3_xplained_mmc_defconfig | 3 ++
configs/sama5d3_xplained_nandflash_defconfig | 3 ++
configs/sfr_nb4-ser_ram_defconfig | 2 +
configs/smartweb_defconfig | 2 +
configs/socrates_defconfig | 2 +
configs/stih410-b2260_defconfig | 1 +
configs/taurus_defconfig | 2 +
configs/vexpress_aemv8a_juno_defconfig | 1 +
drivers/usb/host/Kconfig | 44 +++++++++++++++++++
drivers/usb/host/ohci-at91.c | 5 ---
drivers/usb/host/ohci-generic.c | 4 --
drivers/usb/host/ohci.h | 2 +-
include/configs/at91sam9260ek.h | 6 ---
include/configs/at91sam9261ek.h | 10 -----
include/configs/at91sam9263ek.h | 6 ---
include/configs/at91sam9n12ek.h | 6 ---
include/configs/at91sam9x5ek.h | 6 ---
include/configs/axs10x.h | 2 -
include/configs/bmips_bcm6318.h | 7 ---
include/configs/bmips_bcm63268.h | 7 ---
include/configs/bmips_bcm6328.h | 7 ---
include/configs/bmips_bcm6348.h | 7 ---
include/configs/bmips_bcm6358.h | 7 ---
include/configs/bmips_bcm6362.h | 7 ---
include/configs/bmips_bcm6368.h | 7 ---
include/configs/da850evm.h | 4 --
include/configs/devkit3250.h | 1 -
include/configs/ethernut5.h | 6 ---
include/configs/evb_rk3399.h | 3 --
include/configs/gru.h | 3 --
include/configs/hsdk-4xd.h | 6 ---
include/configs/hsdk.h | 6 ---
include/configs/omapl138_lcdk.h | 6 ---
include/configs/pinebook-pro-rk3399.h | 3 --
include/configs/pm9261.h | 6 ---
include/configs/pm9263.h | 6 ---
include/configs/rk3128_common.h | 3 --
include/configs/rk3328_common.h | 4 --
include/configs/rock960_rk3399.h | 3 --
include/configs/rockpro64_rk3399.h | 3 --
include/configs/rv1108_common.h | 2 -
include/configs/sama5d3_xplained.h | 6 ---
include/configs/sama5d3xek.h | 5 ---
include/configs/smartweb.h | 6 ---
include/configs/snapper9260.h | 6 ---
include/configs/socrates.h | 4 --
include/configs/stih410-b2260.h | 2 -
include/configs/sunxi-common.h | 5 ---
include/configs/taurus.h | 6 ---
include/configs/usb_a9263.h | 5 ---
include/configs/vexpress_aemv8.h | 5 ---
107 files changed, 173 insertions(+), 214 deletions(-)
diff --git a/arch/arm/include/asm/arch-lpc32xx/config.h b/arch/arm/include/asm/arch-lpc32xx/config.h
index 653792c610cb..32d68cbeb81a 100644
--- a/arch/arm/include/asm/arch-lpc32xx/config.h
+++ b/arch/arm/include/asm/arch-lpc32xx/config.h
@@ -52,11 +52,7 @@
/* USB OHCI */
#if defined(CONFIG_USB_OHCI_LPC32XX)
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_CPU_INIT
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
#define CONFIG_SYS_USB_OHCI_REGS_BASE USB_BASE
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "lpc32xx-ohci"
#endif
#endif /* _LPC32XX_CONFIG_H */
diff --git a/configs/at91sam9260ek_dataflash_cs0_defconfig b/configs/at91sam9260ek_dataflash_cs0_defconfig
index 9947d1d4c670..62b467ea3097 100644
--- a/configs/at91sam9260ek_dataflash_cs0_defconfig
+++ b/configs/at91sam9260ek_dataflash_cs0_defconfig
@@ -65,3 +65,6 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9260"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
diff --git a/configs/at91sam9260ek_dataflash_cs1_defconfig b/configs/at91sam9260ek_dataflash_cs1_defconfig
index 8e54f1b13358..a5ccce1eae25 100644
--- a/configs/at91sam9260ek_dataflash_cs1_defconfig
+++ b/configs/at91sam9260ek_dataflash_cs1_defconfig
@@ -65,3 +65,6 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9260"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
diff --git a/configs/at91sam9260ek_nandflash_defconfig b/configs/at91sam9260ek_nandflash_defconfig
index 1badceeb2c1f..d3706d158b7d 100644
--- a/configs/at91sam9260ek_nandflash_defconfig
+++ b/configs/at91sam9260ek_nandflash_defconfig
@@ -63,3 +63,6 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9260"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
diff --git a/configs/at91sam9261ek_dataflash_cs0_defconfig b/configs/at91sam9261ek_dataflash_cs0_defconfig
index 8b2f27a406ea..d479d76c79ec 100644
--- a/configs/at91sam9261ek_dataflash_cs0_defconfig
+++ b/configs/at91sam9261ek_dataflash_cs0_defconfig
@@ -65,4 +65,7 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9261"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
CONFIG_ATMEL_LCD_BGR555=y
diff --git a/configs/at91sam9261ek_dataflash_cs3_defconfig b/configs/at91sam9261ek_dataflash_cs3_defconfig
index e5350cfd6fe6..96c44e9a1628 100644
--- a/configs/at91sam9261ek_dataflash_cs3_defconfig
+++ b/configs/at91sam9261ek_dataflash_cs3_defconfig
@@ -65,4 +65,7 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9261"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
CONFIG_ATMEL_LCD_BGR555=y
diff --git a/configs/at91sam9261ek_nandflash_defconfig b/configs/at91sam9261ek_nandflash_defconfig
index 3557c4e57a67..16de51951191 100644
--- a/configs/at91sam9261ek_nandflash_defconfig
+++ b/configs/at91sam9261ek_nandflash_defconfig
@@ -63,4 +63,7 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9261"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
CONFIG_ATMEL_LCD_BGR555=y
diff --git a/configs/at91sam9263ek_dataflash_cs0_defconfig b/configs/at91sam9263ek_dataflash_cs0_defconfig
index aa69b0f97a07..e73ff8861bed 100644
--- a/configs/at91sam9263ek_dataflash_cs0_defconfig
+++ b/configs/at91sam9263ek_dataflash_cs0_defconfig
@@ -68,4 +68,7 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9263"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
CONFIG_ATMEL_LCD_BGR555=y
diff --git a/configs/at91sam9263ek_dataflash_defconfig b/configs/at91sam9263ek_dataflash_defconfig
index aa69b0f97a07..e73ff8861bed 100644
--- a/configs/at91sam9263ek_dataflash_defconfig
+++ b/configs/at91sam9263ek_dataflash_defconfig
@@ -68,4 +68,7 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9263"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
CONFIG_ATMEL_LCD_BGR555=y
diff --git a/configs/at91sam9263ek_nandflash_defconfig b/configs/at91sam9263ek_nandflash_defconfig
index f88ea5cc3dc3..184431640e66 100644
--- a/configs/at91sam9263ek_nandflash_defconfig
+++ b/configs/at91sam9263ek_nandflash_defconfig
@@ -66,4 +66,7 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9263"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
CONFIG_ATMEL_LCD_BGR555=y
diff --git a/configs/at91sam9263ek_norflash_boot_defconfig b/configs/at91sam9263ek_norflash_boot_defconfig
index b93eeaa2143c..7b975813928c 100644
--- a/configs/at91sam9263ek_norflash_boot_defconfig
+++ b/configs/at91sam9263ek_norflash_boot_defconfig
@@ -68,4 +68,7 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9263"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
CONFIG_ATMEL_LCD_BGR555=y
diff --git a/configs/at91sam9263ek_norflash_defconfig b/configs/at91sam9263ek_norflash_defconfig
index eb2e13ccc09f..2c354f3b5b51 100644
--- a/configs/at91sam9263ek_norflash_defconfig
+++ b/configs/at91sam9263ek_norflash_defconfig
@@ -69,4 +69,7 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9263"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
CONFIG_ATMEL_LCD_BGR555=y
diff --git a/configs/at91sam9g10ek_dataflash_cs0_defconfig b/configs/at91sam9g10ek_dataflash_cs0_defconfig
index 818e630ea2c5..ee4de9b67d67 100644
--- a/configs/at91sam9g10ek_dataflash_cs0_defconfig
+++ b/configs/at91sam9g10ek_dataflash_cs0_defconfig
@@ -62,3 +62,6 @@ CONFIG_ATMEL_USART=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9261"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
diff --git a/configs/at91sam9g10ek_dataflash_cs3_defconfig b/configs/at91sam9g10ek_dataflash_cs3_defconfig
index 118d778d4cfa..4a47ad128655 100644
--- a/configs/at91sam9g10ek_dataflash_cs3_defconfig
+++ b/configs/at91sam9g10ek_dataflash_cs3_defconfig
@@ -62,3 +62,6 @@ CONFIG_ATMEL_USART=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9261"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
diff --git a/configs/at91sam9g10ek_nandflash_defconfig b/configs/at91sam9g10ek_nandflash_defconfig
index bf667606a2a9..0e3d0b13140c 100644
--- a/configs/at91sam9g10ek_nandflash_defconfig
+++ b/configs/at91sam9g10ek_nandflash_defconfig
@@ -60,3 +60,6 @@ CONFIG_ATMEL_USART=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9261"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
diff --git a/configs/at91sam9g20ek_2mmc_defconfig b/configs/at91sam9g20ek_2mmc_defconfig
index d175575f7917..add019c10afd 100644
--- a/configs/at91sam9g20ek_2mmc_defconfig
+++ b/configs/at91sam9g20ek_2mmc_defconfig
@@ -66,3 +66,6 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9260"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
diff --git a/configs/at91sam9g20ek_2mmc_nandflash_defconfig b/configs/at91sam9g20ek_2mmc_nandflash_defconfig
index 2ea5bbd03407..72a21c3da94d 100644
--- a/configs/at91sam9g20ek_2mmc_nandflash_defconfig
+++ b/configs/at91sam9g20ek_2mmc_nandflash_defconfig
@@ -65,3 +65,6 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9260"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
diff --git a/configs/at91sam9g20ek_dataflash_cs0_defconfig b/configs/at91sam9g20ek_dataflash_cs0_defconfig
index 304ee157bb7a..03b029cee8d9 100644
--- a/configs/at91sam9g20ek_dataflash_cs0_defconfig
+++ b/configs/at91sam9g20ek_dataflash_cs0_defconfig
@@ -65,3 +65,6 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9260"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
diff --git a/configs/at91sam9g20ek_dataflash_cs1_defconfig b/configs/at91sam9g20ek_dataflash_cs1_defconfig
index a93ae955a57b..1ae1b28feefd 100644
--- a/configs/at91sam9g20ek_dataflash_cs1_defconfig
+++ b/configs/at91sam9g20ek_dataflash_cs1_defconfig
@@ -65,3 +65,6 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9260"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
diff --git a/configs/at91sam9g20ek_nandflash_defconfig b/configs/at91sam9g20ek_nandflash_defconfig
index 4c51e7a3355a..77ad4b9fda2d 100644
--- a/configs/at91sam9g20ek_nandflash_defconfig
+++ b/configs/at91sam9g20ek_nandflash_defconfig
@@ -63,3 +63,6 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9260"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
diff --git a/configs/at91sam9xeek_dataflash_cs0_defconfig b/configs/at91sam9xeek_dataflash_cs0_defconfig
index 9947d1d4c670..62b467ea3097 100644
--- a/configs/at91sam9xeek_dataflash_cs0_defconfig
+++ b/configs/at91sam9xeek_dataflash_cs0_defconfig
@@ -65,3 +65,6 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9260"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
diff --git a/configs/at91sam9xeek_dataflash_cs1_defconfig b/configs/at91sam9xeek_dataflash_cs1_defconfig
index 8e54f1b13358..a5ccce1eae25 100644
--- a/configs/at91sam9xeek_dataflash_cs1_defconfig
+++ b/configs/at91sam9xeek_dataflash_cs1_defconfig
@@ -65,3 +65,6 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9260"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
diff --git a/configs/at91sam9xeek_nandflash_defconfig b/configs/at91sam9xeek_nandflash_defconfig
index 1badceeb2c1f..d3706d158b7d 100644
--- a/configs/at91sam9xeek_nandflash_defconfig
+++ b/configs/at91sam9xeek_nandflash_defconfig
@@ -63,3 +63,6 @@ CONFIG_DM_SPI=y
CONFIG_TIMER=y
CONFIG_ATMEL_PIT_TIMER=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9260"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
diff --git a/configs/axs103_defconfig b/configs/axs103_defconfig
index 64407655767f..0d1764958224 100644
--- a/configs/axs103_defconfig
+++ b/configs/axs103_defconfig
@@ -62,5 +62,6 @@ CONFIG_DESIGNWARE_SPI=y
CONFIG_USB=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
CONFIG_USB_STORAGE=y
CONFIG_USE_PRIVATE_LIBGCC=y
diff --git a/configs/chromebook_bob_defconfig b/configs/chromebook_bob_defconfig
index 84fe5be19d56..938bc28a1d27 100644
--- a/configs/chromebook_bob_defconfig
+++ b/configs/chromebook_bob_defconfig
@@ -102,6 +102,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
CONFIG_USB_DWC3=y
CONFIG_USB_KEYBOARD=y
CONFIG_USB_HOST_ETHER=y
diff --git a/configs/chromebook_kevin_defconfig b/configs/chromebook_kevin_defconfig
index 669d6f570b9e..6f88002f968c 100644
--- a/configs/chromebook_kevin_defconfig
+++ b/configs/chromebook_kevin_defconfig
@@ -103,6 +103,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
CONFIG_USB_DWC3=y
CONFIG_USB_KEYBOARD=y
CONFIG_USB_HOST_ETHER=y
diff --git a/configs/comtrend_ar5315u_ram_defconfig b/configs/comtrend_ar5315u_ram_defconfig
index 170b766089d0..36eab571eafe 100644
--- a/configs/comtrend_ar5315u_ram_defconfig
+++ b/configs/comtrend_ar5315u_ram_defconfig
@@ -72,3 +72,5 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_SYS_OHCI_SWAP_REG_ACCESS=y
diff --git a/configs/comtrend_ar5387un_ram_defconfig b/configs/comtrend_ar5387un_ram_defconfig
index 599fda481aa8..68969c041386 100644
--- a/configs/comtrend_ar5387un_ram_defconfig
+++ b/configs/comtrend_ar5387un_ram_defconfig
@@ -73,3 +73,5 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_SYS_OHCI_SWAP_REG_ACCESS=y
diff --git a/configs/comtrend_ct5361_ram_defconfig b/configs/comtrend_ct5361_ram_defconfig
index b1ad57b5a56c..cb2caf454350 100644
--- a/configs/comtrend_ct5361_ram_defconfig
+++ b/configs/comtrend_ct5361_ram_defconfig
@@ -67,4 +67,6 @@ CONFIG_BCM6345_SERIAL=y
CONFIG_USB=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_SYS_OHCI_SWAP_REG_ACCESS=y
CONFIG_WDT_BCM6345=y
diff --git a/configs/comtrend_vr3032u_ram_defconfig b/configs/comtrend_vr3032u_ram_defconfig
index d07895de9b82..138d3c84bac7 100644
--- a/configs/comtrend_vr3032u_ram_defconfig
+++ b/configs/comtrend_vr3032u_ram_defconfig
@@ -72,3 +72,5 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_SYS_OHCI_SWAP_REG_ACCESS=y
diff --git a/configs/comtrend_wap5813n_ram_defconfig b/configs/comtrend_wap5813n_ram_defconfig
index ca370e66a346..b7174ff5ee34 100644
--- a/configs/comtrend_wap5813n_ram_defconfig
+++ b/configs/comtrend_wap5813n_ram_defconfig
@@ -69,3 +69,5 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_SYS_OHCI_SWAP_REG_ACCESS=y
diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig
index de2d709a7a22..d7348298587f 100644
--- a/configs/da850evm_defconfig
+++ b/configs/da850evm_defconfig
@@ -110,6 +110,7 @@ CONFIG_USB=y
# CONFIG_SPL_DM_USB is not set
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_DA8XX=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=15
CONFIG_USB_MUSB_HOST=y
CONFIG_USB_MUSB_DA8XX=y
CONFIG_USB_MUSB_PIO_ONLY=y
diff --git a/configs/da850evm_direct_nor_defconfig b/configs/da850evm_direct_nor_defconfig
index 88ef772d9d50..8f6b8b9702f4 100644
--- a/configs/da850evm_direct_nor_defconfig
+++ b/configs/da850evm_direct_nor_defconfig
@@ -88,6 +88,7 @@ CONFIG_DAVINCI_SPI=y
CONFIG_USB=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_DA8XX=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=15
CONFIG_USB_MUSB_HOST=y
CONFIG_USB_MUSB_DA8XX=y
CONFIG_USB_MUSB_PIO_ONLY=y
diff --git a/configs/da850evm_nand_defconfig b/configs/da850evm_nand_defconfig
index 052ef3070334..95b41ef32b14 100644
--- a/configs/da850evm_nand_defconfig
+++ b/configs/da850evm_nand_defconfig
@@ -113,6 +113,7 @@ CONFIG_USB=y
# CONFIG_SPL_DM_USB is not set
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_DA8XX=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=15
CONFIG_USB_MUSB_HOST=y
CONFIG_USB_MUSB_DA8XX=y
CONFIG_USB_MUSB_PIO_ONLY=y
diff --git a/configs/devkit3250_defconfig b/configs/devkit3250_defconfig
index a0b7a2e2d36c..eae073d76ea6 100644
--- a/configs/devkit3250_defconfig
+++ b/configs/devkit3250_defconfig
@@ -86,4 +86,7 @@ CONFIG_CONS_INDEX=5
CONFIG_SYS_NS16550=y
CONFIG_SPI=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="lpc32xx-ohci"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
+CONFIG_USB_OHCI_LPC32XX=y
CONFIG_OF_LIBFDT=y
diff --git a/configs/elgin-rv1108_defconfig b/configs/elgin-rv1108_defconfig
index 2f595be1c24a..263fe3b7c8d1 100644
--- a/configs/elgin-rv1108_defconfig
+++ b/configs/elgin-rv1108_defconfig
@@ -55,6 +55,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
CONFIG_USB_DWC2=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_PRODUCT_NUM=0x110a
diff --git a/configs/evb-rk3128_defconfig b/configs/evb-rk3128_defconfig
index e0fb3f62b45c..ac38d5e78852 100644
--- a/configs/evb-rk3128_defconfig
+++ b/configs/evb-rk3128_defconfig
@@ -51,6 +51,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
CONFIG_USB_DWC2=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DWC2_OTG=y
diff --git a/configs/evb-rk3328_defconfig b/configs/evb-rk3328_defconfig
index 4d6d235cb125..c81437300c74 100644
--- a/configs/evb-rk3328_defconfig
+++ b/configs/evb-rk3328_defconfig
@@ -99,6 +99,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
CONFIG_USB_DWC2=y
CONFIG_USB_DWC3=y
# CONFIG_USB_DWC3_GADGET is not set
diff --git a/configs/evb-rv1108_defconfig b/configs/evb-rv1108_defconfig
index dbca68fcf300..65b76c6b36d4 100644
--- a/configs/evb-rv1108_defconfig
+++ b/configs/evb-rv1108_defconfig
@@ -49,6 +49,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
CONFIG_USB_DWC2=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_PRODUCT_NUM=0x110a
diff --git a/configs/hsdk_4xd_defconfig b/configs/hsdk_4xd_defconfig
index 85844f7ec882..1d78c17d13b0 100644
--- a/configs/hsdk_4xd_defconfig
+++ b/configs/hsdk_4xd_defconfig
@@ -68,6 +68,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
CONFIG_USB_STORAGE=y
CONFIG_USE_PRIVATE_LIBGCC=y
CONFIG_PANIC_HANG=y
diff --git a/configs/hsdk_defconfig b/configs/hsdk_defconfig
index a714d28134bf..f9823af34d4d 100644
--- a/configs/hsdk_defconfig
+++ b/configs/hsdk_defconfig
@@ -67,6 +67,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
CONFIG_USB_STORAGE=y
CONFIG_USE_PRIVATE_LIBGCC=y
CONFIG_PANIC_HANG=y
diff --git a/configs/huawei_hg556a_ram_defconfig b/configs/huawei_hg556a_ram_defconfig
index 1c43ae262d81..2b5a58714102 100644
--- a/configs/huawei_hg556a_ram_defconfig
+++ b/configs/huawei_hg556a_ram_defconfig
@@ -69,3 +69,5 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_SYS_OHCI_SWAP_REG_ACCESS=y
diff --git a/configs/khadas-edge-captain-rk3399_defconfig b/configs/khadas-edge-captain-rk3399_defconfig
index e9618e3e207a..9a0171e4a8a4 100644
--- a/configs/khadas-edge-captain-rk3399_defconfig
+++ b/configs/khadas-edge-captain-rk3399_defconfig
@@ -65,6 +65,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_USB_ETHER_ASIX88179=y
diff --git a/configs/khadas-edge-rk3399_defconfig b/configs/khadas-edge-rk3399_defconfig
index 252a02b579e1..27f119931fb4 100644
--- a/configs/khadas-edge-rk3399_defconfig
+++ b/configs/khadas-edge-rk3399_defconfig
@@ -64,6 +64,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_USB_ETHER_ASIX88179=y
diff --git a/configs/khadas-edge-v-rk3399_defconfig b/configs/khadas-edge-v-rk3399_defconfig
index 731fbfcab264..de2b625120aa 100644
--- a/configs/khadas-edge-v-rk3399_defconfig
+++ b/configs/khadas-edge-v-rk3399_defconfig
@@ -65,6 +65,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_USB_ETHER_ASIX88179=y
diff --git a/configs/nanopi-r2s-rk3328_defconfig b/configs/nanopi-r2s-rk3328_defconfig
index 41793ca7e486..15c2e1698c20 100644
--- a/configs/nanopi-r2s-rk3328_defconfig
+++ b/configs/nanopi-r2s-rk3328_defconfig
@@ -102,6 +102,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
CONFIG_USB_DWC2=y
CONFIG_USB_DWC3=y
# CONFIG_USB_DWC3_GADGET is not set
diff --git a/configs/netgear_dgnd3700v2_ram_defconfig b/configs/netgear_dgnd3700v2_ram_defconfig
index bbfa9e13fa3c..73de5ed15b15 100644
--- a/configs/netgear_dgnd3700v2_ram_defconfig
+++ b/configs/netgear_dgnd3700v2_ram_defconfig
@@ -68,3 +68,5 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_SYS_OHCI_SWAP_REG_ACCESS=y
diff --git a/configs/omapl138_lcdk_defconfig b/configs/omapl138_lcdk_defconfig
index b45f6d8564e9..28f4f95c95bd 100644
--- a/configs/omapl138_lcdk_defconfig
+++ b/configs/omapl138_lcdk_defconfig
@@ -105,6 +105,7 @@ CONFIG_USB=y
# CONFIG_SPL_DM_USB is not set
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_DA8XX=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=15
CONFIG_USB_MUSB_HOST=y
CONFIG_USB_MUSB_DA8XX=y
CONFIG_USB_MUSB_PIO_ONLY=y
diff --git a/configs/pinebook-pro-rk3399_defconfig b/configs/pinebook-pro-rk3399_defconfig
index 121182c55d74..af473f913672 100644
--- a/configs/pinebook-pro-rk3399_defconfig
+++ b/configs/pinebook-pro-rk3399_defconfig
@@ -90,6 +90,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_GENERIC=y
CONFIG_USB_KEYBOARD=y
diff --git a/configs/pm9261_defconfig b/configs/pm9261_defconfig
index c22076250bc7..6922380b0093 100644
--- a/configs/pm9261_defconfig
+++ b/configs/pm9261_defconfig
@@ -61,6 +61,9 @@ CONFIG_ATMEL_USART=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9261"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
CONFIG_DM_VIDEO=y
# CONFIG_VIDEO_BPP32 is not set
CONFIG_ATMEL_LCD=y
diff --git a/configs/pm9263_defconfig b/configs/pm9263_defconfig
index 1406e7f1aa4d..2b4a844d804b 100644
--- a/configs/pm9263_defconfig
+++ b/configs/pm9263_defconfig
@@ -65,6 +65,9 @@ CONFIG_ATMEL_USART=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_SLOT_NAME="at91sam9263"
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
CONFIG_DM_VIDEO=y
# CONFIG_VIDEO_BPP32 is not set
CONFIG_ATMEL_LCD=y
diff --git a/configs/roc-cc-rk3328_defconfig b/configs/roc-cc-rk3328_defconfig
index ab25abc1a031..43b90c7879b7 100644
--- a/configs/roc-cc-rk3328_defconfig
+++ b/configs/roc-cc-rk3328_defconfig
@@ -108,6 +108,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
CONFIG_USB_DWC2=y
CONFIG_USB_DWC3=y
# CONFIG_USB_DWC3_GADGET is not set
diff --git a/configs/rock-pi-e-rk3328_defconfig b/configs/rock-pi-e-rk3328_defconfig
index 1d51a267b93a..7d95e171f7f4 100644
--- a/configs/rock-pi-e-rk3328_defconfig
+++ b/configs/rock-pi-e-rk3328_defconfig
@@ -109,6 +109,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
CONFIG_USB_DWC2=y
CONFIG_USB_DWC3=y
# CONFIG_USB_DWC3_GADGET is not set
diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig
index 640fe558d414..bc333a5e2a6a 100644
--- a/configs/rock64-rk3328_defconfig
+++ b/configs/rock64-rk3328_defconfig
@@ -106,6 +106,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
CONFIG_USB_DWC2=y
CONFIG_USB_DWC3=y
# CONFIG_USB_DWC3_GADGET is not set
diff --git a/configs/rock960-rk3399_defconfig b/configs/rock960-rk3399_defconfig
index 78e50dbfbcb7..bb5b2143691d 100644
--- a/configs/rock960-rk3399_defconfig
+++ b/configs/rock960-rk3399_defconfig
@@ -74,6 +74,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
CONFIG_USB_DWC3=y
CONFIG_USB_KEYBOARD=y
CONFIG_USB_HOST_ETHER=y
diff --git a/configs/rockpro64-rk3399_defconfig b/configs/rockpro64-rk3399_defconfig
index 4d2a5b32e31c..ef28fe6a937a 100644
--- a/configs/rockpro64-rk3399_defconfig
+++ b/configs/rockpro64-rk3399_defconfig
@@ -87,6 +87,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_GENERIC=y
CONFIG_USB_KEYBOARD=y
diff --git a/configs/sama5d3_xplained_mmc_defconfig b/configs/sama5d3_xplained_mmc_defconfig
index 848326051239..486e2190b2b3 100644
--- a/configs/sama5d3_xplained_mmc_defconfig
+++ b/configs/sama5d3_xplained_mmc_defconfig
@@ -104,6 +104,9 @@ CONFIG_ATMEL_PIT_TIMER=y
CONFIG_SPL_ATMEL_PIT_TIMER=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
+CONFIG_USB_ATMEL_CLK_SEL_UPLL=y
CONFIG_USB_STORAGE=y
CONFIG_W1=y
CONFIG_W1_GPIO=y
diff --git a/configs/sama5d3_xplained_nandflash_defconfig b/configs/sama5d3_xplained_nandflash_defconfig
index f12c5d791724..184ff5ff7248 100644
--- a/configs/sama5d3_xplained_nandflash_defconfig
+++ b/configs/sama5d3_xplained_nandflash_defconfig
@@ -107,6 +107,9 @@ CONFIG_ATMEL_PIT_TIMER=y
CONFIG_SPL_ATMEL_PIT_TIMER=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
+CONFIG_USB_ATMEL_CLK_SEL_UPLL=y
CONFIG_USB_STORAGE=y
CONFIG_W1=y
CONFIG_W1_GPIO=y
diff --git a/configs/sfr_nb4-ser_ram_defconfig b/configs/sfr_nb4-ser_ram_defconfig
index 6f261882faae..df008b797f86 100644
--- a/configs/sfr_nb4-ser_ram_defconfig
+++ b/configs/sfr_nb4-ser_ram_defconfig
@@ -71,3 +71,5 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_SYS_OHCI_SWAP_REG_ACCESS=y
diff --git a/configs/smartweb_defconfig b/configs/smartweb_defconfig
index 4e05f71bf3af..84337e49e6c9 100644
--- a/configs/smartweb_defconfig
+++ b/configs/smartweb_defconfig
@@ -92,6 +92,8 @@ CONFIG_MACB=y
CONFIG_RMII=y
CONFIG_ATMEL_USART=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_MANUFACTURER="Siemens AG"
CONFIG_USB_GADGET_VENDOR_NUM=0x0908
diff --git a/configs/socrates_defconfig b/configs/socrates_defconfig
index 28ea447ec55f..621573653785 100644
--- a/configs/socrates_defconfig
+++ b/configs/socrates_defconfig
@@ -96,4 +96,6 @@ CONFIG_USB=y
# CONFIG_USB_EHCI_HCD is not set
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_PCI=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=15
+CONFIG_SYS_OHCI_SWAP_REG_ACCESS=y
CONFIG_USB_STORAGE=y
diff --git a/configs/stih410-b2260_defconfig b/configs/stih410-b2260_defconfig
index 198a0c7f9e5f..cb8c73afd474 100644
--- a/configs/stih410-b2260_defconfig
+++ b/configs/stih410-b2260_defconfig
@@ -58,6 +58,7 @@ CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
CONFIG_USB_DWC3=y
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_ETHER_ASIX=y
diff --git a/configs/taurus_defconfig b/configs/taurus_defconfig
index cf538d0f5f5f..3d61c7b57b59 100644
--- a/configs/taurus_defconfig
+++ b/configs/taurus_defconfig
@@ -110,6 +110,8 @@ CONFIG_SPECIFY_CONSOLE_INDEX=y
CONFIG_ATMEL_USART=y
CONFIG_USB=y
# CONFIG_SPL_DM_USB is not set
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
+CONFIG_USB_ATMEL=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_MANUFACTURER="Siemens AG"
CONFIG_USB_GADGET_VENDOR_NUM=0x0908
diff --git a/configs/vexpress_aemv8a_juno_defconfig b/configs/vexpress_aemv8a_juno_defconfig
index ba8883dced55..792bcf1eb5d4 100644
--- a/configs/vexpress_aemv8a_juno_defconfig
+++ b/configs/vexpress_aemv8a_juno_defconfig
@@ -35,3 +35,4 @@ CONFIG_SYS_FLASH_CFI=y
CONFIG_DM_ETH=y
CONFIG_PCI=y
CONFIG_USB=y
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 0b82c2fdaf71..31ae9f74e7ac 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -297,10 +297,17 @@ config USB_EHCI_TXFIFO_THRESH
endif # USB_EHCI_HCD
+config USB_OHCI_NEW
+ bool
+
+config SYS_USB_OHCI_CPU_INIT
+ bool
+
config USB_OHCI_HCD
bool "OHCI HCD (USB 1.1) support"
depends on DM && OF_CONTROL
select USB_HOST
+ select USB_OHCI_NEW
---help---
The Open Host Controller Interface (OHCI) is a standard for accessing
USB 1.1 host controller hardware. It does more in hardware than Intel's
@@ -332,6 +339,19 @@ config USB_OHCI_DA8XX
endif # USB_OHCI_HCD
+config SYS_USB_OHCI_SLOT_NAME
+ string "Display name for the OHCI controller"
+ depends on USB_OHCI_NEW && !DM_USB
+
+config SYS_USB_OHCI_MAX_ROOT_PORTS
+ int "Maximal number of ports of the root hub"
+ depends on USB_OHCI_NEW
+ default 1 if ARCH_SUNXI
+
+config SYS_OHCI_SWAP_REG_ACCESS
+ bool "Perform byte swapping on OHCI controller register accesses"
+ depends on USB_OHCI_NEW
+
config USB_UHCI_HCD
bool "UHCI HCD (most Intel and VIA) support"
select USB_HOST
@@ -381,6 +401,30 @@ config USB_R8A66597_HCD
This enables support for the on-chip Renesas R8A66597 USB 2.0
controller, present in various RZ and SH SoCs.
+config USB_ATMEL
+ bool "AT91 OHCI USB support"
+ depends on ARCH_AT91
+ select SYS_USB_OHCI_CPU_INIT
+ select USB_OHCI_NEW
+
+choice
+ prompt "Clock for OHCI"
+ depends on USB_ATMEL
+
+config USB_ATMEL_CLK_SEL_PLLB
+ bool "PLLB"
+
+config USB_ATMEL_CLK_SEL_UPLL
+ bool "UPLL"
+
+endchoice
+
+config USB_OHCI_LPC32XX
+ bool "LPC32xx USB OHCI support"
+ depends on ARCH_LPC32XX
+ select SYS_USB_OHCI_CPU_INIT
+ select USB_OHCI_NEW
+
config USB_MAX_CONTROLLER_COUNT
int "Maximum number of USB host controllers"
depends on USB_EHCI_FSL || USB_XHCI_FSL || \
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index 8ceabaf45c1b..9b955c1bd678 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -5,9 +5,6 @@
*/
#include <common.h>
-
-#if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT)
-
#include <asm/arch/clk.h>
int usb_cpu_init(void)
@@ -65,5 +62,3 @@ int usb_cpu_init_fail(void)
{
return usb_cpu_stop();
}
-
-#endif /* defined(CONFIG_USB_OHCI) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT) */
diff --git a/drivers/usb/host/ohci-generic.c b/drivers/usb/host/ohci-generic.c
index 163f0ef17b11..5d23058aaf6a 100644
--- a/drivers/usb/host/ohci-generic.c
+++ b/drivers/usb/host/ohci-generic.c
@@ -14,10 +14,6 @@
#include <reset.h>
#include "ohci.h"
-#if !defined(CONFIG_USB_OHCI_NEW)
-# error "Generic OHCI driver requires CONFIG_USB_OHCI_NEW"
-#endif
-
struct generic_ohci {
ohci_t ohci;
struct clk *clocks; /* clock list */
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
index a38cd25eb85f..7699f2e6b15a 100644
--- a/drivers/usb/host/ohci.h
+++ b/drivers/usb/host/ohci.h
@@ -151,7 +151,7 @@ struct ohci_hcca {
* Maximum number of root hub ports.
*/
#ifndef CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS
-# error "CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS undefined!"
+#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
#endif
/*
diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h
index 2c4f229d3476..ef9335c523f4 100644
--- a/include/configs/at91sam9260ek.h
+++ b/include/configs/at91sam9260ek.h
@@ -53,12 +53,6 @@
#endif
/* USB */
-#define CONFIG_USB_ATMEL
-#define CONFIG_USB_ATMEL_CLK_SEL_PLLB
-#define CONFIG_USB_OHCI_NEW 1
-#define CONFIG_SYS_USB_OHCI_CPU_INIT 1
#define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00500000 /* AT91SAM9260_UHP_BASE */
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9260"
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
#endif
diff --git a/include/configs/at91sam9261ek.h b/include/configs/at91sam9261ek.h
index 563fff531d11..12726c10bd6d 100644
--- a/include/configs/at91sam9261ek.h
+++ b/include/configs/at91sam9261ek.h
@@ -51,16 +51,6 @@
#define CONFIG_DM9000_NO_SROM
/* USB */
-#define CONFIG_USB_ATMEL
-#define CONFIG_USB_ATMEL_CLK_SEL_PLLB
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_CPU_INIT
#define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00500000 /* AT91SAM9261_UHP_BASE */
-#ifdef CONFIG_AT91SAM9G10EK
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9g10"
-#else
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9261"
-#endif
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
#endif
diff --git a/include/configs/at91sam9263ek.h b/include/configs/at91sam9263ek.h
index c100a411b2dc..9497f055035d 100644
--- a/include/configs/at91sam9263ek.h
+++ b/include/configs/at91sam9263ek.h
@@ -173,12 +173,6 @@
#endif
/* USB */
-#define CONFIG_USB_ATMEL
-#define CONFIG_USB_ATMEL_CLK_SEL_PLLB
-#define CONFIG_USB_OHCI_NEW 1
-#define CONFIG_SYS_USB_OHCI_CPU_INIT 1
#define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00a00000 /* AT91SAM9263_UHP_BASE */
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9263"
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
#endif
diff --git a/include/configs/at91sam9n12ek.h b/include/configs/at91sam9n12ek.h
index 29affe7b5cd6..4fac0aad42c5 100644
--- a/include/configs/at91sam9n12ek.h
+++ b/include/configs/at91sam9n12ek.h
@@ -41,13 +41,7 @@
/* USB host */
#ifdef CONFIG_CMD_USB
-#define CONFIG_USB_ATMEL
-#define CONFIG_USB_ATMEL_CLK_SEL_PLLB
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_CPU_INIT
#define CONFIG_SYS_USB_OHCI_REGS_BASE ATMEL_BASE_OHCI
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9n12"
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
#endif
/* SPL */
diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h
index 6857f2e3c4a2..758a91cdaa97 100644
--- a/include/configs/at91sam9x5ek.h
+++ b/include/configs/at91sam9x5ek.h
@@ -41,13 +41,7 @@
/* USB */
#ifdef CONFIG_CMD_USB
#ifndef CONFIG_USB_EHCI_HCD
-#define CONFIG_USB_ATMEL
-#define CONFIG_USB_ATMEL_CLK_SEL_UPLL
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_CPU_INIT
#define CONFIG_SYS_USB_OHCI_REGS_BASE ATMEL_BASE_OHCI
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9x5"
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 3
#endif
#endif
diff --git a/include/configs/axs10x.h b/include/configs/axs10x.h
index 7e25846e401d..3e98ce09c720 100644
--- a/include/configs/axs10x.h
+++ b/include/configs/axs10x.h
@@ -39,8 +39,6 @@
/*
* USB 1.1 configuration
*/
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
/*
* Environment settings
diff --git a/include/configs/bmips_bcm6318.h b/include/configs/bmips_bcm6318.h
index ad7781bd3a27..55c1d439d58b 100644
--- a/include/configs/bmips_bcm6318.h
+++ b/include/configs/bmips_bcm6318.h
@@ -14,13 +14,6 @@
/* RAM */
#define CONFIG_SYS_SDRAM_BASE 0x80000000
-/* USB */
-#define CONFIG_SYS_OHCI_SWAP_REG_ACCESS
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
-#if defined(CONFIG_USB_OHCI_HCD)
-#define CONFIG_USB_OHCI_NEW
-#endif /* CONFIG_USB_OHCI_HCD */
-
/* U-Boot */
#if defined(CONFIG_BMIPS_BOOT_RAM)
diff --git a/include/configs/bmips_bcm63268.h b/include/configs/bmips_bcm63268.h
index 0901f6e88ac4..f046b7e6622f 100644
--- a/include/configs/bmips_bcm63268.h
+++ b/include/configs/bmips_bcm63268.h
@@ -14,13 +14,6 @@
/* RAM */
#define CONFIG_SYS_SDRAM_BASE 0x80000000
-/* USB */
-#define CONFIG_SYS_OHCI_SWAP_REG_ACCESS
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
-#if defined(CONFIG_USB_OHCI_HCD)
-#define CONFIG_USB_OHCI_NEW
-#endif /* CONFIG_USB_OHCI_HCD */
-
/* U-Boot */
#if defined(CONFIG_BMIPS_BOOT_RAM)
diff --git a/include/configs/bmips_bcm6328.h b/include/configs/bmips_bcm6328.h
index 3f45f1f2550f..7e488072edc0 100644
--- a/include/configs/bmips_bcm6328.h
+++ b/include/configs/bmips_bcm6328.h
@@ -14,13 +14,6 @@
/* RAM */
#define CONFIG_SYS_SDRAM_BASE 0x80000000
-/* USB */
-#define CONFIG_SYS_OHCI_SWAP_REG_ACCESS
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
-#if defined(CONFIG_USB_OHCI_HCD)
-#define CONFIG_USB_OHCI_NEW
-#endif /* CONFIG_USB_OHCI_HCD */
-
/* U-Boot */
#if defined(CONFIG_BMIPS_BOOT_RAM)
diff --git a/include/configs/bmips_bcm6348.h b/include/configs/bmips_bcm6348.h
index af1c3673fbb9..f704fe26ca0d 100644
--- a/include/configs/bmips_bcm6348.h
+++ b/include/configs/bmips_bcm6348.h
@@ -14,13 +14,6 @@
/* RAM */
#define CONFIG_SYS_SDRAM_BASE 0x80000000
-/* USB */
-#define CONFIG_SYS_OHCI_SWAP_REG_ACCESS
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
-#if defined(CONFIG_USB_OHCI_HCD)
-#define CONFIG_USB_OHCI_NEW
-#endif /* CONFIG_USB_OHCI_HCD */
-
/* U-Boot */
#if defined(CONFIG_BMIPS_BOOT_RAM)
diff --git a/include/configs/bmips_bcm6358.h b/include/configs/bmips_bcm6358.h
index c15218fc9cb5..9aaa694cad91 100644
--- a/include/configs/bmips_bcm6358.h
+++ b/include/configs/bmips_bcm6358.h
@@ -14,13 +14,6 @@
/* RAM */
#define CONFIG_SYS_SDRAM_BASE 0x80000000
-/* USB */
-#define CONFIG_SYS_OHCI_SWAP_REG_ACCESS
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
-#if defined(CONFIG_USB_OHCI_HCD)
-#define CONFIG_USB_OHCI_NEW
-#endif /* CONFIG_USB_OHCI_HCD */
-
/* U-Boot */
#if defined(CONFIG_BMIPS_BOOT_RAM)
diff --git a/include/configs/bmips_bcm6362.h b/include/configs/bmips_bcm6362.h
index 0c94b2c52543..34e542544cb8 100644
--- a/include/configs/bmips_bcm6362.h
+++ b/include/configs/bmips_bcm6362.h
@@ -14,13 +14,6 @@
/* RAM */
#define CONFIG_SYS_SDRAM_BASE 0x80000000
-/* USB */
-#define CONFIG_SYS_OHCI_SWAP_REG_ACCESS
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
-#if defined(CONFIG_USB_OHCI_HCD)
-#define CONFIG_USB_OHCI_NEW
-#endif /* CONFIG_USB_OHCI_HCD */
-
/* U-Boot */
#if defined(CONFIG_BMIPS_BOOT_RAM)
diff --git a/include/configs/bmips_bcm6368.h b/include/configs/bmips_bcm6368.h
index 6486b7e61107..0319124a0edd 100644
--- a/include/configs/bmips_bcm6368.h
+++ b/include/configs/bmips_bcm6368.h
@@ -14,13 +14,6 @@
/* RAM */
#define CONFIG_SYS_SDRAM_BASE 0x80000000
-/* USB */
-#define CONFIG_SYS_OHCI_SWAP_REG_ACCESS
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
-#if defined(CONFIG_USB_OHCI_HCD)
-#define CONFIG_USB_OHCI_NEW
-#endif /* CONFIG_USB_OHCI_HCD */
-
/* U-Boot */
#if defined(CONFIG_BMIPS_BOOT_RAM)
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index 1f6ac8d28adf..3db97205dab8 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -170,10 +170,6 @@
"console=ttyS2,115200n8\0" \
"hwconfig=dsp:wake=yes"
-/* USB Configs */
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 15
-
#ifdef CONFIG_SPL_BUILD
/* defines for SPL */
diff --git a/include/configs/devkit3250.h b/include/configs/devkit3250.h
index e101d1f60048..328e4958f86a 100644
--- a/include/configs/devkit3250.h
+++ b/include/configs/devkit3250.h
@@ -55,7 +55,6 @@
/*
* USB
*/
-#define CONFIG_USB_OHCI_LPC32XX
#define CONFIG_USB_ISP1301_I2C_ADDR 0x2d
/*
diff --git a/include/configs/ethernut5.h b/include/configs/ethernut5.h
index 2126731ccfc9..529b9837318f 100644
--- a/include/configs/ethernut5.h
+++ b/include/configs/ethernut5.h
@@ -61,13 +61,7 @@
/* USB */
#ifdef CONFIG_CMD_USB
-#define CONFIG_USB_ATMEL
-#define CONFIG_USB_ATMEL_CLK_SEL_PLLB
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_CPU_INIT
#define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00500000
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "host"
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
#endif
/* RTC */
diff --git a/include/configs/evb_rk3399.h b/include/configs/evb_rk3399.h
index 492b7b4df128..b7e850370b31 100644
--- a/include/configs/evb_rk3399.h
+++ b/include/configs/evb_rk3399.h
@@ -15,7 +15,4 @@
#define SDRAM_BANK_SIZE (2UL << 30)
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
-
#endif
diff --git a/include/configs/gru.h b/include/configs/gru.h
index b1084bb21d4d..be2dc79968c0 100644
--- a/include/configs/gru.h
+++ b/include/configs/gru.h
@@ -13,7 +13,4 @@
#include <configs/rk3399_common.h>
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
-
#endif
diff --git a/include/configs/hsdk-4xd.h b/include/configs/hsdk-4xd.h
index 7785bab7147b..03ca9281c829 100644
--- a/include/configs/hsdk-4xd.h
+++ b/include/configs/hsdk-4xd.h
@@ -38,12 +38,6 @@
* Ethernet PHY configuration
*/
-/*
- * USB 1.1 configuration
- */
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
-
/*
* Environment settings
*/
diff --git a/include/configs/hsdk.h b/include/configs/hsdk.h
index 6dd69ca38b42..0b8ac78e2794 100644
--- a/include/configs/hsdk.h
+++ b/include/configs/hsdk.h
@@ -37,12 +37,6 @@
* Ethernet PHY configuration
*/
-/*
- * USB 1.1 configuration
- */
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
-
/*
* Environment settings
*/
diff --git a/include/configs/omapl138_lcdk.h b/include/configs/omapl138_lcdk.h
index a344a46a3e66..c9f5004117f2 100644
--- a/include/configs/omapl138_lcdk.h
+++ b/include/configs/omapl138_lcdk.h
@@ -137,12 +137,6 @@
* U-Boot general configuration
*/
-/*
- * USB Configs
- */
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 15
-
/*
* Linux Information
*/
diff --git a/include/configs/pinebook-pro-rk3399.h b/include/configs/pinebook-pro-rk3399.h
index d478b19917df..241dc39be008 100644
--- a/include/configs/pinebook-pro-rk3399.h
+++ b/include/configs/pinebook-pro-rk3399.h
@@ -16,7 +16,4 @@
#define SDRAM_BANK_SIZE (2UL << 30)
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
-
#endif
diff --git a/include/configs/pm9261.h b/include/configs/pm9261.h
index bc15cdb44602..7374514698f9 100644
--- a/include/configs/pm9261.h
+++ b/include/configs/pm9261.h
@@ -152,13 +152,7 @@
#define CONFIG_SYS_MAX_FLASH_SECT 256
/* USB */
-#define CONFIG_USB_ATMEL
-#define CONFIG_USB_ATMEL_CLK_SEL_PLLB
-#define CONFIG_USB_OHCI_NEW 1
-#define CONFIG_SYS_USB_OHCI_CPU_INIT 1
#define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00500000
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9261"
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
#define CONFIG_EXTRA_ENV_SETTINGS \
"partition=nand0,0\0" \
diff --git a/include/configs/pm9263.h b/include/configs/pm9263.h
index a0eed66b5ff1..7a6d817926c7 100644
--- a/include/configs/pm9263.h
+++ b/include/configs/pm9263.h
@@ -175,13 +175,7 @@
AT91_MATRIX_SCFG_SLOT_CYCLE(255))
/* USB */
-#define CONFIG_USB_ATMEL
-#define CONFIG_USB_ATMEL_CLK_SEL_PLLB
-#define CONFIG_USB_OHCI_NEW 1
-#define CONFIG_SYS_USB_OHCI_CPU_INIT 1
#define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00a00000 /* AT91SAM9263_UHP_BASE */
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9263"
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
#define CONFIG_EXTRA_ENV_SETTINGS \
"partition=nand0,0\0" \
diff --git a/include/configs/rk3128_common.h b/include/configs/rk3128_common.h
index f3e0eefb9a21..d5a4ca26b048 100644
--- a/include/configs/rk3128_common.h
+++ b/include/configs/rk3128_common.h
@@ -19,9 +19,6 @@
#define CONFIG_SYS_SDRAM_BASE 0x60000000
#define SDRAM_MAX_SIZE 0x80000000
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
-
/* usb mass storage */
#define ENV_MEM_LAYOUT_SETTINGS \
diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h
index 90183579202d..165b78ff3309 100644
--- a/include/configs/rk3328_common.h
+++ b/include/configs/rk3328_common.h
@@ -30,8 +30,4 @@
"partitions=" PARTS_DEFAULT \
BOOTENV
-/* rockchip ohci host driver */
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
-
#endif
diff --git a/include/configs/rock960_rk3399.h b/include/configs/rock960_rk3399.h
index 2edad710284f..6099d2fa55a6 100644
--- a/include/configs/rock960_rk3399.h
+++ b/include/configs/rock960_rk3399.h
@@ -14,7 +14,4 @@
#include <configs/rk3399_common.h>
#define SDRAM_BANK_SIZE (2UL << 30)
-
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
#endif
diff --git a/include/configs/rockpro64_rk3399.h b/include/configs/rockpro64_rk3399.h
index 903e9df527c1..9195b9b99e41 100644
--- a/include/configs/rockpro64_rk3399.h
+++ b/include/configs/rockpro64_rk3399.h
@@ -14,7 +14,4 @@
#include <configs/rk3399_common.h>
#define SDRAM_BANK_SIZE (2UL << 30)
-
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
#endif
diff --git a/include/configs/rv1108_common.h b/include/configs/rv1108_common.h
index d8de9c25df2b..83c3167f38dc 100644
--- a/include/configs/rv1108_common.h
+++ b/include/configs/rv1108_common.h
@@ -18,8 +18,6 @@
#define CONFIG_SYS_SDRAM_BASE 0x60000000
/* rockchip ohci host driver */
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
#define ENV_MEM_LAYOUT_SETTINGS \
"scriptaddr=0x60000000\0" \
diff --git a/include/configs/sama5d3_xplained.h b/include/configs/sama5d3_xplained.h
index a10057452fe4..22839d544a50 100644
--- a/include/configs/sama5d3_xplained.h
+++ b/include/configs/sama5d3_xplained.h
@@ -39,13 +39,7 @@
/* USB */
#ifdef CONFIG_CMD_USB
-#define CONFIG_USB_ATMEL
-#define CONFIG_USB_ATMEL_CLK_SEL_UPLL
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_CPU_INIT
#define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00600000
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "SAMA5D3 Xplained"
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
#endif
/* SPL */
diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h
index f61b6e0dabc7..dc89148a0450 100644
--- a/include/configs/sama5d3xek.h
+++ b/include/configs/sama5d3xek.h
@@ -52,12 +52,7 @@
/* USB */
#ifdef CONFIG_CMD_USB
-#define CONFIG_USB_ATMEL_CLK_SEL_UPLL
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_CPU_INIT
#define CONFIG_SYS_USB_OHCI_REGS_BASE ATMEL_BASE_OHCI
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "sama5d3"
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 3
#endif
/* SPL */
diff --git a/include/configs/smartweb.h b/include/configs/smartweb.h
index 215c31bca410..65bc3c672eed 100644
--- a/include/configs/smartweb.h
+++ b/include/configs/smartweb.h
@@ -67,13 +67,7 @@
#define CONFIG_USART_ID ATMEL_ID_SYS
/* USB configuration */
-#define CONFIG_USB_ATMEL
-#define CONFIG_USB_ATMEL_CLK_SEL_PLLB
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_CPU_INIT
#define CONFIG_SYS_USB_OHCI_REGS_BASE ATMEL_UHP_BASE
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9260"
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
/* USB DFU support */
diff --git a/include/configs/snapper9260.h b/include/configs/snapper9260.h
index 6ff21b921687..2b7afb5d25e5 100644
--- a/include/configs/snapper9260.h
+++ b/include/configs/snapper9260.h
@@ -38,13 +38,7 @@
#define CONFIG_SYS_NAND_READY_PIN AT91_PIN_PC13
/* USB */
-#define CONFIG_USB_ATMEL
-#define CONFIG_USB_ATMEL_CLK_SEL_PLLB
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_CPU_INIT
#define CONFIG_SYS_USB_OHCI_REGS_BASE ATMEL_UHP_BASE
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9260"
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
/* GPIOs and IO expander */
#define CONFIG_PCA953X
diff --git a/include/configs/socrates.h b/include/configs/socrates.h
index 6a78cb1f2648..db2826813261 100644
--- a/include/configs/socrates.h
+++ b/include/configs/socrates.h
@@ -223,10 +223,6 @@
/* pass open firmware flat tree */
/* USB support */
-#define CONFIG_USB_OHCI_NEW 1
#define CONFIG_PCI_OHCI 1
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 15
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "ohci_pci"
-#define CONFIG_SYS_OHCI_SWAP_REG_ACCESS 1
#endif /* __CONFIG_H */
diff --git a/include/configs/stih410-b2260.h b/include/configs/stih410-b2260.h
index a425dad69214..1b8d38f4b52a 100644
--- a/include/configs/stih410-b2260.h
+++ b/include/configs/stih410-b2260.h
@@ -43,8 +43,6 @@
/* Extra Commands */
/* USB Configs */
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
/* NET Configs */
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index d52552c5fe76..2bf4e58cddf7 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -120,11 +120,6 @@
/* Ethernet support */
-#ifdef CONFIG_USB_EHCI_HCD
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
-#endif
-
#ifdef CONFIG_ARM64
/*
* Boards seem to come with at least 512MB of DRAM.
diff --git a/include/configs/taurus.h b/include/configs/taurus.h
index 798d72d8e26b..ab2dc3d7146b 100644
--- a/include/configs/taurus.h
+++ b/include/configs/taurus.h
@@ -65,13 +65,7 @@
/* USB */
#if defined(CONFIG_BOARD_TAURUS)
-#define CONFIG_USB_ATMEL
-#define CONFIG_USB_ATMEL_CLK_SEL_PLLB
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_CPU_INIT
#define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00500000
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9260"
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
/* USB DFU support */
diff --git a/include/configs/usb_a9263.h b/include/configs/usb_a9263.h
index e432b04e9f5a..8cb8c609d052 100644
--- a/include/configs/usb_a9263.h
+++ b/include/configs/usb_a9263.h
@@ -45,12 +45,7 @@
/* USB */
#ifdef CONFIG_CMD_USB
-#define CONFIG_USB_ATMEL
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_CPU_INIT
#define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00a00000
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9263"
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
#endif
/* bootstrap + u-boot + env + linux in dataflash on CS0 */
diff --git a/include/configs/vexpress_aemv8.h b/include/configs/vexpress_aemv8.h
index 14b92c095a0d..e864b3fee6ae 100644
--- a/include/configs/vexpress_aemv8.h
+++ b/include/configs/vexpress_aemv8.h
@@ -274,11 +274,6 @@
/* Store environment at top of flash */
#endif
-#ifdef CONFIG_USB_EHCI_HCD
-#define CONFIG_USB_OHCI_NEW
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
-#endif
-
#define CONFIG_SYS_FLASH_EMPTY_INFO /* flinfo indicates empty blocks */
#define FLASH_MAX_SECTOR_SIZE 0x00040000
--
2.25.1
5
29