summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2019-01-02 22:37:49 -0800
committerYe Li <ye.li@nxp.com>2019-01-08 21:46:31 -0800
commitdba0d7c7dc3b9b60043726931b1f635b725e9756 (patch)
tree03ced160685c024bb454514fd24ef7b8939903fd /common
parentbb5ed5774d63031571e04a3061b8481139601257 (diff)
MLK-20559-1 spl_sdp: Add CONFIG_SPL_SDP_USB_DEV for USB device
Add a new configuration CONFIG_SPL_SDP_USB_DEV to specify the usb index for spl sdp driver, so that we change use different device. The default value is 0. Signed-off-by: Ye Li <ye.li@nxp.com>
Diffstat (limited to 'common')
-rw-r--r--common/spl/Kconfig8
-rw-r--r--common/spl/spl_sdp.c4
2 files changed, 10 insertions, 2 deletions
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 1d739a80eb..6c1bb7e649 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -724,6 +724,14 @@ config SPL_USB_SDP_SUPPORT
Enable Serial Download Protocol (SDP) device support in SPL. This
allows to download images into memory and execute (jump to) them
using the same protocol as implemented by the i.MX family's boot ROM.
+
+config SPL_SDP_USB_DEV
+ int "SDP USB controller index"
+ default 0
+ depends on SPL_USB_SDP_SUPPORT
+ help
+ Some boards have USB controller other than 0. Define this option
+ so it can be used in compiled environment.
endif
config SPL_WATCHDOG_SUPPORT
diff --git a/common/spl/spl_sdp.c b/common/spl/spl_sdp.c
index eff252f94a..a3cafa5895 100644
--- a/common/spl/spl_sdp.c
+++ b/common/spl/spl_sdp.c
@@ -17,9 +17,9 @@ static int spl_sdp_load_image(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev)
{
int ret;
- const int controller_index = 0;
+ const int controller_index = CONFIG_SPL_SDP_USB_DEV;
- board_usb_init(0, USB_INIT_DEVICE);
+ board_usb_init(controller_index, USB_INIT_DEVICE);
g_dnl_clear_detach();
g_dnl_register("usb_dnl_sdp");