public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <oss@buserror.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] fsl_qman: Implement device tree fixup for QBMan on ARM processors
Date: Wed, 26 Oct 2016 12:58:31 -0500	[thread overview]
Message-ID: <1477504711.6812.12.camel@buserror.net> (raw)
In-Reply-To: <1477490479-22387-2-git-send-email-roy.pledge@nxp.com>

On Wed, 2016-10-26 at 10:01 -0400, Roy Pledge wrote:
> Add support for device tree fixup for the DPAA1 QBMan nodes in ARM platforms
> 
> Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
> ---
> ?arch/arm/cpu/armv8/fsl-layerscape/fdt.c????????????|???89
> ++++++++++++++++++++
> ?.../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c |????3 +
> ?.../include/asm/arch-fsl-layerscape/immap_lsch2.h??|????2 +
> ?include/configs/ls1043a_common.h???????????????????|????2 +
> ?4 files changed, 96 insertions(+)
> 
> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
> b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
> index 1a8321b..aedf0e7 100644
> --- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
> +++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
> @@ -25,6 +25,8 @@
> ?#ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
> ?#include <asm/armv8/sec_firmware.h>
> ?#endif
> +#include <asm/io.h>
> +#include <asm/arch/speed.h>
> ?
> ?int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc)
> ?{
> @@ -32,6 +34,80 @@ int fdt_fixup_phy_connection(void *blob, int offset,
> phy_interface_t phyc)
> ?					?phy_string_for_interface(phyc));
> ?}
> ?
> +#if defined(CONFIG_SYS_DPAA_QBMAN)
> +
> +#define BMAN_IP_REV_1 0xBF8
> +#define BMAN_IP_REV_2 0xBFC
> +void fdt_fixup_bportals(void *blob)
> +{
> +	int off, err;
> +	unsigned int maj, min;
> +	unsigned int ip_cfg;
> +
> +	u32 rev_1 = in_be32(CONFIG_SYS_FSL_BMAN_ADDR + BMAN_IP_REV_1);
> +	u32 rev_2 = in_be32(CONFIG_SYS_FSL_BMAN_ADDR + BMAN_IP_REV_2);
> +	char compat[64];
> +	int compat_len;
> +
> +	maj = (rev_1 >> 8) & 0xff;
> +	min = rev_1 & 0xff;
> +
> +	ip_cfg = rev_2 & 0xff;
> +
> +	compat_len = sprintf(compat, "fsl,bman-portal-%u.%u.%u",
> +			?????maj, min, ip_cfg) + 1;
> +	compat_len += sprintf(compat + compat_len, "fsl,bman-portal") + 1;
> +
> +	off = fdt_node_offset_by_compatible(blob, -1, "fsl,bman-portal");
> +	while (off != -FDT_ERR_NOTFOUND) {
> +		err = fdt_setprop(blob, off, "compatible", compat,
> compat_len);
> +		if (err < 0) {
> +			printf("ERROR: unable to create props for %s:
> %s\n",
> +			???????fdt_get_name(blob, off, NULL),
> +			???????fdt_strerror(err));
> +			return;
> +		}
> +
> +		off = fdt_node_offset_by_compatible(blob, off,
> +						????"fsl,bman-portal");
> +	}
> +}

Please share code with PPC rather than duplicating it.

-Scott

      reply	other threads:[~2016-10-26 17:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-26 14:01 [U-Boot] [PATCH] armv8: fsl-layerscape: Add DPAA1 QBMan support Roy Pledge
2016-10-26 14:01 ` [U-Boot] [PATCH] fsl_qman: Implement device tree fixup for QBMan on ARM processors Roy Pledge
2016-10-26 17:58   ` Scott Wood [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=1477504711.6812.12.camel@buserror.net \
    --to=oss@buserror.net \
    --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