]> git.sur5r.net Git - u-boot/commitdiff
powerpc/mpc85xx: Add revision properties in portal device tree node 'pme'
authorJeffrey Ladouceur <Jeffrey.Ladouceur@freescale.com>
Fri, 25 Jan 2013 10:38:53 +0000 (10:38 +0000)
committerAndy Fleming <afleming@freescale.com>
Thu, 2 May 2013 21:56:42 +0000 (16:56 -0500)
The 'fsl,pme-rev1' and 'fsl-pme-rev2' properties have been added to the
pme portal node. This is required for software to determine which version
of PME hardware is present and take appropriate actions.
These properties are a direct reflection of the corresponding ccsr pme
register value.

Also removed unnecessary static global variables.

Signed-off-by: Jeffrey Ladouceur <Jeffrey.Ladouceur@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
arch/powerpc/cpu/mpc85xx/portals.c

index b59ef69f1f6c5aa123aae4ae80191fd926047461..d529095ee8c2884fee16508097fa753c6b8e0b62 100644 (file)
 #include <asm/fsl_portals.h>
 #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)
 {
+       ccsr_qman_t *qman = (void *)CONFIG_SYS_FSL_QMAN_ADDR;
 #ifdef CONFIG_FSL_CORENET
        int i;
 
@@ -166,6 +164,20 @@ static int fdt_qportal(void *blob, int off, int id, char *name,
                        num = get_dpaa_liodn(dev, &liodns[0], id);
                        ret = fdt_setprop(blob, childoff, "fsl,liodn",
                                          &liodns[0], sizeof(u32) * num);
+                       if (!strncmp(name, "pme", 3)) {
+                               u32 pme_rev1, pme_rev2;
+                               ccsr_pme_t *pme_regs =
+                                       (void *)CONFIG_SYS_FSL_CORENET_PME_ADDR;
+
+                               pme_rev1 = in_be32(&pme_regs->pm_ip_rev_1);
+                               pme_rev2 = in_be32(&pme_regs->pm_ip_rev_2);
+                               ret = fdt_setprop(blob, childoff,
+                                       "fsl,pme-rev1", &pme_rev1, sizeof(u32));
+                               if (ret < 0)
+                                       return ret;
+                               ret = fdt_setprop(blob, childoff,
+                                       "fsl,pme-rev2", &pme_rev2, sizeof(u32));
+                       }
 #endif
                } else {
                        return childoff;
@@ -183,6 +195,7 @@ void fdt_fixup_qportals(void *blob)
        int off, err;
        unsigned int maj, min;
        unsigned int ip_cfg;
+       ccsr_qman_t *qman = (void *)CONFIG_SYS_FSL_QMAN_ADDR;
        u32 rev_1 = in_be32(&qman->ip_rev_1);
        u32 rev_2 = in_be32(&qman->ip_rev_2);
        char compat[64];
@@ -272,6 +285,7 @@ void fdt_fixup_bportals(void *blob)
        int off, err;
        unsigned int maj, min;
        unsigned int ip_cfg;
+       ccsr_bman_t *bman = (void *)CONFIG_SYS_FSL_BMAN_ADDR;
        u32 rev_1 = in_be32(&bman->ip_rev_1);
        u32 rev_2 = in_be32(&bman->ip_rev_2);
        char compat[64];