]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
[PATCH] ppc32 CPM_UART: various fixes for pq2 uart users
authorVitaly Bordug <vbordug@ru.mvista.com>
Wed, 24 May 2006 17:40:18 +0000 (21:40 +0400)
committerPaul Mackerras <paulus@samba.org>
Fri, 26 May 2006 12:38:56 +0000 (22:38 +1000)
This fixes various odd things that missed update together with cpm_uart
platform_device move. Unified resources names, restructurisation, etc.
Also, addressed issue with recent phys/virt translation rework. Being
cache-coherent, CPM2's do alloc_bootmem() for the console stuff, and it was
used to treat console buffer descriptor mapping 1:1 (as in CPM1 case),
which is definitely wrong.

Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/ppc/platforms/mpc8272ads_setup.c
arch/ppc/syslib/pq2_devices.c
arch/ppc/syslib/pq2_sys.c
drivers/serial/cpm_uart/cpm_uart_core.c
drivers/serial/cpm_uart/cpm_uart_cpm2.c

index e62b75707f7a3f0551575f936d6258b6c97eb0d8..abb7154de2c7fcba30125b5b1971da761a2a59df 100644 (file)
@@ -279,11 +279,11 @@ static int mpc8272ads_platform_notify(struct device *dev)
        static const struct platform_notify_dev_map dev_map[] = {
                {
                        .bus_id = "fsl-cpm-fcc",
-                       .rtn = mpc8272ads_fixup_enet_pdata
+                       .rtn = mpc8272ads_fixup_enet_pdata,
                },
                {
                        .bus_id = "fsl-cpm-scc:uart",
-                       .rtn = mpc
+                       .rtn = mpc8272ads_fixup_uart_pdata,
                },
                {
                        .bus_id = NULL
@@ -335,15 +335,15 @@ struct platform_device* early_uart_get_pdev(int index)
        struct platform_device* pdev = NULL;
        if(index) { /*assume SCC4 here*/
                pdev = &ppc_sys_platform_devices[MPC82xx_CPM_SCC4];
-               pinfo = &mpc8272<F12>_uart_pdata[1];
+               pinfo = &mpc8272_uart_pdata[fsid_scc4_uart];
        } else { /*over SCC1*/
                pdev = &ppc_sys_platform_devices[MPC82xx_CPM_SCC1];
-               pinfo = &mpc8272_uart_pdata[0];
+               pinfo = &mpc8272_uart_pdata[fsid_scc1_uart];
        }
 
        pinfo->uart_clk = bd->bi_intfreq;
        pdev->dev.platform_data = pinfo;
-       ppc_sys_fixup_mem_resource(pdev, IMAP_ADDR);
+       ppc_sys_fixup_mem_resource(pdev, CPM_MAP_ADDR);
        return NULL;
 }
 
index 0636aed7b8271b2f9357c27a6cb9da1a9a63c31b..8692d00c08c42d7e3c33e59b57abbd7f75a6c5fb 100644 (file)
@@ -121,13 +121,13 @@ struct platform_device ppc_sys_platform_devices[] = {
                .num_resources   = 3,
                .resource = (struct resource[]) {
                        {
-                               .name   = "scc_mem",
+                               .name   = "regs",
                                .start  = 0x11A00,
                                .end    = 0x11A1F,
                                .flags  = IORESOURCE_MEM,
                        },
                        {
-                               .name   = "scc_pram",
+                               .name   = "pram",
                                .start  = 0x8000,
                                .end    = 0x80ff,
                                .flags  = IORESOURCE_MEM,
@@ -145,13 +145,13 @@ struct platform_device ppc_sys_platform_devices[] = {
                .num_resources   = 3,
                .resource = (struct resource[]) {
                        {
-                               .name   = "scc_mem",
+                               .name   = "regs",
                                .start  = 0x11A20,
                                .end    = 0x11A3F,
                                .flags  = IORESOURCE_MEM,
                        },
                        {
-                               .name   = "scc_pram",
+                               .name   = "pram",
                                .start  = 0x8100,
                                .end    = 0x81ff,
                                .flags  = IORESOURCE_MEM,
@@ -169,13 +169,13 @@ struct platform_device ppc_sys_platform_devices[] = {
                .num_resources   = 3,
                .resource = (struct resource[]) {
                        {
-                               .name   = "scc_mem",
+                               .name   = "regs",
                                .start  = 0x11A40,
                                .end    = 0x11A5F,
                                .flags  = IORESOURCE_MEM,
                        },
                        {
-                               .name   = "scc_pram",
+                               .name   = "pram",
                                .start  = 0x8200,
                                .end    = 0x82ff,
                                .flags  = IORESOURCE_MEM,
@@ -193,13 +193,13 @@ struct platform_device ppc_sys_platform_devices[] = {
                .num_resources   = 3,
                .resource = (struct resource[]) {
                        {
-                               .name   = "scc_mem",
+                               .name   = "regs",
                                .start  = 0x11A60,
                                .end    = 0x11A7F,
                                .flags  = IORESOURCE_MEM,
                        },
                        {
-                               .name   = "scc_pram",
+                               .name   = "pram",
                                .start  = 0x8300,
                                .end    = 0x83ff,
                                .flags  = IORESOURCE_MEM,
index 433b0fa203e110029aa103fa639ca340560f23af..fee8948162b9a49a7c9767cd6e389db223065ef3 100644 (file)
@@ -139,13 +139,13 @@ struct ppc_sys_spec ppc_sys_specs[] = {
                .ppc_sys_name   = "8272",
                .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,
                },
        },
        /* below is a list of the 8280 family of processors */
index 969f949004318b1080f16643fd0b07d41f280d53..5cba59ad7dc5a38eff874cbc735ec140bdb2829c 100644 (file)
@@ -1164,14 +1164,16 @@ static int __init cpm_uart_console_setup(struct console *co, char *options)
        struct fs_uart_platform_info *pdata;
        struct platform_device* pdev = early_uart_get_pdev(co->index);
 
-       port =
-           (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]];
-       pinfo = (struct uart_cpm_port *)port;
        if (!pdev) {
                pr_info("cpm_uart: console: compat mode\n");
                /* compatibility - will be cleaned up */
                cpm_uart_init_portdesc();
+       }
 
+       port =
+           (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]];
+       pinfo = (struct uart_cpm_port *)port;
+       if (!pdev) {
                if (pinfo->set_lineif)
                        pinfo->set_lineif(pinfo);
        } else {
index 4b2de08f46d0ef7f58462e3144326743c3a6390f..cdba128250a96e5f2f98a07c5dcbf2318c65ff92 100644 (file)
@@ -213,7 +213,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
            L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize);
        if (is_con) {
                mem_addr = alloc_bootmem(memsz);
-               dma_addr = mem_addr;
+               dma_addr = virt_to_bus(mem_addr);
        }
        else
                mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr,