All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] Convert CONFIG_ENV_MIN_ENTRIES et al to Kconfig
@ 2022-06-13  0:01 Tom Rini
  2022-06-13  0:01 ` [PATCH 2/8] fpga: Remove CONFIG_FPGA_COUNT Tom Rini
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Tom Rini @ 2022-06-13  0:01 UTC (permalink / raw)
  To: u-boot; +Cc: Michal Simek

This converts the following to Kconfig:
   CONFIG_ENV_MIN_ENTRIES
   CONFIG_ENV_MAX_ENTRIES

Cc: Michal Simek <michal.simek@amd.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
I'm not 100% sure that what was being done in xilinx_zynqmp.h was
working before this change.  If we _need_ to tweak this value down in
SPL we need to introduce CONFIG_SPL_ENV_{MIN,MAX}_ENTRIES and use
CONFIG_VAL() in the code.
---
 README                          |  8 --------
 configs/clearfog_defconfig      |  1 +
 configs/helios4_defconfig       |  1 +
 env/Kconfig                     | 16 ++++++++++++++++
 include/configs/clearfog.h      |  2 --
 include/configs/helios4.h       |  2 --
 include/configs/xilinx_zynqmp.h |  5 -----
 lib/hashtable.c                 |  7 -------
 8 files changed, 18 insertions(+), 24 deletions(-)

diff --git a/README b/README
index 841f8ce082c0..7649dae36338 100644
--- a/README
+++ b/README
@@ -1877,14 +1877,6 @@ Configuration Settings:
 		while unprotecting/erasing/programming. Please only enable
 		this option if you really know what you are doing.
 
-- CONFIG_ENV_MAX_ENTRIES
-
-	Maximum number of entries in the hash table that is used
-	internally to store the environment settings. The default
-	setting is supposed to be generous and should work in most
-	cases. This setting can be used to tune behaviour; see
-	lib/hashtable.c for details.
-
 - CONFIG_ENV_FLAGS_LIST_DEFAULT
 - CONFIG_ENV_FLAGS_LIST_STATIC
 	Enable validation of the values given to environment variables when
diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig
index bec36beb8554..1ee0c6637573 100644
--- a/configs/clearfog_defconfig
+++ b/configs/clearfog_defconfig
@@ -50,6 +50,7 @@ CONFIG_CMD_TIME=y
 CONFIG_CMD_MVEBU_BUBT=y
 # CONFIG_SPL_PARTITION_UUIDS is not set
 CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_MIN_ENTRIES=128
 CONFIG_ARP_TIMEOUT=200
 CONFIG_NET_RETRY_COUNT=50
 CONFIG_NET_RANDOM_ETHADDR=y
diff --git a/configs/helios4_defconfig b/configs/helios4_defconfig
index 2a1db65d1bfd..4642eb1ccb25 100644
--- a/configs/helios4_defconfig
+++ b/configs/helios4_defconfig
@@ -51,6 +51,7 @@ CONFIG_CMD_TIME=y
 CONFIG_CMD_MVEBU_BUBT=y
 # CONFIG_SPL_PARTITION_UUIDS is not set
 CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_MIN_ENTRIES=128
 CONFIG_ARP_TIMEOUT=200
 CONFIG_NET_RETRY_COUNT=50
 CONFIG_NET_RANDOM_ETHADDR=y
diff --git a/env/Kconfig b/env/Kconfig
index 2f625b22575a..0aed7aea46bc 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -30,6 +30,22 @@ config ENV_OVERWRITE
 	  Use this to permit overriding of certain environmental variables
 	  like Ethernet and Serial
 
+config ENV_MIN_ENTRIES
+	int "Minimum number of entries in the environment hashtable"
+	default 64
+	help
+	  Minimum number of entries in the hash table that is used internally
+	  to store the environment settings.
+
+config ENV_MAX_ENTRIES
+	int "Maximumm number of entries in the environment hashtable"
+	default 512
+	help
+	  Maximum number of entries in the hash table that is used internally
+	  to store the environment settings. The default setting is supposed to
+	  be generous and should work in most cases. This setting can be used
+	  to tune behaviour; see lib/hashtable.c for details.
+
 config ENV_IS_NOWHERE
 	bool "Environment is not stored"
 	default y if !ENV_IS_IN_EEPROM && !ENV_IS_IN_EXT4 && \
diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h
index af04352eda3b..9969269bf2ac 100644
--- a/include/configs/clearfog.h
+++ b/include/configs/clearfog.h
@@ -18,8 +18,6 @@
  * U-Boot into it.
  */
 
-#define CONFIG_ENV_MIN_ENTRIES		128
-
 /* Environment in MMC */
 /*
  * For SD - reserve 1 LBA for MBR + 1M for u-boot image. The MMC/eMMC
diff --git a/include/configs/helios4.h b/include/configs/helios4.h
index cae20073584c..ff2c50644326 100644
--- a/include/configs/helios4.h
+++ b/include/configs/helios4.h
@@ -18,8 +18,6 @@
  * U-Boot into it.
  */
 
-#define CONFIG_ENV_MIN_ENTRIES		128
-
 /* Environment in MMC */
 /*
  * For SD - reserve 1 LBA for MBR + 1M for u-boot image. The MMC/eMMC
diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
index 20515b4e26ac..4e71a42cd346 100644
--- a/include/configs/xilinx_zynqmp.h
+++ b/include/configs/xilinx_zynqmp.h
@@ -207,11 +207,6 @@
 
 /* ATF is my kernel image */
 
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU)
-# define CONFIG_SPL_HASH
-# define CONFIG_ENV_MAX_ENTRIES	10
-#endif
-
 #ifdef CONFIG_SPL_SYS_MALLOC_SIMPLE
 # error "Disable CONFIG_SPL_SYS_MALLOC_SIMPLE. Full malloc needs to be used"
 #endif
diff --git a/lib/hashtable.c b/lib/hashtable.c
index ff5ff7263949..90c8465611e9 100644
--- a/lib/hashtable.c
+++ b/lib/hashtable.c
@@ -35,13 +35,6 @@
 # include <linux/ctype.h>
 #endif
 
-#ifndef	CONFIG_ENV_MIN_ENTRIES	/* minimum number of entries */
-#define	CONFIG_ENV_MIN_ENTRIES 64
-#endif
-#ifndef	CONFIG_ENV_MAX_ENTRIES	/* maximum number of entries */
-#define	CONFIG_ENV_MAX_ENTRIES 512
-#endif
-
 #define USED_FREE 0
 #define USED_DELETED -1
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/8] fpga: Remove CONFIG_FPGA_COUNT
  2022-06-13  0:01 [PATCH 1/8] Convert CONFIG_ENV_MIN_ENTRIES et al to Kconfig Tom Rini
@ 2022-06-13  0:01 ` Tom Rini
  2022-06-13  0:02 ` [PATCH 3/8] Convert CONFIG_FPGA_STRATIX_V to Kconfig Tom Rini
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2022-06-13  0:01 UTC (permalink / raw)
  To: u-boot

This define is only currently used in a single board, and always set to
one.  Define this within the board code and remove other references.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 README                           | 4 ----
 board/astro/mcf5373l/fpga.c      | 9 +++++----
 include/configs/astro_mcf5373l.h | 1 -
 include/configs/mx53cx9020.h     | 2 --
 include/configs/socfpga_common.h | 7 -------
 5 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/README b/README
index 7649dae36338..6a4db9dc5617 100644
--- a/README
+++ b/README
@@ -1350,10 +1350,6 @@ The following options need to be configured:
 		Enables support for FPGA family.
 		(SPARTAN2, SPARTAN3, VIRTEX2, CYCLONE2, ACEX1K, ACEX)
 
-		CONFIG_FPGA_COUNT
-
-		Specify the number of FPGA devices to support.
-
 		CONFIG_SYS_FPGA_PROG_FEEDBACK
 
 		Enable printing of hash marks during FPGA configuration.
diff --git a/board/astro/mcf5373l/fpga.c b/board/astro/mcf5373l/fpga.c
index ef82f0660703..50a3830b8573 100644
--- a/board/astro/mcf5373l/fpga.c
+++ b/board/astro/mcf5373l/fpga.c
@@ -168,7 +168,8 @@ Altera_CYC2_Passive_Serial_fns altera_fns = {
 	altera_post_fn
 };
 
-Altera_desc altera_fpga[CONFIG_FPGA_COUNT] = {
+#define FPGA_COUNT	1
+Altera_desc altera_fpga[FPGA_COUNT] = {
 	{Altera_CYC2,
 	 passive_serial,
 	 85903,
@@ -182,7 +183,7 @@ int astro5373l_altera_load(void)
 {
 	int i;
 
-	for (i = 0; i < CONFIG_FPGA_COUNT; i++) {
+	for (i = 0; i < FPGA_COUNT; i++) {
 		/*
 		 * I did not yet manage to get relocation work properly,
 		 * so set stuff here instead of static initialisation:
@@ -372,7 +373,7 @@ xilinx_spartan3_slave_serial_fns xilinx_fns = {
 	xilinx_fastwr_config_fn
 };
 
-xilinx_desc xilinx_fpga[CONFIG_FPGA_COUNT] = {
+xilinx_desc xilinx_fpga[FPGA_COUNT] = {
 	{xilinx_spartan3,
 	 slave_serial,
 	 XILINX_XC3S4000_SIZE,
@@ -388,7 +389,7 @@ int astro5373l_xilinx_load(void)
 
 	fpga_init();
 
-	for (i = 0; i < CONFIG_FPGA_COUNT; i++) {
+	for (i = 0; i < FPGA_COUNT; i++) {
 		/*
 		 * I did not yet manage to get relocation work properly,
 		 * so set stuff here instead of static initialisation:
diff --git a/include/configs/astro_mcf5373l.h b/include/configs/astro_mcf5373l.h
index 9bf6968e8ad9..18e06076a4ab 100644
--- a/include/configs/astro_mcf5373l.h
+++ b/include/configs/astro_mcf5373l.h
@@ -133,7 +133,6 @@
  * it needs non-blocking CFI routines.
  */
 
-#define CONFIG_FPGA_COUNT	1
 #define CONFIG_SYS_FPGA_PROG_FEEDBACK
 #define CONFIG_SYS_FPGA_WAIT		1000
 
diff --git a/include/configs/mx53cx9020.h b/include/configs/mx53cx9020.h
index 1e5df3f7d7ad..f1d751f15a24 100644
--- a/include/configs/mx53cx9020.h
+++ b/include/configs/mx53cx9020.h
@@ -16,8 +16,6 @@
 
 #define CONFIG_MXC_UART_BASE UART2_BASE
 
-#define CONFIG_FPGA_COUNT 1
-
 /* MMC Configs */
 #define CONFIG_SYS_FSL_ESDHC_ADDR	0
 #define CONFIG_SYS_FSL_ESDHC_NUM	2
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 6453ab79527d..10ba2d22ffa7 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -58,13 +58,6 @@
 #define CONFIG_DW_ALTDESCRIPTOR
 #endif
 
-/*
- * FPGA Driver
- */
-#ifdef CONFIG_CMD_FPGA
-#define CONFIG_FPGA_COUNT		1
-#endif
-
 /*
  * L4 OSC1 Timer 0
  */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/8] Convert CONFIG_FPGA_STRATIX_V to Kconfig
  2022-06-13  0:01 [PATCH 1/8] Convert CONFIG_ENV_MIN_ENTRIES et al to Kconfig Tom Rini
  2022-06-13  0:01 ` [PATCH 2/8] fpga: Remove CONFIG_FPGA_COUNT Tom Rini
@ 2022-06-13  0:02 ` Tom Rini
  2022-06-13  0:02 ` [PATCH 4/8] usb: Remove non-DM code in ehci-fsl and xhci Tom Rini
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2022-06-13  0:02 UTC (permalink / raw)
  To: u-boot

This converts the following to Kconfig:
   CONFIG_FPGA_STRATIX_V

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 configs/theadorable_debug_defconfig | 1 +
 drivers/fpga/Kconfig                | 6 ++++++
 include/configs/theadorable.h       | 3 ---
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/configs/theadorable_debug_defconfig b/configs/theadorable_debug_defconfig
index 25eb2e88ec17..d47413c0a911 100644
--- a/configs/theadorable_debug_defconfig
+++ b/configs/theadorable_debug_defconfig
@@ -71,6 +71,7 @@ CONFIG_LBA48=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_RAM=y
 CONFIG_FPGA_ALTERA=y
