Skip to contentSkip to conversation

MIPS: Netlogic: Add XLP platform files for XLP SoC

PATCH New Jayachandran C 1 participant 1 message Oct 23, 2011 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 7/12 MIPS: Netlogic: Add XLP platform files for XLP SoC

- Update common files to support XLP.
- Add arch/mips/include/asm/netlogic/xlp-hal for register definitions and access macros
- Add arch/mips/netlogic/xlp/ for XLP specific files.

---
 arch/mips/include/asm/netlogic/haldefs.h           |   21 +
 arch/mips/include/asm/netlogic/xlp-hal/bridge.h    |  187 +++++++++
 .../mips/include/asm/netlogic/xlp-hal/cpucontrol.h |   83 ++++
 arch/mips/include/asm/netlogic/xlp-hal/iomap.h     |  153 ++++++++
 arch/mips/include/asm/netlogic/xlp-hal/pic.h       |  411 ++++++++++++++++++++
 arch/mips/include/asm/netlogic/xlp-hal/sys.h       |  129 ++++++
 arch/mips/include/asm/netlogic/xlp-hal/uart.h      |  191 +++++++++
 arch/mips/include/asm/netlogic/xlp-hal/xlp.h       |   54 +++
 arch/mips/netlogic/common/earlycons.c              |    9 +
 arch/mips/netlogic/common/irq.c                    |    8 +
 arch/mips/netlogic/common/smp.c                    |   16 +-
 arch/mips/netlogic/xlp/nlm_hal.c                   |  105 +++++
 arch/mips/netlogic/xlp/platform.c                  |  108 +++++
 arch/mips/netlogic/xlp/setup.c                     |  101 +++++
 arch/mips/netlogic/xlp/smpboot.S                   |  217 +++++++++++
 arch/mips/netlogic/xlp/wakeup.c                    |  149 +++++++
 16 files changed, 1938 insertions(+), 4 deletions(-)
 create mode 100644 arch/mips/include/asm/netlogic/xlp-hal/bridge.h
 create mode 100644 arch/mips/include/asm/netlogic/xlp-hal/cpucontrol.h
 create mode 100644 arch/mips/include/asm/netlogic/xlp-hal/iomap.h
 create mode 100644 arch/mips/include/asm/netlogic/xlp-hal/pic.h
 create mode 100644 arch/mips/include/asm/netlogic/xlp-hal/sys.h
 create mode 100644 arch/mips/include/asm/netlogic/xlp-hal/uart.h
 create mode 100644 arch/mips/include/asm/netlogic/xlp-hal/xlp.h
 create mode 100644 arch/mips/netlogic/xlp/nlm_hal.c
 create mode 100644 arch/mips/netlogic/xlp/platform.c
 create mode 100644 arch/mips/netlogic/xlp/setup.c
 create mode 100644 arch/mips/netlogic/xlp/smpboot.S
 create mode 100644 arch/mips/netlogic/xlp/wakeup.c
arch/mips/include/asm/netlogic/haldefs.h +21 -0
index e3264c1..72a0c78 100644
@@ -40,6 +40,9 @@
  * and will provide a way to read 32/64 bit memory mapped registers in
  * all ABIs
  */
+#if !defined(CONFIG_64BIT) && defined(CONFIG_CPU_XLP)
+#error "o32 compile not supported on XLP yet"
+#endif
 /*
  * For o32 compilation, we have to disable interrupts and enable KX bit to
  * access 64 bit addresses or data.
@@ -133,10 +136,28 @@ nlm_write_reg64_xkphys(uint64_t base, uint32_t reg, uint64_t val)
 /* Location where IO base is mapped */
 extern uint64_t nlm_io_base;
 
+#if defined(CONFIG_CPU_XLP)
+static inline uint64_t
+nlm_pcicfg_base(uint32_t devoffset)
+{
+	return nlm_io_base + devoffset;
+}
+
+static inline uint64_t
+nlm_xkphys_map_pcibar0(uint64_t pcibase)
+{
+	uint64_t paddr;
+
+	paddr = nlm_read_reg(pcibase, 0x4) & ~0xfu;
+	return (uint64_t)0x9000000000000000 | paddr;
+}
+#elif defined(CONFIG_CPU_XLR)
+
 static inline uint64_t
 nlm_mmio_base(uint32_t devoffset)
 {
 	return nlm_io_base + devoffset;
 }
+#endif
 
 #endif
arch/mips/include/asm/netlogic/xlp-hal/bridge.h new file +187 -0

187 lines not on this page · raw message

arch/mips/include/asm/netlogic/xlp-hal/cpucontrol.h new file +83 -0

83 lines not on this page · raw message

arch/mips/include/asm/netlogic/xlp-hal/iomap.h new file +153 -0

153 lines not on this page · raw message

arch/mips/include/asm/netlogic/xlp-hal/pic.h new file +411 -0

411 lines not on this page · raw message

