All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] toradex: imx6: Move g_dnl_bind_fixup() into common SPL code
@ 2017-09-05 23:46 Fabio Estevam
  2017-09-05 23:46 ` [U-Boot] [PATCH 2/2] mx6sabresd: Add Serial Download Protocol support Fabio Estevam
  2017-09-20 13:42 ` [U-Boot] [PATCH 1/2] toradex: imx6: Move g_dnl_bind_fixup() into common SPL code Stefano Babic
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio Estevam @ 2017-09-05 23:46 UTC (permalink / raw)
  To: u-boot

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 2845 bytes --]

From: Fabio Estevam <fabio.estevam@nxp.com>

Instead of having every board file to add its own g_dnl_bind_fixup()
implementation, move it to the common imx6 SPL code.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Łukasz Majewski <lukma@denx.de>
---
Changes since RFC: 
- Keep the non-SPL g_dnl_bind_fixup inside tdx-common.c 

 arch/arm/mach-imx/spl.c                   | 10 ++++++++++
 board/toradex/apalis_imx6/apalis_imx6.c   | 13 -------------
 board/toradex/colibri_imx6/colibri_imx6.c | 13 -------------
 3 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index 8e8e2f7..e350bc9 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -14,6 +14,7 @@
 #include <asm/spl.h>
 #include <spl.h>
 #include <asm/mach-imx/hab.h>
+#include <g_dnl.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -86,6 +87,15 @@ u32 spl_boot_device(void)
 	}
 	return BOOT_DEVICE_NONE;
 }
+
+#ifdef CONFIG_SPL_USB_GADGET_SUPPORT
+int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
+{
+	put_unaligned(CONFIG_G_DNL_PRODUCT_NUM + 0xfff, &dev->idProduct);
+
+	return 0;
+}
+#endif
 #endif
 
 #if defined(CONFIG_SPL_MMC_SUPPORT)
diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c
index ebc6c12..628a61d 100644
--- a/board/toradex/apalis_imx6/apalis_imx6.c
+++ b/board/toradex/apalis_imx6/apalis_imx6.c
@@ -29,7 +29,6 @@
 #include <dm/platform_data/serial_mxc.h>
 #include <dm/platdata.h>
 #include <fsl_esdhc.h>
-#include <g_dnl.h>
 #include <i2c.h>
 #include <imx_thermal.h>
 #include <linux/errno.h>
@@ -1224,18 +1223,6 @@ void reset_cpu(ulong addr)
 {
 }
 
