diff options
Diffstat (limited to 'include/asm-arm/arch-rpc')
-rw-r--r-- | include/asm-arm/arch-rpc/acornfb.h | 140 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/debug-macro.S | 35 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/dma.h | 33 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/entry-macro.S | 3 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/hardware.h | 86 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/io.h | 257 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/irqs.h | 46 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/memory.h | 33 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/param.h | 3 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/system.h | 27 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/timex.h | 17 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/uncompress.h | 155 | ||||
-rw-r--r-- | include/asm-arm/arch-rpc/vmalloc.h | 21 |
13 files changed, 856 insertions, 0 deletions
diff --git a/include/asm-arm/arch-rpc/acornfb.h b/include/asm-arm/arch-rpc/acornfb.h new file mode 100644 index 000000000000..ecb7733a0949 --- /dev/null +++ b/include/asm-arm/arch-rpc/acornfb.h | |||
@@ -0,0 +1,140 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-rpc/acornfb.h | ||
3 | * | ||
4 | * Copyright (C) 1999 Russell King | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * AcornFB architecture specific code | ||
11 | */ | ||
12 | |||
13 | #define acornfb_bandwidth(var) ((var)->pixclock * 8 / (var)->bits_per_pixel) | ||
14 | |||
15 | static inline int | ||
16 | acornfb_valid_pixrate(struct fb_var_screeninfo *var) | ||
17 | { | ||
18 | u_long limit; | ||
19 | |||
20 | if (!var->pixclock) | ||
21 | return 0; | ||
22 | |||
23 | /* | ||
24 | * Limits below are taken from RISC OS bandwidthlimit file | ||
25 | */ | ||
26 | if (current_par.using_vram) { | ||
27 | if (current_par.vram_half_sam == 2048) | ||
28 | limit = 6578; | ||
29 | else | ||
30 | limit = 13157; | ||
31 | } else { | ||
32 | limit = 26315; | ||
33 | } | ||
34 | |||
35 | return acornfb_bandwidth(var) >= limit; | ||
36 | } | ||
37 | |||
38 | /* | ||
39 | * Try to find the best PLL parameters for the pixel clock. | ||
40 | * This algorithm seems to give best predictable results, | ||
41 | * and produces the same values as detailed in the VIDC20 | ||
42 | * data sheet. | ||
43 | */ | ||
44 | static inline u_int | ||
45 | acornfb_vidc20_find_pll(u_int pixclk) | ||
46 | { | ||
47 | u_int r, best_r = 2, best_v = 2; | ||
48 | int best_d = 0x7fffffff; | ||
49 | |||
50 | for (r = 2; r <= 32; r++) { | ||
51 | u_int rr, v, p; | ||
52 | int d; | ||
53 | |||
54 | rr = 41667 * r; | ||
55 | |||
56 | v = (rr + pixclk / 2) / pixclk; | ||
57 | |||
58 | if (v > 32 || v < 2) | ||
59 | continue; | ||
60 | |||
61 | p = (rr + v / 2) / v; | ||
62 | |||
63 | d = pixclk - p; | ||
64 | |||
65 | if (d < 0) | ||
66 | d = -d; | ||
67 | |||
68 | if (d < best_d) { | ||
69 | best_d = d; | ||
70 | best_v = v - 1; | ||
71 | best_r = r - 1; | ||
72 | } | ||
73 | |||
74 | if (d == 0) | ||
75 | break; | ||
76 | } | ||
77 | |||
78 | return best_v << 8 | best_r; | ||
79 | } | ||
80 | |||
81 | static inline void | ||
82 | acornfb_vidc20_find_rates(struct vidc_timing *vidc, | ||
83 | struct fb_var_screeninfo *var) | ||
84 | { | ||
85 | u_int div; | ||
86 | |||
87 | /* Select pixel-clock divisor to keep PLL in range */ | ||
88 | div = var->pixclock / 9090; /*9921*/ | ||
89 | |||
90 | /* Limit divisor */ | ||
91 | if (div == 0) | ||
92 | div = 1; | ||
93 | if (div > 8) | ||
94 | div = 8; | ||
95 | |||
96 | /* Encode divisor to VIDC20 setting */ | ||
97 | switch (div) { | ||
98 | case 1: vidc->control |= VIDC20_CTRL_PIX_CK; break; | ||
99 | case 2: vidc->control |= VIDC20_CTRL_PIX_CK2; break; | ||
100 | case 3: vidc->control |= VIDC20_CTRL_PIX_CK3; break; | ||
101 | case 4: vidc->control |= VIDC20_CTRL_PIX_CK4; break; | ||
102 | case 5: vidc->control |= VIDC20_CTRL_PIX_CK5; break; | ||
103 | case 6: vidc->control |= VIDC20_CTRL_PIX_CK6; break; | ||
104 | case 7: vidc->control |= VIDC20_CTRL_PIX_CK7; break; | ||
105 | case 8: vidc->control |= VIDC20_CTRL_PIX_CK8; break; | ||
106 | } | ||
107 | |||
108 | /* | ||
109 | * With VRAM, the FIFO can be set to the highest possible setting | ||
110 | * because there are no latency considerations for other memory | ||
111 | * accesses. However, in 64 bit bus mode the FIFO preload value | ||
112 | * must not be set to VIDC20_CTRL_FIFO_28 because this will let | ||
113 | * the FIFO overflow. See VIDC20 manual page 33 (6.0 Setting the | ||
114 | * FIFO preload value). | ||
115 | */ | ||
116 | if (current_par.using_vram) { | ||
117 | if (current_par.vram_half_sam == 2048) | ||
118 | vidc->control |= VIDC20_CTRL_FIFO_24; | ||
119 | else | ||
120 | vidc->control |= VIDC20_CTRL_FIFO_28; | ||
121 | } else { | ||
122 | unsigned long bandwidth = acornfb_bandwidth(var); | ||
123 | |||
124 | /* Encode bandwidth as VIDC20 setting */ | ||
125 | if (bandwidth > 33334) /* < 30.0MB/s */ | ||
126 | vidc->control |= VIDC20_CTRL_FIFO_16; | ||
127 | else if (bandwidth > 26666) /* < 37.5MB/s */ | ||
128 | vidc->control |= VIDC20_CTRL_FIFO_20; | ||
129 | else if (bandwidth > 22222) /* < 45.0MB/s */ | ||
130 | vidc->control |= VIDC20_CTRL_FIFO_24; | ||
131 | else /* > 45.0MB/s */ | ||
132 | vidc->control |= VIDC20_CTRL_FIFO_28; | ||
133 | } | ||
134 | |||
135 | /* Find the PLL values */ | ||
136 | vidc->pll_ctl = acornfb_vidc20_find_pll(var->pixclock / div); | ||
137 | } | ||
138 | |||
139 | #define acornfb_default_control() (VIDC20_CTRL_PIX_VCLK) | ||
140 | #define acornfb_default_econtrol() (VIDC20_ECTL_DAC | VIDC20_ECTL_REG(3)) | ||
diff --git a/include/asm-arm/arch-rpc/debug-macro.S b/include/asm-arm/arch-rpc/debug-macro.S new file mode 100644 index 000000000000..0711828164cd --- /dev/null +++ b/include/asm-arm/arch-rpc/debug-macro.S | |||
@@ -0,0 +1,35 @@ | |||
1 | /* linux/include/asm-arm/arch-rpc/debug-macro.S | ||
2 | * | ||
3 | * Debugging macro include header | ||
4 | * | ||
5 | * Copyright (C) 1994-1999 Russell King | ||
6 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | .macro addruart,rx | ||
15 | mov \rx, #0xe0000000 | ||
16 | orr \rx, \rx, #0x00010000 | ||
17 | orr \rx, \rx, #0x00000fe0 | ||
18 | .endm | ||
19 | |||
20 | .macro senduart,rd,rx | ||
21 | strb \rd, [\rx] | ||
22 | .endm | ||
23 | |||
24 | .macro busyuart,rd,rx | ||
25 | 1001: ldrb \rd, [\rx, #0x14] | ||
26 | and \rd, \rd, #0x60 | ||
27 | teq \rd, #0x60 | ||
28 | bne 1001b | ||
29 | .endm | ||
30 | |||
31 | .macro waituart,rd,rx | ||
32 | 1001: ldrb \rd, [\rx, #0x18] | ||
33 | tst \rd, #0x10 | ||
34 | beq 1001b | ||
35 | .endm | ||
diff --git a/include/asm-arm/arch-rpc/dma.h b/include/asm-arm/arch-rpc/dma.h new file mode 100644 index 000000000000..d24a27e30b93 --- /dev/null +++ b/include/asm-arm/arch-rpc/dma.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-rpc/dma.h | ||
3 | * | ||
4 | * Copyright (C) 1997 Russell King | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef __ASM_ARCH_DMA_H | ||
11 | #define __ASM_ARCH_DMA_H | ||
12 | |||
13 | /* | ||
14 | * This is the maximum DMA address that can be DMAd to. | ||
15 | * There should not be more than (0xd0000000 - 0xc0000000) | ||
16 | * bytes of RAM. | ||
17 | */ | ||
18 | #define MAX_DMA_ADDRESS 0xd0000000 | ||
19 | #define MAX_DMA_CHANNELS 8 | ||
20 | |||
21 | #define DMA_0 0 | ||
22 | #define DMA_1 1 | ||
23 | #define DMA_2 2 | ||
24 | #define DMA_3 3 | ||
25 | #define DMA_S0 4 | ||
26 | #define DMA_S1 5 | ||
27 | #define DMA_VIRTUAL_FLOPPY 6 | ||
28 | #define DMA_VIRTUAL_SOUND 7 | ||
29 | |||
30 | #define DMA_FLOPPY DMA_VIRTUAL_FLOPPY | ||
31 | |||
32 | #endif /* _ASM_ARCH_DMA_H */ | ||
33 | |||
diff --git a/include/asm-arm/arch-rpc/entry-macro.S b/include/asm-arm/arch-rpc/entry-macro.S new file mode 100644 index 000000000000..686f413f82d6 --- /dev/null +++ b/include/asm-arm/arch-rpc/entry-macro.S | |||
@@ -0,0 +1,3 @@ | |||
1 | |||
2 | #include <asm/hardware/entry-macro-iomd.S> | ||
3 | |||
diff --git a/include/asm-arm/arch-rpc/hardware.h b/include/asm-arm/arch-rpc/hardware.h new file mode 100644 index 000000000000..be9754a05c19 --- /dev/null +++ b/include/asm-arm/arch-rpc/hardware.h | |||
@@ -0,0 +1,86 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-rpc/hardware.h | ||
3 | * | ||
4 | * Copyright (C) 1996-1999 Russell King. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * This file contains the hardware definitions of the RiscPC series machines. | ||
11 | */ | ||
12 | #ifndef __ASM_ARCH_HARDWARE_H | ||
13 | #define __ASM_ARCH_HARDWARE_H | ||
14 | |||
15 | #include <asm/arch/memory.h> | ||
16 | |||
17 | #ifndef __ASSEMBLY__ | ||
18 | #define IOMEM(x) ((void __iomem *)(x)) | ||
19 | #else | ||
20 | #define IOMEM(x) x | ||
21 | #endif /* __ASSEMBLY__ */ | ||
22 | |||
23 | /* | ||
24 | * What hardware must be present | ||
25 | */ | ||
26 | #define HAS_IOMD | ||
27 | #define HAS_VIDC20 | ||
28 | |||
29 | /* Hardware addresses of major areas. | ||
30 | * *_START is the physical address | ||
31 | * *_SIZE is the size of the region | ||
32 | * *_BASE is the virtual address | ||
33 | */ | ||
34 | #define RAM_SIZE 0x10000000 | ||
35 | #define RAM_START 0x10000000 | ||
36 | |||
37 | #define EASI_SIZE 0x08000000 /* EASI I/O */ | ||
38 | #define EASI_START 0x08000000 | ||
39 | #define EASI_BASE 0xe5000000 | ||
40 | |||
41 | #define IO_START 0x03000000 /* I/O */ | ||
42 | #define IO_SIZE 0x01000000 | ||
43 | #define IO_BASE IOMEM(0xe0000000) | ||
44 | |||
45 | #define SCREEN_START 0x02000000 /* VRAM */ | ||
46 | #define SCREEN_END 0xdfc00000 | ||
47 | #define SCREEN_BASE 0xdf800000 | ||
48 | |||
49 | #define FLUSH_BASE 0xdf000000 | ||
50 | #define UNCACHEABLE_ADDR 0xdf010000 | ||
51 | |||
52 | /* | ||
53 | * IO Addresses | ||
54 | */ | ||
55 | #define VIDC_BASE (void __iomem *)0xe0400000 | ||
56 | #define EXPMASK_BASE 0xe0360000 | ||
57 | #define IOMD_BASE IOMEM(0xe0200000) | ||
58 | #define IOC_BASE IOMEM(0xe0200000) | ||
59 | #define PCIO_BASE IOMEM(0xe0010000) | ||
60 | #define FLOPPYDMA_BASE IOMEM(0xe002a000) | ||
61 | |||
62 | #define FLUSH_BASE_PHYS 0x00000000 /* ROM */ | ||
63 | |||
64 | #define vidc_writel(val) __raw_writel(val, VIDC_BASE) | ||
65 | |||
66 | #define IO_EC_EASI_BASE 0x81400000 | ||
67 | #define IO_EC_IOC4_BASE 0x8009c000 | ||
68 | #define IO_EC_IOC_BASE 0x80090000 | ||
69 | #define IO_EC_MEMC8_BASE 0x8000ac00 | ||
70 | #define IO_EC_MEMC_BASE 0x80000000 | ||
71 | |||
72 | #define NETSLOT_BASE 0x0302b000 | ||
73 | #define NETSLOT_SIZE 0x00001000 | ||
74 | |||
75 | #define PODSLOT_IOC0_BASE 0x03240000 | ||
76 | #define PODSLOT_IOC4_BASE 0x03270000 | ||
77 | #define PODSLOT_IOC_SIZE (1 << 14) | ||
78 | #define PODSLOT_MEMC_BASE 0x03000000 | ||
79 | #define PODSLOT_MEMC_SIZE (1 << 14) | ||
80 | #define PODSLOT_EASI_BASE 0x08000000 | ||
81 | #define PODSLOT_EASI_SIZE (1 << 24) | ||
82 | |||
83 | #define EXPMASK_STATUS (EXPMASK_BASE + 0x00) | ||
84 | #define EXPMASK_ENABLE (EXPMASK_BASE + 0x04) | ||
85 | |||
86 | #endif | ||
diff --git a/include/asm-arm/arch-rpc/io.h b/include/asm-arm/arch-rpc/io.h new file mode 100644 index 000000000000..24453c405a87 --- /dev/null +++ b/include/asm-arm/arch-rpc/io.h | |||
@@ -0,0 +1,257 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-rpc/io.h | ||
3 | * | ||
4 | * Copyright (C) 1997 Russell King | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * Modifications: | ||
11 | * 06-Dec-1997 RMK Created. | ||
12 | */ | ||
13 | #ifndef __ASM_ARM_ARCH_IO_H | ||
14 | #define __ASM_ARM_ARCH_IO_H | ||
15 | |||
16 | #define IO_SPACE_LIMIT 0xffffffff | ||
17 | |||
18 | /* | ||
19 | * GCC is totally crap at loading/storing data. We try to persuade it | ||
20 | * to do the right thing by using these whereever possible instead of | ||
21 | * the above. | ||
22 | */ | ||
23 | #define __arch_base_getb(b,o) \ | ||
24 | ({ \ | ||
25 | unsigned int __v, __r = (b); \ | ||
26 | __asm__ __volatile__( \ | ||
27 | "ldrb %0, [%1, %2]" \ | ||
28 | : "=r" (__v) \ | ||
29 | : "r" (__r), "Ir" (o)); \ | ||
30 | __v; \ | ||
31 | }) | ||
32 | |||
33 | #define __arch_base_getl(b,o) \ | ||
34 | ({ \ | ||
35 | unsigned int __v, __r = (b); \ | ||
36 | __asm__ __volatile__( \ | ||
37 | "ldr %0, [%1, %2]" \ | ||
38 | : "=r" (__v) \ | ||
39 | : "r" (__r), "Ir" (o)); \ | ||
40 | __v; \ | ||
41 | }) | ||
42 | |||
43 | #define __arch_base_putb(v,b,o) \ | ||
44 | ({ \ | ||
45 | unsigned int __r = (b); \ | ||
46 | __asm__ __volatile__( \ | ||
47 | "strb %0, [%1, %2]" \ | ||
48 | : \ | ||
49 | : "r" (v), "r" (__r), "Ir" (o));\ | ||
50 | }) | ||
51 | |||
52 | #define __arch_base_putl(v,b,o) \ | ||
53 | ({ \ | ||
54 | unsigned int __r = (b); \ | ||
55 | __asm__ __volatile__( \ | ||
56 | "str %0, [%1, %2]" \ | ||
57 | : \ | ||
58 | : "r" (v), "r" (__r), "Ir" (o));\ | ||
59 | }) | ||
60 | |||
61 | /* | ||
62 | * We use two different types of addressing - PC style addresses, and ARM | ||
63 | * addresses. PC style accesses the PC hardware with the normal PC IO | ||
64 | * addresses, eg 0x3f8 for serial#1. ARM addresses are 0x80000000+ | ||
65 | * and are translated to the start of IO. Note that all addresses are | ||
66 | * shifted left! | ||
67 | */ | ||
68 | #define __PORT_PCIO(x) (!((x) & 0x80000000)) | ||
69 | |||
70 | /* | ||
71 | * Dynamic IO functions. | ||
72 | */ | ||
73 | static inline void __outb (unsigned int value, unsigned int port) | ||
74 | { | ||
75 | unsigned long temp; | ||
76 | __asm__ __volatile__( | ||
77 | "tst %2, #0x80000000\n\t" | ||
78 | "mov %0, %4\n\t" | ||
79 | "addeq %0, %0, %3\n\t" | ||
80 | "strb %1, [%0, %2, lsl #2] @ outb" | ||
81 | : "=&r" (temp) | ||
82 | : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) | ||
83 | : "cc"); | ||
84 | } | ||
85 | |||
86 | static inline void __outw (unsigned int value, unsigned int port) | ||
87 | { | ||
88 | unsigned long temp; | ||
89 | __asm__ __volatile__( | ||
90 | "tst %2, #0x80000000\n\t" | ||
91 | "mov %0, %4\n\t" | ||
92 | "addeq %0, %0, %3\n\t" | ||
93 | "str %1, [%0, %2, lsl #2] @ outw" | ||
94 | : "=&r" (temp) | ||
95 | : "r" (value|value<<16), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) | ||
96 | : "cc"); | ||
97 | } | ||
98 | |||
99 | static inline void __outl (unsigned int value, unsigned int port) | ||
100 | { | ||
101 | unsigned long temp; | ||
102 | __asm__ __volatile__( | ||
103 | "tst %2, #0x80000000\n\t" | ||
104 | "mov %0, %4\n\t" | ||
105 | "addeq %0, %0, %3\n\t" | ||
106 | "str %1, [%0, %2, lsl #2] @ outl" | ||
107 | : "=&r" (temp) | ||
108 | : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) | ||
109 | : "cc"); | ||
110 | } | ||
111 | |||
112 | #define DECLARE_DYN_IN(sz,fnsuffix,instr) \ | ||
113 | static inline unsigned sz __in##fnsuffix (unsigned int port) \ | ||
114 | { \ | ||
115 | unsigned long temp, value; \ | ||
116 | __asm__ __volatile__( \ | ||
117 | "tst %2, #0x80000000\n\t" \ | ||
118 | "mov %0, %4\n\t" \ | ||
119 | "addeq %0, %0, %3\n\t" \ | ||
120 | "ldr" instr " %1, [%0, %2, lsl #2] @ in" #fnsuffix \ | ||
121 | : "=&r" (temp), "=r" (value) \ | ||
122 | : "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \ | ||
123 | : "cc"); \ | ||
124 | return (unsigned sz)value; \ | ||
125 | } | ||
126 | |||
127 | static inline void __iomem *__ioaddr(unsigned int port) | ||
128 | { | ||
129 | void __iomem *ret; | ||
130 | if (__PORT_PCIO(port)) | ||
131 | ret = PCIO_BASE; | ||
132 | else | ||
133 | ret = IO_BASE; | ||
134 | return ret + (port << 2); | ||
135 | } | ||
136 | |||
137 | #define DECLARE_IO(sz,fnsuffix,instr) \ | ||
138 | DECLARE_DYN_IN(sz,fnsuffix,instr) | ||
139 | |||
140 | DECLARE_IO(char,b,"b") | ||
141 | DECLARE_IO(short,w,"") | ||
142 | DECLARE_IO(int,l,"") | ||
143 | |||
144 | #undef DECLARE_IO | ||
145 | #undef DECLARE_DYN_IN | ||
146 | |||
147 | /* | ||
148 | * Constant address IO functions | ||
149 | * | ||
150 | * These have to be macros for the 'J' constraint to work - | ||
151 | * +/-4096 immediate operand. | ||
152 | */ | ||
153 | #define __outbc(value,port) \ | ||
154 | ({ \ | ||
155 | if (__PORT_PCIO((port))) \ | ||
156 | __asm__ __volatile__( \ | ||
157 | "strb %0, [%1, %2] @ outbc" \ | ||
158 | : : "r" (value), "r" (PCIO_BASE), "Jr" ((port) << 2)); \ | ||
159 | else \ | ||
160 | __asm__ __volatile__( \ | ||
161 | "strb %0, [%1, %2] @ outbc" \ | ||
162 | : : "r" (value), "r" (IO_BASE), "r" ((port) << 2)); \ | ||
163 | }) | ||
164 | |||
165 | #define __inbc(port) \ | ||
166 | ({ \ | ||
167 | unsigned char result; \ | ||
168 | if (__PORT_PCIO((port))) \ | ||
169 | __asm__ __volatile__( \ | ||
170 | "ldrb %0, [%1, %2] @ inbc" \ | ||
171 | : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \ | ||
172 | else \ | ||
173 | __asm__ __volatile__( \ | ||
174 | "ldrb %0, [%1, %2] @ inbc" \ | ||
175 | : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \ | ||
176 | result; \ | ||
177 | }) | ||
178 | |||
179 | #define __outwc(value,port) \ | ||
180 | ({ \ | ||
181 | unsigned long __v = value; \ | ||
182 | if (__PORT_PCIO((port))) \ | ||
183 | __asm__ __volatile__( \ | ||
184 | "str %0, [%1, %2] @ outwc" \ | ||
185 | : : "r" (__v|__v<<16), "r" (PCIO_BASE), "Jr" ((port) << 2)); \ | ||
186 | else \ | ||
187 | __asm__ __volatile__( \ | ||
188 | "str %0, [%1, %2] @ outwc" \ | ||
189 | : : "r" (__v|__v<<16), "r" (IO_BASE), "r" ((port) << 2)); \ | ||
190 | }) | ||
191 | |||
192 | #define __inwc(port) \ | ||
193 | ({ \ | ||
194 | unsigned short result; \ | ||
195 | if (__PORT_PCIO((port))) \ | ||
196 | __asm__ __volatile__( \ | ||
197 | "ldr %0, [%1, %2] @ inwc" \ | ||
198 | : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \ | ||
199 | else \ | ||
200 | __asm__ __volatile__( \ | ||
201 | "ldr %0, [%1, %2] @ inwc" \ | ||
202 | : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \ | ||
203 | result & 0xffff; \ | ||
204 | }) | ||
205 | |||
206 | #define __outlc(value,port) \ | ||
207 | ({ \ | ||
208 | unsigned long __v = value; \ | ||
209 | if (__PORT_PCIO((port))) \ | ||
210 | __asm__ __volatile__( \ | ||
211 | "str %0, [%1, %2] @ outlc" \ | ||
212 | : : "r" (__v), "r" (PCIO_BASE), "Jr" ((port) << 2)); \ | ||
213 | else \ | ||
214 | __asm__ __volatile__( \ | ||
215 | "str %0, [%1, %2] @ outlc" \ | ||
216 | : : "r" (__v), "r" (IO_BASE), "r" ((port) << 2)); \ | ||
217 | }) | ||
218 | |||
219 | #define __inlc(port) \ | ||
220 | ({ \ | ||
221 | unsigned long result; \ | ||
222 | if (__PORT_PCIO((port))) \ | ||
223 | __asm__ __volatile__( \ | ||
224 | "ldr %0, [%1, %2] @ inlc" \ | ||
225 | : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \ | ||
226 | else \ | ||
227 | __asm__ __volatile__( \ | ||
228 | "ldr %0, [%1, %2] @ inlc" \ | ||
229 | : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \ | ||
230 | result; \ | ||
231 | }) | ||
232 | |||
233 | #define __ioaddrc(port) \ | ||
234 | ((__PORT_PCIO(port) ? PCIO_BASE : IO_BASE) + ((port) << 2)) | ||
235 | |||
236 | #define inb(p) (__builtin_constant_p((p)) ? __inbc(p) : __inb(p)) | ||
237 | #define inw(p) (__builtin_constant_p((p)) ? __inwc(p) : __inw(p)) | ||
238 | #define inl(p) (__builtin_constant_p((p)) ? __inlc(p) : __inl(p)) | ||
239 | #define outb(v,p) (__builtin_constant_p((p)) ? __outbc(v,p) : __outb(v,p)) | ||
240 | #define outw(v,p) (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p)) | ||
241 | #define outl(v,p) (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p)) | ||
242 | #define __ioaddr(p) (__builtin_constant_p((p)) ? __ioaddr(p) : __ioaddrc(p)) | ||
243 | /* the following macro is deprecated */ | ||
244 | #define ioaddr(port) ((unsigned long)__ioaddr((port))) | ||
245 | |||
246 | #define insb(p,d,l) __raw_readsb(__ioaddr(p),d,l) | ||
247 | #define insw(p,d,l) __raw_readsw(__ioaddr(p),d,l) | ||
248 | |||
249 | #define outsb(p,d,l) __raw_writesb(__ioaddr(p),d,l) | ||
250 | #define outsw(p,d,l) __raw_writesw(__ioaddr(p),d,l) | ||
251 | |||
252 | /* | ||
253 | * 1:1 mapping for ioremapped regions. | ||
254 | */ | ||
255 | #define __mem_pci(x) (x) | ||
256 | |||
257 | #endif | ||
diff --git a/include/asm-arm/arch-rpc/irqs.h b/include/asm-arm/arch-rpc/irqs.h new file mode 100644 index 000000000000..27c35b05b27d --- /dev/null +++ b/include/asm-arm/arch-rpc/irqs.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-rpc/irqs.h | ||
3 | * | ||
4 | * Copyright (C) 1996 Russell King | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #define IRQ_PRINTER 0 | ||
12 | #define IRQ_BATLOW 1 | ||
13 | #define IRQ_FLOPPYINDEX 2 | ||
14 | #define IRQ_VSYNCPULSE 3 | ||
15 | #define IRQ_POWERON 4 | ||
16 | #define IRQ_TIMER0 5 | ||
17 | #define IRQ_TIMER1 6 | ||
18 | #define IRQ_IMMEDIATE 7 | ||
19 | #define IRQ_EXPCARDFIQ 8 | ||
20 | #define IRQ_HARDDISK 9 | ||
21 | #define IRQ_SERIALPORT 10 | ||
22 | #define IRQ_FLOPPYDISK 12 | ||
23 | #define IRQ_EXPANSIONCARD 13 | ||
24 | #define IRQ_KEYBOARDTX 14 | ||
25 | #define IRQ_KEYBOARDRX 15 | ||
26 | |||
27 | #define IRQ_DMA0 16 | ||
28 | #define IRQ_DMA1 17 | ||
29 | #define IRQ_DMA2 18 | ||
30 | #define IRQ_DMA3 19 | ||
31 | #define IRQ_DMAS0 20 | ||
32 | #define IRQ_DMAS1 21 | ||
33 | |||
34 | #define FIQ_FLOPPYDATA 0 | ||
35 | #define FIQ_ECONET 2 | ||
36 | #define FIQ_SERIALPORT 4 | ||
37 | #define FIQ_EXPANSIONCARD 6 | ||
38 | #define FIQ_FORCE 7 | ||
39 | |||
40 | /* | ||
41 | * This is the offset of the FIQ "IRQ" numbers | ||
42 | */ | ||
43 | #define FIQ_START 64 | ||
44 | |||
45 | #define IRQ_TIMER IRQ_TIMER0 | ||
46 | |||
diff --git a/include/asm-arm/arch-rpc/memory.h b/include/asm-arm/arch-rpc/memory.h new file mode 100644 index 000000000000..33fc75cdead0 --- /dev/null +++ b/include/asm-arm/arch-rpc/memory.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-rpc/memory.h | ||
3 | * | ||
4 | * Copyright (C) 1996,1997,1998 Russell King. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * Changelog: | ||
11 | * 20-Oct-1996 RMK Created | ||
12 | * 31-Dec-1997 RMK Fixed definitions to reduce warnings | ||
13 | * 11-Jan-1998 RMK Uninlined to reduce hits on cache | ||
14 | * 08-Feb-1998 RMK Added __virt_to_bus and __bus_to_virt | ||
15 | * 21-Mar-1999 RMK Renamed to memory.h | ||
16 | * RMK Added TASK_SIZE and PAGE_OFFSET | ||
17 | */ | ||
18 | #ifndef __ASM_ARCH_MEMORY_H | ||
19 | #define __ASM_ARCH_MEMORY_H | ||
20 | |||
21 | /* | ||
22 | * Physical DRAM offset. | ||
23 | */ | ||
24 | #define PHYS_OFFSET (0x10000000UL) | ||
25 | |||
26 | /* | ||
27 | * These are exactly the same on the RiscPC as the | ||
28 | * physical memory view. | ||
29 | */ | ||
30 | #define __virt_to_bus(x) __virt_to_phys(x) | ||
31 | #define __bus_to_virt(x) __phys_to_virt(x) | ||
32 | |||
33 | #endif | ||
diff --git a/include/asm-arm/arch-rpc/param.h b/include/asm-arm/arch-rpc/param.h new file mode 100644 index 000000000000..721dcd658858 --- /dev/null +++ b/include/asm-arm/arch-rpc/param.h | |||
@@ -0,0 +1,3 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-rpc/param.h | ||
3 | */ | ||
diff --git a/include/asm-arm/arch-rpc/system.h b/include/asm-arm/arch-rpc/system.h new file mode 100644 index 000000000000..ca3277d1d5ea --- /dev/null +++ b/include/asm-arm/arch-rpc/system.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-rpc/system.h | ||
3 | * | ||
4 | * Copyright (C) 1996-1999 Russell King. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #include <asm/arch/hardware.h> | ||
11 | #include <asm/hardware/iomd.h> | ||
12 | #include <asm/io.h> | ||
13 | |||
14 | static inline void arch_idle(void) | ||
15 | { | ||
16 | cpu_do_idle(); | ||
17 | } | ||
18 | |||
19 | static inline void arch_reset(char mode) | ||
20 | { | ||
21 | iomd_writeb(0, IOMD_ROMCR0); | ||
22 | |||
23 | /* | ||
24 | * Jump into the ROM | ||
25 | */ | ||
26 | cpu_reset(0); | ||
27 | } | ||
diff --git a/include/asm-arm/arch-rpc/timex.h b/include/asm-arm/arch-rpc/timex.h new file mode 100644 index 000000000000..ed7df64d960b --- /dev/null +++ b/include/asm-arm/arch-rpc/timex.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-rpc/timex.h | ||
3 | * | ||
4 | * Copyright (C) 1997, 1998 Russell King | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * RiscPC architecture timex specifications | ||
11 | */ | ||
12 | |||
13 | /* | ||
14 | * On the RiscPC, the clock ticks at 2MHz. | ||
15 | */ | ||
16 | #define CLOCK_TICK_RATE 2000000 | ||
17 | |||
diff --git a/include/asm-arm/arch-rpc/uncompress.h b/include/asm-arm/arch-rpc/uncompress.h new file mode 100644 index 000000000000..43035fec64d2 --- /dev/null +++ b/include/asm-arm/arch-rpc/uncompress.h | |||
@@ -0,0 +1,155 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-rpc/uncompress.h | ||
3 | * | ||
4 | * Copyright (C) 1996 Russell King | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #define VIDMEM ((char *)SCREEN_START) | ||
11 | |||
12 | #include <asm/hardware.h> | ||
13 | #include <asm/io.h> | ||
14 | |||
15 | int video_num_columns, video_num_lines, video_size_row; | ||
16 | int white, bytes_per_char_h; | ||
17 | extern unsigned long con_charconvtable[256]; | ||
18 | |||
19 | struct param_struct { | ||
20 | unsigned long page_size; | ||
21 | unsigned long nr_pages; | ||
22 | unsigned long ramdisk_size; | ||
23 | unsigned long mountrootrdonly; | ||
24 | unsigned long rootdev; | ||
25 | unsigned long video_num_cols; | ||
26 | unsigned long video_num_rows; | ||
27 | unsigned long video_x; | ||
28 | unsigned long video_y; | ||
29 | unsigned long memc_control_reg; | ||
30 | unsigned char sounddefault; | ||
31 | unsigned char adfsdrives; | ||
32 | unsigned char bytes_per_char_h; | ||
33 | unsigned char bytes_per_char_v; | ||
34 | unsigned long unused[256/4-11]; | ||
35 | }; | ||
36 | |||
37 | static const unsigned long palette_4[16] = { | ||
38 | 0x00000000, | ||
39 | 0x000000cc, | ||
40 | 0x0000cc00, /* Green */ | ||
41 | 0x0000cccc, /* Yellow */ | ||
42 | 0x00cc0000, /* Blue */ | ||
43 | 0x00cc00cc, /* Magenta */ | ||
44 | 0x00cccc00, /* Cyan */ | ||
45 | 0x00cccccc, /* White */ | ||
46 | 0x00000000, | ||
47 | 0x000000ff, | ||
48 | 0x0000ff00, | ||
49 | 0x0000ffff, | ||
50 | 0x00ff0000, | ||
51 | 0x00ff00ff, | ||
52 | 0x00ffff00, | ||
53 | 0x00ffffff | ||
54 | }; | ||
55 | |||
56 | #define palette_setpixel(p) *(unsigned long *)(IO_START+0x00400000) = 0x10000000|((p) & 255) | ||
57 | #define palette_write(v) *(unsigned long *)(IO_START+0x00400000) = 0x00000000|((v) & 0x00ffffff) | ||
58 | |||
59 | /* | ||
60 | * params_phys is a linker defined symbol - see | ||
61 | * arch/arm/boot/compressed/Makefile | ||
62 | */ | ||
63 | extern __attribute__((pure)) struct param_struct *params(void); | ||
64 | #define params (params()) | ||
65 | |||
66 | #ifndef STANDALONE_DEBUG | ||
67 | /* | ||
68 | * This does not append a newline | ||
69 | */ | ||
70 | static void putstr(const char *s) | ||
71 | { | ||
72 | extern void ll_write_char(char *, char c, char white); | ||
73 | int x,y; | ||
74 | unsigned char c; | ||
75 | char *ptr; | ||
76 | |||
77 | x = params->video_x; | ||
78 | y = params->video_y; | ||
79 | |||
80 | while ( ( c = *(unsigned char *)s++ ) != '\0' ) { | ||
81 | if ( c == '\n' ) { | ||
82 | x = 0; | ||
83 | if ( ++y >= video_num_lines ) { | ||
84 | y--; | ||
85 | } | ||
86 | } else { | ||
87 | ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h); | ||
88 | ll_write_char(ptr, c, white); | ||
89 | if ( ++x >= video_num_columns ) { | ||
90 | x = 0; | ||
91 | if ( ++y >= video_num_lines ) { | ||
92 | y--; | ||
93 | } | ||
94 | } | ||
95 | } | ||
96 | } | ||
97 | |||
98 | params->video_x = x; | ||
99 | params->video_y = y; | ||
100 | } | ||
101 | |||
102 | static void error(char *x); | ||
103 | |||
104 | /* | ||
105 | * Setup for decompression | ||
106 | */ | ||
107 | static void arch_decomp_setup(void) | ||
108 | { | ||
109 | int i; | ||
110 | |||
111 | video_num_lines = params->video_num_rows; | ||
112 | video_num_columns = params->video_num_cols; | ||
113 | bytes_per_char_h = params->bytes_per_char_h; | ||
114 | video_size_row = video_num_columns * bytes_per_char_h; | ||
115 | if (bytes_per_char_h == 4) | ||
116 | for (i = 0; i < 256; i++) | ||
117 | con_charconvtable[i] = | ||
118 | (i & 128 ? 1 << 0 : 0) | | ||
119 | (i & 64 ? 1 << 4 : 0) | | ||
120 | (i & 32 ? 1 << 8 : 0) | | ||
121 | (i & 16 ? 1 << 12 : 0) | | ||
122 | (i & 8 ? 1 << 16 : 0) | | ||
123 | (i & 4 ? 1 << 20 : 0) | | ||
124 | (i & 2 ? 1 << 24 : 0) | | ||
125 | (i & 1 ? 1 << 28 : 0); | ||
126 | else | ||
127 | for (i = 0; i < 16; i++) | ||
128 | con_charconvtable[i] = | ||
129 | (i & 8 ? 1 << 0 : 0) | | ||
130 | (i & 4 ? 1 << 8 : 0) | | ||
131 | (i & 2 ? 1 << 16 : 0) | | ||
132 | (i & 1 ? 1 << 24 : 0); | ||
133 | |||
134 | |||
135 | palette_setpixel(0); | ||
136 | if (bytes_per_char_h == 1) { | ||
137 | palette_write (0); | ||
138 | palette_write (0x00ffffff); | ||
139 | for (i = 2; i < 256; i++) | ||
140 | palette_write (0); | ||
141 | white = 1; | ||
142 | } else { | ||
143 | for (i = 0; i < 256; i++) | ||
144 | palette_write (i < 16 ? palette_4[i] : 0); | ||
145 | white = 7; | ||
146 | } | ||
147 | |||
148 | if (params->nr_pages * params->page_size < 4096*1024) error("<4M of mem\n"); | ||
149 | } | ||
150 | #endif | ||
151 | |||
152 | /* | ||
153 | * nothing to do | ||
154 | */ | ||
155 | #define arch_decomp_wdog() | ||
diff --git a/include/asm-arm/arch-rpc/vmalloc.h b/include/asm-arm/arch-rpc/vmalloc.h new file mode 100644 index 000000000000..a13c27f37d71 --- /dev/null +++ b/include/asm-arm/arch-rpc/vmalloc.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-rpc/vmalloc.h | ||
3 | * | ||
4 | * Copyright (C) 1997 Russell King | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | /* | ||
12 | * Just any arbitrary offset to the start of the vmalloc VM area: the | ||
13 | * current 8MB value just means that there will be a 8MB "hole" after the | ||
14 | * physical memory until the kernel virtual memory starts. That means that | ||
15 | * any out-of-bounds memory accesses will hopefully be caught. | ||
16 | * The vmalloc() routines leaves a hole of 4kB between each vmalloced | ||
17 | * area for the same reason. ;) | ||
18 | */ | ||
19 | #define VMALLOC_OFFSET (8*1024*1024) | ||
20 | #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) | ||
21 | #define VMALLOC_END (PAGE_OFFSET + 0x1c000000) | ||