summaryrefslogtreecommitdiff
path: root/arch/powerpc/cpu/mpc85xx/liodn.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2011-10-14 00:03:58 -0500
committerKumar Gala <galak@kernel.crashing.org>2011-10-18 00:36:43 -0500
commit9c42ef61454ff7b4da23767366620a947b2486b5 (patch)
tree79e68bbf75ad7add6437383cc936932cd38b82d2 /arch/powerpc/cpu/mpc85xx/liodn.c
parent1a0c64219df1fe4f8c40ed2ecaa0da1b4e0e26f7 (diff)
downloadu-boot-imx-9c42ef61454ff7b4da23767366620a947b2486b5.zip
u-boot-imx-9c42ef61454ff7b4da23767366620a947b2486b5.tar.gz
u-boot-imx-9c42ef61454ff7b4da23767366620a947b2486b5.tar.bz2
powerpc/85xx: Update device tree handling for SRIO
Update device tree handling for SRIO controller to support updated fsl,srio device tree binding. We handle disabling of individual ports, the whole controller, RMU, and RMAN. Additionally, we setup the SRIO related LIODNs in the device tree. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/cpu/mpc85xx/liodn.c')
-rw-r--r--arch/powerpc/cpu/mpc85xx/liodn.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/powerpc/cpu/mpc85xx/liodn.c b/arch/powerpc/cpu/mpc85xx/liodn.c
index e14de9d..8df9f8e 100644
--- a/arch/powerpc/cpu/mpc85xx/liodn.c
+++ b/arch/powerpc/cpu/mpc85xx/liodn.c
@@ -184,6 +184,35 @@ void set_liodns(void)
#endif
}
+static void fdt_fixup_srio_liodn(void *blob, struct srio_liodn_id_table *tbl)
+{
+ int i, srio_off;
+
+ /* search for srio node, if doesn't exist just return - nothing todo */
+ srio_off = fdt_node_offset_by_compatible(blob, -1, "fsl,srio");
+ if (srio_off < 0)
+ return ;
+
+ for (i = 0; i < srio_liodn_tbl_sz; i++) {
+ int off, portid = tbl[i].portid;
+
+ off = fdt_node_offset_by_prop_value(blob, srio_off,
+ "cell-index", &portid, 4);
+ if (off >= 0) {
+ off = fdt_setprop(blob, off, "fsl,liodn",
+ &tbl[i].id[0],
+ sizeof(u32) * tbl[i].num_ids);
+ if (off > 0)
+ printf("WARNING unable to set fsl,liodn for "
+ "fsl,srio port %d: %s\n",
+ portid, fdt_strerror(off));
+ } else {
+ debug("WARNING: couldn't set fsl,liodn for srio: %s.\n",
+ fdt_strerror(off));
+ }
+ }
+}
+
static void fdt_fixup_liodn_tbl(void *blob, struct liodn_id_table *tbl, int sz)
{
int i;
@@ -213,6 +242,8 @@ static void fdt_fixup_liodn_tbl(void *blob, struct liodn_id_table *tbl, int sz)
void fdt_fixup_liodn(void *blob)
{
+ fdt_fixup_srio_liodn(blob, srio_liodn_tbl);
+
fdt_fixup_liodn_tbl(blob, liodn_tbl, liodn_tbl_sz);
#ifdef CONFIG_SYS_DPAA_FMAN
fdt_fixup_liodn_tbl(blob, fman1_liodn_tbl, fman1_liodn_tbl_sz);