aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/netlogic/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/include/asm/netlogic/common.h')
-rw-r--r--arch/mips/include/asm/netlogic/common.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/arch/mips/include/asm/netlogic/common.h b/arch/mips/include/asm/netlogic/common.h
index aef560a51a7e..bb68c3398c80 100644
--- a/arch/mips/include/asm/netlogic/common.h
+++ b/arch/mips/include/asm/netlogic/common.h
@@ -39,11 +39,17 @@
39 * Common SMP definitions 39 * Common SMP definitions
40 */ 40 */
41#define RESET_VEC_PHYS 0x1fc00000 41#define RESET_VEC_PHYS 0x1fc00000
42#define RESET_VEC_SIZE 8192 /* 8KB reset code and data */
42#define RESET_DATA_PHYS (RESET_VEC_PHYS + (1<<10)) 43#define RESET_DATA_PHYS (RESET_VEC_PHYS + (1<<10))
44
45/* Offsets of parameters in the RESET_DATA_PHYS area */
43#define BOOT_THREAD_MODE 0 46#define BOOT_THREAD_MODE 0
44#define BOOT_NMI_LOCK 4 47#define BOOT_NMI_LOCK 4
45#define BOOT_NMI_HANDLER 8 48#define BOOT_NMI_HANDLER 8
46 49
50/* CPU ready flags for each CPU */
51#define BOOT_CPU_READY 2048
52
47#ifndef __ASSEMBLY__ 53#ifndef __ASSEMBLY__
48#include <linux/cpumask.h> 54#include <linux/cpumask.h>
49#include <linux/spinlock.h> 55#include <linux/spinlock.h>
@@ -59,23 +65,32 @@ int nlm_wakeup_secondary_cpus(void);
59void nlm_rmiboot_preboot(void); 65void nlm_rmiboot_preboot(void);
60void nlm_percpu_init(int hwcpuid); 66void nlm_percpu_init(int hwcpuid);
61 67
68static inline void *
69nlm_get_boot_data(int offset)
70{
71 return (void *)(CKSEG1ADDR(RESET_DATA_PHYS) + offset);
72}
73
62static inline void 74static inline void
63nlm_set_nmi_handler(void *handler) 75nlm_set_nmi_handler(void *handler)
64{ 76{
65 char *reset_data; 77 void *nmih = nlm_get_boot_data(BOOT_NMI_HANDLER);
66 78
67 reset_data = (char *)CKSEG1ADDR(RESET_DATA_PHYS); 79 *(int64_t *)nmih = (long)handler;
68 *(int64_t *)(reset_data + BOOT_NMI_HANDLER) = (long)handler;
69} 80}
70 81
71/* 82/*
72 * Misc. 83 * Misc.
73 */ 84 */
85void nlm_init_boot_cpu(void);
74unsigned int nlm_get_cpu_frequency(void); 86unsigned int nlm_get_cpu_frequency(void);
75void nlm_node_init(int node); 87void nlm_node_init(int node);
76extern struct plat_smp_ops nlm_smp_ops; 88extern struct plat_smp_ops nlm_smp_ops;
77extern char nlm_reset_entry[], nlm_reset_entry_end[]; 89extern char nlm_reset_entry[], nlm_reset_entry_end[];
78 90
91/* SWIOTLB */
92extern struct dma_map_ops nlm_swiotlb_dma_ops;
93
79extern unsigned int nlm_threads_per_core; 94extern unsigned int nlm_threads_per_core;
80extern cpumask_t nlm_cpumask; 95extern cpumask_t nlm_cpumask;
81 96