From: Vitaly Bordug <vbordug@ru.mvista.com>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev <linuxppc-dev@ozlabs.org>
Subject: [PATCH 2/5] [POWERPC] cpm_uart: OF-related fix for arch/powerpc
Date: Sat, 13 Jan 2007 03:42:07 +0300 [thread overview]
Message-ID: <20070113004207.1224.82053.stgit@localhost.localdomain> (raw)
In-Reply-To: <20070113004150.1224.58427.stgit@localhost.localdomain>
This makes cpm uart able to work using OF-passed parameters
in case of CPM stuff (found on most mpc8xx, mpc82xx reference and custom
boards). The idea is to keep ppc stuff working yet making it able ti be
used for powerpc. At the moment, mpc8272 requires this to have a
serial console.
Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
---
drivers/serial/cpm_uart/cpm_uart_cpm1.c | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
index 08e55fd..3ed4622 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -40,6 +40,7 @@
#include <asm/io.h>
#include <asm/irq.h>
+#include <asm/fs_pd.h>
#include <linux/serial_core.h>
#include <linux/kernel.h>
@@ -145,7 +146,11 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
/* was hostalloc but changed cause it blows away the */
/* large tlb mapping when pinning the kernel area */
mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8));
+#ifdef CONFIG_PPC_MERGE
+ dma_addr = (u32)cpm_dpram_phys(mem_addr);
+#else
dma_addr = (u32)mem_addr;
+#endif
} else
mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr,
GFP_KERNEL);
@@ -205,7 +210,7 @@ int __init cpm_uart_init_portdesc(void)
(unsigned long)&cpmp->cp_smc[0];
cpm_uart_ports[UART_SMC1].smcp->smc_smcm |= (SMCM_RX | SMCM_TX);
cpm_uart_ports[UART_SMC1].smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
- cpm_uart_ports[UART_SMC1].port.uartclk = (((bd_t *) __res)->bi_intfreq);
+ cpm_uart_ports[UART_SMC1].port.uartclk = uart_clock();
cpm_uart_port_map[cpm_uart_nr++] = UART_SMC1;
#endif
@@ -217,7 +222,7 @@ int __init cpm_uart_init_portdesc(void)
(unsigned long)&cpmp->cp_smc[1];
cpm_uart_ports[UART_SMC2].smcp->smc_smcm |= (SMCM_RX | SMCM_TX);
cpm_uart_ports[UART_SMC2].smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
- cpm_uart_ports[UART_SMC2].port.uartclk = (((bd_t *) __res)->bi_intfreq);
+ cpm_uart_ports[UART_SMC2].port.uartclk = uart_clock();
cpm_uart_port_map[cpm_uart_nr++] = UART_SMC2;
#endif
@@ -231,7 +236,7 @@ int __init cpm_uart_init_portdesc(void)
~(UART_SCCM_TX | UART_SCCM_RX);
cpm_uart_ports[UART_SCC1].sccp->scc_gsmrl &=
~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
- cpm_uart_ports[UART_SCC1].port.uartclk = (((bd_t *) __res)->bi_intfreq);
+ cpm_uart_ports[UART_SCC1].port.uartclk = uart_clock();
cpm_uart_port_map[cpm_uart_nr++] = UART_SCC1;
#endif
@@ -245,7 +250,7 @@ int __init cpm_uart_init_portdesc(void)
~(UART_SCCM_TX | UART_SCCM_RX);
cpm_uart_ports[UART_SCC2].sccp->scc_gsmrl &=
~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
- cpm_uart_ports[UART_SCC2].port.uartclk = (((bd_t *) __res)->bi_intfreq);
+ cpm_uart_ports[UART_SCC2].port.uartclk = uart_clock();
cpm_uart_port_map[cpm_uart_nr++] = UART_SCC2;
#endif
@@ -259,7 +264,7 @@ int __init cpm_uart_init_portdesc(void)
~(UART_SCCM_TX | UART_SCCM_RX);
cpm_uart_ports[UART_SCC3].sccp->scc_gsmrl &=
~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
- cpm_uart_ports[UART_SCC3].port.uartclk = (((bd_t *) __res)->bi_intfreq);
+ cpm_uart_ports[UART_SCC3].port.uartclk = uart_clock();
cpm_uart_port_map[cpm_uart_nr++] = UART_SCC3;
#endif
@@ -273,7 +278,7 @@ int __init cpm_uart_init_portdesc(void)
~(UART_SCCM_TX | UART_SCCM_RX);
cpm_uart_ports[UART_SCC4].sccp->scc_gsmrl &=
~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
- cpm_uart_ports[UART_SCC4].port.uartclk = (((bd_t *) __res)->bi_intfreq);
+ cpm_uart_ports[UART_SCC4].port.uartclk = uart_clock();
cpm_uart_port_map[cpm_uart_nr++] = UART_SCC4;
#endif
return 0;
next prev parent reply other threads:[~2007-01-13 1:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-13 0:41 [PATCH 1/5] [POWERPC] cpm2: CPM2 interrupt controller fix Vitaly Bordug
2007-01-13 0:42 ` Vitaly Bordug [this message]
2007-01-22 10:02 ` [PATCH 2/5] [POWERPC] cpm_uart: OF-related fix for arch/powerpc Paul Mackerras
2007-01-22 13:55 ` Vitaly Bordug
2007-01-13 0:42 ` [PATCH 3/5] [FS_ENET] OF-related fixup for FEC and SCC MAC's Vitaly Bordug
2007-01-22 10:07 ` Paul Mackerras
2007-01-22 14:04 ` Vitaly Bordug
2007-01-13 0:42 ` [PATCH 4/5] [POWERPC] Fix kernel build errors for mpc8272ads and mpc8560ads Vitaly Bordug
2007-01-13 0:42 ` [PATCH 5/5] [POWERPC] mpc8272ads: defconfig Vitaly Bordug
2007-01-22 9:57 ` [PATCH 1/5] [POWERPC] cpm2: CPM2 interrupt controller fix Paul Mackerras
2007-01-22 13:43 ` Vitaly Bordug
2007-01-22 19:55 ` Benjamin Herrenschmidt
2007-01-22 20:55 ` Vitaly Bordug
2007-01-22 21:13 ` Benjamin Herrenschmidt
2007-01-22 21:42 ` Vitaly Bordug
2007-01-24 10:07 ` Paul Mackerras
2007-01-24 13:05 ` Vitaly Bordug
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070113004207.1224.82053.stgit@localhost.localdomain \
--to=vbordug@ru.mvista.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).