+CONFIG_FPGA_STRATIX_V=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MVTWSI=y
 # CONFIG_MMC is not set
diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig
index dc0b3dd31b7d..76719517f541 100644
--- a/drivers/fpga/Kconfig
+++ b/drivers/fpga/Kconfig
@@ -21,6 +21,12 @@ config FPGA_SOCFPGA
 
 	  This provides common functionality for Gen5 and Arria10 devices.
 
+config FPGA_STRATIX_V
+	bool "Enable Stratix V FPGA drivers"
+	depends on FPGA_ALTERA
+	help
+	  Say Y here to enable the Altera Stratix V FPGA specific driver.
+
 config FPGA_CYCLON2
 	bool "Enable Altera FPGA driver for Cyclone II"
 	depends on FPGA_ALTERA
diff --git a/include/configs/theadorable.h b/include/configs/theadorable.h
index 4f7c9647e292..94e1acd98ba7 100644
--- a/include/configs/theadorable.h
+++ b/include/configs/theadorable.h
@@ -40,9 +40,6 @@
 	"fdt_high=0x10000000\0"		\
 	"initrd_high=0x10000000\0"
 
-/* FPGA programming support */
-#define CONFIG_FPGA_STRATIX_V
-
 /*
  * Bootcounter
  */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/8] usb: Remove non-DM code in ehci-fsl and xhci
  2022-06-13  0:01 [PATCH 1/8] Convert CONFIG_ENV_MIN_ENTRIES et al to Kconfig Tom Rini
  2022-06-13  0:01 ` [PATCH 2/8] fpga: Remove CONFIG_FPGA_COUNT Tom Rini
  2022-06-13  0:02 ` [PATCH 3/8] Convert CONFIG_FPGA_STRATIX_V to Kconfig Tom Rini
@ 2022-06-13  0:02 ` Tom Rini
  2022-06-13  0:02 ` [PATCH 5/8] mx6memcal: Remove SPL_USB_HOST Tom Rini
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2022-06-13  0:02 UTC (permalink / raw)
  To: u-boot

The DM_USB migration deadline has passed and this is not used in SPL.
Remove this now unused code.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 drivers/usb/host/ehci-fsl.c |   4 --
 drivers/usb/host/xhci.c     | 110 ------------------------------------
 2 files changed, 114 deletions(-)

diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 82da339fd505..0569dd54fff9 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -25,10 +25,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifndef CONFIG_USB_MAX_CONTROLLER_COUNT
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
-
 struct ehci_fsl_priv {
 	struct ehci_ctrl ehci;
 	fdt_addr_t hcd_base;
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index ad73ba12e2be..dbeb88afe370 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -37,10 +37,6 @@
 #include <linux/errno.h>
 #include <linux/iopoll.h>
 
-#ifndef CONFIG_USB_MAX_CONTROLLER_COUNT
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
-
 static struct descriptor {
 	struct usb_hub_descriptor hub;
 	struct usb_device_descriptor device;
@@ -115,13 +111,8 @@ static struct descriptor {
 	},
 };
 
-#if !CONFIG_IS_ENABLED(DM_USB)
-static struct xhci_ctrl xhcic[CONFIG_USB_MAX_CONTROLLER_COUNT];
-#endif
-
 struct xhci_ctrl *xhci_get_ctrl(struct usb_device *udev)
 {
-#if CONFIG_IS_ENABLED(DM_USB)
 	struct udevice *dev;
 
 	/* Find the USB controller */
@@ -130,9 +121,6 @@ struct xhci_ctrl *xhci_get_ctrl(struct usb_device *udev)
 	     dev = dev->parent)
 		;
 	return dev_get_priv(dev);
-#else
-	return udev->controller;
-#endif
 }
 
 /**
@@ -752,13 +740,6 @@ static int _xhci_alloc_device(struct usb_device *udev)
 	return 0;
 }
 
-#if !CONFIG_IS_ENABLED(DM_USB)
-int usb_alloc_device(struct usb_device *udev)
-{
-	return _xhci_alloc_device(udev);
-}
-#endif
-
 /*
  * Full speed devices may have a max packet size greater than 8 bytes, but the
  * USB core doesn't know that until it reads the first 8 bytes of the
@@ -1267,95 +1248,6 @@ static int xhci_lowlevel_stop(struct xhci_ctrl *ctrl)
 	return 0;
 }
 
-#if !CONFIG_IS_ENABLED(DM_USB)
-int submit_control_msg(struct usb_device *udev, unsigned long pipe,
-		       void *buffer, int length, struct devrequest *setup)
-{
-	struct usb_device *hop = udev;
-
-	if (hop->parent)
-		while (hop->parent->parent)
-			hop = hop->parent;
-
-	return _xhci_submit_control_msg(udev, pipe, buffer, length, setup,
-					hop->portnr);
-}
-
-int submit_bulk_msg(struct usb_device *udev, unsigned long pipe, void *buffer,
-		    int length)
-{
-	return _xhci_submit_bulk_msg(udev, pipe, buffer, length);
-}
-
-int submit_int_msg(struct usb_device *udev, unsigned long pipe, void *buffer,
-		   int length, int interval, bool nonblock)
-{
-	return _xhci_submit_int_msg(udev, pipe, buffer, length, interval,
-				    nonblock);
-}
-
-/**
- * Intialises the XHCI host controller
- * and allocates the necessary data structures
- *
- * @param index	index to the host controller data structure
- * Return: pointer to the intialised controller
- */
-int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
-{
-	struct xhci_hccr *hccr;
-	struct xhci_hcor *hcor;
-	struct xhci_ctrl *ctrl;
-	int ret;
-
-	*controller = NULL;
-
-	if (xhci_hcd_init(index, &hccr, (struct xhci_hcor **)&hcor) != 0)
-		return -ENODEV;
-
-	if (xhci_reset(hcor) != 0)
-		return -ENODEV;
-
-	ctrl = &xhcic[index];
-
-	ctrl->hccr = hccr;
-	ctrl->hcor = hcor;
-
-	ret = xhci_lowlevel_init(ctrl);
-
-	if (ret) {
-		ctrl->hccr = NULL;
-		ctrl->hcor = NULL;
-	} else {
-		*controller = &xhcic[index];
-	}
-
-	return ret;
-}
-
-/**
- * Stops the XHCI host controller
- * and cleans up all the related data structures
- *
- * @param index	index to the host controller data structure
- * Return: none
- */
-int usb_lowlevel_stop(int index)
-{
-	struct xhci_ctrl *ctrl = (xhcic + index);
-
-	if (ctrl->hcor) {
-		xhci_lowlevel_stop(ctrl);
-		xhci_hcd_stop(index);
-		xhci_cleanup(ctrl);
-	}
-
-	return 0;
-}
-#endif /* CONFIG_IS_ENABLED(DM_USB) */
-
-#if CONFIG_IS_ENABLED(DM_USB)
-
 static int xhci_submit_control_msg(struct udevice *dev, struct usb_device *udev,
 				   unsigned long pipe, void *buffer, int length,
 				   struct devrequest *setup)
@@ -1546,5 +1438,3 @@ struct dm_usb_ops xhci_usb_ops = {
 	.update_hub_device = xhci_update_hub_device,
 	.get_max_xfer_size  = xhci_get_max_xfer_size,
 };
-
-#endif
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/8] mx6memcal: Remove SPL_USB_HOST
  2022-06-13  0:01 [PATCH 1/8] Convert CONFIG_ENV_MIN_ENTRIES et al to Kconfig Tom Rini
                   ` (2 preceding siblings ...)
  2022-06-13  0:02 ` [PATCH 4/8] usb: Remove non-DM code in ehci-fsl and xhci Tom Rini
@ 2022-06-13  0:02 ` Tom Rini
  2022-06-13  3:58   ` Eric Nelson
  2022-06-13  0:02 ` [PATCH 6/8] common: usb: Update logic for usb.o, usb_hub.o and usb_storage.o Tom Rini
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 10+ messages in thread
From: Tom Rini @ 2022-06-13  0:02 UTC (permalink / raw)
  To: u-boot; +Cc: Eric Nelson

As this particular platform is intended to be loaded and run a specific
set of routines in SPL, we do not need the ability to further use the
USB as a host device in SPL.  Disable this support.

Cc: Eric Nelson <eric@nelint.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
Please correct me if I'm wrong here and I'll update the subsequent patch
that lead me to discover this.
---
 configs/mx6memcal_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/configs/mx6memcal_defconfig b/configs/mx6memcal_defconfig
index a1bc95bb4a1c..021e8a6151ee 100644
--- a/configs/mx6memcal_defconfig
+++ b/configs/mx6memcal_defconfig
@@ -16,7 +16,6 @@ CONFIG_SYS_MEMTEST_START=0x10000000
 CONFIG_SYS_MEMTEST_END=0x20000000
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_SYS_SPL_MALLOC=y
-CONFIG_SPL_USB_HOST=y
 CONFIG_SPL_WATCHDOG=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_MAXARGS=32
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/8] common: usb: Update logic for usb.o, usb_hub.o and usb_storage.o
  2022-06-13  0:01 [PATCH 1/8] Convert CONFIG_ENV_MIN_ENTRIES et al to Kconfig Tom Rini
                   ` (3 preceding siblings ...)
  2022-06-13  0:02 ` [PATCH 5/8] mx6memcal: Remove SPL_USB_HOST Tom Rini
@ 2022-06-13  0:02 ` Tom Rini
  2022-06-13  0:02 ` [PATCH 7/8] Convert CONFIG_USB_MAX_CONTROLLER_COUNT to Kconfig Tom Rini
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2022-06-13  0:02 UTC (permalink / raw)
  To: u-boot

Now that we have consistently named symbols to enable USB host or gadget
controller support in SPL or full U-Boot, we do not need to
unconditionally build USB files nor depend on non-SPL symbols to know
when to build these common files.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 common/Makefile | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/common/Makefile b/common/Makefile
index 75c24e324927..2ed8672c3ac1 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -23,10 +23,9 @@ obj-$(CONFIG_MII) += miiphyutil.o
 obj-$(CONFIG_CMD_MII) += miiphyutil.o
 obj-$(CONFIG_PHYLIB) += miiphyutil.o
 
-ifdef CONFIG_USB
-obj-y += usb.o usb_hub.o
+obj-$(CONFIG_USB_HOST) += usb.o usb_hub.o
+obj-$(CONFIG_USB_GADGET) += usb.o usb_hub.o
 obj-$(CONFIG_USB_STORAGE) += usb_storage.o
-endif
 
 # others
 obj-$(CONFIG_CONSOLE_MUX) += iomux.o
@@ -57,13 +56,9 @@ endif
 obj-$(CONFIG_SPL_NET) += miiphyutil.o
 obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o
 
-ifdef CONFIG_SPL_USB_HOST
-obj-y += usb.o
-obj-y += usb_hub.o
+obj-$(CONFIG_SPL_USB_HOST) += usb.o usb_hub.o
 obj-$(CONFIG_SPL_USB_STORAGE) += usb_storage.o
-else
-obj-$(CONFIG_USB_MUSB_HOST) += usb.o
-endif
+obj-$(CONFIG_SPL_MUSB_NEW) += usb.o
 endif # CONFIG_SPL_BUILD
 
 #others
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/8] Convert CONFIG_USB_MAX_CONTROLLER_COUNT to Kconfig
  2022-06-13  0:01 [PATCH 1/8] Convert CONFIG_ENV_MIN_ENTRIES et al to Kconfig Tom Rini
                   ` (4 preceding siblings ...)
  2022-06-13  0:02 ` [PATCH 6/8] common: usb: Update logic for usb.o, usb_hub.o and usb_storage.o Tom Rini
@ 2022-06-13  0:02 ` Tom Rini
  2022-06-13  0:02 ` [PATCH 8/8] Convert CONFIG_SYS_USB_FAT_BOOT_PARTITION " Tom Rini
  2022-06-29 14:11 ` [PATCH 1/8] Convert CONFIG_ENV_MIN_ENTRIES et al " Tom Rini
  7 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2022-06-13  0:02 UTC (permalink / raw)
  To: u-boot

This converts the following to Kconfig:
   CONFIG_USB_MAX_CONTROLLER_COUNT

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 arch/arm/include/asm/arch-ls102xa/config.h   |  1 -
 arch/powerpc/cpu/mpc8xxx/fdt.c               |  4 ----
 arch/powerpc/include/asm/config_mpc85xx.h    | 24 --------------------
 common/usb.c                                 |  4 ----
 configs/P1020RDB-PC_36BIT_NAND_defconfig     |  1 +
 configs/P1020RDB-PC_36BIT_SDCARD_defconfig   |  1 +
 configs/P1020RDB-PC_36BIT_SPIFLASH_defconfig |  1 +
 configs/P1020RDB-PC_36BIT_defconfig          |  1 +
 configs/P1020RDB-PC_NAND_defconfig           |  1 +
 configs/P1020RDB-PC_SDCARD_defconfig         |  1 +
 configs/P1020RDB-PC_SPIFLASH_defconfig       |  1 +
 configs/P1020RDB-PC_defconfig                |  1 +
 configs/P2041RDB_NAND_defconfig              |  1 +
 configs/P2041RDB_SDCARD_defconfig            |  1 +
 configs/P2041RDB_SPIFLASH_defconfig          |  1 +
 configs/P2041RDB_defconfig                   |  1 +
 configs/P3041DS_NAND_defconfig               |  1 +
 configs/P3041DS_SDCARD_defconfig             |  1 +
 configs/P3041DS_SPIFLASH_defconfig           |  1 +
 configs/P3041DS_defconfig                    |  1 +
 configs/P4080DS_SDCARD_defconfig             |  1 +
 configs/P4080DS_SPIFLASH_defconfig           |  1 +
 configs/P4080DS_defconfig                    |  1 +
 configs/P5040DS_NAND_defconfig               |  1 +
 configs/P5040DS_SDCARD_defconfig             |  1 +
 configs/P5040DS_SPIFLASH_defconfig           |  1 +
 configs/P5040DS_defconfig                    |  1 +
 configs/T1024RDB_NAND_defconfig              |  1 +
 configs/T1024RDB_SDCARD_defconfig            |  1 +
 configs/T1024RDB_SPIFLASH_defconfig          |  1 +
 configs/T1024RDB_defconfig                   |  1 +
 configs/T1042D4RDB_NAND_defconfig            |  1 +
 configs/T1042D4RDB_SDCARD_defconfig          |  1 +
 configs/T1042D4RDB_SPIFLASH_defconfig        |  1 +
 configs/T1042D4RDB_defconfig                 |  1 +
 configs/T2080QDS_NAND_defconfig              |  1 +
 configs/T2080QDS_SDCARD_defconfig            |  1 +
 configs/T2080QDS_SECURE_BOOT_defconfig       |  1 +
 configs/T2080QDS_SPIFLASH_defconfig          |  1 +
 configs/T2080QDS_SRIO_PCIE_BOOT_defconfig    |  1 +
 configs/T2080QDS_defconfig                   |  1 +
 configs/T2080RDB_NAND_defconfig              |  1 +
 configs/T2080RDB_SDCARD_defconfig            |  1 +
 configs/T2080RDB_SPIFLASH_defconfig          |  1 +
 configs/T2080RDB_defconfig                   |  1 +
 configs/T2080RDB_revD_NAND_defconfig         |  1 +
 configs/T2080RDB_revD_SDCARD_defconfig       |  1 +
 configs/T2080RDB_revD_SPIFLASH_defconfig     |  1 +
 configs/T2080RDB_revD_defconfig              |  1 +
 configs/T4240RDB_SDCARD_defconfig            |  1 +
 configs/T4240RDB_defconfig                   |  1 +
 configs/apalis_imx6_defconfig                |  1 +
 configs/colibri_imx6_defconfig               |  1 +
 configs/ge_b1x5v2_defconfig                  |  1 +
 configs/imx6dl_mamoj_defconfig               |  1 +
 configs/kontron-sl-mx6ul_defconfig           |  1 +
 configs/lx2160aqds_tfa_SECURE_BOOT_defconfig |  1 +
 configs/lx2160aqds_tfa_defconfig             |  1 +
 configs/lx2160ardb_tfa_SECURE_BOOT_defconfig |  1 +
 configs/lx2160ardb_tfa_defconfig             |  1 +
 configs/lx2160ardb_tfa_stmm_defconfig        |  1 +
 configs/mx6sabreauto_defconfig               |  1 +
 configs/mx6ul_14x14_evk_defconfig            |  1 +
 configs/pico-dwarf-imx6ul_defconfig          |  1 +
 configs/pico-dwarf-imx7d_defconfig           |  1 +
 configs/pico-hobbit-imx6ul_defconfig         |  1 +
 configs/pico-hobbit-imx7d_defconfig          |  1 +
 configs/pico-imx6ul_defconfig                |  1 +
 configs/pico-imx7d_bl33_defconfig            |  1 +
 configs/pico-imx7d_defconfig                 |  1 +
 configs/pico-nymph-imx7d_defconfig           |  1 +
 configs/pico-pi-imx6ul_defconfig             |  1 +
 configs/pico-pi-imx7d_defconfig              |  1 +
 configs/variscite_dart6ul_defconfig          |  1 +
 configs/vining_2000_defconfig                |  1 +
 drivers/usb/common/fsl-dt-fixup.c            |  4 ----
 drivers/usb/host/Kconfig                     |  6 +++++
 drivers/usb/host/ehci-hcd.c                  |  4 ----
 include/configs/apalis_imx6.h                |  1 -
 include/configs/cl-som-imx7.h                |  1 -
 include/configs/cm_fx6.h                     |  1 -
 include/configs/colibri-imx6ull.h            |  1 -
 include/configs/colibri_imx6.h               |  1 -
 include/configs/colibri_imx7.h               |  1 -
 include/configs/colibri_vf.h                 |  1 -
 include/configs/dart_6ul.h                   |  1 -
 include/configs/db-88f6720.h                 |  1 -
 include/configs/db-mv784mp-gp.h              |  1 -
 include/configs/dh_imx6.h                    |  1 -
 include/configs/ge_b1x5v2.h                  |  1 -
 include/configs/imx6_logic.h                 |  1 -
 include/configs/imx6dl-mamoj.h               |  1 -
 include/configs/imx6q-bosch-acc.h            |  1 -
 include/configs/imx8mm-cl-iot-gate.h         |  1 -
 include/configs/kontron-sl-mx6ul.h           |  1 -
 include/configs/kontron-sl-mx8mm.h           |  1 -
 include/configs/kp_imx6q_tpc.h               |  1 -
 include/configs/liteboard.h                  |  1 -
 include/configs/ls1021atsn.h                 |  1 -
 include/configs/lx2160a_common.h             |  5 ----
 include/configs/lx2162aqds.h                 |  2 --
 include/configs/mvebu_armada-37xx.h          |  2 --
 include/configs/mvebu_armada-8k.h            |  2 --
 include/configs/mx23_olinuxino.h             |  3 ---
 include/configs/mx23evk.h                    |  3 ---
 include/configs/mx28evk.h                    |  3 ---
 include/configs/mx6sabreauto.h               |  1 -
 include/configs/mx6sabresd.h                 |  1 -
 include/configs/mx6slevk.h                   |  1 -
 include/configs/mx6sxsabreauto.h             |  1 -
 include/configs/mx6sxsabresd.h               |  1 -
 include/configs/mx6ul_14x14_evk.h            |  1 -
 include/configs/mys_6ulx.h                   |  1 -
 include/configs/nitrogen6x.h                 |  1 -
 include/configs/novena.h                     |  1 -
 include/configs/npi_imx6ull.h                |  1 -
 include/configs/opos6uldev.h                 |  1 -
 include/configs/p1_p2_rdb_pc.h               |  4 ----
 include/configs/pcl063.h                     |  1 -
 include/configs/pcl063_ull.h                 |  1 -
 include/configs/pico-imx6ul.h                |  1 -
 include/configs/pico-imx7d.h                 |  1 -
 include/configs/poplar.h                     |  1 -
 include/configs/somlabs_visionsom_6ull.h     |  1 -
 include/configs/theadorable.h                |  1 -
 include/configs/tqma6.h                      |  1 -
 include/configs/turris_mox.h                 |  2 --
 include/configs/verdin-imx8mm.h              |  1 -
 include/configs/vining_2000.h                |  1 -
 include/configs/warp.h                       |  1 -
 include/configs/xpress.h                     |  1 -
 scripts/config_whitelist.txt                 |  1 -
 132 files changed, 77 insertions(+), 112 deletions(-)

diff --git a/arch/arm/include/asm/arch-ls102xa/config.h b/arch/arm/include/asm/arch-ls102xa/config.h
index 2f3409e3e876..aa790ab54c31 100644
--- a/arch/arm/include/asm/arch-ls102xa/config.h
+++ b/arch/arm/include/asm/arch-ls102xa/config.h
@@ -95,7 +95,6 @@
 #define DCU_LAYER_MAX_NUM			16
 
 #ifdef CONFIG_ARCH_LS1021A
-#define CONFIG_USB_MAX_CONTROLLER_COUNT		1
 #define CONFIG_SYS_FSL_MAX_NUM_OF_SEC		1
 #else
 #error SoC not defined
diff --git a/arch/powerpc/cpu/mpc8xxx/fdt.c b/arch/powerpc/cpu/mpc8xxx/fdt.c
index 67f8b1000183..871554a7f481 100644
--- a/arch/powerpc/cpu/mpc8xxx/fdt.c
+++ b/arch/powerpc/cpu/mpc8xxx/fdt.c
@@ -17,10 +17,6 @@
 #include <phy.h>
 #include <hwconfig.h>
 
-#ifndef CONFIG_USB_MAX_CONTROLLER_COUNT
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
-#endif
-
 #if defined(CONFIG_MP) && (defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx))
 static int ft_del_cpuhandle(void *blob, int cpuhandle)
 {
diff --git a/arch/powerpc/include/asm/config_mpc85xx.h b/arch/powerpc/include/asm/config_mpc85xx.h
index 47bfcc72444c..06f66d02de2b 100644
--- a/arch/powerpc/include/asm/config_mpc85xx.h
+++ b/arch/powerpc/include/asm/config_mpc85xx.h
@@ -31,7 +31,6 @@
 #elif defined(CONFIG_ARCH_P1010)
 #define CONFIG_FSL_SDHC_V2_3
 #define CONFIG_TSECV2
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
 #define CONFIG_SYS_FSL_IFC_BANK_COUNT	4
 #define CONFIG_SYS_FSL_PCIE_COMPAT	"fsl,qoriq-pcie-v2.2"
 #define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY
@@ -41,25 +40,19 @@
 /* P1011 is single core version of P1020 */
 #elif defined(CONFIG_ARCH_P1011)
 #define CONFIG_TSECV2
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 
 #elif defined(CONFIG_ARCH_P1020)
 #define CONFIG_TSECV2
-#ifndef CONFIG_USB_MAX_CONTROLLER_COUNT
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
-#endif
 
 #elif defined(CONFIG_ARCH_P1021)
 #define CONFIG_TSECV2
 #define QE_MURAM_SIZE			0x6000UL
 #define MAX_QE_RISC			1
 #define QE_NUM_OF_SNUM			28
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
 
 #elif defined(CONFIG_ARCH_P1023)
 #define CONFIG_SYS_NUM_FMAN		1
 #define CONFIG_SYS_NUM_FM1_DTSEC	2
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
 #define CONFIG_SYS_QMAN_NUM_PORTALS	3
 #define CONFIG_SYS_BMAN_NUM_PORTALS	3
 #define CONFIG_SYS_FM_MURAM_SIZE	0x10000
@@ -68,11 +61,9 @@
 /* P1024 is lower end variant of P1020 */
 #elif defined(CONFIG_ARCH_P1024)
 #define CONFIG_TSECV2
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 
 /* P1025 is lower end variant of P1021 */
 #elif defined(CONFIG_ARCH_P1025)
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
 #define CONFIG_TSECV2
 #define QE_MURAM_SIZE			0x6000UL
 #define MAX_QE_RISC			1
@@ -84,7 +75,6 @@
 #define CONFIG_SYS_FSL_SRIO_IB_WIN_NUM	5
 #define CONFIG_SYS_FSL_RMU
 #define CONFIG_SYS_FSL_SRIO_MSG_UNIT_NUM	2
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
 
 #elif defined(CONFIG_ARCH_P2041) /* also supports P2040 */
 #define CONFIG_FSL_CORENET		/* Freescale CoreNet platform */
@@ -92,9 +82,6 @@
 #define CONFIG_SYS_NUM_FMAN		1
 #define CONFIG_SYS_NUM_FM1_DTSEC	5
 #define CONFIG_SYS_NUM_FM1_10GEC	1
-#ifndef CONFIG_USB_MAX_CONTROLLER_COUNT
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
-#endif
 #define CONFIG_SYS_FM_MURAM_SIZE	0x28000
 #define CONFIG_SYS_FSL_TBCLK_DIV	32
 #define CONFIG_SYS_FSL_PCIE_COMPAT	"fsl,qoriq-pcie-v2.2"
@@ -118,7 +105,6 @@
 #define CONFIG_SYS_FSL_USB1_PHY_ENABLE
 #define CONFIG_SYS_FSL_USB2_PHY_ENABLE
 #define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 #define CONFIG_SYS_FSL_SRIO_MAX_PORTS	2
 #define CONFIG_SYS_FSL_SRIO_OB_WIN_NUM	9
 #define CONFIG_SYS_FSL_SRIO_IB_WIN_NUM	5
@@ -132,7 +118,6 @@
 #define CONFIG_SYS_NUM_FM2_DTSEC	4
 #define CONFIG_SYS_NUM_FM1_10GEC	1
 #define CONFIG_SYS_NUM_FM2_10GEC	1
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 #define CONFIG_SYS_FM_MURAM_SIZE	0x28000
 #define CONFIG_SYS_FSL_TBCLK_DIV	16
 #define CONFIG_SYS_FSL_PCIE_COMPAT	"fsl,p4080-pcie"
@@ -151,7 +136,6 @@
 #define CONFIG_SYS_NUM_FM1_10GEC	1
 #define CONFIG_SYS_NUM_FM2_DTSEC	5
 #define CONFIG_SYS_NUM_FM2_10GEC	1
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 #define CONFIG_SYS_FM_MURAM_SIZE	0x28000
 #define CONFIG_SYS_FSL_TBCLK_DIV	16
 #define CONFIG_SYS_FSL_PCIE_COMPAT	"fsl,qoriq-pcie-v2.4"
@@ -163,7 +147,6 @@
 #elif defined(CONFIG_ARCH_BSC9131)
 #define CONFIG_FSL_SDHC_V2_3
 #define CONFIG_TSECV2
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
 #define CONFIG_SYS_FSL_DSP_M2_RAM_ADDR	0xb0000000
 #define CONFIG_SYS_FSL_DSP_CCSRBAR_DEFAULT	0xff600000
 #define CONFIG_SYS_FSL_IFC_BANK_COUNT	3
@@ -172,7 +155,6 @@
 #elif defined(CONFIG_ARCH_BSC9132)
 #define CONFIG_FSL_SDHC_V2_3
 #define CONFIG_TSECV2
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
 #define CONFIG_SYS_FSL_DSP_DDR_ADDR	0x40000000
 #define CONFIG_SYS_FSL_DSP_M2_RAM_ADDR	0xb0000000
 #define CONFIG_SYS_FSL_DSP_M3_RAM_ADDR	0xc0000000
@@ -204,7 +186,6 @@
 #define CONFIG_SYS_FSL_SRDS_3
 #define CONFIG_SYS_FSL_SRDS_4
 #define CONFIG_SYS_NUM_FMAN		2
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 #define CONFIG_SYS_PME_CLK		0
 #define CONFIG_SYS_FSL_IFC_BANK_COUNT	8
 #define CONFIG_SYS_FMAN_V3
@@ -234,7 +215,6 @@
 #define CONFIG_SYS_CPRI
 #define CONFIG_SYS_FSL_NUM_CC_PLLS	5
 #define CONFIG_SYS_NUM_FMAN		1
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
 #define CONFIG_SYS_FM1_CLK		0
 #define CONFIG_SYS_CPRI_CLK		3
 #define CONFIG_SYS_ULB_CLK		4
@@ -255,7 +235,6 @@
 #define CONFIG_SYS_FSL_CLUSTER_CLOCKS	{ 1, 4, 4, 4 }
 #define CONFIG_SYS_NUM_FM1_DTSEC	6
 #define CONFIG_SYS_NUM_FM1_10GEC	2
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
 #define CONFIG_SYS_FSL_SRIO_MAX_PORTS	2
 #define CONFIG_SYS_FSL_SRIO_OB_WIN_NUM	9
 #define CONFIG_SYS_FSL_SRIO_IB_WIN_NUM	5
@@ -278,7 +257,6 @@
 #define CONFIG_SYS_FSL_SRDS_1
 #define CONFIG_SYS_NUM_FMAN		1
 #define CONFIG_SYS_NUM_FM1_DTSEC	5
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 #define CONFIG_PME_PLAT_CLK_DIV		2
 #define CONFIG_SYS_PME_CLK		CONFIG_PME_PLAT_CLK_DIV
 #define CONFIG_SYS_FSL_IFC_BANK_COUNT	8
@@ -309,7 +287,6 @@
 #define CONFIG_SYS_NUM_FM1_DTSEC	4
 #define CONFIG_SYS_NUM_FM1_10GEC	1
 #define CONFIG_FSL_FM_10GEC_REGULAR_NOTATION
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 #define CONFIG_SYS_FSL_IFC_BANK_COUNT	8
 #define CONFIG_SYS_FM1_CLK		0
 #define CONFIG_QBMAN_CLK_DIV		1
@@ -343,7 +320,6 @@
 #define CONFIG_SYS_FSL_SRIO_OB_WIN_NUM	9
 #define CONFIG_SYS_FSL_SRIO_IB_WIN_NUM	5
 #endif
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 #define CONFIG_PME_PLAT_CLK_DIV		1
 #define CONFIG_SYS_PME_CLK		CONFIG_PME_PLAT_CLK_DIV
 #define CONFIG_SYS_FM1_CLK		0
diff --git a/common/usb.c b/common/usb.c
index aad13fd9c557..6fcf1e8428e9 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -49,10 +49,6 @@ char usb_started; /* flag for the started/stopped USB status */
 static struct usb_device usb_dev[USB_MAX_DEVICE];
 static int dev_index;
 
-#ifndef CONFIG_USB_MAX_CONTROLLER_COUNT
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
-
 /***************************************************************************
  * Init USB Device
  */
diff --git a/configs/P1020RDB-PC_36BIT_NAND_defconfig b/configs/P1020RDB-PC_36BIT_NAND_defconfig
index 96a79927b535..d8902bc03ffb 100644
--- a/configs/P1020RDB-PC_36BIT_NAND_defconfig
+++ b/configs/P1020RDB-PC_36BIT_NAND_defconfig
@@ -138,5 +138,6 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
diff --git a/configs/P1020RDB-PC_36BIT_SDCARD_defconfig b/configs/P1020RDB-PC_36BIT_SDCARD_defconfig
index 036482b53f7a..95720881f35f 100644
--- a/configs/P1020RDB-PC_36BIT_SDCARD_defconfig
+++ b/configs/P1020RDB-PC_36BIT_SDCARD_defconfig
@@ -120,5 +120,6 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
diff --git a/configs/P1020RDB-PC_36BIT_SPIFLASH_defconfig b/configs/P1020RDB-PC_36BIT_SPIFLASH_defconfig
index a4936777ad0b..cc0b44d9e77f 100644
--- a/configs/P1020RDB-PC_36BIT_SPIFLASH_defconfig
+++ b/configs/P1020RDB-PC_36BIT_SPIFLASH_defconfig
@@ -123,5 +123,6 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
diff --git a/configs/P1020RDB-PC_36BIT_defconfig b/configs/P1020RDB-PC_36BIT_defconfig
index 89b34e6585cd..27e23447393f 100644
--- a/configs/P1020RDB-PC_36BIT_defconfig
+++ b/configs/P1020RDB-PC_36BIT_defconfig
@@ -100,5 +100,6 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
diff --git a/configs/P1020RDB-PC_NAND_defconfig b/configs/P1020RDB-PC_NAND_defconfig
index 27a8653c4ec9..c581b9ddbe6c 100644
--- a/configs/P1020RDB-PC_NAND_defconfig
+++ b/configs/P1020RDB-PC_NAND_defconfig
@@ -137,4 +137,5 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
diff --git a/configs/P1020RDB-PC_SDCARD_defconfig b/configs/P1020RDB-PC_SDCARD_defconfig
index 238e450f2e5a..970ec83a81d2 100644
--- a/configs/P1020RDB-PC_SDCARD_defconfig
+++ b/configs/P1020RDB-PC_SDCARD_defconfig
@@ -119,4 +119,5 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
diff --git a/configs/P1020RDB-PC_SPIFLASH_defconfig b/configs/P1020RDB-PC_SPIFLASH_defconfig
index 92f8209f024b..199d7ba87756 100644
--- a/configs/P1020RDB-PC_SPIFLASH_defconfig
+++ b/configs/P1020RDB-PC_SPIFLASH_defconfig
@@ -122,4 +122,5 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
diff --git a/configs/P1020RDB-PC_defconfig b/configs/P1020RDB-PC_defconfig
index 78f186bdca8b..f7d693fa66b3 100644
--- a/configs/P1020RDB-PC_defconfig
+++ b/configs/P1020RDB-PC_defconfig
@@ -99,4 +99,5 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
diff --git a/configs/P2041RDB_NAND_defconfig b/configs/P2041RDB_NAND_defconfig
index fac2bef7e6af..193e47174782 100644
--- a/configs/P2041RDB_NAND_defconfig
+++ b/configs/P2041RDB_NAND_defconfig
@@ -92,6 +92,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/P2041RDB_SDCARD_defconfig b/configs/P2041RDB_SDCARD_defconfig
index 5516850bb3c2..4a97e85d11ba 100644
--- a/configs/P2041RDB_SDCARD_defconfig
+++ b/configs/P2041RDB_SDCARD_defconfig
@@ -87,6 +87,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/P2041RDB_SPIFLASH_defconfig b/configs/P2041RDB_SPIFLASH_defconfig
index a42d21093c43..3a19e4d09d25 100644
--- a/configs/P2041RDB_SPIFLASH_defconfig
+++ b/configs/P2041RDB_SPIFLASH_defconfig
@@ -89,6 +89,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/P2041RDB_defconfig b/configs/P2041RDB_defconfig
index 8265602bcc7a..5dddbda5c962 100644
--- a/configs/P2041RDB_defconfig
+++ b/configs/P2041RDB_defconfig
@@ -84,6 +84,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/P3041DS_NAND_defconfig b/configs/P3041DS_NAND_defconfig
index 0c07556ef242..d9bc80328b87 100644
--- a/configs/P3041DS_NAND_defconfig
+++ b/configs/P3041DS_NAND_defconfig
@@ -95,6 +95,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/P3041DS_SDCARD_defconfig b/configs/P3041DS_SDCARD_defconfig
index 2c5e5da15fb2..e0e65eef68a1 100644
--- a/configs/P3041DS_SDCARD_defconfig
+++ b/configs/P3041DS_SDCARD_defconfig
@@ -90,6 +90,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/P3041DS_SPIFLASH_defconfig b/configs/P3041DS_SPIFLASH_defconfig
index b8a1d6790998..761a9021b8cc 100644
--- a/configs/P3041DS_SPIFLASH_defconfig
+++ b/configs/P3041DS_SPIFLASH_defconfig
@@ -92,6 +92,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/P3041DS_defconfig b/configs/P3041DS_defconfig
index bce873a0bcc2..6798c1dde481 100644
--- a/configs/P3041DS_defconfig
+++ b/configs/P3041DS_defconfig
@@ -87,6 +87,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/P4080DS_SDCARD_defconfig b/configs/P4080DS_SDCARD_defconfig
index b4917b9a032f..dde3351aa208 100644
--- a/configs/P4080DS_SDCARD_defconfig
+++ b/configs/P4080DS_SDCARD_defconfig
@@ -88,6 +88,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/P4080DS_SPIFLASH_defconfig b/configs/P4080DS_SPIFLASH_defconfig
index 79a3b95eda43..1db447178c3d 100644
--- a/configs/P4080DS_SPIFLASH_defconfig
+++ b/configs/P4080DS_SPIFLASH_defconfig
@@ -90,6 +90,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/P4080DS_defconfig b/configs/P4080DS_defconfig
index d1de95152231..9eb49bf2f23b 100644
--- a/configs/P4080DS_defconfig
+++ b/configs/P4080DS_defconfig
@@ -85,6 +85,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/P5040DS_NAND_defconfig b/configs/P5040DS_NAND_defconfig
index ac4bb3b19b44..75b9c9674816 100644
--- a/configs/P5040DS_NAND_defconfig
+++ b/configs/P5040DS_NAND_defconfig
@@ -96,6 +96,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/P5040DS_SDCARD_defconfig b/configs/P5040DS_SDCARD_defconfig
index 06214ca5c35f..015feac4e7f3 100644
--- a/configs/P5040DS_SDCARD_defconfig
+++ b/configs/P5040DS_SDCARD_defconfig
@@ -90,6 +90,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/P5040DS_SPIFLASH_defconfig b/configs/P5040DS_SPIFLASH_defconfig
index 0c9d564a12c3..7aa076926622 100644
--- a/configs/P5040DS_SPIFLASH_defconfig
+++ b/configs/P5040DS_SPIFLASH_defconfig
@@ -92,6 +92,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/P5040DS_defconfig b/configs/P5040DS_defconfig
index 7e543872a16c..8d5f1076e217 100644
--- a/configs/P5040DS_defconfig
+++ b/configs/P5040DS_defconfig
@@ -87,6 +87,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T1024RDB_NAND_defconfig b/configs/T1024RDB_NAND_defconfig
index c33db8330075..45e82eb33bc9 100644
--- a/configs/T1024RDB_NAND_defconfig
+++ b/configs/T1024RDB_NAND_defconfig
@@ -124,6 +124,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T1024RDB_SDCARD_defconfig b/configs/T1024RDB_SDCARD_defconfig
index 8796db6b635e..f0af5c761bf2 100644
--- a/configs/T1024RDB_SDCARD_defconfig
+++ b/configs/T1024RDB_SDCARD_defconfig
@@ -118,6 +118,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T1024RDB_SPIFLASH_defconfig b/configs/T1024RDB_SPIFLASH_defconfig
index 63b655917712..9095d36cd3d5 100644
--- a/configs/T1024RDB_SPIFLASH_defconfig
+++ b/configs/T1024RDB_SPIFLASH_defconfig
@@ -121,6 +121,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T1024RDB_defconfig b/configs/T1024RDB_defconfig
index 0f7e062380fa..a88b6a323433 100644
--- a/configs/T1024RDB_defconfig
+++ b/configs/T1024RDB_defconfig
@@ -93,6 +93,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T1042D4RDB_NAND_defconfig b/configs/T1042D4RDB_NAND_defconfig
index 6254c8f4e154..585581030b20 100644
--- a/configs/T1042D4RDB_NAND_defconfig
+++ b/configs/T1042D4RDB_NAND_defconfig
@@ -122,6 +122,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T1042D4RDB_SDCARD_defconfig b/configs/T1042D4RDB_SDCARD_defconfig
index eb756c8adbe7..1f3835c200f2 100644
--- a/configs/T1042D4RDB_SDCARD_defconfig
+++ b/configs/T1042D4RDB_SDCARD_defconfig
@@ -116,6 +116,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T1042D4RDB_SPIFLASH_defconfig b/configs/T1042D4RDB_SPIFLASH_defconfig
index b5ce93e715a0..d1bee97c3fdb 100644
--- a/configs/T1042D4RDB_SPIFLASH_defconfig
+++ b/configs/T1042D4RDB_SPIFLASH_defconfig
@@ -119,6 +119,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T1042D4RDB_defconfig b/configs/T1042D4RDB_defconfig
index f05e66e0d374..ae2f00587e64 100644
--- a/configs/T1042D4RDB_defconfig
+++ b/configs/T1042D4RDB_defconfig
@@ -91,6 +91,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T2080QDS_NAND_defconfig b/configs/T2080QDS_NAND_defconfig
index 417f7ea83dda..1e0e2a4e73c4 100644
--- a/configs/T2080QDS_NAND_defconfig
+++ b/configs/T2080QDS_NAND_defconfig
@@ -128,6 +128,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T2080QDS_SDCARD_defconfig b/configs/T2080QDS_SDCARD_defconfig
index 6da6a173bd95..bfb973a829ae 100644
--- a/configs/T2080QDS_SDCARD_defconfig
+++ b/configs/T2080QDS_SDCARD_defconfig
@@ -122,6 +122,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T2080QDS_SECURE_BOOT_defconfig b/configs/T2080QDS_SECURE_BOOT_defconfig
index 4a4c6cde5cae..8c2714ed36f6 100644
--- a/configs/T2080QDS_SECURE_BOOT_defconfig
+++ b/configs/T2080QDS_SECURE_BOOT_defconfig
@@ -95,6 +95,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T2080QDS_SPIFLASH_defconfig b/configs/T2080QDS_SPIFLASH_defconfig
index 36f6761f8715..d2801b541c33 100644
--- a/configs/T2080QDS_SPIFLASH_defconfig
+++ b/configs/T2080QDS_SPIFLASH_defconfig
@@ -125,6 +125,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T2080QDS_SRIO_PCIE_BOOT_defconfig b/configs/T2080QDS_SRIO_PCIE_BOOT_defconfig
index b5e0a539becd..362d9fd6f56e 100644
--- a/configs/T2080QDS_SRIO_PCIE_BOOT_defconfig
+++ b/configs/T2080QDS_SRIO_PCIE_BOOT_defconfig
@@ -88,6 +88,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T2080QDS_defconfig b/configs/T2080QDS_defconfig
index 1c14aedae2c2..e2b3ee11752d 100644
--- a/configs/T2080QDS_defconfig
+++ b/configs/T2080QDS_defconfig
@@ -97,6 +97,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T2080RDB_NAND_defconfig b/configs/T2080RDB_NAND_defconfig
index d0542b65de41..2c0f32fe4172 100644
--- a/configs/T2080RDB_NAND_defconfig
+++ b/configs/T2080RDB_NAND_defconfig
@@ -131,6 +131,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T2080RDB_SDCARD_defconfig b/configs/T2080RDB_SDCARD_defconfig
index a3007cb4d138..5e8ada86b1bf 100644
--- a/configs/T2080RDB_SDCARD_defconfig
+++ b/configs/T2080RDB_SDCARD_defconfig
@@ -125,6 +125,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T2080RDB_SPIFLASH_defconfig b/configs/T2080RDB_SPIFLASH_defconfig
index b3973e151d77..e21d6cfb096b 100644
--- a/configs/T2080RDB_SPIFLASH_defconfig
+++ b/configs/T2080RDB_SPIFLASH_defconfig
@@ -128,6 +128,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T2080RDB_defconfig b/configs/T2080RDB_defconfig
index 18d9d547372d..0e001e2038c5 100644
--- a/configs/T2080RDB_defconfig
+++ b/configs/T2080RDB_defconfig
@@ -99,6 +99,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T2080RDB_revD_NAND_defconfig b/configs/T2080RDB_revD_NAND_defconfig
index 2bc8f56b302d..0bd75e3917f8 100644
--- a/configs/T2080RDB_revD_NAND_defconfig
+++ b/configs/T2080RDB_revD_NAND_defconfig
@@ -133,6 +133,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T2080RDB_revD_SDCARD_defconfig b/configs/T2080RDB_revD_SDCARD_defconfig
index 97460205cb95..b54a9d5572af 100644
--- a/configs/T2080RDB_revD_SDCARD_defconfig
+++ b/configs/T2080RDB_revD_SDCARD_defconfig
@@ -127,6 +127,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T2080RDB_revD_SPIFLASH_defconfig b/configs/T2080RDB_revD_SPIFLASH_defconfig
index ba836be355dd..0235318e4939 100644
--- a/configs/T2080RDB_revD_SPIFLASH_defconfig
+++ b/configs/T2080RDB_revD_SPIFLASH_defconfig
@@ -130,6 +130,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T2080RDB_revD_defconfig b/configs/T2080RDB_revD_defconfig
index c300b82ea8d8..ef87c2ebafa2 100644
--- a/configs/T2080RDB_revD_defconfig
+++ b/configs/T2080RDB_revD_defconfig
@@ -101,6 +101,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T4240RDB_SDCARD_defconfig b/configs/T4240RDB_SDCARD_defconfig
index 63fb7145c9aa..f4580eeb06a1 100644
--- a/configs/T4240RDB_SDCARD_defconfig
+++ b/configs/T4240RDB_SDCARD_defconfig
@@ -112,6 +112,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/T4240RDB_defconfig b/configs/T4240RDB_defconfig
index 67061d03d564..01236eddcd2d 100644
--- a/configs/T4240RDB_defconfig
+++ b/configs/T4240RDB_defconfig
@@ -87,6 +87,7 @@ CONFIG_DM_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_ADDR_MAP=y
 CONFIG_SYS_NUM_ADDR_MAP=64
diff --git a/configs/apalis_imx6_defconfig b/configs/apalis_imx6_defconfig
index 62891557040a..f9721796dbf9 100644
--- a/configs/apalis_imx6_defconfig
+++ b/configs/apalis_imx6_defconfig
@@ -105,6 +105,7 @@ CONFIG_DM_SCSI=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_KEYBOARD=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_GADGET=y
diff --git a/configs/colibri_imx6_defconfig b/configs/colibri_imx6_defconfig
index 44e2ff094099..0bdd088b1e7e 100644
--- a/configs/colibri_imx6_defconfig
+++ b/configs/colibri_imx6_defconfig
@@ -102,6 +102,7 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_KEYBOARD=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_GADGET=y
diff --git a/configs/ge_b1x5v2_defconfig b/configs/ge_b1x5v2_defconfig
index ff14bd625a60..c282990aa458 100644
--- a/configs/ge_b1x5v2_defconfig
+++ b/configs/ge_b1x5v2_defconfig
@@ -123,6 +123,7 @@ CONFIG_POWEROFF_GPIO=y
 CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_USB_GADGET=y
diff --git a/configs/imx6dl_mamoj_defconfig b/configs/imx6dl_mamoj_defconfig
index 866921747127..067498d80e32 100644
--- a/configs/imx6dl_mamoj_defconfig
+++ b/configs/imx6dl_mamoj_defconfig
@@ -63,6 +63,7 @@ CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
 # CONFIG_SPL_DM_USB is not set
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
diff --git a/configs/kontron-sl-mx6ul_defconfig b/configs/kontron-sl-mx6ul_defconfig
index efa7a06886a9..f9cebf9e9c96 100644
--- a/configs/kontron-sl-mx6ul_defconfig
+++ b/configs/kontron-sl-mx6ul_defconfig
@@ -92,6 +92,7 @@ CONFIG_FSL_QSPI=y
 CONFIG_MXC_SPI=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
diff --git a/configs/lx2160aqds_tfa_SECURE_BOOT_defconfig b/configs/lx2160aqds_tfa_SECURE_BOOT_defconfig
index 2e7a6f0393c4..7fe1243795fd 100644
--- a/configs/lx2160aqds_tfa_SECURE_BOOT_defconfig
+++ b/configs/lx2160aqds_tfa_SECURE_BOOT_defconfig
@@ -105,6 +105,7 @@ CONFIG_NXP_FSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
diff --git a/configs/lx2160aqds_tfa_defconfig b/configs/lx2160aqds_tfa_defconfig
index e8ae5af0ade5..b6441a3abde9 100644
--- a/configs/lx2160aqds_tfa_defconfig
+++ b/configs/lx2160aqds_tfa_defconfig
@@ -112,6 +112,7 @@ CONFIG_NXP_FSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_WDT=y
 CONFIG_WDT_SBSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
diff --git a/configs/lx2160ardb_tfa_SECURE_BOOT_defconfig b/configs/lx2160ardb_tfa_SECURE_BOOT_defconfig
index 6930823e308c..e6b1d3029bc3 100644
--- a/configs/lx2160ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/lx2160ardb_tfa_SECURE_BOOT_defconfig
@@ -96,6 +96,7 @@ CONFIG_NXP_FSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
diff --git a/configs/lx2160ardb_tfa_defconfig b/configs/lx2160ardb_tfa_defconfig
index d3cfb1fea529..3040382e3597 100644
--- a/configs/lx2160ardb_tfa_defconfig
+++ b/configs/lx2160ardb_tfa_defconfig
@@ -107,6 +107,7 @@ CONFIG_OPTEE=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_WDT=y
 CONFIG_WDT_SBSA=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
diff --git a/configs/lx2160ardb_tfa_stmm_defconfig b/configs/lx2160ardb_tfa_stmm_defconfig
index 5589c48beffc..efc0f91650ec 100644
--- a/configs/lx2160ardb_tfa_stmm_defconfig
+++ b/configs/lx2160ardb_tfa_stmm_defconfig
@@ -107,5 +107,6 @@ CONFIG_OPTEE=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_EFI_MM_COMM_TEE=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig
index 900fbf7ca711..d9d429b4f962 100644
--- a/configs/mx6sabreauto_defconfig
+++ b/configs/mx6sabreauto_defconfig
@@ -103,6 +103,7 @@ CONFIG_DM_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
diff --git a/configs/mx6ul_14x14_evk_defconfig b/configs/mx6ul_14x14_evk_defconfig
index 10f6b4f099a0..784a5d97f086 100644
--- a/configs/mx6ul_14x14_evk_defconfig
+++ b/configs/mx6ul_14x14_evk_defconfig
@@ -93,6 +93,7 @@ CONFIG_FSL_QSPI=y
 CONFIG_SOFT_SPI=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
diff --git a/configs/pico-dwarf-imx6ul_defconfig b/configs/pico-dwarf-imx6ul_defconfig
index 18373600a40e..cb9c6b8fece9 100644
--- a/configs/pico-dwarf-imx6ul_defconfig
+++ b/configs/pico-dwarf-imx6ul_defconfig
@@ -72,6 +72,7 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_MXC_UART=y
 CONFIG_USB=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
diff --git a/configs/pico-dwarf-imx7d_defconfig b/configs/pico-dwarf-imx7d_defconfig
index e27b5626a3af..3adba803dd43 100644
--- a/configs/pico-dwarf-imx7d_defconfig
+++ b/configs/pico-dwarf-imx7d_defconfig
@@ -87,6 +87,7 @@ CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_MXC_USB_OTG_HACTIVE=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
diff --git a/configs/pico-hobbit-imx6ul_defconfig b/configs/pico-hobbit-imx6ul_defconfig
index f8754092fff5..0a2f10d0f159 100644
--- a/configs/pico-hobbit-imx6ul_defconfig
+++ b/configs/pico-hobbit-imx6ul_defconfig
@@ -75,6 +75,7 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_MXC_UART=y
 CONFIG_USB=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
diff --git a/configs/pico-hobbit-imx7d_defconfig b/configs/pico-hobbit-imx7d_defconfig
index 275a3a0d1f6c..cbfe346820f5 100644
--- a/configs/pico-hobbit-imx7d_defconfig
+++ b/configs/pico-hobbit-imx7d_defconfig
@@ -87,6 +87,7 @@ CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_MXC_USB_OTG_HACTIVE=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
diff --git a/configs/pico-imx6ul_defconfig b/configs/pico-imx6ul_defconfig
index aeda45574365..e8f6c434b66e 100644
--- a/configs/pico-imx6ul_defconfig
+++ b/configs/pico-imx6ul_defconfig
@@ -78,6 +78,7 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_MXC_UART=y
 CONFIG_USB=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
diff --git a/configs/pico-imx7d_bl33_defconfig b/configs/pico-imx7d_bl33_defconfig
index 13a7fcf1759e..a9d21eb02c8d 100644
--- a/configs/pico-imx7d_bl33_defconfig
+++ b/configs/pico-imx7d_bl33_defconfig
@@ -84,6 +84,7 @@ CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_MXC_USB_OTG_HACTIVE=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
diff --git a/configs/pico-imx7d_defconfig b/configs/pico-imx7d_defconfig
index 3181964cdd42..6a2f87a8bb17 100644
--- a/configs/pico-imx7d_defconfig
+++ b/configs/pico-imx7d_defconfig
@@ -87,6 +87,7 @@ CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_MXC_USB_OTG_HACTIVE=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
diff --git a/configs/pico-nymph-imx7d_defconfig b/configs/pico-nymph-imx7d_defconfig
index e27b5626a3af..3adba803dd43 100644
--- a/configs/pico-nymph-imx7d_defconfig
+++ b/configs/pico-nymph-imx7d_defconfig
@@ -87,6 +87,7 @@ CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_MXC_USB_OTG_HACTIVE=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
diff --git a/configs/pico-pi-imx6ul_defconfig b/configs/pico-pi-imx6ul_defconfig
index bb085678c7c2..a184393abd22 100644
--- a/configs/pico-pi-imx6ul_defconfig
+++ b/configs/pico-pi-imx6ul_defconfig
@@ -75,6 +75,7 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_MXC_UART=y
 CONFIG_USB=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig
index 1a052a40227a..79aa398e1e81 100644
--- a/configs/pico-pi-imx7d_defconfig
+++ b/configs/pico-pi-imx7d_defconfig
@@ -87,6 +87,7 @@ CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_MXC_USB_OTG_HACTIVE=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
diff --git a/configs/variscite_dart6ul_defconfig b/configs/variscite_dart6ul_defconfig
index f19dcbddcdf0..0f9cc8d82d3b 100644
--- a/configs/variscite_dart6ul_defconfig
+++ b/configs/variscite_dart6ul_defconfig
@@ -58,6 +58,7 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Variscite"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
diff --git a/configs/vining_2000_defconfig b/configs/vining_2000_defconfig
index 3b9aa9790908..da782889a1bc 100644
--- a/configs/vining_2000_defconfig
+++ b/configs/vining_2000_defconfig
@@ -93,6 +93,7 @@ CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
+CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
diff --git a/drivers/usb/common/fsl-dt-fixup.c b/drivers/usb/common/fsl-dt-fixup.c
index 4d7a2acd8e54..00b8cd368b1a 100644
--- a/drivers/usb/common/fsl-dt-fixup.c
+++ b/drivers/usb/common/fsl-dt-fixup.c
@@ -16,10 +16,6 @@
 #include <fsl_usb.h>
 #include <fdt_support.h>
 
-#ifndef CONFIG_USB_MAX_CONTROLLER_COUNT
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
-
 /* USB Controllers */
 #define FSL_USB2_MPH	"fsl-usb2-mph"
 #define FSL_USB2_DR	"fsl-usb2-dr"
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 9c9d4dc947e4..0b82c2fdaf71 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -380,3 +380,9 @@ config USB_R8A66597_HCD
 	---help---
 	  This enables support for the on-chip Renesas R8A66597 USB 2.0
 	  controller, present in various RZ and SH SoCs.
+
+config USB_MAX_CONTROLLER_COUNT
+	int "Maximum number of USB host controllers"
+	depends on USB_EHCI_FSL || USB_XHCI_FSL || \
+		(SPL_USB_HOST && !DM_SPL_USB) || (USB_HOST && !DM_USB)
+	default 1
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index e6355263cb97..f033198a7c19 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -25,10 +25,6 @@
 
 #include "ehci.h"
 
-#ifndef CONFIG_USB_MAX_CONTROLLER_COUNT
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
-
 /*
  * EHCI spec page 20 says that the HC may take up to 16 uFrames (= 4ms) to halt.
  * Let's time out after 8 to have a little safety margin on top of that.
diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h
index 7767fce4050e..4922b063309e 100644
--- a/include/configs/apalis_imx6.h
+++ b/include/configs/apalis_imx6.h
@@ -30,7 +30,6 @@
 
 /* USB Configs */
 /* Host */
-#define CONFIG_USB_MAX_CONTROLLER_COUNT		2
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
 /* Client */
diff --git a/include/configs/cl-som-imx7.h b/include/configs/cl-som-imx7.h
index c63c5ebb672e..4e982189559d 100644
--- a/include/configs/cl-som-imx7.h
+++ b/include/configs/cl-som-imx7.h
@@ -104,7 +104,6 @@
 /* USB Configs */
 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS   0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 
 /* SPL */
 #include "imx7_spl.h"
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index 02935430c25e..6bffeb6a65b5 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -141,7 +141,6 @@
 /* USB */
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 
 /* Boot */
 #define CONFIG_SYS_BOOTMAPSZ	        (8 << 20)
diff --git a/include/configs/colibri-imx6ull.h b/include/configs/colibri-imx6ull.h
index da5b8a6f80fa..40d145a1bec5 100644
--- a/include/configs/colibri-imx6ull.h
+++ b/include/configs/colibri-imx6ull.h
@@ -138,7 +138,6 @@
 
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 
 #define CONFIG_USBD_HS
 
diff --git a/include/configs/colibri_imx6.h b/include/configs/colibri_imx6.h
index 0d8922bc3f83..3c220e0d6e3e 100644
--- a/include/configs/colibri_imx6.h
+++ b/include/configs/colibri_imx6.h
@@ -27,7 +27,6 @@
 
 /* USB Configs */
 /* Host */
-#define CONFIG_USB_MAX_CONTROLLER_COUNT		2
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
 /* Client */
diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h
index d78a27347c56..8e50eeaec15a 100644
--- a/include/configs/colibri_imx7.h
+++ b/include/configs/colibri_imx7.h
@@ -182,7 +182,6 @@
 
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 
 #define CONFIG_USBD_HS
 
diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h
index 664c538f6dcd..9b1cec578e61 100644
--- a/include/configs/colibri_vf.h
+++ b/include/configs/colibri_vf.h
@@ -97,7 +97,6 @@
 #endif
 
 /* USB Host Support */
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 
 /* USB DFU */
 
diff --git a/include/configs/dart_6ul.h b/include/configs/dart_6ul.h
index 9f27072f12ff..36052fe7d867 100644
--- a/include/configs/dart_6ul.h
+++ b/include/configs/dart_6ul.h
@@ -52,7 +52,6 @@
 /* USB Configs */
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 
 #define ENV_MMC \
 	"mmcdev=" __stringify(MMC_ROOTFS_DEV) "\0" \
diff --git a/include/configs/db-88f6720.h b/include/configs/db-88f6720.h
index 7357f9800fdf..ef9c457e1020 100644
--- a/include/configs/db-88f6720.h
+++ b/include/configs/db-88f6720.h
@@ -20,7 +20,6 @@
 #define CONFIG_I2C_MVTWSI_BASE0		MVEBU_TWSI_BASE
 
 /* USB/EHCI configuration */
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 3
 
 /* Environment in SPI NOR flash */
 
diff --git a/include/configs/db-mv784mp-gp.h b/include/configs/db-mv784mp-gp.h
index da6514b64fc9..715a6d7a9e71 100644
--- a/include/configs/db-mv784mp-gp.h
+++ b/include/configs/db-mv784mp-gp.h
@@ -16,7 +16,6 @@
 #define CONFIG_I2C_MVTWSI_BASE0		MVEBU_TWSI_BASE
 
 /* USB/EHCI configuration */
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 3
 
 /* Environment in SPI NOR flash */
 
diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h
index 0c0abe6023e8..f770b3552869 100644
--- a/include/configs/dh_imx6.h
+++ b/include/configs/dh_imx6.h
@@ -40,7 +40,6 @@
 #ifdef CONFIG_CMD_USB
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2 /* Enabled USB controller number */
 
 /* USB Gadget (DFU, UMS) */
 #if defined(CONFIG_CMD_DFU) || defined(CONFIG_CMD_USB_MASS_STORAGE)
diff --git a/include/configs/ge_b1x5v2.h b/include/configs/ge_b1x5v2.h
index 61ca5f8b34ab..95ba20c686ba 100644
--- a/include/configs/ge_b1x5v2.h
+++ b/include/configs/ge_b1x5v2.h
@@ -31,7 +31,6 @@
 /* USB */
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 /* Enabled USB controller number */
 #define CONFIG_USBD_HS
 
 /* Video */
diff --git a/include/configs/imx6_logic.h b/include/configs/imx6_logic.h
index 6b1c67867da0..2913549c8835 100644
--- a/include/configs/imx6_logic.h
+++ b/include/configs/imx6_logic.h
@@ -124,7 +124,6 @@
 #ifdef CONFIG_CMD_USB
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1 /* Enabled USB controller number */
 #endif
 
 /* Falcon Mode */
diff --git a/include/configs/imx6dl-mamoj.h b/include/configs/imx6dl-mamoj.h
index 0bae238a4b03..909453cd66f4 100644
--- a/include/configs/imx6dl-mamoj.h
+++ b/include/configs/imx6dl-mamoj.h
@@ -45,7 +45,6 @@
 /* USB */
 #define CONFIG_MXC_USB_PORTSC			(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS			0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT		2
 
 /* Falcon */
 
diff --git a/include/configs/imx6q-bosch-acc.h b/include/configs/imx6q-bosch-acc.h
index e904a10b6e86..201684ba802c 100644
--- a/include/configs/imx6q-bosch-acc.h
+++ b/include/configs/imx6q-bosch-acc.h
@@ -113,6 +113,5 @@
 
 #define CONFIG_MXC_USB_PORTSC            (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS             0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT  1	/* Enabled USB controller number */
 
 #endif /* __IMX6Q_ACC_H */
diff --git a/include/configs/imx8mm-cl-iot-gate.h b/include/configs/imx8mm-cl-iot-gate.h
index 8303c68e369e..6b2ad806b56d 100644
--- a/include/configs/imx8mm-cl-iot-gate.h
+++ b/include/configs/imx8mm-cl-iot-gate.h
@@ -142,6 +142,5 @@
 
 /* USB Configs */
 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 
 #endif /*__IMX8MM_CL_IOT_GATE_H*/
diff --git a/include/configs/kontron-sl-mx6ul.h b/include/configs/kontron-sl-mx6ul.h
index 7b5e57734644..512cef09f802 100644
--- a/include/configs/kontron-sl-mx6ul.h
+++ b/include/configs/kontron-sl-mx6ul.h
@@ -31,7 +31,6 @@
 #ifdef CONFIG_USB_EHCI_HCD
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 #endif
 
 /* Boot order for distro boot */
diff --git a/include/configs/kontron-sl-mx8mm.h b/include/configs/kontron-sl-mx8mm.h
index dcc98fdef867..2e42129ba8bd 100644
--- a/include/configs/kontron-sl-mx8mm.h
+++ b/include/configs/kontron-sl-mx8mm.h
@@ -29,7 +29,6 @@
 #ifdef CONFIG_USB_EHCI_HCD
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 #endif
 
 /* GUID for capsule updatable firmware image */
diff --git a/include/configs/kp_imx6q_tpc.h b/include/configs/kp_imx6q_tpc.h
index 7b8e70e59453..1823a7939882 100644
--- a/include/configs/kp_imx6q_tpc.h
+++ b/include/configs/kp_imx6q_tpc.h
@@ -23,7 +23,6 @@
 #ifdef CONFIG_CMD_USB
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2 /* Enabled USB controller number */
 #endif
 
 #define CONFIG_EXTRA_ENV_SETTINGS	\
diff --git a/include/configs/liteboard.h b/include/configs/liteboard.h
index fa178fbe9365..a1fc056c305a 100644
--- a/include/configs/liteboard.h
+++ b/include/configs/liteboard.h
@@ -100,7 +100,6 @@
 #ifdef CONFIG_CMD_USB
 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS   0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
 #endif
 
 #ifdef CONFIG_CMD_NET
diff --git a/include/configs/ls1021atsn.h b/include/configs/ls1021atsn.h
index 905c63d4ddad..b06394c30039 100644
--- a/include/configs/ls1021atsn.h
+++ b/include/configs/ls1021atsn.h
@@ -10,7 +10,6 @@
 #define CONFIG_SYS_INIT_RAM_SIZE	OCRAM_SIZE
 
 /* XHCI Support - enabled by default */
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
 
 #define DDR_SDRAM_CFG			0x470c0008
 #define DDR_CS0_BNDS			0x008000bf
diff --git a/include/configs/lx2160a_common.h b/include/configs/lx2160a_common.h
index f8c3a0923abd..1669ecd2aba9 100644
--- a/include/configs/lx2160a_common.h
+++ b/include/configs/lx2160a_common.h
@@ -96,11 +96,6 @@
 #endif
 
 /* USB */
-#ifdef CONFIG_USB_HOST
-#ifndef CONFIG_TARGET_LX2162AQDS
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
-#endif
-#endif
 
 #define COUNTER_FREQUENCY_REAL		(get_board_sys_clk() / 4)
 
diff --git a/include/configs/lx2162aqds.h b/include/configs/lx2162aqds.h
index 126d226ebc72..729c2707e990 100644
--- a/include/configs/lx2162aqds.h
+++ b/include/configs/lx2162aqds.h
@@ -9,8 +9,6 @@
 #include "lx2160a_common.h"
 
 /* USB */
-#undef CONFIG_USB_MAX_CONTROLLER_COUNT
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
 
 /* RTC */
 #define CONFIG_SYS_RTC_BUS_NUM		0
diff --git a/include/configs/mvebu_armada-37xx.h b/include/configs/mvebu_armada-37xx.h
index b497ada06551..56f640226dd9 100644
--- a/include/configs/mvebu_armada-37xx.h
+++ b/include/configs/mvebu_armada-37xx.h
@@ -34,8 +34,6 @@
  */
 #define DEFAULT_ENV_IS_RW		/* required for configuring default fdtfile= */
 
-#define CONFIG_USB_MAX_CONTROLLER_COUNT (3 + 3)
-
 #define BOOT_TARGET_DEVICES(func) \
 	func(MMC, mmc, 1) \
 	func(MMC, mmc, 0) \
diff --git a/include/configs/mvebu_armada-8k.h b/include/configs/mvebu_armada-8k.h
index 52d88f705895..5a956f0a3e36 100644
--- a/include/configs/mvebu_armada-8k.h
+++ b/include/configs/mvebu_armada-8k.h
@@ -27,8 +27,6 @@
 
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
 
-#define CONFIG_USB_MAX_CONTROLLER_COUNT (3 + 3)
-
 /* USB ethernet */
 
 /*
diff --git a/include/configs/mx23_olinuxino.h b/include/configs/mx23_olinuxino.h
index 06b90e42b4c3..dd303a17d61c 100644
--- a/include/configs/mx23_olinuxino.h
+++ b/include/configs/mx23_olinuxino.h
@@ -15,9 +15,6 @@
 /* Status LED */
 
 /* USB */
-#ifdef CONFIG_CMD_USB
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
 
 /* Ethernet */
 
diff --git a/include/configs/mx23evk.h b/include/configs/mx23evk.h
index 94b916dbdb13..3507e83fb38b 100644
--- a/include/configs/mx23evk.h
+++ b/include/configs/mx23evk.h
@@ -20,9 +20,6 @@
 /* Environment is in MMC */
 
 /* USB */
-#ifdef	CONFIG_CMD_USB
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
 
 /* Framebuffer support */
 #ifdef CONFIG_DM_VIDEO
diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 10f48c12565d..7a352bd2a605 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -34,9 +34,6 @@
 #endif
 
 /* USB */
-#ifdef	CONFIG_CMD_USB
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
-#endif
 
 /* Framebuffer support */
 #ifdef CONFIG_DM_VIDEO
diff --git a/include/configs/mx6sabreauto.h b/include/configs/mx6sabreauto.h
index d0cf6a2251c3..bc4aa52f5bf1 100644
--- a/include/configs/mx6sabreauto.h
+++ b/include/configs/mx6sabreauto.h
@@ -16,7 +16,6 @@
 #define CONSOLE_DEV		"ttymxc3"
 
 /* USB Configs */
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS	0
 
diff --git a/include/configs/mx6sabresd.h b/include/configs/mx6sabresd.h
index 18d5d4988cf4..ef255aa360e9 100644
--- a/include/configs/mx6sabresd.h
+++ b/include/configs/mx6sabresd.h
@@ -38,7 +38,6 @@
 #ifdef CONFIG_CMD_USB
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1 /* Enabled USB controller number */
 #endif
 
 #endif                         /* __MX6SABRESD_CONFIG_H */
diff --git a/include/configs/mx6slevk.h b/include/configs/mx6slevk.h
index 837742b8039c..9f890938f982 100644
--- a/include/configs/mx6slevk.h
+++ b/include/configs/mx6slevk.h
@@ -96,7 +96,6 @@
 #ifdef CONFIG_CMD_USB
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 #endif
 
 #define CONFIG_SYS_FSL_USDHC_NUM	3
diff --git a/include/configs/mx6sxsabreauto.h b/include/configs/mx6sxsabreauto.h
index b3a786da4801..c87804140046 100644
--- a/include/configs/mx6sxsabreauto.h
+++ b/include/configs/mx6sxsabreauto.h
@@ -99,7 +99,6 @@
 #ifdef CONFIG_CMD_USB
 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS   0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 #endif
 
 #define CONFIG_SYS_FSL_USDHC_NUM	2
diff --git a/include/configs/mx6sxsabresd.h b/include/configs/mx6sxsabresd.h
index 8bddc5281e5e..7bbc500ae126 100644
--- a/include/configs/mx6sxsabresd.h
+++ b/include/configs/mx6sxsabresd.h
@@ -126,7 +126,6 @@
 #ifdef CONFIG_CMD_USB
 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS   0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 #endif
 
 #ifdef CONFIG_CMD_PCI
diff --git a/include/configs/mx6ul_14x14_evk.h b/include/configs/mx6ul_14x14_evk.h
index 6a110132a759..ab56ea0205da 100644
--- a/include/configs/mx6ul_14x14_evk.h
+++ b/include/configs/mx6ul_14x14_evk.h
@@ -121,7 +121,6 @@
 #ifdef CONFIG_CMD_USB
 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS   0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 #endif
 
 #ifdef CONFIG_CMD_NET
diff --git a/include/configs/mys_6ulx.h b/include/configs/mys_6ulx.h
index d1dc445a9b73..f7dd31e55780 100644
--- a/include/configs/mys_6ulx.h
+++ b/include/configs/mys_6ulx.h
@@ -36,7 +36,6 @@
 /* USB Configs */
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"console=ttymxc0,115200n8\0" \
diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index 0305aecb1438..72a9f4ec24fb 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -23,7 +23,6 @@
 #define CONFIG_FEC_MXC_PHYADDR		6
 
 /* USB Configs */
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS	0
 
diff --git a/include/configs/novena.h b/include/configs/novena.h
index 40304ba468c1..ee39b3c297cb 100644
--- a/include/configs/novena.h
+++ b/include/configs/novena.h
@@ -64,7 +64,6 @@
 
 /* USB Configs */
 #ifdef CONFIG_CMD_USB
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
 /* Gadget part */
diff --git a/include/configs/npi_imx6ull.h b/include/configs/npi_imx6ull.h
index b3de41852fed..96f570af1d05 100644
--- a/include/configs/npi_imx6ull.h
+++ b/include/configs/npi_imx6ull.h
@@ -37,7 +37,6 @@
 /* USB Configs */
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
 
 #ifdef CONFIG_CMD_NET
 #define CONFIG_FEC_MXC_PHYADDR		0x1
diff --git a/include/configs/opos6uldev.h b/include/configs/opos6uldev.h
index d368376d2028..9b89d9e524fd 100644
--- a/include/configs/opos6uldev.h
+++ b/include/configs/opos6uldev.h
@@ -26,7 +26,6 @@
 #ifdef CONFIG_USB_EHCI_MX6
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 #endif
 
 /* LCD */
diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
index 81bebff6cf76..f241f1483487 100644
--- a/include/configs/p1_p2_rdb_pc.h
+++ b/include/configs/p1_p2_rdb_pc.h
@@ -448,10 +448,6 @@
  * USB
  */
 
-#if defined(CONFIG_TARGET_P1020RDB_PD)
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
-#endif
-
 #ifdef CONFIG_MMC
 #define CONFIG_SYS_FSL_ESDHC_ADDR	CONFIG_SYS_MPC85xx_ESDHC_ADDR
 #endif
diff --git a/include/configs/pcl063.h b/include/configs/pcl063.h
index c6c417b6292a..a07d3517ce29 100644
--- a/include/configs/pcl063.h
+++ b/include/configs/pcl063.h
@@ -48,7 +48,6 @@
 /* USB Configs */
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"console=ttymxc0,115200n8\0" \
diff --git a/include/configs/pcl063_ull.h b/include/configs/pcl063_ull.h
index 4c1d24f64fd5..ae81b8e214e2 100644
--- a/include/configs/pcl063_ull.h
+++ b/include/configs/pcl063_ull.h
@@ -50,7 +50,6 @@
 /* USB Configs */
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1
 
 #define ENV_MMC \
 	"mmcdev=" __stringify(MMC_ROOTFS_DEV) "\0" \
diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h
index 7e57d7b14222..2ac48c40c96e 100644
--- a/include/configs/pico-imx6ul.h
+++ b/include/configs/pico-imx6ul.h
@@ -32,7 +32,6 @@
 /* USB Configs */
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 
 #define CONFIG_USBD_HS
 
diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h
index 39705d95692f..7fbf2c3f55fb 100644
--- a/include/configs/pico-imx7d.h
+++ b/include/configs/pico-imx7d.h
@@ -118,6 +118,5 @@
 /* USB Configs */
 #define CONFIG_MXC_USB_PORTSC			(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS			0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 
 #endif
diff --git a/include/configs/poplar.h b/include/configs/poplar.h
index b119465420df..4b749b13ee81 100644
--- a/include/configs/poplar.h
+++ b/include/configs/poplar.h
@@ -21,7 +21,6 @@
 /* ATF bl33.bin load address (must match) */
 
 /* USB configuration */
-#define CONFIG_USB_MAX_CONTROLLER_COUNT		2
 
 /*****************************************************************************
  *  Initial environment variables
diff --git a/include/configs/somlabs_visionsom_6ull.h b/include/configs/somlabs_visionsom_6ull.h
index bab4bf3deb34..6c0affb21e92 100644
--- a/include/configs/somlabs_visionsom_6ull.h
+++ b/include/configs/somlabs_visionsom_6ull.h
@@ -68,7 +68,6 @@
 #ifdef CONFIG_CMD_USB
 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS   0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 #endif
 
 #ifdef CONFIG_CMD_NET
diff --git a/include/configs/theadorable.h b/include/configs/theadorable.h
index 94e1acd98ba7..655fcb0011b0 100644
--- a/include/configs/theadorable.h
+++ b/include/configs/theadorable.h
@@ -29,7 +29,6 @@
 #define CONFIG_I2C_MVTWSI_BASE1		MVEBU_TWSI1_BASE
 
 /* USB/EHCI configuration */
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 3
 
 /* Environment in SPI NOR flash */
 
diff --git a/include/configs/tqma6.h b/include/configs/tqma6.h
index d60fe51eaf98..a782e3d02bdb 100644
--- a/include/configs/tqma6.h
+++ b/include/configs/tqma6.h
@@ -52,7 +52,6 @@
 
 /* USB Configs */
 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 
 #if defined(CONFIG_TQMA6X_MMC_BOOT)
 
diff --git a/include/configs/turris_mox.h b/include/configs/turris_mox.h
index 7fa30d04f3c2..d4aa312da4f4 100644
--- a/include/configs/turris_mox.h
+++ b/include/configs/turris_mox.h
@@ -18,8 +18,6 @@
 					  4000000, 4500000, 5000000, 5500000, \
 					  6000000 }
 
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	6
-
 #define BOOT_TARGET_DEVICES(func) \
 	func(MMC, mmc, 0) \
 	func(NVME, nvme, 0) \
