Commit 9c57548f authored by Paul Mundt's avatar Paul Mundt

sh: rts7751r2d board updates.

This tidies up some of the rts7751r2d mess and gets it booting
again. Update the defconfig, too.
Signed-off-by: default avatarMasayuki Hosokawa <hosokawa@ace-jp.com>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent e65fa9f5
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
# Makefile for the RTS7751R2D specific parts of the kernel # Makefile for the RTS7751R2D specific parts of the kernel
# #
obj-y := setup.o io.o irq.o obj-y := setup.o irq.o
/*
* Copyright (C) 2001 Ian da Silva, Jeremy Siegel
* Based largely on io_se.c.
*
* I/O routine for Renesas Technology sales RTS7751R2D.
*
* Initial version only to support LAN access; some
* placeholder code from io_rts7751r2d.c left in with the
* expectation of later SuperIO and PCMCIA access.
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/io.h>
#include <asm/rts7751r2d.h>
#include <asm/addrspace.h>
/*
* The 7751R RTS7751R2D uses the built-in PCI controller (PCIC)
* of the 7751R processor, and has a SuperIO accessible via the PCI.
* The board also includes a PCMCIA controller on its memory bus,
* like the other Solution Engine boards.
*/
static inline unsigned long port2adr(unsigned int port)
{
if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6)
if (port == 0x3f6)
return (PA_AREA5_IO + 0x80c);
else
return (PA_AREA5_IO + 0x1000 + ((port-0x1f0) << 1));
else
maybebadio((unsigned long)port);
return port;
}
static inline unsigned long port88796l(unsigned int port, int flag)
{
unsigned long addr;
if (flag)
addr = PA_AX88796L + ((port - AX88796L_IO_BASE) << 1);
else
addr = PA_AX88796L + ((port - AX88796L_IO_BASE) << 1) + 0x1000;
return addr;
}
/* The 7751R RTS7751R2D seems to have everything hooked */
/* up pretty normally (nothing on high-bytes only...) so this */
/* shouldn't be needed */
static inline int shifted_port(unsigned long port)
{
/* For IDE registers, value is not shifted */
if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6)
return 0;
else
return 1;
}
#if defined(CONFIG_NE2000) || defined(CONFIG_NE2000_MODULE)
#define CHECK_AX88796L_PORT(port) \
((port >= AX88796L_IO_BASE) && (port < (AX88796L_IO_BASE+0x20)))
#else
#define CHECK_AX88796L_PORT(port) (0)
#endif
/*
* General outline: remap really low stuff [eventually] to SuperIO,
* stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO)
* is mapped through the PCI IO window. Stuff with high bits (PXSEG)
* should be way beyond the window, and is used w/o translation for
* compatibility.
*/
unsigned char rts7751r2d_inb(unsigned long port)
{
if (CHECK_AX88796L_PORT(port))
return (*(volatile unsigned short *)port88796l(port, 0)) & 0xff;
else if (PXSEG(port))
return *(volatile unsigned char *)port;
else if (is_pci_ioaddr(port) || shifted_port(port))
return *(volatile unsigned char *)pci_ioaddr(port);
else
return (*(volatile unsigned short *)port2adr(port) & 0xff);
}
unsigned char rts7751r2d_inb_p(unsigned long port)
{
unsigned char v;
if (CHECK_AX88796L_PORT(port))
v = (*(volatile unsigned short *)port88796l(port, 0)) & 0xff;
else if (PXSEG(port))
v = *(volatile unsigned char *)port;
else if (is_pci_ioaddr(port) || shifted_port(port))
v = *(volatile unsigned char *)pci_ioaddr(port);
else
v = (*(volatile unsigned short *)port2adr(port) & 0xff);
ctrl_delay();
return v;
}
unsigned short rts7751r2d_inw(unsigned long port)
{
if (CHECK_AX88796L_PORT(port))
maybebadio(port);
else if (PXSEG(port))
return *(volatile unsigned short *)port;
else if (is_pci_ioaddr(port) || shifted_port(port))
return *(volatile unsigned short *)pci_ioaddr(port);
else
maybebadio(port);
return 0;
}
unsigned int rts7751r2d_inl(unsigned long port)
{
if (CHECK_AX88796L_PORT(port))
maybebadio(port);
else if (PXSEG(port))
return *(volatile unsigned long *)port;
else if (is_pci_ioaddr(port) || shifted_port(port))
return *(volatile unsigned long *)pci_ioaddr(port);
else
maybebadio(port);
return 0;
}
void rts7751r2d_outb(unsigned char value, unsigned long port)
{
if (CHECK_AX88796L_PORT(port))
*((volatile unsigned short *)port88796l(port, 0)) = value;
else if (PXSEG(port))
*(volatile unsigned char *)port = value;
else if (is_pci_ioaddr(port) || shifted_port(port))
*(volatile unsigned char *)pci_ioaddr(port) = value;
else
*(volatile unsigned short *)port2adr(port) = value;
}
void rts7751r2d_outb_p(unsigned char value, unsigned long port)
{
if (CHECK_AX88796L_PORT(port))
*((volatile unsigned short *)port88796l(port, 0)) = value;
else if (PXSEG(port))
*(volatile unsigned char *)port = value;
else if (is_pci_ioaddr(port) || shifted_port(port))
*(volatile unsigned char *)pci_ioaddr(port) = value;
else
*(volatile unsigned short *)port2adr(port) = value;
ctrl_delay();
}
void rts7751r2d_outw(unsigned short value, unsigned long port)
{
if (CHECK_AX88796L_PORT(port))
maybebadio(port);
else if (PXSEG(port))
*(volatile unsigned short *)port = value;
else if (is_pci_ioaddr(port) || shifted_port(port))
*(volatile unsigned short *)pci_ioaddr(port) = value;
else
maybebadio(port);
}
void rts7751r2d_outl(unsigned int value, unsigned long port)
{
if (CHECK_AX88796L_PORT(port))
maybebadio(port);
else if (PXSEG(port))
*(volatile unsigned long *)port = value;
else if (is_pci_ioaddr(port) || shifted_port(port))
*(volatile unsigned long *)pci_ioaddr(port) = value;
else
maybebadio(port);
}
void rts7751r2d_insb(unsigned long port, void *addr, unsigned long count)
{
unsigned long a = (unsigned long)addr;
volatile __u8 *bp;
volatile __u16 *p;
if (CHECK_AX88796L_PORT(port)) {
p = (volatile unsigned short *)port88796l(port, 0);
while (count--)
ctrl_outb(*p & 0xff, a++);
} else if (PXSEG(port))
while (count--)
ctrl_outb(ctrl_inb(port), a++);
else if (is_pci_ioaddr(port) || shifted_port(port)) {
bp = (__u8 *)pci_ioaddr(port);
while (count--)
ctrl_outb(*bp, a++);
} else {
p = (volatile unsigned short *)port2adr(port);
while (count--)
ctrl_outb(*p & 0xff, a++);
}
}
void rts7751r2d_insw(unsigned long port, void *addr, unsigned long count)
{
unsigned long a = (unsigned long)addr;
volatile __u16 *p;
if (CHECK_AX88796L_PORT(port))
p = (volatile unsigned short *)port88796l(port, 1);
else if (PXSEG(port))
p = (volatile unsigned short *)port;
else if (is_pci_ioaddr(port) || shifted_port(port))
p = (volatile unsigned short *)pci_ioaddr(port);
else
p = (volatile unsigned short *)port2adr(port);
while (count--)
ctrl_outw(*p, a++);
}
void rts7751r2d_insl(unsigned long port, void *addr, unsigned long count)
{
if (CHECK_AX88796L_PORT(port))
maybebadio(port);
else if (is_pci_ioaddr(port) || shifted_port(port)) {
unsigned long a = (unsigned long)addr;
while (count--) {
ctrl_outl(ctrl_inl(pci_ioaddr(port)), a);
a += 4;
}
} else
maybebadio(port);
}
void rts7751r2d_outsb(unsigned long port, const void *addr, unsigned long count)
{
unsigned long a = (unsigned long)addr;
volatile __u8 *bp;
volatile __u16 *p;
if (CHECK_AX88796L_PORT(port)) {
p = (volatile unsigned short *)port88796l(port, 0);
while (count--)
*p = ctrl_inb(a++);
} else if (PXSEG(port))
while (count--)
ctrl_outb(a++, port);
else if (is_pci_ioaddr(port) || shifted_port(port)) {
bp = (__u8 *)pci_ioaddr(port);
while (count--)
*bp = ctrl_inb(a++);
} else {
p = (volatile unsigned short *)port2adr(port);
while (count--)
*p = ctrl_inb(a++);
}
}
void rts7751r2d_outsw(unsigned long port, const void *addr, unsigned long count)
{
unsigned long a = (unsigned long)addr;
volatile __u16 *p;
if (CHECK_AX88796L_PORT(port))
p = (volatile unsigned short *)port88796l(port, 1);
else if (PXSEG(port))
p = (volatile unsigned short *)port;
else if (is_pci_ioaddr(port) || shifted_port(port))
p = (volatile unsigned short *)pci_ioaddr(port);
else
p = (volatile unsigned short *)port2adr(port);
while (count--) {
ctrl_outw(*p, a);
a += 2;
}
}
void rts7751r2d_outsl(unsigned long port, const void *addr, unsigned long count)
{
if (CHECK_AX88796L_PORT(port))
maybebadio(port);
else if (is_pci_ioaddr(port) || shifted_port(port)) {
unsigned long a = (unsigned long)addr;
while (count--) {
ctrl_outl(ctrl_inl(a), pci_ioaddr(port));
a += 4;
}
} else
maybebadio(port);
}
unsigned long rts7751r2d_isa_port2addr(unsigned long offset)
{
return port2adr(offset);
}
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
* Atom Create Engineering Co., Ltd. 2002. * Atom Create Engineering Co., Ltd. 2002.
*/ */
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/io.h> #include <linux/io.h>
#include <asm/rts7751r2d.h> #include <asm/rts7751r2d.h>
...@@ -22,79 +24,31 @@ static int mask_pos[] = {6, 11, 9, 8, 12, 10, 5, 4, 7, 14, 13, 0, 0, 0, 0}; ...@@ -22,79 +24,31 @@ static int mask_pos[] = {6, 11, 9, 8, 12, 10, 5, 4, 7, 14, 13, 0, 0, 0, 0};
extern int voyagergx_irq_demux(int irq); extern int voyagergx_irq_demux(int irq);
extern void setup_voyagergx_irq(void); extern void setup_voyagergx_irq(void);
static void enable_rts7751r2d_irq(unsigned int irq); static void enable_rts7751r2d_irq(unsigned int irq)
static void disable_rts7751r2d_irq(unsigned int irq);
/* shutdown is same as "disable" */
#define shutdown_rts7751r2d_irq disable_rts7751r2d_irq
static void ack_rts7751r2d_irq(unsigned int irq);
static void end_rts7751r2d_irq(unsigned int irq);
static unsigned int startup_rts7751r2d_irq(unsigned int irq)
{ {
enable_rts7751r2d_irq(irq); /* Set priority in IPR back to original value */
return 0; /* never anything pending */ ctrl_outw(ctrl_inw(IRLCNTR1) | (1 << mask_pos[irq]), IRLCNTR1);
} }
static void disable_rts7751r2d_irq(unsigned int irq) static void disable_rts7751r2d_irq(unsigned int irq)
{ {
unsigned short val;
unsigned short mask = 0xffff ^ (0x0001 << mask_pos[irq]);
/* Set the priority in IPR to 0 */ /* Set the priority in IPR to 0 */
val = ctrl_inw(IRLCNTR1); ctrl_outw(ctrl_inw(IRLCNTR1) & (0xffff ^ (1 << mask_pos[irq])),
val &= mask; IRLCNTR1);
ctrl_outw(val, IRLCNTR1);
}
static void enable_rts7751r2d_irq(unsigned int irq)
{
unsigned short val;
unsigned short value = (0x0001 << mask_pos[irq]);
/* Set priority in IPR back to original value */
val = ctrl_inw(IRLCNTR1);
val |= value;
ctrl_outw(val, IRLCNTR1);
} }
int rts7751r2d_irq_demux(int irq) int rts7751r2d_irq_demux(int irq)
{ {
int demux_irq; return voyagergx_irq_demux(irq);
demux_irq = voyagergx_irq_demux(irq);
return demux_irq;
}
static void ack_rts7751r2d_irq(unsigned int irq)
{
disable_rts7751r2d_irq(irq);
} }
static void end_rts7751r2d_irq(unsigned int irq) static struct irq_chip rts7751r2d_irq_chip __read_mostly = {
{ .name = "rts7751r2d",
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) .mask = disable_rts7751r2d_irq,
enable_rts7751r2d_irq(irq); .unmask = enable_rts7751r2d_irq,
} .mask_ack = disable_rts7751r2d_irq,
static struct hw_interrupt_type rts7751r2d_irq_type = {
.typename = "RTS7751R2D IRQ",
.startup = startup_rts7751r2d_irq,
.shutdown = shutdown_rts7751r2d_irq,
.enable = enable_rts7751r2d_irq,
.disable = disable_rts7751r2d_irq,
.ack = ack_rts7751r2d_irq,
.end = end_rts7751r2d_irq,
}; };
static void make_rts7751r2d_irq(unsigned int irq)
{
disable_irq_nosync(irq);
irq_desc[irq].chip = &rts7751r2d_irq_type;
disable_rts7751r2d_irq(irq);
}
/* /*
* Initialize IRQ setting * Initialize IRQ setting
*/ */
...@@ -119,8 +73,12 @@ void __init init_rts7751r2d_IRQ(void) ...@@ -119,8 +73,12 @@ void __init init_rts7751r2d_IRQ(void)
* IRL14=Extention #3 * IRL14=Extention #3
*/ */
for (i=0; i<15; i++) for (i=0; i<15; i++) {
make_rts7751r2d_irq(i); disable_irq_nosync(i);
set_irq_chip_and_handler_name(i, &rts7751r2d_irq_chip,
handle_level_irq, "level");
enable_rts7751r2d_irq(i);
}
setup_voyagergx_irq(); setup_voyagergx_irq();
} }
/* /*
* Renesas Technology Sales RTS7751R2D Support. * Renesas Technology Sales RTS7751R2D Support.
* *
* Copyright (C) 2002 Atom Create Engineering Co., Ltd. * Copyright (C) 2002 - 2006 Atom Create Engineering Co., Ltd.
* Copyright (C) 2004 - 2006 Paul Mundt * Copyright (C) 2004 - 2007 Paul Mundt
* *
* This file is subject to the terms and conditions of the GNU General Public * 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 * License. See the file "COPYING" in the main directory of this archive
...@@ -10,33 +10,13 @@ ...@@ -10,33 +10,13 @@
*/ */
#include <linux/init.h> #include <linux/init.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pata_platform.h>
#include <linux/serial_8250.h> #include <linux/serial_8250.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <asm/machvec.h> #include <asm/machvec.h>
#include <asm/mach/rts7751r2d.h> #include <asm/rts7751r2d.h>
#include <asm/io.h>
#include <asm/voyagergx.h> #include <asm/voyagergx.h>
#include <asm/io.h>
extern void heartbeat_rts7751r2d(void);
extern void init_rts7751r2d_IRQ(void);
extern int rts7751r2d_irq_demux(int irq);
extern void *voyagergx_consistent_alloc(struct device *, size_t, dma_addr_t *, gfp_t);
extern int voyagergx_consistent_free(struct device *, size_t, void *, dma_addr_t);
static struct plat_serial8250_port uart_platform_data[] = {
{
.membase = (void *)VOYAGER_UART_BASE,
.mapbase = VOYAGER_UART_BASE,
.iotype = UPIO_MEM,
.irq = VOYAGER_UART0_IRQ,
.flags = UPF_BOOT_AUTOCONF,
.regshift = 2,
.uartclk = (9600 * 16),
}, {
.flags = 0,
},
};
static void __init voyagergx_serial_init(void) static void __init voyagergx_serial_init(void)
{ {
...@@ -45,25 +25,72 @@ static void __init voyagergx_serial_init(void) ...@@ -45,25 +25,72 @@ static void __init voyagergx_serial_init(void)
/* /*
* GPIO Control * GPIO Control
*/ */
val = inl(GPIO_MUX_HIGH); val = readl((void __iomem *)GPIO_MUX_HIGH);
val |= 0x00001fe0; val |= 0x00001fe0;
outl(val, GPIO_MUX_HIGH); writel(val, (void __iomem *)GPIO_MUX_HIGH);
/* /*
* Power Mode Gate * Power Mode Gate
*/ */
val = inl(POWER_MODE0_GATE); val = readl((void __iomem *)POWER_MODE0_GATE);
val |= (POWER_MODE0_GATE_U0 | POWER_MODE0_GATE_U1); val |= (POWER_MODE0_GATE_U0 | POWER_MODE0_GATE_U1);
outl(val, POWER_MODE0_GATE); writel(val, (void __iomem *)POWER_MODE0_GATE);
val = inl(POWER_MODE1_GATE); val = readl((void __iomem *)POWER_MODE1_GATE);
val |= (POWER_MODE1_GATE_U0 | POWER_MODE1_GATE_U1); val |= (POWER_MODE1_GATE_U0 | POWER_MODE1_GATE_U1);
outl(val, POWER_MODE1_GATE); writel(val, (void __iomem *)POWER_MODE1_GATE);
} }
static struct resource cf_ide_resources[] = {
[0] = {
.start = PA_AREA5_IO + 0x1000,
.end = PA_AREA5_IO + 0x1000 + 0x08 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = PA_AREA5_IO + 0x80c,
.end = PA_AREA5_IO + 0x80c + 0x16 - 1,
.flags = IORESOURCE_MEM,
},
[2] = {
#ifdef CONFIG_RTS7751R2D_REV11
.start = 1,
#else
.start = 2,
#endif
.flags = IORESOURCE_IRQ,
},
};
static struct pata_platform_info pata_info = {
.ioport_shift = 1,
};
static struct platform_device cf_ide_device = {
.name = "pata_platform",
.id = -1,
.num_resources = ARRAY_SIZE(cf_ide_resources),
.resource = cf_ide_resources,
.dev = {
.platform_data = &pata_info,
},
};
static struct plat_serial8250_port uart_platform_data[] = {
{
.membase = (void __iomem *)VOYAGER_UART_BASE,
.mapbase = VOYAGER_UART_BASE,
.iotype = UPIO_MEM,
.irq = VOYAGER_UART0_IRQ,
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
.regshift = 2,
.uartclk = (9600 * 16),
}
};
static struct platform_device uart_device = { static struct platform_device uart_device = {
.name = "serial8250", .name = "serial8250",
.id = -1, .id = PLAT8250_DEV_PLATFORM,
.dev = { .dev = {
.platform_data = uart_platform_data, .platform_data = uart_platform_data,
}, },
...@@ -87,6 +114,7 @@ static struct platform_device heartbeat_device = { ...@@ -87,6 +114,7 @@ static struct platform_device heartbeat_device = {
static struct platform_device *rts7751r2d_devices[] __initdata = { static struct platform_device *rts7751r2d_devices[] __initdata = {
&uart_device, &uart_device,
&heartbeat_device, &heartbeat_device,
&cf_ide_device,
}; };
static int __init rts7751r2d_devices_setup(void) static int __init rts7751r2d_devices_setup(void)
...@@ -94,6 +122,7 @@ static int __init rts7751r2d_devices_setup(void) ...@@ -94,6 +122,7 @@ static int __init rts7751r2d_devices_setup(void)
return platform_add_devices(rts7751r2d_devices, return platform_add_devices(rts7751r2d_devices,
ARRAY_SIZE(rts7751r2d_devices)); ARRAY_SIZE(rts7751r2d_devices));
} }
__initcall(rts7751r2d_devices_setup);
static void rts7751r2d_power_off(void) static void rts7751r2d_power_off(void)
{ {
...@@ -105,14 +134,17 @@ static void rts7751r2d_power_off(void) ...@@ -105,14 +134,17 @@ static void rts7751r2d_power_off(void)
*/ */
static void __init rts7751r2d_setup(char **cmdline_p) static void __init rts7751r2d_setup(char **cmdline_p)
{ {
device_initcall(rts7751r2d_devices_setup); u16 ver = ctrl_inw(PA_VERREG);
printk(KERN_INFO "Renesas Technology Sales RTS7751R2D support.\n");
printk(KERN_INFO "FPGA version:%d (revision:%d)\n",
(ver >> 4) & 0xf, ver & 0xf);
ctrl_outw(0x0000, PA_OUTPORT); ctrl_outw(0x0000, PA_OUTPORT);
pm_power_off = rts7751r2d_power_off; pm_power_off = rts7751r2d_power_off;
voyagergx_serial_init(); voyagergx_serial_init();
printk(KERN_INFO "Renesas Technology Sales RTS7751R2D support.\n");
} }
/* /*
...@@ -123,27 +155,6 @@ struct sh_machine_vector mv_rts7751r2d __initmv = { ...@@ -123,27 +155,6 @@ struct sh_machine_vector mv_rts7751r2d __initmv = {
.mv_setup = rts7751r2d_setup, .mv_setup = rts7751r2d_setup,
.mv_nr_irqs = 72, .mv_nr_irqs = 72,
.mv_inb = rts7751r2d_inb,
.mv_inw = rts7751r2d_inw,
.mv_inl = rts7751r2d_inl,
.mv_outb = rts7751r2d_outb,
.mv_outw = rts7751r2d_outw,
.mv_outl = rts7751r2d_outl,
.mv_inb_p = rts7751r2d_inb_p,
.mv_inw_p = rts7751r2d_inw,
.mv_inl_p = rts7751r2d_inl,
.mv_outb_p = rts7751r2d_outb_p,
.mv_outw_p = rts7751r2d_outw,
.mv_outl_p = rts7751r2d_outl,
.mv_insb = rts7751r2d_insb,
.mv_insw = rts7751r2d_insw,
.mv_insl = rts7751r2d_insl,
.mv_outsb = rts7751r2d_outsb,
.mv_outsw = rts7751r2d_outsw,
.mv_outsl = rts7751r2d_outsl,
.mv_init_irq = init_rts7751r2d_IRQ, .mv_init_irq = init_rts7751r2d_IRQ,
.mv_irq_demux = rts7751r2d_irq_demux, .mv_irq_demux = rts7751r2d_irq_demux,
......
...@@ -28,21 +28,21 @@ static void disable_voyagergx_irq(unsigned int irq) ...@@ -28,21 +28,21 @@ static void disable_voyagergx_irq(unsigned int irq)
unsigned long val; unsigned long val;
unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE); unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE);
pr_debug("disable_voyagergx_irq(%d): mask=%lx\n", irq, mask); pr_debug("disable_voyagergx_irq(%d): mask=%x\n", irq, mask);
val = inl(VOYAGER_INT_MASK); val = readl((void __iomem *)VOYAGER_INT_MASK);
val &= ~mask; val &= ~mask;
outl(val, VOYAGER_INT_MASK); writel(val, (void __iomem *)VOYAGER_INT_MASK);
} }
static void enable_voyagergx_irq(unsigned int irq) static void enable_voyagergx_irq(unsigned int irq)
{ {
unsigned long val; unsigned long val;
unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE); unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE);
pr_debug("disable_voyagergx_irq(%d): mask=%lx\n", irq, mask); pr_debug("disable_voyagergx_irq(%d): mask=%x\n", irq, mask);
val = inl(VOYAGER_INT_MASK); val = readl((void __iomem *)VOYAGER_INT_MASK);
val |= mask; val |= mask;
outl(val, VOYAGER_INT_MASK); writel(val, (void __iomem *)VOYAGER_INT_MASK);
} }
static void mask_and_ack_voyagergx(unsigned int irq) static void mask_and_ack_voyagergx(unsigned int irq)
...@@ -68,20 +68,20 @@ static void shutdown_voyagergx_irq(unsigned int irq) ...@@ -68,20 +68,20 @@ static void shutdown_voyagergx_irq(unsigned int irq)
} }
static struct hw_interrupt_type voyagergx_irq_type = { static struct hw_interrupt_type voyagergx_irq_type = {
.typename = "VOYAGERGX-IRQ", .typename = "VOYAGERGX-IRQ",
.startup = startup_voyagergx_irq, .startup = startup_voyagergx_irq,
.shutdown = shutdown_voyagergx_irq, .shutdown = shutdown_voyagergx_irq,
.enable = enable_voyagergx_irq, .enable = enable_voyagergx_irq,
.disable = disable_voyagergx_irq, .disable = disable_voyagergx_irq,
.ack = mask_and_ack_voyagergx, .ack = mask_and_ack_voyagergx,
.end = end_voyagergx_irq, .end = end_voyagergx_irq,
}; };
static irqreturn_t voyagergx_interrupt(int irq, void *dev_id) static irqreturn_t voyagergx_interrupt(int irq, void *dev_id)
{ {
printk(KERN_INFO printk(KERN_INFO
"VoyagerGX: spurious interrupt, status: 0x%x\n", "VoyagerGX: spurious interrupt, status: 0x%x\n",
inl(INT_STATUS)); (unsigned int)readl((void __iomem *)INT_STATUS));
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -93,13 +93,13 @@ static struct { ...@@ -93,13 +93,13 @@ static struct {
void voyagergx_register_irq_demux(int irq, void voyagergx_register_irq_demux(int irq,
int (*demux)(int irq, void *dev), void *dev) int (*demux)(int irq, void *dev), void *dev)
{ {
voyagergx_demux[irq - VOYAGER_IRQ_BASE].func = demux; voyagergx_demux[irq - VOYAGER_IRQ_BASE].func = demux;
voyagergx_demux[irq - VOYAGER_IRQ_BASE].dev = dev; voyagergx_demux[irq - VOYAGER_IRQ_BASE].dev = dev;
} }
void voyagergx_unregister_irq_demux(int irq) void voyagergx_unregister_irq_demux(int irq)
{ {
voyagergx_demux[irq - VOYAGER_IRQ_BASE].func = 0; voyagergx_demux[irq - VOYAGER_IRQ_BASE].func = 0;
} }
int voyagergx_irq_demux(int irq) int voyagergx_irq_demux(int irq)
...@@ -107,31 +107,25 @@ int voyagergx_irq_demux(int irq) ...@@ -107,31 +107,25 @@ int voyagergx_irq_demux(int irq)
if (irq == IRQ_VOYAGER ) { if (irq == IRQ_VOYAGER ) {
unsigned long i = 0, bit __attribute__ ((unused)); unsigned long i = 0, bit __attribute__ ((unused));
unsigned long val = inl(INT_STATUS); unsigned long val = readl((void __iomem *)INT_STATUS);
#if 1
if ( val & ( 1 << 1 )){ if (val & (1 << 1))
i = 1; i = 1;
} else if ( val & ( 1 << 2 )){ else if (val & (1 << 2))
i = 2; i = 2;
} else if ( val & ( 1 << 6 )){ else if (val & (1 << 6))
i = 6; i = 6;
} else if( val & ( 1 << 10 )){ else if (val & (1 << 10))
i = 10; i = 10;
} else if( val & ( 1 << 11 )){ else if (val & (1 << 11))
i = 11; i = 11;
} else if( val & ( 1 << 12 )){ else if (val & (1 << 12))
i = 12; i = 12;
} else if( val & ( 1 << 17 )){ else if (val & (1 << 17))
i = 17; i = 17;
} else { else
printk("Unexpected IRQ irq = %d status = 0x%08lx\n", irq, val); printk("Unexpected IRQ irq = %d status = 0x%08lx\n", irq, val);
} pr_debug("voyagergx_irq_demux %d \n", i);
pr_debug("voyagergx_irq_demux %ld\n", i);
#else
for (bit = 1, i = 0 ; i < VOYAGER_IRQ_NUM ; bit <<= 1, i++)
if (val & bit)
break;
#endif
if (i < VOYAGER_IRQ_NUM) { if (i < VOYAGER_IRQ_NUM) {
irq = VOYAGER_IRQ_BASE + i; irq = VOYAGER_IRQ_BASE + i;
if (voyagergx_demux[i].func != 0) if (voyagergx_demux[i].func != 0)
......
...@@ -19,7 +19,7 @@ static int __init setup_voyagergx(void) ...@@ -19,7 +19,7 @@ static int __init setup_voyagergx(void)
{ {
unsigned long val; unsigned long val;
val = inl(DRAM_CTRL); val = readl((void __iomem *)DRAM_CTRL);
val |= (DRAM_CTRL_CPU_COLUMN_SIZE_256 | val |= (DRAM_CTRL_CPU_COLUMN_SIZE_256 |
DRAM_CTRL_CPU_ACTIVE_PRECHARGE | DRAM_CTRL_CPU_ACTIVE_PRECHARGE |
DRAM_CTRL_CPU_RESET | DRAM_CTRL_CPU_RESET |
...@@ -29,7 +29,7 @@ static int __init setup_voyagergx(void) ...@@ -29,7 +29,7 @@ static int __init setup_voyagergx(void)
DRAM_CTRL_ACTIVE_PRECHARGE | DRAM_CTRL_ACTIVE_PRECHARGE |
DRAM_CTRL_RESET | DRAM_CTRL_RESET |
DRAM_CTRL_REMAIN_ACTIVE); DRAM_CTRL_REMAIN_ACTIVE);
outl(val, DRAM_CTRL); writel(val, (void __iomem *)DRAM_CTRL);
return 0; return 0;
} }
......
This diff is collapsed.
...@@ -46,11 +46,13 @@ static struct platform_device rtc_device = { ...@@ -46,11 +46,13 @@ static struct platform_device rtc_device = {
static struct plat_sci_port sci_platform_data[] = { static struct plat_sci_port sci_platform_data[] = {
{ {
#ifndef CONFIG_SH_RTS7751R2D
.mapbase = 0xffe00000, .mapbase = 0xffe00000,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.type = PORT_SCI, .type = PORT_SCI,
.irqs = { 23, 24, 25, 0 }, .irqs = { 23, 24, 25, 0 },
}, { }, {
#endif
.mapbase = 0xffe80000, .mapbase = 0xffe80000,
.flags = UPF_BOOT_AUTOCONF, .flags = UPF_BOOT_AUTOCONF,
.type = PORT_SCIF, .type = PORT_SCIF,
......
/* $Id: io_generic.c,v 1.2 2003/05/04 19:29:53 lethal Exp $ /*
* * arch/sh/kernel/io_generic.c
* linux/arch/sh/kernel/io_generic.c
* *
* Copyright (C) 2000 Niibe Yutaka * Copyright (C) 2000 Niibe Yutaka
* Copyright (C) 2005 Paul Mundt * Copyright (C) 2005 - 2007 Paul Mundt
* *
* Generic I/O routine. These can be used where a machine specific version * Generic I/O routine. These can be used where a machine specific version
* is not required. * is not required.
...@@ -13,8 +12,9 @@ ...@@ -13,8 +12,9 @@
* for more details. * for more details.
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <asm/io.h> #include <linux/io.h>
#include <asm/machvec.h> #include <asm/machvec.h>
#include <asm/cacheflush.h>
#ifdef CONFIG_CPU_SH3 #ifdef CONFIG_CPU_SH3
/* SH3 has a PCMCIA bug that needs a dummy read from area 6 for a /* SH3 has a PCMCIA bug that needs a dummy read from area 6 for a
...@@ -96,6 +96,7 @@ void generic_insw(unsigned long port, void *dst, unsigned long count) ...@@ -96,6 +96,7 @@ void generic_insw(unsigned long port, void *dst, unsigned long count)
while (count--) while (count--)
*buf++ = *port_addr; *buf++ = *port_addr;
flush_dcache_all();
dummy_read(); dummy_read();
} }
...@@ -170,6 +171,7 @@ void generic_outsw(unsigned long port, const void *src, unsigned long count) ...@@ -170,6 +171,7 @@ void generic_outsw(unsigned long port, const void *src, unsigned long count)
while (count--) while (count--)
*port_addr = *buf++; *port_addr = *buf++;
flush_dcache_all();
dummy_read(); dummy_read();
} }
......
...@@ -68,6 +68,10 @@ ...@@ -68,6 +68,10 @@
#define IRQ_PCISLOT2 10 /* PCI Slot #2 IRQ */ #define IRQ_PCISLOT2 10 /* PCI Slot #2 IRQ */
#define IRQ_EXTENTION 11 /* EXTn IRQ */ #define IRQ_EXTENTION 11 /* EXTn IRQ */
/* arch/sh/boards/renesas/rts7751r2d/irq.c */
void init_rts7751r2d_IRQ(void);
int rts7751r2d_irq_demux(int);
#define __IO_PREFIX rts7751r2d #define __IO_PREFIX rts7751r2d
#include <asm/io_generic.h> #include <asm/io_generic.h>
......
...@@ -29,10 +29,7 @@ ...@@ -29,10 +29,7 @@
#else #else
#define SERIAL_PORT_DFNS \ #define SERIAL_PORT_DFNS
/* UART CLK PORT IRQ FLAGS */ \
{ 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
{ 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS } /* ttyS1 */
#endif #endif
......
...@@ -308,6 +308,9 @@ ...@@ -308,6 +308,9 @@
#define AC97C_READ (1 << 19) #define AC97C_READ (1 << 19)
#define AC97C_WD_BIT (1 << 2) #define AC97C_WD_BIT (1 << 2)
#define AC97C_INDEX_MASK 0x7f #define AC97C_INDEX_MASK 0x7f
/* -------------------------------------------------------------------- */
/* arch/sh/cchips/voyagergx/consistent.c */
void *voyagergx_consistent_alloc(struct device *, size_t, dma_addr_t *, gfp_t);
int voyagergx_consistent_free(struct device *, size_t, void *, dma_addr_t);
#endif /* _VOYAGER_GX_REG_H */ #endif /* _VOYAGER_GX_REG_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment