Skip to content

Commit

Permalink
sh: Get the mach-cayman IRQ support building.
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Jan 28, 2008
1 parent caead5e commit 18bc813
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 243 deletions.
1 change: 1 addition & 0 deletions arch/sh/kernel/cpu/irq/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
obj-y += intc.o

obj-$(CONFIG_SUPERH32) += imask.o
obj-$(CONFIG_CPU_SH5) += intc-sh5.o
obj-$(CONFIG_CPU_HAS_IPR_IRQ) += ipr.o
obj-$(CONFIG_CPU_HAS_MASKREG_IRQ) += maskreg.o
23 changes: 4 additions & 19 deletions arch/sh64/kernel/irq_intc.c → arch/sh/kernel/cpu/irq/intc-sh5.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,14 @@
* controller.
*
*/

#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/stddef.h>
#include <linux/bitops.h> /* this includes also <asm/registers.h */
/* which is required to remap register */
/* names used into __asm__ blocks... */

#include <asm/hardware.h>
#include <asm/platform.h>
#include <linux/bitops.h>
#include <asm/cpu/irq.h>
#include <asm/page.h>
#include <asm/io.h>
#include <asm/irq.h>

/*
* Maybe the generic Peripheral block could move to a more
Expand Down Expand Up @@ -192,7 +185,7 @@ int intc_irq_describe(char* p, int irq)
}
#endif

void __init init_IRQ(void)
void __init plat_irq_setup(void)
{
unsigned long long __dummy0, __dummy1=~0x00000000100000f0;
unsigned long reg;
Expand Down Expand Up @@ -251,14 +244,6 @@ void __init init_IRQ(void)
}
}

#ifdef CONFIG_SH_CAYMAN
{
extern void init_cayman_irq(void);

init_cayman_irq();
}
#endif

/*
* And now let interrupts come in.
* sti() is not enough, we need to
Expand Down
4 changes: 0 additions & 4 deletions arch/sh/kernel/cpu/sh5/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@ obj-y := entry.o probe.o switchto.o

obj-$(CONFIG_SH_FPU) += fpu.o
obj-$(CONFIG_KALLSYMS) += unwind.o

# CPU subtype setup
obj-$(CONFIG_CPU_SUBTYPE_SH5_101) += setup-sh5-101.o
obj-$(CONFIG_CPU_SUBTYPE_SH5_103) += setup-sh5-101.o
15 changes: 0 additions & 15 deletions arch/sh/kernel/cpu/sh5/setup-sh5-101.c

This file was deleted.

8 changes: 1 addition & 7 deletions arch/sh/mach-cayman/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#
# Makefile for the Hitachi Cayman specific parts of the kernel
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#

obj-y := setup.o irq.o iomap.o
obj-y := setup.o irq.o
obj-$(CONFIG_HEARTBEAT) += led.o

22 changes: 0 additions & 22 deletions arch/sh/mach-cayman/iomap.c

This file was deleted.

26 changes: 14 additions & 12 deletions arch/sh/mach-cayman/irq.c
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* arch/sh64/kernel/irq_cayman.c
*
* SH-5 Cayman Interrupt Support
* arch/sh/mach-cayman/irq.c - SH-5 Cayman Interrupt Support
*
* This file handles the board specific parts of the Cayman interrupt system
*
* Copyright (C) 2002 Stuart Menefy
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/

#include <asm/irq.h>
#include <asm/page.h>
#include <asm/io.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/signal.h>
#include <asm/cayman.h>
#include <asm/cpu/irq.h>
#include <asm/page.h>

/* Setup for the SMSC FDC37C935 / LAN91C100FD */
#define SMSC_IRQ IRQ_IRL1

/* Setup for PCI Bus 2, which transmits interrupts via the EPLD */
#define PCI2_IRQ IRQ_IRL3

unsigned long epld_virt;

Expand Down
94 changes: 21 additions & 73 deletions arch/sh/mach-cayman/setup.c
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* arch/sh64/mach-cayman/setup.c
* arch/sh/mach-cayman/setup.c
*
* SH5 Cayman support
*
* This file handles the architecture-dependent parts of initialization
* Copyright (C) 2002 David J. Mckay & Benedict Gaster
* Copyright (C) 2003 - 2007 Paul Mundt
*
* Copyright David J. Mckay.
* Needs major work!
*
* benedict.gaster@superh.com: 3rd May 2002
* Added support for ramdisk, removing statically linked romfs at the same time.
*
* lethal@linux-sh.org: 15th May 2003
* Use the generic procfs cpuinfo interface, just return a valid board name.
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <asm/platform.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/cpu/irq.h>