arch/mips/include/asm/netlogic/xlp-hal/sys.h new file +129 -0

129 lines not on this page · raw message

arch/mips/include/asm/netlogic/xlp-hal/uart.h new file +191 -0

191 lines not on this page · raw message

arch/mips/include/asm/netlogic/xlp-hal/xlp.h new file +54 -0

54 lines not on this page · raw message

arch/mips/netlogic/common/earlycons.c +9 -0
index 28c8fa7..f193f7b 100644
@@ -38,13 +38,22 @@
 #include <asm/mipsregs.h>
 #include <asm/netlogic/haldefs.h>
 
+#if defined(CONFIG_CPU_XLP)
+#include <asm/netlogic/xlp-hal/iomap.h>
+#include <asm/netlogic/xlp-hal/uart.h>
+#elif defined(CONFIG_CPU_XLR)
 #include <asm/netlogic/xlr/iomap.h>
+#endif
 
 void prom_putchar(char c)
 {
 	uint64_t uartbase;
 
+#if defined(CONFIG_CPU_XLP)
+	uartbase = nlm_get_uart_regbase(0, 0);
+#elif defined(CONFIG_CPU_XLR)
 	uartbase = nlm_mmio_base(NETLOGIC_IO_UART_0_OFFSET);
+#endif
 	while (nlm_read_reg(uartbase, UART_LSR) == 0)
 		;
 	nlm_write_reg(uartbase, UART_TX, c);
arch/mips/netlogic/common/irq.c +8 -0
index dd0dd62..49a4f6c 100644
@@ -53,8 +53,16 @@
 #include <asm/netlogic/haldefs.h>
 #include <asm/netlogic/common.h>
 
+#if defined(CONFIG_CPU_XLP)
+#include <asm/netlogic/xlp-hal/iomap.h>
+#include <asm/netlogic/xlp-hal/xlp.h>
+#include <asm/netlogic/xlp-hal/pic.h>
+#elif defined(CONFIG_CPU_XLR)
 #include <asm/netlogic/xlr/iomap.h>
 #include <asm/netlogic/xlr/pic.h>
+#else
+#error "Unknown CPU"
+#endif
 /*
  * These are the routines that handle all the low level interrupt stuff.
  * Actions handled here are: initialization of the interrupt map, requesting of
arch/mips/netlogic/common/smp.c +12 -4
index 68171fe..ff368c6 100644
@@ -45,8 +45,15 @@
 #include <asm/netlogic/haldefs.h>
 #include <asm/netlogic/common.h>
 
+#if defined(CONFIG_CPU_XLP)
+#include <asm/netlogic/xlp-hal/iomap.h>
+#include <asm/netlogic/xlp-hal/pic.h>
+#elif defined(CONFIG_CPU_XLR)
 #include <asm/netlogic/xlr/iomap.h>
 #include <asm/netlogic/xlr/pic.h>
+#else
+#error "Unknown CPU"
+#endif
 
 void nlm_send_ipi_single(int logical_cpu, unsigned int action)
 {
@@ -70,15 +77,15 @@ void nlm_send_ipi_mask(const struct cpumask *mask, unsigned int action)
 /* IRQ_IPI_SMP_FUNCTION Handler */
 void nlm_smp_function_ipi_handler(unsigned int irq, struct irq_desc *desc)
 {
-	smp_call_function_interrupt();
 	write_c0_eirr(1ull << irq);
+	smp_call_function_interrupt();
 }
 
 /* IRQ_IPI_SMP_RESCHEDULE  handler */
 void nlm_smp_resched_ipi_handler(unsigned int irq, struct irq_desc *desc)
 {
-	scheduler_ipi();
 	write_c0_eirr(1ull << irq);
+	scheduler_ipi();
 }
 
 /*
@@ -86,9 +93,10 @@ void nlm_smp_resched_ipi_handler(unsigned int irq, struct irq_desc *desc)
  */
 void nlm_early_init_secondary(int cpu)
 {
+	change_c0_config(CONF_CM_CMASK, 0x3);
 	write_c0_ebase((uint32_t)nlm_common_ebase);
-#ifdef NLM_XLP
-	if (cpu % 4 == 0)
+#ifdef CONFIG_CPU_XLP
+	if (hard_smp_processor_id() % 4 == 0)
 		xlp_mmu_init();
 #endif
 }
arch/mips/netlogic/xlp/nlm_hal.c new file +105 -0

105 lines not on this page · raw message

arch/mips/netlogic/xlp/platform.c new file +108 -0

108 lines not on this page · raw message

arch/mips/netlogic/xlp/setup.c new file +101 -0

101 lines not on this page · raw message

arch/mips/netlogic/xlp/smpboot.S new file +217 -0

217 lines not on this page · raw message

arch/mips/netlogic/xlp/wakeup.c new file +149 -0

149 lines not on this page · raw message

Signature · 1 line
1.7.4.1