]> err.no Git - linux-2.6/commitdiff
[PATCH] ppc32: odd fixes and improvements in ppc_sys
authorVitaly Bordug <vbordug@ru.mvista.com>
Tue, 25 Apr 2006 16:26:33 +0000 (20:26 +0400)
committerPaul Mackerras <paulus@samba.org>
Fri, 28 Apr 2006 11:05:16 +0000 (21:05 +1000)
This consists of offsets fix in ..._devices.c, and update of
ppc_sys_fixup_mem_resource() function to prevent subsequent fixups

Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/ppc/syslib/mpc8xx_devices.c
arch/ppc/syslib/ppc_sys.c
arch/ppc/syslib/pq2_sys.c
include/asm-ppc/ppc_sys.h

index bd41ed83beb357f99607ba8b319ad488d80b566e..6f536383866eddf8f32becbd3adb77435c27ac0a 100644 (file)
@@ -170,12 +170,18 @@ struct platform_device ppc_sys_platform_devices[] = {
        [MPC8xx_CPM_SMC1] = {
                .name = "fsl-cpm-smc",
                .id     = 1,
-               .num_resources  = 2,
+               .num_resources  = 3,
                .resource = (struct resource[]) {
                        {
                                .name   = "regs",
-                               .start  = 0xa82,
-                               .end    = 0xa91,
+                               .start  = 0xa80,
+                               .end    = 0xa8f,
+                               .flags  = IORESOURCE_MEM,
+                       },
+                       {
+                               .name   = "pram",
+                               .start  = 0x3e80,
+                               .end    = 0x3ebf,
                                .flags  = IORESOURCE_MEM,
                        },
                        {
@@ -189,14 +195,21 @@ struct platform_device ppc_sys_platform_devices[] = {
        [MPC8xx_CPM_SMC2] = {
                .name = "fsl-cpm-smc",
                .id     = 2,
-               .num_resources  = 2,
+               .num_resources  = 3,
                .resource = (struct resource[]) {
                        {
                                .name   = "regs",
-                               .start  = 0xa92,
-                               .end    = 0xaa1,
+                               .start  = 0xa90,
+                               .end    = 0xa9f,
                                .flags  = IORESOURCE_MEM,
                        },
+                       {
+                               .name   = "pram",
+                               .start  = 0x3f80,
+                               .end    = 0x3fbf,
+                               .flags  = IORESOURCE_MEM,
+
+                       },
                        {
                                .name   = "interrupt",
                                .start  = MPC8xx_INT_SMC2,
index 7662c4e6e7d6070786ce144cb97ea20e6d4bd3a9..2d48018b71d93072216474f807fda2b2e8d4a55c 100644 (file)
@@ -109,9 +109,11 @@ ppc_sys_fixup_mem_resource(struct platform_device *pdev, phys_addr_t paddr)
        int i;
        for (i = 0; i < pdev->num_resources; i++) {
                struct resource *r = &pdev->resource[i];
-               if ((r->flags & IORESOURCE_MEM) == IORESOURCE_MEM) {
+               if (((r->flags & IORESOURCE_MEM) == IORESOURCE_MEM) && 
+                       ((r->flags & PPC_SYS_IORESOURCE_FIXUPPED) != PPC_SYS_IORESOURCE_FIXUPPED)) {
                        r->start += paddr;
                        r->end += paddr;
+                       r->flags |= PPC_SYS_IORESOURCE_FIXUPPED;
                }
        }
 }
index 75e64f1c144d7fd6ff7462d1fe2b36cc6627698c..433b0fa203e110029aa103fa639ca340560f23af 100644 (file)
@@ -113,13 +113,13 @@ struct ppc_sys_spec ppc_sys_specs[] = {
                .ppc_sys_name   = "8248",
                .mask           = 0x0000ff00,
                .value          = 0x00000c00,
-               .num_devices    = 11,
+               .num_devices    = 12,
                .device_list = (enum ppc_sys_devices[])
                {
                        MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
-                       MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1,
-                       MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
-                       MPC82xx_CPM_USB, MPC82xx_SEC1,
+                       MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SCC4,
+                       MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
+                       MPC82xx_CPM_I2C, MPC82xx_CPM_USB, MPC82xx_SEC1,
                },
        },
        {
index 4b94f7059ebec5a8dbaac855f07a051d8c8653dd..40f197af65085844fc6bcad81942d6982d3f7cbc 100644 (file)
@@ -39,6 +39,8 @@
 #error "need definition of ppc_sys_devices"
 #endif
 
+#define PPC_SYS_IORESOURCE_FIXUPPED    0x00000001      
+
 struct ppc_sys_spec {
        /* PPC sys is matched via (ID & mask) == value, id could be
         * PVR, SVR, IMMR, * etc. */