diff options
Diffstat (limited to 'arch/powerpc/sysdev/cpm_common.c')
-rw-r--r-- | arch/powerpc/sysdev/cpm_common.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c index 0ac12e5fd8ab..911456d17713 100644 --- a/arch/powerpc/sysdev/cpm_common.c +++ b/arch/powerpc/sysdev/cpm_common.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <asm/udbg.h> | 28 | #include <asm/udbg.h> |
29 | #include <asm/io.h> | 29 | #include <asm/io.h> |
30 | #include <asm/cpm.h> | 30 | #include <asm/cpm.h> |
31 | #include <asm/fixmap.h> | ||
31 | #include <soc/fsl/qe/qe.h> | 32 | #include <soc/fsl/qe/qe.h> |
32 | 33 | ||
33 | #include <mm/mmu_decl.h> | 34 | #include <mm/mmu_decl.h> |
@@ -37,25 +38,36 @@ | |||
37 | #endif | 38 | #endif |
38 | 39 | ||
39 | #ifdef CONFIG_PPC_EARLY_DEBUG_CPM | 40 | #ifdef CONFIG_PPC_EARLY_DEBUG_CPM |
40 | static u32 __iomem *cpm_udbg_txdesc = | 41 | static u32 __iomem *cpm_udbg_txdesc; |
41 | (u32 __iomem __force *)CONFIG_PPC_EARLY_DEBUG_CPM_ADDR; | 42 | static u8 __iomem *cpm_udbg_txbuf; |
42 | 43 | ||
43 | static void udbg_putc_cpm(char c) | 44 | static void udbg_putc_cpm(char c) |
44 | { | 45 | { |
45 | u8 __iomem *txbuf = (u8 __iomem __force *)in_be32(&cpm_udbg_txdesc[1]); | ||
46 | |||
47 | if (c == '\n') | 46 | if (c == '\n') |
48 | udbg_putc_cpm('\r'); | 47 | udbg_putc_cpm('\r'); |
49 | 48 | ||
50 | while (in_be32(&cpm_udbg_txdesc[0]) & 0x80000000) | 49 | while (in_be32(&cpm_udbg_txdesc[0]) & 0x80000000) |
51 | ; | 50 | ; |
52 | 51 | ||
53 | out_8(txbuf, c); | 52 | out_8(cpm_udbg_txbuf, c); |
54 | out_be32(&cpm_udbg_txdesc[0], 0xa0000001); | 53 | out_be32(&cpm_udbg_txdesc[0], 0xa0000001); |
55 | } | 54 | } |
56 | 55 | ||
57 | void __init udbg_init_cpm(void) | 56 | void __init udbg_init_cpm(void) |
58 | { | 57 | { |
58 | #ifdef CONFIG_PPC_8xx | ||
59 | cpm_udbg_txdesc = (u32 __iomem __force *) | ||
60 | (CONFIG_PPC_EARLY_DEBUG_CPM_ADDR - PHYS_IMMR_BASE + | ||
61 | VIRT_IMMR_BASE); | ||
62 | cpm_udbg_txbuf = (u8 __iomem __force *) | ||
63 | (in_be32(&cpm_udbg_txdesc[1]) - PHYS_IMMR_BASE + | ||
64 | VIRT_IMMR_BASE); | ||
65 | #else | ||
66 | cpm_udbg_txdesc = (u32 __iomem __force *) | ||
67 | CONFIG_PPC_EARLY_DEBUG_CPM_ADDR; | ||
68 | cpm_udbg_txbuf = (u8 __iomem __force *)in_be32(&cpm_udbg_txdesc[1]); | ||
69 | #endif | ||
70 | |||
59 | if (cpm_udbg_txdesc) { | 71 | if (cpm_udbg_txdesc) { |
60 | #ifdef CONFIG_CPM2 | 72 | #ifdef CONFIG_CPM2 |
61 | setbat(1, 0xf0000000, 0xf0000000, 1024*1024, PAGE_KERNEL_NCG); | 73 | setbat(1, 0xf0000000, 0xf0000000, 1024*1024, PAGE_KERNEL_NCG); |