From eab184c2362567f2b2e951b7bd0e0d353a7e5091 Mon Sep 17 00:00:00 2001 From: Alexander Schulz Date: Thu, 8 Jan 2009 18:05:58 +0100 Subject: [ARM] 5363/1: Shark cleanup and new defconfig This includes a new defconfig for the Shark and some changes to the mach-shark directory to avoid namespace pollution and to switch the rtc to the newer driver. Signed-off-by: Alexander Schulz Signed-off-by: Russell King --- arch/arm/mach-shark/core.c | 48 +++++++++++++++++++++++--- arch/arm/mach-shark/include/mach/debug-macro.S | 2 -- arch/arm/mach-shark/include/mach/framebuffer.h | 16 +++++++++ arch/arm/mach-shark/include/mach/hardware.h | 27 --------------- arch/arm/mach-shark/include/mach/io.h | 8 ++--- arch/arm/mach-shark/include/mach/irqs.h | 2 +- arch/arm/mach-shark/include/mach/isa-dma.h | 4 --- arch/arm/mach-shark/include/mach/memory.h | 1 + arch/arm/mach-shark/include/mach/system.h | 16 ++------- arch/arm/mach-shark/include/mach/uncompress.h | 2 +- arch/arm/mach-shark/leds.c | 6 +++- 11 files changed, 74 insertions(+), 58 deletions(-) create mode 100644 arch/arm/mach-shark/include/mach/framebuffer.h (limited to 'arch/arm/mach-shark') diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c index a23fd3d0163a..4f3a26512599 100644 --- a/arch/arm/mach-shark/core.c +++ b/arch/arm/mach-shark/core.c @@ -16,12 +16,28 @@ #include #include -#include - #include #include #include +#define IO_BASE 0xe0000000 +#define IO_SIZE 0x08000000 +#define IO_START 0x40000000 +#define ROMCARD_SIZE 0x08000000 +#define ROMCARD_START 0x10000000 + +void arch_reset(char mode) +{ + short temp; + local_irq_disable(); + /* Reset the Machine via pc[3] of the sequoia chipset */ + outw(0x09,0x24); + temp=inw(0x26); + temp = temp | (1<<3) | (1<<10); + outw(0x09,0x24); + outw(temp,0x26); +} + static struct plat_serial8250_port serial_platform_data[] = { { .iobase = 0x3f8, @@ -50,14 +66,38 @@ static struct platform_device serial_device = { }, }; +static struct resource rtc_resources[] = { + [0] = { + .start = 0x70, + .end = 0x73, + .flags = IORESOURCE_IO, + }, + [1] = { + .start = IRQ_ISA_RTC_ALARM, + .end = IRQ_ISA_RTC_ALARM, + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device rtc_device = { + .name = "rtc_cmos", + .id = -1, + .resource = rtc_resources, + .num_resources = ARRAY_SIZE(rtc_resources), +}; + static int __init shark_init(void) { int ret; if (machine_is_shark()) + { + ret = platform_device_register(&rtc_device); + if (ret) printk(KERN_ERR "Unable to register RTC device: %d\n", ret); ret = platform_device_register(&serial_device); - - return ret; + if (ret) printk(KERN_ERR "Unable to register Serial device: %d\n", ret); + } + return 0; } arch_initcall(shark_init); diff --git a/arch/arm/mach-shark/include/mach/debug-macro.S b/arch/arm/mach-shark/include/mach/debug-macro.S index 0836cb78b29a..f97a7626bd58 100644 --- a/arch/arm/mach-shark/include/mach/debug-macro.S +++ b/arch/arm/mach-shark/include/mach/debug-macro.S @@ -27,5 +27,3 @@ bne 1001b .endm - .macro waituart,rd,rx - .endm diff --git a/arch/arm/mach-shark/include/mach/framebuffer.h b/arch/arm/mach-shark/include/mach/framebuffer.h new file mode 100644 index 000000000000..84a5bf6e5ba3 --- /dev/null +++ b/arch/arm/mach-shark/include/mach/framebuffer.h @@ -0,0 +1,16 @@ +/* + * arch/arm/mach-shark/include/mach/framebuffer.h + * + * by Alexander Schulz + * + */ + +#ifndef __ASM_ARCH_FRAMEBUFFER_H +#define __ASM_ARCH_FRAMEBUFFER_H + +/* defines for the Framebuffer */ +#define FB_START 0x06000000 +#define FB_SIZE 0x01000000 + +#endif + diff --git a/arch/arm/mach-shark/include/mach/hardware.h b/arch/arm/mach-shark/include/mach/hardware.h index 01bf76099ce5..94d84b27a0cb 100644 --- a/arch/arm/mach-shark/include/mach/hardware.h +++ b/arch/arm/mach-shark/include/mach/hardware.h @@ -10,35 +10,8 @@ #ifndef __ASM_ARCH_HARDWARE_H #define __ASM_ARCH_HARDWARE_H -#ifndef __ASSEMBLY__ - -/* - * Mapping areas - */ -#define IO_BASE 0xe0000000 - -#else - -#define IO_BASE 0 - -#endif - -#define IO_SIZE 0x08000000 -#define IO_START 0x40000000 -#define ROMCARD_SIZE 0x08000000 -#define ROMCARD_START 0x10000000 - - -/* defines for the Framebuffer */ -#define FB_START 0x06000000 -#define FB_SIZE 0x01000000 - #define UNCACHEABLE_ADDR 0xdf010000 -#define SEQUOIA_LED_GREEN (1<<6) -#define SEQUOIA_LED_AMBER (1<<5) -#define SEQUOIA_LED_BACK (1<<7) - #define pcibios_assign_all_busses() 1 #define PCIBIOS_MIN_IO 0x6000 diff --git a/arch/arm/mach-shark/include/mach/io.h b/arch/arm/mach-shark/include/mach/io.h index c5cee829fc87..9ccbcecc430b 100644 --- a/arch/arm/mach-shark/include/mach/io.h +++ b/arch/arm/mach-shark/include/mach/io.h @@ -11,10 +11,10 @@ #ifndef __ASM_ARM_ARCH_IO_H #define __ASM_ARM_ARCH_IO_H -#define PCIO_BASE 0xe0000000 -#define IO_SPACE_LIMIT 0xffffffff +#define IO_SPACE_LIMIT 0xffffffff -#define __io(a) ((void __iomem *)(PCIO_BASE + (a))) -#define __mem_pci(addr) (addr) +#define __io(a) ((void __iomem *)(0xe0000000 + (a))) + +#define __mem_pci(addr) (addr) #endif diff --git a/arch/arm/mach-shark/include/mach/irqs.h b/arch/arm/mach-shark/include/mach/irqs.h index 0586acd7cdd5..c8e8a4e1f61a 100644 --- a/arch/arm/mach-shark/include/mach/irqs.h +++ b/arch/arm/mach-shark/include/mach/irqs.h @@ -7,7 +7,7 @@ #define NR_IRQS 16 #define IRQ_ISA_KEYBOARD 1 -#define RTC_IRQ 8 +#define IRQ_ISA_RTC_ALARM 8 #define I8042_KBD_IRQ 1 #define I8042_AUX_IRQ 12 #define IRQ_HARDDISK 14 diff --git a/arch/arm/mach-shark/include/mach/isa-dma.h b/arch/arm/mach-shark/include/mach/isa-dma.h index 864298ff3927..96c43b8f8dda 100644 --- a/arch/arm/mach-shark/include/mach/isa-dma.h +++ b/arch/arm/mach-shark/include/mach/isa-dma.h @@ -6,10 +6,6 @@ #ifndef __ASM_ARCH_DMA_H #define __ASM_ARCH_DMA_H -/* Use only the lowest 4MB, nothing else works. - * The rest is not DMAable. See dev / .properties - * in OpenFirmware. - */ #define MAX_DMA_CHANNELS 8 #define DMA_ISA_CASCADE 4 diff --git a/arch/arm/mach-shark/include/mach/memory.h b/arch/arm/mach-shark/include/mach/memory.h index c5ab038925d6..3053e5b7f168 100644 --- a/arch/arm/mach-shark/include/mach/memory.h +++ b/arch/arm/mach-shark/include/mach/memory.h @@ -23,6 +23,7 @@ static inline void __arch_adjust_zones(int node, unsigned long *zone_size, unsig { if (node != 0) return; /* Only the first 4 MB (=1024 Pages) are usable for DMA */ + /* See dev / -> .properties in OpenFirmware. */ zone_size[1] = zone_size[0] - 1024; zone_size[0] = 1024; zhole_size[1] = zhole_size[0]; diff --git a/arch/arm/mach-shark/include/mach/system.h b/arch/arm/mach-shark/include/mach/system.h index e45bd734a03e..0752ca29971a 100644 --- a/arch/arm/mach-shark/include/mach/system.h +++ b/arch/arm/mach-shark/include/mach/system.h @@ -6,20 +6,8 @@ #ifndef __ASM_ARCH_SYSTEM_H #define __ASM_ARCH_SYSTEM_H -#include - -static void arch_reset(char mode) -{ - short temp; - local_irq_disable(); - /* Reset the Machine via pc[3] of the sequoia chipset */ - outw(0x09,0x24); - temp=inw(0x26); - temp = temp | (1<<3) | (1<<10); - outw(0x09,0x24); - outw(temp,0x26); - -} +/* Found in arch/mach-shark/core.c */ +extern void arch_reset(char mode); static inline void arch_idle(void) { diff --git a/arch/arm/mach-shark/include/mach/uncompress.h b/arch/arm/mach-shark/include/mach/uncompress.h index 3725e1633418..22ccab4c3c5e 100644 --- a/arch/arm/mach-shark/include/mach/uncompress.h +++ b/arch/arm/mach-shark/include/mach/uncompress.h @@ -11,7 +11,7 @@ static inline void putc(int c) { - int t; + volatile int t; SERIAL_BASE[0] = c; t=0x10000; diff --git a/arch/arm/mach-shark/leds.c b/arch/arm/mach-shark/leds.c index 8bd8d6bb4d92..c9e32de4adf9 100644 --- a/arch/arm/mach-shark/leds.c +++ b/arch/arm/mach-shark/leds.c @@ -22,12 +22,16 @@ #include #include -#include #include #include #define LED_STATE_ENABLED 1 #define LED_STATE_CLAIMED 2 + +#define SEQUOIA_LED_GREEN (1<<6) +#define SEQUOIA_LED_AMBER (1<<5) +#define SEQUOIA_LED_BACK (1<<7) + static char led_state; static short hw_led_state; static short saved_state; -- cgit v1.2.3