All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sriram Dash <sriram.dash@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/2] board:freescale:usb: Add device-tree fixup support for xhci controller
Date: Fri, 26 Feb 2016 16:19:13 +0000	[thread overview]
Message-ID: <AM2PR04MB05470E4C573BDC69CC1067F1F5A70@AM2PR04MB0547.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <56CF4152.70204@denx.de>

Please find my reply inline

-----Original Message-----
From: Marek Vasut [mailto:marex at denx.de] 
Sent: Thursday, February 25, 2016 11:31 PM
To: Sriram Dash <sriram.dash@nxp.com>; u-boot at lists.denx.de
Cc: york sun <york.sun@nxp.com>; Ramneek Mehresh <ramneek.mehresh@nxp.com>; Rajesh Bhagat <rajesh.bhagat@nxp.com>
Subject: Re: [PATCH v2 2/2] board:freescale:usb: Add device-tree fixup support for xhci controller

On 02/24/2016 05:44 AM, Sriram Dash wrote:
> Enables usb device-tree fixup code to incorporate xhci controller
> 
> Signed-off-by: Ramneek Mehresh <ramneek.mehresh@nxp.com>
> Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
> ---
>  board/freescale/common/Makefile |  4 +++-
>  board/freescale/common/usb.c    | 11 +++++++++--
>  include/fdt_support.h           |  4 ++--
>  3 files changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/board/freescale/common/Makefile 
> b/board/freescale/common/Makefile index 62de45c..8388f47 100644
> --- a/board/freescale/common/Makefile
> +++ b/board/freescale/common/Makefile
> @@ -13,7 +13,9 @@ MINIMAL=y
>  endif
>  endif
>  
> -obj-$(CONFIG_USB_EHCI_FSL) += usb.o
> +ifneq ($(filter y,$(CONFIG_USB_EHCI_FSL) $(CONFIG_USB_XHCI_FSL)),) 
> +obj-y += usb.o endif

Please just add:

obj-$(CONFIG_USB_XHCI_FSL) += usb.o

here. Kbuild takes care of duplicities.

[Sriram] 
Accepted, Will change in v3 of patch

>  ifdef MINIMAL
>  # necessary to create built-in.o
> diff --git a/board/freescale/common/usb.c 
> b/board/freescale/common/usb.c index 7a35e92..b06daa0 100644
> --- a/board/freescale/common/usb.c
> +++ b/board/freescale/common/usb.c
> @@ -23,6 +23,7 @@ static const char *fdt_usb_get_node_type(void *blob, 
> int start_offset,  {
>  	const char *compat_dr = "fsl-usb2-dr";
>  	const char *compat_mph = "fsl-usb2-mph";
> +	const char *compat_snps = "snps,dwc3";

Will you add more random variables here once you add another DT compat string for another controller? You might want to learn about C arrays :)

[Sriram] Accepted, Will change in v3 of patch


>  	const char *node_type = NULL;
>  
>  	*node_offset = fdt_node_offset_by_compatible(blob, start_offset, @@ 
> -32,8 +33,14 @@ static const char *fdt_usb_get_node_type(void *blob, int start_offset,
>  							     start_offset,
>  							     compat_dr);
>  		if (*node_offset < 0) {
> -			printf("ERROR: could not find compatible node: %s\n",
> -			       fdt_strerror(*node_offset));
> +			*node_offset = fdt_node_offset_by_compatible
> +				       (blob, start_offset, compat_snps);
> +			if (*node_offset < 0) {
> +				printf("ERROR:could not find node:%s",
> +				       fdt_strerror(*node_offset));
> +			} else {
> +				node_type = compat_snps;
> +			}
>  		} else {
>  			node_type = compat_dr;
>  		}
> diff --git a/include/fdt_support.h b/include/fdt_support.h index 
> 296add0..d34e959 100644
> --- a/include/fdt_support.h
> +++ b/include/fdt_support.h
> @@ -113,11 +113,11 @@ void fdt_fixup_qe_firmware(void *fdt);
>   */
>  int fdt_fixup_display(void *blob, const char *path, const char 
> *display);
>  
> -#if defined(CONFIG_HAS_FSL_DR_USB) || defined(CONFIG_HAS_FSL_MPH_USB)
> +#if defined(CONFIG_USB_EHCI_FSL) || defined(CONFIG_USB_XHCI_FSL)

This change looks unrelated.

[Sriram] fdt_fixup_dr_usb is currently for fixing device tree for EHCI. We are planning to use this 
for XHCI also. 

>  void fdt_fixup_dr_usb(void *blob, bd_t *bd);  #else  static inline 
> void fdt_fixup_dr_usb(void *blob, bd_t *bd) {} -#endif /* 
> defined(CONFIG_HAS_FSL_DR_USB) || defined(CONFIG_HAS_FSL_MPH_USB) */
> +#endif /* defined(CONFIG_USB_EHCI_FSL) || 
> +defined(CONFIG_USB_XHCI_FSL) */
>  
>  #if defined(CONFIG_SYS_FSL_SEC_COMPAT)
>  void fdt_fixup_crypto_node(void *blob, int sec_rev);
> 

      reply	other threads:[~2016-02-26 16:19 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26 11:36 [U-Boot] [PATCH 1/2] fsl:usb: Make fsl usb device-tree fixup arch independent Ramneek Mehresh
2016-01-26 11:27 ` Marek Vasut
2016-01-26 11:36 ` [U-Boot] [PATCH 2/2] include:configs: Add usb device-tree fixup for all fsl platforms Ramneek Mehresh
2016-01-26 11:28   ` Marek Vasut
2016-01-27  4:14     ` Ramneek Mehresh
2016-01-27  4:27       ` Marek Vasut
2016-01-27  4:30         ` Ramneek Mehresh
2016-01-27  7:35           ` Marek Vasut
2016-01-27  8:26             ` Ramneek Mehresh
2016-01-27  8:27               ` Marek Vasut
2016-01-27 11:33                 ` Ramneek Mehresh
2016-01-27 11:42                   ` Marek Vasut
2016-01-28 11:05                     ` Ramneek Mehresh
2016-01-28 11:34                       ` Marek Vasut
2016-01-28 12:15                         ` Ramneek Mehresh
2016-02-08 11:07                         ` Ramneek Mehresh
2016-02-08 15:26                           ` Marek Vasut
2016-02-24  4:44 ` [U-Boot] [PATCH v2 0/2] Make usb device-tree fixup independent of USB controller Sriram Dash
2016-02-24  4:44   ` [U-Boot] [PATCH v2 1/2] board:freescale:common: Move device-tree fixup framework to common file Sriram Dash
2016-02-25 17:58     ` Marek Vasut
2016-02-26 16:07       ` Sriram Dash
2016-02-26 16:21         ` Marek Vasut
2016-02-24  4:44   ` [U-Boot] [PATCH v2 2/2] board:freescale:usb: Add device-tree fixup support for xhci controller Sriram Dash
2016-02-25 18:00     ` Marek Vasut
2016-02-26 16:19       ` Sriram Dash [this message]

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=AM2PR04MB05470E4C573BDC69CC1067F1F5A70@AM2PR04MB0547.eurprd04.prod.outlook.com \
    --to=sriram.dash@nxp.com \
    --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.