1 /*
2  *  arch/arm/mach-pxa/include/mach/gumstix.h
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  */
8 
9 #include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */
10 
11 /* BTRESET - Reset line to Bluetooth module, active low signal. */
12 #define GPIO_GUMSTIX_BTRESET          7
13 #define GPIO_GUMSTIX_BTRESET_MD		(GPIO_GUMSTIX_BTRESET | GPIO_OUT)
14 
15 
16 /*
17 GPIOn - Input from MAX823 (or equiv), normalizing USB +5V into a clean
18 interrupt signal for determining cable presence. On the gumstix F,
19 this moves to GPIO17 and GPIO37. */
20 
21 /* GPIOx - Connects to USB D+ and used as a pull-up after GPIOn
22 has detected a cable insertion; driven low otherwise. */
23 
24 #define GPIO_GUMSTIX_USB_GPIOn		35
25 #define GPIO_GUMSTIX_USB_GPIOx		41
26 
27 /* usb state change */
28 #define GUMSTIX_USB_INTR_IRQ		PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_USB_GPIOn)
29 
30 #define GPIO_GUMSTIX_USB_GPIOn_MD	(GPIO_GUMSTIX_USB_GPIOn | GPIO_IN)
31 #define GPIO_GUMSTIX_USB_GPIOx_CON_MD	(GPIO_GUMSTIX_USB_GPIOx | GPIO_OUT)
32 #define GPIO_GUMSTIX_USB_GPIOx_DIS_MD	(GPIO_GUMSTIX_USB_GPIOx | GPIO_IN)
33 
34 /*
35  * SD/MMC definitions
36  */
37 #define GUMSTIX_GPIO_nSD_WP		22 /* SD Write Protect */
38 #define GUMSTIX_GPIO_nSD_DETECT		11 /* MMC/SD Card Detect */
39 #define GUMSTIX_IRQ_GPIO_nSD_DETECT	PXA_GPIO_TO_IRQ(GUMSTIX_GPIO_nSD_DETECT)
40 
41 /*
42  * SMC Ethernet definitions
43  * ETH_RST provides a hardware reset line to the ethernet chip
44  * ETH is the IRQ line in from the ethernet chip to the PXA
45  */
46 #define GPIO_GUMSTIX_ETH0_RST		80
47 #define GPIO_GUMSTIX_ETH0_RST_MD	(GPIO_GUMSTIX_ETH0_RST | GPIO_OUT)
48 #define GPIO_GUMSTIX_ETH1_RST		52
49 #define GPIO_GUMSTIX_ETH1_RST_MD	(GPIO_GUMSTIX_ETH1_RST | GPIO_OUT)
50 
51 #define GPIO_GUMSTIX_ETH0		36
52 #define GPIO_GUMSTIX_ETH0_MD		(GPIO_GUMSTIX_ETH0 | GPIO_IN)
53 #define GUMSTIX_ETH0_IRQ		PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_ETH0)
54 #define GPIO_GUMSTIX_ETH1		27
55 #define GPIO_GUMSTIX_ETH1_MD		(GPIO_GUMSTIX_ETH1 | GPIO_IN)
56 #define GUMSTIX_ETH1_IRQ		PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_ETH1)
57 
58 
59 /* CF reset line */
60 #define GPIO8_RESET			8
61 
62 /* CF slot 0 */
63 #define GPIO4_nBVD1			4
64 #define GPIO4_nSTSCHG			GPIO4_nBVD1
65 #define GPIO11_nCD			11
66 #define GPIO26_PRDY_nBSY		26
67 #define GUMSTIX_S0_nSTSCHG_IRQ		PXA_GPIO_TO_IRQ(GPIO4_nSTSCHG)
68 #define GUMSTIX_S0_nCD_IRQ		PXA_GPIO_TO_IRQ(GPIO11_nCD)
69 #define GUMSTIX_S0_PRDY_nBSY_IRQ	PXA_GPIO_TO_IRQ(GPIO26_PRDY_nBSY)
70 
71 /* CF slot 1 */
72 #define GPIO18_nBVD1			18
73 #define GPIO18_nSTSCHG			GPIO18_nBVD1
74 #define GPIO36_nCD			36
75 #define GPIO27_PRDY_nBSY		27
76 #define GUMSTIX_S1_nSTSCHG_IRQ		PXA_GPIO_TO_IRQ(GPIO18_nSTSCHG)
77 #define GUMSTIX_S1_nCD_IRQ		PXA_GPIO_TO_IRQ(GPIO36_nCD)
78 #define GUMSTIX_S1_PRDY_nBSY_IRQ	PXA_GPIO_TO_IRQ(GPIO27_PRDY_nBSY)
79 
80 /* CF GPIO line modes */
81 #define GPIO4_nSTSCHG_MD		(GPIO4_nSTSCHG | GPIO_IN)
82 #define GPIO8_RESET_MD			(GPIO8_RESET | GPIO_OUT)
83 #define GPIO11_nCD_MD			(GPIO11_nCD | GPIO_IN)
84 #define GPIO18_nSTSCHG_MD		(GPIO18_nSTSCHG | GPIO_IN)
85 #define GPIO26_PRDY_nBSY_MD		(GPIO26_PRDY_nBSY | GPIO_IN)
86 #define GPIO27_PRDY_nBSY_MD		(GPIO27_PRDY_nBSY | GPIO_IN)
87 #define GPIO36_nCD_MD			(GPIO36_nCD | GPIO_IN)
88 
89 /* for expansion boards that can't be programatically detected */
90 extern int am200_init(void);
91 extern int am300_init(void);
92 
93