aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm')
-rw-r--r--include/asm-arm/arch-aaec2000/memory.h4
-rw-r--r--include/asm-arm/arch-iop3xx/memory.h2
-rw-r--r--include/asm-arm/arch-ixp2000/ixp2000-regs.h2
-rw-r--r--include/asm-arm/arch-ixp2000/platform.h16
-rw-r--r--include/asm-arm/arch-lh7a40x/memory.h4
-rw-r--r--include/asm-arm/arch-omap/memory.h1
-rw-r--r--include/asm-arm/arch-pxa/memory.h4
-rw-r--r--include/asm-arm/arch-pxa/poodle.h25
-rw-r--r--include/asm-arm/arch-sa1100/memory.h4
-rw-r--r--include/asm-arm/memory.h15
10 files changed, 37 insertions, 40 deletions
diff --git a/include/asm-arm/arch-aaec2000/memory.h b/include/asm-arm/arch-aaec2000/memory.h
index 681b6a6171a1..79c90813bc3e 100644
--- a/include/asm-arm/arch-aaec2000/memory.h
+++ b/include/asm-arm/arch-aaec2000/memory.h
@@ -64,10 +64,6 @@
64#define NODE_MAX_MEM_SHIFT 26 64#define NODE_MAX_MEM_SHIFT 26
65#define NODE_MAX_MEM_SIZE (1 << NODE_MAX_MEM_SHIFT) 65#define NODE_MAX_MEM_SIZE (1 << NODE_MAX_MEM_SHIFT)
66 66
67#else
68
69#define PFN_TO_NID(addr) (0)
70
71#endif /* CONFIG_DISCONTIGMEM */ 67#endif /* CONFIG_DISCONTIGMEM */
72 68
73#endif /* __ASM_ARCH_MEMORY_H */ 69#endif /* __ASM_ARCH_MEMORY_H */
diff --git a/include/asm-arm/arch-iop3xx/memory.h b/include/asm-arm/arch-iop3xx/memory.h
index dc4735cb0c10..45351f5cd904 100644
--- a/include/asm-arm/arch-iop3xx/memory.h
+++ b/include/asm-arm/arch-iop3xx/memory.h
@@ -36,6 +36,4 @@
36 36
37#endif 37#endif
38 38
39#define PFN_TO_NID(addr) (0)
40
41#endif 39#endif
diff --git a/include/asm-arm/arch-ixp2000/ixp2000-regs.h b/include/asm-arm/arch-ixp2000/ixp2000-regs.h
index 75623f81ef75..32aece069869 100644
--- a/include/asm-arm/arch-ixp2000/ixp2000-regs.h
+++ b/include/asm-arm/arch-ixp2000/ixp2000-regs.h
@@ -370,8 +370,6 @@
370#define GLOBAL_REG_BASE (IXP2000_GLOBAL_REG_VIRT_BASE + 0x0a00) 370#define GLOBAL_REG_BASE (IXP2000_GLOBAL_REG_VIRT_BASE + 0x0a00)
371#define GLOBAL_REG(x) (volatile unsigned long*)(GLOBAL_REG_BASE | (x)) 371#define GLOBAL_REG(x) (volatile unsigned long*)(GLOBAL_REG_BASE | (x))
372 372
373#define IXP2000_PROD_ID GLOBAL_REG(0x00)
374
375#define IXP2000_MAJ_PROD_TYPE_MASK 0x001F0000 373#define IXP2000_MAJ_PROD_TYPE_MASK 0x001F0000
376#define IXP2000_MAJ_PROD_TYPE_IXP2000 0x00000000 374#define IXP2000_MAJ_PROD_TYPE_IXP2000 0x00000000
377#define IXP2000_MIN_PROD_TYPE_MASK 0x0000FF00 375#define IXP2000_MIN_PROD_TYPE_MASK 0x0000FF00
diff --git a/include/asm-arm/arch-ixp2000/platform.h b/include/asm-arm/arch-ixp2000/platform.h
index c0caf3e3e6fd..abdcf51bd283 100644
--- a/include/asm-arm/arch-ixp2000/platform.h
+++ b/include/asm-arm/arch-ixp2000/platform.h
@@ -31,20 +31,24 @@
31 31
32#include <asm/system.h> /* Pickup local_irq_ functions */ 32#include <asm/system.h> /* Pickup local_irq_ functions */
33 33
34static inline void ixp2000_reg_write(volatile unsigned long *reg, unsigned long val) 34static inline void ixp2000_reg_write(volatile void *reg, unsigned long val)
35{ 35{
36 volatile unsigned long dummy; 36 unsigned long dummy;
37 unsigned long flags; 37 unsigned long flags;
38 38
39 local_irq_save(flags); 39 local_irq_save(flags);
40 *reg = val; 40 *((volatile unsigned long *)reg) = val;
41 barrier(); 41 barrier();
42 dummy = *reg; 42 dummy = *((volatile unsigned long *)reg);
43 local_irq_restore(flags); 43 local_irq_restore(flags);
44} 44}
45#else 45#else
46#define ixp2000_reg_write(reg, val) (*reg = val) 46static inline void ixp2000_reg_write(volatile void *reg, unsigned long val)
47{
48 *((volatile unsigned long *)reg) = val;
49}
47#endif /* IXDP2400 || IXDP2401 */ 50#endif /* IXDP2400 || IXDP2401 */
51#define ixp2000_reg_read(reg) (*((volatile unsigned long *)reg))
48 52
49/* 53/*
50 * Boards may multiplex different devices on the 2nd channel of 54 * Boards may multiplex different devices on the 2nd channel of
@@ -84,7 +88,7 @@ void ixp2000_release_slowport(struct slowport_cfg *);
84 */ 88 */
85static inline unsigned ixp2000_has_broken_slowport(void) 89static inline unsigned ixp2000_has_broken_slowport(void)
86{ 90{
87 unsigned long id = *IXP2000_PROD_ID; 91 unsigned long id = *IXP2000_PRODUCT_ID;
88 unsigned long id_prod = id & (IXP2000_MAJ_PROD_TYPE_MASK | 92 unsigned long id_prod = id & (IXP2000_MAJ_PROD_TYPE_MASK |
89 IXP2000_MIN_PROD_TYPE_MASK); 93 IXP2000_MIN_PROD_TYPE_MASK);
90 return (((id_prod == 94 return (((id_prod ==
diff --git a/include/asm-arm/arch-lh7a40x/memory.h b/include/asm-arm/arch-lh7a40x/memory.h
index 7e2fea372663..c650e6feb9d5 100644
--- a/include/asm-arm/arch-lh7a40x/memory.h
+++ b/include/asm-arm/arch-lh7a40x/memory.h
@@ -85,10 +85,6 @@
85 (((unsigned long)(addr) & 0x01ffffff) >> PAGE_SHIFT) 85 (((unsigned long)(addr) & 0x01ffffff) >> PAGE_SHIFT)
86# endif 86# endif
87 87
88#else
89
90# define PFN_TO_NID(addr) (0)
91
92#endif 88#endif
93 89
94#endif 90#endif
diff --git a/include/asm-arm/arch-omap/memory.h b/include/asm-arm/arch-omap/memory.h
index 84f81e315a25..ef32d61eec7a 100644
--- a/include/asm-arm/arch-omap/memory.h
+++ b/include/asm-arm/arch-omap/memory.h
@@ -86,6 +86,5 @@
86 86
87#endif /* CONFIG_ARCH_OMAP1510 */ 87#endif /* CONFIG_ARCH_OMAP1510 */
88 88
89#define PHYS_TO_NID(addr) (0)
90#endif 89#endif
91 90
diff --git a/include/asm-arm/arch-pxa/memory.h b/include/asm-arm/arch-pxa/memory.h
index 217a80b820ff..58bad9748b5c 100644
--- a/include/asm-arm/arch-pxa/memory.h
+++ b/include/asm-arm/arch-pxa/memory.h
@@ -67,10 +67,6 @@
67#define LOCAL_MAP_NR(addr) \ 67#define LOCAL_MAP_NR(addr) \
68 (((unsigned long)(addr) & 0x03ffffff) >> PAGE_SHIFT) 68 (((unsigned long)(addr) & 0x03ffffff) >> PAGE_SHIFT)
69 69
70#else
71
72#define PFN_TO_NID(addr) (0)
73
74#endif 70#endif
75 71
76#endif 72#endif
diff --git a/include/asm-arm/arch-pxa/poodle.h b/include/asm-arm/arch-pxa/poodle.h
index 58bda9d571a5..6b5ac5144e70 100644
--- a/include/asm-arm/arch-pxa/poodle.h
+++ b/include/asm-arm/arch-pxa/poodle.h
@@ -37,24 +37,25 @@
37#define POODLE_GPIO_nSD_DETECT (9) 37#define POODLE_GPIO_nSD_DETECT (9)
38#define POODLE_GPIO_MAIN_BAT_LOW (13) 38#define POODLE_GPIO_MAIN_BAT_LOW (13)
39#define POODLE_GPIO_BAT_COVER (13) 39#define POODLE_GPIO_BAT_COVER (13)
40#define POODLE_GPIO_USB_PULLUP (20)
40#define POODLE_GPIO_ADC_TEMP_ON (21) 41#define POODLE_GPIO_ADC_TEMP_ON (21)
41#define POODLE_GPIO_BYPASS_ON (36) 42#define POODLE_GPIO_BYPASS_ON (36)
42#define POODLE_GPIO_CHRG_ON (38) 43#define POODLE_GPIO_CHRG_ON (38)
43#define POODLE_GPIO_CHRG_FULL (16) 44#define POODLE_GPIO_CHRG_FULL (16)
44 45
45/* PXA GPIOs */ 46/* PXA GPIOs */
46#define POODLE_IRQ_GPIO_ON_KEY IRQ_GPIO0 47#define POODLE_IRQ_GPIO_ON_KEY IRQ_GPIO(0)
47#define POODLE_IRQ_GPIO_AC_IN IRQ_GPIO1 48#define POODLE_IRQ_GPIO_AC_IN IRQ_GPIO(1)
48#define POODLE_IRQ_GPIO_HP_IN IRQ_GPIO4 49#define POODLE_IRQ_GPIO_HP_IN IRQ_GPIO(4)
49#define POODLE_IRQ_GPIO_CO IRQ_GPIO16 50#define POODLE_IRQ_GPIO_CO IRQ_GPIO(16)
50#define POODLE_IRQ_GPIO_TP_INT IRQ_GPIO5 51#define POODLE_IRQ_GPIO_TP_INT IRQ_GPIO(5)
51#define POODLE_IRQ_GPIO_WAKEUP IRQ_GPIO11 52#define POODLE_IRQ_GPIO_WAKEUP IRQ_GPIO(11)
52#define POODLE_IRQ_GPIO_GA_INT IRQ_GPIO10 53#define POODLE_IRQ_GPIO_GA_INT IRQ_GPIO(10)
53#define POODLE_IRQ_GPIO_CF_IRQ IRQ_GPIO17 54#define POODLE_IRQ_GPIO_CF_IRQ IRQ_GPIO(17)
54#define POODLE_IRQ_GPIO_CF_CD IRQ_GPIO14 55#define POODLE_IRQ_GPIO_CF_CD IRQ_GPIO(14)
55#define POODLE_IRQ_GPIO_nSD_INT IRQ_GPIO8 56#define POODLE_IRQ_GPIO_nSD_INT IRQ_GPIO(8)
56#define POODLE_IRQ_GPIO_nSD_DETECT IRQ_GPIO9 57#define POODLE_IRQ_GPIO_nSD_DETECT IRQ_GPIO(9)
57#define POODLE_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO13 58#define POODLE_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO(13)
58 59
59/* SCOOP GPIOs */ 60/* SCOOP GPIOs */
60#define POODLE_SCOOP_CHARGE_ON SCOOP_GPCR_PA11 61#define POODLE_SCOOP_CHARGE_ON SCOOP_GPCR_PA11
diff --git a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h
index 32d3d5bde34d..8743ff5c1b23 100644
--- a/include/asm-arm/arch-sa1100/memory.h
+++ b/include/asm-arm/arch-sa1100/memory.h
@@ -99,10 +99,6 @@ __arch_adjust_zones(int node, unsigned long *size, unsigned long *holes)
99#define LOCAL_MAP_NR(addr) \ 99#define LOCAL_MAP_NR(addr) \
100 (((unsigned long)(addr) & 0x07ffffff) >> PAGE_SHIFT) 100 (((unsigned long)(addr) & 0x07ffffff) >> PAGE_SHIFT)
101 101
102#else
103
104#define PFN_TO_NID(addr) (0)
105
106#endif 102#endif
107 103
108#endif 104#endif
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h
index e47bea7d1723..a8a933a775db 100644
--- a/include/asm-arm/memory.h
+++ b/include/asm-arm/memory.h
@@ -160,12 +160,25 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
160#define page_to_pfn(page) \ 160#define page_to_pfn(page) \
161 (( (page) - page_zone(page)->zone_mem_map) \ 161 (( (page) - page_zone(page)->zone_mem_map) \
162 + page_zone(page)->zone_start_pfn) 162 + page_zone(page)->zone_start_pfn)
163
163#define pfn_to_page(pfn) \ 164#define pfn_to_page(pfn) \
164 (PFN_TO_MAPBASE(pfn) + LOCAL_MAP_NR((pfn) << PAGE_SHIFT)) 165 (PFN_TO_MAPBASE(pfn) + LOCAL_MAP_NR((pfn) << PAGE_SHIFT))
165#define pfn_valid(pfn) (PFN_TO_NID(pfn) < MAX_NUMNODES) 166
167#define pfn_valid(pfn) \
168 ({ \
169 unsigned int nid = PFN_TO_NID(pfn); \
170 int valid = nid < MAX_NUMNODES; \
171 if (valid) { \
172 pg_data_t *node = NODE_DATA(nid); \
173 valid = (pfn - node->node_start_pfn) < \
174 node->node_spanned_pages; \
175 } \
176 valid; \
177 })
166 178
167#define virt_to_page(kaddr) \ 179#define virt_to_page(kaddr) \
168 (ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr)) 180 (ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr))
181
169#define virt_addr_valid(kaddr) (KVADDR_TO_NID(kaddr) < MAX_NUMNODES) 182#define virt_addr_valid(kaddr) (KVADDR_TO_NID(kaddr) < MAX_NUMNODES)
170 183
171/* 184/*