mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: (33 commits)
MIPS: lemote/lm2e: Added io_map_base to pci controller
MIPS: TXx9: Make firmware parameter passing more robust
MIPS: Markeins: Remove unnecessary define and cleanup comments, etc.
MIPS: Markeins: Extract ll_emma2rh_* functions
MIPS: Markeins: Remove runtime debug prints
MIPS: EMMA: Fold arch/mips/emma/{common,markeins}/irq*.c into markeins/irq.c
MIPS: EMMA2RH: Remove emma2rh_gpio_irq_base
MIPS: EMMA2RH: Remove emma2rh_sw_irq_base
MIPS: EMMA2RH: Remove emma2rh_irq_base global variable
MIPS: EMMA2RH: Remove emma2rh_sync on read operation
MIPS: EMMA: Move <asm/emma2rh> to <asm/emma> dir
MIPS: EMMA: Move arch/mips/emma2rh/ into arch/mips/emma/
MIPS: EMMA: Kconfig reorganization
MIPS: Add CONFIG_CPU_R5500 for NEC VR5500 series processors
MIPS: RB532: Disable the right device
MIPS: Add support for NXP PNX833x (STB222/5) into linux kernel
MIPS: TXx9: CONFIG_TOSHIBA_RBTX4939 spelling
MIPS: Fix KGDB build error
INPUT: sgi_btns: Add license specification
MIPS: IP22: ip22-int.c header file weeding.
...
This commit is contained in:
@@ -238,21 +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_R5000
|
||||
help
|
||||
This enables support for the R5432-based NEC Mark-eins
|
||||
boards with R5500 CPU.
|
||||
config MACH_EMMA
|
||||
bool "NEC EMMA series based machines"
|
||||
|
||||
config MACH_VR41XX
|
||||
bool "NEC VR4100 series based machines"
|
||||
@@ -261,6 +248,19 @@ config MACH_VR41XX
|
||||
select SYS_HAS_CPU_VR41XX
|
||||
select GENERIC_HARDIRQS_NO__DO_IRQ
|
||||
|
||||
config NXP_STB220
|
||||
bool "NXP STB220 board"
|
||||
select SOC_PNX833X
|
||||
help
|
||||
Support for NXP Semiconductors STB220 Development Board.
|
||||
|
||||
config NXP_STB225
|
||||
bool "NXP 225 board"
|
||||
select SOC_PNX833X
|
||||
select SOC_PNX8335
|
||||
help
|
||||
Support for NXP Semiconductors STB225 Development Board.
|
||||
|
||||
config PNX8550_JBS
|
||||
bool "NXP PNX8550 based JBS board"
|
||||
select PNX8550
|
||||
@@ -601,6 +601,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"
|
||||
@@ -849,6 +850,24 @@ config MIPS_RM9122
|
||||
bool
|
||||
select SERIAL_RM9000
|
||||
|
||||
config SOC_PNX833X
|
||||
bool
|
||||
select CEVT_R4K
|
||||
select CSRC_R4K
|
||||
select IRQ_CPU
|
||||
select DMA_NONCOHERENT
|
||||
select SYS_HAS_CPU_MIPS32_R2
|
||||
select SYS_SUPPORTS_32BIT_KERNEL
|
||||
select SYS_SUPPORTS_LITTLE_ENDIAN
|
||||
select SYS_SUPPORTS_BIG_ENDIAN
|
||||
select GENERIC_HARDIRQS_NO__DO_IRQ
|
||||
select GENERIC_GPIO
|
||||
select CPU_MIPSR2_IRQ_VI
|
||||
|
||||
config SOC_PNX8335
|
||||
bool
|
||||
select SOC_PNX833X
|
||||
|
||||
config PNX8550
|
||||
bool
|
||||
select SOC_PNX8550
|
||||
@@ -1092,6 +1111,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 +1231,9 @@ config SYS_HAS_CPU_R5000
|
||||
config SYS_HAS_CPU_R5432
|
||||
bool
|
||||
|
||||
config SYS_HAS_CPU_R5500
|
||||
bool
|
||||
|
||||
config SYS_HAS_CPU_R6000
|
||||
bool
|
||||
|
||||
|
||||
@@ -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) \
|
||||
@@ -381,6 +383,14 @@ load-$(CONFIG_CASIO_E55) += 0xffffffff80004000
|
||||
#
|
||||
load-$(CONFIG_TANBAC_TB022X) += 0xffffffff80000000
|
||||
|
||||
# NXP STB225
|
||||
core-$(CONFIG_SOC_PNX833X) += arch/mips/nxp/pnx833x/common/
|
||||
cflags-$(CONFIG_SOC_PNX833X) += -Iarch/mips/include/asm/mach-pnx833x
|
||||
libs-$(CONFIG_NXP_STB220) += arch/mips/nxp/pnx833x/stb22x/
|
||||
load-$(CONFIG_NXP_STB220) += 0xffffffff80001000
|
||||
libs-$(CONFIG_NXP_STB225) += arch/mips/nxp/pnx833x/stb22x/
|
||||
load-$(CONFIG_NXP_STB225) += 0xffffffff80001000
|
||||
|
||||
#
|
||||
# Common NXP PNX8550
|
||||
#
|
||||
@@ -399,14 +409,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
|
||||
# Common NEC EMMAXXX
|
||||
#
|
||||
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_MARKEINS) += arch/mips/emma2rh/markeins/
|
||||
load-$(CONFIG_MARKEINS) += 0xffffffff88100000
|
||||
#
|
||||
core-$(CONFIG_NEC_MARKEINS) += arch/mips/emma/markeins/
|
||||
load-$(CONFIG_NEC_MARKEINS) += 0xffffffff88100000
|
||||
|
||||
#
|
||||
# SGI IP22 (Indy/Indigo2)
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#include <linux/init.h>
|
||||
|
||||
#include <asm/mach-au1x00/au1xxx.h>
|
||||
#include <asm/mach-au1x00/au1xxx_dbdma.h>
|
||||
#include <asm/mach-au1x00/au1100_mmc.h>
|
||||
|
||||
#define PORT(_base, _irq) \
|
||||
{ \
|
||||
@@ -163,24 +165,6 @@ static struct resource au1xxx_usb_gdt_resources[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static struct resource au1xxx_mmc_resources[] = {
|
||||
[0] = {
|
||||
.start = SD0_PHYS_ADDR,
|
||||
.end = SD0_PHYS_ADDR + 0x7ffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = SD1_PHYS_ADDR,
|
||||
.end = SD1_PHYS_ADDR + 0x7ffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[2] = {
|
||||
.start = AU1200_SD_INT,
|
||||
.end = AU1200_SD_INT,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
}
|
||||
};
|
||||
|
||||
static u64 udc_dmamask = DMA_32BIT_MASK;
|
||||
|
||||
static struct platform_device au1xxx_usb_gdt_device = {
|
||||
@@ -249,16 +233,79 @@ static struct platform_device au1200_lcd_device = {
|
||||
|
||||
static u64 au1xxx_mmc_dmamask = DMA_32BIT_MASK;
|
||||
|
||||
static struct platform_device au1xxx_mmc_device = {
|
||||
extern struct au1xmmc_platform_data au1xmmc_platdata[2];
|
||||
|
||||
static struct resource au1200_mmc0_resources[] = {
|
||||
[0] = {
|
||||
.start = SD0_PHYS_ADDR,
|
||||
.end = SD0_PHYS_ADDR + 0x7ffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = AU1200_SD_INT,
|
||||
.end = AU1200_SD_INT,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
[2] = {
|
||||
.start = DSCR_CMD0_SDMS_TX0,
|
||||
.end = DSCR_CMD0_SDMS_TX0,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
[3] = {
|
||||
.start = DSCR_CMD0_SDMS_RX0,
|
||||
.end = DSCR_CMD0_SDMS_RX0,
|
||||
.flags = IORESOURCE_DMA,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device au1200_mmc0_device = {
|
||||
.name = "au1xxx-mmc",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.dma_mask = &au1xxx_mmc_dmamask,
|
||||
.coherent_dma_mask = DMA_32BIT_MASK,
|
||||
.dma_mask = &au1xxx_mmc_dmamask,
|
||||
.coherent_dma_mask = DMA_32BIT_MASK,
|
||||
.platform_data = &au1xmmc_platdata[0],
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(au1xxx_mmc_resources),
|
||||
.resource = au1xxx_mmc_resources,
|
||||
.num_resources = ARRAY_SIZE(au1200_mmc0_resources),
|
||||
.resource = au1200_mmc0_resources,
|
||||
};
|
||||
|
||||
#ifndef CONFIG_MIPS_DB1200
|
||||
static struct resource au1200_mmc1_resources[] = {
|
||||
[0] = {
|
||||
.start = SD1_PHYS_ADDR,
|
||||
.end = SD1_PHYS_ADDR + 0x7ffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = AU1200_SD_INT,
|
||||
.end = AU1200_SD_INT,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
[2] = {
|
||||
.start = DSCR_CMD0_SDMS_TX1,
|
||||
.end = DSCR_CMD0_SDMS_TX1,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
[3] = {
|
||||
.start = DSCR_CMD0_SDMS_RX1,
|
||||
.end = DSCR_CMD0_SDMS_RX1,
|
||||
.flags = IORESOURCE_DMA,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device au1200_mmc1_device = {
|
||||
.name = "au1xxx-mmc",
|
||||
.id = 1,
|
||||
.dev = {
|
||||
.dma_mask = &au1xxx_mmc_dmamask,
|
||||
.coherent_dma_mask = DMA_32BIT_MASK,
|
||||
.platform_data = &au1xmmc_platdata[1],
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(au1200_mmc1_resources),
|
||||
.resource = au1200_mmc1_resources,
|
||||
};
|
||||
#endif /* #ifndef CONFIG_MIPS_DB1200 */
|
||||
#endif /* #ifdef CONFIG_SOC_AU1200 */
|
||||
|
||||
static struct platform_device au1x00_pcmcia_device = {
|
||||
@@ -296,7 +343,10 @@ static struct platform_device *au1xxx_platform_devices[] __initdata = {
|
||||
&au1xxx_usb_gdt_device,
|
||||
&au1xxx_usb_otg_device,
|
||||
&au1200_lcd_device,
|
||||
&au1xxx_mmc_device,
|
||||
&au1200_mmc0_device,
|
||||
#ifndef CONFIG_MIPS_DB1200
|
||||
&au1200_mmc1_device,
|
||||
#endif
|
||||
#endif
|
||||
#ifdef SMBUS_PSC_BASE
|
||||
&pbdb_smbus_device,
|
||||
|
||||
@@ -20,9 +20,90 @@
|
||||
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/leds.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <asm/mach-au1x00/au1xxx.h>
|
||||
#include <asm/mach-au1x00/au1100_mmc.h>
|
||||
|
||||
static int mmc_activity;
|
||||
|
||||
static void pb1200mmc0_set_power(void *mmc_host, int state)
|
||||
{
|
||||
if (state)
|
||||
bcsr->board |= BCSR_BOARD_SD0PWR;
|
||||
else
|
||||
bcsr->board &= ~BCSR_BOARD_SD0PWR;
|
||||
|
||||
au_sync_delay(1);
|
||||
}
|
||||
|
||||
static int pb1200mmc0_card_readonly(void *mmc_host)
|
||||
{
|
||||
return (bcsr->status & BCSR_STATUS_SD0WP) ? 1 : 0;
|
||||
}
|
||||
|
||||
static int pb1200mmc0_card_inserted(void *mmc_host)
|
||||
{
|
||||
return (bcsr->sig_status & BCSR_INT_SD0INSERT) ? 1 : 0;
|
||||
}
|
||||
|
||||
static void pb1200_mmcled_set(struct led_classdev *led,
|
||||
enum led_brightness brightness)
|
||||
{
|
||||
if (brightness != LED_OFF) {
|
||||
if (++mmc_activity == 1)
|
||||
bcsr->disk_leds &= ~(1 << 8);
|
||||
} else {
|
||||
if (--mmc_activity == 0)
|
||||
bcsr->disk_leds |= (1 << 8);
|
||||
}
|
||||
}
|
||||
|
||||
static struct led_classdev pb1200mmc_led = {
|
||||
.brightness_set = pb1200_mmcled_set,
|
||||
};
|
||||
|
||||
#ifndef CONFIG_MIPS_DB1200
|
||||
static void pb1200mmc1_set_power(void *mmc_host, int state)
|
||||
{
|
||||
if (state)
|
||||
bcsr->board |= BCSR_BOARD_SD1PWR;
|
||||
else
|
||||
bcsr->board &= ~BCSR_BOARD_SD1PWR;
|
||||
|
||||
au_sync_delay(1);
|
||||
}
|
||||
|
||||
static int pb1200mmc1_card_readonly(void *mmc_host)
|
||||
{
|
||||
return (bcsr->status & BCSR_STATUS_SD1WP) ? 1 : 0;
|
||||
}
|
||||
|
||||
static int pb1200mmc1_card_inserted(void *mmc_host)
|
||||
{
|
||||
return (bcsr->sig_status & BCSR_INT_SD1INSERT) ? 1 : 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
const struct au1xmmc_platform_data au1xmmc_platdata[2] = {
|
||||
[0] = {
|
||||
.set_power = pb1200mmc0_set_power,
|
||||
.card_inserted = pb1200mmc0_card_inserted,
|
||||
.card_readonly = pb1200mmc0_card_readonly,
|
||||
.cd_setup = NULL, /* use poll-timer in driver */
|
||||
.led = &pb1200mmc_led,
|
||||
},
|
||||
#ifndef CONFIG_MIPS_DB1200
|
||||
[1] = {
|
||||
.set_power = pb1200mmc1_set_power,
|
||||
.card_inserted = pb1200mmc1_card_inserted,
|
||||
.card_readonly = pb1200mmc1_card_readonly,
|
||||
.cd_setup = NULL, /* use poll-timer in driver */
|
||||
.led = &pb1200mmc_led,
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct resource ide_resources[] = {
|
||||
[0] = {
|
||||
|
||||
1149
arch/mips/configs/pnx8335-stb225_defconfig
Normal file
1149
arch/mips/configs/pnx8335-stb225_defconfig
Normal file
File diff suppressed because it is too large
Load Diff
29
arch/mips/emma/Kconfig
Normal file
29
arch/mips/emma/Kconfig
Normal file
@@ -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
|
||||
@@ -10,4 +10,4 @@
|
||||
# (at your option) any later version.
|
||||
#
|
||||
|
||||
obj-$(CONFIG_MARKEINS) += irq.o irq_emma2rh.o prom.o
|
||||
obj-$(CONFIG_NEC_MARKEINS) += prom.o
|
||||
@@ -29,11 +29,11 @@
|
||||
|
||||
#include <asm/addrspace.h>
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/emma2rh/emma2rh.h>
|
||||
#include <asm/emma/emma2rh.h>
|
||||
|
||||
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
|
||||
@@ -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 setup.o led.o platform.o
|
||||
331
arch/mips/emma/markeins/irq.c
Normal file
331
arch/mips/emma/markeins/irq.c
Normal file
@@ -0,0 +1,331 @@
|
||||
/*
|
||||
* arch/mips/emma2rh/markeins/irq.c
|
||||
* This file defines the irq handler for EMMA2RH.
|
||||
*
|
||||
* Copyright (C) NEC Electronics Corporation 2004-2006
|
||||
*
|
||||
* This file is based on the arch/mips/ddb5xxx/ddb5477/irq.c
|
||||
*
|
||||
* Copyright 2001 MontaVista Software Inc.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
#include <asm/irq_cpu.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/mipsregs.h>
|
||||
#include <asm/addrspace.h>
|
||||
#include <asm/bootinfo.h>
|
||||
|
||||
#include <asm/emma/emma2rh.h>
|
||||
|
||||
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) * (irq / 32);
|
||||
reg_value = emma2rh_in32(reg_index);
|
||||
reg_bitmask = 0x1 << (irq % 32);
|
||||
emma2rh_out32(reg_index, reg_value | reg_bitmask);
|
||||
}
|
||||
|
||||
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) * (irq / 32);
|
||||
reg_value = emma2rh_in32(reg_index);
|
||||
reg_bitmask = 0x1 << (irq % 32);
|
||||
emma2rh_out32(reg_index, reg_value & ~reg_bitmask);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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_ack(unsigned int irq)
|
||||
{
|
||||
u32 reg;
|
||||
|
||||
irq -= EMMA2RH_GPIO_IRQ_BASE;
|
||||
emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~(1 << 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)
|
||||
{
|
||||
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 = {
|
||||
.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,
|
||||
.flags = 0,
|
||||
.mask = CPU_MASK_NONE,
|
||||
.name = "cascade",
|
||||
.dev_id = NULL,
|
||||
.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;
|
||||
|
||||
/* by default, interrupts are disabled. */
|
||||
emma2rh_out32(EMMA2RH_BHIF_INT_EN_0, 0);
|
||||
emma2rh_out32(EMMA2RH_BHIF_INT_EN_1, 0);
|
||||
emma2rh_out32(EMMA2RH_BHIF_INT_EN_2, 0);
|
||||
emma2rh_out32(EMMA2RH_BHIF_INT1_EN_0, 0);
|
||||
emma2rh_out32(EMMA2RH_BHIF_INT1_EN_1, 0);
|
||||
emma2rh_out32(EMMA2RH_BHIF_INT1_EN_2, 0);
|
||||
emma2rh_out32(EMMA2RH_BHIF_SW_INT_EN, 0);
|
||||
|
||||
clear_c0_status(0xff00);
|
||||
set_c0_status(0x0400);
|
||||
|
||||
#define GPIO_PCI (0xf<<15)
|
||||
/* setup GPIO interrupt for PCI interface */
|
||||
/* direction input */
|
||||
reg = emma2rh_in32(EMMA2RH_GPIO_DIR);
|
||||
emma2rh_out32(EMMA2RH_GPIO_DIR, reg & ~GPIO_PCI);
|
||||
/* disable interrupt */
|
||||
reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
|
||||
emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg & ~GPIO_PCI);
|
||||
/* level triggerd */
|
||||
reg = emma2rh_in32(EMMA2RH_GPIO_INT_MODE);
|
||||
emma2rh_out32(EMMA2RH_GPIO_INT_MODE, reg | GPIO_PCI);
|
||||
reg = emma2rh_in32(EMMA2RH_GPIO_INT_CND_A);
|
||||
emma2rh_out32(EMMA2RH_GPIO_INT_CND_A, reg & (~GPIO_PCI));
|
||||
/* interrupt clear */
|
||||
emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~GPIO_PCI);
|
||||
|
||||
/* init all controllers */
|
||||
emma2rh_irq_init();
|
||||
emma2rh_sw_irq_init();
|
||||
emma2rh_gpio_irq_init();
|
||||
mips_cpu_irq_init();
|
||||
|
||||
/* setup cascade interrupts */
|
||||
setup_irq(EMMA2RH_IRQ_BASE + EMMA2RH_SW_CASCADE, &irq_cascade);
|
||||
setup_irq(EMMA2RH_IRQ_BASE + EMMA2RH_GPIO_CASCADE, &irq_cascade);
|
||||
setup_irq(CPU_IRQ_BASE + CPU_EMMA2RH_CASCADE, &irq_cascade);
|
||||
}
|
||||
|
||||
asmlinkage void plat_irq_dispatch(void)
|
||||
{
|
||||
unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
|
||||
|
||||
if (pending & STATUSF_IP7)
|
||||
do_IRQ(CPU_IRQ_BASE + 7);
|
||||
else if (pending & STATUSF_IP2)
|
||||
emma2rh_irq_dispatch();
|
||||
else if (pending & STATUSF_IP1)
|
||||
do_IRQ(CPU_IRQ_BASE + 1);
|
||||
else if (pending & STATUSF_IP0)
|
||||
do_IRQ(CPU_IRQ_BASE + 0);
|
||||
else
|
||||
spurious_interrupt();
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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 */
|
||||
@@ -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 */
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
* arch/mips/emma2rh/common/irq.c
|
||||
* This file is common irq dispatcher.
|
||||
*
|
||||
* Copyright (C) NEC Electronics Corporation 2005-2006
|
||||
*
|
||||
* This file is based on the arch/mips/ddb5xxx/ddb5477/irq.c
|
||||
*
|
||||
* Copyright 2001 MontaVista Software Inc.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <asm/system.h>
|
||||
#include <asm/mipsregs.h>
|
||||
#include <asm/addrspace.h>
|
||||
#include <asm/bootinfo.h>
|
||||
|
||||
#include <asm/emma2rh/emma2rh.h>
|
||||
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
/*
|
||||
* arch/mips/emma2rh/common/irq_emma2rh.c
|
||||
* This file defines the irq handler for EMMA2RH.
|
||||
*
|
||||
* Copyright (C) NEC Electronics Corporation 2005-2006
|
||||
*
|
||||
* This file is based on the arch/mips/ddb5xxx/ddb5477/irq_5477.c
|
||||
*
|
||||
* Copyright 2001 MontaVista Software Inc.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* EMMA2RH defines 64 IRQs.
|
||||
*
|
||||
* This file exports one function:
|
||||
* emma2rh_irq_init(u32 irq_base);
|
||||
*/
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/ptrace.h>
|
||||
|
||||
#include <asm/debug.h>
|
||||
|
||||
#include <asm/emma2rh/emma2rh.h>
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
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(u32 irq_base)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ; i++)
|
||||
set_irq_chip_and_handler(i, &emma2rh_irq_controller,
|
||||
handle_level_irq);
|
||||
|
||||
emma2rh_irq_base = irq_base;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -1,132 +0,0 @@
|
||||
/*
|
||||
* arch/mips/emma2rh/markeins/irq.c
|
||||
* This file defines the irq handler for EMMA2RH.
|
||||
*
|
||||
* Copyright (C) NEC Electronics Corporation 2004-2006
|
||||
*
|
||||
* This file is based on the arch/mips/ddb5xxx/ddb5477/irq.c
|
||||
*
|
||||
* Copyright 2001 MontaVista Software Inc.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
#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>
|
||||
|
||||
#include <asm/emma2rh/emma2rh.h>
|
||||
|
||||
/*
|
||||
* 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)
|
||||
*
|
||||
*/
|
||||
|
||||
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_dispatch(void);
|
||||
|
||||
static struct irqaction irq_cascade = {
|
||||
.handler = no_action,
|
||||
.flags = 0,
|
||||
.mask = CPU_MASK_NONE,
|
||||
.name = "cascade",
|
||||
.dev_id = NULL,
|
||||
.next = NULL,
|
||||
};
|
||||
|
||||
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);
|
||||
emma2rh_out32(EMMA2RH_BHIF_INT_EN_2, 0);
|
||||
emma2rh_out32(EMMA2RH_BHIF_INT1_EN_0, 0);
|
||||
emma2rh_out32(EMMA2RH_BHIF_INT1_EN_1, 0);
|
||||
emma2rh_out32(EMMA2RH_BHIF_INT1_EN_2, 0);
|
||||
emma2rh_out32(EMMA2RH_BHIF_SW_INT_EN, 0);
|
||||
|
||||
clear_c0_status(0xff00);
|
||||
set_c0_status(0x0400);
|
||||
|
||||
#define GPIO_PCI (0xf<<15)
|
||||
/* setup GPIO interrupt for PCI interface */
|
||||
/* direction input */
|
||||
reg = emma2rh_in32(EMMA2RH_GPIO_DIR);
|
||||
emma2rh_out32(EMMA2RH_GPIO_DIR, reg & ~GPIO_PCI);
|
||||
/* disable interrupt */
|
||||
reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
|
||||
emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg & ~GPIO_PCI);
|
||||
/* level triggerd */
|
||||
reg = emma2rh_in32(EMMA2RH_GPIO_INT_MODE);
|
||||
emma2rh_out32(EMMA2RH_GPIO_INT_MODE, reg | GPIO_PCI);
|
||||
reg = emma2rh_in32(EMMA2RH_GPIO_INT_CND_A);
|
||||
emma2rh_out32(EMMA2RH_GPIO_INT_CND_A, reg & (~GPIO_PCI));
|
||||
/* interrupt clear */
|
||||
emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~GPIO_PCI);
|
||||
|
||||
/* init all controllers */
|
||||
emma2rh_irq_init(EMMA2RH_IRQ_BASE);
|
||||
emma2rh_sw_irq_init(EMMA2RH_SW_IRQ_BASE);
|
||||
emma2rh_gpio_irq_init(EMMA2RH_GPIO_IRQ_BASE);
|
||||
mips_cpu_irq_init();
|
||||
|
||||
/* setup cascade interrupts */
|
||||
setup_irq(EMMA2RH_IRQ_BASE + EMMA2RH_SW_CASCADE, &irq_cascade);
|
||||
setup_irq(EMMA2RH_IRQ_BASE + EMMA2RH_GPIO_CASCADE, &irq_cascade);
|
||||
setup_irq(CPU_IRQ_BASE + CPU_EMMA2RH_CASCADE, &irq_cascade);
|
||||
}
|
||||
|
||||
asmlinkage void plat_irq_dispatch(void)
|
||||
{
|
||||
unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
|
||||
|
||||
if (pending & STATUSF_IP7)
|
||||
do_IRQ(CPU_IRQ_BASE + 7);
|
||||
else if (pending & STATUSF_IP2)
|
||||
emma2rh_irq_dispatch();
|
||||
else if (pending & STATUSF_IP1)
|
||||
do_IRQ(CPU_IRQ_BASE + 1);
|
||||
else if (pending & STATUSF_IP0)
|
||||
do_IRQ(CPU_IRQ_BASE + 0);
|
||||
else
|
||||
spurious_interrupt();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,158 +0,0 @@
|
||||
/*
|
||||
* arch/mips/emma2rh/markeins/irq_markeins.c
|
||||
* This file defines the irq handler for Mark-eins.
|
||||
*
|
||||
* Copyright (C) NEC Electronics Corporation 2004-2006
|
||||
*
|
||||
* This file is based on the arch/mips/ddb5xxx/ddb5477/irq_5477.c
|
||||
*
|
||||
* Copyright 2001 MontaVista Software Inc.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/ptrace.h>
|
||||
|
||||
#include <asm/debug.h>
|
||||
#include <asm/emma2rh/emma2rh.h>
|
||||
|
||||
static int emma2rh_sw_irq_base = -1;
|
||||
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);
|
||||
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);
|
||||
}
|
||||
|
||||
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(u32 irq_base)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ_SW; i++)
|
||||
set_irq_chip_and_handler(i, &emma2rh_sw_irq_controller,
|
||||
handle_level_irq);
|
||||
|
||||
emma2rh_sw_irq_base = irq_base;
|
||||
}
|
||||
|
||||
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_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(u32 irq_base)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -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
|
||||
@@ -21,8 +21,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef __ASM_EMMA2RH_EMMA2RH_H
|
||||
#define __ASM_EMMA2RH_EMMA2RH_H
|
||||
#ifndef __ASM_EMMA_EMMA2RH_H
|
||||
#define __ASM_EMMA_EMMA2RH_H
|
||||
|
||||
#include <irq.h>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -324,10 +321,10 @@ static inline u8 emma2rh_in8(u32 offset)
|
||||
/*
|
||||
* include the board dependent part
|
||||
*/
|
||||
#if defined(CONFIG_MARKEINS)
|
||||
#include <asm/emma2rh/markeins.h>
|
||||
#ifdef CONFIG_NEC_MARKEINS
|
||||
#include <asm/emma/markeins.h>
|
||||
#else
|
||||
#error "Unknown EMMA2RH board!"
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_EMMA2RH_EMMA2RH_H */
|
||||
#endif /* __ASM_EMMA_EMMA2RH_H */
|
||||
30
arch/mips/include/asm/mach-lemote/pci.h
Normal file
30
arch/mips/include/asm/mach-lemote/pci.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2008 Zhang Le <r0bertz@gentoo.org>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
|
||||
* 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef _LEMOTE_PCI_H_
|
||||
#define _LEMOTE_PCI_H_
|
||||
|
||||
#define LOONGSON2E_PCI_MEM_START 0x14000000UL
|
||||
#define LOONGSON2E_PCI_MEM_END 0x1fffffffUL
|
||||
#define LOONGSON2E_PCI_IO_START 0x00004000UL
|
||||
#define LOONGSON2E_IO_PORT_BASE 0x1fd00000UL
|
||||
|
||||
#endif /* !_LEMOTE_PCI_H_ */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user