aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/commproc.c
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2007-09-28 15:06:16 -0400
committerKumar Gala <galak@kernel.crashing.org>2007-10-04 16:47:05 -0400
commit15f8c604a79c4840ed76eecf3af5d88b7c1dee9e (patch)
treed86815bc2daf835fee081ee7dac92cef8784f6a3 /arch/powerpc/sysdev/commproc.c
parent3c5df5c26ed17828760945d59653a2e22e3fb63f (diff)
[POWERPC] cpm: Describe multi-user ram in its own device node.
The way the current CPM binding describes available multi-user (a.k.a. dual-ported) RAM doesn't work well when there are multiple free regions, and it doesn't work at all if the region doesn't begin at the start of the muram area (as the hardware needs to be programmed with offsets into this area). The latter situation can happen with SMC UARTs on CPM2, as its parameter RAM is relocatable, u-boot puts it at zero, and the kernel doesn't support moving it. It is now described with a muram node, similar to QE. The current CPM binding is sufficiently recent (i.e. never appeared in an official release) that compatibility with existing device trees is not an issue. The code supporting the new binding is shared between cpm1 and cpm2, rather than remain separated. QE should be able to use this code as well, once minor fixes are made to its device trees. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev/commproc.c')
-rw-r--r--arch/powerpc/sysdev/commproc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index 428eb8c151b9..f6a63780bbde 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -39,12 +39,15 @@
39#include <asm/tlbflush.h> 39#include <asm/tlbflush.h>
40#include <asm/rheap.h> 40#include <asm/rheap.h>
41#include <asm/prom.h> 41#include <asm/prom.h>
42#include <asm/cpm.h>
42 43
43#include <asm/fs_pd.h> 44#include <asm/fs_pd.h>
44 45
45#define CPM_MAP_SIZE (0x4000) 46#define CPM_MAP_SIZE (0x4000)
46 47
48#ifndef CONFIG_PPC_CPM_NEW_BINDING
47static void m8xx_cpm_dpinit(void); 49static void m8xx_cpm_dpinit(void);
50#endif
48static uint host_buffer; /* One page of host buffer */ 51static uint host_buffer; /* One page of host buffer */
49static uint host_end; /* end + 1 */ 52static uint host_end; /* end + 1 */
50cpm8xx_t __iomem *cpmp; /* Pointer to comm processor space */ 53cpm8xx_t __iomem *cpmp; /* Pointer to comm processor space */
@@ -193,7 +196,7 @@ end:
193 return sirq; 196 return sirq;
194} 197}
195 198
196void cpm_reset(void) 199void __init cpm_reset(void)
197{ 200{
198 sysconf8xx_t __iomem *siu_conf; 201 sysconf8xx_t __iomem *siu_conf;
199 202
@@ -229,8 +232,12 @@ void cpm_reset(void)
229 out_be32(&siu_conf->sc_sdcr, 1); 232 out_be32(&siu_conf->sc_sdcr, 1);
230 immr_unmap(siu_conf); 233 immr_unmap(siu_conf);
231 234
235#ifdef CONFIG_PPC_CPM_NEW_BINDING
236 cpm_muram_init();
237#else
232 /* Reclaim the DP memory for our use. */ 238 /* Reclaim the DP memory for our use. */
233 m8xx_cpm_dpinit(); 239 m8xx_cpm_dpinit();
240#endif
234} 241}
235 242
236/* We used to do this earlier, but have to postpone as long as possible 243/* We used to do this earlier, but have to postpone as long as possible
@@ -296,6 +303,7 @@ cpm_setbrg(uint brg, uint rate)
296 CPM_BRG_EN | CPM_BRG_DIV16); 303 CPM_BRG_EN | CPM_BRG_DIV16);
297} 304}
298 305
306#ifndef CONFIG_PPC_CPM_NEW_BINDING
299/* 307/*
300 * dpalloc / dpfree bits. 308 * dpalloc / dpfree bits.
301 */ 309 */
@@ -397,6 +405,7 @@ uint cpm_dpram_phys(u8 *addr)
397 return (dpram_pbase + (uint)(addr - dpram_vbase)); 405 return (dpram_pbase + (uint)(addr - dpram_vbase));
398} 406}
399EXPORT_SYMBOL(cpm_dpram_phys); 407EXPORT_SYMBOL(cpm_dpram_phys);
408#endif /* !CONFIG_PPC_CPM_NEW_BINDING */
400 409
401struct cpm_ioport16 { 410struct cpm_ioport16 {
402 __be16 dir, par, sor, dat, intr; 411 __be16 dir, par, sor, dat, intr;