-#ifdef CONFIG_SPL_USB_GADGET_SUPPORT
-int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
-{
-	unsigned short usb_pid;
-
-	usb_pid = TORADEX_USB_PRODUCT_NUM_OFFSET + 0xfff;
-	put_unaligned(usb_pid, &dev->idProduct);
-
-	return 0;
-}
-#endif
-
 #endif
 
 static struct mxc_serial_platdata mxc_serial_plat = {
diff --git a/board/toradex/colibri_imx6/colibri_imx6.c b/board/toradex/colibri_imx6/colibri_imx6.c
index 669d912..756e3f3 100644
--- a/board/toradex/colibri_imx6/colibri_imx6.c
+++ b/board/toradex/colibri_imx6/colibri_imx6.c
@@ -28,7 +28,6 @@
 #include <dm/platform_data/serial_mxc.h>
 #include <dm/platdata.h>
 #include <fsl_esdhc.h>
-#include <g_dnl.h>
 #include <i2c.h>
 #include <imx_thermal.h>
 #include <linux/errno.h>
@@ -1108,18 +1107,6 @@ void reset_cpu(ulong addr)
 {
 }
 
-#ifdef CONFIG_SPL_USB_GADGET_SUPPORT
-int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
-{
-	unsigned short usb_pid;
-
-	usb_pid = TORADEX_USB_PRODUCT_NUM_OFFSET + 0xfff;
-	put_unaligned(usb_pid, &dev->idProduct);
-
-	return 0;
-}
-#endif
-
 #endif
 
 static struct mxc_serial_platdata mxc_serial_plat = {
-- 
2.7.4


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

* [U-Boot] [PATCH 2/2] mx6sabresd: Add Serial Download Protocol support
  2017-09-05 23:46 [U-Boot] [PATCH 1/2] toradex: imx6: Move g_dnl_bind_fixup() into common SPL code Fabio Estevam
@ 2017-09-05 23:46 ` Fabio Estevam
  2017-09-20 13:43   ` Stefano Babic
  2017-09-20 13:42 ` [U-Boot] [PATCH 1/2] toradex: imx6: Move g_dnl_bind_fixup() into common SPL code Stefano Babic
  1 sibling, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2017-09-05 23:46 UTC (permalink / raw)
  To: u-boot

From: Fabio Estevam <fabio.estevam@nxp.com>

Add Serial Download Protocol support (SDP), which allows loading
SPL and u-boot.img via imx_usb_loader tool as explained in
doc/README.sdp.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
In order to get SDP functional on sabresd we need these
two patches from Stefan:

imx: add macro to detect whether USB has been initialized
imx_common: detect USB serial downloader reliably

 configs/mx6sabresd_defconfig | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 7949c5e..1c08639 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -19,6 +19,9 @@ CONFIG_SPL=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
+CONFIG_SPL_USB_HOST_SUPPORT=y
+CONFIG_SPL_USB_GADGET_SUPPORT=y
+CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
@@ -32,6 +35,7 @@ CONFIG_CMD_PART=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
+CONFIG_CMD_USB_SDP=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-- 
2.7.4

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

* [U-Boot] [PATCH 1/2] toradex: imx6: Move g_dnl_bind_fixup() into common SPL code
  2017-09-05 23:46 [U-Boot] [PATCH 1/2] toradex: imx6: Move g_dnl_bind_fixup() into common SPL code Fabio Estevam
  2017-09-05 23:46 ` [U-Boot] [PATCH 2/2] mx6sabresd: Add Serial Download Protocol support Fabio Estevam
@ 2017-09-20 13:42 ` Stefano Babic
  1 sibling, 0 replies; 4+ messages in thread
From: Stefano Babic @ 2017-09-20 13:42 UTC (permalink / raw)
  To: u-boot

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 751 bytes --]

On 06/09/2017 01:46, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> Instead of having every board file to add its own g_dnl_bind_fixup()
> implementation, move it to the common imx6 SPL code.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> Reviewed-by: Łukasz Majewski <lukma@denx.de>
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

* [U-Boot] [PATCH 2/2] mx6sabresd: Add Serial Download Protocol support
  2017-09-05 23:46 ` [U-Boot] [PATCH 2/2] mx6sabresd: Add Serial Download Protocol support Fabio Estevam
@ 2017-09-20 13:43   ` Stefano Babic
  0 siblings, 0 replies; 4+ messages in thread
From: Stefano Babic @ 2017-09-20 13:43 UTC (permalink / raw)
  To: u-boot

On 06/09/2017 01:46, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> Add Serial Download Protocol support (SDP), which allows loading
> SPL and u-boot.img via imx_usb_loader tool as explained in
> doc/README.sdp.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

end of thread, other threads:[~2017-09-20 13:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-05 23:46 [U-Boot] [PATCH 1/2] toradex: imx6: Move g_dnl_bind_fixup() into common SPL code Fabio Estevam
2017-09-05 23:46 ` [U-Boot] [PATCH 2/2] mx6sabresd: Add Serial Download Protocol support Fabio Estevam
2017-09-20 13:43   ` Stefano Babic
2017-09-20 13:42 ` [U-Boot] [PATCH 1/2] toradex: imx6: Move g_dnl_bind_fixup() into common SPL code Stefano Babic

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.