Commit 23680863 authored by Hirokazu Takata's avatar Hirokazu Takata Committed by Linus Torvalds

[PATCH] m32r: Support M3A-2170(Mappi-III) platform

This patchset is for supporting a new m32r platform, M3A-2170(Mappi-III)
evaluation board.  An M32R chip multiprocessor is equipped on the board.
http://http://www.linux-m32r.org/eng/platform/platform.html

	* arch/m32r/Kconfig: Support Mappi-III platform.
	* arch/m32r/kernel/Makefile: ditto.
	* arch/m32r/kernel/io_mappi3.c: ditto.
	* arch/m32r/kernel/setup.c: ditto.
	* arch/m32r/kernel/setup_mappi3.c: ditto.
	* include/asm-m32r/m32102.h: ditto.
	* include/asm-m32r/m32r.h: ditto.
	* include/asm-m32r/mappi3/mappi3_pld.h: ditto.

	* include/asm-m32r/ide.h: CF support for Mappi-III.
	* arch/m32r/kernel/setup_mappi3.c: ditto.

	* arch/m32r/mappi3/defconfig.smp: A default config file for Mappi-III.
	* arch/m32r/mappi3/dot.gdbinit: A default .gdbinit file for Mappi-III.

	* arch/m32r/boot/compressed/m32r_sio.c: Modified for Mappi-III
	  - At boot time, m32r-g00ff bootloader makes MMU off for Mappi-III,
	    on the contrary it makes MMU on for Mappi-II.

	* arch/m32r/kernel/io_mappi2.c: Update comments.
	* arch/m32r/kernel/setup_mappi2.c: ditto.
