This source file includes following definitions.
- nlm_get_boot_data
- nlm_set_nmi_handler
- nlm_irq_to_xirq
- nlm_cores_per_node
- nlm_threads_per_node
- nlm_hwtid_to_node
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 #ifndef _NETLOGIC_COMMON_H_
36 #define _NETLOGIC_COMMON_H_
37
38
39
40
41 #define RESET_VEC_PHYS 0x1fc00000
42 #define RESET_VEC_SIZE 8192
43 #define RESET_DATA_PHYS (RESET_VEC_PHYS + (1<<10))
44
45
46 #define BOOT_THREAD_MODE 0
47 #define BOOT_NMI_LOCK 4
48 #define BOOT_NMI_HANDLER 8
49
50
51 #define BOOT_CPU_READY 2048
52
53 #ifndef __ASSEMBLY__
54 #include <linux/cpumask.h>
55 #include <linux/spinlock.h>
56 #include <asm/irq.h>
57 #include <asm/mach-netlogic/multi-node.h>
58
59 struct irq_desc;
60 void nlm_smp_function_ipi_handler(struct irq_desc *desc);
61 void nlm_smp_resched_ipi_handler(struct irq_desc *desc);
62 void nlm_smp_irq_init(int hwcpuid);
63 void nlm_boot_secondary_cpus(void);
64 int nlm_wakeup_secondary_cpus(void);
65 void nlm_rmiboot_preboot(void);
66 void nlm_percpu_init(int hwcpuid);
67
68 static inline void *
69 nlm_get_boot_data(int offset)
70 {
71 return (void *)(CKSEG1ADDR(RESET_DATA_PHYS) + offset);
72 }
73
74 static inline void
75 nlm_set_nmi_handler(void *handler)
76 {
77 void *nmih = nlm_get_boot_data(BOOT_NMI_HANDLER);
78
79 *(int64_t *)nmih = (long)handler;
80 }
81
82
83
84
85 void nlm_init_boot_cpu(void);
86 unsigned int nlm_get_cpu_frequency(void);
87 extern const struct plat_smp_ops nlm_smp_ops;
88 extern char nlm_reset_entry[], nlm_reset_entry_end[];
89
90 extern unsigned int nlm_threads_per_core;
91 extern cpumask_t nlm_cpumask;
92
93 struct irq_data;
94 uint64_t nlm_pci_irqmask(int node);
95 void nlm_setup_pic_irq(int node, int picirq, int irq, int irt);
96 void nlm_set_pic_extra_ack(int node, int irq, void (*xack)(struct irq_data *));
97
98 #ifdef CONFIG_PCI_MSI
99 void nlm_dispatch_msi(int node, int lirq);
100 void nlm_dispatch_msix(int node, int msixirq);
101 #endif
102
103
104
105
106 static inline int nlm_irq_to_xirq(int node, int irq)
107 {
108 return node * NR_IRQS / NLM_NR_NODES + irq;
109 }
110
111 #ifdef CONFIG_CPU_XLR
112 #define nlm_cores_per_node() 8
113 #else
114 static inline int nlm_cores_per_node(void)
115 {
116 return ((read_c0_prid() & PRID_IMP_MASK)
117 == PRID_IMP_NETLOGIC_XLP9XX) ? 32 : 8;
118 }
119 #endif
120 static inline int nlm_threads_per_node(void)
121 {
122 return nlm_cores_per_node() * NLM_THREADS_PER_CORE;
123 }
124
125 static inline int nlm_hwtid_to_node(int hwtid)
126 {
127 return hwtid / nlm_threads_per_node();
128 }
129
130 extern int nlm_cpu_ready[];
131 #endif
132 #endif