/*
* Platform Dependent Interrupt Priorities.
Expand Down Expand Up @@ -96,42 +87,6 @@

unsigned long smsc_superio_virt;

/*
* Platform dependent structures: maps and parms block.
*/
struct resource io_resources[] = {
/* To be updated with external devices */
};

struct resource kram_resources[] = {
/* These must be last in the array */
{ .name = "Kernel code", .start = 0, .end = 0 },
/* These must be last in the array */
{ .name = "Kernel data", .start = 0, .end = 0 }
};

struct resource xram_resources[] = {
/* To be updated with external devices */
};

struct resource rom_resources[] = {
/* To be updated with external devices */
};

struct sh64_platform platform_parms = {
.readonly_rootfs = 1,
.initial_root_dev = 0x0100,
.loader_type = 1,
.io_res_p = io_resources,
.io_res_count = ARRAY_SIZE(io_resources),
.kram_res_p = kram_resources,
.kram_res_count = ARRAY_SIZE(kram_resources),
.xram_res_p = xram_resources,
.xram_res_count = ARRAY_SIZE(xram_resources),
.rom_res_p = rom_resources,
.rom_res_count = ARRAY_SIZE(rom_resources),
};

int platform_int_priority[NR_INTC_IRQS] = {
IR0, IR1, IR2, IR3, PCA, PCB, PCC, PCD, /* IRQ 0- 7 */
RES, RES, RES, RES, SER, ERR, PW3, PW2, /* IRQ 8-15 */
Expand Down Expand Up @@ -210,30 +165,23 @@ static int __init smsc_superio_setup(void)

return 0;
}

/* This is grotty, but, because kernel is always referenced on the link line
* before any devices, this is safe.
*/
__initcall(smsc_superio_setup);

void __init platform_setup(void)
{
/* Cayman platform leaves the decision to head.S, for now */
platform_parms.fpu_flags = fpu_in_use;
}

void __init platform_monitor(void)
static void __iomem *cayman_ioport_map(unsigned long port, unsigned int len)
{
/* Nothing yet .. */
}
if (port < 0x400) {
extern unsigned long smsc_superio_virt;
return (void __iomem *)((port << 2) | smsc_superio_virt);
}

void __init platform_reserve(void)
{
/* Nothing yet .. */
return (void __iomem *)port;
}

const char *get_system_type(void)
{
return "Hitachi Cayman";
}
extern void init_cayman_irq(void);

static struct sh_machine_vector mv_cayman __initmv = {
.mv_name = "Hitachi Cayman",
.mv_nr_irqs = 64,
.mv_ioport_map = cayman_ioport_map,
.mv_init_irq = init_cayman_irq,
};
28 changes: 1 addition & 27 deletions include/asm-sh/cpu-sh5/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@
#define NR_EXT_IRQS 0
#endif

#define NR_IRQS (NR_INTC_IRQS+NR_EXT_IRQS)


/* Default IRQs, fixed */
#define TIMER_IRQ IRQ_TUNI0
#define RTC_IRQ IRQ_CUI
Expand All @@ -116,29 +113,6 @@

extern int intc_evt_to_irq[(0xE20/0x20)+1];
int intc_irq_describe(char* p, int irq);

#define irq_canonicalize(irq) (irq)

#ifdef CONFIG_SH_CAYMAN
int cayman_irq_demux(int evt);
int cayman_irq_describe(char* p, int irq);
#define irq_demux(x) cayman_irq_demux(x)
#define irq_describe(p, x) cayman_irq_describe(p, x)
#else
#define irq_demux(x) (intc_evt_to_irq[x])
#define irq_describe(p, x) intc_irq_describe(p, x)
#endif

/*
* Function for "on chip support modules".
*/

/*
* SH-5 supports Priority based interrupts only.
* Interrupt priorities are defined at platform level.
*/
#define set_ipr_data(a, b, c, d)
#define make_ipr_irq(a)
#define make_imask_irq(a)
extern int platform_int_priority[NR_INTC_IRQS];

#endif /* __ASM_SH64_IRQ_H */
64 changes: 0 additions & 64 deletions include/asm-sh/platform.h

This file was deleted.

0 comments on commit 18bc813

Please sign in to comment.