aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include
diff options
context:
space:
mode:
authorJayachandran C <jayachandranc@netlogicmicro.com>2011-11-15 19:21:29 -0500
committerRalf Baechle <ralf@linux-mips.org>2011-12-07 17:04:56 -0500
commit66d29985fab8207b1b2c03ac34a2c294c5b47a30 (patch)
treef73145e09c53606716266577eef5e14262129ed9 /arch/mips/include
parent8da24631e60438631112e6fdd198ef62416ff14a (diff)
MIPS: Netlogic: Merge some of XLR/XLP wakup code
Create a common NMI and reset handler in smpboot.S and use this for both XLR and XLP. In the earlier code, the woken up CPUs would busy wait until released, switch this to wakeup by NMI. The initial wakeup code or XLR and XLP are differ since they are started from different bootloaders (XLP from u-boot and XLR from netlogic bootloader). But in both platforms the woken up CPUs wait and are released by sending an NMI. Add support for starting XLR and XLP in 1/2/4 threads per core. Signed-off-by: Jayachandran C <jayachandranc@netlogicmicro.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/2970/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include')
-rw-r--r--arch/mips/include/asm/netlogic/common.h26
-rw-r--r--arch/mips/include/asm/netlogic/xlp-hal/xlp.h7
-rw-r--r--arch/mips/include/asm/netlogic/xlr/xlr.h2
3 files changed, 27 insertions, 8 deletions
diff --git a/arch/mips/include/asm/netlogic/common.h b/arch/mips/include/asm/netlogic/common.h
index e5bdf8c529ff..fdd2f44c7b59 100644
--- a/arch/mips/include/asm/netlogic/common.h
+++ b/arch/mips/include/asm/netlogic/common.h
@@ -38,19 +38,39 @@
38/* 38/*
39 * Common SMP definitions 39 * Common SMP definitions
40 */ 40 */
41#define RESET_VEC_PHYS 0x1fc00000
42#define RESET_DATA_PHYS (RESET_VEC_PHYS + (1<<10))
43#define BOOT_THREAD_MODE 0
44#define BOOT_NMI_LOCK 4
45#define BOOT_NMI_HANDLER 8
46
47#ifndef __ASSEMBLY__
41struct irq_desc; 48struct irq_desc;
42extern struct plat_smp_ops nlm_smp_ops; 49extern struct plat_smp_ops nlm_smp_ops;
43extern char nlm_reset_entry[], nlm_reset_entry_end[]; 50extern char nlm_reset_entry[], nlm_reset_entry_end[];
44void nlm_smp_function_ipi_handler(unsigned int irq, struct irq_desc *desc); 51void nlm_smp_function_ipi_handler(unsigned int irq, struct irq_desc *desc);
45void nlm_smp_resched_ipi_handler(unsigned int irq, struct irq_desc *desc); 52void nlm_smp_resched_ipi_handler(unsigned int irq, struct irq_desc *desc);
46void nlm_smp_irq_init(void); 53void nlm_smp_irq_init(void);
47void prom_pre_boot_secondary_cpus(void); 54void nlm_boot_secondary_cpus(void);
48int nlm_wakeup_secondary_cpus(u32 wakeup_mask); 55int nlm_wakeup_secondary_cpus(u32 wakeup_mask);
49void nlm_boot_smp_nmi(void); 56void nlm_rmiboot_preboot(void);
57
58static inline void
59nlm_set_nmi_handler(void *handler)
60{
61 char *reset_data;
62
63 reset_data = (char *)CKSEG1ADDR(RESET_DATA_PHYS);
64 *(int64_t *)(reset_data + BOOT_NMI_HANDLER) = (long)handler;
65}
50 66
51/* 67/*
52 * Misc. 68 * Misc.
53 */ 69 */
70unsigned int nlm_get_cpu_frequency(void);
71
54extern unsigned long nlm_common_ebase; 72extern unsigned long nlm_common_ebase;
55unsigned int nlm_get_cpu_frequency(void); 73extern int nlm_threads_per_core;
74extern uint32_t nlm_cpumask, nlm_coremask;
75#endif
56#endif /* _NETLOGIC_COMMON_H_ */ 76#endif /* _NETLOGIC_COMMON_H_ */
diff --git a/arch/mips/include/asm/netlogic/xlp-hal/xlp.h b/arch/mips/include/asm/netlogic/xlp-hal/xlp.h
index aae23f107412..1540588e396d 100644
--- a/arch/mips/include/asm/netlogic/xlp-hal/xlp.h
+++ b/arch/mips/include/asm/netlogic/xlp-hal/xlp.h
@@ -35,17 +35,14 @@
35#ifndef _NLM_HAL_XLP_H 35#ifndef _NLM_HAL_XLP_H
36#define _NLM_HAL_XLP_H 36#define _NLM_HAL_XLP_H
37 37
38#define RESET_VEC_PHYS 0x1fc00000
39#define RESET_DATA_PHYS (RESET_VEC_PHYS + (1<<10))
40#define BOOT_THREAD_MODE 0
41
42#define PIC_UART_0_IRQ 17 38#define PIC_UART_0_IRQ 17
43#define PIC_UART_1_IRQ 18 39#define PIC_UART_1_IRQ 18
44 40
45#ifndef __ASSEMBLY__ 41#ifndef __ASSEMBLY__
46 42
47/* SMP support functions */ 43/* SMP support functions */
48void nlm_boot_core0_siblings(void); 44void xlp_boot_core0_siblings(void);
45void xlp_wakeup_secondary_cpus(void);
49 46
50void xlp_mmu_init(void); 47void xlp_mmu_init(void);
51void nlm_hal_init(void); 48void nlm_hal_init(void);
diff --git a/arch/mips/include/asm/netlogic/xlr/xlr.h b/arch/mips/include/asm/netlogic/xlr/xlr.h
index f4d3f7cb6d65..ff4a17b0bf78 100644
--- a/arch/mips/include/asm/netlogic/xlr/xlr.h
+++ b/arch/mips/include/asm/netlogic/xlr/xlr.h
@@ -40,6 +40,8 @@ struct uart_port;
40unsigned int nlm_xlr_uart_in(struct uart_port *, int); 40unsigned int nlm_xlr_uart_in(struct uart_port *, int);
41void nlm_xlr_uart_out(struct uart_port *, int, int); 41void nlm_xlr_uart_out(struct uart_port *, int, int);
42 42
43/* SMP helpers */
44void xlr_wakeup_secondary_cpus(void);
43 45
44/* XLS B silicon "Rook" */ 46/* XLS B silicon "Rook" */
45static inline unsigned int nlm_chip_is_xls_b(void) 47static inline unsigned int nlm_chip_is_xls_b(void)