Restructure EMMA2RH port
cover Restructure EMMA2RH port
Hi,
there have been many NEC EMMA SoCs so far, and with great pleasure we have many Linux ports running on EMMA these days. Even though most those ports are not submitted to upstream, but I'd like to reorganize current EMMA2RH ports into more easy maintainable shape as a reference.
There are a lot of things to do. For the first step, I'd like to introduce arch/mips/emma/ and include/asm/emma/ directories so that all EMMA related sourches/headers can be easily shared across various EMMA products/ports.
Here's the first attempt to try to change things as mentioned above. Some possible improvements and cleanups are also included. Patches will follow, please review. Any comments are highly appreciated.
Thanks in advance,
P.S. I'm also planning to do more cleanups around IRQ codes, register
definition style, and so on. But that'll be some other time.
--
Shinya Kuribayashi
NEC Electronics
PATCH 1/12 MIPS: Add CONFIG_CPU_R5500 for NEC VR5500 series processors
We already have sufficient infrastructure to support VR5500 and VR5500A series processors. Here's a Makefile support to make it selectable by ports, and enable it for NEC EMMA2RH Markeins board.
This patch also fixes a confused target help, and adds 1Gb PageMask bits supported by VR5500 and its variants.
---
arch/mips/Kconfig | 18 +++++++++++++++--- arch/mips/Makefile | 2 ++ arch/mips/include/asm/mipsregs.h | 1 + arch/mips/include/asm/module.h | 2 ++ arch/mips/kernel/Makefile | 1 + arch/mips/lib/Makefile | 1 + arch/mips/lib/dump_tlb.c | 1 + arch/mips/mm/Makefile | 1 + 8 files changed, 24 insertions(+), 3 deletions(-)
arch/mips/Kconfig +0 -0
@@ -249,10 +249,9 @@ config MARKEINS
select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_BIG_ENDIAN
select SYS_SUPPORTS_LITTLE_ENDIAN
- select SYS_HAS_CPU_R5000
+ select SYS_HAS_CPU_R5500
help
- This enables support for the R5432-based NEC Mark-eins - boards with R5500 CPU. + This enables support for the NEC Mark-eins board with VR5500 CPU.
config MACH_VR41XX
bool "NEC VR4100 series based machines"
@@ -1092,6 +1091,16 @@ config CPU_R5432
select CPU_SUPPORTS_32BIT_KERNEL
select CPU_SUPPORTS_64BIT_KERNEL
+config CPU_R5500
+ bool "R5500"
+ depends on SYS_HAS_CPU_R5500
+ select CPU_HAS_LLSC
+ select CPU_SUPPORTS_32BIT_KERNEL
+ select CPU_SUPPORTS_64BIT_KERNEL
+ help
+ NEC VR5500 and VR5500A series processors implement 64-bit MIPS IV
+ instruction set.
+
config CPU_R6000
bool "R6000" depends on EXPERIMENTAL
@@ -1202,6 +1211,9 @@ config SYS_HAS_CPU_R5000
config SYS_HAS_CPU_R5432
bool
+config SYS_HAS_CPU_R5500
+ bool
+
config SYS_HAS_CPU_R6000
bool
arch/mips/Makefile +0 -0
@@ -131,6 +131,8 @@ cflags-$(CONFIG_CPU_MIPS64_R2) += $(call cc-option,-march=mips64r2,-mips64r2 -U_
cflags-$(CONFIG_CPU_R5000) += -march=r5000 -Wa,--trap
cflags-$(CONFIG_CPU_R5432) += $(call cc-option,-march=r5400,-march=r5000) \ -Wa,--trap +cflags-$(CONFIG_CPU_R5500) += $(call cc-option,-march=r5500,-march=r5000) \ + -Wa,--trap cflags-$(CONFIG_CPU_NEVADA) += $(call cc-option,-march=rm5200,-march=r5000) \ -Wa,--trap
cflags-$(CONFIG_CPU_RM7000) += $(call cc-option,-march=rm7000,-march=r5000) \
arch/mips/include/asm/mipsregs.h +0 -0
@@ -192,6 +192,7 @@
#define PM_16M 0x01ffe000
#define PM_64M 0x07ffe000
#define PM_256M 0x1fffe000
+#define PM_1G 0x7fffe000
#endif
arch/mips/include/asm/module.h +0 -0
@@ -98,6 +98,8 @@ search_module_dbetables(unsigned long addr)
#define MODULE_PROC_FAMILY "R5000 "
#elif defined CONFIG_CPU_R5432
#define MODULE_PROC_FAMILY "R5432 "
+#elif defined CONFIG_CPU_R5500
+#define MODULE_PROC_FAMILY "R5500 "
#elif defined CONFIG_CPU_R6000
#define MODULE_PROC_FAMILY "R6000 "
#elif defined CONFIG_CPU_NEVADA
arch/mips/kernel/Makefile +0 -0
@@ -33,6 +33,7 @@ obj-$(CONFIG_CPU_R4X00) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_R5000) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_R6000) += r6000_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_R5432) += r4k_fpu.o r4k_switch.o
+obj-$(CONFIG_CPU_R5500) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_R8000) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_RM7000) += r4k_fpu.o r4k_switch.o
obj-$(CONFIG_CPU_RM9000) += r4k_fpu.o r4k_switch.o
arch/mips/lib/Makefile +0 -0
@@ -18,6 +18,7 @@ obj-$(CONFIG_CPU_R4300) += dump_tlb.o
obj-$(CONFIG_CPU_R4X00) += dump_tlb.o
obj-$(CONFIG_CPU_R5000) += dump_tlb.o
obj-$(CONFIG_CPU_R5432) += dump_tlb.o
+obj-$(CONFIG_CPU_R5500) += dump_tlb.o
obj-$(CONFIG_CPU_R6000) +=
obj-$(CONFIG_CPU_R8000) +=
obj-$(CONFIG_CPU_RM7000) += dump_tlb.o
arch/mips/lib/dump_tlb.c +0 -0
@@ -25,6 +25,7 @@ static inline const char *msk2str(unsigned int mask)
case PM_16M: return "16Mb"; case PM_64M: return "64Mb"; case PM_256M: return "256Mb"; + case PM_1G: return "1Gb"; #endif } return "";
arch/mips/mm/Makefile +0 -0
@@ -19,6 +19,7 @@ obj-$(CONFIG_CPU_R4300) += c-r4k.o cex-gen.o tlb-r4k.o
obj-$(CONFIG_CPU_R4X00) += c-r4k.o cex-gen.o tlb-r4k.o
obj-$(CONFIG_CPU_R5000) += c-r4k.o cex-gen.o tlb-r4k.o
obj-$(CONFIG_CPU_R5432) += c-r4k.o cex-gen.o tlb-r4k.o
+obj-$(CONFIG_CPU_R5500) += c-r4k.o cex-gen.o tlb-r4k.o
obj-$(CONFIG_CPU_R8000) += c-r4k.o cex-gen.o tlb-r8k.o
obj-$(CONFIG_CPU_RM7000) += c-r4k.o cex-gen.o tlb-r4k.o
obj-$(CONFIG_CPU_RM9000) += c-r4k.o cex-gen.o tlb-r4k.o
PATCH 2/12 MIPS: EMMA Kconfig reorganization
In reply to Shinya Kuribayashi- Move EMMA related stuff into arch/mips/emma/Kconfig
- Create CONFIG_SOC_EMMA* to handle more EMMA SoCs effectively
- Rename CONFIG_MARKEINS into CONFIG_NEC_MARKEINS
---
[02/12] does not seem to be properly transfered. Here it is.
arch/mips/Kconfig | 17 +++-------------- arch/mips/Makefile | 11 +++++++---- arch/mips/emma/Kconfig | 29 +++++++++++++++++++++++++++++ arch/mips/emma2rh/common/Makefile | 2 +- arch/mips/emma2rh/common/prom.c | 4 ++-- arch/mips/emma2rh/markeins/Makefile | 2 +- arch/mips/include/asm/emma2rh/emma2rh.h | 2 +- arch/mips/pci/Makefile | 2 +- 8 files changed, 45 insertions(+), 24 deletions(-)
create mode 100644 arch/mips/emma/Kconfig
arch/mips/Kconfig +0 -0
@@ -238,20 +238,8 @@ config MIPS_SIM
This option enables support for MIPS Technologies MIPSsim software emulator.
-config MARKEINS
- bool "NEC EMMA2RH Mark-eins"
- select CEVT_R4K
- select CSRC_R4K
- select DMA_NONCOHERENT
- select HW_HAS_PCI
- select IRQ_CPU
- select SWAP_IO_SPACE
- select SYS_SUPPORTS_32BIT_KERNEL
- select SYS_SUPPORTS_BIG_ENDIAN
- select SYS_SUPPORTS_LITTLE_ENDIAN
- select SYS_HAS_CPU_R5500
- help
- This enables support for the NEC Mark-eins board with VR5500 CPU.
+config MACH_EMMA
+ bool "NEC EMMA series based machines"
config MACH_VR41XX
bool "NEC VR4100 series based machines"
@@ -600,6 +588,7 @@ endchoice
source "arch/mips/alchemy/Kconfig"
source "arch/mips/basler/excite/Kconfig"
+source "arch/mips/emma/Kconfig"
source "arch/mips/jazz/Kconfig"
source "arch/mips/lasat/Kconfig"
source "arch/mips/pmc-sierra/Kconfig"
arch/mips/Makefile +0 -0
@@ -401,14 +401,17 @@ load-$(CONFIG_PNX8550_JBS) += 0xffffffff80060000
libs-$(CONFIG_PNX8550_STB810) += arch/mips/nxp/pnx8550/stb810/
load-$(CONFIG_PNX8550_STB810) += 0xffffffff80060000
+#
# NEC EMMA2RH boards
#
-core-$(CONFIG_EMMA2RH) += arch/mips/emma2rh/common/
-cflags-$(CONFIG_EMMA2RH) += -I$(srctree)/arch/mips/include/asm/mach-emma2rh
+core-$(CONFIG_SOC_EMMA2RH) += arch/mips/emma2rh/common/
+cflags-$(CONFIG_SOC_EMMA2RH) += -I$(srctree)/arch/mips/include/asm/mach-emma2rh
+#
# NEC EMMA2RH Mark-eins
-core-$(CONFIG_MARKEINS) += arch/mips/emma2rh/markeins/
-load-$(CONFIG_MARKEINS) += 0xffffffff88100000
+#
+core-$(CONFIG_NEC_MARKEINS) += arch/mips/emma2rh/markeins/
+load-$(CONFIG_NEC_MARKEINS) += 0xffffffff88100000
#
# SGI IP22 (Indy/Indigo2)
arch/mips/emma/Kconfig new file +29 -0
@@ -0,0 +1,29 @@ +choice + prompt "Machine type" + depends on MACH_EMMA + default NEC_MARKEINS + +config NEC_MARKEINS + bool "NEC EMMA2RH Mark-eins board" + select SOC_EMMA2RH + select HW_HAS_PCI + help + This enables support for the NEC Electronics Mark-eins boards. + +endchoice + +config SOC_EMMA2RH + bool + select SOC_EMMA + select SYS_HAS_CPU_R5500 + select SYS_SUPPORTS_32BIT_KERNEL + select SYS_SUPPORTS_64BIT_KERNEL + +config SOC_EMMA + bool + select CEVT_R4K + select CSRC_R4K + select DMA_NONCOHERENT + select IRQ_CPU + select SWAP_IO_SPACE + select SYS_SUPPORTS_BIG_ENDIAN
arch/mips/emma2rh/common/Makefile +0 -0
@@ -10,4 +10,4 @@
# (at your option) any later version.
#
-obj-$(CONFIG_MARKEINS) += irq.o irq_emma2rh.o prom.o
+obj-$(CONFIG_NEC_MARKEINS) += irq.o irq_emma2rh.o prom.o
arch/mips/emma2rh/common/prom.c +0 -0
@@ -33,7 +33,7 @@
const char *get_system_type(void)
{
-#if defined(CONFIG_MARKEINS)
+#ifdef CONFIG_NEC_MARKEINS
return "NEC EMMA2RH Mark-eins"; #else #error Unknown NEC board @@ -60,7 +60,7 @@ void __init prom_init(void) strcat(arcs_cmdline, " "); }
-#if defined(CONFIG_MARKEINS)
+#ifdef CONFIG_NEC_MARKEINS
add_memory_region(0, EMMA2RH_RAM_SIZE, BOOT_MEM_RAM);
#else
#error Unknown NEC board
arch/mips/emma2rh/markeins/Makefile +0 -0
@@ -10,4 +10,4 @@
# (at your option) any later version.
#
-obj-$(CONFIG_MARKEINS) += irq.o irq_markeins.o setup.o led.o platform.o +obj-$(CONFIG_NEC_MARKEINS) += irq.o irq_markeins.o setup.o led.o platform.o
arch/mips/include/asm/emma2rh/emma2rh.h +0 -0
@@ -324,7 +324,7 @@ static inline u8 emma2rh_in8(u32 offset)
/*
* include the board dependent part
*/
-#if defined(CONFIG_MARKEINS)
+#ifdef CONFIG_NEC_MARKEINS
#include <asm/emma2rh/markeins.h>
#else
#error "Unknown EMMA2RH board!"
arch/mips/pci/Makefile +0 -0
@@ -13,7 +13,7 @@ obj-$(CONFIG_MIPS_MSC) += ops-msc.o
obj-$(CONFIG_MIPS_NILE4) += ops-nile4.o
obj-$(CONFIG_SOC_TX3927) += ops-tx3927.o
obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o pci-vr41xx.o
-obj-$(CONFIG_MARKEINS) += ops-emma2rh.o pci-emma2rh.o fixup-emma2rh.o
+obj-$(CONFIG_NEC_MARKEINS) += ops-emma2rh.o pci-emma2rh.o fixup-emma2rh.o
obj-$(CONFIG_PCI_TX4927) += ops-tx4927.o
obj-$(CONFIG_BCM47XX) += pci-bcm47xx.o
PATCH 3/12 MIPS: Move arch/mips/emma2rh/ into arch/mips/emma/
In reply to Shinya Kuribayashigit mv arch/mips/{emma2rh,emma} and fixups Makefiles. We'll put all NEC EMMA series based machines there in the future.
---
arch/mips/Makefile | 6 - arch/mips/emma/common/Makefile | 13 ++ arch/mips/emma/common/irq.c | 105 ++++++++++++++++ arch/mips/emma/common/irq_emma2rh.c | 106 ++++++++++++++++ arch/mips/emma/common/prom.c | 72 +++++++++++ arch/mips/emma/markeins/Makefile | 13 ++ arch/mips/emma/markeins/irq.c | 132 ++++++++++++++++++++ arch/mips/emma/markeins/irq_markeins.c | 158 ++++++++++++++++++++++++ arch/mips/emma/markeins/led.c | 60 +++++++++ arch/mips/emma/markeins/platform.c | 191 +++++++++++++++++++++++++++++ arch/mips/emma/markeins/setup.c | 135 ++++++++++++++++++++ arch/mips/emma2rh/common/Makefile | 13 -- arch/mips/emma2rh/common/irq.c | 105 ---------------- arch/mips/emma2rh/common/irq_emma2rh.c | 106 ---------------- arch/mips/emma2rh/common/prom.c | 72 ----------- arch/mips/emma2rh/markeins/Makefile | 13 -- arch/mips/emma2rh/markeins/irq.c | 132 -------------------- arch/mips/emma2rh/markeins/irq_markeins.c | 158 ------------------------ arch/mips/emma2rh/markeins/led.c | 60 --------- arch/mips/emma2rh/markeins/platform.c | 191 ----------------------------- arch/mips/emma2rh/markeins/setup.c | 135 -------------------- 21 files changed, 988 insertions(+), 988 deletions(-)
create mode 100644 arch/mips/emma/common/Makefile create mode 100644 arch/mips/emma/common/irq.c create mode 100644 arch/mips/emma/common/irq_emma2rh.c create mode 100644 arch/mips/emma/common/prom.c create mode 100644 arch/mips/emma/markeins/Makefile create mode 100644 arch/mips/emma/markeins/irq.c create mode 100644 arch/mips/emma/markeins/irq_markeins.c create mode 100644 arch/mips/emma/markeins/led.c create mode 100644 arch/mips/emma/markeins/platform.c create mode 100644 arch/mips/emma/markeins/setup.c delete mode 100644 arch/mips/emma2rh/common/Makefile delete mode 100644 arch/mips/emma2rh/common/irq.c delete mode 100644 arch/mips/emma2rh/common/irq_emma2rh.c delete mode 100644 arch/mips/emma2rh/common/prom.c delete mode 100644 arch/mips/emma2rh/markeins/Makefile delete mode 100644 arch/mips/emma2rh/markeins/irq.c delete mode 100644 arch/mips/emma2rh/markeins/irq_markeins.c delete mode 100644 arch/mips/emma2rh/markeins/led.c delete mode 100644 arch/mips/emma2rh/markeins/platform.c delete mode 100644 arch/mips/emma2rh/markeins/setup.c
arch/mips/Makefile +0 -0
@@ -402,15 +402,15 @@ libs-$(CONFIG_PNX8550_STB810) += arch/mips/nxp/pnx8550/stb810/
load-$(CONFIG_PNX8550_STB810) += 0xffffffff80060000
#
-# NEC EMMA2RH boards
+# Common NEC EMMAXXX
#
-core-$(CONFIG_SOC_EMMA2RH) += arch/mips/emma2rh/common/
+core-$(CONFIG_SOC_EMMA) += arch/mips/emma/common/
cflags-$(CONFIG_SOC_EMMA2RH) += -I$(srctree)/arch/mips/include/asm/mach-emma2rh
#
# NEC EMMA2RH Mark-eins
#
-core-$(CONFIG_NEC_MARKEINS) += arch/mips/emma2rh/markeins/
+core-$(CONFIG_NEC_MARKEINS) += arch/mips/emma/markeins/
load-$(CONFIG_NEC_MARKEINS) += 0xffffffff88100000
#
arch/mips/emma/common/Makefile new file +13 -0
@@ -0,0 +1,13 @@ +# +# arch/mips/emma2rh/common/Makefile +# Makefile for the common code of NEC EMMA2RH based board. +# +# Copyright (C) NEC Electronics Corporation 2005-2006 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# + +obj-$(CONFIG_NEC_MARKEINS) += irq.o irq_emma2rh.o prom.o
arch/mips/emma/common/irq.c new file +105 -0
105 lines not on this page · raw message
arch/mips/emma/common/irq_emma2rh.c new file +106 -0
106 lines not on this page · raw message
arch/mips/emma/common/prom.c new file +72 -0
72 lines not on this page · raw message
arch/mips/emma/markeins/Makefile new file +13 -0
@@ -0,0 +1,13 @@ +# +# arch/mips/emma2rh/markeins/Makefile +# Makefile for the common code of NEC EMMA2RH based board. +# +# Copyright (C) NEC Electronics Corporation 2005-2006 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# + +obj-$(CONFIG_NEC_MARKEINS) += irq.o irq_markeins.o setup.o led.o platform.o
arch/mips/emma/markeins/irq.c new file +132 -0
132 lines not on this page · raw message
arch/mips/emma/markeins/irq_markeins.c new file +158 -0
158 lines not on this page · raw message
arch/mips/emma/markeins/led.c new file +60 -0
60 lines not on this page · raw message
arch/mips/emma/markeins/platform.c new file +191 -0
191 lines not on this page · raw message
arch/mips/emma/markeins/setup.c new file +135 -0
135 lines not on this page · raw message
arch/mips/emma2rh/common/Makefile deleted +0 -13
@@ -1,13 +0,0 @@ -# -# arch/mips/emma2rh/common/Makefile -# Makefile for the common code of NEC EMMA2RH based board. -# -# Copyright (C) NEC Electronics Corporation 2005-2006 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# - -obj-$(CONFIG_NEC_MARKEINS) += irq.o irq_emma2rh.o prom.o
arch/mips/emma2rh/common/irq.c deleted +0 -105
105 lines not on this page · raw message
arch/mips/emma2rh/common/irq_emma2rh.c deleted +0 -106
106 lines not on this page · raw message
arch/mips/emma2rh/common/prom.c deleted +0 -72
72 lines not on this page · raw message
arch/mips/emma2rh/markeins/Makefile deleted +0 -13
@@ -1,13 +0,0 @@ -# -# arch/mips/emma2rh/markeins/Makefile -# Makefile for the common code of NEC EMMA2RH based board. -# -# Copyright (C) NEC Electronics Corporation 2005-2006 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# - -obj-$(CONFIG_NEC_MARKEINS) += irq.o irq_markeins.o setup.o led.o platform.o
arch/mips/emma2rh/markeins/irq.c deleted +0 -132
132 lines not on this page · raw message
arch/mips/emma2rh/markeins/irq_markeins.c deleted +0 -158
158 lines not on this page · raw message
arch/mips/emma2rh/markeins/led.c deleted +0 -60
60 lines not on this page · raw message
arch/mips/emma2rh/markeins/platform.c deleted +0 -191
191 lines not on this page · raw message
arch/mips/emma2rh/markeins/setup.c deleted +0 -135
135 lines not on this page · raw message
PATCH 4/12 MIPS: Move <asm/emma2rh> to <asm/emma> dir
In reply to Shinya KuribayashiWe'll put all EMMA related headers there in the future.
---
arch/mips/emma/common/irq.c | 2 arch/mips/emma/common/irq_emma2rh.c | 2 arch/mips/emma/common/prom.c | 2 arch/mips/emma/markeins/irq.c | 2 arch/mips/emma/markeins/irq_markeins.c | 2 arch/mips/emma/markeins/led.c | 2 arch/mips/emma/markeins/platform.c | 2 arch/mips/emma/markeins/setup.c | 2 arch/mips/include/asm/emma/emma2rh.h | 333 ++++++++++++++++++++++++++++++ arch/mips/include/asm/emma/markeins.h | 75 +++++++ arch/mips/include/asm/emma2rh/emma2rh.h | 333 ------------------------------ arch/mips/include/asm/emma2rh/markeins.h | 75 ------- 12 files changed, 416 insertions(+), 416 deletions(-)
create mode 100644 arch/mips/include/asm/emma/emma2rh.h create mode 100644 arch/mips/include/asm/emma/markeins.h delete mode 100644 arch/mips/include/asm/emma2rh/emma2rh.h delete mode 100644 arch/mips/include/asm/emma2rh/markeins.h
arch/mips/emma/common/irq.c +0 -0
@@ -32,7 +32,7 @@
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
-#include <asm/emma2rh/emma2rh.h>
+#include <asm/emma/emma2rh.h>
/*
* the first level int-handler will jump here if it is a emma2rh irq
arch/mips/emma/common/irq_emma2rh.c +0 -0
@@ -36,7 +36,7 @@
#include <asm/debug.h>
-#include <asm/emma2rh/emma2rh.h>
+#include <asm/emma/emma2rh.h>
/* number of total irqs supported by EMMA2RH */
#define NUM_EMMA2RH_IRQ 96
arch/mips/emma/common/prom.c +0 -0
@@ -29,7 +29,7 @@
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
-#include <asm/emma2rh/emma2rh.h>
+#include <asm/emma/emma2rh.h>
const char *get_system_type(void)
{
arch/mips/emma/markeins/irq.c +0 -0
@@ -36,7 +36,7 @@
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
-#include <asm/emma2rh/emma2rh.h>
+#include <asm/emma/emma2rh.h>
/*
* IRQ mapping
arch/mips/emma/markeins/irq_markeins.c +0 -0
@@ -28,7 +28,7 @@
#include <linux/ptrace.h>
#include <asm/debug.h>
-#include <asm/emma2rh/emma2rh.h>
+#include <asm/emma/emma2rh.h>
static int emma2rh_sw_irq_base = -1;
static int emma2rh_gpio_irq_base = -1;
arch/mips/emma/markeins/led.c +0 -0
@@ -21,7 +21,7 @@
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/string.h>
-#include <asm/emma2rh/emma2rh.h>
+#include <asm/emma/emma2rh.h>
const unsigned long clear = 0x20202020;
arch/mips/emma/markeins/platform.c +0 -0
@@ -36,7 +36,7 @@
#include <asm/reboot.h>
#include <asm/traps.h>
-#include <asm/emma2rh/emma2rh.h>
+#include <asm/emma/emma2rh.h>
#define I2C_EMMA2RH "emma2rh-iic" /* must be in sync with IIC driver */
arch/mips/emma/markeins/setup.c +0 -0
@@ -29,7 +29,7 @@
#include <asm/time.h>
#include <asm/reboot.h>
-#include <asm/emma2rh/emma2rh.h>
+#include <asm/emma/emma2rh.h>
#define USE_CPU_COUNTER_TIMER /* whether we use cpu counter */
arch/mips/include/asm/emma/emma2rh.h new file +333 -0
333 lines not on this page · raw message
arch/mips/include/asm/emma/markeins.h new file +75 -0
75 lines not on this page · raw message
arch/mips/include/asm/emma2rh/emma2rh.h deleted +0 -333
333 lines not on this page · raw message
arch/mips/include/asm/emma2rh/markeins.h deleted +0 -75
75 lines not on this page · raw message
PATCH 1/1 MIPS: EMMA2RH: Fix incorrect header references
Now we have <asm/emma/emma2rh.h> as a new EMMA2RH header place. This patch will fix all of the remaining <asm/emma2rh/emma2rh.h> references.
---
arch/mips/include/asm/emma/emma2rh.h | 2 +- arch/mips/pci/fixup-emma2rh.c | 2 +- arch/mips/pci/ops-emma2rh.c | 2 +- arch/mips/pci/pci-emma2rh.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
arch/mips/include/asm/emma/emma2rh.h +0 -0
@@ -1,5 +1,5 @@
/*
- * include/asm-mips/emma2rh/emma2rh.h
+ * arch/mips/include/asm/emma/emma2rh.h
* This file is EMMA2RH common header.
*
* Copyright (C) NEC Electronics Corporation 2005-2006
arch/mips/pci/fixup-emma2rh.c +0 -0
@@ -30,7 +30,7 @@
#include <asm/bootinfo.h>
-#include <asm/emma2rh/emma2rh.h>
+#include <asm/emma/emma2rh.h>
#define EMMA2RH_PCI_HOST_SLOT 0x09
#define EMMA2RH_USB_SLOT 0x03
arch/mips/pci/ops-emma2rh.c +0 -0
@@ -30,7 +30,7 @@
#include <asm/addrspace.h>
#include <asm/debug.h>
-#include <asm/emma2rh/emma2rh.h>
+#include <asm/emma/emma2rh.h>
#define RTABORT (0x1<<9)
#define RMABORT (0x1<<10)
arch/mips/pci/pci-emma2rh.c +0 -0
@@ -30,7 +30,7 @@
#include <asm/bootinfo.h>
-#include <asm/emma2rh/emma2rh.h>
+#include <asm/emma/emma2rh.h>
static struct resource pci_io_resource = {
.name = "pci IO space",
Ralf Baechle
AppliedRe: [PATCH] MIPS: EMMA2RH: Fix incorrect header references
Quoted 2 lines · Shinya Kuribayashi
Now we have <
asm/emma/emma2rh.h> as a new EMMA2RH header place. This patch will fix all of the remaining <asm/emma2rh/emma2rh.h> references.
Applied. For kernel.org I'll fold this into the earlier patch "MIPS: EMMA:
Move <asm/emma2rh> to <asm/emma> dir" to keep things bisectable.
Thanks,
Ralf
PATCH 5/12 MIPS: Remove emma2rh_sync on read operation
In reply to Shinya KuribayashiIt's totally a waste of CPU cycles.
---arch/mips/include/asm/emma/emma2rh.h | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
arch/mips/include/asm/emma/emma2rh.h +0 -0
@@ -206,7 +206,6 @@ static inline void emma2rh_out32(u32 offset, u32 val)
static inline u32 emma2rh_in32(u32 offset)
{
u32 val = *(volatile u32 *)(EMMA2RH_BASE | offset);
- emma2rh_sync();
return val;
}@@ -219,7 +218,6 @@ static inline void emma2rh_out16(u32 offset, u16 val) static inline u16 emma2rh_in16(u32 offset)
{
u16 val = *(volatile u16 *)(EMMA2RH_BASE | offset);
- emma2rh_sync();
return val;
}@@ -232,7 +230,6 @@ static inline void emma2rh_out8(u32 offset, u8 val) static inline u8 emma2rh_in8(u32 offset)
{
u8 val = *(volatile u8 *)(EMMA2RH_BASE | offset);
- emma2rh_sync();
return val;
}PATCH 6/12 MIPS: EMMA2RH: Remove emma2rh_irq_base global variable
In reply to Shinya KuribayashiLet's use immediate value, instead. This also saves memory footprint, and probably a little bit faster.
---arch/mips/emma/common/irq_emma2rh.c | 15 ++++++---------arch/mips/emma/markeins/irq.c | 4 ++--
2 files changed, 8 insertions(+), 11 deletions(-)
arch/mips/emma/common/irq_emma2rh.c +0 -0
@@ -41,19 +41,17 @@
/* number of total irqs supported by EMMA2RH */
#define NUM_EMMA2RH_IRQ 96
-static int emma2rh_irq_base = -1;
-
void ll_emma2rh_irq_enable(int);
void ll_emma2rh_irq_disable(int);
static void emma2rh_irq_enable(unsigned int irq)
{
- ll_emma2rh_irq_enable(irq - emma2rh_irq_base);
+ ll_emma2rh_irq_enable(irq - EMMA2RH_IRQ_BASE);
}
static void emma2rh_irq_disable(unsigned int irq)
{
- ll_emma2rh_irq_disable(irq - emma2rh_irq_base);
+ ll_emma2rh_irq_disable(irq - EMMA2RH_IRQ_BASE);
}
struct irq_chip emma2rh_irq_controller = {
@@ -64,15 +62,14 @@ struct irq_chip emma2rh_irq_controller = {
.unmask = emma2rh_irq_enable,
};
-void emma2rh_irq_init(u32 irq_base)
+void emma2rh_irq_init(void)
{
u32 i;- for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ; i++)
- set_irq_chip_and_handler(i, &emma2rh_irq_controller,
+ for (i = 0; i < NUM_EMMA2RH_IRQ; i++)
+ set_irq_chip_and_handler(EMMA2RH_IRQ_BASE + i,
+ &emma2rh_irq_controller,
handle_level_irq);
-
- emma2rh_irq_base = irq_base;
}
void ll_emma2rh_irq_enable(int emma2rh_irq)
arch/mips/emma/markeins/irq.c +0 -0
@@ -55,7 +55,7 @@
extern void emma2rh_sw_irq_init(u32 base);
extern void emma2rh_gpio_irq_init(u32 base);
-extern void emma2rh_irq_init(u32 base);
+extern void emma2rh_irq_init(void);
extern void emma2rh_irq_dispatch(void);
static struct irqaction irq_cascade = {
@@ -102,7 +102,7 @@ void __init arch_init_irq(void)
emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~GPIO_PCI); /* init all controllers */ - emma2rh_irq_init(EMMA2RH_IRQ_BASE); + emma2rh_irq_init(); emma2rh_sw_irq_init(EMMA2RH_SW_IRQ_BASE); emma2rh_gpio_irq_init(EMMA2RH_GPIO_IRQ_BASE); mips_cpu_irq_init();
PATCH 7/12 MIPS: EMMA2RH: Remove emma2rh_sw_irq_base
In reply to Shinya KuribayashiLet's use immediate value, instead. This also saves memory footprint, and probably a little bit faster.
---arch/mips/emma/markeins/irq.c | 4 ++--arch/mips/emma/markeins/irq_markeins.c | 14 ++++++--------
2 files changed, 8 insertions(+), 10 deletions(-)
arch/mips/emma/markeins/irq.c +1 -1
@@ -53,7 +53,7 @@* */ -extern void emma2rh_sw_irq_init (u32 base); +extern void emma2rh_sw_irq_init (void );
extern void emma2rh_gpio_irq_init(u32 base); extern void emma2rh_irq_init(void);
extern void emma2rh_irq_dispatch(void);
@@ -103,7 +103,7 @@ void __init arch_init_irq(void)
/* init all controllers */ emma2rh_irq_init(); - emma2rh_sw_irq_init(EMMA2RH_SW_IRQ_BASE); + emma2rh_sw_irq_init(); emma2rh_gpio_irq_init(EMMA2RH_GPIO_IRQ_BASE); mips_cpu_irq_init();
arch/mips/emma/markeins/irq_markeins.c +0 -0
@@ -30,7 +30,6 @@
#include <asm/debug.h>
#include <asm/emma/emma2rh.h>
-static int emma2rh_sw_irq_base = -1;
static int emma2rh_gpio_irq_base = -1;
void ll_emma2rh_sw_irq_enable(int reg);
@@ -40,12 +39,12 @@ void ll_emma2rh_gpio_irq_disable(int reg);
static void emma2rh_sw_irq_enable(unsigned int irq) {
- ll_emma2rh_sw_irq_enable(irq - emma2rh_sw_irq_base);
+ ll_emma2rh_sw_irq_enable(irq - EMMA2RH_SW_IRQ_BASE);
}
static void emma2rh_sw_irq_disable(unsigned int irq) {
- ll_emma2rh_sw_irq_disable(irq - emma2rh_sw_irq_base);
+ ll_emma2rh_sw_irq_disable(irq - EMMA2RH_SW_IRQ_BASE);
}
struct irq_chip emma2rh_sw_irq_controller = {
@@ -56,15 +55,14 @@ struct irq_chip emma2rh_sw_irq_controller = {
.unmask = emma2rh_sw_irq_enable,
};
-void emma2rh_sw_irq_init(u32 irq_base)
+void emma2rh_sw_irq_init(void)
{
u32 i;- for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ_SW; i++)
- set_irq_chip_and_handler(i, &emma2rh_sw_irq_controller,
+ for (i = 0; i < NUM_EMMA2RH_IRQ_SW; i++)
+ set_irq_chip_and_handler(EMMA2RH_SW_IRQ_BASE + i,
+ &emma2rh_sw_irq_controller,
handle_level_irq);
-
- emma2rh_sw_irq_base = irq_base;
}
void ll_emma2rh_sw_irq_enable(int irq)
PATCH 8/12 MIPS: EMMA2RH: Remove emma2rh_gpio_irq_base
In reply to Shinya KuribayashiLet's use immediate value, instead. This also saves memory footprint, and probably a little bit faster.
---arch/mips/emma/markeins/irq.c | 4 ++--arch/mips/emma/markeins/irq_markeins.c | 19 ++++++++-----------
2 files changed, 10 insertions(+), 13 deletions(-)
arch/mips/emma/markeins/irq.c +0 -0
@@ -54,7 +54,7 @@*/
extern void emma2rh_sw_irq_init(void);
-extern void emma2rh_gpio_irq_init(u32 base);
+extern void emma2rh_gpio_irq_init(void);
extern void emma2rh_irq_init(void);
extern void emma2rh_irq_dispatch(void);
@@ -104,7 +104,7 @@ void __init arch_init_irq(void)
/* init all controllers */ emma2rh_irq_init(); emma2rh_sw_irq_init(); - emma2rh_gpio_irq_init(EMMA2RH_GPIO_IRQ_BASE); + emma2rh_gpio_irq_init(); mips_cpu_irq_init(); /* setup cascade interrupts */
arch/mips/emma/markeins/irq_markeins.c +0 -0
@@ -30,8 +30,6 @@
#include <asm/debug.h>
#include <asm/emma/emma2rh.h>
-static int emma2rh_gpio_irq_base = -1;
-
void ll_emma2rh_sw_irq_enable(int reg);
void ll_emma2rh_sw_irq_disable(int reg);
void ll_emma2rh_gpio_irq_enable(int reg);
@@ -91,17 +89,17 @@ void ll_emma2rh_sw_irq_disable(int irq)
static void emma2rh_gpio_irq_enable(unsigned int irq) {
- ll_emma2rh_gpio_irq_enable(irq - emma2rh_gpio_irq_base);
+ ll_emma2rh_gpio_irq_enable(irq - EMMA2RH_GPIO_IRQ_BASE);
}
static void emma2rh_gpio_irq_disable(unsigned int irq) {
- ll_emma2rh_gpio_irq_disable(irq - emma2rh_gpio_irq_base);
+ ll_emma2rh_gpio_irq_disable(irq - EMMA2RH_GPIO_IRQ_BASE);
}
static void emma2rh_gpio_irq_ack(unsigned int irq) {
- irq -= emma2rh_gpio_irq_base;
+ irq -= EMMA2RH_GPIO_IRQ_BASE; emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~(1 << irq)); ll_emma2rh_gpio_irq_disable(irq); }
@@ -109,7 +107,7 @@ static void emma2rh_gpio_irq_ack(unsigned int irq) static void emma2rh_gpio_irq_end(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
- ll_emma2rh_gpio_irq_enable(irq - emma2rh_gpio_irq_base);
+ ll_emma2rh_gpio_irq_enable(irq - EMMA2RH_GPIO_IRQ_BASE);
}
struct irq_chip emma2rh_gpio_irq_controller = {
@@ -121,14 +119,13 @@ struct irq_chip emma2rh_gpio_irq_controller = {
.end = emma2rh_gpio_irq_end,
};
-void emma2rh_gpio_irq_init(u32 irq_base)
+void emma2rh_gpio_irq_init(void)
{
u32 i;- for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ_GPIO; i++)
- set_irq_chip(i, &emma2rh_gpio_irq_controller);
-
- emma2rh_gpio_irq_base = irq_base;
+ for (i = 0; i < NUM_EMMA2RH_IRQ_GPIO; i++)
+ set_irq_chip(EMMA2RH_GPIO_IRQ_BASE + i,
+ &emma2rh_gpio_irq_controller);
}
void ll_emma2rh_gpio_irq_enable(int irq)
Re: [PATCH 08/12] MIPS: EMMA2RH: Remove emma2rh_gpio_irq_base
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Reminds me of the I2C driver for EMMA2RH that MontaVista posted, I ought to take the time to shape it up...
//Markus
Quoted 61 lines · Shinya Kuribayashi
Let's use immediate value, instead. This also saves memory footprint, and probably a little bit faster.
Signed-off-by Shinya Kuribayashi <[email protected]>---
arch/mips/emma/markeins/irq.c| 4 ++--arch/mips/emma/markeins/irq_markeins.c| 19 ++++++++----------- 2
files changed, 10 insertions(+), 13 deletions(-)(quoted diff) +0
-0
b/arch/mips/emma/markeins/irq.cindex c0f9d46..3577fd5 100644 ---a/arch/mips/emma/markeins/irq.c+++b/arch/mips/emma/markeins/irq.c
@@ -54,7 +54,7 @@ */extern void
emma2rh_sw_irq_init(void); -extern voidemma2rh_gpio_irq_init(u32 base); +extern voidemma2rh_gpio_irq_init(void); extern voidemma2rh_irq_init(void); extern voidemma2rh_irq_dispatch(void);(quoted diff) +0
-0@@ -104,7 +104,7 @@ void __init arch_init_irq(void) /* init allcontrollers */
emma2rh_irq_init();emma2rh_sw_irq_init(); -emma2rh_gpio_irq_init(EMMA2RH_GPIO_IRQ_BASE); +emma2rh_gpio_irq_init();mips_cpu_irq_init();/* setup cascade interrupts */ diff --git
a/arch/mips/emma/markeins/irq_markeins.cb/arch/mips/emma/markeins/irq_markeins.cindex 1883421..ea27ec5 100644 ---a/arch/mips/emma/markeins/irq_markeins.c+++b/arch/mips/emma/markeins/irq_markeins.c@@ -30,8 +30,6 @@ #include <asm/debug.h> #include <asm/emma/emma2rh.h>-static int
emma2rh_gpio_irq_base= -1; - voidll_emma2rh_sw_irq_enable(int reg); voidll_emma2rh_sw_irq_disable(int reg); voidll_emma2rh_gpio_irq_enable(int reg); @@ -91,17 +89,17 @@ voidll_emma2rh_sw_irq_disable(int irq)static void
emma2rh_gpio_irq_enable(unsigned int irq){ -ll_emma2rh_gpio_irq_enable(irq - emma2rh_gpio_irq_base); +ll_emma2rh_gpio_irq_enable(irq - EMMA2RH_GPIO_IRQ_BASE); }static void
emma2rh_gpio_irq_disable(unsigned int irq){ -ll_emma2rh_gpio_irq_disable(irq - emma2rh_gpio_irq_base); +ll_emma2rh_gpio_irq_disable(irq - EMMA2RH_GPIO_IRQ_BASE); }static void
emma2rh_gpio_irq_ack(unsigned int irq){ - irq -=emma2rh_gpio_irq_base; + irq -=EMMA2RH_GPIO_IRQ_BASE;emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~(1 << irq));ll_emma2rh_gpio_irq_disable(irq); } @@ -109,7 +107,7 @@ static voidemma2rh_gpio_irq_ack(unsigned int irq)static voidemma2rh_gpio_irq_end(unsigned int irq){ if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) -ll_emma2rh_gpio_irq_enable(irq - emma2rh_gpio_irq_base); +ll_emma2rh_gpio_irq_enable(irq - EMMA2RH_GPIO_IRQ_BASE); }struct
irq_chipemma2rh_gpio_irq_controller= { @@ -121,14 +119,13 @@ structirq_chipemma2rh_gpio_irq_controller= { .end =emma2rh_gpio_irq_end, };-void
emma2rh_gpio_irq_init(u32 irq_base)+voidemma2rh_gpio_irq_init(void){ u32 i;
Quoted 9 lines
- for (i =
irq_base; i <irq_base+NUM_EMMA2RH_IRQ_GPIO; i++) -set_irq_chip(i, &emma2rh_gpio_irq_controller); - -emma2rh_gpio_irq_base=irq_base; + for (i = 0; i <NUM_EMMA2RH_IRQ_GPIO; i++) +set_irq_chip(EMMA2RH_GPIO_IRQ_BASE + i, + &emma2rh_gpio_irq_controller); }void
ll_emma2rh_gpio_irq_enable(int irq)
- --
_______________________________________
Mr Markus Gothe
Software Engineer
Phone: +46 (0)13 21 81 20 (ext. 1046)
Fax: +46 (0)13 21 21 15
Mobile: +46 (0)70 348 44 35
Diskettgatan 11, SE-583 35 Linköping, Sweden www.27m.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFJALJe6I0XmJx2NrwRCAkwAJwLnvjgZSCkD9+lc4kDtUxoOIaOGwCg0m8f tZSAE26XNDffF7fmBLRp6sI=
=WD43
-----END PGP SIGNATURE-----
PATCH 9/12 MIPS: Fold arch/mips/emma/{common,markeins}/irq*.c into markeins/irq.c
In reply to Shinya KuribayashiCurrent EMMA2RH irq code is mess. Before cleaning it up, gather them in one place as a first step.
---
arch/mips/emma/common/Makefile | 2 arch/mips/emma/common/irq.c | 105 ------------- arch/mips/emma/common/irq_emma2rh.c | 103 ------------- arch/mips/emma/markeins/Makefile | 2 arch/mips/emma/markeins/irq.c | 251 +++++++++++++++++++++++++++++++- arch/mips/emma/markeins/irq_markeins.c | 153 -------------------- 6 files changed, 249 insertions(+), 367 deletions(-)
delete mode 100644 arch/mips/emma/common/irq.c delete mode 100644 arch/mips/emma/common/irq_emma2rh.c delete mode 100644 arch/mips/emma/markeins/irq_markeins.c
arch/mips/emma/common/Makefile +0 -0
@@ -10,4 +10,4 @@
# (at your option) any later version.
#
-obj-$(CONFIG_NEC_MARKEINS) += irq.o irq_emma2rh.o prom.o
+obj-$(CONFIG_NEC_MARKEINS) += prom.o
arch/mips/emma/common/irq.c deleted +0 -105
105 lines not on this page · raw message
arch/mips/emma/common/irq_emma2rh.c deleted +0 -103
103 lines not on this page · raw message
arch/mips/emma/markeins/Makefile +0 -0
@@ -10,4 +10,4 @@
# (at your option) any later version.
#
-obj-$(CONFIG_NEC_MARKEINS) += irq.o irq_markeins.o setup.o led.o platform.o +obj-$(CONFIG_NEC_MARKEINS) += irq.o setup.o led.o platform.o
arch/mips/emma/markeins/irq.c +0 -0
@@ -38,6 +38,9 @@
#include <asm/emma/emma2rh.h>
+/* number of total irqs supported by EMMA2RH */
+#define NUM_EMMA2RH_IRQ 96
+
/*
* IRQ mapping
*
@@ -53,10 +56,180 @@
*
*/
-extern void emma2rh_sw_irq_init(void); -extern void emma2rh_gpio_irq_init(void); -extern void emma2rh_irq_init(void);
-extern void emma2rh_irq_dispatch(void);
+void ll_emma2rh_irq_enable(int emma2rh_irq) +{
+ u32 reg_value;
+ u32 reg_bitmask;
+ u32 reg_index;
+
+ reg_index = EMMA2RH_BHIF_INT_EN_0 +
+ (EMMA2RH_BHIF_INT_EN_1 - EMMA2RH_BHIF_INT_EN_0) *
+ (emma2rh_irq / 32);
+ reg_value = emma2rh_in32(reg_index);
+ reg_bitmask = 0x1 << (emma2rh_irq % 32);
+ db_assert((reg_value & reg_bitmask) == 0);
+ emma2rh_out32(reg_index, reg_value | reg_bitmask);
+}
+
+void ll_emma2rh_irq_disable(int emma2rh_irq) +{
+ u32 reg_value;
+ u32 reg_bitmask;
+ u32 reg_index;
+
+ reg_index = EMMA2RH_BHIF_INT_EN_0 +
+ (EMMA2RH_BHIF_INT_EN_1 - EMMA2RH_BHIF_INT_EN_0) *
+ (emma2rh_irq / 32);
+ reg_value = emma2rh_in32(reg_index);
+ reg_bitmask = 0x1 << (emma2rh_irq % 32);
+ db_assert((reg_value & reg_bitmask) != 0);
+ emma2rh_out32(reg_index, reg_value & ~reg_bitmask);
+}
+
+static void emma2rh_irq_enable(unsigned int irq) +{
+ ll_emma2rh_irq_enable(irq - EMMA2RH_IRQ_BASE);
+}
+
+static void emma2rh_irq_disable(unsigned int irq) +{
+ ll_emma2rh_irq_disable(irq - EMMA2RH_IRQ_BASE);
+}
+
+struct irq_chip emma2rh_irq_controller = {
+ .name = "emma2rh_irq",
+ .ack = emma2rh_irq_disable,
+ .mask = emma2rh_irq_disable,
+ .mask_ack = emma2rh_irq_disable,
+ .unmask = emma2rh_irq_enable,
+};
+
+void emma2rh_irq_init(void)
+{
+ u32 i;
+
+ for (i = 0; i < NUM_EMMA2RH_IRQ; i++)
+ set_irq_chip_and_handler(EMMA2RH_IRQ_BASE + i,
+ &emma2rh_irq_controller,
+ handle_level_irq);
+}
+
+void ll_emma2rh_sw_irq_enable(int irq)
+{
+ u32 reg;
+
+ db_assert(irq >= 0);
+ db_assert(irq < NUM_EMMA2RH_IRQ_SW);
+
+ reg = emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN);
+ reg |= 1 << irq;
+ emma2rh_out32(EMMA2RH_BHIF_SW_INT_EN, reg);
+}
+
+void ll_emma2rh_sw_irq_disable(int irq)
+{
+ u32 reg;
+
+ db_assert(irq >= 0);
+ db_assert(irq < 32);
+
+ reg = emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN);
+ reg &= ~(1 << irq);
+ emma2rh_out32(EMMA2RH_BHIF_SW_INT_EN, reg);
+}
+
+static void emma2rh_sw_irq_enable(unsigned int irq) +{
+ ll_emma2rh_sw_irq_enable(irq - EMMA2RH_SW_IRQ_BASE);
+}
+
+static void emma2rh_sw_irq_disable(unsigned int irq) +{
+ ll_emma2rh_sw_irq_disable(irq - EMMA2RH_SW_IRQ_BASE);
+}
+
+struct irq_chip emma2rh_sw_irq_controller = {
+ .name = "emma2rh_sw_irq",
+ .ack = emma2rh_sw_irq_disable,
+ .mask = emma2rh_sw_irq_disable,
+ .mask_ack = emma2rh_sw_irq_disable,
+ .unmask = emma2rh_sw_irq_enable,
+};
+
+void emma2rh_sw_irq_init(void)
+{
+ u32 i;
+
+ for (i = 0; i < NUM_EMMA2RH_IRQ_SW; i++)
+ set_irq_chip_and_handler(EMMA2RH_SW_IRQ_BASE + i,
+ &emma2rh_sw_irq_controller,
+ handle_level_irq);
+}
+
+void ll_emma2rh_gpio_irq_enable(int irq)
+{
+ u32 reg;
+
+ db_assert(irq >= 0);
+ db_assert(irq < NUM_EMMA2RH_IRQ_GPIO);
+
+ reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
+ reg |= 1 << irq;
+ emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg);
+}
+
+void ll_emma2rh_gpio_irq_disable(int irq)
+{
+ u32 reg;
+
+ db_assert(irq >= 0);
+ db_assert(irq < NUM_EMMA2RH_IRQ_GPIO);
+
+ reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
+ reg &= ~(1 << irq);
+ emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg);
+}
+
+static void emma2rh_gpio_irq_enable(unsigned int irq) +{
+ ll_emma2rh_gpio_irq_enable(irq - EMMA2RH_GPIO_IRQ_BASE);
+}
+
+static void emma2rh_gpio_irq_disable(unsigned int irq) +{
+ ll_emma2rh_gpio_irq_disable(irq - EMMA2RH_GPIO_IRQ_BASE);
+}
+
+static void emma2rh_gpio_irq_ack(unsigned int irq) +{
+ irq -= EMMA2RH_GPIO_IRQ_BASE;
+ emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~(1 << irq));
+ ll_emma2rh_gpio_irq_disable(irq);
+}
+
+static void emma2rh_gpio_irq_end(unsigned int irq) +{
+ if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
+ ll_emma2rh_gpio_irq_enable(irq - EMMA2RH_GPIO_IRQ_BASE);
+}
+
+struct irq_chip emma2rh_gpio_irq_controller = {
+ .name = "emma2rh_gpio_irq",
+ .ack = emma2rh_gpio_irq_ack,
+ .mask = emma2rh_gpio_irq_disable,
+ .mask_ack = emma2rh_gpio_irq_ack,
+ .unmask = emma2rh_gpio_irq_enable,
+ .end = emma2rh_gpio_irq_end,
+};
+
+void emma2rh_gpio_irq_init(void)
+{
+ u32 i;
+
+ for (i = 0; i < NUM_EMMA2RH_IRQ_GPIO; i++)
+ set_irq_chip(EMMA2RH_GPIO_IRQ_BASE + i,
+ &emma2rh_gpio_irq_controller);
+}
static struct irqaction irq_cascade = {
.handler = no_action,
@@ -67,6 +240,76 @@ static struct irqaction irq_cascade = {
.next = NULL,
};
+/*
+ * the first level int-handler will jump here if it is a emma2rh irq
+ */
+void emma2rh_irq_dispatch(void)
+{
+ u32 intStatus;
+ u32 bitmask;
+ u32 i;
+
+ intStatus = emma2rh_in32(EMMA2RH_BHIF_INT_ST_0) &
+ emma2rh_in32(EMMA2RH_BHIF_INT_EN_0);
+
+#ifdef EMMA2RH_SW_CASCADE
+ if (intStatus &
+ (1 << ((EMMA2RH_SW_CASCADE - EMMA2RH_IRQ_INT0) & (32 - 1)))) {
+ u32 swIntStatus;
+ swIntStatus = emma2rh_in32(EMMA2RH_BHIF_SW_INT)
+ & emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN);
+ for (i = 0, bitmask = 1; i < 32; i++, bitmask <<= 1) {
+ if (swIntStatus & bitmask) {
+ do_IRQ(EMMA2RH_SW_IRQ_BASE + i);
+ return;
+ }
+ }
+ }
+#endif
+
+ for (i = 0, bitmask = 1; i < 32; i++, bitmask <<= 1) {
+ if (intStatus & bitmask) {
+ do_IRQ(EMMA2RH_IRQ_BASE + i);
+ return;
+ }
+ }
+
+ intStatus = emma2rh_in32(EMMA2RH_BHIF_INT_ST_1) &
+ emma2rh_in32(EMMA2RH_BHIF_INT_EN_1);
+
+#ifdef EMMA2RH_GPIO_CASCADE
+ if (intStatus &
+ (1 << ((EMMA2RH_GPIO_CASCADE - EMMA2RH_IRQ_INT0) & (32 - 1)))) {
+ u32 gpioIntStatus;
+ gpioIntStatus = emma2rh_in32(EMMA2RH_GPIO_INT_ST)
+ & emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
+ for (i = 0, bitmask = 1; i < 32; i++, bitmask <<= 1) {
+ if (gpioIntStatus & bitmask) {
+ do_IRQ(EMMA2RH_GPIO_IRQ_BASE + i);
+ return;
+ }
+ }
+ }
+#endif
+
+ for (i = 32, bitmask = 1; i < 64; i++, bitmask <<= 1) {
+ if (intStatus & bitmask) {
+ do_IRQ(EMMA2RH_IRQ_BASE + i);
+ return;
+ }
+ }
+
+ intStatus = emma2rh_in32(EMMA2RH_BHIF_INT_ST_2) &
+ emma2rh_in32(EMMA2RH_BHIF_INT_EN_2);
+
+ for (i = 64, bitmask = 1; i < 96; i++, bitmask <<= 1) {
+ if (intStatus & bitmask) {
+ do_IRQ(EMMA2RH_IRQ_BASE + i);
+ return;
+ }
+ }
+}
+
void __init arch_init_irq(void)
{
u32 reg;arch/mips/emma/markeins/irq_markeins.c deleted +0 -153
153 lines not on this page · raw message
PATCH 10/12 MIPS: Markeins: Remove runtime debug prints
In reply to Shinya KuribayashiRemove runtime db_* macros as we don't need them any more. In general, such helpers are useful for initial porting, but once approved, they are not indispensable.
---arch/mips/emma/markeins/irq.c | 17 -----------------
1 files changed, 0 insertions(+), 17 deletions(-)
arch/mips/emma/markeins/irq.c +0 -0
@@ -32,7 +32,6 @@
#include <asm/irq_cpu.h>
#include <asm/system.h>
#include <asm/mipsregs.h>
-#include <asm/debug.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
@@ -67,7 +66,6 @@ void ll_emma2rh_irq_enable(int emma2rh_irq)
(emma2rh_irq / 32); reg_value = emma2rh_in32(reg_index); reg_bitmask = 0x1 << (emma2rh_irq % 32); - db_assert((reg_value & reg_bitmask) == 0); emma2rh_out32(reg_index, reg_value | reg_bitmask); }
@@ -82,7 +80,6 @@ void ll_emma2rh_irq_disable(int emma2rh_irq)
(emma2rh_irq / 32); reg_value = emma2rh_in32(reg_index); reg_bitmask = 0x1 << (emma2rh_irq % 32); - db_assert((reg_value & reg_bitmask) != 0); emma2rh_out32(reg_index, reg_value & ~reg_bitmask); }
@@ -118,9 +115,6 @@ void ll_emma2rh_sw_irq_enable(int irq)
{
u32 reg;- db_assert(irq >= 0);
- db_assert(irq < NUM_EMMA2RH_IRQ_SW);
-
reg = emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN);
reg |= 1 << irq;
emma2rh_out32(EMMA2RH_BHIF_SW_INT_EN, reg);
@@ -130,9 +124,6 @@ void ll_emma2rh_sw_irq_disable(int irq)
{
u32 reg;- db_assert(irq >= 0);
- db_assert(irq < 32);
-
reg = emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN);
reg &= ~(1 << irq);
emma2rh_out32(EMMA2RH_BHIF_SW_INT_EN, reg);
@@ -170,9 +161,6 @@ void ll_emma2rh_gpio_irq_enable(int irq)
{
u32 reg;- db_assert(irq >= 0);
- db_assert(irq < NUM_EMMA2RH_IRQ_GPIO);
-
reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
reg |= 1 << irq;
emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg);
@@ -182,9 +170,6 @@ void ll_emma2rh_gpio_irq_disable(int irq)
{
u32 reg;- db_assert(irq >= 0);
- db_assert(irq < NUM_EMMA2RH_IRQ_GPIO);
-
reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
reg &= ~(1 << irq);
emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg);
@@ -314,8 +299,6 @@ void __init arch_init_irq(void)
{
u32 reg;- db_run(printk("markeins_irq_setup invoked.\n"));
-
/* by default, interrupts are disabled. */ emma2rh_out32(EMMA2RH_BHIF_INT_EN_0, 0); emma2rh_out32(EMMA2RH_BHIF_INT_EN_1, 0);
PATCH 11/12 MIPS: Markeins: Extract ll_emma2rh_* functions
In reply to Shinya KuribayashiThese functions are completely ineffective.
---
Oops, there are more patches upto 12. The first [PATCH 00/10] is typo.
arch/mips/emma/markeins/irq.c | 83 +++++++++++++++++++----------------------
1 files changed, 38 insertions(+), 45 deletions(-)
arch/mips/emma/markeins/irq.c +1 -1
@@ -55,44 +55,36 @@* */ -void ll_emma2rh_irq_enable (int emma2rh_irq) +static void emma2rh_irq_enable (unsigned int irq)
{
u32 reg_value;
u32 reg_bitmask;
u32 reg_index;+ irq -= EMMA2RH_IRQ_BASE;
+
reg_index = EMMA2RH_BHIF_INT_EN_0 + - (EMMA2RH_BHIF_INT_EN_1 - EMMA2RH_BHIF_INT_EN_0) * - (emma2rh_irq / 32); + (EMMA2RH_BHIF_INT_EN_1 - EMMA2RH_BHIF_INT_EN_0) * (irq / 32); reg_value = emma2rh_in32(reg_index); - reg_bitmask = 0x1 << (emma2rh_irq % 32); + reg_bitmask = 0x1 << (irq % 32); emma2rh_out32(reg_index, reg_value | reg_bitmask); }
-void ll_emma2rh_irq_disable(int emma2rh_irq) +static void emma2rh_irq_disable(unsigned int irq)
{
u32 reg_value;
u32 reg_bitmask;
u32 reg_index;+ irq -= EMMA2RH_IRQ_BASE;
+
reg_index = EMMA2RH_BHIF_INT_EN_0 + - (EMMA2RH_BHIF_INT_EN_1 - EMMA2RH_BHIF_INT_EN_0) * - (emma2rh_irq / 32); + (EMMA2RH_BHIF_INT_EN_1 - EMMA2RH_BHIF_INT_EN_0) * (irq / 32); reg_value = emma2rh_in32(reg_index); - reg_bitmask = 0x1 << (emma2rh_irq % 32); + reg_bitmask = 0x1 << (irq % 32); emma2rh_out32(reg_index, reg_value & ~reg_bitmask); }
-static void emma2rh_irq_enable(unsigned int irq) -{
- ll_emma2rh_irq_enable(irq - EMMA2RH_IRQ_BASE);
-}
-
-static void emma2rh_irq_disable(unsigned int irq) -{
- ll_emma2rh_irq_disable(irq - EMMA2RH_IRQ_BASE);
-}
-
struct irq_chip emma2rh_irq_controller = {
.name = "emma2rh_irq",
.ack = emma2rh_irq_disable,
@@ -111,34 +103,28 @@ void emma2rh_irq_init(void)
handle_level_irq);
}-void ll_emma2rh_sw_irq_enable(int irq) +static void emma2rh_sw_irq_enable(unsigned int irq)
{
u32 reg;+ irq -= EMMA2RH_SW_IRQ_BASE;
+
reg = emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN); reg |= 1 << irq; emma2rh_out32(EMMA2RH_BHIF_SW_INT_EN, reg); }
-void ll_emma2rh_sw_irq_disable(int irq) +static void emma2rh_sw_irq_disable(unsigned int irq)
{
u32 reg;+ irq -= EMMA2RH_SW_IRQ_BASE;
+
reg = emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN); reg &= ~(1 << irq); emma2rh_out32(EMMA2RH_BHIF_SW_INT_EN, reg); }
-static void emma2rh_sw_irq_enable(unsigned int irq) -{
- ll_emma2rh_sw_irq_enable(irq - EMMA2RH_SW_IRQ_BASE);
-}
-
-static void emma2rh_sw_irq_disable(unsigned int irq) -{
- ll_emma2rh_sw_irq_disable(irq - EMMA2RH_SW_IRQ_BASE);
-}
-
struct irq_chip emma2rh_sw_irq_controller = {
.name = "emma2rh_sw_irq",
.ack = emma2rh_sw_irq_disable,
@@ -157,45 +143,52 @@ void emma2rh_sw_irq_init(void)
handle_level_irq);
}-void ll_emma2rh_gpio_irq_enable(int irq) +static void emma2rh_gpio_irq_enable(unsigned int irq)
{
u32 reg;+ irq -= EMMA2RH_GPIO_IRQ_BASE;
+
reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK); reg |= 1 << irq; emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg); }
-void ll_emma2rh_gpio_irq_disable(int irq) +static void emma2rh_gpio_irq_disable(unsigned int irq)
{
u32 reg;+ irq -= EMMA2RH_GPIO_IRQ_BASE;
+
reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK); reg &= ~(1 << irq); emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg); }
-static void emma2rh_gpio_irq_enable(unsigned int irq) -{
- ll_emma2rh_gpio_irq_enable(irq - EMMA2RH_GPIO_IRQ_BASE);
-}
-
-static void emma2rh_gpio_irq_disable(unsigned int irq) -{
- ll_emma2rh_gpio_irq_disable(irq - EMMA2RH_GPIO_IRQ_BASE);
-}
-
static void emma2rh_gpio_irq_ack(unsigned int irq) {
+ u32 reg;
+
irq -= EMMA2RH_GPIO_IRQ_BASE; emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~(1 << irq));
- ll_emma2rh_gpio_irq_disable(irq);
+
+ reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
+ reg &= ~(1 << irq);
+ emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg);
}
static void emma2rh_gpio_irq_end(unsigned int irq) {
- if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
- ll_emma2rh_gpio_irq_enable(irq - EMMA2RH_GPIO_IRQ_BASE);
+ u32 reg;
+
+ if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
+
+ irq -= EMMA2RH_GPIO_IRQ_BASE;
+
+ reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
+ reg |= 1 << irq;
+ emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg);
+ }
}
struct irq_chip emma2rh_gpio_irq_controller = {
PATCH 12/12 MIPS: Markeins: Remove unnecessary define and cleanup comments, etc.
In reply to Shinya Kuribayashi---arch/mips/emma/markeins/irq.c | 20 --------------------
1 files changed, 0 insertions(+), 20 deletions(-)
arch/mips/emma/markeins/irq.c +0 -0
@@ -37,24 +37,6 @@
#include <asm/emma/emma2rh.h>
-/* number of total irqs supported by EMMA2RH */
-#define NUM_EMMA2RH_IRQ 96
-
-/*
- * IRQ mapping
- *
- * 0-7: 8 CPU interrupts
- * 0 - software interrupt 0
- * 1 - software interrupt 1
- * 2 - most Vrc5477 interrupts are routed to this pin
- * 3 - (optional) some other interrupts routed to this pin for debugg
- * 4 - not used
- * 5 - not used
- * 6 - not used
- * 7 - cpu timer (used by default)
- *
- */
-
static void emma2rh_irq_enable(unsigned int irq)
{
u32 reg_value;
@@ -347,5 +329,3 @@ asmlinkage void plat_irq_dispatch(void)
else
spurious_interrupt();
}-
-
On Fri, Oct 24, 2008 at 01:23:44AM +0900, Shinya Kuribayashi wrote:
Shinya-San,
Quoted 4 lines
there have been many NEC EMMA SoCs so far, and with great pleasure we have many Linux ports running on EMMA these days. Even though most those ports are not submitted to upstream, but I'd like to reorganize current EMMA2RH ports into more easy maintainable shape as a reference.
And I hope more of the code for the reference platforms to be submitted in the future!
Quoted 8 lines
There are a lot of things to do. For the first step, I'd like to introduce
arch/mips/emma/andinclude/asm/emma/directories so that all EMMA related sourches/headers can be easily shared across various EMMA products/ports.Here's the first attempt to try to change things as mentioned above. Some possible improvements and cleanups are also included. Patches will follow, please review. Any comments are highly appreciated.
Full series applied.
Quoted 2 lines
P.S. I'm also planning to do more cleanups around IRQ codes, register
definition style, and so on. But that'll be some other time.
Whenever you're ready!
Thanks,
Ralf
Quoted 2 lines · Ralf Baechle
And I hope more of the code for the reference platforms to be submitted in the future!
Yeah, worth talking with my colleagues.
Quoted 10 lines
Quoted 8 lines
There are a lot of things to do. For the first step, I'd like to introduce
arch/mips/emma/andinclude/asm/emma/directories so that all EMMA related sourches/headers can be easily shared across various EMMA products/ports.Here's the first attempt to try to change things as mentioned above. Some possible improvements and cleanups are also included. Patches will follow, please review. Any comments are highly appreciated.
Full series applied.
I forgot to modify the <asm/emma2rh.h> references from arch/mips/pci/ {ops,pci,fixup}-emma2rh.c sources. I'll send delta patch soon, please fold it to previous one.
Anyway, thanks a lot!
Signature · 2 lines
Shinya Kuribayashi NEC Electronics
Quoted 5 lines · Shinya Kuribayashi
Quoted 2 lines · Ralf Baechle
And I hope more of the code for the reference platforms to be submitted in the future!
Yeah, worth talking with my colleagues.
There are plenty of good arguments:
o Users have direct access to uptodate code through the canical sources such as kernel.org and all the distributions based on that code. That is they can chose what they want and are not tied to a product of NEC's blessing.
o NEC's cost of development and maintenance will go down.
o A a contributors both NEC as a company and the individuals contributing code will gain a positive image.
Quoted 9 lines
Quoted 3 lines
Quoted 1 line
follow, please review. Any comments are highly appreciated.
Full series applied.
I forgot to modify the <
asm/emma2rh.h> references fromarch/mips/pci/{ops,pci,fixup}-emma2rh.c sources. I'll send delta patch soon, please fold it to previous one.Anyway, thanks a lot!
You're welcome!
Ralf