aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm')
-rw-r--r--include/asm-arm/arch-at91rm9200/at91rm9200_spi.h81
-rw-r--r--include/asm-arm/arch-at91rm9200/at91rm9200_ssc.h96
-rw-r--r--include/asm-arm/arch-at91rm9200/at91rm9200_sys.h11
-rw-r--r--include/asm-arm/arch-at91rm9200/at91rm9200_tc.h146
-rw-r--r--include/asm-arm/arch-at91rm9200/at91rm9200_udp.h77
-rw-r--r--include/asm-arm/arch-at91rm9200/board.h30
-rw-r--r--include/asm-arm/arch-at91rm9200/gpio.h5
-rw-r--r--include/asm-arm/arch-at91rm9200/hardware.h9
-rw-r--r--include/asm-arm/arch-at91rm9200/io.h1
-rw-r--r--include/asm-arm/arch-at91rm9200/irqs.h2
-rw-r--r--include/asm-arm/arch-at91rm9200/memory.h2
-rw-r--r--include/asm-arm/arch-at91rm9200/pio.h115
-rw-r--r--include/asm-arm/arch-at91rm9200/system.h10
-rw-r--r--include/asm-arm/arch-at91rm9200/timex.h2
-rw-r--r--include/asm-arm/arch-at91rm9200/uncompress.h2
-rw-r--r--include/asm-arm/arch-at91rm9200/vmalloc.h2
-rw-r--r--include/asm-arm/arch-ixp23xx/entry-macro.S2
-rw-r--r--include/asm-arm/arch-ixp23xx/ixp23xx.h2
-rw-r--r--include/asm-arm/arch-netx/debug-macro.S38
-rw-r--r--include/asm-arm/arch-netx/dma.h21
-rw-r--r--include/asm-arm/arch-netx/entry-macro.S35
-rw-r--r--include/asm-arm/arch-netx/hardware.h39
-rw-r--r--include/asm-arm/arch-netx/io.h29
-rw-r--r--include/asm-arm/arch-netx/irqs.h70
-rw-r--r--include/asm-arm/arch-netx/memory.h36
-rw-r--r--include/asm-arm/arch-netx/netx-regs.h410
-rw-r--r--include/asm-arm/arch-netx/param.h18
-rw-r--r--include/asm-arm/arch-netx/pfifo.h54
-rw-r--r--include/asm-arm/arch-netx/system.h38
-rw-r--r--include/asm-arm/arch-netx/timex.h20
-rw-r--r--include/asm-arm/arch-netx/uncompress.h76
-rw-r--r--include/asm-arm/arch-netx/vmalloc.h19
-rw-r--r--include/asm-arm/arch-netx/xc.h42
-rw-r--r--include/asm-arm/arch-pxa/poodle.h4
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h18
-rw-r--r--include/asm-arm/arch-pxa/system.h1
-rw-r--r--include/asm-arm/arch-versatile/system.h16
-rw-r--r--include/asm-arm/byteorder.h10
-rw-r--r--include/asm-arm/hardware/sharpsl_pm.h11
-rw-r--r--include/asm-arm/mach/serial_at91.h (renamed from include/asm-arm/mach/serial_at91rm9200.h)8
-rw-r--r--include/asm-arm/system.h3
41 files changed, 1453 insertions, 158 deletions
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_spi.h b/include/asm-arm/arch-at91rm9200/at91rm9200_spi.h
new file mode 100644
index 000000000000..bff5ea45f604
--- /dev/null
+++ b/include/asm-arm/arch-at91rm9200/at91rm9200_spi.h
@@ -0,0 +1,81 @@
1/*
2 * include/asm-arm/arch-at91rm9200/at91rm9200_spi.h
3 *
4 * Copyright (C) 2005 Ivan Kokshaysky
5 * Copyright (C) SAN People
6 *
7 * Serial Peripheral Interface (SPI) registers.
8 * Based on AT91RM9200 datasheet revision E.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 */
15
16#ifndef AT91RM9200_SPI_H
17#define AT91RM9200_SPI_H
18
19#define AT91_SPI_CR 0x00 /* Control Register */
20#define AT91_SPI_SPIEN (1 << 0) /* SPI Enable */
21#define AT91_SPI_SPIDIS (1 << 1) /* SPI Disable */
22#define AT91_SPI_SWRST (1 << 7) /* SPI Software Reset */
23#define AT91_SPI_LASTXFER (1 << 24) /* Last Transfer [SAM9261 only] */
24
25#define AT91_SPI_MR 0x04 /* Mode Register */
26#define AT91_SPI_MSTR (1 << 0) /* Master/Slave Mode */
27#define AT91_SPI_PS (1 << 1) /* Peripheral Select */
28#define AT91_SPI_PS_FIXED (0 << 1)
29#define AT91_SPI_PS_VARIABLE (1 << 1)
30#define AT91_SPI_PCSDEC (1 << 2) /* Chip Select Decode */
31#define AT91_SPI_DIV32 (1 << 3) /* Clock Selection */
32#define AT91_SPI_MODFDIS (1 << 4) /* Mode Fault Detection */
33#define AT91_SPI_LLB (1 << 7) /* Local Loopback Enable */
34#define AT91_SPI_PCS (0xf << 16) /* Peripheral Chip Select */
35#define AT91_SPI_DLYBCS (0xff << 24) /* Delay Between Chip Selects */
36
37#define AT91_SPI_RDR 0x08 /* Receive Data Register */
38#define AT91_SPI_RD (0xffff << 0) /* Receive Data */
39#define AT91_SPI_PCS (0xf << 16) /* Peripheral Chip Select */
40
41#define AT91_SPI_TDR 0x0c /* Transmit Data Register */
42#define AT91_SPI_TD (0xffff << 0) /* Transmit Data */
43#define AT91_SPI_PCS (0xf << 16) /* Peripheral Chip Select */
44#define AT91_SPI_LASTXFER (1 << 24) /* Last Transfer [SAM9261 only] */
45
46#define AT91_SPI_SR 0x10 /* Status Register */
47#define AT91_SPI_RDRF (1 << 0) /* Receive Data Register Full */
48#define AT91_SPI_TDRE (1 << 1) /* Transmit Data Register Full */
49#define AT91_SPI_MODF (1 << 2) /* Mode Fault Error */
50#define AT91_SPI_OVRES (1 << 3) /* Overrun Error Status */
51#define AT91_SPI_ENDRX (1 << 4) /* End of RX buffer */
52#define AT91_SPI_ENDTX (1 << 5) /* End of TX buffer */
53#define AT91_SPI_RXBUFF (1 << 6) /* RX Buffer Full */
54#define AT91_SPI_TXBUFE (1 << 7) /* TX Buffer Empty */
55#define AT91_SPI_NSSR (1 << 8) /* NSS Rising [SAM9261 only] */
56#define AT91_SPI_TXEMPTY (1 << 9) /* Transmission Register Empty [SAM9261 only] */
57#define AT91_SPI_SPIENS (1 << 16) /* SPI Enable Status */
58
59#define AT91_SPI_IER 0x14 /* Interrupt Enable Register */
60#define AT91_SPI_IDR 0x18 /* Interrupt Disable Register */
61#define AT91_SPI_IMR 0x1c /* Interrupt Mask Register */
62
63#define AT91_SPI_CSR(n) (0x30 + ((n) * 4)) /* Chip Select Registers 0-3 */
64#define AT91_SPI_CPOL (1 << 0) /* Clock Polarity */
65#define AT91_SPI_NCPHA (1 << 1) /* Clock Phase */
66#define AT91_SPI_CSAAT (1 << 3) /* Chip Select Active After Transfer [SAM9261 only] */
67#define AT91_SPI_BITS (0xf << 4) /* Bits Per Transfer */
68#define AT91_SPI_BITS_8 (0 << 4)
69#define AT91_SPI_BITS_9 (1 << 4)
70#define AT91_SPI_BITS_10 (2 << 4)
71#define AT91_SPI_BITS_11 (3 << 4)
72#define AT91_SPI_BITS_12 (4 << 4)
73#define AT91_SPI_BITS_13 (5 << 4)
74#define AT91_SPI_BITS_14 (6 << 4)
75#define AT91_SPI_BITS_15 (7 << 4)
76#define AT91_SPI_BITS_16 (8 << 4)
77#define AT91_SPI_SCBR (0xff << 8) /* Serial Clock Baud Rate */
78#define AT91_SPI_DLYBS (0xff << 16) /* Delay before SPCK */
79#define AT91_SPI_DLYBCT (0xff << 24) /* Delay between Consecutive Transfers */
80
81#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_ssc.h b/include/asm-arm/arch-at91rm9200/at91rm9200_ssc.h
new file mode 100644
index 000000000000..ac880227147f
--- /dev/null
+++ b/include/asm-arm/arch-at91rm9200/at91rm9200_ssc.h
@@ -0,0 +1,96 @@
1/*
2 * include/asm-arm/arch-at91rm9200/at91rm9200_ssc.h
3 *
4 * Copyright (C) SAN People
5 *
6 * Serial Synchronous Controller (SSC) registers.
7 * Based on AT91RM9200 datasheet revision E.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 */
14
15#ifndef AT91RM9200_SSC_H
16#define AT91RM9200_SSC_H
17
18#define AT91_SSC_CR 0x00 /* Control Register */
19#define AT91_SSC_RXEN (1 << 0) /* Receive Enable */
20#define AT91_SSC_RXDIS (1 << 1) /* Receive Disable */
21#define AT91_SSC_TXEN (1 << 8) /* Transmit Enable */
22#define AT91_SSC_TXDIS (1 << 9) /* Transmit Disable */
23#define AT91_SSC_SWRST (1 << 15) /* Software Reset */
24
25#define AT91_SSC_CMR 0x04 /* Clock Mode Register */
26#define AT91_SSC_CMR_DIV (0xfff << 0) /* Clock Divider */
27
28#define AT91_SSC_RCMR 0x10 /* Receive Clock Mode Register */
29#define AT91_SSC_CKS (3 << 0) /* Clock Selection */
30#define AT91_SSC_CKS_DIV (0 << 0)
31#define AT91_SSC_CKS_CLOCK (1 << 0)
32#define AT91_SSC_CKS_PIN (2 << 0)
33#define AT91_SSC_CKO (7 << 2) /* Clock Output Mode Selection */
34#define AT91_SSC_CKO_NONE (0 << 2)
35#define AT91_SSC_CKO_CONTINUOUS (1 << 2)
36#define AT91_SSC_CKI (1 << 5) /* Clock Inversion */
37#define AT91_SSC_CKI_FALLING (0 << 5)
38#define AT91_SSC_CK_RISING (1 << 5)
39#define AT91_SSC_START (0xf << 8) /* Start Selection */
40#define AT91_SSC_START_CONTINUOUS (0 << 8)
41#define AT91_SSC_START_TX_RX (1 << 8)
42#define AT91_SSC_START_LOW_RF (2 << 8)
43#define AT91_SSC_START_HIGH_RF (3 << 8)
44#define AT91_SSC_START_FALLING_RF (4 << 8)
45#define AT91_SSC_START_RISING_RF (5 << 8)
46#define AT91_SSC_START_LEVEL_RF (6 << 8)
47#define AT91_SSC_START_EDGE_RF (7 << 8)
48#define AT91_SSC_STTDLY (0xff << 16) /* Start Delay */
49#define AT91_SSC_PERIOD (0xff << 24) /* Period Divider Selection */
50
51#define AT91_SSC_RFMR 0x14 /* Receive Frame Mode Register */
52#define AT91_SSC_DATALEN (0x1f << 0) /* Data Length */
53#define AT91_SSC_LOOP (1 << 5) /* Loop Mode */
54#define AT91_SSC_MSBF (1 << 7) /* Most Significant Bit First */
55#define AT91_SSC_DATNB (0xf << 8) /* Data Number per Frame */
56#define AT91_SSC_FSLEN (0xf << 16) /* Frame Sync Length */
57#define AT91_SSC_FSOS (7 << 20) /* Frame Sync Output Selection */
58#define AT91_SSC_FSOS_NONE (0 << 20)
59#define AT91_SSC_FSOS_NEGATIVE (1 << 20)
60#define AT91_SSC_FSOS_POSITIVE (2 << 20)
61#define AT91_SSC_FSOS_LOW (3 << 20)
62#define AT91_SSC_FSOS_HIGH (4 << 20)
63#define AT91_SSC_FSOS_TOGGLE (5 << 20)
64#define AT91_SSC_FSEDGE (1 << 24) /* Frame Sync Edge Detection */
65#define AT91_SSC_FSEDGE_POSITIVE (0 << 24)
66#define AT91_SSC_FSEDGE_NEGATIVE (1 << 24)
67
68#define AT91_SSC_TCMR 0x18 /* Transmit Clock Mode Register */
69#define AT91_SSC_TFMR 0x1c /* Transmit Fram Mode Register */
70#define AT91_SSC_DATDEF (1 << 5) /* Data Default Value */
71#define AT91_SSC_FSDEN (1 << 23) /* Frame Sync Data Enable */
72
73#define AT91_SSC_RHR 0x20 /* Receive Holding Register */
74#define AT91_SSC_THR 0x24 /* Transmit Holding Register */
75#define AT91_SSC_RSHR 0x30 /* Receive Sync Holding Register */
76#define AT91_SSC_TSHR 0x34 /* Transmit Sync Holding Register */
77
78#define AT91_SSC_SR 0x40 /* Status Register */
79#define AT91_SSC_TXRDY (1 << 0) /* Transmit Ready */
80#define AT91_SSC_TXEMPTY (1 << 1) /* Transmit Empty */
81#define AT91_SSC_ENDTX (1 << 2) /* End of Transmission */
82#define AT91_SSC_TXBUFE (1 << 3) /* Transmit Buffer Empty */
83#define AT91_SSC_RXRDY (1 << 4) /* Receive Ready */
84#define AT91_SSC_OVRUN (1 << 5) /* Receive Overrun */
85#define AT91_SSC_ENDRX (1 << 6) /* End of Reception */
86#define AT91_SSC_RXBUFF (1 << 7) /* Receive Buffer Full */
87#define AT91_SSC_TXSYN (1 << 10) /* Transmit Sync */
88#define AT91_SSC_RXSYN (1 << 11) /* Receive Sync */
89#define AT91_SSC_TXENA (1 << 16) /* Transmit Enable */
90#define AT91_SSC_RXENA (1 << 17) /* Receive Enable */
91
92#define AT91_SSC_IER 0x44 /* Interrupt Enable Register */
93#define AT91_SSC_IDR 0x48 /* Interrupt Disable Register */
94#define AT91_SSC_IMR 0x4c /* Interrupt Mask Register */
95
96#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_sys.h b/include/asm-arm/arch-at91rm9200/at91rm9200_sys.h
index 2910d359f919..0f4c12d5f0cd 100644
--- a/include/asm-arm/arch-at91rm9200/at91rm9200_sys.h
+++ b/include/asm-arm/arch-at91rm9200/at91rm9200_sys.h
@@ -68,8 +68,17 @@
68#define AT91_DBGU_RHR (AT91_DBGU + 0x18) /* Receiver Holding Register */ 68#define AT91_DBGU_RHR (AT91_DBGU + 0x18) /* Receiver Holding Register */
69#define AT91_DBGU_THR (AT91_DBGU + 0x1c) /* Transmitter Holding Register */ 69#define AT91_DBGU_THR (AT91_DBGU + 0x1c) /* Transmitter Holding Register */
70#define AT91_DBGU_BRGR (AT91_DBGU + 0x20) /* Baud Rate Generator Register */ 70#define AT91_DBGU_BRGR (AT91_DBGU + 0x20) /* Baud Rate Generator Register */
71
71#define AT91_DBGU_CIDR (AT91_DBGU + 0x40) /* Chip ID Register */ 72#define AT91_DBGU_CIDR (AT91_DBGU + 0x40) /* Chip ID Register */
72#define AT91_DBGU_EXID (AT91_DBGU + 0x44) /* Chip ID Extension Register */ 73#define AT91_DBGU_EXID (AT91_DBGU + 0x44) /* Chip ID Extension Register */
74#define AT91_CIDR_VERSION (0x1f << 0) /* Version of the Device */
75#define AT91_CIDR_EPROC (7 << 5) /* Embedded Processor */
76#define AT91_CIDR_NVPSIZ (0xf << 8) /* Nonvolatile Program Memory Size */
77#define AT91_CIDR_NVPSIZ2 (0xf << 12) /* Second Nonvolatile Program Memory Size */
78#define AT91_CIDR_SRAMSIZ (0xf << 16) /* Internal SRAM Size */
79#define AT91_CIDR_ARCH (0xff << 20) /* Architecture Identifier */
80#define AT91_CIDR_NVPTYP (7 << 28) /* Nonvolatile Program Memory Type */
81#define AT91_CIDR_EXT (1 << 31) /* Extension Flag */
73 82
74 83
75/* 84/*
@@ -241,7 +250,7 @@
241#define AT91_RTC_SEC (0x7f << 0) /* Current Second */ 250#define AT91_RTC_SEC (0x7f << 0) /* Current Second */
242#define AT91_RTC_MIN (0x7f << 8) /* Current Minute */ 251#define AT91_RTC_MIN (0x7f << 8) /* Current Minute */
243#define AT91_RTC_HOUR (0x3f << 16) /* Current Hour */ 252#define AT91_RTC_HOUR (0x3f << 16) /* Current Hour */
244#define At91_RTC_AMPM (1 << 22) /* Ante Meridiem Post Meridiem Indicator */ 253#define AT91_RTC_AMPM (1 << 22) /* Ante Meridiem Post Meridiem Indicator */
245 254
246#define AT91_RTC_CALR (AT91_RTC + 0x0c) /* Calendar Register */ 255#define AT91_RTC_CALR (AT91_RTC + 0x0c) /* Calendar Register */
247#define AT91_RTC_CENT (0x7f << 0) /* Current Century */ 256#define AT91_RTC_CENT (0x7f << 0) /* Current Century */
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_tc.h b/include/asm-arm/arch-at91rm9200/at91rm9200_tc.h
new file mode 100644
index 000000000000..f4da752bb0c8
--- /dev/null
+++ b/include/asm-arm/arch-at91rm9200/at91rm9200_tc.h
@@ -0,0 +1,146 @@
1/*
2 * include/asm-arm/arch-at91rm9200/at91rm9200_tc.h
3 *
4 * Copyright (C) SAN People
5 *
6 * Timer/Counter Unit (TC) registers.
7 * Based on AT91RM9200 datasheet revision E.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 */
14
15#ifndef AT91RM9200_TC_H
16#define AT91RM9200_TC_H
17
18#define AT91_TC_BCR 0xc0 /* TC Block Control Register */
19#define AT91_TC_SYNC (1 << 0) /* Synchro Command */
20
21#define AT91_TC_BMR 0xc4 /* TC Block Mode Register */
22#define AT91_TC_TC0XC0S (3 << 0) /* External Clock Signal 0 Selection */
23#define AT91_TC_TC0XC0S_TCLK0 (0 << 0)
24#define AT91_TC_TC0XC0S_NONE (1 << 0)
25#define AT91_TC_TC0XC0S_TIOA1 (2 << 0)
26#define AT91_TC_TC0XC0S_TIOA2 (3 << 0)
27#define AT91_TC_TC1XC1S (3 << 2) /* External Clock Signal 1 Selection */
28#define AT91_TC_TC1XC1S_TCLK1 (0 << 2)
29#define AT91_TC_TC1XC1S_NONE (1 << 2)
30#define AT91_TC_TC1XC1S_TIOA0 (2 << 2)
31#define AT91_TC_TC1XC1S_TIOA2 (3 << 2)
32#define AT91_TC_TC2XC2S (3 << 4) /* External Clock Signal 2 Selection */
33#define AT91_TC_TC2XC2S_TCLK2 (0 << 4)
34#define AT91_TC_TC2XC2S_NONE (1 << 4)
35#define AT91_TC_TC2XC2S_TIOA0 (2 << 4)
36#define AT91_TC_TC2XC2S_TIOA1 (3 << 4)
37
38
39#define AT91_TC_CCR 0x00 /* Channel Control Register */
40#define AT91_TC_CLKEN (1 << 0) /* Counter Clock Enable Command */
41#define AT91_TC_CLKDIS (1 << 1) /* Counter CLock Disable Command */
42#define AT91_TC_SWTRG (1 << 2) /* Software Trigger Command */
43
44#define AT91_TC_CMR 0x04 /* Channel Mode Register */
45#define AT91_TC_TCCLKS (7 << 0) /* Capture/Waveform Mode: Clock Selection */
46#define AT91_TC_TIMER_CLOCK1 (0 << 0)
47#define AT91_TC_TIMER_CLOCK2 (1 << 0)
48#define AT91_TC_TIMER_CLOCK3 (2 << 0)
49#define AT91_TC_TIMER_CLOCK4 (3 << 0)
50#define AT91_TC_TIMER_CLOCK5 (4 << 0)
51#define AT91_TC_XC0 (5 << 0)
52#define AT91_TC_XC1 (6 << 0)
53#define AT91_TC_XC2 (7 << 0)
54#define AT91_TC_CLKI (1 << 3) /* Capture/Waveform Mode: Clock Invert */
55#define AT91_TC_BURST (3 << 4) /* Capture/Waveform Mode: Burst Signal Selection */
56#define AT91_TC_LDBSTOP (1 << 6) /* Capture Mode: Counter Clock Stopped with TB Loading */
57#define AT91_TC_LDBDIS (1 << 7) /* Capture Mode: Counter Clock Disable with RB Loading */
58#define AT91_TC_ETRGEDG (3 << 8) /* Capture Mode: External Trigger Edge Selection */
59#define AT91_TC_ABETRG (1 << 10) /* Capture Mode: TIOA or TIOB External Trigger Selection */
60#define AT91_TC_CPCTRG (1 << 14) /* Capture Mode: RC Compare Trigger Enable */
61#define AT91_TC_WAVE (1 << 15) /* Capture/Waveform mode */
62#define AT91_TC_LDRA (3 << 16) /* Capture Mode: RA Loading Selection */
63#define AT91_TC_LDRB (3 << 18) /* Capture Mode: RB Loading Selection */
64
65#define AT91_TC_CPCSTOP (1 << 6) /* Waveform Mode: Counter Clock Stopped with RC Compare */
66#define AT91_TC_CPCDIS (1 << 7) /* Waveform Mode: Counter Clock Disable with RC Compare */
67#define AT91_TC_EEVTEDG (3 << 8) /* Waveform Mode: External Event Edge Selection */
68#define AT91_TC_EEVTEDG_NONE (0 << 8)
69#define AT91_TC_EEVTEDG_RISING (1 << 8)
70#define AT91_TC_EEVTEDG_FALLING (2 << 8)
71#define AT91_TC_EEVTEDG_BOTH (3 << 8)
72#define AT91_TC_EEVT (3 << 10) /* Waveform Mode: External Event Selection */
73#define AT91_TC_EEVT_TIOB (0 << 10)
74#define AT91_TC_EEVT_XC0 (1 << 10)
75#define AT91_TC_EEVT_XC1 (2 << 10)
76#define AT91_TC_EEVT_XC2 (3 << 10)
77#define AT91_TC_ENETRG (1 << 12) /* Waveform Mode: External Event Trigger Enable */
78#define AT91_TC_WAVESEL (3 << 13) /* Waveform Mode: Waveform Selection */
79#define AT91_TC_WAVESEL_UP (0 << 13)
80#define AT91_TC_WAVESEL_UP_AUTO (2 << 13)
81#define AT91_TC_WAVESEL_UPDOWN (1 << 13)
82#define AT91_TC_WAVESEL_UPDOWN_AUTO (3 << 13)
83#define AT91_TC_ACPA (3 << 16) /* Waveform Mode: RA Compare Effect on TIOA */
84#define AT91_TC_ACPA_NONE (0 << 16)
85#define AT91_TC_ACPA_SET (1 << 16)
86#define AT91_TC_ACPA_CLEAR (2 << 16)
87#define AT91_TC_ACPA_TOGGLE (3 << 16)
88#define AT91_TC_ACPC (3 << 18) /* Waveform Mode: RC Compre Effect on TIOA */
89#define AT91_TC_ACPC_NONE (0 << 18)
90#define AT91_TC_ACPC_SET (1 << 18)
91#define AT91_TC_ACPC_CLEAR (2 << 18)
92#define AT91_TC_ACPC_TOGGLE (3 << 18)
93#define AT91_TC_AEEVT (3 << 20) /* Waveform Mode: External Event Effect on TIOA */
94#define AT91_TC_AEEVT_NONE (0 << 20)
95#define AT91_TC_AEEVT_SET (1 << 20)
96#define AT91_TC_AEEVT_CLEAR (2 << 20)
97#define AT91_TC_AEEVT_TOGGLE (3 << 20)
98#define AT91_TC_ASWTRG (3 << 22) /* Waveform Mode: Software Trigger Effect on TIOA */
99#define AT91_TC_ASWTRG_NONE (0 << 22)
100#define AT91_TC_ASWTRG_SET (1 << 22)
101#define AT91_TC_ASWTRG_CLEAR (2 << 22)
102#define AT91_TC_ASWTRG_TOGGLE (3 << 22)
103#define AT91_TC_BCPB (3 << 24) /* Waveform Mode: RB Compare Effect on TIOB */
104#define AT91_TC_BCPB_NONE (0 << 24)
105#define AT91_TC_BCPB_SET (1 << 24)
106#define AT91_TC_BCPB_CLEAR (2 << 24)
107#define AT91_TC_BCPB_TOGGLE (3 << 24)
108#define AT91_TC_BCPC (3 << 26) /* Waveform Mode: RC Compare Effect on TIOB */
109#define AT91_TC_BCPC_NONE (0 << 26)
110#define AT91_TC_BCPC_SET (1 << 26)
111#define AT91_TC_BCPC_CLEAR (2 << 26)
112#define AT91_TC_BCPC_TOGGLE (3 << 26)
113#define AT91_TC_BEEVT (3 << 28) /* Waveform Mode: External Event Effect on TIOB */
114#define AT91_TC_BEEVT_NONE (0 << 28)
115#define AT91_TC_BEEVT_SET (1 << 28)
116#define AT91_TC_BEEVT_CLEAR (2 << 28)
117#define AT91_TC_BEEVT_TOGGLE (3 << 28)
118#define AT91_TC_BSWTRG (3 << 30) /* Waveform Mode: Software Trigger Effect on TIOB */
119#define AT91_TC_BSWTRG_NONE (0 << 30)
120#define AT91_TC_BSWTRG_SET (1 << 30)
121#define AT91_TC_BSWTRG_CLEAR (2 << 30)
122#define AT91_TC_BSWTRG_TOGGLE (3 << 30)
123
124#define AT91_TC_CV 0x10 /* Counter Value */
125#define AT91_TC_RA 0x14 /* Register A */
126#define AT91_TC_RB 0x18 /* Register B */
127#define AT91_TC_RC 0x1c /* Register C */
128
129#define AT91_TC_SR 0x20 /* Status Register */
130#define AT91_TC_COVFS (1 << 0) /* Counter Overflow Status */
131#define AT91_TC_LOVRS (1 << 1) /* Load Overrun Status */
132#define AT91_TC_CPAS (1 << 2) /* RA Compare Status */
133#define AT91_TC_CPBS (1 << 3) /* RB Compare Status */
134#define AT91_TC_CPCS (1 << 4) /* RC Compare Status */
135#define AT91_TC_LDRAS (1 << 5) /* RA Loading Status */
136#define AT91_TC_LDRBS (1 << 6) /* RB Loading Status */
137#define AT91_TC_ETRGS (1 << 7) /* External Trigger Status */
138#define AT91_TC_CLKSTA (1 << 16) /* Clock Enabling Status */
139#define AT91_TC_MTIOA (1 << 17) /* TIOA Mirror */
140#define AT91_TC_MTIOB (1 << 18) /* TIOB Mirror */
141
142#define AT91_TC_IER 0x24 /* Interrupt Enable Register */
143#define AT91_TC_IDR 0x28 /* Interrupt Disable Register */
144#define AT91_TC_IMR 0x2c /* Interrupt Mask Register */
145
146#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_udp.h b/include/asm-arm/arch-at91rm9200/at91rm9200_udp.h
new file mode 100644
index 000000000000..951e3f61cef4
--- /dev/null
+++ b/include/asm-arm/arch-at91rm9200/at91rm9200_udp.h
@@ -0,0 +1,77 @@
1/*
2 * include/asm-arm/arch-at91rm9200/at91rm9200_udp.h
3 *
4 * Copyright (C) 2005 Ivan Kokshaysky
5 * Copyright (C) SAN People
6 *
7 * USB Device Port (UDP) registers.
8 * Based on AT91RM9200 datasheet revision E.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 */
15
16#ifndef AT91RM9200_UDP_H
17#define AT91RM9200_UDP_H
18
19#define AT91_UDP_FRM_NUM 0x00 /* Frame Number Register */
20#define AT91_UDP_NUM (0x7ff << 0) /* Frame Number */
21#define AT91_UDP_FRM_ERR (1 << 16) /* Frame Error */
22#define AT91_UDP_FRM_OK (1 << 17) /* Frame OK */
23
24#define AT91_UDP_GLB_STAT 0x04 /* Global State Register */
25#define AT91_UDP_FADDEN (1 << 0) /* Function Address Enable */
26#define AT91_UDP_CONFG (1 << 1) /* Configured */
27#define AT91_UDP_ESR (1 << 2) /* Enable Send Resume */
28#define AT91_UDP_RSMINPR (1 << 3) /* Resume has been sent */
29#define AT91_UDP_RMWUPE (1 << 4) /* Remote Wake Up Enable */
30
31#define AT91_UDP_FADDR 0x08 /* Function Address Register */
32#define AT91_UDP_FADD (0x7f << 0) /* Function Address Value */
33#define AT91_UDP_FEN (1 << 8) /* Function Enable */
34
35#define AT91_UDP_IER 0x10 /* Interrupt Enable Register */
36#define AT91_UDP_IDR 0x14 /* Interrupt Disable Register */
37#define AT91_UDP_IMR 0x18 /* Interrupt Mask Register */
38
39#define AT91_UDP_ISR 0x1c /* Interrupt Status Register */
40#define AT91_UDP_EP(n) (1 << (n)) /* Endpoint Interrupt Status */
41#define AT91_UDP_RXSUSP (1 << 8) /* USB Suspend Interrupt Status */
42#define AT91_UDP_RXRSM (1 << 9) /* USB Resume Interrupt Status */
43#define AT91_UDP_EXTRSM (1 << 10) /* External Resume Interrupt Status */
44#define AT91_UDP_SOFINT (1 << 11) /* Start of Frame Interrupt Status */
45#define AT91_UDP_ENDBUSRES (1 << 12) /* End of Bus Reset Interrpt Status */
46#define AT91_UDP_WAKEUP (1 << 13) /* USB Wakeup Interrupt Status */
47
48#define AT91_UDP_ICR 0x20 /* Interrupt Clear Register */
49#define AT91_UDP_RST_EP 0x28 /* Reset Endpoint Register */
50
51#define AT91_UDP_CSR(n) (0x30 + ((n) * 4)) /* Endpoint Control/Status Registers 0-7 */
52#define AT91_UDP_TXCOMP (1 << 0) /* Generates IN packet with data previously written in DPR */
53#define AT91_UDP_RX_DATA_BK0 (1 << 1) /* Receive Data Bank 0 */
54#define AT91_UDP_RXSETUP (1 << 2) /* Send STALL to the host */
55#define AT91_UDP_STALLSENT (1 << 3) /* Stall Sent / Isochronous error (Isochronous endpoints) */
56#define AT91_UDP_TXPKTRDY (1 << 4) /* Transmit Packet Ready */
57#define AT91_UDP_FORCESTALL (1 << 5) /* Force Stall */
58#define AT91_UDP_RX_DATA_BK1 (1 << 6) /* Receive Data Bank 1 */
59#define AT91_UDP_DIR (1 << 7) /* Transfer Direction */
60#define AT91_UDP_EPTYPE (7 << 8) /* Endpoint Type */
61#define AT91_UDP_EPTYPE_CTRL (0 << 8)
62#define AT91_UDP_EPTYPE_ISO_OUT (1 << 8)
63#define AT91_UDP_EPTYPE_BULK_OUT (2 << 8)
64#define AT91_UDP_EPTYPE_INT_OUT (3 << 8)
65#define AT91_UDP_EPTYPE_ISO_IN (5 << 8)
66#define AT91_UDP_EPTYPE_BULK_IN (6 << 8)
67#define AT91_UDP_EPTYPE_INT_IN (7 << 8)
68#define AT91_UDP_DTGLE (1 << 11) /* Data Toggle */
69#define AT91_UDP_EPEDS (1 << 15) /* Endpoint Enable/Disable */
70#define AT91_UDP_RXBYTECNT (0x7ff << 16) /* Number of bytes in FIFO */
71
72#define AT91_UDP_FDR(n) (0x50 + ((n) * 4)) /* Endpoint FIFO Data Registers 0-7 */
73
74#define AT91_UDP_TXVC 0x74 /* Transceiver Control Register */
75#define AT91_UDP_TXVC_TXVDIS (1 << 8) /* Transceiver Disable */
76
77#endif
diff --git a/include/asm-arm/arch-at91rm9200/board.h b/include/asm-arm/arch-at91rm9200/board.h
index 4fdef13d01d4..1fdd70b23809 100644
--- a/include/asm-arm/arch-at91rm9200/board.h
+++ b/include/asm-arm/arch-at91rm9200/board.h
@@ -31,14 +31,9 @@
31#ifndef __ASM_ARCH_BOARD_H 31#ifndef __ASM_ARCH_BOARD_H
32#define __ASM_ARCH_BOARD_H 32#define __ASM_ARCH_BOARD_H
33 33
34 /* Clocks */
35extern unsigned long at91_master_clock;
36
37 /* Serial Port */
38extern int at91_serial_map[AT91_NR_UART];
39extern int at91_console_port;
40
41#include <linux/mtd/partitions.h> 34#include <linux/mtd/partitions.h>
35#include <linux/device.h>
36#include <linux/spi/spi.h>
42 37
43 /* USB Device */ 38 /* USB Device */
44struct at91_udc_data { 39struct at91_udc_data {
@@ -91,10 +86,25 @@ struct at91_nand_data {
91extern void __init at91_add_device_nand(struct at91_nand_data *data); 86extern void __init at91_add_device_nand(struct at91_nand_data *data);
92 87
93 /* I2C*/ 88 /* I2C*/
94void __init at91_add_device_i2c(void); 89extern void __init at91_add_device_i2c(void);
90
91 /* SPI */
92extern void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices);
95 93
96 /* RTC */ 94 /* Serial */
97void __init at91_add_device_rtc(void); 95struct at91_uart_config {
96 unsigned short console_tty; /* tty number of serial console */
97 unsigned short nr_tty; /* number of serial tty's */
98 short tty_map[]; /* map UART to tty number */
99};
100extern struct platform_device *at91_default_console_device;
101extern void __init at91_init_serial(struct at91_uart_config *config);
102
103struct at91_uart_data {
104 short use_dma_tx; /* use transmit DMA? */
105 short use_dma_rx; /* use receive DMA? */
106};
107extern void __init at91_add_device_serial(void);
98 108
99 /* LEDs */ 109 /* LEDs */
100extern u8 at91_leds_cpu; 110extern u8 at91_leds_cpu;
diff --git a/include/asm-arm/arch-at91rm9200/gpio.h b/include/asm-arm/arch-at91rm9200/gpio.h
index 6176ab2dc417..dbde1baaf251 100644
--- a/include/asm-arm/arch-at91rm9200/gpio.h
+++ b/include/asm-arm/arch-at91rm9200/gpio.h
@@ -13,6 +13,8 @@
13#ifndef __ASM_ARCH_AT91RM9200_GPIO_H 13#ifndef __ASM_ARCH_AT91RM9200_GPIO_H
14#define __ASM_ARCH_AT91RM9200_GPIO_H 14#define __ASM_ARCH_AT91RM9200_GPIO_H
15 15
16#include <asm/irq.h>
17
16#define PIN_BASE NR_AIC_IRQS 18#define PIN_BASE NR_AIC_IRQS
17 19
18#define PQFP_GPIO_BANKS 3 /* PQFP package has 3 banks */ 20#define PQFP_GPIO_BANKS 3 /* PQFP package has 3 banks */
@@ -188,6 +190,9 @@ extern int at91_set_multi_drive(unsigned pin, int is_on);
188/* callable at any time */ 190/* callable at any time */
189extern int at91_set_gpio_value(unsigned pin, int value); 191extern int at91_set_gpio_value(unsigned pin, int value);
190extern int at91_get_gpio_value(unsigned pin); 192extern int at91_get_gpio_value(unsigned pin);
193
194extern void at91_gpio_suspend(void);
195extern void at91_gpio_resume(void);
191#endif 196#endif
192 197
193#endif 198#endif
diff --git a/include/asm-arm/arch-at91rm9200/hardware.h b/include/asm-arm/arch-at91rm9200/hardware.h
index 59e6f44d3a0d..235d39d91107 100644
--- a/include/asm-arm/arch-at91rm9200/hardware.h
+++ b/include/asm-arm/arch-at91rm9200/hardware.h
@@ -50,9 +50,12 @@
50#define AT91_VA_BASE_TCB0 AT91_IO_P2V(AT91_BASE_TCB0) 50#define AT91_VA_BASE_TCB0 AT91_IO_P2V(AT91_BASE_TCB0)
51 51
52/* Internal SRAM */ 52/* Internal SRAM */
53#define AT91_BASE_SRAM 0x00200000 /* Internal SRAM base address */ 53#define AT91_SRAM_BASE 0x00200000 /* Internal SRAM base address */
54#define AT91_SRAM_SIZE 0x00004000 /* Internal SRAM SIZE (16Kb) */ 54#define AT91_SRAM_SIZE 0x00004000 /* Internal SRAM SIZE (16Kb) */
55 55
56 /* Internal SRAM is mapped below the IO devices */
57#define AT91_SRAM_VIRT_BASE (AT91_IO_VIRT_BASE - AT91_SRAM_SIZE)
58
56/* Serial ports */ 59/* Serial ports */
57#define AT91_NR_UART 5 /* 4 USART3's and one DBGU port */ 60#define AT91_NR_UART 5 /* 4 USART3's and one DBGU port */
58 61
@@ -81,14 +84,14 @@ static inline unsigned int at91_sys_read(unsigned int reg_offset)
81{ 84{
82 void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS; 85 void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
83 86
84 return readl(addr + reg_offset); 87 return __raw_readl(addr + reg_offset);
85} 88}
86 89
87static inline void at91_sys_write(unsigned int reg_offset, unsigned long value) 90static inline void at91_sys_write(unsigned int reg_offset, unsigned long value)
88{ 91{
89 void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS; 92 void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
90 93
91 writel(value, addr + reg_offset); 94 __raw_writel(value, addr + reg_offset);
92} 95}
93#endif 96#endif
94 97
diff --git a/include/asm-arm/arch-at91rm9200/io.h b/include/asm-arm/arch-at91rm9200/io.h
index 23e670d85c9d..88fd1bebcef3 100644
--- a/include/asm-arm/arch-at91rm9200/io.h
+++ b/include/asm-arm/arch-at91rm9200/io.h
@@ -21,7 +21,6 @@
21#ifndef __ASM_ARCH_IO_H 21#ifndef __ASM_ARCH_IO_H
22#define __ASM_ARCH_IO_H 22#define __ASM_ARCH_IO_H
23 23
24#include <asm/arch/at91rm9200.h>
25#include <asm/io.h> 24#include <asm/io.h>
26 25
27#define IO_SPACE_LIMIT 0xFFFFFFFF 26#define IO_SPACE_LIMIT 0xFFFFFFFF
diff --git a/include/asm-arm/arch-at91rm9200/irqs.h b/include/asm-arm/arch-at91rm9200/irqs.h
index 27b0497f1b36..2dc93b174a8f 100644
--- a/include/asm-arm/arch-at91rm9200/irqs.h
+++ b/include/asm-arm/arch-at91rm9200/irqs.h
@@ -37,8 +37,6 @@
37 * symbols in gpio.h for ones handled indirectly as GPIOs. 37 * symbols in gpio.h for ones handled indirectly as GPIOs.
38 * We make provision for 4 banks of GPIO. 38 * We make provision for 4 banks of GPIO.
39 */ 39 */
40#include <asm/arch/gpio.h>
41
42#define NR_IRQS (NR_AIC_IRQS + (4 * 32)) 40#define NR_IRQS (NR_AIC_IRQS + (4 * 32))
43 41
44 42
diff --git a/include/asm-arm/arch-at91rm9200/memory.h b/include/asm-arm/arch-at91rm9200/memory.h
index 462f1f0ad67c..3c327c404373 100644
--- a/include/asm-arm/arch-at91rm9200/memory.h
+++ b/include/asm-arm/arch-at91rm9200/memory.h
@@ -21,7 +21,7 @@
21#ifndef __ASM_ARCH_MEMORY_H 21#ifndef __ASM_ARCH_MEMORY_H
22#define __ASM_ARCH_MEMORY_H 22#define __ASM_ARCH_MEMORY_H
23 23
24#include <asm/arch/hardware.h> 24#include <asm/hardware.h>
25 25
26#define PHYS_OFFSET (AT91_SDRAM_BASE) 26#define PHYS_OFFSET (AT91_SDRAM_BASE)
27 27
diff --git a/include/asm-arm/arch-at91rm9200/pio.h b/include/asm-arm/arch-at91rm9200/pio.h
deleted file mode 100644
index a89501b4a703..000000000000
--- a/include/asm-arm/arch-at91rm9200/pio.h
+++ /dev/null
@@ -1,115 +0,0 @@
1/*
2 * include/asm-arm/arch-at91rm9200/pio.h
3 *
4 * Copyright (C) 2003 SAN People
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 */
12
13#ifndef __ASM_ARCH_PIO_H
14#define __ASM_ARCH_PIO_H
15
16#include <asm/arch/hardware.h>
17
18static inline void AT91_CfgPIO_USART0(void) {
19 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA17_TXD0 | AT91_PA18_RXD0 | AT91_PA20_CTS0);
20
21 /*
22 * Errata #39 - RTS0 is not internally connected to PA21. We need to drive
23 * the pin manually. Default is off (RTS is active low).
24 */
25 at91_sys_write(AT91_PIOA + PIO_PER, AT91_PA21_RTS0);
26 at91_sys_write(AT91_PIOA + PIO_OER, AT91_PA21_RTS0);
27 at91_sys_write(AT91_PIOA + PIO_SODR, AT91_PA21_RTS0);
28}
29
30static inline void AT91_CfgPIO_USART1(void) {
31 at91_sys_write(AT91_PIOB + PIO_PDR, AT91_PB18_RI1 | AT91_PB19_DTR1
32 | AT91_PB20_TXD1 | AT91_PB21_RXD1 | AT91_PB23_DCD1
33 | AT91_PB24_CTS1 | AT91_PB25_DSR1 | AT91_PB26_RTS1);
34}
35
36static inline void AT91_CfgPIO_USART2(void) {
37 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA22_RXD2 | AT91_PA23_TXD2);
38}
39
40static inline void AT91_CfgPIO_USART3(void) {
41 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA5_TXD3 | AT91_PA6_RXD3);
42 at91_sys_write(AT91_PIOA + PIO_BSR, AT91_PA5_TXD3 | AT91_PA6_RXD3);
43}
44
45static inline void AT91_CfgPIO_DBGU(void) {
46 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA31_DTXD | AT91_PA30_DRXD);
47}
48
49/*
50 * Enable the Two-Wire interface.
51 */
52static inline void AT91_CfgPIO_TWI(void) {
53 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA25_TWD | AT91_PA26_TWCK);
54 at91_sys_write(AT91_PIOA + PIO_ASR, AT91_PA25_TWD | AT91_PA26_TWCK);
55 at91_sys_write(AT91_PIOA + PIO_MDER, AT91_PA25_TWD | AT91_PA26_TWCK); /* open drain */
56}
57
58/*
59 * Enable the Serial Peripheral Interface.
60 */
61static inline void AT91_CfgPIO_SPI(void) {
62 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA0_MISO | AT91_PA1_MOSI | AT91_PA2_SPCK);
63}
64
65static inline void AT91_CfgPIO_SPI_CS0(void) {
66 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA3_NPCS0);
67}
68
69static inline void AT91_CfgPIO_SPI_CS1(void) {
70 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA4_NPCS1);
71}
72
73static inline void AT91_CfgPIO_SPI_CS2(void) {
74 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA5_NPCS2);
75}
76
77static inline void AT91_CfgPIO_SPI_CS3(void) {
78 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA6_NPCS3);
79}
80
81/*
82 * Select the DataFlash card.
83 */
84static inline void AT91_CfgPIO_DataFlashCard(void) {
85 at91_sys_write(AT91_PIOB + PIO_PER, AT91_PIO_P(7));
86 at91_sys_write(AT91_PIOB + PIO_OER, AT91_PIO_P(7));
87 at91_sys_write(AT91_PIOB + PIO_CODR, AT91_PIO_P(7));
88}
89
90/*
91 * Enable NAND Flash (SmartMedia) interface.
92 */
93static inline void AT91_CfgPIO_SmartMedia(void) {
94 /* enable PC0=SMCE, PC1=SMOE, PC3=SMWE, A21=CLE, A22=ALE */
95 at91_sys_write(AT91_PIOC + PIO_ASR, AT91_PC0_BFCK | AT91_PC1_BFRDY_SMOE | AT91_PC3_BFBAA_SMWE);
96 at91_sys_write(AT91_PIOC + PIO_PDR, AT91_PC0_BFCK | AT91_PC1_BFRDY_SMOE | AT91_PC3_BFBAA_SMWE);
97
98 /* Configure PC2 as input (signal READY of the SmartMedia) */
99 at91_sys_write(AT91_PIOC + PIO_PER, AT91_PC2_BFAVD); /* enable direct output enable */
100 at91_sys_write(AT91_PIOC + PIO_ODR, AT91_PC2_BFAVD); /* disable output */
101
102 /* Configure PB1 as input (signal Card Detect of the SmartMedia) */
103 at91_sys_write(AT91_PIOB + PIO_PER, AT91_PIO_P(1)); /* enable direct output enable */
104 at91_sys_write(AT91_PIOB + PIO_ODR, AT91_PIO_P(1)); /* disable output */
105}
106
107static inline int AT91_PIO_SmartMedia_RDY(void) {
108 return (at91_sys_read(AT91_PIOC + PIO_PDSR) & AT91_PIO_P(2)) ? 1 : 0;
109}
110
111static inline int AT91_PIO_SmartMedia_CardDetect(void) {
112 return (at91_sys_read(AT91_PIOB + PIO_PDSR) & AT91_PIO_P(1)) ? 1 : 0;
113}
114
115#endif
diff --git a/include/asm-arm/arch-at91rm9200/system.h b/include/asm-arm/arch-at91rm9200/system.h
index 29c42655f05c..8a2ff472e4cf 100644
--- a/include/asm-arm/arch-at91rm9200/system.h
+++ b/include/asm-arm/arch-at91rm9200/system.h
@@ -21,7 +21,7 @@
21#ifndef __ASM_ARCH_SYSTEM_H 21#ifndef __ASM_ARCH_SYSTEM_H
22#define __ASM_ARCH_SYSTEM_H 22#define __ASM_ARCH_SYSTEM_H
23 23
24#include <asm/arch/hardware.h> 24#include <asm/hardware.h>
25 25
26static inline void arch_idle(void) 26static inline void arch_idle(void)
27{ 27{
@@ -48,4 +48,12 @@ static inline void arch_reset(char mode)
48 at91_sys_write(AT91_ST_CR, AT91_ST_WDRST); 48 at91_sys_write(AT91_ST_CR, AT91_ST_WDRST);
49} 49}
50 50
51#define ARCH_ID_AT91RM9200 0x09200080
52#define ARCH_ID_AT91SAM9261 0x019000a0
53
54static inline unsigned long arch_identify(void)
55{
56 return at91_sys_read(AT91_DBGU_CIDR) & (AT91_CIDR_EPROC | AT91_CIDR_ARCH);
57}
58
51#endif 59#endif
diff --git a/include/asm-arm/arch-at91rm9200/timex.h b/include/asm-arm/arch-at91rm9200/timex.h
index 3f112dd12587..88687cefe6eb 100644
--- a/include/asm-arm/arch-at91rm9200/timex.h
+++ b/include/asm-arm/arch-at91rm9200/timex.h
@@ -21,7 +21,7 @@
21#ifndef __ASM_ARCH_TIMEX_H 21#ifndef __ASM_ARCH_TIMEX_H
22#define __ASM_ARCH_TIMEX_H 22#define __ASM_ARCH_TIMEX_H
23 23
24#include <asm/arch/hardware.h> 24#include <asm/hardware.h>
25 25
26#define CLOCK_TICK_RATE (AT91_SLOW_CLOCK) 26#define CLOCK_TICK_RATE (AT91_SLOW_CLOCK)
27 27
diff --git a/include/asm-arm/arch-at91rm9200/uncompress.h b/include/asm-arm/arch-at91rm9200/uncompress.h
index 7b38497c24b5..ec7811ab0a52 100644
--- a/include/asm-arm/arch-at91rm9200/uncompress.h
+++ b/include/asm-arm/arch-at91rm9200/uncompress.h
@@ -21,7 +21,7 @@
21#ifndef __ASM_ARCH_UNCOMPRESS_H 21#ifndef __ASM_ARCH_UNCOMPRESS_H
22#define __ASM_ARCH_UNCOMPRESS_H 22#define __ASM_ARCH_UNCOMPRESS_H
23 23
24#include <asm/arch/hardware.h> 24#include <asm/hardware.h>
25 25
26/* 26/*
27 * The following code assumes the serial port has already been 27 * The following code assumes the serial port has already been
diff --git a/include/asm-arm/arch-at91rm9200/vmalloc.h b/include/asm-arm/arch-at91rm9200/vmalloc.h
index 34d9718feb90..4c367eb57f47 100644
--- a/include/asm-arm/arch-at91rm9200/vmalloc.h
+++ b/include/asm-arm/arch-at91rm9200/vmalloc.h
@@ -21,6 +21,6 @@
21#ifndef __ASM_ARCH_VMALLOC_H 21#ifndef __ASM_ARCH_VMALLOC_H
22#define __ASM_ARCH_VMALLOC_H 22#define __ASM_ARCH_VMALLOC_H
23 23
24#define VMALLOC_END (AT91_IO_VIRT_BASE & PGDIR_MASK) 24#define VMALLOC_END (AT91_SRAM_VIRT_BASE & PGDIR_MASK)
25 25
26#endif 26#endif
diff --git a/include/asm-arm/arch-ixp23xx/entry-macro.S b/include/asm-arm/arch-ixp23xx/entry-macro.S
index 0ef4e6016ac4..867761677b57 100644
--- a/include/asm-arm/arch-ixp23xx/entry-macro.S
+++ b/include/asm-arm/arch-ixp23xx/entry-macro.S
@@ -8,7 +8,7 @@
8 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 8 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
9 ldr \irqnr, =(IXP23XX_INTC_VIRT + IXP23XX_INTR_IRQ_ENC_ST_OFFSET) 9 ldr \irqnr, =(IXP23XX_INTC_VIRT + IXP23XX_INTR_IRQ_ENC_ST_OFFSET)
10 ldr \irqnr, [\irqnr] @ get interrupt number 10 ldr \irqnr, [\irqnr] @ get interrupt number
11 cmp \irqnr, #0x0 @ suprious interrupt ? 11 cmp \irqnr, #0x0 @ spurious interrupt ?
12 movne \irqnr, \irqnr, lsr #2 @ skip unwanted low order bits 12 movne \irqnr, \irqnr, lsr #2 @ skip unwanted low order bits
13 subne \irqnr, \irqnr, #1 @ convert to 0 based 13 subne \irqnr, \irqnr, #1 @ convert to 0 based
14 14
diff --git a/include/asm-arm/arch-ixp23xx/ixp23xx.h b/include/asm-arm/arch-ixp23xx/ixp23xx.h
index e49e1ca61b1a..01efdbd1180f 100644
--- a/include/asm-arm/arch-ixp23xx/ixp23xx.h
+++ b/include/asm-arm/arch-ixp23xx/ixp23xx.h
@@ -251,7 +251,7 @@
251 * CAP CSRs. 251 * CAP CSRs.
252 ****************************************************************************/ 252 ****************************************************************************/
253#define IXP23XX_GLOBAL_REG(x) ((volatile unsigned long *)(IXP23XX_CAP_CSR_VIRT + 0x4a00 + (x))) 253#define IXP23XX_GLOBAL_REG(x) ((volatile unsigned long *)(IXP23XX_CAP_CSR_VIRT + 0x4a00 + (x)))
254#define IXP23XX_PROD_IDG IXP23XX_GLOBAL_REG(0x00) 254#define IXP23XX_PRODUCT_ID IXP23XX_GLOBAL_REG(0x00)
255#define IXP23XX_MISC_CONTROL IXP23XX_GLOBAL_REG(0x04) 255#define IXP23XX_MISC_CONTROL IXP23XX_GLOBAL_REG(0x04)
256#define IXP23XX_MSF_CLK_CNTRL IXP23XX_GLOBAL_REG(0x08) 256#define IXP23XX_MSF_CLK_CNTRL IXP23XX_GLOBAL_REG(0x08)
257#define IXP23XX_RESET0 IXP23XX_GLOBAL_REG(0x0c) 257#define IXP23XX_RESET0 IXP23XX_GLOBAL_REG(0x0c)
diff --git a/include/asm-arm/arch-netx/debug-macro.S b/include/asm-arm/arch-netx/debug-macro.S
new file mode 100644
index 000000000000..a940d0e80cb2
--- /dev/null
+++ b/include/asm-arm/arch-netx/debug-macro.S
@@ -0,0 +1,38 @@
1/* linux/include/asm-arm/arch-netx/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12*/
13
14#include "hardware.h"
15
16 .macro addruart,rx
17 mrc p15, 0, \rx, c1, c0
18 tst \rx, #1 @ MMU enabled?
19 moveq \rx, #0x00100000 @ physical
20 movne \rx, #io_p2v(0x00100000) @ virtual
21 orr \rx, \rx, #0x00000a00
22 .endm
23
24 .macro senduart,rd,rx
25 str \rd, [\rx, #0]
26 .endm
27
28 .macro busyuart,rd,rx
291002: ldr \rd, [\rx, #0x18]
30 tst \rd, #(1 << 3)
31 bne 1002b
32 .endm
33
34 .macro waituart,rd,rx
351001: ldr \rd, [\rx, #0x18]
36 tst \rd, #(1 << 3)
37 bne 1001b
38 .endm
diff --git a/include/asm-arm/arch-netx/dma.h b/include/asm-arm/arch-netx/dma.h
new file mode 100644
index 000000000000..4eda5feed81c
--- /dev/null
+++ b/include/asm-arm/arch-netx/dma.h
@@ -0,0 +1,21 @@
1/*
2 * linux/include/asm-arm/arch-netx/dma.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#define MAX_DMA_CHANNELS 0
21#define MAX_DMA_ADDRESS ~0
diff --git a/include/asm-arm/arch-netx/entry-macro.S b/include/asm-arm/arch-netx/entry-macro.S
new file mode 100644
index 000000000000..658df4d60ff3
--- /dev/null
+++ b/include/asm-arm/arch-netx/entry-macro.S
@@ -0,0 +1,35 @@
1/*
2 * include/asm-arm/arch-netx/entry-macro.S
3 *
4 * Low-level IRQ helper macros for Hilscher netX based platforms
5 *
6 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2
10 * as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#include <asm/hardware.h>
22
23 .macro disable_fiq
24 .endm
25
26 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
27 mov \base, #io_p2v(0x00100000)
28 add \base, \base, #0x000ff000
29
30 ldr \irqstat, [\base, #0]
31 clz \irqnr, \irqstat
32 rsb \irqnr, \irqnr, #31
33 cmp \irqstat, #0
34 .endm
35
diff --git a/include/asm-arm/arch-netx/hardware.h b/include/asm-arm/arch-netx/hardware.h
new file mode 100644
index 000000000000..7786c45455cd
--- /dev/null
+++ b/include/asm-arm/arch-netx/hardware.h
@@ -0,0 +1,39 @@
1/*
2 * include/asm-arm/arch-netx/hardware.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#ifndef __ASM_ARCH_HARDWARE_H
20#define __ASM_ARCH_HARDWARE_H
21
22#define NETX_IO_PHYS 0x00100000
23#define NETX_IO_VIRT 0xe0000000
24#define NETX_IO_SIZE 0x00100000
25
26#define SRAM_INTERNAL_PHYS_0 0x00000
27#define SRAM_INTERNAL_PHYS_1 0x08000
28#define SRAM_INTERNAL_PHYS_2 0x10000
29#define SRAM_INTERNAL_PHYS_3 0x18000
30#define SRAM_INTERNAL_PHYS(no) ((no) * 0x8000)
31
32#define XPEC_MEM_SIZE 0x4000
33#define XMAC_MEM_SIZE 0x1000
34#define SRAM_MEM_SIZE 0x8000
35
36#define io_p2v(x) ((x) - NETX_IO_PHYS + NETX_IO_VIRT)
37#define io_v2p(x) ((x) - NETX_IO_VIRT + NETX_IO_PHYS)
38
39#endif
diff --git a/include/asm-arm/arch-netx/io.h b/include/asm-arm/arch-netx/io.h
new file mode 100644
index 000000000000..81b7bc47747e
--- /dev/null
+++ b/include/asm-arm/arch-netx/io.h
@@ -0,0 +1,29 @@
1/*
2 * linux/include/asm-arm/arch-netx/io.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H
22
23#define IO_SPACE_LIMIT 0xffffffff
24
25#define __io(a) ((void __iomem *)(a))
26#define __mem_pci(a) (a)
27#define __mem_isa(a) (a)
28
29#endif
diff --git a/include/asm-arm/arch-netx/irqs.h b/include/asm-arm/arch-netx/irqs.h
new file mode 100644
index 000000000000..a487dc6e2661
--- /dev/null
+++ b/include/asm-arm/arch-netx/irqs.h
@@ -0,0 +1,70 @@
1/*
2 * include/asm-arm/arch-netx/irqs.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#define NETX_IRQ_VIC_START 0
21#define NETX_IRQ_SOFTINT 0
22#define NETX_IRQ_TIMER0 1
23#define NETX_IRQ_TIMER1 2
24#define NETX_IRQ_TIMER2 3
25#define NETX_IRQ_SYSTIME_NS 4
26#define NETX_IRQ_SYSTIME_S 5
27#define NETX_IRQ_GPIO_15 6
28#define NETX_IRQ_WATCHDOG 7
29#define NETX_IRQ_UART0 8
30#define NETX_IRQ_UART1 9
31#define NETX_IRQ_UART2 10
32#define NETX_IRQ_USB 11
33#define NETX_IRQ_SPI 12
34#define NETX_IRQ_I2C 13
35#define NETX_IRQ_LCD 14
36#define NETX_IRQ_HIF 15
37#define NETX_IRQ_GPIO_0_14 16
38#define NETX_IRQ_XPEC0 17
39#define NETX_IRQ_XPEC1 18
40#define NETX_IRQ_XPEC2 19
41#define NETX_IRQ_XPEC3 20
42#define NETX_IRQ_XPEC(no) (17 + (no))
43#define NETX_IRQ_MSYNC0 21
44#define NETX_IRQ_MSYNC1 22
45#define NETX_IRQ_MSYNC2 23
46#define NETX_IRQ_MSYNC3 24
47#define NETX_IRQ_IRQ_PHY 25
48#define NETX_IRQ_ISO_AREA 26
49/* int 27 is reserved */
50/* int 28 is reserved */
51#define NETX_IRQ_TIMER3 29
52#define NETX_IRQ_TIMER4 30
53/* int 31 is reserved */
54
55#define NETX_IRQS 32
56
57/* for multiplexed irqs on gpio 0..14 */
58#define NETX_IRQ_GPIO(x) (NETX_IRQS + (x))
59#define NETX_IRQ_GPIO_LAST NETX_IRQ_GPIO(14)
60
61/* Host interface interrupts */
62#define NETX_IRQ_HIF_CHAINED(x) (NETX_IRQ_GPIO_LAST + 1 + (x))
63#define NETX_IRQ_HIF_PIO35 NETX_IRQ_HIF_CHAINED(0)
64#define NETX_IRQ_HIF_PIO36 NETX_IRQ_HIF_CHAINED(1)
65#define NETX_IRQ_HIF_PIO40 NETX_IRQ_HIF_CHAINED(2)
66#define NETX_IRQ_HIF_PIO47 NETX_IRQ_HIF_CHAINED(3)
67#define NETX_IRQ_HIF_PIO72 NETX_IRQ_HIF_CHAINED(4)
68#define NETX_IRQ_HIF_LAST NETX_IRQ_HIF_CHAINED(4)
69
70#define NR_IRQS (NETX_IRQ_HIF_LAST + 1)
diff --git a/include/asm-arm/arch-netx/memory.h b/include/asm-arm/arch-netx/memory.h
new file mode 100644
index 000000000000..6d8d2df3e99d
--- /dev/null
+++ b/include/asm-arm/arch-netx/memory.h
@@ -0,0 +1,36 @@
1/*
2 * linux/include/asm-arm/arch-netx/memory.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef __ASM_ARCH_MEMORY_H
21#define __ASM_ARCH_MEMORY_H
22
23#define PHYS_OFFSET UL(0x80000000)
24
25/*
26 * Virtual view <-> DMA view memory address translations
27 * virt_to_bus: Used to translate the virtual address to an
28 * address suitable to be passed to set_dma_addr
29 * bus_to_virt: Used to convert an address for DMA operations
30 * to an address that the kernel can use.
31 */
32#define __virt_to_bus(x) __virt_to_phys(x)
33#define __bus_to_virt(x) __phys_to_virt(x)
34
35#endif
36
diff --git a/include/asm-arm/arch-netx/netx-regs.h b/include/asm-arm/arch-netx/netx-regs.h
new file mode 100644
index 000000000000..8ab45bea83ca
--- /dev/null
+++ b/include/asm-arm/arch-netx/netx-regs.h
@@ -0,0 +1,410 @@
1/*
2 * include/asm-arm/arch-netx/netx-regs.h
3 *
4 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef __ASM_ARCH_NETX_REGS_H
21#define __ASM_ARCH_NETX_REGS_H
22
23/* offsets relative to the beginning of the io space */
24#define NETX_OFS_SYSTEM 0x00000
25#define NETX_OFS_MEMCR 0x00100
26#define NETX_OFS_DPMAS 0x03000
27#define NETX_OFS_GPIO 0x00800
28#define NETX_OFS_PIO 0x00900
29#define NETX_OFS_UART0 0x00a00
30#define NETX_OFS_UART1 0x00a40
31#define NETX_OFS_UART2 0x00a80
32#define NETX_OF_MIIMU 0x00b00
33#define NETX_OFS_SPI 0x00c00
34#define NETX_OFS_I2C 0x00d00
35#define NETX_OFS_SYSTIME 0x01100
36#define NETX_OFS_RTC 0x01200
37#define NETX_OFS_EXTBUS 0x03600
38#define NETX_OFS_LCD 0x04000
39#define NETX_OFS_USB 0x20000
40#define NETX_OFS_XMAC0 0x60000
41#define NETX_OFS_XMAC1 0x61000
42#define NETX_OFS_XMAC2 0x62000
43#define NETX_OFS_XMAC3 0x63000
44#define NETX_OFS_XMAC(no) (0x60000 + (no) * 0x1000)
45#define NETX_OFS_PFIFO 0x64000
46#define NETX_OFS_XPEC0 0x70000
47#define NETX_OFS_XPEC1 0x74000
48#define NETX_OFS_XPEC2 0x78000
49#define NETX_OFS_XPEC3 0x7c000
50#define NETX_OFS_XPEC(no) (0x70000 + (no) * 0x4000)
51#define NETX_OFS_VIC 0xff000
52
53/* physical addresses */
54#define NETX_PA_SYSTEM (NETX_IO_PHYS + NETX_OFS_SYSTEM)
55#define NETX_PA_MEMCR (NETX_IO_PHYS + NETX_OFS_MEMCR)
56#define NETX_PA_DPMAS (NETX_IO_PHYS + NETX_OFS_DPMAS)
57#define NETX_PA_GPIO (NETX_IO_PHYS + NETX_OFS_GPIO)
58#define NETX_PA_PIO (NETX_IO_PHYS + NETX_OFS_PIO)
59#define NETX_PA_UART0 (NETX_IO_PHYS + NETX_OFS_UART0)
60#define NETX_PA_UART1 (NETX_IO_PHYS + NETX_OFS_UART1)
61#define NETX_PA_UART2 (NETX_IO_PHYS + NETX_OFS_UART2)
62#define NETX_PA_MIIMU (NETX_IO_PHYS + NETX_OF_MIIMU)
63#define NETX_PA_SPI (NETX_IO_PHYS + NETX_OFS_SPI)
64#define NETX_PA_I2C (NETX_IO_PHYS + NETX_OFS_I2C)
65#define NETX_PA_SYSTIME (NETX_IO_PHYS + NETX_OFS_SYSTIME)
66#define NETX_PA_RTC (NETX_IO_PHYS + NETX_OFS_RTC)
67#define NETX_PA_EXTBUS (NETX_IO_PHYS + NETX_OFS_EXTBUS)
68#define NETX_PA_LCD (NETX_IO_PHYS + NETX_OFS_LCD)
69#define NETX_PA_USB (NETX_IO_PHYS + NETX_OFS_USB)
70#define NETX_PA_XMAC0 (NETX_IO_PHYS + NETX_OFS_XMAC0)
71#define NETX_PA_XMAC1 (NETX_IO_PHYS + NETX_OFS_XMAC1)
72#define NETX_PA_XMAC2 (NETX_IO_PHYS + NETX_OFS_XMAC2)
73#define NETX_PA_XMAC3 (NETX_IO_PHYS + NETX_OFS_XMAC3)
74#define NETX_PA_XMAC(no) (NETX_IO_PHYS + NETX_OFS_XMAC(no))
75#define NETX_PA_PFIFO (NETX_IO_PHYS + NETX_OFS_PFIFO)
76#define NETX_PA_XPEC0 (NETX_IO_PHYS + NETX_OFS_XPEC0)
77#define NETX_PA_XPEC1 (NETX_IO_PHYS + NETX_OFS_XPEC1)
78#define NETX_PA_XPEC2 (NETX_IO_PHYS + NETX_OFS_XPEC2)
79#define NETX_PA_XPEC3 (NETX_IO_PHYS + NETX_OFS_XPEC3)
80#define NETX_PA_XPEC(no) (NETX_IO_PHYS + NETX_OFS_XPEC(no))
81#define NETX_PA_VIC (NETX_IO_PHYS + NETX_OFS_VIC)
82
83/* virual addresses */
84#define NETX_VA_SYSTEM (NETX_IO_VIRT + NETX_OFS_SYSTEM)
85#define NETX_VA_MEMCR (NETX_IO_VIRT + NETX_OFS_MEMCR)
86#define NETX_VA_DPMAS (NETX_IO_VIRT + NETX_OFS_DPMAS)
87#define NETX_VA_GPIO (NETX_IO_VIRT + NETX_OFS_GPIO)
88#define NETX_VA_PIO (NETX_IO_VIRT + NETX_OFS_PIO)
89#define NETX_VA_UART0 (NETX_IO_VIRT + NETX_OFS_UART0)
90#define NETX_VA_UART1 (NETX_IO_VIRT + NETX_OFS_UART1)
91#define NETX_VA_UART2 (NETX_IO_VIRT + NETX_OFS_UART2)
92#define NETX_VA_MIIMU (NETX_IO_VIRT + NETX_OF_MIIMU)
93#define NETX_VA_SPI (NETX_IO_VIRT + NETX_OFS_SPI)
94#define NETX_VA_I2C (NETX_IO_VIRT + NETX_OFS_I2C)
95#define NETX_VA_SYSTIME (NETX_IO_VIRT + NETX_OFS_SYSTIME)
96#define NETX_VA_RTC (NETX_IO_VIRT + NETX_OFS_RTC)
97#define NETX_VA_EXTBUS (NETX_IO_VIRT + NETX_OFS_EXTBUS)
98#define NETX_VA_LCD (NETX_IO_VIRT + NETX_OFS_LCD)
99#define NETX_VA_USB (NETX_IO_VIRT + NETX_OFS_USB)
100#define NETX_VA_XMAC0 (NETX_IO_VIRT + NETX_OFS_XMAC0)
101#define NETX_VA_XMAC1 (NETX_IO_VIRT + NETX_OFS_XMAC1)
102#define NETX_VA_XMAC2 (NETX_IO_VIRT + NETX_OFS_XMAC2)
103#define NETX_VA_XMAC3 (NETX_IO_VIRT + NETX_OFS_XMAC3)
104#define NETX_VA_XMAC(no) (NETX_IO_VIRT + NETX_OFS_XMAC(no))
105#define NETX_VA_PFIFO (NETX_IO_VIRT + NETX_OFS_PFIFO)
106#define NETX_VA_XPEC0 (NETX_IO_VIRT + NETX_OFS_XPEC0)
107#define NETX_VA_XPEC1 (NETX_IO_VIRT + NETX_OFS_XPEC1)
108#define NETX_VA_XPEC2 (NETX_IO_VIRT + NETX_OFS_XPEC2)
109#define NETX_VA_XPEC3 (NETX_IO_VIRT + NETX_OFS_XPEC3)
110#define NETX_VA_XPEC(no) (NETX_IO_VIRT + NETX_OFS_XPEC(no))
111#define NETX_VA_VIC (NETX_IO_VIRT + NETX_OFS_VIC)
112
113/*********************************
114 * System functions *
115 *********************************/
116
117/* Registers */
118#define NETX_SYSTEM_REG(ofs) __io(NETX_VA_SYSTEM + (ofs))
119#define NETX_SYSTEM_BOO_SR NETX_SYSTEM_REG(0x00)
120#define NETX_SYSTEM_IOC_CR NETX_SYSTEM_REG(0x04)
121#define NETX_SYSTEM_IOC_MR NETX_SYSTEM_REG(0x08)
122
123/* FIXME: Docs are not consistent */
124#define NETX_SYSTEM_RES_CR NETX_SYSTEM_REG(0x08)
125/* #define NETX_SYSTEM_RES_CR NETX_SYSTEM_REG(0x0c) */
126
127#define NETX_SYSTEM_PHY_CONTROL NETX_SYSTEM_REG(0x10)
128#define NETX_SYSTEM_REV NETX_SYSTEM_REG(0x34)
129#define NETX_SYSTEM_IOC_ACCESS_KEY NETX_SYSTEM_REG(0x70)
130#define NETX_SYSTEM_WDG_TR NETX_SYSTEM_REG(0x200)
131#define NETX_SYSTEM_WDG_CTR NETX_SYSTEM_REG(0x204)
132#define NETX_SYSTEM_WDG_IRQ_TIMEOUT NETX_SYSTEM_REG(0x208)
133#define NETX_SYSTEM_WDG_RES_TIMEOUT NETX_SYSTEM_REG(0x20c)
134
135/* Bits */
136#define NETX_SYSTEM_RES_CR_RSTIN (1<<0)
137#define NETX_SYSTEM_RES_CR_WDG_RES (1<<1)
138#define NETX_SYSTEM_RES_CR_HOST_RES (1<<2)
139#define NETX_SYSTEM_RES_CR_FIRMW_RES (1<<3)
140#define NETX_SYSTEM_RES_CR_XPEC0_RES (1<<4)
141#define NETX_SYSTEM_RES_CR_XPEC1_RES (1<<5)
142#define NETX_SYSTEM_RES_CR_XPEC2_RES (1<<6)
143#define NETX_SYSTEM_RES_CR_XPEC3_RES (1<<7)
144#define NETX_SYSTEM_RES_CR_DIS_XPEC0_RES (1<<16)
145#define NETX_SYSTEM_RES_CR_DIS_XPEC1_RES (1<<17)
146#define NETX_SYSTEM_RES_CR_DIS_XPEC2_RES (1<<18)
147#define NETX_SYSTEM_RES_CR_DIS_XPEC3_RES (1<<19)
148#define NETX_SYSTEM_RES_CR_FIRMW_FLG0 (1<<20)
149#define NETX_SYSTEM_RES_CR_FIRMW_FLG1 (1<<21)
150#define NETX_SYSTEM_RES_CR_FIRMW_FLG2 (1<<22)
151#define NETX_SYSTEM_RES_CR_FIRMW_FLG3 (1<<23)
152#define NETX_SYSTEM_RES_CR_FIRMW_RES_EN (1<<24)
153#define NETX_SYSTEM_RES_CR_RSTOUT (1<<25)
154#define NETX_SYSTEM_RES_CR_EN_RSTOUT (1<<26)
155
156#define PHY_CONTROL_RESET (1<<31)
157#define PHY_CONTROL_SIM_BYP (1<<30)
158#define PHY_CONTROL_CLK_XLATIN (1<<29)
159#define PHY_CONTROL_PHY1_EN (1<<21)
160#define PHY_CONTROL_PHY1_NP_MSG_CODE
161#define PHY_CONTROL_PHY1_AUTOMDIX (1<<17)
162#define PHY_CONTROL_PHY1_FIXMODE (1<<16)
163#define PHY_CONTROL_PHY1_MODE(mode) (((mode) & 0x7) << 13)
164#define PHY_CONTROL_PHY0_EN (1<<12)
165#define PHY_CONTROL_PHY0_NP_MSG_CODE
166#define PHY_CONTROL_PHY0_AUTOMDIX (1<<8)
167#define PHY_CONTROL_PHY0_FIXMODE (1<<7)
168#define PHY_CONTROL_PHY0_MODE(mode) (((mode) & 0x7) << 4)
169#define PHY_CONTROL_PHY_ADDRESS(adr) ((adr) & 0xf)
170
171#define PHY_MODE_10BASE_T_HALF 0
172#define PHY_MODE_10BASE_T_FULL 1
173#define PHY_MODE_100BASE_TX_FX_FULL 2
174#define PHY_MODE_100BASE_TX_FX_HALF 3
175#define PHY_MODE_100BASE_TX_HALF 4
176#define PHY_MODE_REPEATER 5
177#define PHY_MODE_POWER_DOWN 6
178#define PHY_MODE_ALL 7
179
180/* Bits */
181#define VECT_CNTL_ENABLE (1 << 5)
182
183/*******************************
184 * GPIO and timer module *
185 *******************************/
186
187/* Registers */
188#define NETX_GPIO_REG(ofs) __io(NETX_VA_GPIO + (ofs))
189#define NETX_GPIO_CFG(gpio) NETX_GPIO_REG(0x0 + ((gpio)<<2))
190#define NETX_GPIO_THRESHOLD_CAPTURE(gpio) NETX_GPIO_REG(0x40 + ((gpio)<<2))
191#define NETX_GPIO_COUNTER_CTRL(counter) NETX_GPIO_REG(0x80 + ((counter)<<2))
192#define NETX_GPIO_COUNTER_MAX(counter) NETX_GPIO_REG(0x94 + ((counter)<<2))
193#define NETX_GPIO_COUNTER_CURRENT(counter) NETX_GPIO_REG(0xa8 + ((counter)<<2))
194#define NETX_GPIO_IRQ_ENABLE NETX_GPIO_REG(0xbc)
195#define NETX_GPIO_IRQ_DISABLE NETX_GPIO_REG(0xc0)
196#define NETX_GPIO_SYSTIME_NS_CMP NETX_GPIO_REG(0xc4)
197#define NETX_GPIO_LINE NETX_GPIO_REG(0xc8)
198#define NETX_GPIO_IRQ NETX_GPIO_REG(0xd0)
199
200/* Bits */
201#define NETX_GPIO_CFG_IOCFG_GP_INPUT (0x0)
202#define NETX_GPIO_CFG_IOCFG_GP_OUTPUT (0x1)
203#define NETX_GPIO_CFG_IOCFG_GP_UART (0x2)
204#define NETX_GPIO_CFG_INV (1<<2)
205#define NETX_GPIO_CFG_MODE_INPUT_READ (0<<3)
206#define NETX_GPIO_CFG_MODE_INPUT_CAPTURE_CONT_RISING (1<<3)
207#define NETX_GPIO_CFG_MODE_INPUT_CAPTURE_ONCE_RISING (2<<3)
208#define NETX_GPIO_CFG_MODE_INPUT_CAPTURE_HIGH_LEVEL (3<<3)
209#define NETX_GPIO_CFG_COUNT_REF_COUNTER0 (0<<5)
210#define NETX_GPIO_CFG_COUNT_REF_COUNTER1 (1<<5)
211#define NETX_GPIO_CFG_COUNT_REF_COUNTER2 (2<<5)
212#define NETX_GPIO_CFG_COUNT_REF_COUNTER3 (3<<5)
213#define NETX_GPIO_CFG_COUNT_REF_COUNTER4 (4<<5)
214#define NETX_GPIO_CFG_COUNT_REF_SYSTIME (7<<5)
215
216#define NETX_GPIO_COUNTER_CTRL_RUN (1<<0)
217#define NETX_GPIO_COUNTER_CTRL_SYM (1<<1)
218#define NETX_GPIO_COUNTER_CTRL_ONCE (1<<2)
219#define NETX_GPIO_COUNTER_CTRL_IRQ_EN (1<<3)
220#define NETX_GPIO_COUNTER_CTRL_CNT_EVENT (1<<4)
221#define NETX_GPIO_COUNTER_CTRL_RST_EN (1<<5)
222#define NETX_GPIO_COUNTER_CTRL_SEL_EVENT (1<<6)
223#define NETX_GPIO_COUNTER_CTRL_GPIO_REF /* FIXME */
224
225#define GPIO_BIT(gpio) (1<<(gpio))
226#define COUNTER_BIT(counter) ((1<<16)<<(counter))
227
228/*******************************
229 * PIO *
230 *******************************/
231
232/* Registers */
233#define NETX_PIO_REG(ofs) __io(NETX_VA_PIO + (ofs))
234#define NETX_PIO_INPIO NETX_PIO_REG(0x0)
235#define NETX_PIO_OUTPIO NETX_PIO_REG(0x4)
236#define NETX_PIO_OEPIO NETX_PIO_REG(0x8)
237
238/*******************************
239 * MII Unit *
240 *******************************/
241
242/* Registers */
243#define NETX_MIIMU __io(NETX_VA_MIIMU)
244
245/* Bits */
246#define MIIMU_SNRDY (1<<0)
247#define MIIMU_PREAMBLE (1<<1)
248#define MIIMU_OPMODE_WRITE (1<<2)
249#define MIIMU_MDC_PERIOD (1<<3)
250#define MIIMU_PHY_NRES (1<<4)
251#define MIIMU_RTA (1<<5)
252#define MIIMU_REGADDR(adr) (((adr) & 0x1f) << 6)
253#define MIIMU_PHYADDR(adr) (((adr) & 0x1f) << 11)
254#define MIIMU_DATA(data) (((data) & 0xffff) << 16)
255
256/*******************************
257 * xmac / xpec *
258 *******************************/
259
260/* XPEC register offsets relative to NETX_VA_XPEC(no) */
261#define NETX_XPEC_R0_OFS 0x00
262#define NETX_XPEC_R1_OFS 0x04
263#define NETX_XPEC_R2_OFS 0x08
264#define NETX_XPEC_R3_OFS 0x0c
265#define NETX_XPEC_R4_OFS 0x10
266#define NETX_XPEC_R5_OFS 0x14
267#define NETX_XPEC_R6_OFS 0x18
268#define NETX_XPEC_R7_OFS 0x1c
269#define NETX_XPEC_RANGE01_OFS 0x20
270#define NETX_XPEC_RANGE23_OFS 0x24
271#define NETX_XPEC_RANGE45_OFS 0x28
272#define NETX_XPEC_RANGE67_OFS 0x2c
273#define NETX_XPEC_PC_OFS 0x48
274#define NETX_XPEC_TIMER_OFS(timer) (0x30 + ((timer)<<2))
275#define NETX_XPEC_IRQ_OFS 0x8c
276#define NETX_XPEC_SYSTIME_NS_OFS 0x90
277#define NETX_XPEC_FIFO_DATA_OFS 0x94
278#define NETX_XPEC_SYSTIME_S_OFS 0x98
279#define NETX_XPEC_ADC_OFS 0x9c
280#define NETX_XPEC_URX_COUNT_OFS 0x40
281#define NETX_XPEC_UTX_COUNT_OFS 0x44
282#define NETX_XPEC_PC_OFS 0x48
283#define NETX_XPEC_ZERO_OFS 0x4c
284#define NETX_XPEC_STATCFG_OFS 0x50
285#define NETX_XPEC_EC_MASKA_OFS 0x54
286#define NETX_XPEC_EC_MASKB_OFS 0x58
287#define NETX_XPEC_EC_MASK0_OFS 0x5c
288#define NETX_XPEC_EC_MASK8_OFS 0x7c
289#define NETX_XPEC_EC_MASK9_OFS 0x80
290#define NETX_XPEC_XPU_HOLD_PC_OFS 0x100
291#define NETX_XPEC_RAM_START_OFS 0x2000
292
293/* Bits */
294#define XPU_HOLD_PC (1<<0)
295
296/* XMAC register offsets relative to NETX_VA_XMAC(no) */
297#define NETX_XMAC_RPU_PROGRAM_START_OFS 0x000
298#define NETX_XMAC_RPU_PROGRAM_END_OFS 0x3ff
299#define NETX_XMAC_TPU_PROGRAM_START_OFS 0x400
300#define NETX_XMAC_TPU_PROGRAM_END_OFS 0x7ff
301#define NETX_XMAC_RPU_HOLD_PC_OFS 0xa00
302#define NETX_XMAC_TPU_HOLD_PC_OFS 0xa04
303#define NETX_XMAC_STATUS_SHARED0_OFS 0x840
304#define NETX_XMAC_CONFIG_SHARED0_OFS 0x844
305#define NETX_XMAC_STATUS_SHARED1_OFS 0x848
306#define NETX_XMAC_CONFIG_SHARED1_OFS 0x84c
307#define NETX_XMAC_STATUS_SHARED2_OFS 0x850
308#define NETX_XMAC_CONFIG_SHARED2_OFS 0x854
309#define NETX_XMAC_STATUS_SHARED3_OFS 0x858
310#define NETX_XMAC_CONFIG_SHARED3_OFS 0x85c
311
312#define RPU_HOLD_PC (1<<15)
313#define TPU_HOLD_PC (1<<15)
314
315/*******************************
316 * Pointer FIFO *
317 *******************************/
318
319/* Registers */
320#define NETX_PFIFO_REG(ofs) __io(NETX_VA_PFIFO + (ofs))
321#define NETX_PFIFO_BASE(pfifo) NETX_PFIFO_REG(0x00 + ((pfifo)<<2))
322#define NETX_PFIFO_BORDER_BASE(pfifo) NETX_PFIFO_REG(0x80 + ((pfifo)<<2))
323#define NETX_PFIFO_RESET NETX_PFIFO_REG(0x100)
324#define NETX_PFIFO_FULL NETX_PFIFO_REG(0x104)
325#define NETX_PFIFO_EMPTY NETX_PFIFO_REG(0x108)
326#define NETX_PFIFO_OVEFLOW NETX_PFIFO_REG(0x10c)
327#define NETX_PFIFO_UNDERRUN NETX_PFIFO_REG(0x110)
328#define NETX_PFIFO_FILL_LEVEL(pfifo) NETX_PFIFO_REG(0x180 + ((pfifo)<<2))
329#define NETX_PFIFO_XPEC_ISR(xpec) NETX_PFIFO_REG(0x400 + ((xpec) << 2))
330
331/*******************************
332 * Dual Port Memory *
333 *******************************/
334
335/* Registers */
336#define NETX_DPMAS_REG(ofs) __io(NETX_VA_DPMAS + (ofs))
337#define NETX_DPMAS_SYS_STAT NETX_DPMAS_REG(0x4d8)
338#define NETX_DPMAS_INT_STAT NETX_DPMAS_REG(0x4e0)
339#define NETX_DPMAS_INT_EN NETX_DPMAS_REG(0x4f0)
340#define NETX_DPMAS_IF_CONF0 NETX_DPMAS_REG(0x608)
341#define NETX_DPMAS_IF_CONF1 NETX_DPMAS_REG(0x60c)
342#define NETX_DPMAS_EXT_CONFIG(cs) NETX_DPMAS_REG(0x610 + 4 * (cs))
343#define NETX_DPMAS_IO_MODE0 NETX_DPMAS_REG(0x620) /* I/O 32..63 */
344#define NETX_DPMAS_DRV_EN0 NETX_DPMAS_REG(0x624)
345#define NETX_DPMAS_DATA0 NETX_DPMAS_REG(0x628)
346#define NETX_DPMAS_IO_MODE1 NETX_DPMAS_REG(0x630) /* I/O 64..84 */
347#define NETX_DPMAS_DRV_EN1 NETX_DPMAS_REG(0x634)
348#define NETX_DPMAS_DATA1 NETX_DPMAS_REG(0x638)
349
350/* Bits */
351#define NETX_DPMAS_INT_EN_GLB_EN (1<<31)
352#define NETX_DPMAS_INT_EN_MEM_LCK (1<<30)
353#define NETX_DPMAS_INT_EN_WDG (1<<29)
354#define NETX_DPMAS_INT_EN_PIO72 (1<<28)
355#define NETX_DPMAS_INT_EN_PIO47 (1<<27)
356#define NETX_DPMAS_INT_EN_PIO40 (1<<26)
357#define NETX_DPMAS_INT_EN_PIO36 (1<<25)
358#define NETX_DPMAS_INT_EN_PIO35 (1<<24)
359
360#define NETX_DPMAS_IF_CONF0_HIF_DISABLED (0<<28)
361#define NETX_DPMAS_IF_CONF0_HIF_EXT_BUS (1<<28)
362#define NETX_DPMAS_IF_CONF0_HIF_UP_8BIT (2<<28)
363#define NETX_DPMAS_IF_CONF0_HIF_UP_16BIT (3<<28)
364#define NETX_DPMAS_IF_CONF0_HIF_IO (4<<28)
365#define NETX_DPMAS_IF_CONF0_WAIT_DRV_PP (1<<14)
366#define NETX_DPMAS_IF_CONF0_WAIT_DRV_OD (2<<14)
367#define NETX_DPMAS_IF_CONF0_WAIT_DRV_TRI (3<<14)
368
369#define NETX_DPMAS_IF_CONF1_IRQ_POL_PIO35 (1<<26)
370#define NETX_DPMAS_IF_CONF1_IRQ_POL_PIO36 (1<<27)
371#define NETX_DPMAS_IF_CONF1_IRQ_POL_PIO40 (1<<28)
372#define NETX_DPMAS_IF_CONF1_IRQ_POL_PIO47 (1<<29)
373#define NETX_DPMAS_IF_CONF1_IRQ_POL_PIO72 (1<<30)
374
375#define NETX_EXT_CONFIG_TALEWIDTH(x) (((x) & 0x7) << 29)
376#define NETX_EXT_CONFIG_TADRHOLD(x) (((x) & 0x7) << 26)
377#define NETX_EXT_CONFIG_TCSON(x) (((x) & 0x7) << 23)
378#define NETX_EXT_CONFIG_TRDON(x) (((x) & 0x7) << 20)
379#define NETX_EXT_CONFIG_TWRON(x) (((x) & 0x7) << 17)
380#define NETX_EXT_CONFIG_TWROFF(x) (((x) & 0x1f) << 12)
381#define NETX_EXT_CONFIG_TRDWRCYC(x) (((x) & 0x1f) << 7)
382#define NETX_EXT_CONFIG_WAIT_POL (1<<6)
383#define NETX_EXT_CONFIG_WAIT_EN (1<<5)
384#define NETX_EXT_CONFIG_NRD_MODE (1<<4)
385#define NETX_EXT_CONFIG_DS_MODE (1<<3)
386#define NETX_EXT_CONFIG_NWR_MODE (1<<2)
387#define NETX_EXT_CONFIG_16BIT (1<<1)
388#define NETX_EXT_CONFIG_CS_ENABLE (1<<0)
389
390#define NETX_DPMAS_IO_MODE0_WRL (1<<13)
391#define NETX_DPMAS_IO_MODE0_WAIT (1<<14)
392#define NETX_DPMAS_IO_MODE0_READY (1<<15)
393#define NETX_DPMAS_IO_MODE0_CS0 (1<<19)
394#define NETX_DPMAS_IO_MODE0_EXTRD (1<<20)
395
396#define NETX_DPMAS_IO_MODE1_CS2 (1<<15)
397#define NETX_DPMAS_IO_MODE1_CS1 (1<<16)
398#define NETX_DPMAS_IO_MODE1_SAMPLE_NPOR (0<<30)
399#define NETX_DPMAS_IO_MODE1_SAMPLE_100MHZ (1<<30)
400#define NETX_DPMAS_IO_MODE1_SAMPLE_NPIO36 (2<<30)
401#define NETX_DPMAS_IO_MODE1_SAMPLE_PIO36 (3<<30)
402
403/*******************************
404 * I2C *
405 *******************************/
406#define NETX_I2C_REG(ofs) __io(NETX_VA_I2C, (ofs))
407#define NETX_I2C_CTRL NETX_I2C_REG(0x0)
408#define NETX_I2C_DATA NETX_I2C_REG(0x4)
409
410#endif /* __ASM_ARCH_NETX_REGS_H */
diff --git a/include/asm-arm/arch-netx/param.h b/include/asm-arm/arch-netx/param.h
new file mode 100644
index 000000000000..7a80c26178a8
--- /dev/null
+++ b/include/asm-arm/arch-netx/param.h
@@ -0,0 +1,18 @@
1/*
2 * linux/include/asm-arm/arch-netx/param.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
diff --git a/include/asm-arm/arch-netx/pfifo.h b/include/asm-arm/arch-netx/pfifo.h
new file mode 100644
index 000000000000..4af2ee4a32c1
--- /dev/null
+++ b/include/asm-arm/arch-netx/pfifo.h
@@ -0,0 +1,54 @@
1/*
2 * include/asm-arm/arch-netx/pfifo.h
3 *
4 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20
21#ifndef ASM_ARCH_PFIFO_H
22#define ASM_ARCH_PFIFO_H
23
24static inline int pfifo_push(int no, unsigned int pointer)
25{
26 writel(pointer, NETX_PFIFO_BASE(no));
27 return 0;
28}
29
30static inline unsigned int pfifo_pop(int no)
31{
32 return readl(NETX_PFIFO_BASE(no));
33}
34
35static inline int pfifo_fill_level(int no)
36{
37
38 return readl(NETX_PFIFO_FILL_LEVEL(no));
39}
40
41static inline int pfifo_full(int no)
42{
43 return readl(NETX_PFIFO_FULL) & (1<<no) ? 1 : 0;
44}
45
46static inline int pfifo_empty(int no)
47{
48 return readl(NETX_PFIFO_EMPTY) & (1<<no) ? 1 : 0;
49}
50
51int pfifo_request(unsigned int pfifo_mask);
52void pfifo_free(unsigned int pfifo_mask);
53
54#endif /* ASM_ARCH_PFIFO_H */
diff --git a/include/asm-arm/arch-netx/system.h b/include/asm-arm/arch-netx/system.h
new file mode 100644
index 000000000000..52adf368d765
--- /dev/null
+++ b/include/asm-arm/arch-netx/system.h
@@ -0,0 +1,38 @@
1/*
2 * include/asm-arm/arch-netx/system.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#ifndef __ASM_ARCH_SYSTEM_H
20#define __ASM_ARCH_SYSTEM_H
21
22#include <asm/io.h>
23#include <asm/hardware.h>
24#include "netx-regs.h"
25
26static inline void arch_idle(void)
27{
28 cpu_do_idle();
29}
30
31static inline void arch_reset(char mode)
32{
33 writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES,
34 NETX_SYSTEM_RES_CR);
35}
36
37#endif
38
diff --git a/include/asm-arm/arch-netx/timex.h b/include/asm-arm/arch-netx/timex.h
new file mode 100644
index 000000000000..7fdb42da0b40
--- /dev/null
+++ b/include/asm-arm/arch-netx/timex.h
@@ -0,0 +1,20 @@
1/*
2 * include/asm-arm/arch-netx/timex.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#define CLOCK_TICK_RATE 100000000
diff --git a/include/asm-arm/arch-netx/uncompress.h b/include/asm-arm/arch-netx/uncompress.h
new file mode 100644
index 000000000000..f89434547102
--- /dev/null
+++ b/include/asm-arm/arch-netx/uncompress.h
@@ -0,0 +1,76 @@
1/*
2 * include/asm-arm/arch-netx/uncompress.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20/*
21 * The following code assumes the serial port has already been
22 * initialized by the bootloader. We search for the first enabled
23 * port in the most probable order. If you didn't setup a port in
24 * your bootloader then nothing will appear (which might be desired).
25 *
26 * This does not append a newline
27 */
28
29#define REG(x) (*(volatile unsigned long *)(x))
30
31#define UART1_BASE 0x100a00
32#define UART2_BASE 0x100a80
33
34#define UART_DR 0x0
35
36#define UART_CR 0x14
37#define CR_UART_EN (1<<0)
38
39#define UART_FR 0x18
40#define FR_BUSY (1<<3)
41#define FR_TXFF (1<<5)
42
43static void putc(char c)
44{
45 unsigned long base;
46
47 if (REG(UART1_BASE + UART_CR) & CR_UART_EN)
48 base = UART1_BASE;
49 else if (REG(UART2_BASE + UART_CR) & CR_UART_EN)
50 base = UART2_BASE;
51 else
52 return;
53
54 while (REG(base + UART_FR) & FR_TXFF);
55 REG(base + UART_DR) = c;
56}
57
58static inline void flush(void)
59{
60 unsigned long base;
61
62 if (REG(UART1_BASE + UART_CR) & CR_UART_EN)
63 base = UART1_BASE;
64 else if (REG(UART2_BASE + UART_CR) & CR_UART_EN)
65 base = UART2_BASE;
66 else
67 return;
68
69 while (REG(base + UART_FR) & FR_BUSY);
70}
71
72/*
73 * nothing to do
74 */
75#define arch_decomp_setup()
76#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-netx/vmalloc.h b/include/asm-arm/arch-netx/vmalloc.h
new file mode 100644
index 000000000000..da2da5a595da
--- /dev/null
+++ b/include/asm-arm/arch-netx/vmalloc.h
@@ -0,0 +1,19 @@
1/*
2 * linux/include/asm-arm/arch-netx/vmalloc.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/include/asm-arm/arch-netx/xc.h b/include/asm-arm/arch-netx/xc.h
new file mode 100644
index 000000000000..659af19512a9
--- /dev/null
+++ b/include/asm-arm/arch-netx/xc.h
@@ -0,0 +1,42 @@
1/*
2 * linux/include/asm-arm/arch-netx/xc.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef __ASM_ARCH_XC_H
21#define __ASM_ARCH_XC_H
22
23struct xc {
24 int no;
25 unsigned int type;
26 unsigned int version;
27 void __iomem *xpec_base;
28 void __iomem *xmac_base;
29 void __iomem *sram_base;
30 int irq;
31 struct device *dev;
32};
33
34int xc_reset(struct xc *x);
35int xc_stop(struct xc* x);
36int xc_start(struct xc *x);
37int xc_running(struct xc *x);
38int xc_request_firmware(struct xc* x);
39struct xc* request_xc(int xcno, struct device *dev);
40void free_xc(struct xc *x);
41
42#endif /* __ASM_ARCH_XC_H */
diff --git a/include/asm-arm/arch-pxa/poodle.h b/include/asm-arm/arch-pxa/poodle.h
index 6b5ac5144e70..4d6a40315764 100644
--- a/include/asm-arm/arch-pxa/poodle.h
+++ b/include/asm-arm/arch-pxa/poodle.h
@@ -31,6 +31,7 @@
31#define POODLE_GPIO_CF_CD (14) 31#define POODLE_GPIO_CF_CD (14)
32#define POODLE_GPIO_CF_STSCHG (14) 32#define POODLE_GPIO_CF_STSCHG (14)
33#define POODLE_GPIO_SD_PWR (33) 33#define POODLE_GPIO_SD_PWR (33)
34#define POODLE_GPIO_SD_PWR1 (3)
34#define POODLE_GPIO_nSD_CLK (6) 35#define POODLE_GPIO_nSD_CLK (6)
35#define POODLE_GPIO_nSD_WP (7) 36#define POODLE_GPIO_nSD_WP (7)
36#define POODLE_GPIO_nSD_INT (8) 37#define POODLE_GPIO_nSD_INT (8)
@@ -42,6 +43,7 @@
42#define POODLE_GPIO_BYPASS_ON (36) 43#define POODLE_GPIO_BYPASS_ON (36)
43#define POODLE_GPIO_CHRG_ON (38) 44#define POODLE_GPIO_CHRG_ON (38)
44#define POODLE_GPIO_CHRG_FULL (16) 45#define POODLE_GPIO_CHRG_FULL (16)
46#define POODLE_GPIO_DISCHARGE_ON (42) /* Enable battery discharge */
45 47
46/* PXA GPIOs */ 48/* PXA GPIOs */
47#define POODLE_IRQ_GPIO_ON_KEY IRQ_GPIO(0) 49#define POODLE_IRQ_GPIO_ON_KEY IRQ_GPIO(0)
@@ -68,4 +70,6 @@
68#define POODLE_SCOOP_IO_DIR ( POODLE_SCOOP_VPEN | POODLE_SCOOP_HS_OUT ) 70#define POODLE_SCOOP_IO_DIR ( POODLE_SCOOP_VPEN | POODLE_SCOOP_HS_OUT )
69#define POODLE_SCOOP_IO_OUT ( 0 ) 71#define POODLE_SCOOP_IO_OUT ( 0 )
70 72
73extern struct platform_device poodle_locomo_device;
74
71#endif /* __ASM_ARCH_POODLE_H */ 75#endif /* __ASM_ARCH_POODLE_H */
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index 6650d4decaeb..9f83f4adfbf3 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -1625,7 +1625,7 @@
1625#define SSCR0_RIM (1 << 22) /* Receive FIFO overrrun interrupt mask */ 1625#define SSCR0_RIM (1 << 22) /* Receive FIFO overrrun interrupt mask */
1626#define SSCR0_TUM (1 << 23) /* Transmit FIFO underrun interrupt mask */ 1626#define SSCR0_TUM (1 << 23) /* Transmit FIFO underrun interrupt mask */
1627#define SSCR0_FRDC (0x07000000) /* Frame rate divider control (mask) */ 1627#define SSCR0_FRDC (0x07000000) /* Frame rate divider control (mask) */
1628#define SSCR0_SlotsPerFrm(c) ((x) - 1) /* Time slots per frame [1..8] */ 1628#define SSCR0_SlotsPerFrm(x) ((x) - 1) /* Time slots per frame [1..8] */
1629#define SSCR0_ADC (1 << 30) /* Audio clock select */ 1629#define SSCR0_ADC (1 << 30) /* Audio clock select */
1630#define SSCR0_MOD (1 << 31) /* Mode (normal or network) */ 1630#define SSCR0_MOD (1 << 31) /* Mode (normal or network) */
1631#endif 1631#endif
@@ -1706,6 +1706,10 @@
1706#if defined (CONFIG_PXA27x) 1706#if defined (CONFIG_PXA27x)
1707#define SSTO_P1 __REG(0x41000028) /* SSP Port 1 Time Out Register */ 1707#define SSTO_P1 __REG(0x41000028) /* SSP Port 1 Time Out Register */
1708#define SSPSP_P1 __REG(0x4100002C) /* SSP Port 1 Programmable Serial Protocol */ 1708#define SSPSP_P1 __REG(0x4100002C) /* SSP Port 1 Programmable Serial Protocol */
1709#define SSTSA_P1 __REG(0x41000030) /* SSP Port 1 Tx Timeslot Active */
1710#define SSRSA_P1 __REG(0x41000034) /* SSP Port 1 Rx Timeslot Active */
1711#define SSTSS_P1 __REG(0x41000038) /* SSP Port 1 Timeslot Status */
1712#define SSACD_P1 __REG(0x4100003C) /* SSP Port 1 Audio Clock Divider */
1709#define SSCR0_P2 __REG(0x41700000) /* SSP Port 2 Control Register 0 */ 1713#define SSCR0_P2 __REG(0x41700000) /* SSP Port 2 Control Register 0 */
1710#define SSCR1_P2 __REG(0x41700004) /* SSP Port 2 Control Register 1 */ 1714#define SSCR1_P2 __REG(0x41700004) /* SSP Port 2 Control Register 1 */
1711#define SSSR_P2 __REG(0x41700008) /* SSP Port 2 Status Register */ 1715#define SSSR_P2 __REG(0x41700008) /* SSP Port 2 Status Register */
@@ -1713,6 +1717,10 @@
1713#define SSDR_P2 __REG(0x41700010) /* (Write / Read) SSP Port 2 Data Write Register/SSP Data Read Register */ 1717#define SSDR_P2 __REG(0x41700010) /* (Write / Read) SSP Port 2 Data Write Register/SSP Data Read Register */
1714#define SSTO_P2 __REG(0x41700028) /* SSP Port 2 Time Out Register */ 1718#define SSTO_P2 __REG(0x41700028) /* SSP Port 2 Time Out Register */
1715#define SSPSP_P2 __REG(0x4170002C) /* SSP Port 2 Programmable Serial Protocol */ 1719#define SSPSP_P2 __REG(0x4170002C) /* SSP Port 2 Programmable Serial Protocol */
1720#define SSTSA_P2 __REG(0x41700030) /* SSP Port 2 Tx Timeslot Active */
1721#define SSRSA_P2 __REG(0x41700034) /* SSP Port 2 Rx Timeslot Active */
1722#define SSTSS_P2 __REG(0x41700038) /* SSP Port 2 Timeslot Status */
1723#define SSACD_P2 __REG(0x4170003C) /* SSP Port 2 Audio Clock Divider */
1716#define SSCR0_P3 __REG(0x41900000) /* SSP Port 3 Control Register 0 */ 1724#define SSCR0_P3 __REG(0x41900000) /* SSP Port 3 Control Register 0 */
1717#define SSCR1_P3 __REG(0x41900004) /* SSP Port 3 Control Register 1 */ 1725#define SSCR1_P3 __REG(0x41900004) /* SSP Port 3 Control Register 1 */
1718#define SSSR_P3 __REG(0x41900008) /* SSP Port 3 Status Register */ 1726#define SSSR_P3 __REG(0x41900008) /* SSP Port 3 Status Register */
@@ -1720,6 +1728,10 @@
1720#define SSDR_P3 __REG(0x41900010) /* (Write / Read) SSP Port 3 Data Write Register/SSP Data Read Register */ 1728#define SSDR_P3 __REG(0x41900010) /* (Write / Read) SSP Port 3 Data Write Register/SSP Data Read Register */
1721#define SSTO_P3 __REG(0x41900028) /* SSP Port 3 Time Out Register */ 1729#define SSTO_P3 __REG(0x41900028) /* SSP Port 3 Time Out Register */
1722#define SSPSP_P3 __REG(0x4190002C) /* SSP Port 3 Programmable Serial Protocol */ 1730#define SSPSP_P3 __REG(0x4190002C) /* SSP Port 3 Programmable Serial Protocol */
1731#define SSTSA_P3 __REG(0x41900030) /* SSP Port 3 Tx Timeslot Active */
1732#define SSRSA_P3 __REG(0x41900034) /* SSP Port 3 Rx Timeslot Active */
1733#define SSTSS_P3 __REG(0x41900038) /* SSP Port 3 Timeslot Status */
1734#define SSACD_P3 __REG(0x4190003C) /* SSP Port 3 Audio Clock Divider */
1723#else /* PXA255 (only port 2) and PXA26x ports*/ 1735#else /* PXA255 (only port 2) and PXA26x ports*/
1724#define SSTO_P1 __REG(0x41000028) /* SSP Port 1 Time Out Register */ 1736#define SSTO_P1 __REG(0x41000028) /* SSP Port 1 Time Out Register */
1725#define SSPSP_P1 __REG(0x4100002C) /* SSP Port 1 Programmable Serial Protocol */ 1737#define SSPSP_P1 __REG(0x4100002C) /* SSP Port 1 Programmable Serial Protocol */
@@ -1746,6 +1758,10 @@
1746#define SSDR_P(x) (*(((x) == 1) ? &SSDR_P1 : ((x) == 2) ? &SSDR_P2 : ((x) == 3) ? &SSDR_P3 : NULL)) 1758#define SSDR_P(x) (*(((x) == 1) ? &SSDR_P1 : ((x) == 2) ? &SSDR_P2 : ((x) == 3) ? &SSDR_P3 : NULL))
1747#define SSTO_P(x) (*(((x) == 1) ? &SSTO_P1 : ((x) == 2) ? &SSTO_P2 : ((x) == 3) ? &SSTO_P3 : NULL)) 1759#define SSTO_P(x) (*(((x) == 1) ? &SSTO_P1 : ((x) == 2) ? &SSTO_P2 : ((x) == 3) ? &SSTO_P3 : NULL))
1748#define SSPSP_P(x) (*(((x) == 1) ? &SSPSP_P1 : ((x) == 2) ? &SSPSP_P2 : ((x) == 3) ? &SSPSP_P3 : NULL)) 1760#define SSPSP_P(x) (*(((x) == 1) ? &SSPSP_P1 : ((x) == 2) ? &SSPSP_P2 : ((x) == 3) ? &SSPSP_P3 : NULL))
1761#define SSTSA_P(x) (*(((x) == 1) ? &SSTSA_P1 : ((x) == 2) ? &SSTSA_P2 : ((x) == 3) ? &SSTSA_P3 : NULL))
1762#define SSRSA_P(x) (*(((x) == 1) ? &SSRSA_P1 : ((x) == 2) ? &SSRSA_P2 : ((x) == 3) ? &SSRSA_P3 : NULL))
1763#define SSTSS_P(x) (*(((x) == 1) ? &SSTSS_P1 : ((x) == 2) ? &SSTSS_P2 : ((x) == 3) ? &SSTSS_P3 : NULL))
1764#define SSACD_P(x) (*(((x) == 1) ? &SSACD_P1 : ((x) == 2) ? &SSACD_P2 : ((x) == 3) ? &SSACD_P3 : NULL))
1749 1765
1750/* 1766/*
1751 * MultiMediaCard (MMC) controller 1767 * MultiMediaCard (MMC) controller
diff --git a/include/asm-arm/arch-pxa/system.h b/include/asm-arm/arch-pxa/system.h
index 840a46bfbc54..1d56a3ef89fd 100644
--- a/include/asm-arm/arch-pxa/system.h
+++ b/include/asm-arm/arch-pxa/system.h
@@ -10,6 +10,7 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12 12
13#include <asm/proc-fns.h>
13#include "hardware.h" 14#include "hardware.h"
14#include "pxa-regs.h" 15#include "pxa-regs.h"
15 16
diff --git a/include/asm-arm/arch-versatile/system.h b/include/asm-arm/arch-versatile/system.h
index 8889a189739f..71c6254c0d9b 100644
--- a/include/asm-arm/arch-versatile/system.h
+++ b/include/asm-arm/arch-versatile/system.h
@@ -36,16 +36,14 @@ static inline void arch_idle(void)
36 36
37static inline void arch_reset(char mode) 37static inline void arch_reset(char mode)
38{ 38{
39 unsigned int hdr_ctrl = (IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_RESETCTL_OFFSET); 39 u32 val;
40 unsigned int val;
41 40
42 /* 41 val = __raw_readl(IO_ADDRESS(VERSATILE_SYS_RESETCTL)) & ~0x7;
43 * To reset, we hit the on-board reset register 42 val |= 0x105;
44 * in the system FPGA 43
45 */ 44 __raw_writel(0xa05f, IO_ADDRESS(VERSATILE_SYS_LOCK));
46 val = __raw_readl(hdr_ctrl); 45 __raw_writel(val, IO_ADDRESS(VERSATILE_SYS_RESETCTL));
47 val |= VERSATILE_SYS_CTRL_RESET_CONFIGCLR; 46 __raw_writel(0, IO_ADDRESS(VERSATILE_SYS_LOCK));
48 __raw_writel(val, hdr_ctrl);
49} 47}
50 48
51#endif 49#endif
diff --git a/include/asm-arm/byteorder.h b/include/asm-arm/byteorder.h
index 17eaf8bdf092..e6f7fcdc73b0 100644
--- a/include/asm-arm/byteorder.h
+++ b/include/asm-arm/byteorder.h
@@ -22,16 +22,18 @@ static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
22{ 22{
23 __u32 t; 23 __u32 t;
24 24
25 if (__builtin_constant_p(x)) { 25#ifndef __thumb__
26 t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */ 26 if (!__builtin_constant_p(x)) {
27 } else {
28 /* 27 /*
29 * The compiler needs a bit of a hint here to always do the 28 * The compiler needs a bit of a hint here to always do the
30 * right thing and not screw it up to different degrees 29 * right thing and not screw it up to different degrees
31 * depending on the gcc version. 30 * depending on the gcc version.
32 */ 31 */
33 asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x)); 32 asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
34 } 33 } else
34#endif
35 t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */
36
35 x = (x << 24) | (x >> 8); /* mov r0,r0,ror #8 */ 37 x = (x << 24) | (x >> 8); /* mov r0,r0,ror #8 */
36 t &= ~0x00FF0000; /* bic r1,r1,#0x00FF0000 */ 38 t &= ~0x00FF0000; /* bic r1,r1,#0x00FF0000 */
37 x ^= (t >> 8); /* eor r0,r0,r1,lsr #8 */ 39 x ^= (t >> 8); /* eor r0,r0,r1,lsr #8 */
diff --git a/include/asm-arm/hardware/sharpsl_pm.h b/include/asm-arm/hardware/sharpsl_pm.h
index 36983e5f3665..ecf15b83956f 100644
--- a/include/asm-arm/hardware/sharpsl_pm.h
+++ b/include/asm-arm/hardware/sharpsl_pm.h
@@ -16,6 +16,7 @@ struct sharpsl_charger_machinfo {
16 void (*exit)(void); 16 void (*exit)(void);
17 int gpio_acin; 17 int gpio_acin;
18 int gpio_batfull; 18 int gpio_batfull;
19 int batfull_irq;
19 int gpio_batlock; 20 int gpio_batlock;
20 int gpio_fatal; 21 int gpio_fatal;
21 void (*discharge)(int); 22 void (*discharge)(int);
@@ -34,9 +35,19 @@ struct sharpsl_charger_machinfo {
34#define SHARPSL_STATUS_FATAL 7 35#define SHARPSL_STATUS_FATAL 7
35 unsigned long (*charger_wakeup)(void); 36 unsigned long (*charger_wakeup)(void);
36 int (*should_wakeup)(unsigned int resume_on_alarm); 37 int (*should_wakeup)(unsigned int resume_on_alarm);
38 void (*backlight_limit)(int);
39 int (*backlight_get_status) (void);
40 int charge_on_volt;
41 int charge_on_temp;
42 int charge_acin_high;
43 int charge_acin_low;
44 int fatal_acin_volt;
45 int fatal_noacin_volt;
37 int bat_levels; 46 int bat_levels;
38 struct battery_thresh *bat_levels_noac; 47 struct battery_thresh *bat_levels_noac;
39 struct battery_thresh *bat_levels_acin; 48 struct battery_thresh *bat_levels_acin;
49 struct battery_thresh *bat_levels_noac_bl;
50 struct battery_thresh *bat_levels_acin_bl;
40 int status_high_acin; 51 int status_high_acin;
41 int status_low_acin; 52 int status_low_acin;
42 int status_high_noac; 53 int status_high_noac;
diff --git a/include/asm-arm/mach/serial_at91rm9200.h b/include/asm-arm/mach/serial_at91.h
index a0269de12079..1290bb32802d 100644
--- a/include/asm-arm/mach/serial_at91rm9200.h
+++ b/include/asm-arm/mach/serial_at91.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-arm/mach/serial_at91rm9200.h 2 * linux/include/asm-arm/mach/serial_at91.h
3 * 3 *
4 * Based on serial_sa1100.h by Nicolas Pitre 4 * Based on serial_sa1100.h by Nicolas Pitre
5 * 5 *
@@ -14,7 +14,7 @@ struct uart_port;
14 * This is a temporary structure for registering these 14 * This is a temporary structure for registering these
15 * functions; it is intended to be discarded after boot. 15 * functions; it is intended to be discarded after boot.
16 */ 16 */
17struct at91rm9200_port_fns { 17struct at91_port_fns {
18 void (*set_mctrl)(struct uart_port *, u_int); 18 void (*set_mctrl)(struct uart_port *, u_int);
19 u_int (*get_mctrl)(struct uart_port *); 19 u_int (*get_mctrl)(struct uart_port *);
20 void (*enable_ms)(struct uart_port *); 20 void (*enable_ms)(struct uart_port *);
@@ -25,11 +25,9 @@ struct at91rm9200_port_fns {
25}; 25};
26 26
27#if defined(CONFIG_SERIAL_AT91) 27#if defined(CONFIG_SERIAL_AT91)
28void at91_register_uart_fns(struct at91rm9200_port_fns *fns); 28void at91_register_uart_fns(struct at91_port_fns *fns);
29void at91_register_uart(int idx, int port);
30#else 29#else
31#define at91_register_uart_fns(fns) do { } while (0) 30#define at91_register_uart_fns(fns) do { } while (0)
32#define at91_register_uart(idx,port) do { } while (0)
33#endif 31#endif
34 32
35 33
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 9c744ae6c6e3..6001febfe63b 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -107,6 +107,9 @@ extern void __show_regs(struct pt_regs *);
107extern int cpu_architecture(void); 107extern int cpu_architecture(void);
108extern void cpu_init(void); 108extern void cpu_init(void);
109 109
110void arm_machine_restart(char mode);
111extern void (*arm_pm_restart)(char str);
112
110/* 113/*
111 * Intel's XScale3 core supports some v6 features (supersections, L2) 114 * Intel's XScale3 core supports some v6 features (supersections, L2)
112 * but advertises itself as v5 as it does not support the v6 ISA. For 115 * but advertises itself as v5 as it does not support the v6 ISA. For