diff --git a/include/configs/verdin-imx8mm.h b/include/configs/verdin-imx8mm.h
index 0192a4fe06cb..523ef703a271 100644
--- a/include/configs/verdin-imx8mm.h
+++ b/include/configs/verdin-imx8mm.h
@@ -74,6 +74,5 @@
 
 /* USB Configs */
 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 
 #endif /* __VERDIN_IMX8MM_H */
diff --git a/include/configs/vining_2000.h b/include/configs/vining_2000.h
index 487ab3d664cc..9cc8fc5ff533 100644
--- a/include/configs/vining_2000.h
+++ b/include/configs/vining_2000.h
@@ -43,7 +43,6 @@
 
 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS   0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 
 #ifdef CONFIG_CMD_PCI
 #define CONFIG_PCI_SCAN_SHOW
diff --git a/include/configs/warp.h b/include/configs/warp.h
index 5716f8f9a600..7cb9743fddb3 100644
--- a/include/configs/warp.h
+++ b/include/configs/warp.h
@@ -36,7 +36,6 @@
 #ifdef CONFIG_CMD_USB
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	1 /* Only OTG2 port enabled */
 #endif
 
 #define CONFIG_USBD_HS
diff --git a/include/configs/xpress.h b/include/configs/xpress.h
index 81f8d64067dc..0e43b373649a 100644
--- a/include/configs/xpress.h
+++ b/include/configs/xpress.h
@@ -33,7 +33,6 @@
 /* USB Configs */
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
 
 #define CONFIG_FEC_ENET_DEV		0
 #define CONFIG_FEC_MXC_PHYADDR          0x0
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 2dcc195e36cf..5db0984f73e3 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1674,7 +1674,6 @@ CONFIG_USB_FAT_BOOT
 CONFIG_USB_GADGET_AT91
 CONFIG_USB_GADGET_DWC2_OTG_PHY
 CONFIG_USB_ISP1301_I2C_ADDR
-CONFIG_USB_MAX_CONTROLLER_COUNT
 CONFIG_USB_OHCI_LPC32XX
 CONFIG_USB_OHCI_NEW
 CONFIG_USB_TTY
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 8/8] Convert CONFIG_SYS_USB_FAT_BOOT_PARTITION to Kconfig
  2022-06-13  0:01 [PATCH 1/8] Convert CONFIG_ENV_MIN_ENTRIES et al to Kconfig Tom Rini
                   ` (5 preceding siblings ...)
  2022-06-13  0:02 ` [PATCH 7/8] Convert CONFIG_USB_MAX_CONTROLLER_COUNT to Kconfig Tom Rini
@ 2022-06-13  0:02 ` Tom Rini
  2022-06-29 14:11 ` [PATCH 1/8] Convert CONFIG_ENV_MIN_ENTRIES et al " Tom Rini
  7 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2022-06-13  0:02 UTC (permalink / raw)
  To: u-boot

This converts the following to Kconfig:
   CONFIG_SYS_USB_FAT_BOOT_PARTITION

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 common/spl/Kconfig           | 7 +++++++
 include/configs/am43xx_evm.h | 6 ------
 include/configs/am64x_evm.h  | 2 --
 include/configs/am65x_evm.h  | 2 --
 4 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 42f2c95228a6..3fd564480061 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -1317,6 +1317,13 @@ config SPL_USB_STORAGE
 	  config options. This enables loading from USB using a configured
 	  device.
 
