summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.osdl.org>2004-02-05 20:06:21 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2004-02-05 20:06:21 -0800
commitdac9e97d6faf7c5fef80d8e1987fc1246aba2320 (patch)
tree4f1492df959701993ccff661b0e11912e0f219e4 /include
parent9e81ab3b7d7396810cbe4b2eddb7a86353f2f819 (diff)
parent617a1bc9d3ce7d4e0771669cc3a94a3332632d85 (diff)
Merge bk://bk.arm.linux.org.uk/linux-2.6-rmk
into home.osdl.org:/home/torvalds/v2.5/linux
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/arch-integrator/cm.h36
-rw-r--r--include/asm-arm/arch-integrator/irqs.h25
-rw-r--r--include/asm-arm/arch-integrator/system.h9
-rw-r--r--include/asm-arm/arch-integrator/time.h38
-rw-r--r--include/asm-arm/hardware/amba.h12
-rw-r--r--include/asm-arm/hardware/sa1111.h8
-rw-r--r--include/asm-arm/pci.h2
-rw-r--r--include/asm-arm/semaphore.h14
-rw-r--r--include/asm-arm/unistd.h3
9 files changed, 111 insertions, 36 deletions
diff --git a/include/asm-arm/arch-integrator/cm.h b/include/asm-arm/arch-integrator/cm.h
new file mode 100644
index 000000000000..d31c1a71f781
--- /dev/null
+++ b/include/asm-arm/arch-integrator/cm.h
@@ -0,0 +1,36 @@
+/*
+ * update the core module control register.
+ */
+void cm_control(u32, u32);
+
+#define CM_CTRL_LED (1 << 0)
+#define CM_CTRL_nMBDET (1 << 1)
+#define CM_CTRL_REMAP (1 << 2)
+#define CM_CTRL_RESET (1 << 3)
+
+/*
+ * Integrator/AP,PP2 specific
+ */
+#define CM_CTRL_HIGHVECTORS (1 << 4)
+#define CM_CTRL_BIGENDIAN (1 << 5)
+#define CM_CTRL_FASTBUS (1 << 6)
+#define CM_CTRL_SYNC (1 << 7)
+
+/*
+ * ARM926/946/966 Integrator/CP specific
+ */
+#define CM_CTRL_LCDBIASEN (1 << 8)
+#define CM_CTRL_LCDBIASUP (1 << 9)
+#define CM_CTRL_LCDBIASDN (1 << 10)
+#define CM_CTRL_LCDMUXSEL_MASK (7 << 11)
+#define CM_CTRL_LCDMUXSEL_GENLCD (1 << 11)
+#define CM_CTRL_LCDMUXSEL_SHARPLCD1 (3 << 11)
+#define CM_CTRL_LCDMUXSEL_SHARPLCD2 (4 << 11)
+#define CM_CTRL_LCDMUXSEL_VGA (7 << 11)
+#define CM_CTRL_LCDEN0 (1 << 14)
+#define CM_CTRL_LCDEN1 (1 << 15)
+#define CM_CTRL_STATIC1 (1 << 16)
+#define CM_CTRL_STATIC2 (1 << 17)
+#define CM_CTRL_STATIC (1 << 18)
+#define CM_CTRL_n24BITEN (1 << 19)
+#define CM_CTRL_EBIWP (1 << 20)
diff --git a/include/asm-arm/arch-integrator/irqs.h b/include/asm-arm/arch-integrator/irqs.h
index a36789ad20f8..ba7b3afee445 100644
--- a/include/asm-arm/arch-integrator/irqs.h
+++ b/include/asm-arm/arch-integrator/irqs.h
@@ -45,6 +45,13 @@
#define IRQ_AP_CPINT1 19
#define IRQ_AP_LBUSTIMEOUT 20
#define IRQ_AP_APCINT 21
+#define IRQ_CP_CLCDCINT 22
+#define IRQ_CP_MMCIINT0 23
+#define IRQ_CP_MMCIINT1 24
+#define IRQ_CP_AACIINT 25
+#define IRQ_CP_CPPLDINT 26
+#define IRQ_CP_ETHINT 27
+#define IRQ_CP_TSPENINT 28
#define IRQ_PIC_END 31
#define IRQ_CIC_START 32
@@ -53,5 +60,23 @@
#define IRQ_CM_COMMTX 34
#define IRQ_CIC_END 34
+/*
+ * IntegratorCP only
+ */
+#define IRQ_SIC_START 35
+#define IRQ_SIC_CP_SOFTINT 35
+#define IRQ_SIC_CP_RI0 36
+#define IRQ_SIC_CP_RI1 37
+#define IRQ_SIC_CP_CARDIN 38
+#define IRQ_SIC_CP_LMINT0 39
+#define IRQ_SIC_CP_LMINT1 40
+#define IRQ_SIC_CP_LMINT2 41
+#define IRQ_SIC_CP_LMINT3 42
+#define IRQ_SIC_CP_LMINT4 43
+#define IRQ_SIC_CP_LMINT5 44
+#define IRQ_SIC_CP_LMINT6 45
+#define IRQ_SIC_CP_LMINT7 46
+#define IRQ_SIC_END 46
+
#define NR_IRQS 47
diff --git a/include/asm-arm/arch-integrator/system.h b/include/asm-arm/arch-integrator/system.h
index 904a5822d6e3..8ea442237d20 100644
--- a/include/asm-arm/arch-integrator/system.h
+++ b/include/asm-arm/arch-integrator/system.h
@@ -21,7 +21,7 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
-#include <asm/arch/platform.h>
+#include <asm/arch/cm.h>
static inline void arch_idle(void)
{
@@ -34,16 +34,11 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode)
{
- unsigned int hdr_ctrl = (IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_CTRL_OFFSET);
- unsigned int val;
-
/*
* To reset, we hit the on-board reset register
* in the system FPGA
*/
- val = __raw_readl(hdr_ctrl);
- val |= INTEGRATOR_HDR_CTRL_RESET;
- __raw_writel(val, hdr_ctrl);
+ cm_control(CM_CTRL_RESET, CM_CTRL_RESET);
}
#endif
diff --git a/include/asm-arm/arch-integrator/time.h b/include/asm-arm/arch-integrator/time.h
index e361e947f151..2ecbfa7f1259 100644
--- a/include/asm-arm/arch-integrator/time.h
+++ b/include/asm-arm/arch-integrator/time.h
@@ -17,6 +17,7 @@
*/
#include <asm/system.h>
#include <asm/leds.h>
+#include <asm/mach-types.h>
/*
* Where is the timer (VA)?
@@ -31,19 +32,15 @@
*/
#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10)
#if TIMER_INTERVAL >= 0x100000
-#define TIMER_RELOAD (TIMER_INTERVAL >> 8) /* Divide by 256 */
-#define TIMER_CTRL 0x88 /* Enable, Clock / 256 */
#define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC)
#elif TIMER_INTERVAL >= 0x10000
-#define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */
-#define TIMER_CTRL 0x84 /* Enable, Clock / 16 */
#define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC)
#else
-#define TIMER_RELOAD (TIMER_INTERVAL)
-#define TIMER_CTRL 0x80 /* Enable */
#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)
#endif
+#define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable */
+
/*
* What does it look like?
*/
@@ -56,6 +53,8 @@ typedef struct TimerStruct {
extern unsigned long (*gettimeoffset)(void);
+static unsigned long timer_reload;
+
/*
* Returns number of ms since last clock interrupt. Note that interrupts
* will have been disabled by do_gettimeoffset()
@@ -81,13 +80,13 @@ static unsigned long integrator_gettimeoffset(void)
/*
* Number of ticks since last interrupt.
*/
- ticks1 = TIMER_RELOAD - ticks2;
+ ticks1 = timer_reload - ticks2;
/*
* Interrupt pending? If so, we've reloaded once already.
*/
if (status & (1 << IRQ_TIMERINT1))
- ticks1 += TIMER_RELOAD;
+ ticks1 += timer_reload;
/*
* Convert the ticks to usecs
@@ -121,8 +120,21 @@ void __init time_init(void)
volatile TimerStruct_t *timer0 = (volatile TimerStruct_t *)TIMER0_VA_BASE;
volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE;
volatile TimerStruct_t *timer2 = (volatile TimerStruct_t *)TIMER2_VA_BASE;
-
- timer_irq.handler = integrator_timer_interrupt;
+ unsigned int timer_ctrl = 0x80 | 0x40; /* periodic */
+
+ if (machine_is_integrator()) {
+ timer_reload = 1000000 * TICKS_PER_uSEC / HZ;
+ } else if (machine_is_cintegrator()) {
+ timer_reload = 1000000 / HZ;
+ timer_ctrl |= TIMER_CTRL_IE;
+ }
+ if (timer_reload > 0x100000) {
+ timer_reload >>= 8;
+ timer_ctrl |= 0x08; /* /256 */
+ } else if (timer_reload > 0x010000) {
+ timer_reload >>= 4;
+ timer_ctrl |= 0x04; /* /16 */
+ }
/*
* Initialise to a known state (all timers off)
@@ -131,12 +143,14 @@ void __init time_init(void)
timer1->TimerControl = 0;
timer2->TimerControl = 0;
- timer1->TimerLoad = TIMER_RELOAD;
- timer1->TimerControl = TIMER_CTRL | 0x40; /* periodic */
+ timer1->TimerLoad = timer_reload;
+ timer1->TimerValue = timer_reload;
+ timer1->TimerControl = timer_ctrl;
/*
* Make irqs happen for the system timer
*/
+ timer_irq.handler = integrator_timer_interrupt;
setup_irq(IRQ_TIMERINT1, &timer_irq);
gettimeoffset = integrator_gettimeoffset;
}
diff --git a/include/asm-arm/hardware/amba.h b/include/asm-arm/hardware/amba.h
index 174afa5d16c2..17bb14bf4376 100644
--- a/include/asm-arm/hardware/amba.h
+++ b/include/asm-arm/hardware/amba.h
@@ -10,11 +10,13 @@
#ifndef ASMARM_AMBA_H
#define ASMARM_AMBA_H
+#define AMBA_NR_IRQS 2
+
struct amba_device {
struct device dev;
struct resource res;
- unsigned int irq;
unsigned int periphid;
+ unsigned int irq[AMBA_NR_IRQS];
};
struct amba_id {
@@ -40,5 +42,13 @@ int amba_driver_register(struct amba_driver *);
void amba_driver_unregister(struct amba_driver *);
int amba_device_register(struct amba_device *, struct resource *);
void amba_device_unregister(struct amba_device *);
+struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int);
+int amba_request_regions(struct amba_device *, const char *);
+void amba_release_regions(struct amba_device *);
+
+#define amba_config(d) (((d)->periphid >> 24) & 0xff)
+#define amba_rev(d) (((d)->periphid >> 20) & 0x0f)
+#define amba_manf(d) (((d)->periphid >> 12) & 0xff)
+#define amba_part(d) ((d)->periphid & 0xfff)
#endif
diff --git a/include/asm-arm/hardware/sa1111.h b/include/asm-arm/hardware/sa1111.h
index ad0731607668..6f60c300099f 100644
--- a/include/asm-arm/hardware/sa1111.h
+++ b/include/asm-arm/hardware/sa1111.h
@@ -219,8 +219,6 @@
#define _SAITR _SA1111( 0x065c )
#define _SADR _SA1111( 0x0680 )
-#if LANGUAGE == C
-
#define SACR0 __CCREG(0x0600)
#define SACR1 __CCREG(0x0604)
#define SACR2 __CCREG(0x0608)
@@ -246,8 +244,6 @@
#define SAITR __CCREG(0x065c)
#define SADR __CCREG(0x0680)
-#endif /* LANGUAGE == C */
-
#define SACR0_ENB (1<<0)
#define SACR0_BCKD (1<<2)
#define SACR0_RST (1<<3)
@@ -368,8 +364,6 @@
#define _PC_SDR _SA1111( 0x1028 )
#define _PC_SSR _SA1111( 0x102c )
-#if LANGUAGE == C
-
#define PA_DDR __CCREG(0x1000)
#define PA_DRR __CCREG(0x1004)
#define PA_DWR __CCREG(0x1004)
@@ -386,8 +380,6 @@
#define PC_SDR __CCREG(0x1028)
#define PC_SSR __CCREG(0x102c)
-#endif /* LANGUAGE == C */
-
/*
* Interrupt Controller
*
diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h
index ac2ed843eefe..5280c8fa574d 100644
--- a/include/asm-arm/pci.h
+++ b/include/asm-arm/pci.h
@@ -75,7 +75,7 @@ pci_unmap_single(struct pci_dev *hwdev, dma_addr_t handle, size_t size, int dir)
return;
}
- return dma_unmap_single(hwdev ? &hwdev->dev : NULL, handle, size, dir);
+ dma_unmap_single(hwdev ? &hwdev->dev : NULL, handle, size, dir);
}
static inline int
diff --git a/include/asm-arm/semaphore.h b/include/asm-arm/semaphore.h
index 76284ff21f49..2e47880be261 100644
--- a/include/asm-arm/semaphore.h
+++ b/include/asm-arm/semaphore.h
@@ -16,12 +16,12 @@ struct semaphore {
atomic_t count;
int sleepers;
wait_queue_head_t wait;
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
long __magic;
#endif
};
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
# define __SEM_DEBUG_INIT(name) .__magic = (long)&(name).__magic
#else
# define __SEM_DEBUG_INIT(name)
@@ -46,7 +46,7 @@ static inline void sema_init(struct semaphore *sem, int val)
atomic_set(&sem->count, val);
sem->sleepers = 0;
init_waitqueue_head(&sem->wait);
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
sem->__magic = (long)&sem->__magic;
#endif
}
@@ -85,7 +85,7 @@ extern void __up(struct semaphore * sem);
*/
static inline void down(struct semaphore * sem)
{
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
#endif
might_sleep();
@@ -98,7 +98,7 @@ static inline void down(struct semaphore * sem)
*/
static inline int down_interruptible (struct semaphore * sem)
{
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
#endif
might_sleep();
@@ -107,7 +107,7 @@ static inline int down_interruptible (struct semaphore * sem)
static inline int down_trylock(struct semaphore *sem)
{
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
#endif
@@ -122,7 +122,7 @@ static inline int down_trylock(struct semaphore *sem)
*/
static inline void up(struct semaphore * sem)
{
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
#endif
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index 4affa93ebb48..bba255b0bb93 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -296,6 +296,9 @@
#define __NR_tgkill (__NR_SYSCALL_BASE+268)
#define __NR_utimes (__NR_SYSCALL_BASE+269)
#define __NR_fadvise64_64 (__NR_SYSCALL_BASE+270)
+#define __NR_pciconfig_iobase (__NR_SYSCALL_BASE+271)
+#define __NR_pciconfig_read (__NR_SYSCALL_BASE+272)
+#define __NR_pciconfig_write (__NR_SYSCALL_BASE+273)
/*
* The following SWIs are ARM private.