diff options
author | Wolfgang Denk <wd@denx.de> | 2011-04-30 22:45:55 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-04-30 22:45:55 +0200 |
commit | aeabdeb7a33c9cff9ae0cd804521d0d691a7c341 (patch) | |
tree | 2979428a02f5eebf256d18a3fb5839e063c3354a /arch/powerpc/cpu/mpc85xx/portals.c | |
parent | f3c615b8abc098f5222b061b81c75f1363ff4d32 (diff) | |
parent | a2879634c430df3d308f4a3badb37cddca0328f5 (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
Diffstat (limited to 'arch/powerpc/cpu/mpc85xx/portals.c')
-rw-r--r-- | arch/powerpc/cpu/mpc85xx/portals.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/powerpc/cpu/mpc85xx/portals.c b/arch/powerpc/cpu/mpc85xx/portals.c index e8d53bb2fd..c014163e3c 100644 --- a/arch/powerpc/cpu/mpc85xx/portals.c +++ b/arch/powerpc/cpu/mpc85xx/portals.c @@ -31,6 +31,7 @@ #include <asm/fsl_liodn.h> static ccsr_qman_t *qman = (void *)CONFIG_SYS_FSL_QMAN_ADDR; +static ccsr_bman_t *bman = (void *)CONFIG_SYS_FSL_BMAN_ADDR; void setup_portals(void) { @@ -250,3 +251,32 @@ err: off = fdt_node_offset_by_compatible(blob, off, "fsl,qman-portal"); } } + +void fdt_fixup_bportals(void *blob) +{ + int off, err; + unsigned int maj, min; + u32 rev_1 = in_be32(&bman->ip_rev_1); + char compat[64]; + int compat_len; + + maj = (rev_1 >> 8) & 0xff; + min = rev_1 & 0xff; + + compat_len = sprintf(compat, "fsl,bman-portal-%u.%u", maj, min) + 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"); + } + +} |