+config SYS_USB_FAT_BOOT_PARTITION
+	int "Partition on USB to use to load U-Boot from"
+	depends on SPL_USB_STORAGE
+	default 1
+	help
+	  Partition on the USB storage device to load U-Boot from
+
 config SPL_USB_GADGET
 	bool "Suppport USB Gadget drivers"
 	help
diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h
index e0138fe1db83..e3a01adae971 100644
--- a/include/configs/am43xx_evm.h
+++ b/include/configs/am43xx_evm.h
@@ -48,12 +48,6 @@
 /* NS16550 Configuration */
 #define CONFIG_SYS_NS16550_COM1		0x44e09000	/* Base EVM has UART0 */
 
-/* SPL USB Support */
-
-#if defined(CONFIG_SPL_USB_HOST) || !defined(CONFIG_SPL_BUILD)
-#define CONFIG_SYS_USB_FAT_BOOT_PARTITION		1
-#endif
-
 #ifndef CONFIG_SPL_BUILD
 /* USB Device Firmware Update support */
 #define DFUARGS \
diff --git a/include/configs/am64x_evm.h b/include/configs/am64x_evm.h
index 6da11b86c4b1..140940730d0e 100644
--- a/include/configs/am64x_evm.h
+++ b/include/configs/am64x_evm.h
@@ -106,6 +106,4 @@
 /* Now for the remaining common defines */
 #include <configs/ti_armv7_common.h>
 
-#define CONFIG_SYS_USB_FAT_BOOT_PARTITION 1
-
 #endif /* __CONFIG_AM642_EVM_H */
diff --git a/include/configs/am65x_evm.h b/include/configs/am65x_evm.h
index db35af98d9aa..65b0a576a6f4 100644
--- a/include/configs/am65x_evm.h
+++ b/include/configs/am65x_evm.h
@@ -110,8 +110,6 @@
 	EXTRA_ENV_DFUARGS						\
 	BOOTENV
 
-#define CONFIG_SYS_USB_FAT_BOOT_PARTITION 1
-
 /* Now for the remaining common defines */
 #include <configs/ti_armv7_common.h>
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 5/8] mx6memcal: Remove SPL_USB_HOST
  2022-06-13  0:02 ` [PATCH 5/8] mx6memcal: Remove SPL_USB_HOST Tom Rini
@ 2022-06-13  3:58   ` Eric Nelson
  0 siblings, 0 replies; 10+ messages in thread
From: Eric Nelson @ 2022-06-13  3:58 UTC (permalink / raw)
  To: Tom Rini, u-boot

Thanks Tom.

On 6/12/22 17:02, Tom Rini wrote:
> As this particular platform is intended to be loaded and run a specific
> set of routines in SPL, we do not need the ability to further use the
> USB as a host device in SPL.  Disable this support.
> 
> Cc: Eric Nelson <eric@nelint.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Please correct me if I'm wrong here and I'll update the subsequent patch
> that lead me to discover this.
> ---
>   configs/mx6memcal_defconfig | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/configs/mx6memcal_defconfig b/configs/mx6memcal_defconfig
> index a1bc95bb4a1c..021e8a6151ee 100644
> --- a/configs/mx6memcal_defconfig
> +++ b/configs/mx6memcal_defconfig
> @@ -16,7 +16,6 @@ CONFIG_SYS_MEMTEST_START=0x10000000
>   CONFIG_SYS_MEMTEST_END=0x20000000
>   CONFIG_SUPPORT_RAW_INITRD=y
>   CONFIG_SYS_SPL_MALLOC=y
> -CONFIG_SPL_USB_HOST=y
>   CONFIG_SPL_WATCHDOG=y
>   CONFIG_HUSH_PARSER=y
>   CONFIG_SYS_MAXARGS=32

Acked-by: Eric Nelson <eric@nelint.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/8] Convert CONFIG_ENV_MIN_ENTRIES et al to Kconfig
  2022-06-13  0:01 [PATCH 1/8] Convert CONFIG_ENV_MIN_ENTRIES et al to Kconfig Tom Rini
                   ` (6 preceding siblings ...)
  2022-06-13  0:02 ` [PATCH 8/8] Convert CONFIG_SYS_USB_FAT_BOOT_PARTITION " Tom Rini
@ 2022-06-29 14:11 ` Tom Rini
  7 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2022-06-29 14:11 UTC (permalink / raw)
  To: u-boot; +Cc: Michal Simek

[-- Attachment #1: Type: text/plain, Size: 320 bytes --]

On Sun, Jun 12, 2022 at 08:01:58PM -0400, Tom Rini wrote:

> This converts the following to Kconfig:
>    CONFIG_ENV_MIN_ENTRIES
>    CONFIG_ENV_MAX_ENTRIES
> 
> Cc: Michal Simek <michal.simek@amd.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>

For the series, applied to u-boot/next, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-06-29 14:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-13  0:01 [PATCH 1/8] Convert CONFIG_ENV_MIN_ENTRIES et al to Kconfig Tom Rini
2022-06-13  0:01 ` [PATCH 2/8] fpga: Remove CONFIG_FPGA_COUNT Tom Rini
2022-06-13  0:02 ` [PATCH 3/8] Convert CONFIG_FPGA_STRATIX_V to Kconfig Tom Rini
2022-06-13  0:02 ` [PATCH 4/8] usb: Remove non-DM code in ehci-fsl and xhci Tom Rini
2022-06-13  0:02 ` [PATCH 5/8] mx6memcal: Remove SPL_USB_HOST Tom Rini
2022-06-13  3:58   ` Eric Nelson
2022-06-13  0:02 ` [PATCH 6/8] common: usb: Update logic for usb.o, usb_hub.o and usb_storage.o Tom Rini
2022-06-13  0:02 ` [PATCH 7/8] Convert CONFIG_USB_MAX_CONTROLLER_COUNT to Kconfig Tom Rini
2022-06-13  0:02 ` [PATCH 8/8] Convert CONFIG_SYS_USB_FAT_BOOT_PARTITION " Tom Rini
2022-06-29 14:11 ` [PATCH 1/8] Convert CONFIG_ENV_MIN_ENTRIES et al " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.