11 #ifndef __ASM_IA64_UV_HUB_H__
12 #define __ASM_IA64_UV_HUB_H__
16 #include <asm/types.h>
17 #include <asm/percpu.h>
78 #define UV_MAX_NUMALINK_BLADES 16384
84 #define UV_MAX_SSI_BLADES 1
89 #define UV_MAX_NASID_VALUE (UV_MAX_NUMALINK_NODES * 2)
111 #define uv_hub_info (&__get_cpu_var(__uv_hub_info))
112 #define uv_cpu_hub_info(cpu) (&per_cpu(__uv_hub_info, cpu))
122 #define UV_NASID_TO_PNODE(n) (((n) >> 1) & uv_hub_info->pnode_mask)
123 #define UV_PNODE_TO_NASID(p) (((p) << 1) | uv_hub_info->gnode_upper)
125 #define UV_LOCAL_MMR_BASE 0xf4000000UL
126 #define UV_GLOBAL_MMR32_BASE 0xf8000000UL
127 #define UV_GLOBAL_MMR64_BASE (uv_hub_info->global_mmr_base)
129 #define UV_GLOBAL_MMR32_PNODE_SHIFT 15
130 #define UV_GLOBAL_MMR64_PNODE_SHIFT 26
132 #define UV_GLOBAL_MMR32_PNODE_BITS(p) ((p) << (UV_GLOBAL_MMR32_PNODE_SHIFT))
134 #define UV_GLOBAL_MMR64_PNODE_BITS(p) \
135 ((unsigned long)(p) << UV_GLOBAL_MMR64_PNODE_SHIFT)
145 static inline unsigned long uv_soc_phys_ram_to_gpa(
unsigned long paddr)
147 if (paddr < uv_hub_info->lowmem_remap_top)
154 static inline unsigned long uv_gpa(
void *
v)
160 static inline void *uv_vgpa(
void *
v)
162 return (
void *)uv_gpa(v);
166 static inline void *uv_va(
unsigned long gpa)
172 static inline void *uv_pnode_offset_to_vaddr(
int pnode,
unsigned long offset)
182 static inline unsigned long *uv_global_mmr32_address(
int pnode,
183 unsigned long offset)
189 static inline void uv_write_global_mmr32(
int pnode,
unsigned long offset,
192 *uv_global_mmr32_address(pnode, offset) =
val;
195 static inline unsigned long uv_read_global_mmr32(
int pnode,
196 unsigned long offset)
198 return *uv_global_mmr32_address(pnode, offset);
205 static inline unsigned long *uv_global_mmr64_address(
int pnode,
206 unsigned long offset)
212 static inline void uv_write_global_mmr64(
int pnode,
unsigned long offset,
215 *uv_global_mmr64_address(pnode, offset) =
val;
218 static inline unsigned long uv_read_global_mmr64(
int pnode,
219 unsigned long offset)
221 return *uv_global_mmr64_address(pnode, offset);
228 static inline unsigned long *uv_local_mmr_address(
unsigned long offset)
233 static inline unsigned long uv_read_local_mmr(
unsigned long offset)
235 return *uv_local_mmr_address(offset);
238 static inline void uv_write_local_mmr(
unsigned long offset,
unsigned long val)
240 *uv_local_mmr_address(offset) =
val;
249 static inline int uv_blade_processor_id(
void)
255 static inline int uv_numa_blade_id(
void)
261 static inline int uv_cpu_to_blade_id(
int cpu)
267 static inline int uv_node_to_blade_id(
int nid)
273 static inline int uv_blade_to_pnode(
int bid)
279 static inline int uv_blade_nr_possible_cpus(
int bid)
285 static inline int uv_blade_nr_online_cpus(
int bid)
291 static inline int uv_cpu_to_pnode(
int cpu)
297 static inline int uv_node_to_pnode(
int nid)
303 static inline int uv_num_possible_blades(
void)
308 static inline void uv_hub_send_ipi(
int pnode,
int apicid,
int vector)