Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[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
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -78,6 +78,9 @@ config PLAT_OAKS32R
config PLAT_MAPPI2
       bool "Mappi-II(M3A-ZA36/M3A-ZA52)"

config PLAT_MAPPI3
       bool "Mappi-III(M3A-2170)"

endchoice

choice
@@ -134,6 +137,7 @@ config BUS_CLOCK
	int "Bus Clock [Hz] (integer)"
	default "70000000" if PLAT_MAPPI
	default "25000000" if PLAT_USRV
	default "50000000" if PLAT_MAPPI3
	default "50000000" if PLAT_M32700UT
	default "50000000" if PLAT_OPSPUT
	default "33333333" if PLAT_OAKS32R
@@ -149,7 +153,7 @@ config CPU_LITTLE_ENDIAN

config MEMORY_START
	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_M32700UT
	default "08000000" if PLAT_OPSPUT
@@ -157,6 +161,7 @@ config MEMORY_START

config MEMORY_SIZE
	hex "Physical memory size (hex)"
	default "08000000" if PLAT_MAPPI3
	default "04000000" if PLAT_MAPPI || PLAT_MAPPI2
	default "02000000" if PLAT_USRV
	default "01000000" if PLAT_M32700UT
+11 −8
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
 */

#include <linux/config.h>
#include <asm/processor.h>

static void putc(char c);

@@ -38,16 +39,17 @@ static int puts(const char *s)

static void putc(char c)
{

	while ((*BOOT_SIO0STS & 0x3) != 0x3) ;
	while ((*BOOT_SIO0STS & 0x3) != 0x3)
		cpu_relax();
	if (c == '\n') {
		*BOOT_SIO0TXB = '\r';
		while ((*BOOT_SIO0STS & 0x3) != 0x3) ;
		while ((*BOOT_SIO0STS & 0x3) != 0x3)
			cpu_relax();
	}
	*BOOT_SIO0TXB = c;
}
#else /* defined(CONFIG_PLAT_M32700UT_Alpha) || defined(CONFIG_PLAT_M32700UT) */
#ifdef CONFIG_MMU
#else /* !(CONFIG_PLAT_M32700UT_Alpha) && !(CONFIG_PLAT_M32700UT) */
#if defined(CONFIG_PLAT_MAPPI2)
#define SIO0STS	(volatile unsigned short *)(0xa0efd000 + 14)
#define SIO0TXB	(volatile unsigned short *)(0xa0efd000 + 30)
#else
@@ -57,11 +59,12 @@ static void putc(char c)

static void putc(char c)
{

	while ((*SIO0STS & 0x1) == 0) ;
	while ((*SIO0STS & 0x1) == 0)
		cpu_relax();
	if (c == '\n') {
		*SIO0TXB = '\r';
		while ((*SIO0STS & 0x1) == 0) ;
		while ((*SIO0STS & 0x1) == 0)
			cpu_relax();
	}
	*SIO0TXB = c;
}
+1 −1
Original line number Diff line number Diff line
@@ -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_PLAT_MAPPI)	+= setup_mappi.o io_mappi.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_M32700UT)	+= setup_m32700ut.o io_m32700ut.o
obj-$(CONFIG_PLAT_OPSPUT)	+= setup_opsput.o io_opsput.o
@@ -17,4 +18,3 @@ obj-$(CONFIG_MODULES) += module.o
obj-$(CONFIG_PLAT_OAKS32R)	+= setup_oaks32r.o io_oaks32r.o

EXTRA_AFLAGS	:= -traditional
+8 −84
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 *
 *  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
 *
 *  This file is subject to the terms and conditions of the GNU General
@@ -172,64 +172,21 @@ unsigned long _inl(unsigned long port)

unsigned char _inb_p(unsigned long port)
{
	unsigned char  v;

	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);

	unsigned char v = _inb(port);
	delay();
	return (v);
}

unsigned short _inw_p(unsigned long port)
{
	unsigned short  v;

	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);

	unsigned short v = _inw(port);
	delay();
	return (v);
}

unsigned long _inl_p(unsigned long port)
{
	unsigned long  v;

	v = *(volatile unsigned long *)PORT2ADDR(port);
	unsigned long v = _inl(port);
	delay();
	return (v);
}
@@ -287,52 +244,19 @@ void _outl(unsigned long l, unsigned long port)

void _outb_p(unsigned char b, unsigned long port)
{
	if (port >= LAN_IOSTART && port < LAN_IOEND)
		_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;

	_outb(b, port);
	delay();
}

void _outw_p(unsigned short w, unsigned long port)
{
	if (port >= LAN_IOSTART && port < LAN_IOEND)
		_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;

	_outw(w, port);
	delay();
}

void _outl_p(unsigned long l, unsigned long port)
{
	*(volatile unsigned long *)PORT2ADDR(port) = l;
	_outl(l, port);
	delay();
}

+8 −66
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 *
 *  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
 */

@@ -130,57 +130,21 @@ unsigned long _inl(unsigned long port)

unsigned char _inb_p(unsigned long port)
{
	unsigned char  v;

	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);

	unsigned char v = _inb(port);
	delay();
	return (v);
}

unsigned short _inw_p(unsigned long port)
{
	unsigned short  v;

	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);

	unsigned short v = _inw(port);
	delay();
	return (v);
}

unsigned long _inl_p(unsigned long port)
{
	unsigned long  v;

	v = *(volatile unsigned long *)PORT2ADDR(port);
	unsigned long v = _inl(port);
	delay();
	return (v);
}
@@ -229,41 +193,19 @@ void _outl(unsigned long l, unsigned long port)

void _outb_p(unsigned char b, unsigned long port)
{
	if (port >= 0x300 && port < 0x320)
		_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;

	_outb(b, port);
	delay();
}

void _outw_p(unsigned short w, unsigned long port)
{
	if (port >= 0x300 && port < 0x320)
		_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;

	_outw(w, port);
	delay();
}

void _outl_p(unsigned long l, unsigned long port)
{
	*(volatile unsigned long *)PORT2ADDR(port) = l;
	_outl(l, port);
	delay();
}

Loading