mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
powerpc/85xx: Add device tree fixup for bman portal
Fix fdt bportal to pass the bman revision number to kernel via device tree. Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
This commit is contained in:
@ -473,6 +473,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
|
|||||||
fdt_portal(blob, "fsl,bman-portal", "bman-portals",
|
fdt_portal(blob, "fsl,bman-portal", "bman-portals",
|
||||||
(u64)CONFIG_SYS_BMAN_MEM_PHYS,
|
(u64)CONFIG_SYS_BMAN_MEM_PHYS,
|
||||||
CONFIG_SYS_BMAN_MEM_SIZE);
|
CONFIG_SYS_BMAN_MEM_SIZE);
|
||||||
|
fdt_fixup_bportals(blob);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_SYS_QMAN_MEM_PHYS)
|
#if defined(CONFIG_SYS_QMAN_MEM_PHYS)
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include <asm/fsl_liodn.h>
|
#include <asm/fsl_liodn.h>
|
||||||
|
|
||||||
static ccsr_qman_t *qman = (void *)CONFIG_SYS_FSL_QMAN_ADDR;
|
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)
|
void setup_portals(void)
|
||||||
{
|
{
|
||||||
@ -250,3 +251,32 @@ err:
|
|||||||
off = fdt_node_offset_by_compatible(blob, off, "fsl,qman-portal");
|
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");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009-2010 Freescale Semiconductor, Inc.
|
* Copyright 2009-2011 Freescale Semiconductor, Inc.
|
||||||
*
|
*
|
||||||
* See file CREDITS for list of people who contributed to this
|
* See file CREDITS for list of people who contributed to this
|
||||||
* project.
|
* project.
|
||||||
@ -51,6 +51,7 @@ extern int get_dpaa_liodn(enum fsl_dpaa_dev dpaa_dev,
|
|||||||
u32 *liodns, int liodn_offset);
|
u32 *liodns, int liodn_offset);
|
||||||
extern void setup_portals(void);
|
extern void setup_portals(void);
|
||||||
extern void fdt_fixup_qportals(void *blob);
|
extern void fdt_fixup_qportals(void *blob);
|
||||||
|
extern void fdt_fixup_bportals(void *blob);
|
||||||
|
|
||||||
extern struct qportal_info qp_info[];
|
extern struct qportal_info qp_info[];
|
||||||
extern void fdt_portal(void *blob, const char *compat, const char *container,
|
extern void fdt_portal(void *blob, const char *compat, const char *container,
|
||||||
|
Reference in New Issue
Block a user