public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
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: Thu, 25 Feb 2016 19:00:50 +0100	[thread overview]
Message-ID: <56CF4152.70204@denx.de> (raw)
In-Reply-To: <1456289048-9226-3-git-send-email-sriram.dash@nxp.com>

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.

>  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 :)

>  	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.

>  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-25 18:00 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 [this message]
2016-02-26 16:19       ` Sriram Dash

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=56CF4152.70204@denx.de \
    --to=marex@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox