All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/4] Make some changes to SDP
@ 2019-07-18  1:40 sherry sun
  2019-07-18  1:40 ` [U-Boot] [PATCH 1/4] imx: spl: Change USB boot device type sherry sun
                   ` (4 more replies)
  0 siblings, 5 replies; 24+ messages in thread
From: sherry sun @ 2019-07-18  1:40 UTC (permalink / raw)
  To: u-boot

From: Sherry Sun <sherry.sun@nxp.com>

This patchset adds:
1. Add usb_gadget_initialize() and usb_gadget_release() to initialize and
release UDC during sdp download.
2. Add high speed endpoint descriptor for sdp. 
3. Add a macro definition--CONFIG_SDP_LOADADDR as default sdp load
address while SDP_WRITE and SDP_JUMP command addr is zero.

Sherry Sun (4):
  imx: spl: Change USB boot device type
  SDP: use CONFIG_SDP_LOADADDR as default load address
  SDP: fix wrong usb request size and add high speed endpoint descriptor
  SDP: Call usb_gadget_initialize and usb_gadget_release to support UDC

 arch/arm/mach-imx/spl.c    |  2 +-
 common/spl/spl_sdp.c       |  4 ++++
 drivers/usb/gadget/Kconfig |  4 ++++
 drivers/usb/gadget/f_sdp.c | 39 +++++++++++++++++++++++++++++++++-----
 4 files changed, 43 insertions(+), 6 deletions(-)

-- 
2.17.1

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

* [U-Boot] [PATCH 1/4] imx: spl: Change USB boot device type
  2019-07-18  1:40 [U-Boot] [PATCH 0/4] Make some changes to SDP sherry sun
@ 2019-07-18  1:40 ` sherry sun
  2019-07-18  7:27   ` Lukasz Majewski
  2019-07-18  1:40 ` [U-Boot] [PATCH 2/4] SDP: use CONFIG_SDP_LOADADDR as default load address sherry sun
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 24+ messages in thread
From: sherry sun @ 2019-07-18  1:40 UTC (permalink / raw)
  To: u-boot

From: Sherry Sun <sherry.sun@nxp.com>

The SPL SDP is configured as BOOT_DEVICE_BOARD, so when booting from
USB, change its type to BOOT_DEVICE_BOARD, so we can use SDP.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
---
 arch/arm/mach-imx/spl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index 9f1e0f6a72..2355019243 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -156,7 +156,7 @@ u32 spl_boot_device(void)
 	case SPI_NOR_BOOT:
 		return BOOT_DEVICE_SPI;
 	case USB_BOOT:
-		return BOOT_DEVICE_USB;
+		return BOOT_DEVICE_BOARD;
 	default:
 		return BOOT_DEVICE_NONE;
 	}
-- 
2.17.1

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

* [U-Boot] [PATCH 2/4] SDP: use CONFIG_SDP_LOADADDR as default load address
  2019-07-18  1:40 [U-Boot] [PATCH 0/4] Make some changes to SDP sherry sun
  2019-07-18  1:40 ` [U-Boot] [PATCH 1/4] imx: spl: Change USB boot device type sherry sun
@ 2019-07-18  1:40 ` sherry sun
  2019-07-18  7:29   ` Lukasz Majewski
  2019-07-18  1:40 ` [U-Boot] [PATCH 3/4] SDP: fix wrong usb request size and add high speed endpoint descriptor sherry sun
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 24+ messages in thread
From: sherry sun @ 2019-07-18  1:40 UTC (permalink / raw)
  To: u-boot

From: Sherry Sun <sherry.sun@nxp.com>

If SDP_WRITE and SDP_JUMP command addr is zero, use CONFIG_SDP_LOADADDR
as default address.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 drivers/usb/gadget/Kconfig | 4 ++++
 drivers/usb/gadget/f_sdp.c | 6 ++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 26b4d12a09..172a82195b 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -115,6 +115,10 @@ config USB_GADGET_VBUS_DRAW
 	   This value will be used except for system-specific gadget
 	   drivers that have more specific information.
 
+config SDP_LOADADDR
+	hex "Default load address at SDP_WRITE and SDP_JUMP"
+	default 0
+
 # Selected by UDC drivers that support high-speed operation.
 config USB_GADGET_DUALSPEED
 	bool
diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
index fab7ce6f97..b1601575e0 100644
--- a/drivers/usb/gadget/f_sdp.c
+++ b/drivers/usb/gadget/f_sdp.c
@@ -275,7 +275,8 @@ static void sdp_rx_command_complete(struct usb_ep *ep, struct usb_request *req)
 		sdp->error_status = SDP_WRITE_FILE_COMPLETE;
 
 		sdp->state = SDP_STATE_RX_FILE_DATA;
-		sdp->dnl_address = be32_to_cpu(cmd->addr);
+		sdp->dnl_address = cmd->addr ? be32_to_cpu(cmd->addr) :
+					       CONFIG_SDP_LOADADDR;
 		sdp->dnl_bytes_remaining = be32_to_cpu(cmd->cnt);
 		sdp->dnl_bytes = sdp->dnl_bytes_remaining;
 		sdp->next_state = SDP_STATE_IDLE;
@@ -303,7 +304,8 @@ static void sdp_rx_command_complete(struct usb_ep *ep, struct usb_request *req)
 		sdp->always_send_status = false;
 		sdp->error_status = 0;
 
-		sdp->jmp_address = be32_to_cpu(cmd->addr);
+		sdp->jmp_address = cmd->addr ? be32_to_cpu(cmd->addr) :
+					       CONFIG_SDP_LOADADDR;
 		sdp->state = SDP_STATE_TX_SEC_CONF;
 		sdp->next_state = SDP_STATE_JUMP;
 		break;
-- 
2.17.1

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

* [U-Boot] [PATCH 3/4] SDP: fix wrong usb request size and add high speed endpoint descriptor
  2019-07-18  1:40 [U-Boot] [PATCH 0/4] Make some changes to SDP sherry sun
  2019-07-18  1:40 ` [U-Boot] [PATCH 1/4] imx: spl: Change USB boot device type sherry sun
  2019-07-18  1:40 ` [U-Boot] [PATCH 2/4] SDP: use CONFIG_SDP_LOADADDR as default load address sherry sun
@ 2019-07-18  1:40 ` sherry sun
  2019-07-18  7:32   ` Lukasz Majewski
  2019-07-18  1:40 ` [U-Boot] [PATCH 4/4] SDP: Call usb_gadget_initialize and usb_gadget_release to support UDC sherry sun
  2019-07-28 14:06 ` [U-Boot] [PATCH 0/4] Make some changes to SDP Angus Ainslie
  4 siblings, 1 reply; 24+ messages in thread
From: sherry sun @ 2019-07-18  1:40 UTC (permalink / raw)
  To: u-boot

From: Sherry Sun <sherry.sun@nxp.com>

Because the buffer length of sdp usb request is 65, we have to allocate
65 bytes not 64 bytes. Otherwise there is potential buffer overflow.

So the wMaxPacketSize of fullspeed can't meet the needs. Add HS
endpoint descriptor for SDP. Then we can use high speed endpoint,
and the SDP device can send packet with 512 byte size.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
---
 drivers/usb/gadget/f_sdp.c | 33 ++++++++++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
index b1601575e0..532041063a 100644
--- a/drivers/usb/gadget/f_sdp.c
+++ b/drivers/usb/gadget/f_sdp.c
@@ -157,6 +157,16 @@ static struct usb_endpoint_descriptor in_desc = {
 	.bInterval =		1,
 };
 
+static struct usb_endpoint_descriptor in_hs_desc = {
+	.bLength =		USB_DT_ENDPOINT_SIZE,
+	.bDescriptorType =	USB_DT_ENDPOINT, /*USB_DT_CS_ENDPOINT*/
+
+	.bEndpointAddress =	1 | USB_DIR_IN,
+	.bmAttributes =	USB_ENDPOINT_XFER_INT,
+	.wMaxPacketSize =	512,
+	.bInterval =		1,
+};
+
 static struct usb_descriptor_header *sdp_runtime_descs[] = {
 	(struct usb_descriptor_header *)&sdp_intf_runtime,
 	(struct usb_descriptor_header *)&sdp_hid_desc,
@@ -164,6 +174,13 @@ static struct usb_descriptor_header *sdp_runtime_descs[] = {
 	NULL,
 };
 
+static struct usb_descriptor_header *sdp_runtime_hs_descs[] = {
+	(struct usb_descriptor_header *)&sdp_intf_runtime,
+	(struct usb_descriptor_header *)&sdp_hid_desc,
+	(struct usb_descriptor_header *)&in_hs_desc,
+	NULL,
+};
+
 /* This is synchronized with what the SoC implementation reports */
 static struct hid_report sdp_hid_report = {
 	.usage_page = {
@@ -489,6 +506,11 @@ static int sdp_bind(struct usb_configuration *c, struct usb_function *f)
 		goto error;
 	}
 
+	if (gadget_is_dualspeed(gadget)) {
+		/* Assume endpoint addresses are the same for both speeds */
+		in_hs_desc.bEndpointAddress = in_desc.bEndpointAddress;
+	}
+
 	sdp->in_ep = ep; /* Store IN EP for enabling @ setup */
 
 	cdev->req->context = sdp;
@@ -526,7 +548,7 @@ static struct usb_request *sdp_start_ep(struct usb_ep *ep)
 {
 	struct usb_request *req;
 
-	req = alloc_ep_req(ep, 64);
+	req = alloc_ep_req(ep, 65);
 	debug("%s: ep:%p req:%p\n", __func__, ep, req);
 
 	if (!req)
@@ -541,11 +563,15 @@ static int sdp_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
 {
 	struct f_sdp *sdp = func_to_sdp(f);
 	struct usb_composite_dev *cdev = f->config->cdev;
+	struct usb_gadget *gadget = cdev->gadget;
 	int result;
 
 	debug("%s: intf: %d alt: %d\n", __func__, intf, alt);
 
-	result = usb_ep_enable(sdp->in_ep, &in_desc);
+	if (gadget_is_dualspeed(gadget) && gadget->speed == USB_SPEED_HIGH)
+		result = usb_ep_enable(sdp->in_ep, &in_hs_desc);
+	else
+		result = usb_ep_enable(sdp->in_ep, &in_desc);
 	if (result)
 		return result;
 	sdp->in_req = sdp_start_ep(sdp->in_ep);
@@ -591,7 +617,7 @@ static int sdp_bind_config(struct usb_configuration *c)
 	memset(sdp_func, 0, sizeof(*sdp_func));
 
 	sdp_func->usb_function.name = "sdp";
-	sdp_func->usb_function.hs_descriptors = sdp_runtime_descs;
+	sdp_func->usb_function.hs_descriptors = sdp_runtime_hs_descs;
 	sdp_func->usb_function.descriptors = sdp_runtime_descs;
 	sdp_func->usb_function.bind = sdp_bind;
 	sdp_func->usb_function.unbind = sdp_unbind;
@@ -724,6 +750,7 @@ static void sdp_handle_in_ep(struct spl_image_info *spl_image)
 			/* In SPL, allow jumps to U-Boot images */
 			struct spl_image_info spl_image = {};
 			spl_parse_image_header(&spl_image, header);
+
 			jump_to_image_no_args(&spl_image);
 #else
 			/* In U-Boot, allow jumps to scripts */
-- 
2.17.1

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

* [U-Boot] [PATCH 4/4] SDP: Call usb_gadget_initialize and usb_gadget_release to support UDC
  2019-07-18  1:40 [U-Boot] [PATCH 0/4] Make some changes to SDP sherry sun
                   ` (2 preceding siblings ...)
  2019-07-18  1:40 ` [U-Boot] [PATCH 3/4] SDP: fix wrong usb request size and add high speed endpoint descriptor sherry sun
@ 2019-07-18  1:40 ` sherry sun
  2019-07-18  7:32   ` Lukasz Majewski
  2019-07-28 14:06 ` [U-Boot] [PATCH 0/4] Make some changes to SDP Angus Ainslie
  4 siblings, 1 reply; 24+ messages in thread
