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
59struct irq_desc;
60void nlm_smp_function_ipi_handler(unsigned int irq, struct irq_desc *desc);
61void nlm_smp_resched_ipi_handler(unsigned int irq, struct irq_desc *desc);
62void nlm_smp_irq_init(int hwcpuid);
63void nlm_boot_secondary_cpus(void);
64int nlm_wakeup_secondary_cpus(void);
65void nlm_rmiboot_preboot(void);
66void nlm_percpu_init(int hwcpuid);
67
68static inline void *
69nlm_get_boot_data(int offset)
70{
71 return (void *)(CKSEG1ADDR(RESET_DATA_PHYS) + offset);
72}
73
74static inline void
75nlm_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
85void nlm_init_boot_cpu(void);
86unsigned int nlm_get_cpu_frequency(void);
87extern struct plat_smp_ops nlm_smp_ops;
88extern char nlm_reset_entry[], nlm_reset_entry_end[];
89
90
91extern struct dma_map_ops nlm_swiotlb_dma_ops;
92
93extern unsigned int nlm_threads_per_core;
94extern cpumask_t nlm_cpumask;
95
96struct irq_data;
97uint64_t nlm_pci_irqmask(int node);
98void nlm_setup_pic_irq(int node, int picirq, int irq, int irt);
99void nlm_set_pic_extra_ack(int node, int irq, void (*xack)(struct irq_data *));
100
101#ifdef CONFIG_PCI_MSI
102void nlm_dispatch_msi(int node, int lirq);
103void nlm_dispatch_msix(int node, int msixirq);
104#endif
105
106
107
108
109static inline int nlm_irq_to_xirq(int node, int irq)
110{
111 return node * NR_IRQS / NLM_NR_NODES + irq;
112}
113
114extern int nlm_cpu_ready[];
115#endif
116#endif
117