Signed-off-by: default avatarMamoru Sakugawa <sakugawa@linux-m32r.org>
Signed-off-by: default avatarHirokazu Takata <takata@linux-m32r.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d4c477ca
...@@ -78,6 +78,9 @@ config PLAT_OAKS32R ...@@ -78,6 +78,9 @@ config PLAT_OAKS32R
config PLAT_MAPPI2 config PLAT_MAPPI2
bool "Mappi-II(M3A-ZA36/M3A-ZA52)" bool "Mappi-II(M3A-ZA36/M3A-ZA52)"
config PLAT_MAPPI3
bool "Mappi-III(M3A-2170)"
endchoice endchoice
choice choice
...@@ -134,6 +137,7 @@ config BUS_CLOCK ...@@ -134,6 +137,7 @@ config BUS_CLOCK
int "Bus Clock [Hz] (integer)" int "Bus Clock [Hz] (integer)"
default "70000000" if PLAT_MAPPI default "70000000" if PLAT_MAPPI
default "25000000" if PLAT_USRV default "25000000" if PLAT_USRV
default "50000000" if PLAT_MAPPI3
default "50000000" if PLAT_M32700UT default "50000000" if PLAT_M32700UT
default "50000000" if PLAT_OPSPUT default "50000000" if PLAT_OPSPUT
default "33333333" if PLAT_OAKS32R default "33333333" if PLAT_OAKS32R
...@@ -149,7 +153,7 @@ config CPU_LITTLE_ENDIAN ...@@ -149,7 +153,7 @@ config CPU_LITTLE_ENDIAN
config MEMORY_START config MEMORY_START
hex "Physical memory start address (hex)" hex "Physical memory start address (hex)"
default "08000000" if PLAT_MAPPI || PLAT_MAPPI2 default "08000000" if PLAT_MAPPI || PLAT_MAPPI2 || PLAT_MAPPI3
default "08000000" if PLAT_USRV default "08000000" if PLAT_USRV
default "08000000" if PLAT_M32700UT default "08000000" if PLAT_M32700UT
default "08000000" if PLAT_OPSPUT default "08000000" if PLAT_OPSPUT
...@@ -157,6 +161,7 @@ config MEMORY_START ...@@ -157,6 +161,7 @@ config MEMORY_START
config MEMORY_SIZE config MEMORY_SIZE
hex "Physical memory size (hex)" hex "Physical memory size (hex)"
default "08000000" if PLAT_MAPPI3
default "04000000" if PLAT_MAPPI || PLAT_MAPPI2 default "04000000" if PLAT_MAPPI || PLAT_MAPPI2
default "02000000" if PLAT_USRV default "02000000" if PLAT_USRV
default "01000000" if PLAT_M32700UT default "01000000" if PLAT_M32700UT
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <asm/processor.h>
static void putc(char c); static void putc(char c);
...@@ -38,16 +39,17 @@ static int puts(const char *s) ...@@ -38,16 +39,17 @@ static int puts(const char *s)
static void putc(char c) static void putc(char c)
{ {
while ((*BOOT_SIO0STS & 0x3) != 0x3)
while ((*BOOT_SIO0STS & 0x3) != 0x3) ; cpu_relax();
if (c == '\n') { if (c == '\n') {
*BOOT_SIO0TXB = '\r'; *BOOT_SIO0TXB = '\r';
while ((*BOOT_SIO0STS & 0x3) != 0x3) ; while ((*BOOT_SIO0STS & 0x3) != 0x3)
cpu_relax();
} }
*BOOT_SIO0TXB = c; *BOOT_SIO0TXB = c;
} }
#else /* defined(CONFIG_PLAT_M32700UT_Alpha) || defined(CONFIG_PLAT_M32700UT) */ #else /* !(CONFIG_PLAT_M32700UT_Alpha) && !(CONFIG_PLAT_M32700UT) */
#ifdef CONFIG_MMU #if defined(CONFIG_PLAT_MAPPI2)
#define SIO0STS (volatile unsigned short *)(0xa0efd000 + 14) #define SIO0STS (volatile unsigned short *)(0xa0efd000 + 14)
#define SIO0TXB (volatile unsigned short *)(0xa0efd000 + 30) #define SIO0TXB (volatile unsigned short *)(0xa0efd000 + 30)
#else #else
...@@ -57,11 +59,12 @@ static void putc(char c) ...@@ -57,11 +59,12 @@ static void putc(char c)
static void putc(char c) static void putc(char c)
{ {
while ((*SIO0STS & 0x1) == 0)
while ((*SIO0STS & 0x1) == 0) ; cpu_relax();
if (c == '\n') { if (c == '\n') {
*SIO0TXB = '\r'; *SIO0TXB = '\r';
while ((*SIO0STS & 0x1) == 0) ; while ((*SIO0STS & 0x1) == 0)
cpu_relax();
} }
*SIO0TXB = c; *SIO0TXB = c;
} }
......
...@@ -10,6 +10,7 @@ obj-y := process.o entry.o traps.o align.o irq.o setup.o time.o \ ...@@ -10,6 +10,7 @@ obj-y := process.o entry.o traps.o align.o irq.o setup.o time.o \
obj-$(CONFIG_SMP) += smp.o smpboot.o obj-$(CONFIG_SMP) += smp.o smpboot.o
obj-$(CONFIG_PLAT_MAPPI) += setup_mappi.o io_mappi.o obj-$(CONFIG_PLAT_MAPPI) += setup_mappi.o io_mappi.o
obj-$(CONFIG_PLAT_MAPPI2) += setup_mappi2.o io_mappi2.o obj-$(CONFIG_PLAT_MAPPI2) += setup_mappi2.o io_mappi2.o
obj-$(CONFIG_PLAT_MAPPI3) += setup_mappi3.o io_mappi3.o
obj-$(CONFIG_PLAT_USRV) += setup_usrv.o io_usrv.o obj-$(CONFIG_PLAT_USRV) += setup_usrv.o io_usrv.o
obj-$(CONFIG_PLAT_M32700UT) += setup_m32700ut.o io_m32700ut.o obj-$(CONFIG_PLAT_M32700UT) += setup_m32700ut.o io_m32700ut.o
obj-$(CONFIG_PLAT_OPSPUT) += setup_opsput.o io_opsput.o obj-$(CONFIG_PLAT_OPSPUT) += setup_opsput.o io_opsput.o
...@@ -17,4 +18,3 @@ obj-$(CONFIG_MODULES) += module.o ...@@ -17,4 +18,3 @@ obj-$(CONFIG_MODULES) += module.o
obj-$(CONFIG_PLAT_OAKS32R) += setup_oaks32r.o io_oaks32r.o obj-$(CONFIG_PLAT_OAKS32R) += setup_oaks32r.o io_oaks32r.o
EXTRA_AFLAGS := -traditional EXTRA_AFLAGS := -traditional
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* *
* Typical I/O routines for M32700UT board. * Typical I/O routines for M32700UT board.
* *
* Copyright (c) 2001, 2002 Hiroyuki Kondo, Hirokazu Takata, * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
* Hitoshi Yamamoto, Takeo Takahashi * Hitoshi Yamamoto, Takeo Takahashi
* *
* This file is subject to the terms and conditions of the GNU General * 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 * Public License. See the file "COPYING" in the main directory of this
...@@ -172,64 +172,21 @@ unsigned long _inl(unsigned long port) ...@@ -172,64 +172,21 @@ unsigned long _inl(unsigned long port)
unsigned char _inb_p(unsigned long port) unsigned char _inb_p(unsigned long port)
{ {
unsigned char v; unsigned char v = _inb(port);
if (port >= LAN_IOSTART && port < LAN_IOEND)
v = _ne_inb(PORT2ADDR_NE(port));
else
#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
return *(volatile unsigned char *)__port2addr_ata(port);
} else
#endif
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
unsigned char b;
pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0);
return b;
} else
#endif
v = *(volatile unsigned char *)PORT2ADDR(port);
delay(); delay();
return (v); return (v);
} }
unsigned short _inw_p(unsigned long port) unsigned short _inw_p(unsigned long port)
{ {
unsigned short v; unsigned short v = _inw(port);
if (port >= LAN_IOSTART && port < LAN_IOEND)
v = _ne_inw(PORT2ADDR_NE(port));
else
#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
return *(volatile unsigned short *)__port2addr_ata(port);
} else
#endif
#if defined(CONFIG_USB)
if(port >= 0x340 && port < 0x3a0)
return *(volatile unsigned short *)PORT2ADDR_USB(port);
else
#endif
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
unsigned short w;
pcc_ioread_word(0, port, &w, sizeof(w), 1, 0);
return w;
} else
#endif
v = *(volatile unsigned short *)PORT2ADDR(port);
delay(); delay();
return (v); return (v);
} }
unsigned long _inl_p(unsigned long port) unsigned long _inl_p(unsigned long port)
{ {
unsigned long v; unsigned long v = _inl(port);
v = *(volatile unsigned long *)PORT2ADDR(port);
delay(); delay();
return (v); return (v);
} }
...@@ -287,52 +244,19 @@ void _outl(unsigned long l, unsigned long port) ...@@ -287,52 +244,19 @@ void _outl(unsigned long l, unsigned long port)
void _outb_p(unsigned char b, unsigned long port) void _outb_p(unsigned char b, unsigned long port)
{ {
if (port >= LAN_IOSTART && port < LAN_IOEND) _outb(b, port);
_ne_outb(b, PORT2ADDR_NE(port));
else
#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
*(volatile unsigned char *)__port2addr_ata(port) = b;
} else
#endif
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0);
} else
#endif
*(volatile unsigned char *)PORT2ADDR(port) = b;
delay(); delay();
} }
void _outw_p(unsigned short w, unsigned long port) void _outw_p(unsigned short w, unsigned long port)
{ {
if (port >= LAN_IOSTART && port < LAN_IOEND) _outw(w, port);
_ne_outw(w, PORT2ADDR_NE(port));
else
#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
*(volatile unsigned short *)__port2addr_ata(port) = w;
} else
#endif
#if defined(CONFIG_USB)
if(port >= 0x340 && port < 0x3a0)
*(volatile unsigned short *)PORT2ADDR_USB(port) = w;
else
#endif
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0);
} else
#endif
*(volatile unsigned short *)PORT2ADDR(port) = w;
delay(); delay();
} }
void _outl_p(unsigned long l, unsigned long port) void _outl_p(unsigned long l, unsigned long port)
{ {
*(volatile unsigned long *)PORT2ADDR(port) = l; _outl(l, port);
delay(); delay();
} }
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* *
* Typical I/O routines for Mappi board. * Typical I/O routines for Mappi board.
* *
* Copyright (c) 2001, 2002 Hiroyuki Kondo, Hirokazu Takata, * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
* Hitoshi Yamamoto * Hitoshi Yamamoto
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -130,57 +130,21 @@ unsigned long _inl(unsigned long port) ...@@ -130,57 +130,21 @@ unsigned long _inl(unsigned long port)
unsigned char _inb_p(unsigned long port) unsigned char _inb_p(unsigned long port)
{ {
unsigned char v; unsigned char v = _inb(port);
if (port >= 0x300 && port < 0x320)
v = _ne_inb(PORT2ADDR_NE(port));
else
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
unsigned char b;
pcc_ioread(0, port, &b, sizeof(b), 1, 0);
return b;
} else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) {
unsigned char b;
pcc_ioread(1, port, &b, sizeof(b), 1, 0);
return b;
} else
#endif
v = *(volatile unsigned char *)PORT2ADDR(port);
delay(); delay();
return (v); return (v);
} }
unsigned short _inw_p(unsigned long port) unsigned short _inw_p(unsigned long port)
{ {
unsigned short v; unsigned short v = _inw(port);
if (port >= 0x300 && port < 0x320)
v = _ne_inw(PORT2ADDR_NE(port));
else
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
unsigned short w;
pcc_ioread(0, port, &w, sizeof(w), 1, 0);
return w;
} else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) {
unsigned short w;
pcc_ioread(1, port, &w, sizeof(w), 1, 0);
return w;
} else
#endif
v = *(volatile unsigned short *)PORT2ADDR(port);
delay(); delay();
return (v); return (v);
} }
unsigned long _inl_p(unsigned long port) unsigned long _inl_p(unsigned long port)
{ {
unsigned long v; unsigned long v = _inl(port);
v = *(volatile unsigned long *)PORT2ADDR(port);
delay(); delay();
return (v); return (v);
} }
...@@ -229,41 +193,19 @@ void _outl(unsigned long l, unsigned long port) ...@@ -229,41 +193,19 @@ void _outl(unsigned long l, unsigned long port)
void _outb_p(unsigned char b, unsigned long port) void _outb_p(unsigned char b, unsigned long port)
{ {
if (port >= 0x300 && port < 0x320) _outb(b, port);
_ne_outb(b, PORT2ADDR_NE(port));
else
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
pcc_iowrite(0, port, &b, sizeof(b), 1, 0);
} else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) {
pcc_iowrite(1, port, &b, sizeof(b), 1, 0);
} else
#endif
*(volatile unsigned char *)PORT2ADDR(port) = b;
delay(); delay();
} }
void _outw_p(unsigned short w, unsigned long port) void _outw_p(unsigned short w, unsigned long port)
{ {
if (port >= 0x300 && port < 0x320) _outw(w, port);
_ne_outw(w, PORT2ADDR_NE(port));
else
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
pcc_iowrite(0, port, &w, sizeof(w), 1, 0);
} else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) {
pcc_iowrite(1, port, &w, sizeof(w), 1, 0);
} else
#endif
*(volatile unsigned short *)PORT2ADDR(port) = w;
delay(); delay();
} }
void _outl_p(unsigned long l, unsigned long port) void _outl_p(unsigned long l, unsigned long port)
{ {
*(volatile unsigned long *)PORT2ADDR(port) = l; _outl(l, port);
delay(); delay();
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Typical I/O routines for Mappi2 board. * Typical I/O routines for Mappi2 board.
* *
* Copyright (c) 2001-2003 Hiroyuki Kondo, Hirokazu Takata, * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
* Hitoshi Yamamoto, Mamoru Sakugawa * Hitoshi Yamamoto, Mamoru Sakugawa
*/ */
...@@ -25,7 +25,7 @@ extern void pcc_ioread_byte(int, unsigned long, void *, size_t, size_t, int); ...@@ -25,7 +25,7 @@ extern void pcc_ioread_byte(int, unsigned long, void *, size_t, size_t, int);
extern void pcc_ioread_word(int, unsigned long, void *, size_t, size_t, int); extern void pcc_ioread_word(int, unsigned long, void *, size_t, size_t, int);
extern void pcc_iowrite_byte(int, unsigned long, void *, size_t, size_t, int); extern void pcc_iowrite_byte(int, unsigned long, void *, size_t, size_t, int);
extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int); extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int);
#endif /* CONFIG_PCMCIA && CONFIG_MAPPI2_CFC */ #endif /* CONFIG_PCMCIA && CONFIG_M32R_CFC */
#define PORT2ADDR(port) _port2addr(port) #define PORT2ADDR(port) _port2addr(port)
#define PORT2ADDR_NE(port) _port2addr_ne(port) #define PORT2ADDR_NE(port) _port2addr_ne(port)
...@@ -169,64 +169,21 @@ unsigned long _inl(unsigned long port) ...@@ -169,64 +169,21 @@ unsigned long _inl(unsigned long port)
unsigned char _inb_p(unsigned long port) unsigned char _inb_p(unsigned long port)
{ {
unsigned char v; unsigned char v = _inb(port);
if (port >= LAN_IOSTART && port < LAN_IOEND)
v = _ne_inb(PORT2ADDR_NE(port));
else
#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
return *(volatile unsigned char *)__port2addr_ata(port);
} else
#endif
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
unsigned char b;
pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0);
return b;
} else
#endif
v = *(volatile unsigned char *)PORT2ADDR(port);
delay(); delay();
return (v); return (v);
} }
unsigned short _inw_p(unsigned long port) unsigned short _inw_p(unsigned long port)
{ {
unsigned short v; unsigned short v = _inw(port);
if (port >= LAN_IOSTART && port < LAN_IOEND)
v = _ne_inw(PORT2ADDR_NE(port));
else
#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
return *(volatile unsigned short *)__port2addr_ata(port);
} else
#endif
#if defined(CONFIG_USB)
if (port >= 0x340 && port < 0x3a0)
v = *(volatile unsigned short *)PORT2ADDR_USB(port);
else
#endif
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
unsigned short w;
pcc_ioread_word(0, port, &w, sizeof(w), 1, 0);
return w;
} else
#endif
v = *(volatile unsigned short *)PORT2ADDR(port);
delay(); delay();
return (v); return (v);
} }
unsigned long _inl_p(unsigned long port) unsigned long _inl_p(unsigned long port)
{ {
unsigned long v; unsigned long v = _inl(port);
v = *(volatile unsigned long *)PORT2ADDR(port);
delay(); delay();
return (v); return (v);
} }
...@@ -284,52 +241,19 @@ void _outl(unsigned long l, unsigned long port) ...@@ -284,52 +241,19 @@ void _outl(unsigned long l, unsigned long port)
void _outb_p(unsigned char b, unsigned long port) void _outb_p(unsigned char b, unsigned long port)
{ {
if (port >= LAN_IOSTART && port < LAN_IOEND) _outb(b, port);
_ne_outb(b, PORT2ADDR_NE(port));
else
#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
*(volatile unsigned char *)__port2addr_ata(port) = b;
} else
#endif
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0);
} else
#endif
*(volatile unsigned char *)PORT2ADDR(port) = b;
delay(); delay();
} }
void _outw_p(unsigned short w, unsigned long port) void _outw_p(unsigned short w, unsigned long port)
{ {
if (port >= LAN_IOSTART && port < LAN_IOEND) _outw(w, port);
_ne_outw(w, PORT2ADDR_NE(port));
else
#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
*(volatile unsigned short *)__port2addr_ata(port) = w;
} else
#endif
#if defined(CONFIG_USB)
if (port >= 0x340 && port < 0x3a0)
*(volatile unsigned short *)PORT2ADDR_USB(port) = w;
else
#endif
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0);
} else
#endif
*(volatile unsigned short *)PORT2ADDR(port) = w;
delay(); delay();
} }
void _outl_p(unsigned long l, unsigned long port) void _outl_p(unsigned long l, unsigned long port)
{ {
*(volatile unsigned long *)PORT2ADDR(port) = l; _outl(l, port);
delay(); delay();
} }
......
This diff is collapsed.
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Typical I/O routines for OAKS32R board. * Typical I/O routines for OAKS32R board.
* *
* Copyright (c) 2001-2004 Hiroyuki Kondo, Hirokazu Takata, * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
* Hitoshi Yamamoto, Mamoru Sakugawa * Hitoshi Yamamoto, Mamoru Sakugawa
*/ */
...@@ -90,35 +90,21 @@ unsigned long _inl(unsigned long port) ...@@ -90,35 +90,21 @@ unsigned long _inl(unsigned long port)
unsigned char _inb_p(unsigned long port) unsigned char _inb_p(unsigned long port)
{ {
unsigned char v; unsigned char v = _inb(port);
if (port >= 0x300 && port < 0x320)
v = _ne_inb(PORT2ADDR_NE(port));
else
v = *(volatile unsigned char *)PORT2ADDR(port);
delay(); delay();
return (v); return (v);
} }
unsigned short _inw_p(unsigned long port) unsigned short _inw_p(unsigned long port)
{ {
unsigned short v; unsigned short v = _inw(port);
if (port >= 0x300 && port < 0x320)
v = _ne_inw(PORT2ADDR_NE(port));
else
v = *(volatile unsigned short *)PORT2ADDR(port);
delay(); delay();
return (v); return (v);
} }
unsigned long _inl_p(unsigned long port) unsigned long _inl_p(unsigned long port)
{ {
unsigned long v; unsigned long v = _inl(port);
v = *(volatile unsigned long *)PORT2ADDR(port);
delay(); delay();
return (v); return (v);
} }
...@@ -146,27 +132,19 @@ void _outl(unsigned long l, unsigned long port) ...@@ -146,27 +132,19 @@ void _outl(unsigned long l, unsigned long port)
void _outb_p(unsigned char b, unsigned long port) void _outb_p(unsigned char b, unsigned long port)
{ {
if (port >= 0x300 && port < 0x320) _outb(b, port);
_ne_outb(b, PORT2ADDR_NE(port));
else
*(volatile unsigned char *)PORT2ADDR(port) = b;
delay(); delay();
} }
void _outw_p(unsigned short w, unsigned long port) void _outw_p(unsigned short w, unsigned long port)
{ {
if (port >= 0x300 && port < 0x320) _outw(w, port);
_ne_outw(w, PORT2ADDR_NE(port));
else
*(volatile unsigned short *)PORT2ADDR(port) = w;
delay(); delay();
} }
void _outl_p(unsigned long l, unsigned long port) void _outl_p(unsigned long l, unsigned long port)
{ {
*(volatile unsigned long *)PORT2ADDR(port) = l; _outl(l, port);
delay(); delay();
} }
......
/* /*
* linux/arch/m32r/kernel/io_mappi.c * linux/arch/m32r/kernel/io_opsput.c
* *
* Typical I/O routines for OPSPUT board. * Typical I/O routines for OPSPUT board.
* *
* Copyright (c) 2001, 2002 Hiroyuki Kondo, Hirokazu Takata, * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
* Hitoshi Yamamoto, Takeo Takahashi * Hitoshi Yamamoto, Takeo Takahashi
* *
* This file is subject to the terms and conditions of the GNU General * 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 * Public License. See the file "COPYING" in the main directory of this
...@@ -98,7 +98,6 @@ unsigned char _inb(unsigned long port) ...@@ -98,7 +98,6 @@ unsigned char _inb(unsigned long port)
{ {
if (port >= LAN_IOSTART && port < LAN_IOEND) if (port >= LAN_IOSTART && port < LAN_IOEND)
return _ne_inb(PORT2ADDR_NE(port)); return _ne_inb(PORT2ADDR_NE(port));
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
unsigned char b; unsigned char b;
...@@ -118,7 +117,6 @@ unsigned short _inw(unsigned long port) ...@@ -118,7 +117,6 @@ unsigned short _inw(unsigned long port)
else if(port >= 0x340 && port < 0x3a0) else if(port >= 0x340 && port < 0x3a0)
return *(volatile unsigned short *)PORT2ADDR_USB(port); return *(volatile unsigned short *)PORT2ADDR_USB(port);
#endif #endif
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
unsigned short w; unsigned short w;
...@@ -143,55 +141,21 @@ unsigned long _inl(unsigned long port) ...@@ -143,55 +141,21 @@ unsigned long _inl(unsigned long port)
unsigned char _inb_p(unsigned long port) unsigned char _inb_p(unsigned long port)
{ {
unsigned char v; unsigned char v = _inb(port);
if (port >= LAN_IOSTART && port < LAN_IOEND)
v = _ne_inb(PORT2ADDR_NE(port));
else
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
unsigned char b;
pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0);
return b;
} else
#endif
v = *(volatile unsigned char *)PORT2ADDR(port);
delay(); delay();
return (v); return (v);
} }
unsigned short _inw_p(unsigned long port) unsigned short _inw_p(unsigned long port)
{ {
unsigned short v; unsigned short v = _inw(port);
if (port >= LAN_IOSTART && port < LAN_IOEND)
v = _ne_inw(PORT2ADDR_NE(port));
else
#if defined(CONFIG_USB)
if(port >= 0x340 && port < 0x3a0)
return *(volatile unsigned short *)PORT2ADDR_USB(port);
else
#endif
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
unsigned short w;
pcc_ioread_word(0, port, &w, sizeof(w), 1, 0);
return w;
} else
#endif
v = *(volatile unsigned short *)PORT2ADDR(port);
delay(); delay();
return (v); return (v);
} }
unsigned long _inl_p(unsigned long port) unsigned long _inl_p(unsigned long port)
{ {
unsigned long v; unsigned long v = _inl(port);
v = *(volatile unsigned long *)PORT2ADDR(port);
delay(); delay();
return (v); return (v);
} }
...@@ -219,7 +183,6 @@ void _outw(unsigned short w, unsigned long port) ...@@ -219,7 +183,6 @@ void _outw(unsigned short w, unsigned long port)
*(volatile unsigned short *)PORT2ADDR_USB(port) = w; *(volatile unsigned short *)PORT2ADDR_USB(port) = w;
else else
#endif #endif
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0);
...@@ -240,43 +203,19 @@ void _outl(unsigned long l, unsigned long port) ...@@ -240,43 +203,19 @@ void _outl(unsigned long l, unsigned long port)
void _outb_p(unsigned char b, unsigned long port) void _outb_p(unsigned char b, unsigned long port)
{ {
if (port >= LAN_IOSTART && port < LAN_IOEND) _outb(b, port);
_ne_outb(b, PORT2ADDR_NE(port));
else
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0);
} else
#endif
*(volatile unsigned char *)PORT2ADDR(port) = b;
delay(); delay();
} }
void _outw_p(unsigned short w, unsigned long port) void _outw_p(unsigned short w, unsigned long port)
{ {
if (port >= LAN_IOSTART && port < LAN_IOEND) _outw(w, port);
_ne_outw(w, PORT2ADDR_NE(port));
else
#if defined(CONFIG_USB)
if(port >= 0x340 && port < 0x3a0)
*(volatile unsigned short *)PORT2ADDR_USB(port) = w;
else
#endif
#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0);
} else
#endif
*(volatile unsigned short *)PORT2ADDR(port) = w;
delay(); delay();
} }
void _outl_p(unsigned long l, unsigned long port) void _outl_p(unsigned long l, unsigned long port)
{ {
*(volatile unsigned long *)PORT2ADDR(port) = l; _outl(l, port);
delay(); delay();
} }
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* *
* Typical I/O routines for uServer board. * Typical I/O routines for uServer board.
* *
* Copyright (c) 2001 - 2003 Hiroyuki Kondo, Hirokazu Takata, * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
* Hitoshi Yamamoto, Takeo Takahashi * Hitoshi Yamamoto, Takeo Takahashi
* *
* This file is subject to the terms and conditions of the GNU General * 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 * Public License. See the file "COPYING" in the main directory of this
...@@ -39,7 +39,7 @@ extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int); ...@@ -39,7 +39,7 @@ extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int);
#define PORT2ADDR(port) _port2addr(port) #define PORT2ADDR(port) _port2addr(port)
static __inline__ void *_port2addr(unsigned long port) static inline void *_port2addr(unsigned long port)
{ {
#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
if (port >= UART0_IOSTART && port <= UART0_IOEND) if (port >= UART0_IOSTART && port <= UART0_IOEND)
...@@ -50,7 +50,7 @@ static __inline__ void *_port2addr(unsigned long port) ...@@ -50,7 +50,7 @@ static __inline__ void *_port2addr(unsigned long port)
return (void *)(port + NONCACHE_OFFSET); return (void *)(port + NONCACHE_OFFSET);
} }
static __inline__ void delay(void) static inline void delay(void)
{ {
__asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory"); __asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory");
} }
...@@ -87,39 +87,22 @@ unsigned long _inl(unsigned long port) ...@@ -87,39 +87,22 @@ unsigned long _inl(unsigned long port)
unsigned char _inb_p(unsigned long port) unsigned char _inb_p(unsigned long port)
{ {
unsigned char b; unsigned char v = _inb(port);
delay();
if (port >= CFC_IOSTART && port <= CFC_IOEND) { return v;
pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0);
return b;
} else {
b = *(volatile unsigned char *)PORT2ADDR(port);
delay();
return b;
}
} }
unsigned short _inw_p(unsigned long port) unsigned short _inw_p(unsigned long port)
{ {
unsigned short w; unsigned short v = _inw(port);
delay();
if (port >= CFC_IOSTART && port <= CFC_IOEND) { return v;
pcc_ioread_word(0, port, &w, sizeof(w), 1, 0);
return w;
} else {
w = *(volatile unsigned short *)PORT2ADDR(port);
delay();
return w;
}
} }
unsigned long _inl_p(unsigned long port) unsigned long _inl_p(unsigned long port)
{ {
unsigned long v; unsigned long v = _inl(port);
v = *(volatile unsigned long *)PORT2ADDR(port);
delay(); delay();
return v; return v;
} }
...@@ -149,25 +132,19 @@ void _outl(unsigned long l, unsigned long port) ...@@ -149,25 +132,19 @@ void _outl(unsigned long l, unsigned long port)
void _outb_p(unsigned char b, unsigned long port) void _outb_p(unsigned char b, unsigned long port)
{ {
if (port >= CFC_IOSTART && port <= CFC_IOEND) _outb(b, port);
pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0);
else
*(volatile unsigned char *)PORT2ADDR(port) = b;
delay(); delay();
} }
void _outw_p(unsigned short w, unsigned long port) void _outw_p(unsigned short w, unsigned long port)
{ {
if (port >= CFC_IOSTART && port <= CFC_IOEND) _outw(w, port);
pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0);
else
*(volatile unsigned short *)PORT2ADDR(port) = w;
delay(); delay();
} }
void _outl_p(unsigned long l, unsigned long port) void _outl_p(unsigned long l, unsigned long port)
{ {
*(volatile unsigned long *)PORT2ADDR(port) = l; _outl(l, port);
delay(); delay();
} }
......
...@@ -330,6 +330,8 @@ static int show_cpuinfo(struct seq_file *m, void *v) ...@@ -330,6 +330,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
seq_printf(m, "Machine\t\t: Mappi Evaluation board\n"); seq_printf(m, "Machine\t\t: Mappi Evaluation board\n");
#elif CONFIG_PLAT_MAPPI2 #elif CONFIG_PLAT_MAPPI2
seq_printf(m, "Machine\t\t: Mappi-II Evaluation board\n"); seq_printf(m, "Machine\t\t: Mappi-II Evaluation board\n");
#elif CONFIG_PLAT_MAPPI3
seq_printf(m, "Machine\t\t: Mappi-III Evaluation board\n");
#elif CONFIG_PLAT_M32700UT #elif CONFIG_PLAT_M32700UT
seq_printf(m, "Machine\t\t: M32700UT Evaluation board\n"); seq_printf(m, "Machine\t\t: M32700UT Evaluation board\n");
#elif CONFIG_PLAT_OPSPUT #elif CONFIG_PLAT_OPSPUT
......
/* /*
* linux/arch/m32r/kernel/setup_mappi.c * linux/arch/m32r/kernel/setup_mappi2.c
* *
* Setup routines for Renesas MAPPI-II(M3A-ZA36) Board * Setup routines for Renesas MAPPI-II(M3A-ZA36) Board
* *
...@@ -156,7 +156,6 @@ void __init init_IRQ(void) ...@@ -156,7 +156,6 @@ void __init init_IRQ(void)
irq_desc[PLD_IRQ_CFIREQ].handler = &mappi2_irq_type; irq_desc[PLD_IRQ_CFIREQ].handler = &mappi2_irq_type;
irq_desc[PLD_IRQ_CFIREQ].action = 0; irq_desc[PLD_IRQ_CFIREQ].action = 0;
irq_desc[PLD_IRQ_CFIREQ].depth = 1; /* disable nested irq */ irq_desc[PLD_IRQ_CFIREQ].depth = 1; /* disable nested irq */
// icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00;
icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01; icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01;
disable_mappi2_irq(PLD_IRQ_CFIREQ); disable_mappi2_irq(PLD_IRQ_CFIREQ);
...@@ -167,7 +166,6 @@ void __init init_IRQ(void) ...@@ -167,7 +166,6 @@ void __init init_IRQ(void)
irq_desc[PLD_IRQ_CFC_INSERT].action = 0; irq_desc[PLD_IRQ_CFC_INSERT].action = 0;
irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */ irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */
icu_data[PLD_IRQ_CFC_INSERT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00; icu_data[PLD_IRQ_CFC_INSERT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00;
// icu_data[PLD_IRQ_CFC_INSERT].icucr = 0;
disable_mappi2_irq(PLD_IRQ_CFC_INSERT); disable_mappi2_irq(PLD_IRQ_CFC_INSERT);
/* ICUCR42: CFC Eject */ /* ICUCR42: CFC Eject */
...@@ -176,9 +174,7 @@ void __init init_IRQ(void) ...@@ -176,9 +174,7 @@ void __init init_IRQ(void)
irq_desc[PLD_IRQ_CFC_EJECT].action = 0; irq_desc[PLD_IRQ_CFC_EJECT].action = 0;
irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */ irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */
icu_data[PLD_IRQ_CFC_EJECT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; icu_data[PLD_IRQ_CFC_EJECT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
// icu_data[PLD_IRQ_CFC_EJECT].icucr = 0;
disable_mappi2_irq(PLD_IRQ_CFC_EJECT); disable_mappi2_irq(PLD_IRQ_CFC_EJECT);
#endif /* CONFIG_MAPPI2_CFC */ #endif /* CONFIG_MAPPI2_CFC */
} }
......
/*
* linux/arch/m32r/kernel/setup_mappi3.c
*
* Setup routines for Renesas MAPPI-III(M3A-2170) Board
*
* Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
* Hitoshi Yamamoto, Mamoru Sakugawa
*/
#include <linux/config.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/device.h>
#include <asm/system.h>
#include <asm/m32r.h>
#include <asm/io.h>
#define irq2port(x) (M32R_ICU_CR1_PORTL + ((x - 1) * sizeof(unsigned long)))
#ifndef CONFIG_SMP
typedef struct {
unsigned long icucr; /* ICU Control Register */
} icu_data_t;
#endif /* CONFIG_SMP */
icu_data_t icu_data[NR_IRQS];
static void disable_mappi3_irq(unsigned int irq)
{
unsigned long port, data;
if ((irq == 0) ||(irq >= NR_IRQS)) {
printk("bad irq 0x%08x\n", irq);
return;
}
port = irq2port(irq);
data = icu_data[irq].icucr|M32R_ICUCR_ILEVEL7;
outl(data, port);
}
static void enable_mappi3_irq(unsigned int irq)
{
unsigned long port, data;
if ((irq == 0) ||(irq >= NR_IRQS)) {
printk("bad irq 0x%08x\n", irq);
return;
}
port = irq2port(irq);
data = icu_data[irq].icucr|M32R_ICUCR_IEN|M32R_ICUCR_ILEVEL6;
outl(data, port);
}
static void mask_and_ack_mappi3(unsigned int irq)
{
disable_mappi3_irq(irq);
}
static void end_mappi3_irq(unsigned int irq)
{
enable_mappi3_irq(irq);
}
static unsigned int startup_mappi3_irq(unsigned int irq)
{
enable_mappi3_irq(irq);
return (0);
}
static void shutdown_mappi3_irq(unsigned int irq)
{
unsigned long port;
port = irq2port(irq);
outl(M32R_ICUCR_ILEVEL7, port);
}
static struct hw_interrupt_type mappi3_irq_type =
{
"MAPPI3-IRQ",
startup_mappi3_irq,
shutdown_mappi3_irq,
enable_mappi3_irq,
disable_mappi3_irq,
mask_and_ack_mappi3,
end_mappi3_irq
};
void __init init_IRQ(void)
{
#if defined(CONFIG_SMC91X)
/* INT0 : LAN controller (SMC91111) */
irq_desc[M32R_IRQ_INT0].status = IRQ_DISABLED;
irq_desc[M32R_IRQ_INT0].handler = &mappi3_irq_type;
irq_desc[M32R_IRQ_INT0].action = 0;
irq_desc[M32R_IRQ_INT0].depth = 1;
icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
disable_mappi3_irq(M32R_IRQ_INT0);
#endif /* CONFIG_SMC91X */
/* MFT2 : system timer */
irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED;
irq_desc[M32R_IRQ_MFT2].handler = &mappi3_irq_type;
irq_desc[M32R_IRQ_MFT2].action = 0;
irq_desc[M32R_IRQ_MFT2].depth = 1;
icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN;
disable_mappi3_irq(M32R_IRQ_MFT2);
#ifdef CONFIG_SERIAL_M32R_SIO
/* SIO0_R : uart receive data */
irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED;
irq_desc[M32R_IRQ_SIO0_R].handler = &mappi3_irq_type;
irq_desc[M32R_IRQ_SIO0_R].action = 0;
irq_desc[M32R_IRQ_SIO0_R].depth = 1;
icu_data[M32R_IRQ_SIO0_R].icucr = 0;
disable_mappi3_irq(M32R_IRQ_SIO0_R);
/* SIO0_S : uart send data */
irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED;
irq_desc[M32R_IRQ_SIO0_S].handler = &mappi3_irq_type;
irq_desc[M32R_IRQ_SIO0_S].action = 0;
irq_desc[M32R_IRQ_SIO0_S].depth = 1;
icu_data[M32R_IRQ_SIO0_S].icucr = 0;
disable_mappi3_irq(M32R_IRQ_SIO0_S);
/* SIO1_R : uart receive data */
irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED;
irq_desc[M32R_IRQ_SIO1_R].handler = &mappi3_irq_type;
irq_desc[M32R_IRQ_SIO1_R].action = 0;
irq_desc[M32R_IRQ_SIO1_R].depth = 1;
icu_data[M32R_IRQ_SIO1_R].icucr = 0;
disable_mappi3_irq(M32R_IRQ_SIO1_R);
/* SIO1_S : uart send data */
irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED;
irq_desc[M32R_IRQ_SIO1_S].handler = &mappi3_irq_type;
irq_desc[M32R_IRQ_SIO1_S].action = 0;
irq_desc[M32R_IRQ_SIO1_S].depth = 1;
icu_data[M32R_IRQ_SIO1_S].icucr = 0;
disable_mappi3_irq(M32R_IRQ_SIO1_S);
#endif /* CONFIG_M32R_USE_DBG_CONSOLE */
#if defined(CONFIG_USB)
/* INT1 : USB Host controller interrupt */
irq_desc[M32R_IRQ_INT1].status = IRQ_DISABLED;
irq_desc[M32R_IRQ_INT1].handler = &mappi3_irq_type;
irq_desc[M32R_IRQ_INT1].action = 0;
irq_desc[M32R_IRQ_INT1].depth = 1;
icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_ISMOD01;
disable_mappi3_irq(M32R_IRQ_INT1);
#endif /* CONFIG_USB */
/* ICUCR40: CFC IREQ */
irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED;
irq_desc[PLD_IRQ_CFIREQ].handler = &mappi3_irq_type;
irq_desc[PLD_IRQ_CFIREQ].action = 0;
irq_desc[PLD_IRQ_CFIREQ].depth = 1; /* disable nested irq */
icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01;
disable_mappi3_irq(PLD_IRQ_CFIREQ);
#if defined(CONFIG_M32R_CFC)
/* ICUCR41: CFC Insert */
irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED;
irq_desc[PLD_IRQ_CFC_INSERT].handler = &mappi3_irq_type;
irq_desc[PLD_IRQ_CFC_INSERT].action = 0;
irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */
icu_data[PLD_IRQ_CFC_INSERT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00;
disable_mappi3_irq(PLD_IRQ_CFC_INSERT);
/* ICUCR42: CFC Eject */
irq_desc[PLD_IRQ_CFC_EJECT].status = IRQ_DISABLED;
irq_desc[PLD_IRQ_CFC_EJECT].handler = &mappi3_irq_type;
irq_desc[PLD_IRQ_CFC_EJECT].action = 0;
irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */
icu_data[PLD_IRQ_CFC_EJECT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
disable_mappi3_irq(PLD_IRQ_CFC_EJECT);
#endif /* CONFIG_M32R_CFC */
}
#define LAN_IOSTART 0x300
#define LAN_IOEND 0x320
static struct resource smc91x_resources[] = {
[0] = {
.start = (LAN_IOSTART),
.end = (LAN_IOEND),
.flags = IORESOURCE_MEM,
},
[1] = {
.start = M32R_IRQ_INT0,
.end = M32R_IRQ_INT0,
.flags = IORESOURCE_IRQ,
}
};
static struct platform_device smc91x_device = {
.name = "smc91x",
.id = 0,
.num_resources = ARRAY_SIZE(smc91x_resources),
.resource = smc91x_resources,
};
static int __init platform_init(void)
{
platform_device_register(&smc91x_device);
return 0;
}
arch_initcall(platform_init);
This diff is collapsed.
# .gdbinit file
# $Id: dot.gdbinit,v 1.1 2005/04/11 02:21:08 sakugawa Exp $
# setting
set width 0d70
set radix 0d16
use_debug_dma
# Initialize SDRAM controller for Mappi
define sdram_init
# SDIR0
set *(unsigned long *)0x00ef6008 = 0x00000182
# SDIR1
set *(unsigned long *)0x00ef600c = 0x00000001
# Initialize wait
shell sleep 0.1
# MOD
set *(unsigned long *)0x00ef602c = 0x00000020
set *(unsigned long *)0x00ef604c = 0x00000020
# TR
set *(unsigned long *)0x00ef6028 = 0x00051502
set *(unsigned long *)0x00ef6048 = 0x00051502
# ADR
set *(unsigned long *)0x00ef6020 = 0x08000004
set *(unsigned long *)0x00ef6040 = 0x0c000004
# AutoRef On
set *(unsigned long *)0x00ef6004 = 0x00010517
# Access enable
set *(unsigned long *)0x00ef6024 = 0x00000001
set *(unsigned long *)0x00ef6044 = 0x00000001
end
# Initialize LAN controller for Mappi
define lanc_init
# Set BSEL4
#set *(unsigned long *)0x00ef5004 = 0x0fff330f
#set *(unsigned long *)0x00ef5004 = 0x01113301
# set *(unsigned long *)0x00ef5004 = 0x02011101
# set *(unsigned long *)0x00ef5004 = 0x04441104
end
define clock_init
set *(unsigned long *)0x00ef4010 = 2
set *(unsigned long *)0x00ef4014 = 2
set *(unsigned long *)0x00ef4020 = 3
set *(unsigned long *)0x00ef4024 = 3
set *(unsigned long *)0x00ef4004 = 0x7
# shell sleep 0.1
# set *(unsigned long *)0x00ef4004 = 0x5
shell sleep 0.1
set *(unsigned long *)0x00ef4008 = 0x0200
end
define port_init
set $sfrbase = 0x00ef0000
set *(unsigned short *)0x00ef1060 = 0x5555
set *(unsigned short *)0x00ef1062 = 0x5555
set *(unsigned short *)0x00ef1064 = 0x5555
set *(unsigned short *)0x00ef1066 = 0x5555
set *(unsigned short *)0x00ef1068 = 0x5555
set *(unsigned short *)0x00ef106a = 0x0000
set *(unsigned short *)0x00ef106e = 0x5555
set *(unsigned short *)0x00ef1070 = 0x5555
end
# MMU enable
define mmu_enable
set $evb=0x88000000
set *(unsigned long *)0xffff0024=1
end
# MMU disable
define mmu_disable
set $evb=0
set *(unsigned long *)0xffff0024=0
end
# Show TLB entries
define show_tlb_entries
set $i = 0
set $addr = $arg0
while ($i < 0d16 )
set $tlb_tag = *(unsigned long*)$addr
set $tlb_data = *(unsigned long*)($addr + 4)
printf " [%2d] 0x%08lx : 0x%08lx - 0x%08lx\n", $i, $addr, $tlb_tag, $tlb_data
set $i = $i + 1
set $addr = $addr + 8
end
end
define itlb
set $itlb=0xfe000000
show_tlb_entries $itlb
end
define dtlb
set $dtlb=0xfe000800
show_tlb_entries $dtlb
end
# Cache ON
define set_cache_type
set $mctype = (void*)0xfffffff8
# chaos
# set *(unsigned long *)($mctype) = 0x0000c000
# m32102 i-cache only
set *(unsigned long *)($mctype) = 0x00008000
# m32102 d-cache only
# set *(unsigned long *)($mctype) = 0x00004000
end
define cache_on
set $param = (void*)0x08001000
set *(unsigned long *)($param) = 0x60ff6102
end
# Show current task structure
define show_current
set $current = $spi & 0xffffe000
printf "$current=0x%08lX\n",$current
print *(struct task_struct *)$current
end
# Show user assigned task structure
define show_task
set $task = $arg0 & 0xffffe000
printf "$task=0x%08lX\n",$task
print *(struct task_struct *)$task
end
document show_task
Show user assigned task structure
arg0 : task structure address
end
# Show M32R registers
define show_regs
printf " R0[0x%08lX] R1[0x%08lX] R2[0x%08lX] R3[0x%08lX]\n",$r0,$r1,$r2,$r3
printf " R4[0x%08lX] R5[0x%08lX] R6[0x%08lX] R7[0x%08lX]\n",$r4,$r5,$r6,$r7
printf " R8[0x%08lX] R9[0x%08lX] R10[0x%08lX] R11[0x%08lX]\n",$r8,$r9,$r10,$r11
printf "R12[0x%08lX] FP[0x%08lX] LR[0x%08lX] SP[0x%08lX]\n",$r12,$fp,$lr,$sp
printf "PSW[0x%08lX] CBR[0x%08lX] SPI[0x%08lX] SPU[0x%08lX]\n",$psw,$cbr,$spi,$spu
printf "BPC[0x%08lX] PC[0x%08lX] ACCL[0x%08lX] ACCH[0x%08lX]\n",$bpc,$pc,$accl,$acch
printf "EVB[0x%08lX]\n",$evb
set $mests = *(unsigned long *)0xffff000c
set $mdeva = *(unsigned long *)0xffff0010
printf "MESTS[0x%08lX] MDEVA[0x%08lX]\n",$mests,$mdeva
end
# Setup all
define setup
clock_init
shell sleep 0.1
port_init
sdram_init
# lanc_init
# dispc_init
# set $evb=0x08000000
end
# Load modules
define load_modules
use_debug_dma
load
# load busybox.mot
end
# Set kernel parameters
define set_kernel_parameters
set $param = (void*)0x08001000
## MOUNT_ROOT_RDONLY
set {long}($param+0x00)=0
## RAMDISK_FLAGS
#set {long}($param+0x04)=0
## ORIG_ROOT_DEV
#set {long}($param+0x08)=0x00000100
## LOADER_TYPE
#set {long}($param+0x0C)=0
## INITRD_START
set {long}($param+0x10)=0x082a0000
## INITRD_SIZE
set {long}($param+0x14)=0d6200000
# M32R_CPUCLK
set *(unsigned long *)($param + 0x0018) = 0d100000000
# M32R_BUSCLK
set *(unsigned long *)($param + 0x001c) = 0d50000000
# M32R_TIMER_DIVIDE
set *(unsigned long *)($param + 0x0020) = 0d128
set {char[0x200]}($param + 0x100) = "console=ttyS0,115200n8x root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/root.2.6_04 nfsaddrs=192.168.0.102:192.168.0.1:192.168.0.1:255.255.255.0:mappi: \0"
end
# Boot
define boot
set_kernel_parameters
debug_chaos
set *(unsigned long *)0x00f00000=0x08002000
set $pc=0x08002000
set $fp=0
del b
si
end
# Restart
define restart
sdireset
sdireset
setup
load_modules
boot
end
sdireset
sdireset
file vmlinux
target m32rsdi
restart
boot
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
static __inline__ int ide_default_irq(unsigned long base) static __inline__ int ide_default_irq(unsigned long base)
{ {
switch (base) { switch (base) {
#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) #if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) || defined(CONFIG_PLAT_MAPPI3)
case 0x1f0: return PLD_IRQ_CFIREQ; case 0x1f0: return PLD_IRQ_CFIREQ;
default: default:
return 0; return 0;
......
...@@ -175,6 +175,7 @@ ...@@ -175,6 +175,7 @@
#define M32R_ICU_CR5_PORTL (0x210+M32R_ICU_OFFSET) /* INT4 */ #define M32R_ICU_CR5_PORTL (0x210+M32R_ICU_OFFSET) /* INT4 */
#define M32R_ICU_CR6_PORTL (0x214+M32R_ICU_OFFSET) /* INT5 */ #define M32R_ICU_CR6_PORTL (0x214+M32R_ICU_OFFSET) /* INT5 */
#define M32R_ICU_CR7_PORTL (0x218+M32R_ICU_OFFSET) /* INT6 */ #define M32R_ICU_CR7_PORTL (0x218+M32R_ICU_OFFSET) /* INT6 */
#define M32R_ICU_CR8_PORTL (0x219+M32R_ICU_OFFSET) /* INT7 */
#define M32R_ICU_CR16_PORTL (0x23C+M32R_ICU_OFFSET) /* MFT0 */ #define M32R_ICU_CR16_PORTL (0x23C+M32R_ICU_OFFSET) /* MFT0 */
#define M32R_ICU_CR17_PORTL (0x240+M32R_ICU_OFFSET) /* MFT1 */ #define M32R_ICU_CR17_PORTL (0x240+M32R_ICU_OFFSET) /* MFT1 */
#define M32R_ICU_CR18_PORTL (0x244+M32R_ICU_OFFSET) /* MFT2 */ #define M32R_ICU_CR18_PORTL (0x244+M32R_ICU_OFFSET) /* MFT2 */
......
...@@ -36,6 +36,10 @@ ...@@ -36,6 +36,10 @@
#include <asm/mappi2/mappi2_pld.h> #include <asm/mappi2/mappi2_pld.h>
#endif /* CONFIG_PLAT_MAPPI2 */ #endif /* CONFIG_PLAT_MAPPI2 */
#if defined(CONFIG_PLAT_MAPPI3)
#include <asm/mappi3/mappi3_pld.h>
#endif /* CONFIG_PLAT_MAPPI3 */
#if defined(CONFIG_PLAT_USRV) #if defined(CONFIG_PLAT_USRV)
#include <asm/m32700ut/m32700ut_pld.h> #include <asm/m32700ut/m32700ut_pld.h>
#endif #endif
......
/*
* include/asm/mappi3/mappi3_pld.h
*
* Definitions for Extended IO Logic on MAPPI3 board.
* based on m32700ut_pld.h
*
* 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.
*
*/
#ifndef _MAPPI3_PLD_H
#define _MAPPI3_PLD_H
#ifndef __ASSEMBLY__
/* FIXME:
* Some C functions use non-cache address, so can't define non-cache address.
*/
#define PLD_BASE (0x1c000000 /* + NONCACHE_OFFSET */)
#define __reg8 (volatile unsigned char *)
#define __reg16 (volatile unsigned short *)
#define __reg32 (volatile unsigned int *)
#else
#define PLD_BASE (0x1c000000 + NONCACHE_OFFSET)
#define __reg8
#define __reg16
#define __reg32
#endif /* __ASSEMBLY__ */
/* CFC */
#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000)
#define PLD_CFSTS __reg16(PLD_BASE + 0x0002)
#define PLD_CFIMASK __reg16(PLD_BASE + 0x0004)
#define PLD_CFBUFCR __reg16(PLD_BASE + 0x0006)
#define PLD_CFCR0 __reg16(PLD_BASE + 0x000a)
#define PLD_CFCR1 __reg16(PLD_BASE + 0x000c)
/* MMC */
#define PLD_MMCCR __reg16(PLD_BASE + 0x4000)
#define PLD_MMCMOD __reg16(PLD_BASE + 0x4002)
#define PLD_MMCSTS __reg16(PLD_BASE + 0x4006)
#define PLD_MMCBAUR __reg16(PLD_BASE + 0x400a)
#define PLD_MMCCMDBCUT __reg16(PLD_BASE + 0x400c)
#define PLD_MMCCDTBCUT __reg16(PLD_BASE + 0x400e)
#define PLD_MMCDET __reg16(PLD_BASE + 0x4010)
#define PLD_MMCWP __reg16(PLD_BASE + 0x4012)
#define PLD_MMCWDATA __reg16(PLD_BASE + 0x5000)
#define PLD_MMCRDATA __reg16(PLD_BASE + 0x6000)
#define PLD_MMCCMDDATA __reg16(PLD_BASE + 0x7000)
#define PLD_MMCRSPDATA __reg16(PLD_BASE + 0x7006)
/* Power Control of MMC and CF */
#define PLD_CPCR __reg16(PLD_BASE + 0x14000)
/*==== ICU ====*/
#define M32R_IRQ_PC104 (5) /* INT4(PC/104) */
#define M32R_IRQ_I2C (28) /* I2C-BUS */
#define PLD_IRQ_CFIREQ (6) /* INT5 CFC Card Interrupt */
#define PLD_IRQ_CFC_INSERT (7) /* INT6 CFC Card Insert */
#define PLD_IRQ_CFC_EJECT (8) /* INT7 CFC Card Eject */
#define PLD_IRQ_MMCCARD (43) /* MMC Card Insert */
#define PLD_IRQ_MMCIRQ (44) /* MMC Transfer Done */
#if 0
/* LED Control
*
* 1: DIP swich side
* 2: Reset switch side
*/
#define PLD_IOLEDCR __reg16(PLD_BASE + 0x14002)
#define PLD_IOLED_1_ON 0x001
#define PLD_IOLED_1_OFF 0x000
#define PLD_IOLED_2_ON 0x002
#define PLD_IOLED_2_OFF 0x000
/* DIP Switch
* 0: Write-protect of Flash Memory (0:protected, 1:non-protected)
* 1: -
* 2: -
* 3: -
*/
#define PLD_IOSWSTS __reg16(PLD_BASE + 0x14004)
#define PLD_IOSWSTS_IOSW2 0x0200
#define PLD_IOSWSTS_IOSW1 0x0100
#define PLD_IOSWSTS_IOWP0 0x0001
#endif
/* CRC */
#define PLD_CRC7DATA __reg16(PLD_BASE + 0x18000)
#define PLD_CRC7INDATA __reg16(PLD_BASE + 0x18002)
#define PLD_CRC16DATA __reg16(PLD_BASE + 0x18004)
#define PLD_CRC16INDATA __reg16(PLD_BASE + 0x18006)
#define PLD_CRC16ADATA __reg16(PLD_BASE + 0x18008)
#define PLD_CRC16AINDATA __reg16(PLD_BASE + 0x1800a)
#if 0
/* RTC */
#define PLD_RTCCR __reg16(PLD_BASE + 0x1c000)
#define PLD_RTCBAUR __reg16(PLD_BASE + 0x1c002)
#define PLD_RTCWRDATA __reg16(PLD_BASE + 0x1c004)
#define PLD_RTCRDDATA __reg16(PLD_BASE + 0x1c006)
#define PLD_RTCRSTODT __reg16(PLD_BASE + 0x1c008)
/* SIO0 */
#define PLD_ESIO0CR __reg16(PLD_BASE + 0x20000)
#define PLD_ESIO0CR_TXEN 0x0001
#define PLD_ESIO0CR_RXEN 0x0002
#define PLD_ESIO0MOD0 __reg16(PLD_BASE + 0x20002)
#define PLD_ESIO0MOD0_CTSS 0x0040
#define PLD_ESIO0MOD0_RTSS 0x0080
#define PLD_ESIO0MOD1 __reg16(PLD_BASE + 0x20004)
#define PLD_ESIO0MOD1_LMFS 0x0010
#define PLD_ESIO0STS __reg16(PLD_BASE + 0x20006)
#define PLD_ESIO0STS_TEMP 0x0001
#define PLD_ESIO0STS_TXCP 0x0002
#define PLD_ESIO0STS_RXCP 0x0004
#define PLD_ESIO0STS_TXSC 0x0100
#define PLD_ESIO0STS_RXSC 0x0200
#define PLD_ESIO0STS_TXREADY (PLD_ESIO0STS_TXCP | PLD_ESIO0STS_TEMP)
#define PLD_ESIO0INTCR __reg16(PLD_BASE + 0x20008)
#define PLD_ESIO0INTCR_TXIEN 0x0002
#define PLD_ESIO0INTCR_RXCEN 0x0004
#define PLD_ESIO0BAUR __reg16(PLD_BASE + 0x2000a)
#define PLD_ESIO0TXB __reg16(PLD_BASE + 0x2000c)
#define PLD_ESIO0RXB __reg16(PLD_BASE + 0x2000e)
/* SIM Card */
#define PLD_SCCR __reg16(PLD_BASE + 0x38000)
#define PLD_SCMOD __reg16(PLD_BASE + 0x38004)
#define PLD_SCSTS __reg16(PLD_BASE + 0x38006)
#define PLD_SCINTCR __reg16(PLD_BASE + 0x38008)
#define PLD_SCBAUR __reg16(PLD_BASE + 0x3800a)
#define PLD_SCTXB __reg16(PLD_BASE + 0x3800c)
#define PLD_SCRXB __reg16(PLD_BASE + 0x3800e)
#endif
#endif /* _MAPPI3_PLD.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