Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: (25 commits)
m68knommu: fix broken setting of irq_chip and handler
m68knommu: switch to using -mcpu= flags for ColdFire targets
m68knommu: arch/m68knommu/Kconfig whitespace cleanup
m68knommu: create optimal separate instruction and data cache for ColdFire
m68knommu: support ColdFire caches that do copyback and write-through
m68knommu: support version 2 ColdFire split cache
m68knommu: make cache push code ColdFire generic
m68knommu: clean up ColdFire cache control code
m68knommu: move inclusion of ColdFire v4 cache registers
m68knommu: merge bit definitions for version 3 ColdFire cache controller
m68knommu: create bit definitions for the version 2 ColdFire cache controller
m68knommu: remove empty __iounmap() it is no used
m68knommu: remove kernel_map() code, it is not used
m68knommu: remove do_page_fault(), it is not used
m68knommu: use user stack pointer hardware on some ColdFire cores
m68knommu: remove command line printing DEBUG
m68knommu: remove fasthandler interrupt code
m68knommu: move UART addressing to part specific includes
m68knommu: fix clock rate value reported for ColdFire 54xx parts
m68knommu: move ColdFire CPU names into their headers
...

+732 -628
+46 -59
arch/m68k/include/asm/cacheflush_no.h
··· 2 2 #define _M68KNOMMU_CACHEFLUSH_H 3 3 4 4 /* 5 - * (C) Copyright 2000-2004, Greg Ungerer <gerg@snapgear.com> 5 + * (C) Copyright 2000-2010, Greg Ungerer <gerg@snapgear.com> 6 6 */ 7 7 #include <linux/mm.h> 8 + #include <asm/mcfsim.h> 8 9 9 10 #define flush_cache_all() __flush_cache_all() 10 11 #define flush_cache_mm(mm) do { } while (0) 11 12 #define flush_cache_dup_mm(mm) do { } while (0) 12 - #define flush_cache_range(vma, start, end) __flush_cache_all() 13 + #define flush_cache_range(vma, start, end) do { } while (0) 13 14 #define flush_cache_page(vma, vmaddr) do { } while (0) 14 - #define flush_dcache_range(start,len) __flush_cache_all() 15 + #define flush_dcache_range(start, len) __flush_dcache_all() 15 16 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 16 17 #define flush_dcache_page(page) do { } while (0) 17 18 #define flush_dcache_mmap_lock(mapping) do { } while (0) 18 19 #define flush_dcache_mmap_unlock(mapping) do { } while (0) 19 - #define flush_icache_range(start,len) __flush_cache_all() 20 + #define flush_icache_range(start, len) __flush_icache_all() 20 21 #define flush_icache_page(vma,pg) do { } while (0) 21 22 #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) 22 23 #define flush_cache_vmap(start, end) do { } while (0) ··· 28 27 #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ 29 28 memcpy(dst, src, len) 30 29 30 + void mcf_cache_push(void); 31 + 31 32 static inline void __flush_cache_all(void) 32 33 { 33 - #if defined(CONFIG_M5407) || defined(CONFIG_M548x) 34 - /* 35 - * Use cpushl to push and invalidate all cache lines. 36 - * Gas doesn't seem to know how to generate the ColdFire 37 - * cpushl instruction... Oh well, bit stuff it for now. 38 - */ 34 + #ifdef CACHE_PUSH 35 + mcf_cache_push(); 36 + #endif 37 + #ifdef CACHE_INVALIDATE 39 38 __asm__ __volatile__ ( 40 - "nop\n\t" 41 - "clrl %%d0\n\t" 42 - "1:\n\t" 43 - "movel %%d0,%%a0\n\t" 44 - "2:\n\t" 45 - ".word 0xf468\n\t" 46 - "addl #0x10,%%a0\n\t" 47 - "cmpl #0x00000800,%%a0\n\t" 48 - "blt 2b\n\t" 49 - "addql #1,%%d0\n\t" 50 - "cmpil #4,%%d0\n\t" 51 - "bne 1b\n\t" 52 - "movel #0xb6088500,%%d0\n\t" 53 - "movec %%d0,%%CACR\n\t" 54 - : : : "d0", "a0" ); 55 - #endif /* CONFIG_M5407 */ 56 - #if defined(CONFIG_M523x) || defined(CONFIG_M527x) 57 - __asm__ __volatile__ ( 58 - "movel #0x81400100, %%d0\n\t" 39 + "movel %0, %%d0\n\t" 59 40 "movec %%d0, %%CACR\n\t" 60 41 "nop\n\t" 61 - : : : "d0" ); 62 - #endif /* CONFIG_M523x || CONFIG_M527x */ 63 - #if defined(CONFIG_M528x) 64 - __asm__ __volatile__ ( 65 - "movel #0x81000200, %%d0\n\t" 66 - "movec %%d0, %%CACR\n\t" 67 - "nop\n\t" 68 - : : : "d0" ); 69 - #endif /* CONFIG_M528x */ 70 - #if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || defined(CONFIG_M5272) 71 - __asm__ __volatile__ ( 72 - "movel #0x81000100, %%d0\n\t" 73 - "movec %%d0, %%CACR\n\t" 74 - "nop\n\t" 75 - : : : "d0" ); 76 - #endif /* CONFIG_M5206 || CONFIG_M5206e || CONFIG_M5272 */ 77 - #ifdef CONFIG_M5249 78 - __asm__ __volatile__ ( 79 - "movel #0xa1000200, %%d0\n\t" 80 - "movec %%d0, %%CACR\n\t" 81 - "nop\n\t" 82 - : : : "d0" ); 83 - #endif /* CONFIG_M5249 */ 84 - #ifdef CONFIG_M532x 85 - __asm__ __volatile__ ( 86 - "movel #0x81000200, %%d0\n\t" 87 - "movec %%d0, %%CACR\n\t" 88 - "nop\n\t" 89 - : : : "d0" ); 90 - #endif /* CONFIG_M532x */ 42 + : : "i" (CACHE_INVALIDATE) : "d0" ); 43 + #endif 91 44 } 92 45 46 + /* 47 + * Some ColdFire parts implement separate instruction and data caches, 48 + * on those we should just flush the appropriate cache. If we don't need 49 + * to do any specific flushing then this will be optimized away. 50 + */ 51 + static inline void __flush_icache_all(void) 52 + { 53 + #ifdef CACHE_INVALIDATEI 54 + __asm__ __volatile__ ( 55 + "movel %0, %%d0\n\t" 56 + "movec %%d0, %%CACR\n\t" 57 + "nop\n\t" 58 + : : "i" (CACHE_INVALIDATEI) : "d0" ); 59 + #endif 60 + } 61 + 62 + static inline void __flush_dcache_all(void) 63 + { 64 + #ifdef CACHE_PUSH 65 + mcf_cache_push(); 66 + #endif 67 + #ifdef CACHE_INVALIDATED 68 + __asm__ __volatile__ ( 69 + "movel %0, %%d0\n\t" 70 + "movec %%d0, %%CACR\n\t" 71 + "nop\n\t" 72 + : : "i" (CACHE_INVALIDATED) : "d0" ); 73 + #else 74 + /* Flush the wrtite buffer */ 75 + __asm__ __volatile__ ( "nop" ); 76 + #endif 77 + } 93 78 #endif /* _M68KNOMMU_CACHEFLUSH_H */
+1 -1
arch/m68k/include/asm/coldfire.h
··· 32 32 */ 33 33 #define MCF_MBAR 0x10000000 34 34 #define MCF_MBAR2 0x80000000 35 - #if defined(CONFIG_M548x) 35 + #if defined(CONFIG_M54xx) 36 36 #define MCF_IPSBAR MCF_MBAR 37 37 #elif defined(CONFIG_M520x) 38 38 #define MCF_IPSBAR 0xFC000000
+34 -25
arch/m68k/include/asm/entry_no.h
··· 42 42 */ 43 43 44 44 #ifdef CONFIG_COLDFIRE 45 + #ifdef CONFIG_COLDFIRE_SW_A7 45 46 /* 46 - * This is made a little more tricky on the ColdFire. There is no 47 - * separate kernel and user stack pointers. Need to artificially 47 + * This is made a little more tricky on older ColdFires. There is no 48 + * separate supervisor and user stack pointers. Need to artificially 48 49 * construct a usp in software... When doing this we need to disable 49 - * interrupts, otherwise bad things could happen. 50 + * interrupts, otherwise bad things will happen. 50 51 */ 52 + .globl sw_usp 53 + .globl sw_ksp 54 + 51 55 .macro SAVE_ALL 52 56 move #0x2700,%sr /* disable intrs */ 53 57 btst #5,%sp@(2) /* from user? */ ··· 78 74 7: 79 75 .endm 80 76 81 - .macro RESTORE_ALL 82 - btst #5,%sp@(PT_SR) /* going user? */ 83 - bnes 8f /* no, skip */ 77 + .macro RESTORE_USER 84 78 move #0x2700,%sr /* disable intrs */ 85 79 movel sw_usp,%a0 /* get usp */ 86 80 movel %sp@(PT_OFF_PC),%a0@- /* copy exception program counter */ ··· 93 91 subql #8,sw_usp /* set exception */ 94 92 movel sw_usp,%sp /* restore usp */ 95 93 rte 96 - 8: 97 - moveml %sp@,%d1-%d5/%a0-%a2 98 - lea %sp@(32),%sp /* space for 8 regs */ 99 - movel %sp@+,%d0 100 - addql #4,%sp /* orig d0 */ 101 - addl %sp@+,%sp /* stkadj */ 102 - rte 103 94 .endm 104 95 96 + .macro RDUSP 97 + movel sw_usp,%a2 98 + .endm 99 + 100 + .macro WRUSP 101 + movel %a0,sw_usp 102 + .endm 103 + 104 + #else /* !CONFIG_COLDFIRE_SW_A7 */ 105 105 /* 106 - * Quick exception save, use current stack only. 106 + * Modern ColdFire parts have separate supervisor and user stack 107 + * pointers. Simple load and restore macros for this case. 107 108 */ 108 - .macro SAVE_LOCAL 109 + .macro SAVE_ALL 109 110 move #0x2700,%sr /* disable intrs */ 110 111 clrl %sp@- /* stkadj */ 111 112 movel %d0,%sp@- /* orig d0 */ ··· 117 112 moveml %d1-%d5/%a0-%a2,%sp@ 118 113 .endm 119 114 120 - .macro RESTORE_LOCAL 115 + .macro RESTORE_USER 121 116 moveml %sp@,%d1-%d5/%a0-%a2 122 117 lea %sp@(32),%sp /* space for 8 regs */ 123 118 movel %sp@+,%d0 ··· 125 120 addl %sp@+,%sp /* stkadj */ 126 121 rte 127 122 .endm 123 + 124 + .macro RDUSP 125 + /*move %usp,%a2*/ 126 + .word 0x4e6a 127 + .endm 128 + 129 + .macro WRUSP 130 + /*move %a0,%usp*/ 131 + .word 0x4e60 132 + .endm 133 + 134 + #endif /* !CONFIG_COLDFIRE_SW_A7 */ 128 135 129 136 .macro SAVE_SWITCH_STACK 130 137 lea %sp@(-24),%sp /* 6 regs */ ··· 147 130 moveml %sp@,%a3-%a6/%d6-%d7 148 131 lea %sp@(24),%sp /* 6 regs */ 149 132 .endm 150 - 151 - /* 152 - * Software copy of the user and kernel stack pointers... Ugh... 153 - * Need these to get around ColdFire not having separate kernel 154 - * and user stack pointers. 155 - */ 156 - .globl sw_usp 157 - .globl sw_ksp 158 133 159 134 #else /* !CONFIG_COLDFIRE */ 160 135 ··· 176 167 moveml %sp@+,%a3-%a6/%d6-%d7 177 168 .endm 178 169 179 - #endif /* !CONFIG_COLDFIRE */ 170 + #endif /* !COLDFIRE_SW_A7 */ 180 171 #endif /* __ASSEMBLY__ */ 181 172 #endif /* __M68KNOMMU_ENTRY_H */
+1 -1
arch/m68k/include/asm/gpio.h
··· 37 37 #if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \ 38 38 defined(CONFIG_M520x) || defined(CONFIG_M523x) || \ 39 39 defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ 40 - defined(CONFIG_M532x) || defined(CONFIG_M548x) 40 + defined(CONFIG_M532x) || defined(CONFIG_M54xx) 41 41 42 42 /* These parts have GPIO organized by 8 bit ports */ 43 43
-1
arch/m68k/include/asm/io_no.h
··· 145 145 #define IOMAP_WRITETHROUGH 3 146 146 147 147 extern void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag); 148 - extern void __iounmap(void *addr, unsigned long size); 149 148 150 149 static inline void *ioremap(unsigned long physaddr, unsigned long size) 151 150 {
+13 -1
arch/m68k/include/asm/m5206sim.h
··· 12 12 #define m5206sim_h 13 13 /****************************************************************************/ 14 14 15 + #define CPU_NAME "COLDFIRE(m5206)" 16 + #define CPU_INSTR_PER_JIFFY 3 17 + 18 + #include <asm/m52xxacr.h> 15 19 16 20 /* 17 21 * Define the 5206 SIM register set addresses. ··· 92 88 #define MCFSIM_PADDR (MCF_MBAR + 0x1c5) /* Parallel Direction (r/w) */ 93 89 #define MCFSIM_PADAT (MCF_MBAR + 0x1c9) /* Parallel Port Value (r/w) */ 94 90 91 + #if defined(CONFIG_NETtel) 92 + #define MCFUART_BASE1 0x180 /* Base address of UART1 */ 93 + #define MCFUART_BASE2 0x140 /* Base address of UART2 */ 94 + #else 95 + #define MCFUART_BASE1 0x140 /* Base address of UART1 */ 96 + #define MCFUART_BASE2 0x180 /* Base address of UART2 */ 97 + #endif 98 + 95 99 /* 96 100 * Define system peripheral IRQ usage. 97 101 */ ··· 107 95 #define MCF_IRQ_PROFILER 31 /* Timer1, Level 7 */ 108 96 109 97 /* 110 - * Generic GPIO 98 + * Generic GPIO 111 99 */ 112 100 #define MCFGPIO_PIN_MAX 8 113 101 #define MCFGPIO_IRQ_VECBASE -1
+16 -1
arch/m68k/include/asm/m520xsim.h
··· 11 11 #define m520xsim_h 12 12 /****************************************************************************/ 13 13 14 + #define CPU_NAME "COLDFIRE(m520x)" 15 + #define CPU_INSTR_PER_JIFFY 3 16 + 17 + #include <asm/m52xxacr.h> 18 + 14 19 /* 15 20 * Define the 520x SIM register set addresses. 16 21 */ ··· 59 54 #define MCFSIM_SDCS0 0x000a8110 /* SDRAM Chip Select 0 Configuration */ 60 55 #define MCFSIM_SDCS1 0x000a8114 /* SDRAM Chip Select 1 Configuration */ 61 56 57 + /* 58 + * EPORT and GPIO registers. 59 + */ 62 60 #define MCFEPORT_EPDDR 0xFC088002 63 61 #define MCFEPORT_EPDR 0xFC088004 64 62 #define MCFEPORT_EPPDR 0xFC088005 ··· 105 97 #define MCFGPIO_PCLRR_UART 0xFC0A402A 106 98 #define MCFGPIO_PCLRR_FECH 0xFC0A402B 107 99 #define MCFGPIO_PCLRR_FECL 0xFC0A402C 100 + 108 101 /* 109 102 * Generic GPIO support 110 103 */ ··· 118 109 #define MCFGPIO_PIN_MAX 80 119 110 #define MCFGPIO_IRQ_MAX 8 120 111 #define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE 121 - /****************************************************************************/ 122 112 123 113 #define MCF_GPIO_PAR_UART (0xA4036) 124 114 #define MCF_GPIO_PAR_FECI2C (0xA4033) ··· 132 124 133 125 #define MCF_GPIO_PAR_FECI2C_PAR_SDA_URXD2 (0x02) 134 126 #define MCF_GPIO_PAR_FECI2C_PAR_SCL_UTXD2 (0x04) 127 + 128 + /* 129 + * UART module. 130 + */ 131 + #define MCFUART_BASE1 0x60000 /* Base address of UART1 */ 132 + #define MCFUART_BASE2 0x64000 /* Base address of UART2 */ 133 + #define MCFUART_BASE3 0x68000 /* Base address of UART2 */ 135 134 136 135 /* 137 136 * Reset Controll Unit.
+11
arch/m68k/include/asm/m523xsim.h
··· 11 11 #define m523xsim_h 12 12 /****************************************************************************/ 13 13 14 + #define CPU_NAME "COLDFIRE(m523x)" 15 + #define CPU_INSTR_PER_JIFFY 3 16 + 17 + #include <asm/m52xxacr.h> 14 18 15 19 /* 16 20 * Define the 523x SIM register set addresses. ··· 53 49 54 50 #define MCF_RCR_SWRESET 0x80 /* Software reset bit */ 55 51 #define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */ 52 + 53 + /* 54 + * UART module. 55 + */ 56 + #define MCFUART_BASE1 0x200 /* Base address of UART1 */ 57 + #define MCFUART_BASE2 0x240 /* Base address of UART2 */ 58 + #define MCFUART_BASE3 0x280 /* Base address of UART3 */ 56 59 57 60 #define MCFGPIO_PODR_ADDR (MCF_IPSBAR + 0x100000) 58 61 #define MCFGPIO_PODR_DATAH (MCF_IPSBAR + 0x100001)
+10
arch/m68k/include/asm/m5249sim.h
··· 11 11 #define m5249sim_h 12 12 /****************************************************************************/ 13 13 14 + #define CPU_NAME "COLDFIRE(m5249)" 15 + #define CPU_INSTR_PER_JIFFY 3 16 + 17 + #include <asm/m52xxacr.h> 18 + 14 19 /* 15 20 * Define the 5249 SIM register set addresses. 16 21 */ ··· 61 56 #define MCFSIM_DACR1 0x110 /* DRAM 1 Addr and Ctrl (r/w) */ 62 57 #define MCFSIM_DMR1 0x114 /* DRAM 1 Mask reg (r/w) */ 63 58 59 + /* 60 + * UART module. 61 + */ 62 + #define MCFUART_BASE1 0x1c0 /* Base address of UART1 */ 63 + #define MCFUART_BASE2 0x200 /* Base address of UART2 */ 64 64 65 65 /* 66 66 * Some symbol defines for the above...
+8
arch/m68k/include/asm/m5272sim.h
··· 12 12 #define m5272sim_h 13 13 /****************************************************************************/ 14 14 15 + #define CPU_NAME "COLDFIRE(m5272)" 16 + #define CPU_INSTR_PER_JIFFY 3 17 + 18 + #include <asm/m52xxacr.h> 19 + 15 20 /* 16 21 * Define the 5272 SIM register set addresses. 17 22 */ ··· 66 61 #define MCFSIM_DCAR1 0x58 /* DRAM 1 Address reg (r/w) */ 67 62 #define MCFSIM_DCMR1 0x5c /* DRAM 1 Mask reg (r/w) */ 68 63 #define MCFSIM_DCCR1 0x63 /* DRAM 1 Control reg (r/w) */ 64 + 65 + #define MCFUART_BASE1 0x100 /* Base address of UART1 */ 66 + #define MCFUART_BASE2 0x140 /* Base address of UART2 */ 69 67 70 68 #define MCFSIM_PACNT (MCF_MBAR + 0x80) /* Port A Control (r/w) */ 71 69 #define MCFSIM_PADDR (MCF_MBAR + 0x84) /* Port A Direction (r/w) */
+10
arch/m68k/include/asm/m527xsim.h
··· 11 11 #define m527xsim_h 12 12 /****************************************************************************/ 13 13 14 + #define CPU_NAME "COLDFIRE(m527x)" 15 + #define CPU_INSTR_PER_JIFFY 3 16 + 17 + #include <asm/m52xxacr.h> 14 18 15 19 /* 16 20 * Define the 5270/5271 SIM register set addresses. ··· 59 55 #define MCFSIM_DMR1 0x5c /* SDRAM address mask 1 */ 60 56 #endif 61 57 58 + /* 59 + * UART module. 60 + */ 61 + #define MCFUART_BASE1 0x200 /* Base address of UART1 */ 62 + #define MCFUART_BASE2 0x240 /* Base address of UART2 */ 63 + #define MCFUART_BASE3 0x280 /* Base address of UART3 */ 62 64 63 65 #ifdef CONFIG_M5271 64 66 #define MCFGPIO_PODR_ADDR (MCF_IPSBAR + 0x100000)
+11
arch/m68k/include/asm/m528xsim.h
··· 11 11 #define m528xsim_h 12 12 /****************************************************************************/ 13 13 14 + #define CPU_NAME "COLDFIRE(m528x)" 15 + #define CPU_INSTR_PER_JIFFY 3 16 + 17 + #include <asm/m52xxacr.h> 14 18 15 19 /* 16 20 * Define the 5280/5282 SIM register set addresses. ··· 44 40 #define MCFSIM_DMR0 0x4c /* SDRAM address mask 0 */ 45 41 #define MCFSIM_DACR1 0x50 /* SDRAM base address 1 */ 46 42 #define MCFSIM_DMR1 0x54 /* SDRAM address mask 1 */ 43 + 44 + /* 45 + * UART module. 46 + */ 47 + #define MCFUART_BASE1 0x200 /* Base address of UART1 */ 48 + #define MCFUART_BASE2 0x240 /* Base address of UART2 */ 49 + #define MCFUART_BASE3 0x280 /* Base address of UART3 */ 47 50 48 51 /* 49 52 * GPIO registers
+94
arch/m68k/include/asm/m52xxacr.h
··· 1 + /****************************************************************************/ 2 + 3 + /* 4 + * m52xxacr.h -- ColdFire version 2 core cache support 5 + * 6 + * (C) Copyright 2010, Greg Ungerer <gerg@snapgear.com> 7 + */ 8 + 9 + /****************************************************************************/ 10 + #ifndef m52xxacr_h 11 + #define m52xxacr_h 12 + /****************************************************************************/ 13 + 14 + /* 15 + * All varients of the ColdFire using version 2 cores have a similar 16 + * cache setup. Although not absolutely identical the cache register 17 + * definitions are compatible for all of them. Mostly they support a 18 + * configurable cache memory that can be instruction only, data only, 19 + * or split instruction and data. The exception is the very old version 2 20 + * core based parts, like the 5206(e), 5249 and 5272, which are instruction 21 + * cache only. Cache size varies from 2k up to 16k. 22 + */ 23 + 24 + /* 25 + * Define the Cache Control register flags. 26 + */ 27 + #define CACR_CENB 0x80000000 /* Enable cache */ 28 + #define CACR_CDPI 0x10000000 /* Disable invalidation by CPUSHL */ 29 + #define CACR_CFRZ 0x08000000 /* Cache freeze mode */ 30 + #define CACR_CINV 0x01000000 /* Invalidate cache */ 31 + #define CACR_DISI 0x00800000 /* Disable instruction cache */ 32 + #define CACR_DISD 0x00400000 /* Disable data cache */ 33 + #define CACR_INVI 0x00200000 /* Invalidate instruction cache */ 34 + #define CACR_INVD 0x00100000 /* Invalidate data cache */ 35 + #define CACR_CEIB 0x00000400 /* Non-cachable instruction burst */ 36 + #define CACR_DCM 0x00000200 /* Default cache mode */ 37 + #define CACR_DBWE 0x00000100 /* Buffered write enable */ 38 + #define CACR_DWP 0x00000020 /* Write protection */ 39 + #define CACR_EUSP 0x00000010 /* Enable separate user a7 */ 40 + 41 + /* 42 + * Define the Access Control register flags. 43 + */ 44 + #define ACR_BASE_POS 24 /* Address Base (upper 8 bits) */ 45 + #define ACR_MASK_POS 16 /* Address Mask (next 8 bits) */ 46 + #define ACR_ENABLE 0x00008000 /* Enable this ACR */ 47 + #define ACR_USER 0x00000000 /* Allow only user accesses */ 48 + #define ACR_SUPER 0x00002000 /* Allow supervisor access only */ 49 + #define ACR_ANY 0x00004000 /* Allow any access type */ 50 + #define ACR_CENB 0x00000000 /* Caching of region enabled */ 51 + #define ACR_CDIS 0x00000040 /* Caching of region disabled */ 52 + #define ACR_BWE 0x00000020 /* Write buffer enabled */ 53 + #define ACR_WPROTECT 0x00000004 /* Write protect region */ 54 + 55 + /* 56 + * Set the cache controller settings we will use. On the cores that support 57 + * a split cache configuration we allow all the combinations at Kconfig 58 + * time. For those cores that only have an instruction cache we just set 59 + * that as on. 60 + */ 61 + #if defined(CONFIG_CACHE_I) 62 + #define CACHE_TYPE (CACR_DISD + CACR_EUSP) 63 + #define CACHE_INVTYPEI 0 64 + #elif defined(CONFIG_CACHE_D) 65 + #define CACHE_TYPE (CACR_DISI + CACR_EUSP) 66 + #define CACHE_INVTYPED 0 67 + #elif defined(CONFIG_CACHE_BOTH) 68 + #define CACHE_TYPE CACR_EUSP 69 + #define CACHE_INVTYPEI CACR_INVI 70 + #define CACHE_INVTYPED CACR_INVD 71 + #else 72 + /* This is the instruction cache only devices (no split cache, no eusp) */ 73 + #define CACHE_TYPE 0 74 + #define CACHE_INVTYPEI 0 75 + #endif 76 + 77 + #define CACHE_INIT (CACR_CINV + CACHE_TYPE) 78 + #define CACHE_MODE (CACR_CENB + CACHE_TYPE + CACR_DCM) 79 + 80 + #define CACHE_INVALIDATE (CACHE_MODE + CACR_CINV) 81 + #if defined(CACHE_INVTYPEI) 82 + #define CACHE_INVALIDATEI (CACHE_MODE + CACR_CINV + CACHE_INVTYPEI) 83 + #endif 84 + #if defined(CACHE_INVTYPED) 85 + #define CACHE_INVALIDATED (CACHE_MODE + CACR_CINV + CACHE_INVTYPED) 86 + #endif 87 + 88 + #define ACR0_MODE ((CONFIG_RAMBASE & 0xff000000) + \ 89 + (0x000f0000) + \ 90 + (ACR_ENABLE + ACR_ANY + ACR_CENB + ACR_BWE)) 91 + #define ACR1_MODE 0 92 + 93 + /****************************************************************************/ 94 + #endif /* m52xxsim_h */
+16 -27
arch/m68k/include/asm/m5307sim.h
··· 14 14 #define m5307sim_h 15 15 /****************************************************************************/ 16 16 17 + #define CPU_NAME "COLDFIRE(m5307)" 18 + #define CPU_INSTR_PER_JIFFY 3 19 + 20 + #include <asm/m53xxacr.h> 21 + 17 22 /* 18 23 * Define the 5307 SIM register set addresses. 19 24 */ ··· 99 94 #define MCFSIM_PADAT (MCF_MBAR + 0x248) 100 95 101 96 /* 97 + * UART module. 98 + */ 99 + #if defined(CONFIG_NETtel) || defined(CONFIG_SECUREEDGEMP3) 100 + #define MCFUART_BASE1 0x200 /* Base address of UART1 */ 101 + #define MCFUART_BASE2 0x1c0 /* Base address of UART2 */ 102 + #else 103 + #define MCFUART_BASE1 0x1c0 /* Base address of UART1 */ 104 + #define MCFUART_BASE2 0x200 /* Base address of UART2 */ 105 + #endif 106 + 107 + /* 102 108 * Generic GPIO support 103 109 */ 104 110 #define MCFGPIO_PIN_MAX 16 ··· 161 145 */ 162 146 #define MCF_IRQ_TIMER 30 /* Timer0, Level 6 */ 163 147 #define MCF_IRQ_PROFILER 31 /* Timer1, Level 7 */ 164 - 165 - /* 166 - * Define the Cache register flags. 167 - */ 168 - #define CACR_EC (1<<31) 169 - #define CACR_ESB (1<<29) 170 - #define CACR_DPI (1<<28) 171 - #define CACR_HLCK (1<<27) 172 - #define CACR_CINVA (1<<24) 173 - #define CACR_DNFB (1<<10) 174 - #define CACR_DCM_WTHRU (0<<8) 175 - #define CACR_DCM_WBACK (1<<8) 176 - #define CACR_DCM_OFF_PRE (2<<8) 177 - #define CACR_DCM_OFF_IMP (3<<8) 178 - #define CACR_DW (1<<5) 179 - 180 - #define ACR_BASE_POS 24 181 - #define ACR_MASK_POS 16 182 - #define ACR_ENABLE (1<<15) 183 - #define ACR_USER (0<<13) 184 - #define ACR_SUPER (1<<13) 185 - #define ACR_ANY (2<<13) 186 - #define ACR_CM_WTHRU (0<<5) 187 - #define ACR_CM_WBACK (1<<5) 188 - #define ACR_CM_OFF_PRE (2<<5) 189 - #define ACR_CM_OFF_IMP (3<<5) 190 - #define ACR_WPROTECT (1<<2) 191 148 192 149 /****************************************************************************/ 193 150 #endif /* m5307sim_h */
+9 -24
arch/m68k/include/asm/m532xsim.h
··· 9 9 #define m532xsim_h 10 10 /****************************************************************************/ 11 11 12 + #define CPU_NAME "COLDFIRE(m532x)" 13 + #define CPU_INSTR_PER_JIFFY 3 14 + 15 + #include <asm/m53xxacr.h> 16 + 12 17 #define MCF_REG32(x) (*(volatile unsigned long *)(x)) 13 18 #define MCF_REG16(x) (*(volatile unsigned short *)(x)) 14 19 #define MCF_REG08(x) (*(volatile unsigned char *)(x)) ··· 79 74 #define MCF_IRQ_PROFILER (64 + 33) /* Timer1 */ 80 75 81 76 /* 82 - * Define the Cache register flags. 77 + * UART module. 83 78 */ 84 - #define CACR_EC (1<<31) 85 - #define CACR_ESB (1<<29) 86 - #define CACR_DPI (1<<28) 87 - #define CACR_HLCK (1<<27) 88 - #define CACR_CINVA (1<<24) 89 - #define CACR_DNFB (1<<10) 90 - #define CACR_DCM_WTHRU (0<<8) 91 - #define CACR_DCM_WBACK (1<<8) 92 - #define CACR_DCM_OFF_PRE (2<<8) 93 - #define CACR_DCM_OFF_IMP (3<<8) 94 - #define CACR_DW (1<<5) 95 - 96 - #define ACR_BASE_POS 24 97 - #define ACR_MASK_POS 16 98 - #define ACR_ENABLE (1<<15) 99 - #define ACR_USER (0<<13) 100 - #define ACR_SUPER (1<<13) 101 - #define ACR_ANY (2<<13) 102 - #define ACR_CM_WTHRU (0<<5) 103 - #define ACR_CM_WBACK (1<<5) 104 - #define ACR_CM_OFF_PRE (2<<5) 105 - #define ACR_CM_OFF_IMP (3<<5) 106 - #define ACR_WPROTECT (1<<2) 79 + #define MCFUART_BASE1 0xFC060000 /* Base address of UART1 */ 80 + #define MCFUART_BASE2 0xFC064000 /* Base address of UART2 */ 81 + #define MCFUART_BASE3 0xFC068000 /* Base address of UART3 */ 107 82 108 83 /********************************************************************* 109 84 *
+101
arch/m68k/include/asm/m53xxacr.h
··· 1 + /****************************************************************************/ 2 + 3 + /* 4 + * m53xxacr.h -- ColdFire version 3 core cache support 5 + * 6 + * (C) Copyright 2010, Greg Ungerer <gerg@snapgear.com> 7 + */ 8 + 9 + /****************************************************************************/ 10 + #ifndef m53xxacr_h 11 + #define m53xxacr_h 12 + /****************************************************************************/ 13 + 14 + /* 15 + * All varients of the ColdFire using version 3 cores have a similar 16 + * cache setup. They have a unified instruction and data cache, with 17 + * configurable write-through or copy-back operation. 18 + */ 19 + 20 + /* 21 + * Define the Cache Control register flags. 22 + */ 23 + #define CACR_EC 0x80000000 /* Enable cache */ 24 + #define CACR_ESB 0x20000000 /* Enable store buffer */ 25 + #define CACR_DPI 0x10000000 /* Disable invalidation by CPUSHL */ 26 + #define CACR_HLCK 0x08000000 /* Half cache lock mode */ 27 + #define CACR_CINVA 0x01000000 /* Invalidate cache */ 28 + #define CACR_DNFB 0x00000400 /* Inhibited fill buffer */ 29 + #define CACR_DCM_WT 0x00000000 /* Cacheable write-through */ 30 + #define CACR_DCM_CB 0x00000100 /* Cacheable copy-back */ 31 + #define CACR_DCM_PRE 0x00000200 /* Cache inhibited, precise */ 32 + #define CACR_DCM_IMPRE 0x00000300 /* Cache inhibited, imprecise */ 33 + #define CACR_WPROTECT 0x00000020 /* Write protect*/ 34 + #define CACR_EUSP 0x00000010 /* Eanble separate user a7 */ 35 + 36 + /* 37 + * Define the Access Control register flags. 38 + */ 39 + #define ACR_BASE_POS 24 /* Address Base (upper 8 bits) */ 40 + #define ACR_MASK_POS 16 /* Address Mask (next 8 bits) */ 41 + #define ACR_ENABLE 0x00008000 /* Enable this ACR */ 42 + #define ACR_USER 0x00000000 /* Allow only user accesses */ 43 + #define ACR_SUPER 0x00002000 /* Allow supervisor access only */ 44 + #define ACR_ANY 0x00004000 /* Allow any access type */ 45 + #define ACR_CM_WT 0x00000000 /* Cacheable, write-through */ 46 + #define ACR_CM_CB 0x00000020 /* Cacheable, copy-back */ 47 + #define ACR_CM_PRE 0x00000040 /* Cache inhibited, precise */ 48 + #define ACR_CM_IMPRE 0x00000060 /* Cache inhibited, imprecise */ 49 + #define ACR_WPROTECT 0x00000004 /* Write protect region */ 50 + 51 + /* 52 + * Define the cache type and arrangement (needed for pushes). 53 + */ 54 + #if defined(CONFIG_M5307) 55 + #define CACHE_SIZE 0x2000 /* 8k of unified cache */ 56 + #define ICACHE_SIZE CACHE_SIZE 57 + #define DCACHE_SIZE CACHE_SIZE 58 + #elif defined(CONFIG_M532x) 59 + #define CACHE_SIZE 0x4000 /* 32k of unified cache */ 60 + #define ICACHE_SIZE CACHE_SIZE 61 + #define DCACHE_SIZE CACHE_SIZE 62 + #endif 63 + 64 + #define CACHE_LINE_SIZE 16 /* 16 byte line size */ 65 + #define CACHE_WAYS 4 /* 4 ways - set associative */ 66 + 67 + /* 68 + * Set the cache controller settings we will use. This default in the 69 + * CACR is cache inhibited, we use the ACR register to set cacheing 70 + * enabled on the regions we want (eg RAM). 71 + */ 72 + #if defined(CONFIG_CACHE_COPYBACK) 73 + #define CACHE_TYPE ACR_CM_CB 74 + #define CACHE_PUSH 75 + #else 76 + #define CACHE_TYPE ACR_CM_WT 77 + #endif 78 + 79 + #ifdef CONFIG_COLDFIRE_SW_A7 80 + #define CACHE_MODE (CACR_EC + CACR_ESB + CACR_DCM_PRE) 81 + #else 82 + #define CACHE_MODE (CACR_EC + CACR_ESB + CACR_DCM_PRE + CACR_EUSP) 83 + #endif 84 + 85 + /* 86 + * Unified cache means we will never need to flush for coherency of 87 + * instruction fetch. We will need to flush to maintain memory/DMA 88 + * coherency though in all cases. And for copyback caches we will need 89 + * to push cached data as well. 90 + */ 91 + #define CACHE_INIT CACR_CINVA 92 + #define CACHE_INVALIDATE CACR_CINVA 93 + #define CACHE_INVALIDATED CACR_CINVA 94 + 95 + #define ACR0_MODE ((CONFIG_RAMBASE & 0xff000000) + \ 96 + (0x000f0000) + \ 97 + (ACR_ENABLE + ACR_ANY + CACHE_TYPE)) 98 + #define ACR1_MODE 0 99 + 100 + /****************************************************************************/ 101 + #endif /* m53xxsim_h */
+8 -34
arch/m68k/include/asm/m5407sim.h
··· 14 14 #define m5407sim_h 15 15 /****************************************************************************/ 16 16 17 + #define CPU_NAME "COLDFIRE(m5407)" 18 + #define CPU_INSTR_PER_JIFFY 3 19 + 20 + #include <asm/m54xxacr.h> 21 + 17 22 /* 18 23 * Define the 5407 SIM register set addresses. 19 24 */ ··· 78 73 #define MCFSIM_DACR1 0x110 /* DRAM 1 Addr and Ctrl (r/w) */ 79 74 #define MCFSIM_DMR1 0x114 /* DRAM 1 Mask reg (r/w) */ 80 75 76 + #define MCFUART_BASE1 0x1c0 /* Base address of UART1 */ 77 + #define MCFUART_BASE2 0x200 /* Base address of UART2 */ 78 + 81 79 #define MCFSIM_PADDR (MCF_MBAR + 0x244) 82 80 #define MCFSIM_PADAT (MCF_MBAR + 0x248) 83 81 ··· 124 116 */ 125 117 #define MCF_IRQ_TIMER 30 /* Timer0, Level 6 */ 126 118 #define MCF_IRQ_PROFILER 31 /* Timer1, Level 7 */ 127 - 128 - /* 129 - * Define the Cache register flags. 130 - */ 131 - #define CACR_DEC 0x80000000 /* Enable data cache */ 132 - #define CACR_DWP 0x40000000 /* Data write protection */ 133 - #define CACR_DESB 0x20000000 /* Enable data store buffer */ 134 - #define CACR_DDPI 0x10000000 /* Disable CPUSHL */ 135 - #define CACR_DHCLK 0x08000000 /* Half data cache lock mode */ 136 - #define CACR_DDCM_WT 0x00000000 /* Write through cache*/ 137 - #define CACR_DDCM_CP 0x02000000 /* Copyback cache */ 138 - #define CACR_DDCM_P 0x04000000 /* No cache, precise */ 139 - #define CACR_DDCM_IMP 0x06000000 /* No cache, imprecise */ 140 - #define CACR_DCINVA 0x01000000 /* Invalidate data cache */ 141 - #define CACR_BEC 0x00080000 /* Enable branch cache */ 142 - #define CACR_BCINVA 0x00040000 /* Invalidate branch cache */ 143 - #define CACR_IEC 0x00008000 /* Enable instruction cache */ 144 - #define CACR_DNFB 0x00002000 /* Inhibited fill buffer */ 145 - #define CACR_IDPI 0x00001000 /* Disable CPUSHL */ 146 - #define CACR_IHLCK 0x00000800 /* Intruction cache half lock */ 147 - #define CACR_IDCM 0x00000400 /* Intruction cache inhibit */ 148 - #define CACR_ICINVA 0x00000100 /* Invalidate instr cache */ 149 - 150 - #define ACR_BASE_POS 24 /* Address Base */ 151 - #define ACR_MASK_POS 16 /* Address Mask */ 152 - #define ACR_ENABLE 0x00008000 /* Enable address */ 153 - #define ACR_USER 0x00000000 /* User mode access only */ 154 - #define ACR_SUPER 0x00002000 /* Supervisor mode only */ 155 - #define ACR_ANY 0x00004000 /* Match any access mode */ 156 - #define ACR_CM_WT 0x00000000 /* Write through mode */ 157 - #define ACR_CM_CP 0x00000020 /* Copyback mode */ 158 - #define ACR_CM_OFF_PRE 0x00000040 /* No cache, precise */ 159 - #define ACR_CM_OFF_IMP 0x00000060 /* No cache, imprecise */ 160 - #define ACR_WPROTECT 0x00000004 /* Write protect */ 161 119 162 120 /****************************************************************************/ 163 121 #endif /* m5407sim_h */
+5 -5
arch/m68k/include/asm/m548xgpt.h arch/m68k/include/asm/m54xxgpt.h
··· 1 1 /* 2 - * File: m548xgpt.h 3 - * Purpose: Register and bit definitions for the MCF548X 2 + * File: m54xxgpt.h 3 + * Purpose: Register and bit definitions for the MCF54XX 4 4 * 5 5 * Notes: 6 6 * 7 7 */ 8 8 9 - #ifndef m548xgpt_h 10 - #define m548xgpt_h 9 + #ifndef m54xxgpt_h 10 + #define m54xxgpt_h 11 11 12 12 /********************************************************************* 13 13 * ··· 87 87 88 88 /********************************************************************/ 89 89 90 - #endif /* m548xgpt_h */ 90 + #endif /* m54xxgpt_h */
+18 -5
arch/m68k/include/asm/m548xsim.h arch/m68k/include/asm/m54xxsim.h
··· 1 1 /* 2 - * m548xsim.h -- ColdFire 547x/548x System Integration Unit support. 2 + * m54xxsim.h -- ColdFire 547x/548x System Integration Unit support. 3 3 */ 4 4 5 - #ifndef m548xsim_h 6 - #define m548xsim_h 5 + #ifndef m54xxsim_h 6 + #define m54xxsim_h 7 7 8 - #define MCFINT_VECBASE 64 8 + #define CPU_NAME "COLDFIRE(m54xx)" 9 + #define CPU_INSTR_PER_JIFFY 2 10 + 11 + #include <asm/m54xxacr.h> 12 + 13 + #define MCFINT_VECBASE 64 9 14 10 15 /* 11 16 * Interrupt Controller Registers ··· 25 20 #define MCFINTC_IRLR 0x18 /* */ 26 21 #define MCFINTC_IACKL 0x19 /* */ 27 22 #define MCFINTC_ICR0 0x40 /* Base ICR register */ 23 + 24 + /* 25 + * UART module. 26 + */ 27 + #define MCFUART_BASE1 0x8600 /* Base address of UART1 */ 28 + #define MCFUART_BASE2 0x8700 /* Base address of UART2 */ 29 + #define MCFUART_BASE3 0x8800 /* Base address of UART3 */ 30 + #define MCFUART_BASE4 0x8900 /* Base address of UART4 */ 28 31 29 32 /* 30 33 * Define system peripheral IRQ usage. ··· 65 52 #define MCF_PAR_PSC_RTS_RTS (0x30) 66 53 #define MCF_PAR_PSC_CANRX (0x40) 67 54 68 - #endif /* m548xsim_h */ 55 + #endif /* m54xxsim_h */
+97
arch/m68k/include/asm/m54xxacr.h
··· 1 + /* 2 + * Bit definitions for the MCF54xx ACR and CACR registers. 3 + */ 4 + 5 + #ifndef m54xxacr_h 6 + #define m54xxacr_h 7 + 8 + /* 9 + * Define the Cache register flags. 10 + */ 11 + #define CACR_DEC 0x80000000 /* Enable data cache */ 12 + #define CACR_DWP 0x40000000 /* Data write protection */ 13 + #define CACR_DESB 0x20000000 /* Enable data store buffer */ 14 + #define CACR_DDPI 0x10000000 /* Disable invalidation by CPUSHL */ 15 + #define CACR_DHCLK 0x08000000 /* Half data cache lock mode */ 16 + #define CACR_DDCM_WT 0x00000000 /* Write through cache*/ 17 + #define CACR_DDCM_CP 0x02000000 /* Copyback cache */ 18 + #define CACR_DDCM_P 0x04000000 /* No cache, precise */ 19 + #define CACR_DDCM_IMP 0x06000000 /* No cache, imprecise */ 20 + #define CACR_DCINVA 0x01000000 /* Invalidate data cache */ 21 + #define CACR_BEC 0x00080000 /* Enable branch cache */ 22 + #define CACR_BCINVA 0x00040000 /* Invalidate branch cache */ 23 + #define CACR_IEC 0x00008000 /* Enable instruction cache */ 24 + #define CACR_DNFB 0x00002000 /* Inhibited fill buffer */ 25 + #define CACR_IDPI 0x00001000 /* Disable CPUSHL */ 26 + #define CACR_IHLCK 0x00000800 /* Intruction cache half lock */ 27 + #define CACR_IDCM 0x00000400 /* Intruction cache inhibit */ 28 + #define CACR_ICINVA 0x00000100 /* Invalidate instr cache */ 29 + #define CACR_EUSP 0x00000020 /* Enable separate user a7 */ 30 + 31 + #define ACR_BASE_POS 24 /* Address Base */ 32 + #define ACR_MASK_POS 16 /* Address Mask */ 33 + #define ACR_ENABLE 0x00008000 /* Enable address */ 34 + #define ACR_USER 0x00000000 /* User mode access only */ 35 + #define ACR_SUPER 0x00002000 /* Supervisor mode only */ 36 + #define ACR_ANY 0x00004000 /* Match any access mode */ 37 + #define ACR_CM_WT 0x00000000 /* Write through mode */ 38 + #define ACR_CM_CP 0x00000020 /* Copyback mode */ 39 + #define ACR_CM_OFF_PRE 0x00000040 /* No cache, precise */ 40 + #define ACR_CM_OFF_IMP 0x00000060 /* No cache, imprecise */ 41 + #define ACR_CM 0x00000060 /* Cache mode mask */ 42 + #define ACR_WPROTECT 0x00000004 /* Write protect */ 43 + 44 + #if defined(CONFIG_M5407) 45 + 46 + #define ICACHE_SIZE 0x4000 /* instruction - 16k */ 47 + #define DCACHE_SIZE 0x2000 /* data - 8k */ 48 + 49 + #elif defined(CONFIG_M54xx) 50 + 51 + #define ICACHE_SIZE 0x8000 /* instruction - 32k */ 52 + #define DCACHE_SIZE 0x8000 /* data - 32k */ 53 + 54 + #endif 55 + 56 + #define CACHE_LINE_SIZE 0x0010 /* 16 bytes */ 57 + #define CACHE_WAYS 4 /* 4 ways */ 58 + 59 + /* 60 + * Version 4 cores have a true harvard style separate instruction 61 + * and data cache. Enable data and instruction caches, also enable write 62 + * buffers and branch accelerator. 63 + */ 64 + /* attention : enabling CACR_DESB requires a "nop" to flush the store buffer */ 65 + /* use '+' instead of '|' for assembler's sake */ 66 + 67 + /* Enable data cache */ 68 + /* Enable data store buffer */ 69 + /* outside ACRs : No cache, precise */ 70 + /* Enable instruction+branch caches */ 71 + #if defined(CONFIG_M5407) 72 + #define CACHE_MODE (CACR_DEC+CACR_DESB+CACR_DDCM_P+CACR_BEC+CACR_IEC) 73 + #else 74 + #define CACHE_MODE (CACR_DEC+CACR_DESB+CACR_DDCM_P+CACR_BEC+CACR_IEC+CACR_EUSP) 75 + #endif 76 + #if defined(CONFIG_CACHE_COPYBACK) 77 + #define DATA_CACHE_MODE (ACR_ENABLE+ACR_ANY+ACR_CM_CP) 78 + #else 79 + #define DATA_CACHE_MODE (ACR_ENABLE+ACR_ANY+ACR_CM_WT) 80 + #endif 81 + #define INSN_CACHE_MODE (ACR_ENABLE+ACR_ANY) 82 + 83 + #define CACHE_INIT (CACR_DCINVA+CACR_BCINVA+CACR_ICINVA) 84 + #define CACHE_INVALIDATE (CACHE_MODE+CACR_DCINVA+CACR_BCINVA+CACR_ICINVA) 85 + #define CACHE_INVALIDATEI (CACHE_MODE+CACR_BCINVA+CACR_ICINVA) 86 + #define CACHE_INVALIDATED (CACHE_MODE+CACR_DCINVA) 87 + #define ACR0_MODE (0x000f0000+DATA_CACHE_MODE) 88 + #define ACR1_MODE 0 89 + #define ACR2_MODE (0x000f0000+INSN_CACHE_MODE) 90 + #define ACR3_MODE 0 91 + 92 + #if ((DATA_CACHE_MODE & ACR_CM) == ACR_CM_CP) 93 + /* Copyback cache mode must push dirty cache lines first */ 94 + #define CACHE_PUSH 95 + #endif 96 + 97 + #endif /* m54xxacr_h */
-150
arch/m68k/include/asm/mcfcache.h
··· 1 - /****************************************************************************/ 2 - 3 - /* 4 - * mcfcache.h -- ColdFire CPU cache support code 5 - * 6 - * (C) Copyright 2004, Greg Ungerer <gerg@snapgear.com> 7 - */ 8 - 9 - /****************************************************************************/ 10 - #ifndef __M68KNOMMU_MCFCACHE_H 11 - #define __M68KNOMMU_MCFCACHE_H 12 - /****************************************************************************/ 13 - 14 - 15 - /* 16 - * The different ColdFire families have different cache arrangments. 17 - * Everything from a small instruction only cache, to configurable 18 - * data and/or instruction cache, to unified instruction/data, to 19 - * harvard style separate instruction and data caches. 20 - */ 21 - 22 - #if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || defined(CONFIG_M5272) 23 - /* 24 - * Simple version 2 core cache. These have instruction cache only, 25 - * we just need to invalidate it and enable it. 26 - */ 27 - .macro CACHE_ENABLE 28 - movel #0x01000000,%d0 /* invalidate cache cmd */ 29 - movec %d0,%CACR /* do invalidate cache */ 30 - movel #0x80000100,%d0 /* setup cache mask */ 31 - movec %d0,%CACR /* enable cache */ 32 - .endm 33 - #endif /* CONFIG_M5206 || CONFIG_M5206e || CONFIG_M5272 */ 34 - 35 - #if defined(CONFIG_M523x) || defined(CONFIG_M527x) 36 - /* 37 - * New version 2 cores have a configurable split cache arrangement. 38 - * For now I am just enabling instruction cache - but ultimately I 39 - * think a split instruction/data cache would be better. 40 - */ 41 - .macro CACHE_ENABLE 42 - movel #0x01400000,%d0 43 - movec %d0,%CACR /* invalidate cache */ 44 - nop 45 - movel #0x0000c000,%d0 /* set SDRAM cached only */ 46 - movec %d0,%ACR0 47 - movel #0x00000000,%d0 /* no other regions cached */ 48 - movec %d0,%ACR1 49 - movel #0x80400100,%d0 /* configure cache */ 50 - movec %d0,%CACR /* enable cache */ 51 - nop 52 - .endm 53 - #endif /* CONFIG_M523x || CONFIG_M527x */ 54 - 55 - #if defined(CONFIG_M528x) 56 - .macro CACHE_ENABLE 57 - nop 58 - movel #0x01000000, %d0 59 - movec %d0, %CACR /* Invalidate cache */ 60 - nop 61 - movel #0x0000c020, %d0 /* Set SDRAM cached only */ 62 - movec %d0, %ACR0 63 - movel #0x00000000, %d0 /* No other regions cached */ 64 - movec %d0, %ACR1 65 - movel #0x80000200, %d0 /* Setup cache mask */ 66 - movec %d0, %CACR /* Enable cache */ 67 - nop 68 - .endm 69 - #endif /* CONFIG_M528x */ 70 - 71 - #if defined(CONFIG_M5249) || defined(CONFIG_M5307) 72 - /* 73 - * The version 3 core cache. Oddly enough the version 2 core 5249 74 - * has the same SDRAM and cache setup as the version 3 cores. 75 - * This is a single unified instruction/data cache. 76 - */ 77 - .macro CACHE_ENABLE 78 - movel #0x01000000,%d0 /* invalidate whole cache */ 79 - movec %d0,%CACR 80 - nop 81 - #if defined(DEBUGGER_COMPATIBLE_CACHE) || defined(CONFIG_SECUREEDGEMP3) 82 - movel #0x0000c000,%d0 /* set SDRAM cached (write-thru) */ 83 - #else 84 - movel #0x0000c020,%d0 /* set SDRAM cached (copyback) */ 85 - #endif 86 - movec %d0,%ACR0 87 - movel #0x00000000,%d0 /* no other regions cached */ 88 - movec %d0,%ACR1 89 - movel #0xa0000200,%d0 /* enable cache */ 90 - movec %d0,%CACR 91 - nop 92 - .endm 93 - #endif /* CONFIG_M5249 || CONFIG_M5307 */ 94 - 95 - #if defined(CONFIG_M532x) 96 - .macro CACHE_ENABLE 97 - movel #0x01000000,%d0 /* invalidate cache cmd */ 98 - movec %d0,%CACR /* do invalidate cache */ 99 - nop 100 - movel #0x4001C000,%d0 /* set SDRAM cached (write-thru) */ 101 - movec %d0,%ACR0 102 - movel #0x00000000,%d0 /* no other regions cached */ 103 - movec %d0,%ACR1 104 - movel #0x80000200,%d0 /* setup cache mask */ 105 - movec %d0,%CACR /* enable cache */ 106 - nop 107 - .endm 108 - #endif /* CONFIG_M532x */ 109 - 110 - #if defined(CONFIG_M5407) || defined(CONFIG_M548x) 111 - /* 112 - * Version 4 cores have a true harvard style separate instruction 113 - * and data cache. Invalidate and enable cache, also enable write 114 - * buffers and branch accelerator. 115 - */ 116 - .macro CACHE_ENABLE 117 - movel #0x01040100,%d0 /* invalidate whole cache */ 118 - movec %d0,%CACR 119 - nop 120 - movel #0x000fc000,%d0 /* set SDRAM cached only */ 121 - movec %d0, %ACR0 122 - movel #0x00000000,%d0 /* no other regions cached */ 123 - movec %d0, %ACR1 124 - movel #0x000fc000,%d0 /* set SDRAM cached only */ 125 - movec %d0, %ACR2 126 - movel #0x00000000,%d0 /* no other regions cached */ 127 - movec %d0, %ACR3 128 - movel #0xb6088400,%d0 /* enable caches */ 129 - movec %d0,%CACR 130 - nop 131 - .endm 132 - #endif /* CONFIG_M5407 */ 133 - 134 - #if defined(CONFIG_M520x) 135 - .macro CACHE_ENABLE 136 - move.l #0x01000000,%d0 /* invalidate whole cache */ 137 - movec %d0,%CACR 138 - nop 139 - move.l #0x0000c000,%d0 /* set SDRAM cached (write-thru) */ 140 - movec %d0,%ACR0 141 - move.l #0x00000000,%d0 /* no other regions cached */ 142 - movec %d0,%ACR1 143 - move.l #0x80400000,%d0 /* enable 8K instruction cache */ 144 - movec %d0,%CACR 145 - nop 146 - .endm 147 - #endif /* CONFIG_M520x */ 148 - 149 - /****************************************************************************/ 150 - #endif /* __M68KNOMMU_MCFCACHE_H */
+2 -2
arch/m68k/include/asm/mcfsim.h
··· 41 41 #elif defined(CONFIG_M5407) 42 42 #include <asm/m5407sim.h> 43 43 #include <asm/mcfintc.h> 44 - #elif defined(CONFIG_M548x) 45 - #include <asm/m548xsim.h> 44 + #elif defined(CONFIG_M54xx) 45 + #include <asm/m54xxsim.h> 46 46 #endif 47 47 48 48 /****************************************************************************/
+1 -44
arch/m68k/include/asm/mcfuart.h
··· 12 12 #define mcfuart_h 13 13 /****************************************************************************/ 14 14 15 - /* 16 - * Define the base address of the UARTS within the MBAR address 17 - * space. 18 - */ 19 - #if defined(CONFIG_M5272) 20 - #define MCFUART_BASE1 0x100 /* Base address of UART1 */ 21 - #define MCFUART_BASE2 0x140 /* Base address of UART2 */ 22 - #elif defined(CONFIG_M5206) || defined(CONFIG_M5206e) 23 - #if defined(CONFIG_NETtel) 24 - #define MCFUART_BASE1 0x180 /* Base address of UART1 */ 25 - #define MCFUART_BASE2 0x140 /* Base address of UART2 */ 26 - #else 27 - #define MCFUART_BASE1 0x140 /* Base address of UART1 */ 28 - #define MCFUART_BASE2 0x180 /* Base address of UART2 */ 29 - #endif 30 - #elif defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) 31 - #define MCFUART_BASE1 0x200 /* Base address of UART1 */ 32 - #define MCFUART_BASE2 0x240 /* Base address of UART2 */ 33 - #define MCFUART_BASE3 0x280 /* Base address of UART3 */ 34 - #elif defined(CONFIG_M5249) || defined(CONFIG_M5307) || defined(CONFIG_M5407) 35 - #if defined(CONFIG_NETtel) || defined(CONFIG_SECUREEDGEMP3) 36 - #define MCFUART_BASE1 0x200 /* Base address of UART1 */ 37 - #define MCFUART_BASE2 0x1c0 /* Base address of UART2 */ 38 - #else 39 - #define MCFUART_BASE1 0x1c0 /* Base address of UART1 */ 40 - #define MCFUART_BASE2 0x200 /* Base address of UART2 */ 41 - #endif 42 - #elif defined(CONFIG_M520x) 43 - #define MCFUART_BASE1 0x60000 /* Base address of UART1 */ 44 - #define MCFUART_BASE2 0x64000 /* Base address of UART2 */ 45 - #define MCFUART_BASE3 0x68000 /* Base address of UART2 */ 46 - #elif defined(CONFIG_M532x) 47 - #define MCFUART_BASE1 0xfc060000 /* Base address of UART1 */ 48 - #define MCFUART_BASE2 0xfc064000 /* Base address of UART2 */ 49 - #define MCFUART_BASE3 0xfc068000 /* Base address of UART3 */ 50 - #elif defined(CONFIG_M548x) 51 - #define MCFUART_BASE1 0x8600 /* on M548x */ 52 - #define MCFUART_BASE2 0x8700 /* on M548x */ 53 - #define MCFUART_BASE3 0x8800 /* on M548x */ 54 - #define MCFUART_BASE4 0x8900 /* on M548x */ 55 - #endif 56 - 57 - 58 15 #include <linux/serial_core.h> 59 16 #include <linux/platform_device.h> 60 17 ··· 174 217 #define MCFUART_URF_RXS 0xc0 /* Receiver status */ 175 218 #endif 176 219 177 - #if defined(CONFIG_M548x) 220 + #if defined(CONFIG_M54xx) 178 221 #define MCFUART_TXFIFOSIZE 512 179 222 #elif defined(CONFIG_M5272) 180 223 #define MCFUART_TXFIFOSIZE 25
+8 -5
arch/m68k/include/asm/processor.h
··· 20 20 21 21 static inline unsigned long rdusp(void) 22 22 { 23 - #ifdef CONFIG_COLDFIRE 23 + #ifdef CONFIG_COLDFIRE_SW_A7 24 24 extern unsigned int sw_usp; 25 25 return sw_usp; 26 26 #else 27 - unsigned long usp; 28 - __asm__ __volatile__("move %/usp,%0" : "=a" (usp)); 27 + register unsigned long usp __asm__("a0"); 28 + /* move %usp,%a0 */ 29 + __asm__ __volatile__(".word 0x4e68" : "=a" (usp)); 29 30 return usp; 30 31 #endif 31 32 } 32 33 33 34 static inline void wrusp(unsigned long usp) 34 35 { 35 - #ifdef CONFIG_COLDFIRE 36 + #ifdef CONFIG_COLDFIRE_SW_A7 36 37 extern unsigned int sw_usp; 37 38 sw_usp = usp; 38 39 #else 39 - __asm__ __volatile__("move %0,%/usp" : : "a" (usp)); 40 + register unsigned long a0 __asm__("a0") = usp; 41 + /* move %a0,%usp */ 42 + __asm__ __volatile__(".word 0x4e60" : : "a" (a0) ); 40 43 #endif 41 44 } 42 45
+87 -11
arch/m68knommu/Kconfig
··· 75 75 config NO_IOPORT 76 76 def_bool y 77 77 78 + config COLDFIRE_SW_A7 79 + bool 80 + default n 81 + 82 + config HAVE_CACHE_SPLIT 83 + bool 84 + 85 + config HAVE_CACHE_CB 86 + bool 87 + 78 88 source "init/Kconfig" 79 89 80 90 source "kernel/Kconfig.freezer" ··· 117 107 118 108 config M5206 119 109 bool "MCF5206" 110 + select COLDFIRE_SW_A7 120 111 help 121 112 Motorola ColdFire 5206 processor support. 122 113 123 114 config M5206e 124 115 bool "MCF5206e" 116 + select COLDFIRE_SW_A7 125 117 help 126 118 Motorola ColdFire 5206e processor support. 127 119 128 120 config M520x 129 121 bool "MCF520x" 130 122 select GENERIC_CLOCKEVENTS 123 + select HAVE_CACHE_SPLIT 131 124 help 132 125 Freescale Coldfire 5207/5208 processor support. 133 126 134 127 config M523x 135 128 bool "MCF523x" 136 129 select GENERIC_CLOCKEVENTS 130 + select HAVE_CACHE_SPLIT 137 131 help 138 132 Freescale Coldfire 5230/1/2/4/5 processor support 139 133 140 134 config M5249 141 135 bool "MCF5249" 136 + select COLDFIRE_SW_A7 142 137 help 143 138 Motorola ColdFire 5249 processor support. 144 139 145 140 config M5271 146 141 bool "MCF5271" 142 + select HAVE_CACHE_SPLIT 147 143 help 148 144 Freescale (Motorola) ColdFire 5270/5271 processor support. 149 145 150 146 config M5272 151 147 bool "MCF5272" 148 + select COLDFIRE_SW_A7 152 149 help 153 150 Motorola ColdFire 5272 processor support. 154 151 155 152 config M5275 156 153 bool "MCF5275" 154 + select HAVE_CACHE_SPLIT 157 155 help 158 156 Freescale (Motorola) ColdFire 5274/5275 processor support. 159 157 160 158 config M528x 161 159 bool "MCF528x" 162 160 select GENERIC_CLOCKEVENTS 161 + select HAVE_CACHE_SPLIT 163 162 help 164 163 Motorola ColdFire 5280/5282 processor support. 165 164 166 165 config M5307 167 166 bool "MCF5307" 167 + select COLDFIRE_SW_A7 168 + select HAVE_CACHE_CB 168 169 help 169 170 Motorola ColdFire 5307 processor support. 170 171 171 172 config M532x 172 173 bool "MCF532x" 174 + select HAVE_CACHE_CB 173 175 help 174 176 Freescale (Motorola) ColdFire 532x processor support. 175 177 176 178 config M5407 177 179 bool "MCF5407" 180 + select COLDFIRE_SW_A7 181 + select HAVE_CACHE_CB 178 182 help 179 183 Motorola ColdFire 5407 processor support. 180 184 185 + config M547x 186 + bool "MCF547x" 187 + select HAVE_CACHE_CB 188 + help 189 + Freescale ColdFire 5470/5471/5472/5473/5474/5475 processor support. 190 + 181 191 config M548x 182 192 bool "MCF548x" 193 + select HAVE_CACHE_CB 183 194 help 184 195 Freescale ColdFire 5480/5481/5482/5483/5484/5485 processor support. 185 196 ··· 212 181 select GENERIC_CLOCKEVENTS 213 182 default y 214 183 184 + config M54xx 185 + bool 186 + depends on (M548x || M547x) 187 + default y 188 + 215 189 config COLDFIRE 216 190 bool 217 - depends on (M5206 || M5206e || M520x || M523x || M5249 || M527x || M5272 || M528x || M5307 || M532x || M5407 || M548x) 191 + depends on (M5206 || M5206e || M520x || M523x || M5249 || M527x || M5272 || M528x || M5307 || M532x || M5407 || M54xx) 218 192 select GENERIC_GPIO 219 193 select ARCH_REQUIRE_GPIOLIB 220 194 default y ··· 266 230 Build support for the older revision ColdFire 5307 silicon. 267 231 Specifically this is the 1H55J mask revision. 268 232 233 + if HAVE_CACHE_SPLIT 234 + choice 235 + prompt "Split Cache Configuration" 236 + default CACHE_I 237 + 238 + config CACHE_I 239 + bool "Instruction" 240 + help 241 + Use all of the ColdFire CPU cache memory as an instruction cache. 242 + 243 + config CACHE_D 244 + bool "Data" 245 + help 246 + Use all of the ColdFire CPU cache memory as a data cache. 247 + 248 + config CACHE_BOTH 249 + bool "Both" 250 + help 251 + Split the ColdFire CPU cache, and use half as an instruction cache 252 + and half as a data cache. 253 + endchoice 254 + endif 255 + 256 + if HAVE_CACHE_CB 257 + choice 258 + prompt "Data cache mode" 259 + default CACHE_WRITETHRU 260 + 261 + config CACHE_WRITETHRU 262 + bool "Write-through" 263 + help 264 + The ColdFire CPU cache is set into Write-through mode. 265 + 266 + config CACHE_COPYBACK 267 + bool "Copy-back" 268 + help 269 + The ColdFire CPU cache is set into Copy-back mode. 270 + endchoice 271 + endif 272 + 269 273 comment "Platform" 270 274 271 275 config PILOT3 ··· 321 245 Support the bugs of Xcopilot. 322 246 323 247 config UC5272 324 - bool 'Arcturus Networks uC5272 dimm board support' 325 - depends on M5272 326 - help 327 - Support for the Arcturus Networks uC5272 dimm board. 248 + bool 'Arcturus Networks uC5272 dimm board support' 249 + depends on M5272 250 + help 251 + Support for the Arcturus Networks uC5272 dimm board. 328 252 329 253 config UC5282 330 - bool "Arcturus Networks uC5282 board support" 331 - depends on M528x 332 - help 333 - Support for the Arcturus Networks uC5282 dimm board. 254 + bool "Arcturus Networks uC5282 board support" 255 + depends on M528x 256 + help 257 + Support for the Arcturus Networks uC5282 dimm board. 334 258 335 259 config UCSIMM 336 260 bool "uCsimm module support" ··· 355 279 depends on (UCSIMM || UCDIMM || DRAGEN2) 356 280 help 357 281 Disable the CPU internal registers protection in user mode, 358 - to allow a user application to read/write them. 282 + to allow a user application to read/write them. 359 283 360 284 config INIT_LCD 361 285 bool "Initialize LCD" ··· 593 517 depends on (SOM5282EM) 594 518 595 519 config SNEHA 596 - bool 520 + bool 597 521 default y 598 522 depends on CPU16B 599 523
+7 -7
arch/m68knommu/Makefile
··· 25 25 platform-$(CONFIG_M5307) := 5307 26 26 platform-$(CONFIG_M532x) := 532x 27 27 platform-$(CONFIG_M5407) := 5407 28 - platform-$(CONFIG_M548x) := 548x 28 + platform-$(CONFIG_M54xx) := 54xx 29 29 PLATFORM := $(platform-y) 30 30 31 31 board-$(CONFIG_PILOT) := pilot ··· 74 74 cpuclass-$(CONFIG_M5307) := coldfire 75 75 cpuclass-$(CONFIG_M532x) := coldfire 76 76 cpuclass-$(CONFIG_M5407) := coldfire 77 - cpuclass-$(CONFIG_M548x) := coldfire 77 + cpuclass-$(CONFIG_M54xx) := coldfire 78 78 cpuclass-$(CONFIG_M68328) := 68328 79 79 cpuclass-$(CONFIG_M68EZ328) := 68328 80 80 cpuclass-$(CONFIG_M68VZ328) := 68328 ··· 91 91 # Some CFLAG additions based on specific CPU type. 92 92 # 93 93 cflags-$(CONFIG_M5206) := $(call cc-option,-mcpu=5206,-m5200) 94 - cflags-$(CONFIG_M5206e) := $(call cc-option,-m5206e,-m5200) 94 + cflags-$(CONFIG_M5206e) := $(call cc-option,-mcpu=5206e,-m5200) 95 95 cflags-$(CONFIG_M520x) := $(call cc-option,-mcpu=5208,-m5200) 96 96 cflags-$(CONFIG_M523x) := $(call cc-option,-mcpu=523x,-m5307) 97 97 cflags-$(CONFIG_M5249) := $(call cc-option,-mcpu=5249,-m5200) 98 98 cflags-$(CONFIG_M5271) := $(call cc-option,-mcpu=5271,-m5307) 99 99 cflags-$(CONFIG_M5272) := $(call cc-option,-mcpu=5272,-m5307) 100 100 cflags-$(CONFIG_M5275) := $(call cc-option,-mcpu=5275,-m5307) 101 - cflags-$(CONFIG_M528x) := $(call cc-option,-m528x,-m5307) 102 - cflags-$(CONFIG_M5307) := $(call cc-option,-m5307,-m5200) 101 + cflags-$(CONFIG_M528x) := $(call cc-option,-mcpu=528x,-m5307) 102 + cflags-$(CONFIG_M5307) := $(call cc-option,-mcpu=5307,-m5200) 103 103 cflags-$(CONFIG_M532x) := $(call cc-option,-mcpu=532x,-m5307) 104 - cflags-$(CONFIG_M5407) := $(call cc-option,-m5407,-m5200) 105 - cflags-$(CONFIG_M548x) := $(call cc-option,-m5407,-m5200) 104 + cflags-$(CONFIG_M5407) := $(call cc-option,-mcpu=5407,-m5200) 105 + cflags-$(CONFIG_M54xx) := $(call cc-option,-mcpu=5475,-m5200) 106 106 cflags-$(CONFIG_M68328) := -m68000 107 107 cflags-$(CONFIG_M68EZ328) := -m68000 108 108 cflags-$(CONFIG_M68VZ328) := -m68000
+18 -54
arch/m68knommu/kernel/setup.c
··· 55 55 void (*mach_power_off)(void); 56 56 57 57 #ifdef CONFIG_M68328 58 - #define CPU "MC68328" 58 + #define CPU_NAME "MC68328" 59 59 #endif 60 60 #ifdef CONFIG_M68EZ328 61 - #define CPU "MC68EZ328" 61 + #define CPU_NAME "MC68EZ328" 62 62 #endif 63 63 #ifdef CONFIG_M68VZ328 64 - #define CPU "MC68VZ328" 64 + #define CPU_NAME "MC68VZ328" 65 65 #endif 66 66 #ifdef CONFIG_M68360 67 - #define CPU "MC68360" 67 + #define CPU_NAME "MC68360" 68 68 #endif 69 - #if defined(CONFIG_M5206) 70 - #define CPU "COLDFIRE(m5206)" 69 + #ifndef CPU_NAME 70 + #define CPU_NAME "UNKNOWN" 71 71 #endif 72 - #if defined(CONFIG_M5206e) 73 - #define CPU "COLDFIRE(m5206e)" 74 - #endif 75 - #if defined(CONFIG_M520x) 76 - #define CPU "COLDFIRE(m520x)" 77 - #endif 78 - #if defined(CONFIG_M523x) 79 - #define CPU "COLDFIRE(m523x)" 80 - #endif 81 - #if defined(CONFIG_M5249) 82 - #define CPU "COLDFIRE(m5249)" 83 - #endif 84 - #if defined(CONFIG_M5271) 85 - #define CPU "COLDFIRE(m5270/5271)" 86 - #endif 87 - #if defined(CONFIG_M5272) 88 - #define CPU "COLDFIRE(m5272)" 89 - #endif 90 - #if defined(CONFIG_M5275) 91 - #define CPU "COLDFIRE(m5274/5275)" 92 - #endif 93 - #if defined(CONFIG_M528x) 94 - #define CPU "COLDFIRE(m5280/5282)" 95 - #endif 96 - #if defined(CONFIG_M5307) 97 - #define CPU "COLDFIRE(m5307)" 98 - #endif 99 - #if defined(CONFIG_M532x) 100 - #define CPU "COLDFIRE(m532x)" 101 - #endif 102 - #if defined(CONFIG_M5407) 103 - #define CPU "COLDFIRE(m5407)" 104 - #endif 105 - #ifndef CPU 106 - #define CPU "UNKNOWN" 72 + 73 + /* 74 + * Different cores have different instruction execution timings. 75 + * The old/traditional 68000 cores are basically all the same, at 16. 76 + * The ColdFire cores vary a little, their values are defined in their 77 + * headers. We default to the standard 68000 value here. 78 + */ 79 + #ifndef CPU_INSTR_PER_JIFFY 80 + #define CPU_INSTR_PER_JIFFY 16 107 81 #endif 108 82 109 83 extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end; ··· 182 208 command_line[sizeof(command_line) - 1] = 0; 183 209 #endif /* CONFIG_UBOOT */ 184 210 185 - printk(KERN_INFO "\x0F\r\n\nuClinux/" CPU "\n"); 211 + printk(KERN_INFO "\x0F\r\n\nuClinux/" CPU_NAME "\n"); 186 212 187 213 #ifdef CONFIG_UCDIMM 188 214 printk(KERN_INFO "uCdimm by Lineo, Inc. <www.lineo.com>\n"); ··· 231 257 memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); 232 258 boot_command_line[COMMAND_LINE_SIZE-1] = 0; 233 259 234 - #ifdef DEBUG 235 - if (strlen(*cmdline_p)) 236 - printk(KERN_DEBUG "Command line: '%s'\n", *cmdline_p); 237 - #endif 238 - 239 260 #if defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_DUMMY_CONSOLE) 240 261 conswitchp = &dummy_con; 241 262 #endif ··· 272 303 char *cpu, *mmu, *fpu; 273 304 u_long clockfreq; 274 305 275 - cpu = CPU; 306 + cpu = CPU_NAME; 276 307 mmu = "none"; 277 308 fpu = "none"; 278 - 279 - #ifdef CONFIG_COLDFIRE 280 - clockfreq = (loops_per_jiffy * HZ) * 3; 281 - #else 282 - clockfreq = (loops_per_jiffy * HZ) * 16; 283 - #endif 309 + clockfreq = (loops_per_jiffy * HZ) * CPU_INSTR_PER_JIFFY; 284 310 285 311 seq_printf(m, "CPU:\t\t%s\n" 286 312 "MMU:\t\t%s\n"
+1 -1
arch/m68knommu/mm/Makefile
··· 2 2 # Makefile for the linux m68knommu specific parts of the memory manager. 3 3 # 4 4 5 - obj-y += init.o fault.o memory.o kmap.o 5 + obj-y += init.o kmap.o
-57
arch/m68knommu/mm/fault.c
··· 1 - /* 2 - * linux/arch/m68knommu/mm/fault.c 3 - * 4 - * Copyright (C) 1998 D. Jeff Dionne <jeff@lineo.ca>, 5 - * Copyright (C) 2000 Lineo, Inc. (www.lineo.com) 6 - * 7 - * Based on: 8 - * 9 - * linux/arch/m68k/mm/fault.c 10 - * 11 - * Copyright (C) 1995 Hamish Macdonald 12 - */ 13 - 14 - #include <linux/mman.h> 15 - #include <linux/mm.h> 16 - #include <linux/kernel.h> 17 - #include <linux/ptrace.h> 18 - 19 - #include <asm/system.h> 20 - #include <asm/pgtable.h> 21 - 22 - extern void die_if_kernel(char *, struct pt_regs *, long); 23 - 24 - /* 25 - * This routine handles page faults. It determines the problem, and 26 - * then passes it off to one of the appropriate routines. 27 - * 28 - * error_code: 29 - * bit 0 == 0 means no page found, 1 means protection fault 30 - * bit 1 == 0 means read, 1 means write 31 - * 32 - * If this routine detects a bad access, it returns 1, otherwise it 33 - * returns 0. 34 - */ 35 - asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address, 36 - unsigned long error_code) 37 - { 38 - #ifdef DEBUG 39 - printk(KERN_DEBUG "regs->sr=%#x, regs->pc=%#lx, address=%#lx, %ld\n", 40 - regs->sr, regs->pc, address, error_code); 41 - #endif 42 - 43 - /* 44 - * Oops. The kernel tried to access some bad page. We'll have to 45 - * terminate things with extreme prejudice. 46 - */ 47 - if ((unsigned long) address < PAGE_SIZE) 48 - printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference"); 49 - else 50 - printk(KERN_ALERT "Unable to handle kernel access"); 51 - printk(KERN_ALERT " at virtual address %08lx\n", address); 52 - die_if_kernel("Oops", regs, error_code); 53 - do_exit(SIGKILL); 54 - 55 - return 1; 56 - } 57 -
-9
arch/m68knommu/mm/kmap.c
··· 36 36 } 37 37 38 38 /* 39 - * __iounmap unmaps nearly everything, so be careful 40 - * it doesn't free currently pointer/page tables anymore but it 41 - * wans't used anyway and might be added later. 42 - */ 43 - void __iounmap(void *addr, unsigned long size) 44 - { 45 - } 46 - 47 - /* 48 39 * Set new cache mode for some kernel address space. 49 40 * The caller must push data for that range itself, if such data may already 50 41 * be in the cache.
-33
arch/m68knommu/mm/memory.c
··· 1 - /* 2 - * linux/arch/m68knommu/mm/memory.c 3 - * 4 - * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>, 5 - * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com) 6 - * 7 - * Based on: 8 - * 9 - * linux/arch/m68k/mm/memory.c 10 - * 11 - * Copyright (C) 1995 Hamish Macdonald 12 - */ 13 - 14 - #include <linux/mm.h> 15 - #include <linux/kernel.h> 16 - #include <linux/string.h> 17 - #include <linux/types.h> 18 - 19 - #include <asm/segment.h> 20 - #include <asm/page.h> 21 - #include <asm/pgtable.h> 22 - #include <asm/system.h> 23 - 24 - /* 25 - * Map some physical address range into the kernel address space. 26 - */ 27 - 28 - unsigned long kernel_map(unsigned long paddr, unsigned long size, 29 - int nocacheflag, unsigned long *memavailp ) 30 - { 31 - return paddr; 32 - } 33 -
arch/m68knommu/platform/548x/Makefile arch/m68knommu/platform/54xx/Makefile
+16 -16
arch/m68knommu/platform/548x/config.c arch/m68knommu/platform/54xx/config.c
··· 1 1 /***************************************************************************/ 2 2 3 3 /* 4 - * linux/arch/m68knommu/platform/548x/config.c 4 + * linux/arch/m68knommu/platform/54xx/config.c 5 5 * 6 6 * Copyright (C) 2010, Philippe De Muyter <phdm@macqel.be> 7 7 */ ··· 15 15 #include <linux/io.h> 16 16 #include <asm/machdep.h> 17 17 #include <asm/coldfire.h> 18 - #include <asm/m548xsim.h> 18 + #include <asm/m54xxsim.h> 19 19 #include <asm/mcfuart.h> 20 - #include <asm/m548xgpt.h> 20 + #include <asm/m54xxgpt.h> 21 21 22 22 /***************************************************************************/ 23 23 24 - static struct mcf_platform_uart m548x_uart_platform[] = { 24 + static struct mcf_platform_uart m54xx_uart_platform[] = { 25 25 { 26 26 .mapbase = MCF_MBAR + MCFUART_BASE1, 27 27 .irq = 64 + 35, ··· 40 40 }, 41 41 }; 42 42 43 - static struct platform_device m548x_uart = { 43 + static struct platform_device m54xx_uart = { 44 44 .name = "mcfuart", 45 45 .id = 0, 46 - .dev.platform_data = m548x_uart_platform, 46 + .dev.platform_data = m54xx_uart_platform, 47 47 }; 48 48 49 - static struct platform_device *m548x_devices[] __initdata = { 50 - &m548x_uart, 49 + static struct platform_device *m54xx_devices[] __initdata = { 50 + &m54xx_uart, 51 51 }; 52 52 53 53 54 54 /***************************************************************************/ 55 55 56 - static void __init m548x_uart_init_line(int line, int irq) 56 + static void __init m54xx_uart_init_line(int line, int irq) 57 57 { 58 58 int rts_cts; 59 59 ··· 72 72 MCF_MBAR + MCF_PAR_PSC(line)); 73 73 } 74 74 75 - static void __init m548x_uarts_init(void) 75 + static void __init m54xx_uarts_init(void) 76 76 { 77 - const int nrlines = ARRAY_SIZE(m548x_uart_platform); 77 + const int nrlines = ARRAY_SIZE(m54xx_uart_platform); 78 78 int line; 79 79 80 80 for (line = 0; (line < nrlines); line++) 81 - m548x_uart_init_line(line, m548x_uart_platform[line].irq); 81 + m54xx_uart_init_line(line, m54xx_uart_platform[line].irq); 82 82 } 83 83 84 84 /***************************************************************************/ 85 85 86 - static void mcf548x_reset(void) 86 + static void mcf54xx_reset(void) 87 87 { 88 88 /* disable interrupts and enable the watchdog */ 89 89 asm("movew #0x2700, %sr\n"); ··· 97 97 98 98 void __init config_BSP(char *commandp, int size) 99 99 { 100 - mach_reset = mcf548x_reset; 101 - m548x_uarts_init(); 100 + mach_reset = mcf54xx_reset; 101 + m54xx_uarts_init(); 102 102 } 103 103 104 104 /***************************************************************************/ ··· 106 106 static int __init init_BSP(void) 107 107 { 108 108 109 - platform_add_devices(m548x_devices, ARRAY_SIZE(m548x_devices)); 109 + platform_add_devices(m54xx_devices, ARRAY_SIZE(m54xx_devices)); 110 110 return 0; 111 111 } 112 112
+2 -2
arch/m68knommu/platform/68328/ints.c
··· 179 179 IMR = ~0; 180 180 181 181 for (i = 0; (i < NR_IRQS); i++) { 182 - set_irq_chip(irq, &intc_irq_chip); 183 - set_irq_handler(irq, handle_level_irq); 182 + set_irq_chip(i, &intc_irq_chip); 183 + set_irq_handler(i, handle_level_irq); 184 184 } 185 185 } 186 186
+2 -2
arch/m68knommu/platform/coldfire/Makefile
··· 14 14 15 15 asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 16 16 17 - obj-$(CONFIG_COLDFIRE) += clk.o dma.o entry.o vectors.o 17 + obj-$(CONFIG_COLDFIRE) += cache.o clk.o dma.o entry.o vectors.o 18 18 obj-$(CONFIG_M5206) += timers.o intc.o 19 19 obj-$(CONFIG_M5206e) += timers.o intc.o 20 20 obj-$(CONFIG_M520x) += pit.o intc-simr.o ··· 26 26 obj-$(CONFIG_M5307) += timers.o intc.o 27 27 obj-$(CONFIG_M532x) += timers.o intc-simr.o 28 28 obj-$(CONFIG_M5407) += timers.o intc.o 29 - obj-$(CONFIG_M548x) += sltimers.o intc-2.o 29 + obj-$(CONFIG_M54xx) += sltimers.o intc-2.o 30 30 31 31 obj-y += pinmux.o gpio.o 32 32 extra-y := head.o
+48
arch/m68knommu/platform/coldfire/cache.c
··· 1 + /***************************************************************************/ 2 + 3 + /* 4 + * cache.c -- general ColdFire Cache maintainence code 5 + * 6 + * Copyright (C) 2010, Greg Ungerer (gerg@snapgear.com) 7 + */ 8 + 9 + /***************************************************************************/ 10 + 11 + #include <linux/kernel.h> 12 + #include <asm/coldfire.h> 13 + #include <asm/mcfsim.h> 14 + 15 + /***************************************************************************/ 16 + #ifdef CACHE_PUSH 17 + /***************************************************************************/ 18 + 19 + /* 20 + * Use cpushl to push all dirty cache lines back to memory. 21 + * Older versions of GAS don't seem to know how to generate the 22 + * ColdFire cpushl instruction... Oh well, bit stuff it for now. 23 + */ 24 + 25 + void mcf_cache_push(void) 26 + { 27 + __asm__ __volatile__ ( 28 + "clrl %%d0\n\t" 29 + "1:\n\t" 30 + "movel %%d0,%%a0\n\t" 31 + "2:\n\t" 32 + ".word 0xf468\n\t" 33 + "addl %0,%%a0\n\t" 34 + "cmpl %1,%%a0\n\t" 35 + "blt 2b\n\t" 36 + "addql #1,%%d0\n\t" 37 + "cmpil %2,%%d0\n\t" 38 + "bne 1b\n\t" 39 + : /* No output */ 40 + : "i" (CACHE_LINE_SIZE), 41 + "i" (DCACHE_SIZE / CACHE_WAYS), 42 + "i" (CACHE_WAYS) 43 + : "d0", "a0" ); 44 + } 45 + 46 + /***************************************************************************/ 47 + #endif /* CACHE_PUSH */ 48 + /***************************************************************************/
+10 -46
arch/m68knommu/platform/coldfire/entry.S
··· 36 36 #include <asm/asm-offsets.h> 37 37 #include <asm/entry.h> 38 38 39 + #ifdef CONFIG_COLDFIRE_SW_A7 40 + /* 41 + * Define software copies of the supervisor and user stack pointers. 42 + */ 39 43 .bss 40 - 41 44 sw_ksp: 42 45 .long 0 43 - 44 46 sw_usp: 45 47 .long 0 48 + #endif /* CONFIG_COLDFIRE_SW_A7 */ 46 49 47 50 .text 48 51 ··· 54 51 .globl ret_from_exception 55 52 .globl ret_from_signal 56 53 .globl sys_call_table 57 - .globl ret_from_interrupt 58 54 .globl inthandler 59 55 .globl fasthandler 60 56 ··· 142 140 jne Lwork_to_do /* still work to do */ 143 141 144 142 Lreturn: 145 - move #0x2700,%sr /* disable intrs */ 146 - movel sw_usp,%a0 /* get usp */ 147 - movel %sp@(PT_OFF_PC),%a0@- /* copy exception program counter */ 148 - movel %sp@(PT_OFF_FORMATVEC),%a0@- /* copy exception format/vector/sr */ 149 - moveml %sp@,%d1-%d5/%a0-%a2 150 - lea %sp@(32),%sp /* space for 8 regs */ 151 - movel %sp@+,%d0 152 - addql #4,%sp /* orig d0 */ 153 - addl %sp@+,%sp /* stk adj */ 154 - addql #8,%sp /* remove exception */ 155 - movel %sp,sw_ksp /* save ksp */ 156 - subql #8,sw_usp /* set exception */ 157 - movel sw_usp,%sp /* restore usp */ 158 - rte 143 + RESTORE_USER 159 144 160 145 Lwork_to_do: 161 146 movel %a0@(TI_FLAGS),%d1 /* get thread_info->flags */ ··· 180 191 jbsr do_IRQ /* call high level irq handler */ 181 192 lea %sp@(8),%sp /* pop args off stack */ 182 193 183 - bra ret_from_interrupt /* this was fallthrough */ 184 - 185 - /* 186 - * This is the fast interrupt handler (for certain hardware interrupt 187 - * sources). Unlike the normal interrupt handler it just uses the 188 - * current stack (doesn't care if it is user or kernel). It also 189 - * doesn't bother doing the bottom half handlers. 190 - */ 191 - ENTRY(fasthandler) 192 - SAVE_LOCAL 193 - 194 - movew %sp@(PT_OFF_FORMATVEC),%d0 195 - andl #0x03fc,%d0 /* mask out vector only */ 196 - 197 - movel %sp,%sp@- /* push regs arg */ 198 - lsrl #2,%d0 /* calculate real vector # */ 199 - movel %d0,%sp@- /* push vector number */ 200 - jbsr do_IRQ /* call high level irq handler */ 201 - lea %sp@(8),%sp /* pop args off stack */ 202 - 203 - RESTORE_LOCAL 204 - 205 - ENTRY(ret_from_interrupt) 206 - /* the fasthandler is confusing me, haven't seen any user */ 207 - jmp ret_from_exception 194 + bra ret_from_exception 208 195 209 196 /* 210 197 * Beware - when entering resume, prev (the current task) is ··· 191 226 */ 192 227 ENTRY(resume) 193 228 movel %a0, %d1 /* get prev thread in d1 */ 194 - 195 - movel sw_usp,%d0 /* save usp */ 196 - movel %d0,%a0@(TASK_THREAD+THREAD_USP) 229 + RDUSP 230 + movel %a2,%a0@(TASK_THREAD+THREAD_USP) 197 231 198 232 SAVE_SWITCH_STACK 199 233 movel %sp,%a0@(TASK_THREAD+THREAD_KSP) /* save kernel stack pointer */ ··· 200 236 RESTORE_SWITCH_STACK 201 237 202 238 movel %a1@(TASK_THREAD+THREAD_USP),%a0 /* restore thread user stack */ 203 - movel %a0, sw_usp 239 + WRUSP 204 240 rts
+21 -5
arch/m68knommu/platform/coldfire/head.S
··· 3 3 /* 4 4 * head.S -- common startup code for ColdFire CPUs. 5 5 * 6 - * (C) Copyright 1999-2006, Greg Ungerer <gerg@snapgear.com>. 6 + * (C) Copyright 1999-2010, Greg Ungerer <gerg@snapgear.com>. 7 7 */ 8 8 9 9 /*****************************************************************************/ ··· 13 13 #include <linux/init.h> 14 14 #include <asm/asm-offsets.h> 15 15 #include <asm/coldfire.h> 16 - #include <asm/mcfcache.h> 17 16 #include <asm/mcfsim.h> 18 17 #include <asm/thread_info.h> 19 18 ··· 172 173 173 174 /* 174 175 * Now that we know what the memory is, lets enable cache 175 - * and get things moving. This is Coldfire CPU specific. 176 + * and get things moving. This is Coldfire CPU specific. Not 177 + * all version cores have identical cache register setup. But 178 + * it is very similar. Define the exact settings in the headers 179 + * then the code here is the same for all. 176 180 */ 177 - CACHE_ENABLE /* enable CPU cache */ 178 - 181 + movel #CACHE_INIT,%d0 /* invalidate whole cache */ 182 + movec %d0,%CACR 183 + nop 184 + movel #ACR0_MODE,%d0 /* set RAM region for caching */ 185 + movec %d0,%ACR0 186 + movel #ACR1_MODE,%d0 /* anything else to cache? */ 187 + movec %d0,%ACR1 188 + #ifdef ACR2_MODE 189 + movel #ACR2_MODE,%d0 190 + movec %d0,%ACR2 191 + movel #ACR3_MODE,%d0 192 + movec %d0,%ACR3 193 + #endif 194 + movel #CACHE_MODE,%d0 /* enable cache */ 195 + movec %d0,%CACR 196 + nop 179 197 180 198 #ifdef CONFIG_ROMFS_FS 181 199 /*