From: sherry sun @ 2019-07-18  1:40 UTC (permalink / raw)
  To: u-boot

From: Sherry Sun <sherry.sun@nxp.com>

Need initialize UDC before run sdp download and release it at the end of
sdp.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 common/spl/spl_sdp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/common/spl/spl_sdp.c b/common/spl/spl_sdp.c
index 806bf1327e..7b0a213d4c 100644
--- a/common/spl/spl_sdp.c
+++ b/common/spl/spl_sdp.c
@@ -16,6 +16,8 @@ static int spl_sdp_load_image(struct spl_image_info *spl_image,
 	int ret;
 	const int controller_index = 0;
 
+	usb_gadget_initialize(controller_index);
+
 	g_dnl_clear_detach();
 	ret = g_dnl_register("usb_dnl_sdp");
 	if (ret) {
@@ -37,6 +39,8 @@ static int spl_sdp_load_image(struct spl_image_info *spl_image,
 	ret = spl_sdp_handle(controller_index, spl_image);
 	debug("SDP ended\n");
 
+	usb_gadget_release(controller_index);
+
 	return ret;
 }
 SPL_LOAD_IMAGE_METHOD("USB SDP", 0, BOOT_DEVICE_BOARD, spl_sdp_load_image);
-- 
2.17.1

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

* [U-Boot] [PATCH 1/4] imx: spl: Change USB boot device type
  2019-07-18  1:40 ` [U-Boot] [PATCH 1/4] imx: spl: Change USB boot device type sherry sun
@ 2019-07-18  7:27   ` Lukasz Majewski
  2019-07-18  7:38     ` Peng Fan
  0 siblings, 1 reply; 24+ messages in thread
From: Lukasz Majewski @ 2019-07-18  7:27 UTC (permalink / raw)
  To: u-boot

Hi Sherry,

> From: Sherry Sun <sherry.sun@nxp.com>
> 
> The SPL SDP is configured as BOOT_DEVICE_BOARD, so when booting from
> USB, change its type to BOOT_DEVICE_BOARD, so we can use SDP.
> 
> Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> Signed-off-by: Ye Li <ye.li@nxp.com>
> ---
>  arch/arm/mach-imx/spl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
> index 9f1e0f6a72..2355019243 100644
> --- a/arch/arm/mach-imx/spl.c
> +++ b/arch/arm/mach-imx/spl.c
> @@ -156,7 +156,7 @@ u32 spl_boot_device(void)
>  	case SPI_NOR_BOOT:
>  		return BOOT_DEVICE_SPI;
>  	case USB_BOOT:
> -		return BOOT_DEVICE_USB;
> +		return BOOT_DEVICE_BOARD;

Why this change is required? What is the problem you are trying to
solve here? (And it is always welcome if one write the detailed
description of the problem in the commit message).

I've been using recently SDP (with uuu on imx6q) and I did not
experience any issues.

>  	default:
>  		return BOOT_DEVICE_NONE;
>  	}




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190718/c3a6df85/attachment.sig>

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

* [U-Boot] [PATCH 2/4] SDP: use CONFIG_SDP_LOADADDR as default load address
  2019-07-18  1:40 ` [U-Boot] [PATCH 2/4] SDP: use CONFIG_SDP_LOADADDR as default load address sherry sun
@ 2019-07-18  7:29   ` Lukasz Majewski
  0 siblings, 0 replies; 24+ messages in thread
From: Lukasz Majewski @ 2019-07-18  7:29 UTC (permalink / raw)
  To: u-boot

On Thu, 18 Jul 2019 09:40:54 +0800
sherry sun <sherry.sun@nxp.com> wrote:

> From: Sherry Sun <sherry.sun@nxp.com>
> 
> If SDP_WRITE and SDP_JUMP command addr is zero, use
> CONFIG_SDP_LOADADDR as default address.
> 
> Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>  drivers/usb/gadget/Kconfig | 4 ++++
>  drivers/usb/gadget/f_sdp.c | 6 ++++--
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
> index 26b4d12a09..172a82195b 100644
> --- a/drivers/usb/gadget/Kconfig
> +++ b/drivers/usb/gadget/Kconfig
> @@ -115,6 +115,10 @@ config USB_GADGET_VBUS_DRAW
>  	   This value will be used except for system-specific gadget
>  	   drivers that have more specific information.
>  
> +config SDP_LOADADDR
> +	hex "Default load address at SDP_WRITE and SDP_JUMP"
> +	default 0
> +
>  # Selected by UDC drivers that support high-speed operation.
>  config USB_GADGET_DUALSPEED
>  	bool
> diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
> index fab7ce6f97..b1601575e0 100644
> --- a/drivers/usb/gadget/f_sdp.c
> +++ b/drivers/usb/gadget/f_sdp.c
> @@ -275,7 +275,8 @@ static void sdp_rx_command_complete(struct usb_ep
> *ep, struct usb_request *req) sdp->error_status =
> SDP_WRITE_FILE_COMPLETE; 
>  		sdp->state = SDP_STATE_RX_FILE_DATA;
> -		sdp->dnl_address = be32_to_cpu(cmd->addr);
> +		sdp->dnl_address = cmd->addr ?
> be32_to_cpu(cmd->addr) :
> +					       CONFIG_SDP_LOADADDR;
>  		sdp->dnl_bytes_remaining = be32_to_cpu(cmd->cnt);
>  		sdp->dnl_bytes = sdp->dnl_bytes_remaining;
>  		sdp->next_state = SDP_STATE_IDLE;
> @@ -303,7 +304,8 @@ static void sdp_rx_command_complete(struct usb_ep
> *ep, struct usb_request *req) sdp->always_send_status = false;
>  		sdp->error_status = 0;
>  
> -		sdp->jmp_address = be32_to_cpu(cmd->addr);
> +		sdp->jmp_address = cmd->addr ?
> be32_to_cpu(cmd->addr) :
> +					       CONFIG_SDP_LOADADDR;
>  		sdp->state = SDP_STATE_TX_SEC_CONF;
>  		sdp->next_state = SDP_STATE_JUMP;
>  		break;

Reviewed-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190718/6dc5dfe9/attachment.sig>

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

* [U-Boot] [PATCH 3/4] SDP: fix wrong usb request size and add high speed endpoint descriptor
  2019-07-18  1:40 ` [U-Boot] [PATCH 3/4] SDP: fix wrong usb request size and add high speed endpoint descriptor sherry sun
@ 2019-07-18  7:32   ` Lukasz Majewski
  2019-07-18  8:56     ` [U-Boot] 答复: " Sherry Sun
  0 siblings, 1 reply; 24+ messages in thread
From: Lukasz Majewski @ 2019-07-18  7:32 UTC (permalink / raw)
  To: u-boot

Hi Sherry,

> From: Sherry Sun <sherry.sun@nxp.com>
> 
> Because the buffer length of sdp usb request is 65, 

Is the value 65 mentioned somewhere (in any doc/spec)?

As fair as I remember other protocols - like DFU use 64B. Do we need
here to store extra \0 or \n ?

The 64 bytes are default packet size on EP0.


If I may ask - what user space program do you use? imx_loader (imx_usb)
or uuu ?

> we have to
> allocate 65 bytes not 64 bytes. Otherwise there is potential buffer
> overflow.
> 
> So the wMaxPacketSize of fullspeed can't meet the needs. Add HS
> endpoint descriptor for SDP. Then we can use high speed endpoint,
> and the SDP device can send packet with 512 byte size.
> 
> Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> Signed-off-by: Ye Li <ye.li@nxp.com>
> ---
>  drivers/usb/gadget/f_sdp.c | 33 ++++++++++++++++++++++++++++++---
>  1 file changed, 30 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
> index b1601575e0..532041063a 100644
> --- a/drivers/usb/gadget/f_sdp.c
> +++ b/drivers/usb/gadget/f_sdp.c
> @@ -157,6 +157,16 @@ static struct usb_endpoint_descriptor in_desc = {
>  	.bInterval =		1,
>  };
>  
> +static struct usb_endpoint_descriptor in_hs_desc = {
> +	.bLength =		USB_DT_ENDPOINT_SIZE,
> +	.bDescriptorType =
> USB_DT_ENDPOINT, /*USB_DT_CS_ENDPOINT*/ +
> +	.bEndpointAddress =	1 | USB_DIR_IN,
> +	.bmAttributes =	USB_ENDPOINT_XFER_INT,
> +	.wMaxPacketSize =	512,
> +	.bInterval =		1,

Which endpoint do we use in SDP? EP0 or EP1...n ?

> +};
> +
>  static struct usb_descriptor_header *sdp_runtime_descs[] = {
>  	(struct usb_descriptor_header *)&sdp_intf_runtime,
>  	(struct usb_descriptor_header *)&sdp_hid_desc,
> @@ -164,6 +174,13 @@ static struct usb_descriptor_header
> *sdp_runtime_descs[] = { NULL,
>  };
>  
> +static struct usb_descriptor_header *sdp_runtime_hs_descs[] = {
> +	(struct usb_descriptor_header *)&sdp_intf_runtime,
> +	(struct usb_descriptor_header *)&sdp_hid_desc,
> +	(struct usb_descriptor_header *)&in_hs_desc,
> +	NULL,
> +};
> +
>  /* This is synchronized with what the SoC implementation reports */
>  static struct hid_report sdp_hid_report = {
>  	.usage_page = {
> @@ -489,6 +506,11 @@ static int sdp_bind(struct usb_configuration *c,
> struct usb_function *f) goto error;
>  	}
>  
> +	if (gadget_is_dualspeed(gadget)) {
> +		/* Assume endpoint addresses are the same for both
> speeds */
> +		in_hs_desc.bEndpointAddress =
> in_desc.bEndpointAddress;
> +	}
> +
>  	sdp->in_ep = ep; /* Store IN EP for enabling @ setup */
>  
>  	cdev->req->context = sdp;
> @@ -526,7 +548,7 @@ static struct usb_request *sdp_start_ep(struct
> usb_ep *ep) {
>  	struct usb_request *req;
>  
> -	req = alloc_ep_req(ep, 64);
> +	req = alloc_ep_req(ep, 65);
>  	debug("%s: ep:%p req:%p\n", __func__, ep, req);
>  
>  	if (!req)
> @@ -541,11 +563,15 @@ static int sdp_set_alt(struct usb_function *f,
> unsigned intf, unsigned alt) {
>  	struct f_sdp *sdp = func_to_sdp(f);
>  	struct usb_composite_dev *cdev = f->config->cdev;
> +	struct usb_gadget *gadget = cdev->gadget;
>  	int result;
>  
>  	debug("%s: intf: %d alt: %d\n", __func__, intf, alt);
>  
> -	result = usb_ep_enable(sdp->in_ep, &in_desc);
> +	if (gadget_is_dualspeed(gadget) && gadget->speed ==
> USB_SPEED_HIGH)
> +		result = usb_ep_enable(sdp->in_ep, &in_hs_desc);
> +	else
> +		result = usb_ep_enable(sdp->in_ep, &in_desc);
>  	if (result)
>  		return result;
>  	sdp->in_req = sdp_start_ep(sdp->in_ep);
> @@ -591,7 +617,7 @@ static int sdp_bind_config(struct
> usb_configuration *c) memset(sdp_func, 0, sizeof(*sdp_func));
>  
>  	sdp_func->usb_function.name = "sdp";
> -	sdp_func->usb_function.hs_descriptors = sdp_runtime_descs;
> +	sdp_func->usb_function.hs_descriptors = sdp_runtime_hs_descs;
>  	sdp_func->usb_function.descriptors = sdp_runtime_descs;
>  	sdp_func->usb_function.bind = sdp_bind;
>  	sdp_func->usb_function.unbind = sdp_unbind;
> @@ -724,6 +750,7 @@ static void sdp_handle_in_ep(struct
> spl_image_info *spl_image) /* In SPL, allow jumps to U-Boot images */
>  			struct spl_image_info spl_image = {};
>  			spl_parse_image_header(&spl_image, header);
> +
>  			jump_to_image_no_args(&spl_image);
>  #else
>  			/* In U-Boot, allow jumps to scripts */




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190718/e15ff166/attachment.sig>

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

* [U-Boot] [PATCH 4/4] SDP: Call usb_gadget_initialize and usb_gadget_release to support UDC
  2019-07-18  1:40 ` [U-Boot] [PATCH 4/4] SDP: Call usb_gadget_initialize and usb_gadget_release to support UDC sherry sun
@ 2019-07-18  7:32   ` Lukasz Majewski
  0 siblings, 0 replies; 24+ messages in thread
From: Lukasz Majewski @ 2019-07-18  7:32 UTC (permalink / raw)
  To: u-boot

On Thu, 18 Jul 2019 09:40:56 +0800
sherry sun <sherry.sun@nxp.com> wrote:

> From: Sherry Sun <sherry.sun@nxp.com>
> 
> Need initialize UDC before run sdp download and release it at the end
> of sdp.
> 
> Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>  common/spl/spl_sdp.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/common/spl/spl_sdp.c b/common/spl/spl_sdp.c
> index 806bf1327e..7b0a213d4c 100644
> --- a/common/spl/spl_sdp.c
> +++ b/common/spl/spl_sdp.c
> @@ -16,6 +16,8 @@ static int spl_sdp_load_image(struct spl_image_info
> *spl_image, int ret;
>  	const int controller_index = 0;
>  
> +	usb_gadget_initialize(controller_index);
> +
>  	g_dnl_clear_detach();
>  	ret = g_dnl_register("usb_dnl_sdp");
>  	if (ret) {
> @@ -37,6 +39,8 @@ static int spl_sdp_load_image(struct spl_image_info
> *spl_image, ret = spl_sdp_handle(controller_index, spl_image);
>  	debug("SDP ended\n");
>  
> +	usb_gadget_release(controller_index);
> +
>  	return ret;
>  }
>  SPL_LOAD_IMAGE_METHOD("USB SDP", 0, BOOT_DEVICE_BOARD,
> spl_sdp_load_image);

Reviewed-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190718/de8e0c4d/attachment.sig>

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

* [U-Boot] [PATCH 1/4] imx: spl: Change USB boot device type
  2019-07-18  7:27   ` Lukasz Majewski
@ 2019-07-18  7:38     ` Peng Fan
  2019-07-18  7:44       ` Lukasz Majewski
  0 siblings, 1 reply; 24+ messages in thread
From: Peng Fan @ 2019-07-18  7:38 UTC (permalink / raw)
  To: u-boot

Hi Lukasz,

> Subject: Re: [PATCH 1/4] imx: spl: Change USB boot device type
> 
> Hi Sherry,
> 
> > From: Sherry Sun <sherry.sun@nxp.com>
> >
> > The SPL SDP is configured as BOOT_DEVICE_BOARD, so when booting from
> > USB, change its type to BOOT_DEVICE_BOARD, so we can use SDP.
> >
> > Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> > Signed-off-by: Ye Li <ye.li@nxp.com>
> > ---
> >  arch/arm/mach-imx/spl.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c index
> > 9f1e0f6a72..2355019243 100644
> > --- a/arch/arm/mach-imx/spl.c
> > +++ b/arch/arm/mach-imx/spl.c
> > @@ -156,7 +156,7 @@ u32 spl_boot_device(void)
> >  	case SPI_NOR_BOOT:
> >  		return BOOT_DEVICE_SPI;
> >  	case USB_BOOT:
> > -		return BOOT_DEVICE_USB;
> > +		return BOOT_DEVICE_BOARD;
> 
> Why this change is required? What is the problem you are trying to solve here?
> (And it is always welcome if one write the detailed description of the problem
> in the commit message).

It is spl sdp need it.
SPL_LOAD_IMAGE_METHOD("USB SDP", 0, BOOT_DEVICE_BOARD, spl_sdp_load_image);

Regards,
Peng.

> 
> I've been using recently SDP (with uuu on imx6q) and I did not experience any
> issues.
> 
> >  	default:
> >  		return BOOT_DEVICE_NONE;
> >  	}
> 
> 
> 
> 
> Best regards,
> 
> Lukasz Majewski
> 
> --
> 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> lukma at denx.de

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

* [U-Boot] [PATCH 1/4] imx: spl: Change USB boot device type
  2019-07-18  7:38     ` Peng Fan
@ 2019-07-18  7:44       ` Lukasz Majewski
  2019-07-18  7:47         ` Peng Fan
  2019-07-18  9:24         ` [U-Boot] 答复: [EXT] " Sherry Sun
  0 siblings, 2 replies; 24+ messages in thread
From: Lukasz Majewski @ 2019-07-18  7:44 UTC (permalink / raw)
  To: u-boot

On Thu, 18 Jul 2019 07:38:10 +0000
Peng Fan <peng.fan@nxp.com> wrote:

> Hi Lukasz,
> 
> > Subject: Re: [PATCH 1/4] imx: spl: Change USB boot device type
> > 
> > Hi Sherry,
> >   
> > > From: Sherry Sun <sherry.sun@nxp.com>
> > >
> > > The SPL SDP is configured as BOOT_DEVICE_BOARD, so when booting
> > > from USB, change its type to BOOT_DEVICE_BOARD, so we can use SDP.
> > >
> > > Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> > > Signed-off-by: Ye Li <ye.li@nxp.com>
> > > ---
> > >  arch/arm/mach-imx/spl.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
> > > index 9f1e0f6a72..2355019243 100644
> > > --- a/arch/arm/mach-imx/spl.c
> > > +++ b/arch/arm/mach-imx/spl.c
> > > @@ -156,7 +156,7 @@ u32 spl_boot_device(void)
> > >  	case SPI_NOR_BOOT:
> > >  		return BOOT_DEVICE_SPI;
> > >  	case USB_BOOT:
> > > -		return BOOT_DEVICE_USB;
> > > +		return BOOT_DEVICE_BOARD;  
> > 
> > Why this change is required? What is the problem you are trying to
> > solve here? (And it is always welcome if one write the detailed
> > description of the problem in the commit message).  
> 
> It is spl sdp need it.
> SPL_LOAD_IMAGE_METHOD("USB SDP", 0, BOOT_DEVICE_BOARD,
> spl_sdp_load_image);

My point is why this error was not apparent earlier (or when I was
using the uuu with newest u-boot)?

I'm just curious why let's say "average" uuu/SDP user did not
encountered this problem (as I had also to recover SPL on my i.MX6
board).

> 
> Regards,
> Peng.
> 
> > 
> > I've been using recently SDP (with uuu on imx6q) and I did not
> > experience any issues.
> >   
> > >  	default:
> > >  		return BOOT_DEVICE_NONE;
> > >  	}  
> > 
> > 
> > 
> > 
> > Best regards,
> > 
> > Lukasz Majewski
> > 
> > --
> > 
> > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > lukma at denx.de  




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190718/54f0797a/attachment.sig>

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

* [U-Boot] [PATCH 1/4] imx: spl: Change USB boot device type
  2019-07-18  7:44       ` Lukasz Majewski
@ 2019-07-18  7:47         ` Peng Fan
  2019-07-18  9:27           ` Lukasz Majewski
  2019-07-18  9:24         ` [U-Boot] 答复: [EXT] " Sherry Sun
  1 sibling, 1 reply; 24+ messages in thread
From: Peng Fan @ 2019-07-18  7:47 UTC (permalink / raw)
  To: u-boot

> Subject: Re: [PATCH 1/4] imx: spl: Change USB boot device type
> 
> On Thu, 18 Jul 2019 07:38:10 +0000
> Peng Fan <peng.fan@nxp.com> wrote:
> 
> > Hi Lukasz,
> >
> > > Subject: Re: [PATCH 1/4] imx: spl: Change USB boot device type
> > >
> > > Hi Sherry,
> > >
> > > > From: Sherry Sun <sherry.sun@nxp.com>
> > > >
> > > > The SPL SDP is configured as BOOT_DEVICE_BOARD, so when booting
> > > > from USB, change its type to BOOT_DEVICE_BOARD, so we can use SDP.
> > > >
> > > > Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> > > > Signed-off-by: Ye Li <ye.li@nxp.com>
> > > > ---
> > > >  arch/arm/mach-imx/spl.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
> > > > index 9f1e0f6a72..2355019243 100644
> > > > --- a/arch/arm/mach-imx/spl.c
> > > > +++ b/arch/arm/mach-imx/spl.c
> > > > @@ -156,7 +156,7 @@ u32 spl_boot_device(void)
> > > >  	case SPI_NOR_BOOT:
> > > >  		return BOOT_DEVICE_SPI;
> > > >  	case USB_BOOT:
> > > > -		return BOOT_DEVICE_USB;
> > > > +		return BOOT_DEVICE_BOARD;
> > >
> > > Why this change is required? What is the problem you are trying to
> > > solve here? (And it is always welcome if one write the detailed
> > > description of the problem in the commit message).
> >
> > It is spl sdp need it.
> > SPL_LOAD_IMAGE_METHOD("USB SDP", 0, BOOT_DEVICE_BOARD,
> > spl_sdp_load_image);
> 
> My point is why this error was not apparent earlier (or when I was using the
> uuu with newest u-boot)?

The patch changes the i.MX7/8/8M spl_boot_device,
i.MX7 already have BOARD support. i.MX8/8M has not been verified
SDP before, so this patch is to fix for i.MX8/8M SDP.

Regards,
Peng.

> 
> I'm just curious why let's say "average" uuu/SDP user did not encountered this
> problem (as I had also to recover SPL on my i.MX6 board).
> 
> >
> > Regards,
> > Peng.
> >
> > >
> > > I've been using recently SDP (with uuu on imx6q) and I did not
> > > experience any issues.
> > >
> > > >  	default:
> > > >  		return BOOT_DEVICE_NONE;
> > > >  	}
> > >
> > >
> > >
> > >
> > > Best regards,
> > >
> > > Lukasz Majewski
> > >
> > > --
> > >
> > > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> > > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > > lukma at denx.de
> 
> 
> 
> 
> Best regards,
> 
> Lukasz Majewski
> 
> --
> 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> lukma at denx.de

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

* [U-Boot] 答复: [PATCH 3/4] SDP: fix wrong usb request size and add high speed endpoint descriptor
  2019-07-18  7:32   ` Lukasz Majewski
@ 2019-07-18  8:56     ` Sherry Sun
  0 siblings, 0 replies; 24+ messages in thread
From: Sherry Sun @ 2019-07-18  8:56 UTC (permalink / raw)
  To: u-boot


Hi, Lukasz

> 
> Hi Sherry,
> 
> > From: Sherry Sun <sherry.sun@nxp.com>
> >
> > Because the buffer length of sdp usb request is 65,
> 
> Is the value 65 mentioned somewhere (in any doc/spec)?
> 
> As fair as I remember other protocols - like DFU use 64B. Do we need here to
> store extra \0 or \n ?
> 

You can see case SDP_STATE_TX_STATUS and case SDP_STATE_TX_REGISTER in
static void sdp_handle_in_ep(struct spl_image_info *spl_image)
Here sdp_func->in_req->length = 65; 

Data[0] is the report id, and the next 64 bytes are the date to host.
So totally we need 65 bytes.

> The 64 bytes are default packet size on EP0.
> 
> 
> If I may ask - what user space program do you use? imx_loader (imx_usb) or
> uuu ?
> 

Yes, I use uuu.


> > we have to
> > allocate 65 bytes not 64 bytes. Otherwise there is potential buffer
> > overflow.
> >
> > So the wMaxPacketSize of fullspeed can't meet the needs. Add HS
> > endpoint descriptor for SDP. Then we can use high speed endpoint, and
> > the SDP device can send packet with 512 byte size.
> >
> > Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> > Signed-off-by: Ye Li <ye.li@nxp.com>
> > ---
> >  drivers/usb/gadget/f_sdp.c | 33 ++++++++++++++++++++++++++++++---
> >  1 file changed, 30 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
> > index b1601575e0..532041063a 100644
> > --- a/drivers/usb/gadget/f_sdp.c
> > +++ b/drivers/usb/gadget/f_sdp.c
> > @@ -157,6 +157,16 @@ static struct usb_endpoint_descriptor in_desc = {
> >  	.bInterval =		1,
> >  };
> >
> > +static struct usb_endpoint_descriptor in_hs_desc = {
> > +	.bLength =		USB_DT_ENDPOINT_SIZE,
> > +	.bDescriptorType =
> > USB_DT_ENDPOINT, /*USB_DT_CS_ENDPOINT*/ +
> > +	.bEndpointAddress =	1 | USB_DIR_IN,
> > +	.bmAttributes =	USB_ENDPOINT_XFER_INT,
> > +	.wMaxPacketSize =	512,
> > +	.bInterval =		1,
> 
> Which endpoint do we use in SDP? EP0 or EP1...n ?

We use EP0 to transfer datas from host to device in report 1 and report 2.
And use EP1 to transfer datas from device to host in report3 and report 4.


> 
> > +};
> > +
> >  static struct usb_descriptor_header *sdp_runtime_descs[] = {
> >  	(struct usb_descriptor_header *)&sdp_intf_runtime,
> >  	(struct usb_descriptor_header *)&sdp_hid_desc, @@ -164,6 +174,13 @@
> > static struct usb_descriptor_header *sdp_runtime_descs[] = { NULL,  };
> >
> > +static struct usb_descriptor_header *sdp_runtime_hs_descs[] = {
> > +	(struct usb_descriptor_header *)&sdp_intf_runtime,
> > +	(struct usb_descriptor_header *)&sdp_hid_desc,
> > +	(struct usb_descriptor_header *)&in_hs_desc,
> > +	NULL,
> > +};
> > +
> >  /* This is synchronized with what the SoC implementation reports */
> > static struct hid_report sdp_hid_report = {
> >  	.usage_page = {
> > @@ -489,6 +506,11 @@ static int sdp_bind(struct usb_configuration *c,
> > struct usb_function *f) goto error;
> >  	}
> >
> > +	if (gadget_is_dualspeed(gadget)) {
> > +		/* Assume endpoint addresses are the same for both
> > speeds */
> > +		in_hs_desc.bEndpointAddress =
> > in_desc.bEndpointAddress;
> > +	}
> > +
> >  	sdp->in_ep = ep; /* Store IN EP for enabling @ setup */
> >
> >  	cdev->req->context = sdp;
> > @@ -526,7 +548,7 @@ static struct usb_request *sdp_start_ep(struct
> > usb_ep *ep) {
> >  	struct usb_request *req;
> >
> > -	req = alloc_ep_req(ep, 64);
> > +	req = alloc_ep_req(ep, 65);
> >  	debug("%s: ep:%p req:%p\n", __func__, ep, req);
> >
> >  	if (!req)
> > @@ -541,11 +563,15 @@ static int sdp_set_alt(struct usb_function *f,
> > unsigned intf, unsigned alt) {
> >  	struct f_sdp *sdp = func_to_sdp(f);
> >  	struct usb_composite_dev *cdev = f->config->cdev;
> > +	struct usb_gadget *gadget = cdev->gadget;
> >  	int result;
> >
> >  	debug("%s: intf: %d alt: %d\n", __func__, intf, alt);
> >
> > -	result = usb_ep_enable(sdp->in_ep, &in_desc);
> > +	if (gadget_is_dualspeed(gadget) && gadget->speed ==
> > USB_SPEED_HIGH)
> > +		result = usb_ep_enable(sdp->in_ep, &in_hs_desc);
> > +	else
> > +		result = usb_ep_enable(sdp->in_ep, &in_desc);
> >  	if (result)
> >  		return result;
> >  	sdp->in_req = sdp_start_ep(sdp->in_ep); @@ -591,7 +617,7 @@ static
> > int sdp_bind_config(struct usb_configuration *c) memset(sdp_func, 0,
> > sizeof(*sdp_func));
> >
> >  	sdp_func->usb_function.name = "sdp";
> > -	sdp_func->usb_function.hs_descriptors = sdp_runtime_descs;
> > +	sdp_func->usb_function.hs_descriptors = sdp_runtime_hs_descs;
> >  	sdp_func->usb_function.descriptors = sdp_runtime_descs;
> >  	sdp_func->usb_function.bind = sdp_bind;
> >  	sdp_func->usb_function.unbind = sdp_unbind; @@ -724,6 +750,7 @@
> > static void sdp_handle_in_ep(struct spl_image_info *spl_image) /* In
> > SPL, allow jumps to U-Boot images */
> >  			struct spl_image_info spl_image = {};
> >  			spl_parse_image_header(&spl_image, header);
> > +
> >  			jump_to_image_no_args(&spl_image);
> >  #else
> >  			/* In U-Boot, allow jumps to scripts */
> 
> 
> 
> 
> Best regards,
> 
> Lukasz Majewski
> 
> --
> 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> lukma at denx.de



Best regards
Sherry sun

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

* [U-Boot] 答复: [EXT] Re: [PATCH 1/4] imx: spl: Change USB boot device type
  2019-07-18  7:44       ` Lukasz Majewski
  2019-07-18  7:47         ` Peng Fan
@ 2019-07-18  9:24         ` Sherry Sun
  1 sibling, 0 replies; 24+ messages in thread
From: Sherry Sun @ 2019-07-18  9:24 UTC (permalink / raw)
  To: u-boot

Hi, Lukasz


> 
> On Thu, 18 Jul 2019 07:38:10 +0000
> Peng Fan <peng.fan@nxp.com> wrote:
> 
> > Hi Lukasz,
> >
> > > Subject: Re: [PATCH 1/4] imx: spl: Change USB boot device type
> > >
> > > Hi Sherry,
> > >
> > > > From: Sherry Sun <sherry.sun@nxp.com>
> > > >
> > > > The SPL SDP is configured as BOOT_DEVICE_BOARD, so when booting
> > > > from USB, change its type to BOOT_DEVICE_BOARD, so we can use SDP.
> > > >
> > > > Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> > > > Signed-off-by: Ye Li <ye.li@nxp.com>
> > > > ---
> > > >  arch/arm/mach-imx/spl.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
> > > > index 9f1e0f6a72..2355019243 100644
> > > > --- a/arch/arm/mach-imx/spl.c
> > > > +++ b/arch/arm/mach-imx/spl.c
> > > > @@ -156,7 +156,7 @@ u32 spl_boot_device(void)
> > > >  	case SPI_NOR_BOOT:
> > > >  		return BOOT_DEVICE_SPI;
> > > >  	case USB_BOOT:
> > > > -		return BOOT_DEVICE_USB;
> > > > +		return BOOT_DEVICE_BOARD;
> > >
> > > Why this change is required? What is the problem you are trying to
> > > solve here? (And it is always welcome if one write the detailed
> > > description of the problem in the commit message).
> >
> > It is spl sdp need it.
> > SPL_LOAD_IMAGE_METHOD("USB SDP", 0, BOOT_DEVICE_BOARD,
> > spl_sdp_load_image);
> 
> My point is why this error was not apparent earlier (or when I was using the
> uuu with newest u-boot)?
> 
> I'm just curious why let's say "average" uuu/SDP user did not encountered this
> problem (as I had also to recover SPL on my i.MX6 board).

This change is only available on imx8 and imx8m platform.

For imx7, BOOT_DEVICE_BOARD has already been set at the beginning of u32 spl_boot_device(void).
For imx6, BOOT_DEVICE_BOARD also has been set as below.
 21#if defined(CONFIG_MX6)
 22 /* determine boot device from SRC_SBMR1 (BOOT_CFG[4:1]) or SRC_GPR9 register */
 23 u32 spl_boot_device(void)
 24 {
 25     unsigned int bmode = readl(&src_base->sbmr2);
 26     u32 reg = imx6_src_get_boot_mode();
 27
 28     /*
 29      * Check for BMODE if serial downloader is enabled
 30      * BOOT_MODE - see IMX6DQRM Table 8-1
 31      */
 32     if (((bmode >> 24) & 0x03) == 0x01) /* Serial Downloader */
 33         return BOOT_DEVICE_BOARD;


> 
> >
> > Regards,
> > Peng.
> >
> > >
> > > I've been using recently SDP (with uuu on imx6q) and I did not
> > > experience any issues.
> > >
> > > >  	default:
> > > >  		return BOOT_DEVICE_NONE;
> > > >  	}
> > >
> > >
> > >
> > >
> > > Best regards,
> > >
> > > Lukasz Majewski
> > >
> > > --
> > >
> > > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> > > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > > lukma at denx.de
> 
> 
> 
> 
> Best regards,
> 
> Lukasz Majewski
> 
> --
> 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> lukma at denx.de


Best regards
Sherry sun

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

* [U-Boot] [PATCH 1/4] imx: spl: Change USB boot device type
  2019-07-18  7:47         ` Peng Fan
@ 2019-07-18  9:27           ` Lukasz Majewski
  2019-07-18 11:01             ` [U-Boot] 答复: " Sherry Sun
  0 siblings, 1 reply; 24+ messages in thread
From: Lukasz Majewski @ 2019-07-18  9:27 UTC (permalink / raw)
  To: u-boot

On Thu, 18 Jul 2019 07:47:53 +0000
Peng Fan <peng.fan@nxp.com> wrote:

> > Subject: Re: [PATCH 1/4] imx: spl: Change USB boot device type
> > 
> > On Thu, 18 Jul 2019 07:38:10 +0000
> > Peng Fan <peng.fan@nxp.com> wrote:
> >   
> > > Hi Lukasz,
> > >  
> > > > Subject: Re: [PATCH 1/4] imx: spl: Change USB boot device type
> > > >
> > > > Hi Sherry,
> > > >  
> > > > > From: Sherry Sun <sherry.sun@nxp.com>
> > > > >
> > > > > The SPL SDP is configured as BOOT_DEVICE_BOARD, so when
> > > > > booting from USB, change its type to BOOT_DEVICE_BOARD, so we
> > > > > can use SDP.
> > > > >
> > > > > Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> > > > > Signed-off-by: Ye Li <ye.li@nxp.com>
> > > > > ---
> > > > >  arch/arm/mach-imx/spl.c | 2 +-
> > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
> > > > > index 9f1e0f6a72..2355019243 100644
> > > > > --- a/arch/arm/mach-imx/spl.c
> > > > > +++ b/arch/arm/mach-imx/spl.c
> > > > > @@ -156,7 +156,7 @@ u32 spl_boot_device(void)
> > > > >  	case SPI_NOR_BOOT:
> > > > >  		return BOOT_DEVICE_SPI;
> > > > >  	case USB_BOOT:
> > > > > -		return BOOT_DEVICE_USB;
> > > > > +		return BOOT_DEVICE_BOARD;  
> > > >
> > > > Why this change is required? What is the problem you are trying
> > > > to solve here? (And it is always welcome if one write the
> > > > detailed description of the problem in the commit message).  
> > >
> > > It is spl sdp need it.
> > > SPL_LOAD_IMAGE_METHOD("USB SDP", 0, BOOT_DEVICE_BOARD,
> > > spl_sdp_load_image);  
> > 
> > My point is why this error was not apparent earlier (or when I was
> > using the uuu with newest u-boot)?  
> 
> The patch changes the i.MX7/8/8M spl_boot_device,
> i.MX7 already have BOARD support. i.MX8/8M has not been verified
> SDP before, so this patch is to fix for i.MX8/8M SDP.

I've looked into the source code and this fix is indeed for IMX7/8.

That was not apparent from either the code nor commit message.

Please prepare more detailed commit messages, so we would know much
more from the patch without the need to see the relevant source code.

> 
> Regards,
> Peng.
> 
> > 
> > I'm just curious why let's say "average" uuu/SDP user did not
> > encountered this problem (as I had also to recover SPL on my i.MX6
> > board). 
> > >
> > > Regards,
> > > Peng.
> > >  
> > > >
> > > > I've been using recently SDP (with uuu on imx6q) and I did not
> > > > experience any issues.
> > > >  
> > > > >  	default:
> > > > >  		return BOOT_DEVICE_NONE;
> > > > >  	}  
> > > >
> > > >
> > > >
> > > >
> > > > Best regards,
> > > >
> > > > Lukasz Majewski
> > > >
> > > > --
> > > >
> > > > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194
> > > > Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax:
> > > > (+49)-8142-66989-80 Email: lukma at denx.de  
> > 
> > 
> > 
> > 
> > Best regards,
> > 
> > Lukasz Majewski
> > 
> > --
> > 
> > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > lukma at denx.de  




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190718/f9507141/attachment.sig>

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

* [U-Boot] 答复: [PATCH 1/4] imx: spl: Change USB boot device type
  2019-07-18  9:27           ` Lukasz Majewski
@ 2019-07-18 11:01             ` Sherry Sun
  0 siblings, 0 replies; 24+ messages in thread
From: Sherry Sun @ 2019-07-18 11:01 UTC (permalink / raw)
  To: u-boot

Hi, Lukasz

> 
> On Thu, 18 Jul 2019 07:47:53 +0000
> Peng Fan <peng.fan@nxp.com> wrote:
> 
> > > Subject: Re: [PATCH 1/4] imx: spl: Change USB boot device type
> > >
> > > On Thu, 18 Jul 2019 07:38:10 +0000
> > > Peng Fan <peng.fan@nxp.com> wrote:
> > >
> > > > Hi Lukasz,
> > > >
> > > > > Subject: Re: [PATCH 1/4] imx: spl: Change USB boot device type
> > > > >
> > > > > Hi Sherry,
> > > > >
> > > > > > From: Sherry Sun <sherry.sun@nxp.com>
> > > > > >
> > > > > > The SPL SDP is configured as BOOT_DEVICE_BOARD, so when
> > > > > > booting from USB, change its type to BOOT_DEVICE_BOARD, so we
> > > > > > can use SDP.
> > > > > >
> > > > > > Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> > > > > > Signed-off-by: Ye Li <ye.li@nxp.com>
> > > > > > ---
> > > > > >  arch/arm/mach-imx/spl.c | 2 +-
> > > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > >
> > > > > > diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
> > > > > > index 9f1e0f6a72..2355019243 100644
> > > > > > --- a/arch/arm/mach-imx/spl.c
> > > > > > +++ b/arch/arm/mach-imx/spl.c
> > > > > > @@ -156,7 +156,7 @@ u32 spl_boot_device(void)
> > > > > >  	case SPI_NOR_BOOT:
> > > > > >  		return BOOT_DEVICE_SPI;
> > > > > >  	case USB_BOOT:
> > > > > > -		return BOOT_DEVICE_USB;
> > > > > > +		return BOOT_DEVICE_BOARD;
> > > > >
> > > > > Why this change is required? What is the problem you are trying
> > > > > to solve here? (And it is always welcome if one write the
> > > > > detailed description of the problem in the commit message).
> > > >
> > > > It is spl sdp need it.
> > > > SPL_LOAD_IMAGE_METHOD("USB SDP", 0, BOOT_DEVICE_BOARD,
> > > > spl_sdp_load_image);
> > >
> > > My point is why this error was not apparent earlier (or when I was
> > > using the uuu with newest u-boot)?
> >
> > The patch changes the i.MX7/8/8M spl_boot_device,
> > i.MX7 already have BOARD support. i.MX8/8M has not been verified SDP
> > before, so this patch is to fix for i.MX8/8M SDP.
> 
> I've looked into the source code and this fix is indeed for IMX7/8.
> 
> That was not apparent from either the code nor commit message.
> 
> Please prepare more detailed commit messages, so we would know much
> more from the patch without the need to see the relevant source code.
> 


Okay, I will add more commit messages for this patch. Thanks for your comments.


> >
> > Regards,
> > Peng.
> >
> > >
> > > I'm just curious why let's say "average" uuu/SDP user did not
> > > encountered this problem (as I had also to recover SPL on my i.MX6
> > > board).
> > > >
> > > > Regards,
> > > > Peng.
> > > >
> > > > >
> > > > > I've been using recently SDP (with uuu on imx6q) and I did not
> > > > > experience any issues.
> > > > >
> > > > > >  	default:
> > > > > >  		return BOOT_DEVICE_NONE;
> > > > > >  	}
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Best regards,
> > > > >
> > > > > Lukasz Majewski
> > > > >
> > > > > --
> > > > >
> > > > > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > > > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194
> > > > > Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax:
> > > > > (+49)-8142-66989-80 Email: lukma at denx.de
> > >
> > >
> > >
> > >
> > > Best regards,
> > >
> > > Lukasz Majewski
> > >
> > > --
> > >
> > > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> > > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > > lukma at denx.de
> 
> 
> 
> 
> Best regards,
> 
> Lukasz Majewski
> 
> --
> 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> lukma at denx.de

Best regards
Sherry sun

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

* [U-Boot] [PATCH 0/4] Make some changes to SDP
  2019-07-18  1:40 [U-Boot] [PATCH 0/4] Make some changes to SDP sherry sun
                   ` (3 preceding siblings ...)
  2019-07-18  1:40 ` [U-Boot] [PATCH 4/4] SDP: Call usb_gadget_initialize and usb_gadget_release to support UDC sherry sun
@ 2019-07-28 14:06 ` Angus Ainslie
  2019-08-01  2:56   ` [U-Boot] 答复: " Sherry Sun
  4 siblings, 1 reply; 24+ messages in thread
From: Angus Ainslie @ 2019-07-28 14:06 UTC (permalink / raw)
  To: u-boot

Hi Sherry,

On 2019-07-17 18:40, sherry sun wrote:
> From: Sherry Sun <sherry.sun@nxp.com>
> 
> This patchset adds:
> 1. Add usb_gadget_initialize() and usb_gadget_release() to initialize 
> and
> release UDC during sdp download.
> 2. Add high speed endpoint descriptor for sdp.
> 3. Add a macro definition--CONFIG_SDP_LOADADDR as default sdp load
> address while SDP_WRITE and SDP_JUMP command addr is zero.
> 
> Sherry Sun (4):
>   imx: spl: Change USB boot device type
>   SDP: use CONFIG_SDP_LOADADDR as default load address
>   SDP: fix wrong usb request size and add high speed endpoint 
> descriptor
>   SDP: Call usb_gadget_initialize and usb_gadget_release to support UDC

These changes look like like they target SDP on imx8. For imx8mq is this 
all that is required to get SDP working with uuu or are there additional 
changes required ?

Thanks
Angus

> 
>  arch/arm/mach-imx/spl.c    |  2 +-
>  common/spl/spl_sdp.c       |  4 ++++
>  drivers/usb/gadget/Kconfig |  4 ++++
>  drivers/usb/gadget/f_sdp.c | 39 +++++++++++++++++++++++++++++++++-----
>  4 files changed, 43 insertions(+), 6 deletions(-)

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

* [U-Boot] 答复:  [PATCH 0/4] Make some changes to SDP
  2019-07-28 14:06 ` [U-Boot] [PATCH 0/4] Make some changes to SDP Angus Ainslie
@ 2019-08-01  2:56   ` Sherry Sun
  2019-08-01 13:07     ` Angus Ainslie
  0 siblings, 1 reply; 24+ messages in thread
From: Sherry Sun @ 2019-08-01  2:56 UTC (permalink / raw)
  To: u-boot

Hi Angus

> 
> Hi Sherry,
> 
> On 2019-07-17 18:40, sherry sun wrote:
> > From: Sherry Sun <sherry.sun@nxp.com>
> >
> > This patchset adds:
> > 1. Add usb_gadget_initialize() and usb_gadget_release() to initialize
> > and release UDC during sdp download.
> > 2. Add high speed endpoint descriptor for sdp.
> > 3. Add a macro definition--CONFIG_SDP_LOADADDR as default sdp load
> > address while SDP_WRITE and SDP_JUMP command addr is zero.
> >
> > Sherry Sun (4):
> >   imx: spl: Change USB boot device type
> >   SDP: use CONFIG_SDP_LOADADDR as default load address
> >   SDP: fix wrong usb request size and add high speed endpoint
> > descriptor
> >   SDP: Call usb_gadget_initialize and usb_gadget_release to support
> > UDC
> 
> These changes look like like they target SDP on imx8. For imx8mq is this all
> that is required to get SDP working with uuu or are there additional changes
> required ?
> 

The changes in patch 1/4 are target on both imx8 and imx8m.
The rest three patches are target on all boards which used SDP.
So for imx8mq, if your usb gadget driver is ready ,these changes are enough to get SDP working with UUU. 

Best regards
Sherry sun

> Thanks
> Angus
> 
> >
> >  arch/arm/mach-imx/spl.c    |  2 +-
> >  common/spl/spl_sdp.c       |  4 ++++
> >  drivers/usb/gadget/Kconfig |  4 ++++
> >  drivers/usb/gadget/f_sdp.c | 39
> > +++++++++++++++++++++++++++++++++-----
> >  4 files changed, 43 insertions(+), 6 deletions(-)

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

* [U-Boot] 答复:  [PATCH 0/4] Make some changes to SDP
  2019-08-01  2:56   ` [U-Boot] 答复: " Sherry Sun
@ 2019-08-01 13:07     ` Angus Ainslie
  2019-08-02  1:01       ` Peng Fan
  0 siblings, 1 reply; 24+ messages in thread
From: Angus Ainslie @ 2019-08-01 13:07 UTC (permalink / raw)
  To: u-boot

Hi Sherry,

On 2019-07-31 19:56, Sherry Sun wrote:
> Hi Angus
> 
>> 
>> Hi Sherry,
>> 
>> On 2019-07-17 18:40, sherry sun wrote:
>> > From: Sherry Sun <sherry.sun@nxp.com>
>> >
>> > This patchset adds:
>> > 1. Add usb_gadget_initialize() and usb_gadget_release() to initialize
>> > and release UDC during sdp download.
>> > 2. Add high speed endpoint descriptor for sdp.
>> > 3. Add a macro definition--CONFIG_SDP_LOADADDR as default sdp load
>> > address while SDP_WRITE and SDP_JUMP command addr is zero.
>> >
>> > Sherry Sun (4):
>> >   imx: spl: Change USB boot device type
>> >   SDP: use CONFIG_SDP_LOADADDR as default load address
>> >   SDP: fix wrong usb request size and add high speed endpoint
>> > descriptor
>> >   SDP: Call usb_gadget_initialize and usb_gadget_release to support
>> > UDC
>> 
>> These changes look like like they target SDP on imx8. For imx8mq is 
>> this all
>> that is required to get SDP working with uuu or are there additional 
>> changes
>> required ?
>> 
> 
> The changes in patch 1/4 are target on both imx8 and imx8m.
> The rest three patches are target on all boards which used SDP.
> So for imx8mq, if your usb gadget driver is ready ,these changes are
> enough to get SDP working with UUU.
> 

I'm trying to use SDP on the imx8mq-evk but it doesn't look like it's 
enabled there. Do you have patches to enable SDP on the imx8mq-evk , 
even if they aren't ready to go upstream ?

Thanks
Angus

> Best regards
> Sherry sun
> 
>> Thanks
>> Angus
>> 
>> >
>> >  arch/arm/mach-imx/spl.c    |  2 +-
>> >  common/spl/spl_sdp.c       |  4 ++++
>> >  drivers/usb/gadget/Kconfig |  4 ++++
>> >  drivers/usb/gadget/f_sdp.c | 39
>> > +++++++++++++++++++++++++++++++++-----
>> >  4 files changed, 43 insertions(+), 6 deletions(-)

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

* [U-Boot] 答复:  [PATCH 0/4] Make some changes to SDP
  2019-08-01 13:07     ` Angus Ainslie
@ 2019-08-02  1:01       ` Peng Fan
  2019-08-02  2:30         ` Angus Ainslie
  0 siblings, 1 reply; 24+ messages in thread
From: Peng Fan @ 2019-08-02  1:01 UTC (permalink / raw)
  To: u-boot

Angus,

> Subject: Re: 答复: [U-Boot] [PATCH 0/4] Make some changes to SDP
> 
> Hi Sherry,
> 
> On 2019-07-31 19:56, Sherry Sun wrote:
> > Hi Angus
> >
> >>
> >> Hi Sherry,
> >>
> >> On 2019-07-17 18:40, sherry sun wrote:
> >> > From: Sherry Sun <sherry.sun@nxp.com>
> >> >
> >> > This patchset adds:
> >> > 1. Add usb_gadget_initialize() and usb_gadget_release() to
> >> > initialize and release UDC during sdp download.
> >> > 2. Add high speed endpoint descriptor for sdp.
> >> > 3. Add a macro definition--CONFIG_SDP_LOADADDR as default sdp load
> >> > address while SDP_WRITE and SDP_JUMP command addr is zero.
> >> >
> >> > Sherry Sun (4):
> >> >   imx: spl: Change USB boot device type
> >> >   SDP: use CONFIG_SDP_LOADADDR as default load address
> >> >   SDP: fix wrong usb request size and add high speed endpoint
> >> > descriptor
> >> >   SDP: Call usb_gadget_initialize and usb_gadget_release to support
> >> > UDC
> >>
> >> These changes look like like they target SDP on imx8. For imx8mq is
> >> this all that is required to get SDP working with uuu or are there
> >> additional changes required ?
> >>
> >
> > The changes in patch 1/4 are target on both imx8 and imx8m.
> > The rest three patches are target on all boards which used SDP.
> > So for imx8mq, if your usb gadget driver is ready ,these changes are
> > enough to get SDP working with UUU.
> >
> 
> I'm trying to use SDP on the imx8mq-evk but it doesn't look like it's enabled
> there. Do you have patches to enable SDP on the imx8mq-evk , even if they
> aren't ready to go upstream ?

You could try downstream code,
https://source.codeaurora.org/external/imx/uboot-imx/ 
branch: imx_v2019.04_4.19.35_1.0.0

Regards,
Peng.

> 
> Thanks
> Angus
> 
> > Best regards
> > Sherry sun
> >
> >> Thanks
> >> Angus
> >>
> >> >
> >> >  arch/arm/mach-imx/spl.c    |  2 +-
> >> >  common/spl/spl_sdp.c       |  4 ++++
> >> >  drivers/usb/gadget/Kconfig |  4 ++++  drivers/usb/gadget/f_sdp.c |
> >> > 39
> >> > +++++++++++++++++++++++++++++++++-----
> >> >  4 files changed, 43 insertions(+), 6 deletions(-)

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

* [U-Boot] 答复:  [PATCH 0/4] Make some changes to SDP
  2019-08-02  1:01       ` Peng Fan
@ 2019-08-02  2:30         ` Angus Ainslie
  2019-08-08  9:38           ` [U-Boot] 答复: " Sherry Sun
  0 siblings, 1 reply; 24+ messages in thread
From: Angus Ainslie @ 2019-08-02  2:30 UTC (permalink / raw)
  To: u-boot

Hi Peng,

On 2019-08-01 18:01, Peng Fan wrote:
> Angus,
> 
>> Subject: Re: 答复: [U-Boot] [PATCH 0/4] Make some changes to SDP
>> 
>> Hi Sherry,
>> 
>> On 2019-07-31 19:56, Sherry Sun wrote:
>> > Hi Angus
>> >
>> >>
>> >> Hi Sherry,
>> >>
>> >> On 2019-07-17 18:40, sherry sun wrote:
>> >> > From: Sherry Sun <sherry.sun@nxp.com>
>> >> >
>> >> > This patchset adds:
>> >> > 1. Add usb_gadget_initialize() and usb_gadget_release() to
>> >> > initialize and release UDC during sdp download.
>> >> > 2. Add high speed endpoint descriptor for sdp.
>> >> > 3. Add a macro definition--CONFIG_SDP_LOADADDR as default sdp load
>> >> > address while SDP_WRITE and SDP_JUMP command addr is zero.
>> >> >
>> >> > Sherry Sun (4):
>> >> >   imx: spl: Change USB boot device type
>> >> >   SDP: use CONFIG_SDP_LOADADDR as default load address
>> >> >   SDP: fix wrong usb request size and add high speed endpoint
>> >> > descriptor
>> >> >   SDP: Call usb_gadget_initialize and usb_gadget_release to support
>> >> > UDC
>> >>
>> >> These changes look like like they target SDP on imx8. For imx8mq is
>> >> this all that is required to get SDP working with uuu or are there
>> >> additional changes required ?
>> >>
>> >
>> > The changes in patch 1/4 are target on both imx8 and imx8m.
>> > The rest three patches are target on all boards which used SDP.
>> > So for imx8mq, if your usb gadget driver is ready ,these changes are
>> > enough to get SDP working with UUU.
>> >
>> 
>> I'm trying to use SDP on the imx8mq-evk but it doesn't look like it's 
>> enabled
>> there. Do you have patches to enable SDP on the imx8mq-evk , even if 
>> they
>> aren't ready to go upstream ?
> 
> You could try downstream code,
> https://source.codeaurora.org/external/imx/uboot-imx/
> branch: imx_v2019.04_4.19.35_1.0.0
> 

I already have SDP  working with the vendor u-boot. I'm trying to switch 
to mainline u-boot so I'm looking for mainline patches.

Thanks
Angus

> Regards,
> Peng.
> 
>> 
>> Thanks
>> Angus
>> 
>> > Best regards
>> > Sherry sun
>> >
>> >> Thanks
>> >> Angus
>> >>
>> >> >
>> >> >  arch/arm/mach-imx/spl.c    |  2 +-
>> >> >  common/spl/spl_sdp.c       |  4 ++++
>> >> >  drivers/usb/gadget/Kconfig |  4 ++++  drivers/usb/gadget/f_sdp.c |
>> >> > 39
>> >> > +++++++++++++++++++++++++++++++++-----
>> >> >  4 files changed, 43 insertions(+), 6 deletions(-)

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

* [U-Boot] 答复: 答复:  [PATCH 0/4] Make some changes to SDP
  2019-08-02  2:30         ` Angus Ainslie
@ 2019-08-08  9:38           ` Sherry Sun
       [not found]             ` <d490b39d-ac95-4e25-adcb-e26d422c5305@email.android.com>
  0 siblings, 1 reply; 24+ messages in thread
From: Sherry Sun @ 2019-08-08  9:38 UTC (permalink / raw)
  To: u-boot

Hi Angus,

Sorry for the late reply.

> -----邮件原件-----
> 发件人: Angus Ainslie <angus@akkea.ca>
> 发送时间: 2019年8月2日 10:30
> 收件人: Peng Fan <peng.fan@nxp.com>
> 抄送: Sherry Sun <sherry.sun@nxp.com>; sbabic at denx.de;
> festevam at gmail.com; lukma at denx.de; marex at denx.de;
> u-boot at lists.denx.de; dl-uboot-imx <uboot-imx@nxp.com>
> 主题: Re: 答复: [U-Boot] [PATCH 0/4] Make some changes to SDP
> 
> Hi Peng,
> 
> On 2019-08-01 18:01, Peng Fan wrote:
> > Angus,
> >
> >> Subject: Re: 答复: [U-Boot] [PATCH 0/4] Make some changes to SDP
> >>
> >> Hi Sherry,
> >>
> >> On 2019-07-31 19:56, Sherry Sun wrote:
> >> > Hi Angus
> >> >
> >> >>
> >> >> Hi Sherry,
> >> >>
> >> >> On 2019-07-17 18:40, sherry sun wrote:
> >> >> > From: Sherry Sun <sherry.sun@nxp.com>
> >> >> >
> >> >> > This patchset adds:
> >> >> > 1. Add usb_gadget_initialize() and usb_gadget_release() to
> >> >> > initialize and release UDC during sdp download.
> >> >> > 2. Add high speed endpoint descriptor for sdp.
> >> >> > 3. Add a macro definition--CONFIG_SDP_LOADADDR as default sdp
> >> >> > load address while SDP_WRITE and SDP_JUMP command addr is zero.
> >> >> >
> >> >> > Sherry Sun (4):
> >> >> >   imx: spl: Change USB boot device type
> >> >> >   SDP: use CONFIG_SDP_LOADADDR as default load address
> >> >> >   SDP: fix wrong usb request size and add high speed endpoint
> >> >> > descriptor
> >> >> >   SDP: Call usb_gadget_initialize and usb_gadget_release to
> >> >> > support UDC
> >> >>
> >> >> These changes look like like they target SDP on imx8. For imx8mq
> >> >> is this all that is required to get SDP working with uuu or are
> >> >> there additional changes required ?
> >> >>
> >> >
> >> > The changes in patch 1/4 are target on both imx8 and imx8m.
> >> > The rest three patches are target on all boards which used SDP.
> >> > So for imx8mq, if your usb gadget driver is ready ,these changes
> >> > are enough to get SDP working with UUU.
> >> >
> >>
> >> I'm trying to use SDP on the imx8mq-evk but it doesn't look like it's
> >> enabled there. Do you have patches to enable SDP on the imx8mq-evk ,
> >> even if they aren't ready to go upstream ?
> >
> > You could try downstream code,
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsour
> >
> ce.codeaurora.org%2Fexternal%2Fimx%2Fuboot-imx%2F&amp;data=02%7C01
> %7Cs
> >
> herry.sun%40nxp.com%7C6d63289fbb104168bce308d716f157c4%7C686ea1
> d3bc2b4
> >
> c6fa92cd99c5c301635%7C0%7C0%7C637003098143081621&amp;sdata=beh
> 08%2Fv3f
> > s8ZZPP29F1iVMfo3uNTWGf91SYYyak2GVU%3D&amp;reserved=0
> > branch: imx_v2019.04_4.19.35_1.0.0
> >
> 
> I already have SDP  working with the vendor u-boot. I'm trying to switch to
> mainline u-boot so I'm looking for mainline patches.
> 

May I ask, is your usb gadget driver is working? Such as you can use it for fastboot or ums.

Best regards
Sherry sun

> Thanks
> Angus
> 
> > Regards,
> > Peng.
> >
> >>
> >> Thanks
> >> Angus
> >>
> >> > Best regards
> >> > Sherry sun
> >> >
> >> >> Thanks
> >> >> Angus
> >> >>
> >> >> >
> >> >> >  arch/arm/mach-imx/spl.c    |  2 +-
> >> >> >  common/spl/spl_sdp.c       |  4 ++++
> >> >> >  drivers/usb/gadget/Kconfig |  4 ++++
> >> >> > drivers/usb/gadget/f_sdp.c |
> >> >> > 39
> >> >> > +++++++++++++++++++++++++++++++++-----
> >> >> >  4 files changed, 43 insertions(+), 6 deletions(-)

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

* [U-Boot] 答复: 答复: 答复:  [PATCH 0/4] Make some changes to SDP
       [not found]             ` <d490b39d-ac95-4e25-adcb-e26d422c5305@email.android.com>
@ 2019-08-09  6:21               ` Sherry Sun
  2019-12-12 18:22                 ` 答复: 答复: [U-Boot] " Fabio Estevam
  0 siblings, 1 reply; 24+ messages in thread
From: Sherry Sun @ 2019-08-09  6:21 UTC (permalink / raw)
  To: u-boot

Hi Angus,


Hi Sherry,

On Aug. 8, 2019 2:38 a.m., Sherry Sun <sherry.sun at nxp.com<mailto:sherry.sun@nxp.com>> wrote:

Hi Angus,

Sorry for the late reply.

> -----邮件原件-----
> 发件人: Angus Ainslie <angus at akkea.ca<mailto:angus@akkea.ca>>
> 发送时间: 2019年8月2日 10:30
> 收件人: Peng Fan <peng.fan at nxp.com<mailto:peng.fan@nxp.com>>
> 抄送: Sherry Sun <sherry.sun at nxp.com<mailto:sherry.sun@nxp.com>>; sbabic at denx.de<mailto:sbabic@denx.de>;
> festevam at gmail.com<mailto:festevam@gmail.com>; lukma at denx.de<mailto:lukma@denx.de>; marex at denx.de<mailto:marex@denx.de>;
> u-boot at lists.denx.de<mailto:u-boot@lists.denx.de>; dl-uboot-imx <uboot-imx at nxp.com<mailto:uboot-imx@nxp.com>>
> 主题: Re: 答复: [U-Boot] [PATCH 0/4] Make some changes to SDP
>
> Hi Peng,
>
> On 2019-08-01 18:01, Peng Fan wrote:
> > Angus,
> >
> >> Subject: Re: 答复: [U-Boot] [PATCH 0/4] Make some changes to SDP
> >>
> >> Hi Sherry,
> >>
> >> On 2019-07-31 19:56, Sherry Sun wrote:
> >> > Hi Angus
> >> >
> >> >>
> >> >> Hi Sherry,
> >> >>
> >> >> On 2019-07-17 18:40, sherry sun wrote:
> >> >> > From: Sherry Sun <sherry.sun at nxp.com<mailto:sherry.sun@nxp.com>>
> >> >> >
> >> >> > This patchset adds:
> >> >> > 1. Add usb_gadget_initialize() and usb_gadget_release() to
> >> >> > initialize and release UDC during sdp download.
> >> >> > 2. Add high speed endpoint descriptor for sdp.
> >> >> > 3. Add a macro definition--CONFIG_SDP_LOADADDR as default sdp
> >> >> > load address while SDP_WRITE and SDP_JUMP command addr is zero.
> >> >> >
> >> >> > Sherry Sun (4):
> >> >> >   imx: spl: Change USB boot device type
> >> >> >   SDP: use CONFIG_SDP_LOADADDR as default load address
> >> >> >   SDP: fix wrong usb request size and add high speed endpoint
> >> >> > descriptor
> >> >> >   SDP: Call usb_gadget_initialize and usb_gadget_release to
> >> >> > support UDC
> >> >>
> >> >> These changes look like like they target SDP on imx8. For imx8mq
> >> >> is this all that is required to get SDP working with uuu or are
> >> >> there additional changes required ?
> >> >>
> >> >
> >> > The changes in patch 1/4 are target on both imx8 and imx8m.
> >> > The rest three patches are target on all boards which used SDP.
> >> > So for imx8mq, if your usb gadget driver is ready ,these changes
> >> > are enough to get SDP working with UUU.
> >> >
> >>
> >> I'm trying to use SDP on the imx8mq-evk but it doesn't look like it's
> >> enabled there. Do you have patches to enable SDP on the imx8mq-evk ,
> >> even if they aren't ready to go upstream ?
> >
> > You could try downstream code,
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsour
> >
> ce.codeaurora.org%2Fexternal%2Fimx%2Fuboot-imx%2F&amp;data=02%7C01
> %7Cs
> >
> herry.sun%40nxp.com%7C6d63289fbb104168bce308d716f157c4%7C686ea1
> d3bc2b4
> >
> c6fa92cd99c5c301635%7C0%7C0%7C637003098143081621&amp;sdata=beh
> 08%2Fv3f
> > s8ZZPP29F1iVMfo3uNTWGf91SYYyak2GVU%3D&amp;reserved=0
> > branch: imx_v2019.04_4.19.35_1.0.0
> >
>
> I already have SDP  working with the vendor u-boot. I'm trying to switch to
> mainline u-boot so I'm looking for mainline patches.
>

May I ask, is your usb gadget driver is working? Such as you can use it for fastboot or ums.
>If I enable dwc3 gadget and DM for the SPL then I must start removing other SPL features to get it to fit in the 124k allocation.
>
>It sounds like you haven't tested this on the imx8mq-evk then ?

Yes, I  have not used imx8mq-evk yet. I will try to test it later.

Best regards
Sherry sun

>Thanks
>Angus

Best regards
Sherry sun

> Thanks
> Angus
>
> > Regards,
> > Peng.
> >
> >>
> >> Thanks
> >> Angus
> >>
> >> > Best regards
> >> > Sherry sun
> >> >
> >> >> Thanks
> >> >> Angus
> >> >>
> >> >> >
> >> >> >  arch/arm/mach-imx/spl.c    |  2 +-
> >> >> >  common/spl/spl_sdp.c       |  4 ++++
> >> >> >  drivers/usb/gadget/Kconfig |  4 ++++
> >> >> > drivers/usb/gadget/f_sdp.c |
> >> >> > 39
> >> >> > +++++++++++++++++++++++++++++++++-----
> >> >> >  4 files changed, 43 insertions(+), 6 deletions(-)

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

* Re: 答复: 答复: [U-Boot] [PATCH 0/4] Make some changes to SDP
  2019-08-09  6:21               ` [U-Boot] 答复: " Sherry Sun
@ 2019-12-12 18:22                 ` Fabio Estevam
  0 siblings, 0 replies; 24+ messages in thread
From: Fabio Estevam @ 2019-12-12 18:22 UTC (permalink / raw)
  To: u-boot

Hi Sherry,

On Fri, Aug 9, 2019 at 3:21 AM Sherry Sun <sherry.sun@nxp.com> wrote:

> Yes, I  have not used imx8mq-evk yet. I will try to test it later.

Have you managed to make any progress with regards to implementing UMS
support on imx8mq-evk?

Thanks

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

end of thread, other threads:[~2019-12-12 18:22 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-18  1:40 [U-Boot] [PATCH 0/4] Make some changes to SDP sherry sun
2019-07-18  1:40 ` [U-Boot] [PATCH 1/4] imx: spl: Change USB boot device type sherry sun
2019-07-18  7:27   ` Lukasz Majewski
2019-07-18  7:38     ` Peng Fan
2019-07-18  7:44       ` Lukasz Majewski
2019-07-18  7:47         ` Peng Fan
2019-07-18  9:27           ` Lukasz Majewski
2019-07-18 11:01             ` [U-Boot] 答复: " Sherry Sun
2019-07-18  9:24         ` [U-Boot] 答复: [EXT] " Sherry Sun
2019-07-18  1:40 ` [U-Boot] [PATCH 2/4] SDP: use CONFIG_SDP_LOADADDR as default load address sherry sun
2019-07-18  7:29   ` Lukasz Majewski
2019-07-18  1:40 ` [U-Boot] [PATCH 3/4] SDP: fix wrong usb request size and add high speed endpoint descriptor sherry sun
2019-07-18  7:32   ` Lukasz Majewski
2019-07-18  8:56     ` [U-Boot] 答复: " Sherry Sun
2019-07-18  1:40 ` [U-Boot] [PATCH 4/4] SDP: Call usb_gadget_initialize and usb_gadget_release to support UDC sherry sun
2019-07-18  7:32   ` Lukasz Majewski
2019-07-28 14:06 ` [U-Boot] [PATCH 0/4] Make some changes to SDP Angus Ainslie
2019-08-01  2:56   ` [U-Boot] 答复: " Sherry Sun
2019-08-01 13:07     ` Angus Ainslie
2019-08-02  1:01       ` Peng Fan
2019-08-02  2:30         ` Angus Ainslie
2019-08-08  9:38           ` [U-Boot] 答复: " Sherry Sun
     [not found]             ` <d490b39d-ac95-4e25-adcb-e26d422c5305@email.android.com>
2019-08-09  6:21               ` [U-Boot] 答复: " Sherry Sun
2019-12-12 18:22                 ` 答复: 答复: [U-Boot] " Fabio Estevam

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.