All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/4] SDP: use CONFIG_SDP_LOADADDR as default load address
Date: Thu, 18 Jul 2019 09:29:11 +0200	[thread overview]
Message-ID: <20190718092911.17384d7b@jawa> (raw)
In-Reply-To: <1563414056-20331-3-git-send-email-sherry.sun@nxp.com>

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>

  reply	other threads:[~2019-07-18  7:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=20190718092911.17384d7b@jawa \
    --to=lukma@denx.de \
    --cc=u-boot@lists.denx.de \
    /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.