diff options
Diffstat (limited to 'include/asm-sh/cpu-sh4')
-rw-r--r-- | include/asm-sh/cpu-sh4/addrspace.h | 3 | ||||
-rw-r--r-- | include/asm-sh/cpu-sh4/cache.h | 2 | ||||
-rw-r--r-- | include/asm-sh/cpu-sh4/cacheflush.h | 36 | ||||
-rw-r--r-- | include/asm-sh/cpu-sh4/dma-sh7780.h | 39 | ||||
-rw-r--r-- | include/asm-sh/cpu-sh4/dma.h | 11 | ||||
-rw-r--r-- | include/asm-sh/cpu-sh4/shmparam.h | 19 | ||||
-rw-r--r-- | include/asm-sh/cpu-sh4/sq.h | 23 |
7 files changed, 69 insertions, 64 deletions
diff --git a/include/asm-sh/cpu-sh4/addrspace.h b/include/asm-sh/cpu-sh4/addrspace.h index 727634d886ce..bb2e1b03060c 100644 --- a/include/asm-sh/cpu-sh4/addrspace.h +++ b/include/asm-sh/cpu-sh4/addrspace.h | |||
@@ -22,5 +22,8 @@ | |||
22 | #define P4SEG_TLB_DATA 0xf7000000 | 22 | #define P4SEG_TLB_DATA 0xf7000000 |
23 | #define P4SEG_REG_BASE 0xff000000 | 23 | #define P4SEG_REG_BASE 0xff000000 |
24 | 24 | ||
25 | #define PA_AREA5_IO 0xb4000000 /* Area 5 IO Memory */ | ||
26 | #define PA_AREA6_IO 0xb8000000 /* Area 6 IO Memory */ | ||
27 | |||
25 | #endif /* __ASM_CPU_SH4_ADDRSPACE_H */ | 28 | #endif /* __ASM_CPU_SH4_ADDRSPACE_H */ |
26 | 29 | ||
diff --git a/include/asm-sh/cpu-sh4/cache.h b/include/asm-sh/cpu-sh4/cache.h index 1fe20359312c..6e9c7e6ee8e4 100644 --- a/include/asm-sh/cpu-sh4/cache.h +++ b/include/asm-sh/cpu-sh4/cache.h | |||
@@ -22,7 +22,9 @@ | |||
22 | #define CCR_CACHE_ICE 0x0100 /* Instruction Cache Enable */ | 22 | #define CCR_CACHE_ICE 0x0100 /* Instruction Cache Enable */ |
23 | #define CCR_CACHE_ICI 0x0800 /* IC Invalidate */ | 23 | #define CCR_CACHE_ICI 0x0800 /* IC Invalidate */ |
24 | #define CCR_CACHE_IIX 0x8000 /* IC Index Enable */ | 24 | #define CCR_CACHE_IIX 0x8000 /* IC Index Enable */ |
25 | #ifndef CONFIG_CPU_SUBTYPE_SH7780 | ||
25 | #define CCR_CACHE_EMODE 0x80000000 /* EMODE Enable */ | 26 | #define CCR_CACHE_EMODE 0x80000000 /* EMODE Enable */ |
27 | #endif | ||
26 | 28 | ||
27 | /* Default CCR setup: 8k+16k-byte cache,P1-wb,enable */ | 29 | /* Default CCR setup: 8k+16k-byte cache,P1-wb,enable */ |
28 | #define CCR_CACHE_ENABLE (CCR_CACHE_OCE|CCR_CACHE_ICE) | 30 | #define CCR_CACHE_ENABLE (CCR_CACHE_OCE|CCR_CACHE_ICE) |
diff --git a/include/asm-sh/cpu-sh4/cacheflush.h b/include/asm-sh/cpu-sh4/cacheflush.h index f323567e085f..515fd574267c 100644 --- a/include/asm-sh/cpu-sh4/cacheflush.h +++ b/include/asm-sh/cpu-sh4/cacheflush.h | |||
@@ -16,40 +16,29 @@ | |||
16 | * caching; in which case they're only semi-broken), | 16 | * caching; in which case they're only semi-broken), |
17 | * so we need them. | 17 | * so we need them. |
18 | */ | 18 | */ |
19 | 19 | void flush_cache_all(void); | |
20 | /* Page is 4K, OC size is 16K, there are four lines. */ | 20 | void flush_cache_mm(struct mm_struct *mm); |
21 | #define CACHE_ALIAS 0x00003000 | 21 | void flush_cache_range(struct vm_area_struct *vma, unsigned long start, |
22 | 22 | unsigned long end); | |
23 | struct page; | 23 | void flush_cache_page(struct vm_area_struct *vma, unsigned long addr, |
24 | struct mm_struct; | 24 | unsigned long pfn); |
25 | struct vm_area_struct; | 25 | void flush_dcache_page(struct page *pg); |
26 | |||
27 | extern void flush_cache_all(void); | ||
28 | extern void flush_cache_mm(struct mm_struct *mm); | ||
29 | extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, | ||
30 | unsigned long end); | ||
31 | extern void flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn); | ||
32 | extern void flush_dcache_page(struct page *pg); | ||
33 | 26 | ||
34 | #define flush_dcache_mmap_lock(mapping) do { } while (0) | 27 | #define flush_dcache_mmap_lock(mapping) do { } while (0) |
35 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) | 28 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) |
36 | 29 | ||
37 | extern void flush_icache_range(unsigned long start, unsigned long end); | 30 | void flush_icache_range(unsigned long start, unsigned long end); |
38 | extern void flush_cache_sigtramp(unsigned long addr); | 31 | void flush_cache_sigtramp(unsigned long addr); |
39 | extern void flush_icache_user_range(struct vm_area_struct *vma, | 32 | void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, |
40 | struct page *page, unsigned long addr, | 33 | unsigned long addr, int len); |
41 | int len); | ||
42 | 34 | ||
43 | #define flush_icache_page(vma,pg) do { } while (0) | 35 | #define flush_icache_page(vma,pg) do { } while (0) |
44 | 36 | ||
45 | /* Initialization of P3 area for copy_user_page */ | 37 | /* Initialization of P3 area for copy_user_page */ |
46 | extern void p3_cache_init(void); | 38 | void p3_cache_init(void); |
47 | 39 | ||
48 | #define PG_mapped PG_arch_1 | 40 | #define PG_mapped PG_arch_1 |
49 | 41 | ||
50 | /* We provide our own get_unmapped_area to avoid cache alias issue */ | ||
51 | #define HAVE_ARCH_UNMAPPED_AREA | ||
52 | |||
53 | #ifdef CONFIG_MMU | 42 | #ifdef CONFIG_MMU |
54 | extern int remap_area_pages(unsigned long addr, unsigned long phys_addr, | 43 | extern int remap_area_pages(unsigned long addr, unsigned long phys_addr, |
55 | unsigned long size, unsigned long flags); | 44 | unsigned long size, unsigned long flags); |
@@ -61,4 +50,3 @@ static inline int remap_area_pages(unsigned long addr, unsigned long phys_addr, | |||
61 | } | 50 | } |
62 | #endif /* CONFIG_MMU */ | 51 | #endif /* CONFIG_MMU */ |
63 | #endif /* __ASM_CPU_SH4_CACHEFLUSH_H */ | 52 | #endif /* __ASM_CPU_SH4_CACHEFLUSH_H */ |
64 | |||
diff --git a/include/asm-sh/cpu-sh4/dma-sh7780.h b/include/asm-sh/cpu-sh4/dma-sh7780.h new file mode 100644 index 000000000000..6c90d28331b2 --- /dev/null +++ b/include/asm-sh/cpu-sh4/dma-sh7780.h | |||
@@ -0,0 +1,39 @@ | |||
1 | #ifndef __ASM_SH_CPU_SH4_DMA_SH7780_H | ||
2 | #define __ASM_SH_CPU_SH4_DMA_SH7780_H | ||
3 | |||
4 | #define REQ_HE 0x000000C0 | ||
5 | #define REQ_H 0x00000080 | ||
6 | #define REQ_LE 0x00000040 | ||
7 | #define TM_BURST 0x0000020 | ||
8 | #define TS_8 0x00000000 | ||
9 | #define TS_16 0x00000008 | ||
10 | #define TS_32 0x00000010 | ||
11 | #define TS_16BLK 0x00000018 | ||
12 | #define TS_32BLK 0x00100000 | ||
13 | |||
14 | /* | ||
15 | * The SuperH DMAC supports a number of transmit sizes, we list them here, | ||
16 | * with their respective values as they appear in the CHCR registers. | ||
17 | * | ||
18 | * Defaults to a 64-bit transfer size. | ||
19 | */ | ||
20 | enum { | ||
21 | XMIT_SZ_8BIT, | ||
22 | XMIT_SZ_16BIT, | ||
23 | XMIT_SZ_32BIT, | ||
24 | XMIT_SZ_128BIT, | ||
25 | XMIT_SZ_256BIT, | ||
26 | }; | ||
27 | |||
28 | /* | ||
29 | * The DMA count is defined as the number of bytes to transfer. | ||
30 | */ | ||
31 | static unsigned int __attribute__ ((used)) ts_shift[] = { | ||
32 | [XMIT_SZ_8BIT] = 0, | ||
33 | [XMIT_SZ_16BIT] = 1, | ||
34 | [XMIT_SZ_32BIT] = 2, | ||
35 | [XMIT_SZ_128BIT] = 4, | ||
36 | [XMIT_SZ_256BIT] = 5, | ||
37 | }; | ||
38 | |||
39 | #endif /* __ASM_SH_CPU_SH4_DMA_SH7780_H */ | ||
diff --git a/include/asm-sh/cpu-sh4/dma.h b/include/asm-sh/cpu-sh4/dma.h index 0dfe61f14802..3e4b3e6d80c0 100644 --- a/include/asm-sh/cpu-sh4/dma.h +++ b/include/asm-sh/cpu-sh4/dma.h | |||
@@ -1,11 +1,17 @@ | |||
1 | #ifndef __ASM_CPU_SH4_DMA_H | 1 | #ifndef __ASM_CPU_SH4_DMA_H |
2 | #define __ASM_CPU_SH4_DMA_H | 2 | #define __ASM_CPU_SH4_DMA_H |
3 | 3 | ||
4 | #define DMAOR_INIT ( 0x8000 | DMAOR_DME ) | ||
5 | |||
4 | #ifdef CONFIG_CPU_SH4A | 6 | #ifdef CONFIG_CPU_SH4A |
5 | #define SH_DMAC_BASE 0xfc808020 | 7 | #define SH_DMAC_BASE 0xfc808020 |
8 | |||
9 | #define CHCR_TS_MASK 0x18 | ||
10 | #define CHCR_TS_SHIFT 3 | ||
11 | |||
12 | #include <asm/cpu/dma-sh7780.h> | ||
6 | #else | 13 | #else |
7 | #define SH_DMAC_BASE 0xffa00000 | 14 | #define SH_DMAC_BASE 0xffa00000 |
8 | #endif | ||
9 | 15 | ||
10 | /* Definitions for the SuperH DMAC */ | 16 | /* Definitions for the SuperH DMAC */ |
11 | #define TM_BURST 0x0000080 | 17 | #define TM_BURST 0x0000080 |
@@ -19,8 +25,6 @@ | |||
19 | 25 | ||
20 | #define DMAOR_COD 0x00000008 | 26 | #define DMAOR_COD 0x00000008 |
21 | 27 | ||
22 | #define DMAOR_INIT ( 0x8000 | DMAOR_DME ) | ||
23 | |||
24 | /* | 28 | /* |
25 | * The SuperH DMAC supports a number of transmit sizes, we list them here, | 29 | * The SuperH DMAC supports a number of transmit sizes, we list them here, |
26 | * with their respective values as they appear in the CHCR registers. | 30 | * with their respective values as they appear in the CHCR registers. |
@@ -45,5 +49,6 @@ static unsigned int ts_shift[] __attribute__ ((used)) = { | |||
45 | [XMIT_SZ_32BIT] = 2, | 49 | [XMIT_SZ_32BIT] = 2, |
46 | [XMIT_SZ_256BIT] = 5, | 50 | [XMIT_SZ_256BIT] = 5, |
47 | }; | 51 | }; |
52 | #endif | ||
48 | 53 | ||
49 | #endif /* __ASM_CPU_SH4_DMA_H */ | 54 | #endif /* __ASM_CPU_SH4_DMA_H */ |
diff --git a/include/asm-sh/cpu-sh4/shmparam.h b/include/asm-sh/cpu-sh4/shmparam.h deleted file mode 100644 index a5a0aa9425fe..000000000000 --- a/include/asm-sh/cpu-sh4/shmparam.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-sh/cpu-sh4/shmparam.h | ||
3 | * | ||
4 | * Copyright (C) 1999 Niibe Yutaka | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | #ifndef __ASM_CPU_SH4_SHMPARAM_H | ||
11 | #define __ASM_CPU_SH4_SHMPARAM_H | ||
12 | |||
13 | /* | ||
14 | * SH-4 has D-cache alias issue | ||
15 | */ | ||
16 | #define SHMLBA (PAGE_SIZE*4) /* attach addr a multiple of this */ | ||
17 | |||
18 | #endif /* __ASM_CPU_SH4_SHMPARAM_H */ | ||
19 | |||
diff --git a/include/asm-sh/cpu-sh4/sq.h b/include/asm-sh/cpu-sh4/sq.h index 366b09166d3b..586d6491816a 100644 --- a/include/asm-sh/cpu-sh4/sq.h +++ b/include/asm-sh/cpu-sh4/sq.h | |||
@@ -17,7 +17,7 @@ | |||
17 | * Store queues range from e0000000-e3fffffc, allowing approx. 64MB to be | 17 | * Store queues range from e0000000-e3fffffc, allowing approx. 64MB to be |
18 | * mapped to any physical address space. Since data is written (and aligned) | 18 | * mapped to any physical address space. Since data is written (and aligned) |
19 | * to 32-byte boundaries, we need to be sure that all allocations are aligned. | 19 | * to 32-byte boundaries, we need to be sure that all allocations are aligned. |
20 | */ | 20 | */ |
21 | #define SQ_SIZE 32 | 21 | #define SQ_SIZE 32 |
22 | #define SQ_ALIGN_MASK (~(SQ_SIZE - 1)) | 22 | #define SQ_ALIGN_MASK (~(SQ_SIZE - 1)) |
23 | #define SQ_ALIGN(addr) (((addr)+SQ_SIZE-1) & SQ_ALIGN_MASK) | 23 | #define SQ_ALIGN(addr) (((addr)+SQ_SIZE-1) & SQ_ALIGN_MASK) |
@@ -26,23 +26,10 @@ | |||
26 | #define SQ_QACR1 (P4SEG_REG_BASE + 0x3c) | 26 | #define SQ_QACR1 (P4SEG_REG_BASE + 0x3c) |
27 | #define SQ_ADDRMAX (P4SEG_STORE_QUE + 0x04000000) | 27 | #define SQ_ADDRMAX (P4SEG_STORE_QUE + 0x04000000) |
28 | 28 | ||
29 | struct sq_mapping { | ||
30 | const char *name; | ||
31 | |||
32 | unsigned long sq_addr; | ||
33 | unsigned long addr; | ||
34 | unsigned int size; | ||
35 | |||
36 | struct list_head list; | ||
37 | }; | ||
38 | |||
39 | /* arch/sh/kernel/cpu/sh4/sq.c */ | 29 | /* arch/sh/kernel/cpu/sh4/sq.c */ |
40 | extern struct sq_mapping *sq_remap(unsigned long phys, unsigned int size, const char *name); | 30 | unsigned long sq_remap(unsigned long phys, unsigned int size, |
41 | extern void sq_unmap(struct sq_mapping *map); | 31 | const char *name, unsigned long flags); |
42 | 32 | void sq_unmap(unsigned long vaddr); | |
43 | extern void sq_clear(unsigned long addr, unsigned int len); | 33 | void sq_flush_range(unsigned long start, unsigned int len); |
44 | extern void sq_flush(void *addr); | ||
45 | extern void sq_flush_range(unsigned long start, unsigned int len); | ||
46 | 34 | ||
47 | #endif /* __ASM_CPU_SH4_SQ_H */ | 35 | #endif /* __ASM_CPU_SH4_SQ_H */ |
48 | |||