|
From: Andy P. <at...@us...> - 2002-04-10 18:39:59
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/arm/mach-shark
In directory usw-pr-cvs1:/tmp/cvs-serv24336/arm/mach-shark
Modified Files:
Makefile arch.c dma.c mm.c
Added Files:
leds.c
Log Message:
synch 2.4.15 commit 32
--- NEW FILE ---
/*
* arch/arm/kernel/leds-shark.c
* by Alexander Schulz
*
* derived from:
* arch/arm/kernel/leds-footbridge.c
* Copyright (C) 1998-1999 Russell King
*
* DIGITAL Shark LED control routines.
*
* The leds use is as follows:
* - Green front - toggles state every 50 timer interrupts
* - Amber front - Unused, this is a dual color led (Amber/Green)
* - Amber back - On if system is not idle
*
* Changelog:
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/ioport.h>
#include <asm/hardware.h>
#include <asm/leds.h>
#include <asm/io.h>
#include <asm/system.h>
#define LED_STATE_ENABLED 1
#define LED_STATE_CLAIMED 2
static char led_state;
static short hw_led_state;
static short saved_state;
static spinlock_t leds_lock = SPIN_LOCK_UNLOCKED;
short sequoia_read(int addr) {
outw(addr,0x24);
return inw(0x26);
}
void sequoia_write(short value,short addr) {
outw(addr,0x24);
outw(value,0x26);
}
static void sequoia_leds_event(led_event_t evt)
{
unsigned long flags;
spin_lock_irqsave(&leds_lock, flags);
hw_led_state = sequoia_read(0x09);
switch (evt) {
case led_start:
hw_led_state |= SEQUOIA_LED_GREEN;
hw_led_state |= SEQUOIA_LED_AMBER;
#ifdef CONFIG_LEDS_CPU
hw_led_state |= SEQUOIA_LED_BACK;
#else
hw_led_state &= ~SEQUOIA_LED_BACK;
#endif
led_state |= LED_STATE_ENABLED;
break;
case led_stop:
hw_led_state &= ~SEQUOIA_LED_BACK;
hw_led_state |= SEQUOIA_LED_GREEN;
hw_led_state |= SEQUOIA_LED_AMBER;
led_state &= ~LED_STATE_ENABLED;
break;
case led_claim:
led_state |= LED_STATE_CLAIMED;
saved_state = hw_led_state;
hw_led_state &= ~SEQUOIA_LED_BACK;
hw_led_state |= SEQUOIA_LED_GREEN;
hw_led_state |= SEQUOIA_LED_AMBER;
break;
case led_release:
led_state &= ~LED_STATE_CLAIMED;
hw_led_state = saved_state;
break;
#ifdef CONFIG_LEDS_TIMER
case led_timer:
if (!(led_state & LED_STATE_CLAIMED))
hw_led_state ^= SEQUOIA_LED_GREEN;
break;
#endif
#ifdef CONFIG_LEDS_CPU
case led_idle_start:
if (!(led_state & LED_STATE_CLAIMED))
hw_led_state &= ~SEQUOIA_LED_BACK;
break;
case led_idle_end:
if (!(led_state & LED_STATE_CLAIMED))
hw_led_state |= SEQUOIA_LED_BACK;
break;
#endif
case led_green_on:
if (led_state & LED_STATE_CLAIMED)
hw_led_state &= ~SEQUOIA_LED_GREEN;
break;
case led_green_off:
if (led_state & LED_STATE_CLAIMED)
hw_led_state |= SEQUOIA_LED_GREEN;
break;
case led_amber_on:
if (led_state & LED_STATE_CLAIMED)
hw_led_state &= ~SEQUOIA_LED_AMBER;
break;
case led_amber_off:
if (led_state & LED_STATE_CLAIMED)
hw_led_state |= SEQUOIA_LED_AMBER;
break;
case led_red_on:
if (led_state & LED_STATE_CLAIMED)
hw_led_state |= SEQUOIA_LED_BACK;
break;
case led_red_off:
if (led_state & LED_STATE_CLAIMED)
hw_led_state &= ~SEQUOIA_LED_BACK;
break;
default:
break;
}
if (led_state & LED_STATE_ENABLED)
sequoia_write(hw_led_state,0x09);
spin_unlock_irqrestore(&leds_lock, flags);
}
static int __init leds_init(void)
{
extern void (*leds_event)(led_event_t);
short temp;
leds_event = sequoia_leds_event;
/* Make LEDs independent of power-state */
request_region(0x24,4,"sequoia");
temp = sequoia_read(0x09);
temp |= 1<<10;
sequoia_write(temp,0x09);
leds_event(led_start);
return 0;
}
__initcall(leds_init);
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/mach-shark/Makefile,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- Makefile 25 Feb 2001 23:15:21 -0000 1.1.1.2
+++ Makefile 10 Apr 2002 13:51:23 -0000 1.2
@@ -18,6 +18,6 @@
export-objs :=
-#obj-$(CONFIG_LEDS) += leds.o
+obj-$(CONFIG_LEDS) += leds.o
include $(TOPDIR)/Rules.make
Index: arch.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/mach-shark/arch.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- arch.c 14 Jan 2001 19:48:18 -0000 1.1.1.1
+++ arch.c 10 Apr 2002 13:51:23 -0000 1.2
@@ -1,10 +1,7 @@
/*
* linux/arch/arm/mach-shark/arch.c
*
- * Architecture specific fixups. This is where any
- * parameters in the params struct are fixed up, or
- * any additional architecture specific information
- * is pulled from the params struct.
+ * Architecture specific stuff.
*/
#include <linux/tty.h>
#include <linux/delay.h>
@@ -18,14 +15,13 @@
#include <asm/mach/arch.h>
-extern void setup_initrd(unsigned int start, unsigned int size);
-extern void setup_ramdisk(int doload, int prompt, int start, unsigned int rd_sz);
-extern void __init footbridge_map_io(void);
-extern void __init shark_map_io(void);
+extern void shark_map_io(void);
+extern void genarch_init_irq(void);
MACHINE_START(SHARK, "Shark")
MAINTAINER("Alexander Schulz")
BOOT_MEM(0x08000000, 0x40000000, 0xe0000000)
- VIDEO(0x06000000, 0x061fffff)
+ BOOT_PARAMS(0x08003000)
MAPIO(shark_map_io)
+ INITIRQ(genarch_init_irq)
MACHINE_END
Index: dma.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/mach-shark/dma.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- dma.c 14 Jan 2001 19:48:19 -0000 1.1.1.1
+++ dma.c 10 Apr 2002 13:51:23 -0000 1.2
@@ -1,7 +1,7 @@
/*
* linux/arch/arm/mach-shark/dma.c
*
- * by Ale...@st...
+ * by Alexander Schulz
*
* derived from:
* arch/arm/kernel/dma-ebsa285.c
Index: mm.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/mach-shark/mm.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- mm.c 14 Jan 2001 19:48:19 -0000 1.1.1.1
+++ mm.c 10 Apr 2002 13:51:23 -0000 1.2
@@ -1,7 +1,7 @@
/*
* linux/arch/arm/mach-shark/mm.c
*
- * by Ale...@st...
+ * by Alexander Schulz
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -19,8 +19,6 @@
static struct map_desc shark_io_desc[] __initdata = {
{ IO_BASE , IO_START , IO_SIZE , DOMAIN_IO, 0, 1, 0, 0 },
- { FB_BASE , FB_START , FB_SIZE , DOMAIN_IO, 0, 1, 0, 0 },
- { FBREG_BASE , FBREG_START , FBREG_SIZE , DOMAIN_IO, 0, 1, 0, 0 },
LAST_DESC
};
|