All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Cc: Marek Vasut <marex@denx.de>, Andrew Davis <afd@ti.com>,
	Chris Packham <judge.packham@gmail.com>,
	Jim Liu <jim.t90615@gmail.com>, Lukasz Majewski <lukma@denx.de>,
	Samuel Holland <samuel@sholland.org>,
	Simon Glass <sjg@chromium.org>, Stefan Roese <sr@denx.de>,
	Tom Rini <trini@konsulko.com>,
	Weijie Gao <weijie.gao@mediatek.com>
Subject: [PATCH 3/4] usb: Move SPL_USB_GADGET and related Kconfig symbols to drivers/usb/
Date: Sat,  6 May 2023 16:42:39 +0200	[thread overview]
Message-ID: <20230506144240.10042-3-marex@denx.de> (raw)
In-Reply-To: <20230506144240.10042-1-marex@denx.de>

To avoid piling up all the various Kconfig symbols in one place, i.e.
common/spl/Kconfig, move the USB Kconfig symbols into drivers/usb/ .
This commit moves SPL_USB_GADGET and related symbols. Fix typo and
rename SPL_USB_GADGET to "USB Gadget Support in SPL" .

Update the gadget Makefile to match the symbol changes.

Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Andrew Davis <afd@ti.com>
Cc: Chris Packham <judge.packham@gmail.com>
Cc: Jim Liu <jim.t90615@gmail.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Samuel Holland <samuel@sholland.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefan Roese <sr@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Weijie Gao <weijie.gao@mediatek.com>
---
 common/spl/Kconfig          | 63 ------------------------------------
 drivers/usb/gadget/Kconfig  | 64 +++++++++++++++++++++++++++++++++++++
 drivers/usb/gadget/Makefile |  5 ++-
 3 files changed, 66 insertions(+), 66 deletions(-)

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 5ad29af21cb..6774ba5b42e 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -1345,69 +1345,6 @@ config SPL_THERMAL
 	  automatic power-off when the temperature gets too high or low. Other
 	  devices may be discrete but connected on a suitable bus.
 
-config SPL_USB_GADGET
-	bool "Suppport USB Gadget drivers"
-	help
-	  Enable USB Gadget API which allows to enable USB device functions
-	  in SPL.
-
-if SPL_USB_GADGET
-
-config SPL_USB_ETHER
-	bool "Support USB Ethernet drivers"
-	depends on SPL_NET
-	help
-	  Enable access to the USB network subsystem and associated
-	  drivers in SPL. This permits SPL to load U-Boot over a
-	  USB-connected Ethernet link (such as a USB Ethernet dongle) rather
-	  than from an onboard peripheral. Environment support is required
-	  since the network stack uses a number of environment variables.
-	  See also SPL_NET and SPL_ETH.
-
-config SPL_DFU
-	bool "Support DFU (Device Firmware Upgrade)"
-	select SPL_HASH
-	select SPL_DFU_NO_RESET
-	depends on SPL_RAM_SUPPORT
-	help
-	  This feature enables the DFU (Device Firmware Upgrade) in SPL with
-	  RAM memory device support. The ROM code will load and execute
-	  the SPL built with dfu. The user can load binaries (u-boot/kernel) to
-	  selected device partition from host-pc using dfu-utils.
-	  This feature is useful to flash the binaries to factory or bare-metal
-	  boards using USB interface.
-
-choice
-	bool "DFU device selection"
-	depends on SPL_DFU
-
-config SPL_DFU_RAM
-	bool "RAM device"
-	depends on SPL_DFU && SPL_RAM_SUPPORT
-	help
-	 select RAM/DDR memory device for loading binary images
-	 (u-boot/kernel) to the selected device partition using
-	 DFU and execute the u-boot/kernel from RAM.
-
-endchoice
-
-config SPL_USB_SDP_SUPPORT
-	bool "Support SDP (Serial Download Protocol)"
-	depends on SPL_SERIAL
-	help
-	  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
 	bool "Support watchdog drivers"
 	imply SPL_WDT if !HW_WATCHDOG
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 941f97c96d0..6f85089a9bf 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -36,6 +36,12 @@ menuconfig USB_GADGET
 	   peripheral/device side bus controller, and a "gadget driver" for
 	   your peripheral protocol.
 
+config SPL_USB_GADGET
+	bool "USB Gadget Support in SPL"
+	help
+	  Enable USB Gadget API which allows to enable USB device functions
+	  in SPL.
+
 if USB_GADGET
 
 config USB_GADGET_MANUFACTURER
@@ -265,3 +271,61 @@ config USBNET_HOST_ADDR
 endif # USB_ETHER
 
 endif # USB_GADGET
+
+if SPL_USB_GADGET
+
+config SPL_USB_ETHER
+	bool "Support USB Ethernet drivers in SPL"
+	depends on SPL_NET
+	help
+	  Enable access to the USB network subsystem and associated
+	  drivers in SPL. This permits SPL to load U-Boot over a
+	  USB-connected Ethernet link (such as a USB Ethernet dongle) rather
+	  than from an onboard peripheral. Environment support is required
+	  since the network stack uses a number of environment variables.
+	  See also SPL_NET and SPL_ETH.
+
+config SPL_DFU
+	bool "Support DFU (Device Firmware Upgrade) in SPL"
+	select SPL_HASH
+	select SPL_DFU_NO_RESET
+	depends on SPL_RAM_SUPPORT
+	help
+	  This feature enables the DFU (Device Firmware Upgrade) in SPL with
+	  RAM memory device support. The ROM code will load and execute
+	  the SPL built with dfu. The user can load binaries (u-boot/kernel) to
+	  selected device partition from host-pc using dfu-utils.
+	  This feature is useful to flash the binaries to factory or bare-metal
+	  boards using USB interface.
+
+choice
+	bool "DFU device selection in SPL"
+	depends on SPL_DFU
+
+config SPL_DFU_RAM
+	bool "RAM device"
+	depends on SPL_DFU && SPL_RAM_SUPPORT
+	help
+	 select RAM/DDR memory device for loading binary images
+	 (u-boot/kernel) to the selected device partition using
+	 DFU and execute the u-boot/kernel from RAM.
+
+endchoice
+
+config SPL_USB_SDP_SUPPORT
+	bool "Support SDP (Serial Download Protocol) in SPL"
+	depends on SPL_SERIAL
+	help
+	  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 in SPL"
+	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 # SPL_USB_GADGET
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 6cfe0f3a041..a9edeb9f396 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -3,8 +3,8 @@
 # (C) Copyright 2000-2007
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 
-obj-$(CONFIG_USB_GADGET) += epautoconf.o config.o usbstring.o
-obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o usbstring.o
+obj-$(CONFIG_$(SPL_TPL_)USB_GADGET) += epautoconf.o config.o usbstring.o
+obj-$(CONFIG_$(SPL_TPL_)USB_ETHER) += epautoconf.o config.o usbstring.o ether.o
 
 ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_SPL_USB_GADGET) += g_dnl.o
@@ -34,7 +34,6 @@ endif
 
 obj-$(CONFIG_CI_UDC) += ci_udc.o
 
-obj-$(CONFIG_USB_ETHER) += ether.o
 obj-$(CONFIG_USB_ETH_RNDIS) += rndis.o
 
 # Devices not related to the new gadget layer depend on CONFIG_USB_DEVICE
-- 
2.39.2


  parent reply	other threads:[~2023-05-06 14:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-06 14:42 [PATCH 1/4] usb: Move SPL_USB_HOST Kconfig symbol to drivers/usb/ Marek Vasut
2023-05-06 14:42 ` [PATCH 2/4] usb: Move SPL_USB_STORAGE " Marek Vasut
2023-05-16 20:21   ` Tom Rini
2023-05-06 14:42 ` Marek Vasut [this message]
2023-05-16 20:21   ` [PATCH 3/4] usb: Move SPL_USB_GADGET and related Kconfig symbols " Tom Rini
2023-05-06 14:42 ` [PATCH 4/4] usb: gadget: Add and use matching SPL USB ethernet gadget Kconfig symbols Marek Vasut
2023-05-16 20:21   ` Tom Rini
2023-05-16 20:21 ` [PATCH 1/4] usb: Move SPL_USB_HOST Kconfig symbol to drivers/usb/ Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230506144240.10042-3-marex@denx.de \
    --to=marex@denx.de \
    --cc=afd@ti.com \
    --cc=jim.t90615@gmail.com \
    --cc=judge.packham@gmail.com \
    --cc=lukma@denx.de \
    --cc=samuel@sholland.org \
    --cc=sjg@chromium.org \
    --cc=sr@denx.de \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=weijie.gao@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.