diff options
Diffstat (limited to 'include/asm-sh')
-rw-r--r-- | include/asm-sh/bitops.h | 1 | ||||
-rw-r--r-- | include/asm-sh/bugs.h | 2 | ||||
-rw-r--r-- | include/asm-sh/cpu-sh4/freq.h | 6 | ||||
-rw-r--r-- | include/asm-sh/cpu-sh4/rtc.h | 5 | ||||
-rw-r--r-- | include/asm-sh/hugetlb.h | 91 | ||||
-rw-r--r-- | include/asm-sh/i2c-sh7760.h | 22 | ||||
-rw-r--r-- | include/asm-sh/ide.h | 3 | ||||
-rw-r--r-- | include/asm-sh/migor.h | 58 | ||||
-rw-r--r-- | include/asm-sh/mpc1211/pci.h | 2 | ||||
-rw-r--r-- | include/asm-sh/pgtable_32.h | 3 | ||||
-rw-r--r-- | include/asm-sh/pgtable_64.h | 10 | ||||
-rw-r--r-- | include/asm-sh/processor.h | 5 | ||||
-rw-r--r-- | include/asm-sh/r7780rp.h | 22 | ||||
-rw-r--r-- | include/asm-sh/se7721.h | 70 | ||||
-rw-r--r-- | include/asm-sh/se7722.h | 2 | ||||
-rw-r--r-- | include/asm-sh/semaphore-helper.h | 89 | ||||
-rw-r--r-- | include/asm-sh/semaphore.h | 116 | ||||
-rw-r--r-- | include/asm-sh/sh_keysc.h | 13 | ||||
-rw-r--r-- | include/asm-sh/system.h | 2 | ||||
-rw-r--r-- | include/asm-sh/topology.h | 2 | ||||
-rw-r--r-- | include/asm-sh/uaccess_32.h | 5 |
21 files changed, 295 insertions, 234 deletions
diff --git a/include/asm-sh/bitops.h b/include/asm-sh/bitops.h index b6ba5a60dec2..d7d382f63ee5 100644 --- a/include/asm-sh/bitops.h +++ b/include/asm-sh/bitops.h | |||
@@ -95,6 +95,7 @@ static inline unsigned long ffz(unsigned long word) | |||
95 | #include <asm-generic/bitops/ext2-atomic.h> | 95 | #include <asm-generic/bitops/ext2-atomic.h> |
96 | #include <asm-generic/bitops/minix.h> | 96 | #include <asm-generic/bitops/minix.h> |
97 | #include <asm-generic/bitops/fls.h> | 97 | #include <asm-generic/bitops/fls.h> |
98 | #include <asm-generic/bitops/__fls.h> | ||
98 | #include <asm-generic/bitops/fls64.h> | 99 | #include <asm-generic/bitops/fls64.h> |
99 | 100 | ||
100 | #endif /* __KERNEL__ */ | 101 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-sh/bugs.h b/include/asm-sh/bugs.h index cfda7d5bf026..121b2ecddfc3 100644 --- a/include/asm-sh/bugs.h +++ b/include/asm-sh/bugs.h | |||
@@ -25,7 +25,7 @@ static void __init check_bugs(void) | |||
25 | case CPU_SH7619: | 25 | case CPU_SH7619: |
26 | *p++ = '2'; | 26 | *p++ = '2'; |
27 | break; | 27 | break; |
28 | case CPU_SH7203 ... CPU_SH7263: | 28 | case CPU_SH7203 ... CPU_MXG: |
29 | *p++ = '2'; | 29 | *p++ = '2'; |
30 | *p++ = 'a'; | 30 | *p++ = 'a'; |
31 | break; | 31 | break; |
diff --git a/include/asm-sh/cpu-sh4/freq.h b/include/asm-sh/cpu-sh4/freq.h index ec028c649215..da46e67ae26d 100644 --- a/include/asm-sh/cpu-sh4/freq.h +++ b/include/asm-sh/cpu-sh4/freq.h | |||
@@ -10,14 +10,14 @@ | |||
10 | #ifndef __ASM_CPU_SH4_FREQ_H | 10 | #ifndef __ASM_CPU_SH4_FREQ_H |
11 | #define __ASM_CPU_SH4_FREQ_H | 11 | #define __ASM_CPU_SH4_FREQ_H |
12 | 12 | ||
13 | #if defined(CONFIG_CPU_SUBTYPE_SH7722) || defined(CONFIG_CPU_SUBTYPE_SH7366) | 13 | #if defined(CONFIG_CPU_SUBTYPE_SH7722) || \ |
14 | defined(CONFIG_CPU_SUBTYPE_SH7723) || \ | ||
15 | defined(CONFIG_CPU_SUBTYPE_SH7366) | ||
14 | #define FRQCR 0xa4150000 | 16 | #define FRQCR 0xa4150000 |
15 | #define VCLKCR 0xa4150004 | 17 | #define VCLKCR 0xa4150004 |
16 | #define SCLKACR 0xa4150008 | 18 | #define SCLKACR 0xa4150008 |
17 | #define SCLKBCR 0xa415000c | 19 | #define SCLKBCR 0xa415000c |
18 | #if defined(CONFIG_CPU_SUBTYPE_SH7722) | ||
19 | #define IrDACLKCR 0xa4150010 | 20 | #define IrDACLKCR 0xa4150010 |
20 | #endif | ||
21 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \ | 21 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \ |
22 | defined(CONFIG_CPU_SUBTYPE_SH7780) | 22 | defined(CONFIG_CPU_SUBTYPE_SH7780) |
23 | #define FRQCR 0xffc80000 | 23 | #define FRQCR 0xffc80000 |
diff --git a/include/asm-sh/cpu-sh4/rtc.h b/include/asm-sh/cpu-sh4/rtc.h index f3d0f53275e4..25b1e6adfe8c 100644 --- a/include/asm-sh/cpu-sh4/rtc.h +++ b/include/asm-sh/cpu-sh4/rtc.h | |||
@@ -1,7 +1,12 @@ | |||
1 | #ifndef __ASM_SH_CPU_SH4_RTC_H | 1 | #ifndef __ASM_SH_CPU_SH4_RTC_H |
2 | #define __ASM_SH_CPU_SH4_RTC_H | 2 | #define __ASM_SH_CPU_SH4_RTC_H |
3 | 3 | ||
4 | #ifdef CONFIG_CPU_SUBTYPE_SH7723 | ||
5 | #define rtc_reg_size sizeof(u16) | ||
6 | #else | ||
4 | #define rtc_reg_size sizeof(u32) | 7 | #define rtc_reg_size sizeof(u32) |
8 | #endif | ||
9 | |||
5 | #define RTC_BIT_INVERTED 0x40 /* bug on SH7750, SH7750S */ | 10 | #define RTC_BIT_INVERTED 0x40 /* bug on SH7750, SH7750S */ |
6 | #define RTC_DEF_CAPABILITIES RTC_CAP_4_DIGIT_YEAR | 11 | #define RTC_DEF_CAPABILITIES RTC_CAP_4_DIGIT_YEAR |
7 | 12 | ||
diff --git a/include/asm-sh/hugetlb.h b/include/asm-sh/hugetlb.h new file mode 100644 index 000000000000..02402303d89b --- /dev/null +++ b/include/asm-sh/hugetlb.h | |||
@@ -0,0 +1,91 @@ | |||
1 | #ifndef _ASM_SH_HUGETLB_H | ||
2 | #define _ASM_SH_HUGETLB_H | ||
3 | |||
4 | #include <asm/page.h> | ||
5 | |||
6 | |||
7 | static inline int is_hugepage_only_range(struct mm_struct *mm, | ||
8 | unsigned long addr, | ||
9 | unsigned long len) { | ||
10 | return 0; | ||
11 | } | ||
12 | |||
13 | /* | ||
14 | * If the arch doesn't supply something else, assume that hugepage | ||
15 | * size aligned regions are ok without further preparation. | ||
16 | */ | ||
17 | static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | ||
18 | { | ||
19 | if (len & ~HPAGE_MASK) | ||
20 | return -EINVAL; | ||
21 | if (addr & ~HPAGE_MASK) | ||
22 | return -EINVAL; | ||
23 | return 0; | ||
24 | } | ||
25 | |||
26 | static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm) { | ||
27 | } | ||
28 | |||
29 | static inline void hugetlb_free_pgd_range(struct mmu_gather **tlb, | ||
30 | unsigned long addr, unsigned long end, | ||
31 | unsigned long floor, | ||
32 | unsigned long ceiling) | ||
33 | { | ||
34 | free_pgd_range(tlb, addr, end, floor, ceiling); | ||
35 | } | ||
36 | |||
37 | static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, | ||
38 | pte_t *ptep, pte_t pte) | ||
39 | { | ||
40 | set_pte_at(mm, addr, ptep, pte); | ||
41 | } | ||
42 | |||
43 | static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, | ||
44 | unsigned long addr, pte_t *ptep) | ||
45 | { | ||
46 | return ptep_get_and_clear(mm, addr, ptep); | ||
47 | } | ||
48 | |||
49 | static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, | ||
50 | unsigned long addr, pte_t *ptep) | ||
51 | { | ||
52 | } | ||
53 | |||
54 | static inline int huge_pte_none(pte_t pte) | ||
55 | { | ||
56 | return pte_none(pte); | ||
57 | } | ||
58 | |||
59 | static inline pte_t huge_pte_wrprotect(pte_t pte) | ||
60 | { | ||
61 | return pte_wrprotect(pte); | ||
62 | } | ||
63 | |||
64 | static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, | ||
65 | unsigned long addr, pte_t *ptep) | ||
66 | { | ||
67 | ptep_set_wrprotect(mm, addr, ptep); | ||
68 | } | ||
69 | |||
70 | static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, | ||
71 | unsigned long addr, pte_t *ptep, | ||
72 | pte_t pte, int dirty) | ||
73 | { | ||
74 | return ptep_set_access_flags(vma, addr, ptep, pte, dirty); | ||
75 | } | ||
76 | |||
77 | static inline pte_t huge_ptep_get(pte_t *ptep) | ||
78 | { | ||
79 | return *ptep; | ||
80 | } | ||
81 | |||
82 | static inline int arch_prepare_hugepage(struct page *page) | ||
83 | { | ||
84 | return 0; | ||
85 | } | ||
86 | |||
87 | static inline void arch_release_hugepage(struct page *page) | ||
88 | { | ||
89 | } | ||
90 | |||
91 | #endif /* _ASM_SH_HUGETLB_H */ | ||
diff --git a/include/asm-sh/i2c-sh7760.h b/include/asm-sh/i2c-sh7760.h new file mode 100644 index 000000000000..24182116711f --- /dev/null +++ b/include/asm-sh/i2c-sh7760.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * MMIO/IRQ and platform data for SH7760 I2C channels | ||
3 | */ | ||
4 | |||
5 | #ifndef _I2C_SH7760_H_ | ||
6 | #define _I2C_SH7760_H_ | ||
7 | |||
8 | #define SH7760_I2C_DEVNAME "sh7760-i2c" | ||
9 | |||
10 | #define SH7760_I2C0_MMIO 0xFE140000 | ||
11 | #define SH7760_I2C0_MMIOEND 0xFE14003B | ||
12 | #define SH7760_I2C0_IRQ 62 | ||
13 | |||
14 | #define SH7760_I2C1_MMIO 0xFE150000 | ||
15 | #define SH7760_I2C1_MMIOEND 0xFE15003B | ||
16 | #define SH7760_I2C1_IRQ 63 | ||
17 | |||
18 | struct sh7760_i2c_platdata { | ||
19 | unsigned int speed_khz; | ||
20 | }; | ||
21 | |||
22 | #endif | ||
diff --git a/include/asm-sh/ide.h b/include/asm-sh/ide.h index 9f8e9142dc33..58e0bdd52be4 100644 --- a/include/asm-sh/ide.h +++ b/include/asm-sh/ide.h | |||
@@ -14,9 +14,6 @@ | |||
14 | 14 | ||
15 | #ifdef __KERNEL__ | 15 | #ifdef __KERNEL__ |
16 | 16 | ||
17 | |||
18 | #define ide_default_io_ctl(base) (0) | ||
19 | |||
20 | #include <asm-generic/ide_iops.h> | 17 | #include <asm-generic/ide_iops.h> |
21 | 18 | ||
22 | #endif /* __KERNEL__ */ | 19 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-sh/migor.h b/include/asm-sh/migor.h new file mode 100644 index 000000000000..2329363afdc3 --- /dev/null +++ b/include/asm-sh/migor.h | |||
@@ -0,0 +1,58 @@ | |||
1 | #ifndef __ASM_SH_MIGOR_H | ||
2 | #define __ASM_SH_MIGOR_H | ||
3 | |||
4 | /* | ||
5 | * linux/include/asm-sh/migor.h | ||
6 | * | ||
7 | * Copyright (C) 2008 Renesas Solutions | ||
8 | * | ||
9 | * Portions Copyright (C) 2007 Nobuhiro Iwamatsu | ||
10 | * | ||
11 | * This file is subject to the terms and conditions of the GNU General Public | ||
12 | * License. See the file "COPYING" in the main directory of this archive | ||
13 | * for more details. | ||
14 | * | ||
15 | */ | ||
16 | #include <asm/addrspace.h> | ||
17 | |||
18 | /* GPIO */ | ||
19 | #define MSTPCR0 0xa4150030 | ||
20 | #define MSTPCR1 0xa4150034 | ||
21 | #define MSTPCR2 0xa4150038 | ||
22 | |||
23 | #define PORT_PACR 0xa4050100 | ||
24 | #define PORT_PDCR 0xa4050106 | ||
25 | #define PORT_PECR 0xa4050108 | ||
26 | #define PORT_PHCR 0xa405010e | ||
27 | #define PORT_PJCR 0xa4050110 | ||
28 | #define PORT_PKCR 0xa4050112 | ||
29 | #define PORT_PLCR 0xa4050114 | ||
30 | #define PORT_PMCR 0xa4050116 | ||
31 | #define PORT_PRCR 0xa405011c | ||
32 | #define PORT_PWCR 0xa4050146 | ||
33 | #define PORT_PXCR 0xa4050148 | ||
34 | #define PORT_PYCR 0xa405014a | ||
35 | #define PORT_PZCR 0xa405014c | ||
36 | #define PORT_PADR 0xa4050120 | ||
37 | #define PORT_PWDR 0xa4050166 | ||
38 | |||
39 | #define PORT_HIZCRA 0xa4050158 | ||
40 | #define PORT_HIZCRC 0xa405015c | ||
41 | |||
42 | #define PORT_MSELCRB 0xa4050182 | ||
43 | |||
44 | #define MSTPCR1 0xa4150034 | ||
45 | #define MSTPCR2 0xa4150038 | ||
46 | |||
47 | #define PORT_PSELA 0xa405014e | ||
48 | #define PORT_PSELB 0xa4050150 | ||
49 | #define PORT_PSELC 0xa4050152 | ||
50 | #define PORT_PSELD 0xa4050154 | ||
51 | |||
52 | #define PORT_HIZCRA 0xa4050158 | ||
53 | #define PORT_HIZCRB 0xa405015a | ||
54 | #define PORT_HIZCRC 0xa405015c | ||
55 | |||
56 | #define BSC_CS6ABCR 0xfec1001c | ||
57 | |||
58 | #endif /* __ASM_SH_MIGOR_H */ | ||
diff --git a/include/asm-sh/mpc1211/pci.h b/include/asm-sh/mpc1211/pci.h index 5d3712c3a701..d9162c5ed76a 100644 --- a/include/asm-sh/mpc1211/pci.h +++ b/include/asm-sh/mpc1211/pci.h | |||
@@ -24,8 +24,6 @@ | |||
24 | #define PCI_PROBE_BIOS 1 | 24 | #define PCI_PROBE_BIOS 1 |
25 | #define PCI_PROBE_CONF1 2 | 25 | #define PCI_PROBE_CONF1 2 |
26 | #define PCI_PROBE_CONF2 4 | 26 | #define PCI_PROBE_CONF2 4 |
27 | #define PCI_NO_SORT 0x100 | ||
28 | #define PCI_BIOS_SORT 0x200 | ||
29 | #define PCI_NO_CHECKS 0x400 | 27 | #define PCI_NO_CHECKS 0x400 |
30 | #define PCI_ASSIGN_ROMS 0x1000 | 28 | #define PCI_ASSIGN_ROMS 0x1000 |
31 | #define PCI_BIOS_IRQ_SCAN 0x2000 | 29 | #define PCI_BIOS_IRQ_SCAN 0x2000 |
diff --git a/include/asm-sh/pgtable_32.h b/include/asm-sh/pgtable_32.h index 3e3557c53c55..cbc731d35c25 100644 --- a/include/asm-sh/pgtable_32.h +++ b/include/asm-sh/pgtable_32.h | |||
@@ -326,6 +326,7 @@ static inline void set_pte(pte_t *ptep, pte_t pte) | |||
326 | #define pte_dirty(pte) ((pte).pte_low & _PAGE_DIRTY) | 326 | #define pte_dirty(pte) ((pte).pte_low & _PAGE_DIRTY) |
327 | #define pte_young(pte) ((pte).pte_low & _PAGE_ACCESSED) | 327 | #define pte_young(pte) ((pte).pte_low & _PAGE_ACCESSED) |
328 | #define pte_file(pte) ((pte).pte_low & _PAGE_FILE) | 328 | #define pte_file(pte) ((pte).pte_low & _PAGE_FILE) |
329 | #define pte_special(pte) (0) | ||
329 | 330 | ||
330 | #ifdef CONFIG_X2TLB | 331 | #ifdef CONFIG_X2TLB |
331 | #define pte_write(pte) ((pte).pte_high & _PAGE_EXT_USER_WRITE) | 332 | #define pte_write(pte) ((pte).pte_high & _PAGE_EXT_USER_WRITE) |
@@ -356,6 +357,8 @@ PTE_BIT_FUNC(low, mkdirty, |= _PAGE_DIRTY); | |||
356 | PTE_BIT_FUNC(low, mkold, &= ~_PAGE_ACCESSED); | 357 | PTE_BIT_FUNC(low, mkold, &= ~_PAGE_ACCESSED); |
357 | PTE_BIT_FUNC(low, mkyoung, |= _PAGE_ACCESSED); | 358 | PTE_BIT_FUNC(low, mkyoung, |= _PAGE_ACCESSED); |
358 | 359 | ||
360 | static inline pte_t pte_mkspecial(pte_t pte) { return pte; } | ||
361 | |||
359 | /* | 362 | /* |
360 | * Macro and implementation to make a page protection as uncachable. | 363 | * Macro and implementation to make a page protection as uncachable. |
361 | */ | 364 | */ |
diff --git a/include/asm-sh/pgtable_64.h b/include/asm-sh/pgtable_64.h index f9dd9d311441..c78990cda557 100644 --- a/include/asm-sh/pgtable_64.h +++ b/include/asm-sh/pgtable_64.h | |||
@@ -254,10 +254,11 @@ extern void __handle_bad_pmd_kernel(pmd_t * pmd); | |||
254 | /* | 254 | /* |
255 | * The following have defined behavior only work if pte_present() is true. | 255 | * The following have defined behavior only work if pte_present() is true. |
256 | */ | 256 | */ |
257 | static inline int pte_dirty(pte_t pte){ return pte_val(pte) & _PAGE_DIRTY; } | 257 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } |
258 | static inline int pte_young(pte_t pte){ return pte_val(pte) & _PAGE_ACCESSED; } | 258 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
259 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 259 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
260 | static inline int pte_write(pte_t pte){ return pte_val(pte) & _PAGE_WRITE; } | 260 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; } |
261 | static inline int pte_special(pte_t pte){ return 0; } | ||
261 | 262 | ||
262 | static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_WRITE)); return pte; } | 263 | static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_WRITE)); return pte; } |
263 | static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } | 264 | static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } |
@@ -266,6 +267,7 @@ static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | | |||
266 | static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } | 267 | static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } |
267 | static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } | 268 | static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } |
268 | static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; } | 269 | static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; } |
270 | static inline pte_t pte_mkspecial(pte_t pte) { return pte; } | ||
269 | 271 | ||
270 | 272 | ||
271 | /* | 273 | /* |
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h index ec707b98e5b9..b7c7ce80f03e 100644 --- a/include/asm-sh/processor.h +++ b/include/asm-sh/processor.h | |||
@@ -16,7 +16,7 @@ enum cpu_type { | |||
16 | CPU_SH7619, | 16 | CPU_SH7619, |
17 | 17 | ||
18 | /* SH-2A types */ | 18 | /* SH-2A types */ |
19 | CPU_SH7203, CPU_SH7206, CPU_SH7263, | 19 | CPU_SH7203, CPU_SH7206, CPU_SH7263, CPU_MXG, |
20 | 20 | ||
21 | /* SH-3 types */ | 21 | /* SH-3 types */ |
22 | CPU_SH7705, CPU_SH7706, CPU_SH7707, | 22 | CPU_SH7705, CPU_SH7706, CPU_SH7707, |
@@ -29,7 +29,8 @@ enum cpu_type { | |||
29 | CPU_SH7760, CPU_SH4_202, CPU_SH4_501, | 29 | CPU_SH7760, CPU_SH4_202, CPU_SH4_501, |
30 | 30 | ||
31 | /* SH-4A types */ | 31 | /* SH-4A types */ |
32 | CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SHX3, | 32 | CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, |
33 | CPU_SH7723, CPU_SHX3, | ||
33 | 34 | ||
34 | /* SH4AL-DSP types */ | 35 | /* SH4AL-DSP types */ |
35 | CPU_SH7343, CPU_SH7722, CPU_SH7366, | 36 | CPU_SH7343, CPU_SH7722, CPU_SH7366, |
diff --git a/include/asm-sh/r7780rp.h b/include/asm-sh/r7780rp.h index 1770460a4616..a33838f23a6d 100644 --- a/include/asm-sh/r7780rp.h +++ b/include/asm-sh/r7780rp.h | |||
@@ -55,11 +55,11 @@ | |||
55 | #define PA_SCSPTR1 (PA_BCR+0x0524) /* SCIF1 Serial Port control */ | 55 | #define PA_SCSPTR1 (PA_BCR+0x0524) /* SCIF1 Serial Port control */ |
56 | #define PA_SCLSR1 (PA_BCR+0x0528) /* SCIF1 Line Status control */ | 56 | #define PA_SCLSR1 (PA_BCR+0x0528) /* SCIF1 Line Status control */ |
57 | #define PA_SCRER1 (PA_BCR+0x052c) /* SCIF1 Serial Error control */ | 57 | #define PA_SCRER1 (PA_BCR+0x052c) /* SCIF1 Serial Error control */ |
58 | #define PA_ICCR (PA_BCR+0x0600) /* Serial control */ | 58 | #define PA_SMCR (PA_BCR+0x0600) /* 2-wire Serial control */ |
59 | #define PA_SAR (PA_BCR+0x0602) /* Serial Slave control */ | 59 | #define PA_SMSMADR (PA_BCR+0x0602) /* 2-wire Serial Slave control */ |
60 | #define PA_MDR (PA_BCR+0x0604) /* Serial Mode control */ | 60 | #define PA_SMMR (PA_BCR+0x0604) /* 2-wire Serial Mode control */ |
61 | #define PA_ADR1 (PA_BCR+0x0606) /* Serial Address1 control */ | 61 | #define PA_SMSADR1 (PA_BCR+0x0606) /* 2-wire Serial Address1 control */ |
62 | #define PA_DAR1 (PA_BCR+0x0646) /* Serial Data1 control */ | 62 | #define PA_SMTRDR1 (PA_BCR+0x0646) /* 2-wire Serial Data1 control */ |
63 | #define PA_VERREG (PA_BCR+0x0700) /* FPGA Version Register */ | 63 | #define PA_VERREG (PA_BCR+0x0700) /* FPGA Version Register */ |
64 | #define PA_POFF (PA_BCR+0x0800) /* System Power Off control */ | 64 | #define PA_POFF (PA_BCR+0x0800) /* System Power Off control */ |
65 | #define PA_PMR (PA_BCR+0x0900) /* */ | 65 | #define PA_PMR (PA_BCR+0x0900) /* */ |
@@ -107,11 +107,11 @@ | |||
107 | #define PA_SCFCR (PA_BCR+0x040c) /* SCIF FIFO control */ | 107 | #define PA_SCFCR (PA_BCR+0x040c) /* SCIF FIFO control */ |
108 | #define PA_SCFDR (PA_BCR+0x040e) /* SCIF FIFO data control */ | 108 | #define PA_SCFDR (PA_BCR+0x040e) /* SCIF FIFO data control */ |
109 | #define PA_SCLSR (PA_BCR+0x0412) /* SCIF Line Status control */ | 109 | #define PA_SCLSR (PA_BCR+0x0412) /* SCIF Line Status control */ |
110 | #define PA_ICCR (PA_BCR+0x0500) /* Serial control */ | 110 | #define PA_SMCR (PA_BCR+0x0500) /* 2-wire Serial control */ |
111 | #define PA_SAR (PA_BCR+0x0502) /* Serial Slave control */ | 111 | #define PA_SMSMADR (PA_BCR+0x0502) /* 2-wire Serial Slave control */ |
112 | #define PA_MDR (PA_BCR+0x0504) /* Serial Mode control */ | 112 | #define PA_SMMR (PA_BCR+0x0504) /* 2-wire Serial Mode control */ |
113 | #define PA_ADR1 (PA_BCR+0x0506) /* Serial Address1 control */ | 113 | #define PA_SMSADR1 (PA_BCR+0x0506) /* 2-wire Serial Address1 control */ |
114 | #define PA_DAR1 (PA_BCR+0x0546) /* Serial Data1 control */ | 114 | #define PA_SMTRDR1 (PA_BCR+0x0546) /* 2-wire Serial Data1 control */ |
115 | #define PA_VERREG (PA_BCR+0x0600) /* FPGA Version Register */ | 115 | #define PA_VERREG (PA_BCR+0x0600) /* FPGA Version Register */ |
116 | 116 | ||
117 | #define PA_AX88796L 0xa5800400 /* AX88796L Area */ | 117 | #define PA_AX88796L 0xa5800400 /* AX88796L Area */ |
@@ -190,6 +190,8 @@ | |||
190 | #define IRQ_TP (HL_FPGA_IRQ_BASE + 12) | 190 | #define IRQ_TP (HL_FPGA_IRQ_BASE + 12) |
191 | #define IRQ_RTC (HL_FPGA_IRQ_BASE + 13) | 191 | #define IRQ_RTC (HL_FPGA_IRQ_BASE + 13) |
192 | #define IRQ_TH_ALERT (HL_FPGA_IRQ_BASE + 14) | 192 | #define IRQ_TH_ALERT (HL_FPGA_IRQ_BASE + 14) |
193 | #define IRQ_SCIF0 (HL_FPGA_IRQ_BASE + 15) | ||
194 | #define IRQ_SCIF1 (HL_FPGA_IRQ_BASE + 16) | ||
193 | 195 | ||
194 | unsigned char *highlander_init_irq_r7780mp(void); | 196 | unsigned char *highlander_init_irq_r7780mp(void); |
195 | unsigned char *highlander_init_irq_r7780rp(void); | 197 | unsigned char *highlander_init_irq_r7780rp(void); |
diff --git a/include/asm-sh/se7721.h b/include/asm-sh/se7721.h new file mode 100644 index 000000000000..b957f6041193 --- /dev/null +++ b/include/asm-sh/se7721.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 Renesas Solutions Corp. | ||
3 | * | ||
4 | * Hitachi UL SolutionEngine 7721 Support. | ||
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 | */ | ||
11 | |||
12 | #ifndef __ASM_SH_SE7721_H | ||
13 | #define __ASM_SH_SE7721_H | ||
14 | #include <asm/addrspace.h> | ||
15 | |||
16 | /* Box specific addresses. */ | ||
17 | #define SE_AREA0_WIDTH 2 /* Area0: 32bit */ | ||
18 | #define PA_ROM 0xa0000000 /* EPROM */ | ||
19 | #define PA_ROM_SIZE 0x00200000 /* EPROM size 2M byte */ | ||
20 | #define PA_FROM 0xa1000000 /* Flash-ROM */ | ||
21 | #define PA_FROM_SIZE 0x01000000 /* Flash-ROM size 16M byte */ | ||
22 | #define PA_EXT1 0xa4000000 | ||
23 | #define PA_EXT1_SIZE 0x04000000 | ||
24 | #define PA_SDRAM 0xaC000000 /* SDRAM(Area3) 64MB */ | ||
25 | #define PA_SDRAM_SIZE 0x04000000 | ||
26 | |||
27 | #define PA_EXT4 0xb0000000 | ||
28 | #define PA_EXT4_SIZE 0x04000000 | ||
29 | |||
30 | #define PA_PERIPHERAL 0xB8000000 | ||
31 | |||
32 | #define PA_PCIC PA_PERIPHERAL | ||
33 | #define PA_MRSHPC (PA_PERIPHERAL + 0x003fffe0) | ||
34 | #define PA_MRSHPC_MW1 (PA_PERIPHERAL + 0x00400000) | ||
35 | #define PA_MRSHPC_MW2 (PA_PERIPHERAL + 0x00500000) | ||
36 | #define PA_MRSHPC_IO (PA_PERIPHERAL + 0x00600000) | ||
37 | #define MRSHPC_OPTION (PA_MRSHPC + 6) | ||
38 | #define MRSHPC_CSR (PA_MRSHPC + 8) | ||
39 | #define MRSHPC_ISR (PA_MRSHPC + 10) | ||
40 | #define MRSHPC_ICR (PA_MRSHPC + 12) | ||
41 | #define MRSHPC_CPWCR (PA_MRSHPC + 14) | ||
42 | #define MRSHPC_MW0CR1 (PA_MRSHPC + 16) | ||
43 | #define MRSHPC_MW1CR1 (PA_MRSHPC + 18) | ||
44 | #define MRSHPC_IOWCR1 (PA_MRSHPC + 20) | ||
45 | #define MRSHPC_MW0CR2 (PA_MRSHPC + 22) | ||
46 | #define MRSHPC_MW1CR2 (PA_MRSHPC + 24) | ||
47 | #define MRSHPC_IOWCR2 (PA_MRSHPC + 26) | ||
48 | #define MRSHPC_CDCR (PA_MRSHPC + 28) | ||
49 | #define MRSHPC_PCIC_INFO (PA_MRSHPC + 30) | ||
50 | |||
51 | #define PA_LED 0xB6800000 /* 8bit LED */ | ||
52 | #define PA_FPGA 0xB7000000 /* FPGA base address */ | ||
53 | |||
54 | #define MRSHPC_IRQ0 10 | ||
55 | |||
56 | #define FPGA_ILSR1 (PA_FPGA + 0x02) | ||
57 | #define FPGA_ILSR2 (PA_FPGA + 0x03) | ||
58 | #define FPGA_ILSR3 (PA_FPGA + 0x04) | ||
59 | #define FPGA_ILSR4 (PA_FPGA + 0x05) | ||
60 | #define FPGA_ILSR5 (PA_FPGA + 0x06) | ||
61 | #define FPGA_ILSR6 (PA_FPGA + 0x07) | ||
62 | #define FPGA_ILSR7 (PA_FPGA + 0x08) | ||
63 | #define FPGA_ILSR8 (PA_FPGA + 0x09) | ||
64 | |||
65 | void init_se7721_IRQ(void); | ||
66 | |||
67 | #define __IO_PREFIX se7721 | ||
68 | #include <asm/io_generic.h> | ||
69 | |||
70 | #endif /* __ASM_SH_SE7721_H */ | ||
diff --git a/include/asm-sh/se7722.h b/include/asm-sh/se7722.h index e0e89fcb8388..3690fe5857a4 100644 --- a/include/asm-sh/se7722.h +++ b/include/asm-sh/se7722.h | |||
@@ -77,6 +77,8 @@ | |||
77 | #define PORT_PSELA 0xA405014EUL | 77 | #define PORT_PSELA 0xA405014EUL |
78 | #define PORT_PYCR 0xA405014AUL | 78 | #define PORT_PYCR 0xA405014AUL |
79 | #define PORT_PZCR 0xA405014CUL | 79 | #define PORT_PZCR 0xA405014CUL |
80 | #define PORT_HIZCRA 0xA4050158UL | ||
81 | #define PORT_HIZCRC 0xA405015CUL | ||
80 | 82 | ||
81 | /* IRQ */ | 83 | /* IRQ */ |
82 | #define IRQ0_IRQ 32 | 84 | #define IRQ0_IRQ 32 |
diff --git a/include/asm-sh/semaphore-helper.h b/include/asm-sh/semaphore-helper.h deleted file mode 100644 index bd8230c369ca..000000000000 --- a/include/asm-sh/semaphore-helper.h +++ /dev/null | |||
@@ -1,89 +0,0 @@ | |||
1 | #ifndef __ASM_SH_SEMAPHORE_HELPER_H | ||
2 | #define __ASM_SH_SEMAPHORE_HELPER_H | ||
3 | |||
4 | /* | ||
5 | * SMP- and interrupt-safe semaphores helper functions. | ||
6 | * | ||
7 | * (C) Copyright 1996 Linus Torvalds | ||
8 | * (C) Copyright 1999 Andrea Arcangeli | ||
9 | */ | ||
10 | |||
11 | /* | ||
12 | * These two _must_ execute atomically wrt each other. | ||
13 | * | ||
14 | * This is trivially done with load_locked/store_cond, | ||
15 | * which we have. Let the rest of the losers suck eggs. | ||
16 | */ | ||
17 | static __inline__ void wake_one_more(struct semaphore * sem) | ||
18 | { | ||
19 | atomic_inc((atomic_t *)&sem->sleepers); | ||
20 | } | ||
21 | |||
22 | static __inline__ int waking_non_zero(struct semaphore *sem) | ||
23 | { | ||
24 | unsigned long flags; | ||
25 | int ret = 0; | ||
26 | |||
27 | spin_lock_irqsave(&semaphore_wake_lock, flags); | ||
28 | if (sem->sleepers > 0) { | ||
29 | sem->sleepers--; | ||
30 | ret = 1; | ||
31 | } | ||
32 | spin_unlock_irqrestore(&semaphore_wake_lock, flags); | ||
33 | return ret; | ||
34 | } | ||
35 | |||
36 | /* | ||
37 | * waking_non_zero_interruptible: | ||
38 | * 1 got the lock | ||
39 | * 0 go to sleep | ||
40 | * -EINTR interrupted | ||
41 | * | ||
42 | * We must undo the sem->count down_interruptible() increment while we are | ||
43 | * protected by the spinlock in order to make atomic this atomic_inc() with the | ||
44 | * atomic_read() in wake_one_more(), otherwise we can race. -arca | ||
45 | */ | ||
46 | static __inline__ int waking_non_zero_interruptible(struct semaphore *sem, | ||
47 | struct task_struct *tsk) | ||
48 | { | ||
49 | unsigned long flags; | ||
50 | int ret = 0; | ||
51 | |||
52 | spin_lock_irqsave(&semaphore_wake_lock, flags); | ||
53 | if (sem->sleepers > 0) { | ||
54 | sem->sleepers--; | ||
55 | ret = 1; | ||
56 | } else if (signal_pending(tsk)) { | ||
57 | atomic_inc(&sem->count); | ||
58 | ret = -EINTR; | ||
59 | } | ||
60 | spin_unlock_irqrestore(&semaphore_wake_lock, flags); | ||
61 | return ret; | ||
62 | } | ||
63 | |||
64 | /* | ||
65 | * waking_non_zero_trylock: | ||
66 | * 1 failed to lock | ||
67 | * 0 got the lock | ||
68 | * | ||
69 | * We must undo the sem->count down_trylock() increment while we are | ||
70 | * protected by the spinlock in order to make atomic this atomic_inc() with the | ||
71 | * atomic_read() in wake_one_more(), otherwise we can race. -arca | ||
72 | */ | ||
73 | static __inline__ int waking_non_zero_trylock(struct semaphore *sem) | ||
74 | { | ||
75 | unsigned long flags; | ||
76 | int ret = 1; | ||
77 | |||
78 | spin_lock_irqsave(&semaphore_wake_lock, flags); | ||
79 | if (sem->sleepers <= 0) | ||
80 | atomic_inc(&sem->count); | ||
81 | else { | ||
82 | sem->sleepers--; | ||
83 | ret = 0; | ||
84 | } | ||
85 | spin_unlock_irqrestore(&semaphore_wake_lock, flags); | ||
86 | return ret; | ||
87 | } | ||
88 | |||
89 | #endif /* __ASM_SH_SEMAPHORE_HELPER_H */ | ||
diff --git a/include/asm-sh/semaphore.h b/include/asm-sh/semaphore.h index 9e5a37c4dce2..d9b2034ed1d2 100644 --- a/include/asm-sh/semaphore.h +++ b/include/asm-sh/semaphore.h | |||
@@ -1,115 +1 @@ | |||
1 | #ifndef __ASM_SH_SEMAPHORE_H | #include <linux/semaphore.h> | |
2 | #define __ASM_SH_SEMAPHORE_H | ||
3 | |||
4 | #include <linux/linkage.h> | ||
5 | |||
6 | #ifdef __KERNEL__ | ||
7 | /* | ||
8 | * SMP- and interrupt-safe semaphores. | ||
9 | * | ||
10 | * (C) Copyright 1996 Linus Torvalds | ||
11 | * | ||
12 | * SuperH verison by Niibe Yutaka | ||
13 | * (Currently no asm implementation but generic C code...) | ||
14 | */ | ||
15 | |||
16 | #include <linux/spinlock.h> | ||
17 | #include <linux/rwsem.h> | ||
18 | #include <linux/wait.h> | ||
19 | |||
20 | #include <asm/system.h> | ||
21 | #include <asm/atomic.h> | ||
22 | |||
23 | struct semaphore { | ||
24 | atomic_t count; | ||
25 | int sleepers; | ||
26 | wait_queue_head_t wait; | ||
27 | }; | ||
28 | |||
29 | #define __SEMAPHORE_INITIALIZER(name, n) \ | ||
30 | { \ | ||
31 | .count = ATOMIC_INIT(n), \ | ||
32 | .sleepers = 0, \ | ||
33 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | ||
34 | } | ||
35 | |||
36 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | ||
37 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | ||
38 | |||
39 | #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) | ||
40 | |||
41 | static inline void sema_init (struct semaphore *sem, int val) | ||
42 | { | ||
43 | /* | ||
44 | * *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); | ||
45 | * | ||
46 | * i'd rather use the more flexible initialization above, but sadly | ||
47 | * GCC 2.7.2.3 emits a bogus warning. EGCS doesn't. Oh well. | ||
48 | */ | ||
49 | atomic_set(&sem->count, val); | ||
50 | sem->sleepers = 0; | ||
51 | init_waitqueue_head(&sem->wait); | ||
52 | } | ||
53 | |||
54 | static inline void init_MUTEX (struct semaphore *sem) | ||
55 | { | ||
56 | sema_init(sem, 1); | ||
57 | } | ||
58 | |||
59 | static inline void init_MUTEX_LOCKED (struct semaphore *sem) | ||
60 | { | ||
61 | sema_init(sem, 0); | ||
62 | } | ||
63 | |||
64 | #if 0 | ||
65 | asmlinkage void __down_failed(void /* special register calling convention */); | ||
66 | asmlinkage int __down_failed_interruptible(void /* params in registers */); | ||
67 | asmlinkage int __down_failed_trylock(void /* params in registers */); | ||
68 | asmlinkage void __up_wakeup(void /* special register calling convention */); | ||
69 | #endif | ||
70 | |||
71 | asmlinkage void __down(struct semaphore * sem); | ||
72 | asmlinkage int __down_interruptible(struct semaphore * sem); | ||
73 | asmlinkage int __down_trylock(struct semaphore * sem); | ||
74 | asmlinkage void __up(struct semaphore * sem); | ||
75 | |||
76 | extern spinlock_t semaphore_wake_lock; | ||
77 | |||
78 | static inline void down(struct semaphore * sem) | ||
79 | { | ||
80 | might_sleep(); | ||
81 | if (atomic_dec_return(&sem->count) < 0) | ||
82 | __down(sem); | ||
83 | } | ||
84 | |||
85 | static inline int down_interruptible(struct semaphore * sem) | ||
86 | { | ||
87 | int ret = 0; | ||
88 | |||
89 | might_sleep(); | ||
90 | if (atomic_dec_return(&sem->count) < 0) | ||
91 | ret = __down_interruptible(sem); | ||
92 | return ret; | ||
93 | } | ||
94 | |||
95 | static inline int down_trylock(struct semaphore * sem) | ||
96 | { | ||
97 | int ret = 0; | ||
98 | |||
99 | if (atomic_dec_return(&sem->count) < 0) | ||
100 | ret = __down_trylock(sem); | ||
101 | return ret; | ||
102 | } | ||
103 | |||
104 | /* | ||
105 | * Note! This is subtle. We jump to wake people up only if | ||
106 | * the semaphore was negative (== somebody was waiting on it). | ||
107 | */ | ||
108 | static inline void up(struct semaphore * sem) | ||
109 | { | ||
110 | if (atomic_inc_return(&sem->count) <= 0) | ||
111 | __up(sem); | ||
112 | } | ||
113 | |||
114 | #endif | ||
115 | #endif /* __ASM_SH_SEMAPHORE_H */ | ||
diff --git a/include/asm-sh/sh_keysc.h b/include/asm-sh/sh_keysc.h new file mode 100644 index 000000000000..b5a4dd5a9729 --- /dev/null +++ b/include/asm-sh/sh_keysc.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef __ASM_KEYSC_H__ | ||
2 | #define __ASM_KEYSC_H__ | ||
3 | |||
4 | #define SH_KEYSC_MAXKEYS 30 | ||
5 | |||
6 | struct sh_keysc_info { | ||
7 | enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3 } mode; | ||
8 | int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */ | ||
9 | int delay; | ||
10 | int keycodes[SH_KEYSC_MAXKEYS]; | ||
11 | }; | ||
12 | |||
13 | #endif /* __ASM_KEYSC_H__ */ | ||
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h index 5145aa2a0ce9..e65b6b822cb3 100644 --- a/include/asm-sh/system.h +++ b/include/asm-sh/system.h | |||
@@ -146,6 +146,8 @@ extern unsigned int instruction_size(unsigned int insn); | |||
146 | 146 | ||
147 | extern unsigned long cached_to_uncached; | 147 | extern unsigned long cached_to_uncached; |
148 | 148 | ||
149 | extern struct dentry *sh_debugfs_root; | ||
150 | |||
149 | /* XXX | 151 | /* XXX |
150 | * disable hlt during certain critical i/o operations | 152 | * disable hlt during certain critical i/o operations |
151 | */ | 153 | */ |
diff --git a/include/asm-sh/topology.h b/include/asm-sh/topology.h index f402a3b1cfa4..34cdb28e8f44 100644 --- a/include/asm-sh/topology.h +++ b/include/asm-sh/topology.h | |||
@@ -16,7 +16,7 @@ | |||
16 | .cache_nice_tries = 2, \ | 16 | .cache_nice_tries = 2, \ |
17 | .busy_idx = 3, \ | 17 | .busy_idx = 3, \ |
18 | .idle_idx = 2, \ | 18 | .idle_idx = 2, \ |
19 | .newidle_idx = 0, \ | 19 | .newidle_idx = 2, \ |
20 | .wake_idx = 1, \ | 20 | .wake_idx = 1, \ |
21 | .forkexec_idx = 1, \ | 21 | .forkexec_idx = 1, \ |
22 | .flags = SD_LOAD_BALANCE \ | 22 | .flags = SD_LOAD_BALANCE \ |
diff --git a/include/asm-sh/uaccess_32.h b/include/asm-sh/uaccess_32.h index c0318b608893..1e41fda74bd3 100644 --- a/include/asm-sh/uaccess_32.h +++ b/include/asm-sh/uaccess_32.h | |||
@@ -55,13 +55,10 @@ static inline void set_fs(mm_segment_t s) | |||
55 | * If we don't have an MMU (or if its disabled) the only thing we really have | 55 | * If we don't have an MMU (or if its disabled) the only thing we really have |
56 | * to look out for is if the address resides somewhere outside of what | 56 | * to look out for is if the address resides somewhere outside of what |
57 | * available RAM we have. | 57 | * available RAM we have. |
58 | * | ||
59 | * TODO: This check could probably also stand to be restricted somewhat more.. | ||
60 | * though it still does the Right Thing(tm) for the time being. | ||
61 | */ | 58 | */ |
62 | static inline int __access_ok(unsigned long addr, unsigned long size) | 59 | static inline int __access_ok(unsigned long addr, unsigned long size) |
63 | { | 60 | { |
64 | return ((addr >= memory_start) && ((addr + size) < memory_end)); | 61 | return 1; |
65 | } | 62 | } |
66 | #else /* CONFIG_MMU */ | 63 | #else /* CONFIG_MMU */ |
67 | #define __addr_ok(addr) \ | 64 | #define __addr_ok(addr) \ |