blob: 238f887ebaea5c0e2bf9e04d1121111e9f715c29 [file] [log] [blame]
Jonathan McDowell2a23ec32009-07-04 14:43:56 +01001/*
2 * linux/include/asm-arm/arch-pxa/balloon3.h
3 *
4 * Authors: Nick Bane and Wookey
5 * Created: Oct, 2005
6 * Copyright: Toby Churchill Ltd
7 * Cribbed from mainstone.c, by Nicholas Pitre
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 version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef ASM_ARCH_BALLOON3_H
15#define ASM_ARCH_BALLOON3_H
16
17enum balloon3_features {
18 BALLOON3_FEATURE_OHCI,
19 BALLOON3_FEATURE_MMC,
20 BALLOON3_FEATURE_CF,
21 BALLOON3_FEATURE_AUDIO,
22 BALLOON3_FEATURE_TOPPOLY,
23};
24
25#define BALLOON3_FPGA_PHYS PXA_CS4_PHYS
26#define BALLOON3_FPGA_VIRT (0xf1000000) /* as per balloon2 */
27#define BALLOON3_FPGA_LENGTH 0x01000000
28
Marek Vasuta9c06292010-07-27 21:48:10 +020029/* FPGA / CPLD registers for CF socket */
30#define BALLOON3_CF_STATUS_REG (BALLOON3_FPGA_VIRT + 0x00e00008)
31#define BALLOON3_CF_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00008)
32/* FPGA / CPLD version register */
33#define BALLOON3_FPGA_VER (BALLOON3_FPGA_VIRT + 0x00e0001c)
34
Jonathan McDowell2a23ec32009-07-04 14:43:56 +010035#define BALLOON3_NANDIO_IO_REG (BALLOON3_FPGA_VIRT + 0x00e00000)
36/* fpga/cpld interrupt control register */
37#define BALLOON3_INT_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e0000C)
38#define BALLOON3_NANDIO_CTL2_REG (BALLOON3_FPGA_VIRT + 0x00e00010)
39#define BALLOON3_NANDIO_CTL_REG (BALLOON3_FPGA_VIRT + 0x00e00014)
40#define BALLOON3_VERSION_REG (BALLOON3_FPGA_VIRT + 0x00e0001c)
41
42#define BALLOON3_SAMOSA_ADDR_REG (BALLOON3_FPGA_VIRT + 0x00c00000)
43#define BALLOON3_SAMOSA_DATA_REG (BALLOON3_FPGA_VIRT + 0x00c00004)
44#define BALLOON3_SAMOSA_STATUS_REG (BALLOON3_FPGA_VIRT + 0x00c0001c)
45
Marek Vasuta9c06292010-07-27 21:48:10 +020046/* CF Status Register bits (read-only) bits */
47#define BALLOON3_CF_nIRQ (1 << 0)
48#define BALLOON3_CF_nSTSCHG_BVD1 (1 << 1)
49
50/* CF Control Set Register bits / CF Control Clear Register bits (write-only) */
51#define BALLOON3_CF_RESET (1 << 0)
52#define BALLOON3_CF_ENABLE (1 << 1)
53#define BALLOON3_CF_ADD_ENABLE (1 << 2)
54
55/* CF Interrupt sources */
56#define BALLOON3_BP_CF_NRDY_IRQ BALLOON3_IRQ(0)
57#define BALLOON3_BP_NSTSCHG_IRQ BALLOON3_IRQ(1)
58
Jonathan McDowell2a23ec32009-07-04 14:43:56 +010059/* GPIOs for irqs */
60#define BALLOON3_GPIO_AUX_NIRQ (94)
61#define BALLOON3_GPIO_CODEC_IRQ (95)
62
63/* Timer and Idle LED locations */
64#define BALLOON3_GPIO_LED_NAND (9)
65#define BALLOON3_GPIO_LED_IDLE (10)
66
67/* backlight control */
68#define BALLOON3_GPIO_RUN_BACKLIGHT (99)
69
70#define BALLOON3_GPIO_S0_CD (105)
71
Marek Vasut02a453e2010-07-27 23:11:03 +020072/* PCF8574A Leds */
73#define BALLOON3_PCF_GPIO_BASE 160
74#define BALLOON3_PCF_GPIO_LED0 (BALLOON3_PCF_GPIO_BASE + 0)
75#define BALLOON3_PCF_GPIO_LED1 (BALLOON3_PCF_GPIO_BASE + 1)
76#define BALLOON3_PCF_GPIO_LED2 (BALLOON3_PCF_GPIO_BASE + 2)
77#define BALLOON3_PCF_GPIO_LED3 (BALLOON3_PCF_GPIO_BASE + 3)
78#define BALLOON3_PCF_GPIO_LED4 (BALLOON3_PCF_GPIO_BASE + 4)
79#define BALLOON3_PCF_GPIO_LED5 (BALLOON3_PCF_GPIO_BASE + 5)
80#define BALLOON3_PCF_GPIO_LED6 (BALLOON3_PCF_GPIO_BASE + 6)
81#define BALLOON3_PCF_GPIO_LED7 (BALLOON3_PCF_GPIO_BASE + 7)
82
Jonathan McDowell2a23ec32009-07-04 14:43:56 +010083/* FPGA Interrupt Mask/Acknowledge Register */
84#define BALLOON3_INT_S0_IRQ (1 << 0) /* PCMCIA 0 IRQ */
85#define BALLOON3_INT_S0_STSCHG (1 << 1) /* PCMCIA 0 status changed */
86
Jonathan McDowell2a23ec32009-07-04 14:43:56 +010087/* CPLD (and FPGA) interface definitions */
88#define CPLD_LCD0_DATA_SET 0x00
89#define CPLD_LCD0_DATA_CLR 0x10
90#define CPLD_LCD0_COMMAND_SET 0x01
91#define CPLD_LCD0_COMMAND_CLR 0x11
92#define CPLD_LCD1_DATA_SET 0x02
93#define CPLD_LCD1_DATA_CLR 0x12
94#define CPLD_LCD1_COMMAND_SET 0x03
95#define CPLD_LCD1_COMMAND_CLR 0x13
96
97#define CPLD_MISC_SET 0x07
98#define CPLD_MISC_CLR 0x17
99#define CPLD_MISC_LOON_NRESET_BIT 0
100#define CPLD_MISC_LOON_UNSUSP_BIT 1
101#define CPLD_MISC_RUN_5V_BIT 2
102#define CPLD_MISC_CHG_D0_BIT 3
103#define CPLD_MISC_CHG_D1_BIT 4
104#define CPLD_MISC_DAC_NCS_BIT 5
105
106#define CPLD_LCD_SET 0x08
107#define CPLD_LCD_CLR 0x18
108#define CPLD_LCD_BACKLIGHT_EN_0_BIT 0
109#define CPLD_LCD_BACKLIGHT_EN_1_BIT 1
110#define CPLD_LCD_LED_RED_BIT 4
111#define CPLD_LCD_LED_GREEN_BIT 5
112#define CPLD_LCD_NRESET_BIT 7
113
114#define CPLD_LCD_RO_SET 0x09
115#define CPLD_LCD_RO_CLR 0x19
116#define CPLD_LCD_RO_LCD0_nWAIT_BIT 0
117#define CPLD_LCD_RO_LCD1_nWAIT_BIT 1
118
119#define CPLD_SERIAL_SET 0x0a
120#define CPLD_SERIAL_CLR 0x1a
121#define CPLD_SERIAL_GSM_RI_BIT 0
122#define CPLD_SERIAL_GSM_CTS_BIT 1
123#define CPLD_SERIAL_GSM_DTR_BIT 2
124#define CPLD_SERIAL_LPR_CTS_BIT 3
125#define CPLD_SERIAL_TC232_CTS_BIT 4
126#define CPLD_SERIAL_TC232_DSR_BIT 5
127
128#define CPLD_SROUTING_SET 0x0b
129#define CPLD_SROUTING_CLR 0x1b
130#define CPLD_SROUTING_MSP430_LPR 0
131#define CPLD_SROUTING_MSP430_TC232 1
132#define CPLD_SROUTING_MSP430_GSM 2
133#define CPLD_SROUTING_LOON_LPR (0 << 4)
134#define CPLD_SROUTING_LOON_TC232 (1 << 4)
135#define CPLD_SROUTING_LOON_GSM (2 << 4)
136
137#define CPLD_AROUTING_SET 0x0c
138#define CPLD_AROUTING_CLR 0x1c
139#define CPLD_AROUTING_MIC2PHONE_BIT 0
140#define CPLD_AROUTING_PHONE2INT_BIT 1
141#define CPLD_AROUTING_PHONE2EXT_BIT 2
142#define CPLD_AROUTING_LOONL2INT_BIT 3
143#define CPLD_AROUTING_LOONL2EXT_BIT 4
144#define CPLD_AROUTING_LOONR2PHONE_BIT 5
145#define CPLD_AROUTING_LOONR2INT_BIT 6
146#define CPLD_AROUTING_LOONR2EXT_BIT 7
147
Eric Miao0dc726b2009-12-27 23:01:25 +0800148/* Balloon3 Interrupts */
149#define BALLOON3_IRQ(x) (IRQ_BOARD_START + (x))
150
Eric Miao0dc726b2009-12-27 23:01:25 +0800151#define BALLOON3_AUX_NIRQ IRQ_GPIO(BALLOON3_GPIO_AUX_NIRQ)
152#define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ)
153#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD)
154
Jonathan McDowell2a23ec32009-07-04 14:43:56 +0100155extern int balloon3_has(enum balloon3_features feature);
156
157#endif