7 - support in pxa_gpio_mode for active low
10 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
13 Index: linux-2.6.21.7/arch/arm/mm/proc-xscale.S
14 ===================================================================
15 --- linux-2.6.21.7.orig/arch/arm/mm/proc-xscale.S
16 +++ linux-2.6.21.7/arch/arm/mm/proc-xscale.S
17 @@ -474,11 +474,62 @@ ENTRY(cpu_xscale_set_pte_ext)
18 movne r2, #0 @ no -> fault
20 str r2, [r0] @ hardware version
22 + @ We try to map 64K page entries when possible.
23 + @ We do that for kernel space only since the usage pattern from
24 + @ the setting of VM area is quite simple. User space is not worth
25 + @ the implied complexity because of ever randomly changing PTEs
26 + @ (page aging, swapout, etc) requiring constant coherency checks.
27 + @ Since PTEs are usually set in increasing order, we test the
28 + @ possibility for a large page only when given the last PTE of a
30 + tsteq r1, #L_PTE_USER
31 + andeq r1, r0, #(15 << 2)
32 + teqeq r1, #(15 << 2)
36 mcr p15, 0, r0, c7, c10, 1 @ Clean D cache line
37 mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
40 + @ See if we have 16 identical PTEs but with consecutive base addresses
41 +1: bic r3, r2, #0x0000f000
46 + subs r1, r1, #0x00001000
52 + @ Now create our LARGE PTE from the current EXT one.
53 + bic r3, r3, #PTE_TYPE_MASK
54 + orr r3, r3, #PTE_TYPE_LARGE
55 + and r2, r3, #0x30 @ EXT_AP --> LARGE_AP0
56 + orr r2, r2, r2, lsl #2 @ add LARGE_AP1
57 + orr r2, r2, r2, lsl #4 @ add LARGE_AP3 + LARGE_AP2
58 + and r1, r3, #0x3c0 @ EXT_TEX
60 + orr r2, r2, r1, lsl #(12 - 6) @ --> LARGE_TEX
61 + orr r2, r2, r3 @ add remaining bits
63 + @ then put it in the pagetable
69 + @ Then sync the 2 corresponding cache lines
70 + sub r0, r0, #(16 << 2)
71 + mcr p15, 0, r0, c7, c10, 1 @ Clean D cache line
72 +4: orr r0, r0, #(15 << 2)
73 + mcr p15, 0, r0, c7, c10, 1 @ Clean D cache line
75 + mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
80 Index: linux-2.6.21.7/include/asm-arm/arch-pxa/pxa-regs.h
81 ===================================================================
82 --- linux-2.6.21.7.orig/include/asm-arm/arch-pxa/pxa-regs.h
83 +++ linux-2.6.21.7/include/asm-arm/arch-pxa/pxa-regs.h
85 #define GPIO_ALT_FN_2_OUT 0x280
86 #define GPIO_ALT_FN_3_IN 0x300
87 #define GPIO_ALT_FN_3_OUT 0x380
88 +#define GPIO_ACTIVE_LOW 0x1000
89 #define GPIO_MD_MASK_NR 0x07f
90 #define GPIO_MD_MASK_DIR 0x080
91 #define GPIO_MD_MASK_FN 0x300
92 @@ -1597,6 +1598,25 @@
93 #define PWER_GPIO15 PWER_GPIO (15) /* GPIO [15] wake-up enable */
94 #define PWER_RTC 0x80000000 /* RTC alarm wake-up enable */
96 +#define PWER_GPIO(Nb) (1 << Nb) /* GPIO [0..15] wake-up enable */
97 +#define PWER_GPIO0 PWER_GPIO (0) /* GPIO [0] wake-up enable */
98 +#define PWER_GPIO1 PWER_GPIO (1) /* GPIO [1] wake-up enable */
99 +#define PWER_GPIO2 PWER_GPIO (2) /* GPIO [2] wake-up enable */
100 +#define PWER_GPIO3 PWER_GPIO (3) /* GPIO [3] wake-up enable */
101 +#define PWER_GPIO4 PWER_GPIO (4) /* GPIO [4] wake-up enable */
102 +#define PWER_GPIO5 PWER_GPIO (5) /* GPIO [5] wake-up enable */
103 +#define PWER_GPIO6 PWER_GPIO (6) /* GPIO [6] wake-up enable */
104 +#define PWER_GPIO7 PWER_GPIO (7) /* GPIO [7] wake-up enable */
105 +#define PWER_GPIO8 PWER_GPIO (8) /* GPIO [8] wake-up enable */
106 +#define PWER_GPIO9 PWER_GPIO (9) /* GPIO [9] wake-up enable */
107 +#define PWER_GPIO10 PWER_GPIO (10) /* GPIO [10] wake-up enable */
108 +#define PWER_GPIO11 PWER_GPIO (11) /* GPIO [11] wake-up enable */
109 +#define PWER_GPIO12 PWER_GPIO (12) /* GPIO [12] wake-up enable */
110 +#define PWER_GPIO13 PWER_GPIO (13) /* GPIO [13] wake-up enable */
111 +#define PWER_GPIO14 PWER_GPIO (14) /* GPIO [14] wake-up enable */
112 +#define PWER_GPIO15 PWER_GPIO (15) /* GPIO [15] wake-up enable */
113 +#define PWER_RTC 0x80000000 /* RTC alarm wake-up enable */
117 * SSP Serial Port Registers