1 /*
2  * linux/include/asm-arm/arch-sa1100/adsagc.h
3  *
4  * Created Feb 7, 2003 by Robert Whaley <rwhaley@applieddata.net>
5  *
6  * This file comes from graphicsmaster.h of Woojung Huh <whuh@applieddata.net>
7  *
8  * This file contains the hardware specific definitions for the
9  * ADS Advanced Graphics Client
10  */
11 
12 #ifndef __ASM_ARCH_HARDWARE_H
13 #error "include <asm/hardware.h> instead"
14 #endif
15 
16 #define ADS_CPLD_BASE		(0x10000000)
17 #define ADS_p2v( x )		((x) - ADS_CPLD_BASE + 0xf0000000)
18 #define ADS_v2p( x )		((x) - 0xf0000000 + ADS_CPLD_BASE)
19 
20 
21 #define _ADS_SW_SWITCHES	0x10060000	/* Software Switches */
22 
23 #define _ADS_CR1                0x10060004      /* audio and serial */
24 #define _ADS_CR2                0x10060008      /* clocks */
25 #define _ADS_CR3                0x1006000c      /* AVR, LCD, LEDs */
26 
27 #define ADS_CR1_AMP             0x01
28 #define ADS_CR1_CODEC           0x02
29 #define ADS_CR1_BTL             0x04
30 #define ADS_CR1_AUDIO_RST       0x08
31 #define ADS_CR1_COM3_ENA        0x10
32 #define ADS_CR1_IRDA_ENA        0x20
33 #define ADS_CR1_SPI_SEL         0x40
34 #define ADS_CR1_ARM_RST         0x80
35 
36 #define ADS_CR2_CLK_SEL0        0x01
37 #define ADS_CR2_CLK_SEL1        0x02
38 #define ADS_CR2_PLL_OFF         0x04
39 #define ADS_CR2_CLK_PWR         0x08
40 
41 #define ADS_CR3_PNLON           0x01
42 #define ADS_CR3_VEECTL          0x02
43 #define ADS_CR3_BLON            0x04
44 #define ADS_CR3_WAKEUP          0x08
45 
46 
47 /* Extra IRQ Controller */
48 #define _ADS_INT_ST1		0x10080000	/* IRQ Status #1 */
49 #define _ADS_INT_EN1		0x10080008	/* IRQ Enable #1 */
50 #define _ADS_DCR			0x10080018	/* Discrete Control Reg */
51 
52 /* Discrete Controller (AVR:Atmel AT90LS8535) */
53 #define _ADS_AVR_REG		0x10080018
54 
55 /* On-Board Ethernet */
56 #define _ADS_ETHERNET		0x40000000	/* Ethernet */
57 
58 /* LEDs */
59 #define ADS_LED0	0x10		/* on-board Green */
60 #define ADS_LED1	0x20		/* on-board Yellow */
61 #define ADS_LED2	0x40		/* on-board Red */
62 
63 /* DCR */
64 #define DCR_AVR_RESET		0x01
65 #define DCR_SA1111_RESET	0x02
66 #define	DCR_BACKLITE_ON		0x04
67 
68 /* Virtual register addresses */
69 
70 #ifndef __ASSEMBLY__
71 #define ADS_INT_ST1	(*((volatile u_char *) ADS_p2v(_ADS_INT_ST1)))
72 #define ADS_INT_EN1	(*((volatile u_char *) ADS_p2v(_ADS_INT_EN1)))
73 
74 #define ADS_CR1  	(*((volatile u_char *) ADS_p2v(_ADS_CR1)))
75 #define ADS_CR2  	(*((volatile u_char *) ADS_p2v(_ADS_CR2)))
76 #define ADS_CR3  	(*((volatile u_char *) ADS_p2v(_ADS_CR3)))
77 
78 #define ADS_ETHERNET	((int) ADS_p2v(_ADS_ETHERNET))
79 #define ADS_AVR_REG	(*((volatile u_char *) ADS_p2v(_ADS_AVR_REG)))
80 #define ADS_DCR		(*((volatile u_char *) ADS_p2v(_ADS_DCR)))
81 #endif
82 
83 #define ADS_SA1111_BASE		(0x18000000)
84