Sonic Zhang | e7b9aa9 | 2011-11-29 15:05:35 +0800 | [diff] [blame^] | 1 | /* |
| 2 | * U-boot - main board file |
| 3 | * |
| 4 | * Copyright (c) 2008-2011 Analog Devices Inc. |
| 5 | * |
| 6 | * Licensed under the GPL-2 or later. |
| 7 | */ |
| 8 | |
| 9 | #ifndef __SOFT_SWITCH_H__ |
| 10 | #define __SOFT_SWITCH_H__ |
| 11 | |
| 12 | /* switch 0 port A */ |
| 13 | #define CAN_EN 0x1 |
| 14 | #define CAN_STB 0x2 |
| 15 | #define CAN0_ERR_EN 0x4 |
| 16 | #define CAN0RX_EN 0x8 |
| 17 | #define CNT0UD_EN 0x10 |
| 18 | #define CNT0DG_EN 0x20 |
| 19 | #define CNT0ZM_EN 0x40 |
| 20 | #define RMII_CLK_EN 0x80 |
| 21 | |
| 22 | /* switch 0 port B */ |
| 23 | #define UART0RTS_EN 0x1 |
| 24 | #define UART0RX_EN 0x2 |
| 25 | #define UART0CTS_EN 0x4 |
| 26 | #define UART0CTS_RTS_LPBK 0x8 |
| 27 | #define UART0CTS_RST_EN 0x10 |
| 28 | #define UART0CTS_146_EN 0x20 |
| 29 | #define TEMP_IRQ_EN 0x40 |
| 30 | #define TEMP_THERM_EN 0x80 |
| 31 | |
| 32 | /* switch 1 port A */ |
| 33 | #define OVERRIDE_SMC0_LP0_BOOT 0x1 |
| 34 | #define SMC0_EPPI2_LP1_SWITCH 0x2 |
| 35 | #define SMC0_LP0_EN 0x8 |
| 36 | #define LED1_GPIO_EN 0x10 |
| 37 | #define LED2_GPIO_EN 0x20 |
| 38 | #define LED3_GPIO_EN 0x40 |
| 39 | #define LED4_GPIO_EN 0x80 |
| 40 | |
| 41 | /* switch 1 port B */ |
| 42 | #define PUSHBUTTON1_EN 0x1 |
| 43 | #define PUSHBUTTON2_EN 0x2 |
| 44 | #define SD_CD_EN 0x4 |
| 45 | #define SD_WP_EN 0x8 |
| 46 | #define SPIFLASH_CS_EN 0x10 |
| 47 | #define SPI0D2_EN 0x20 |
| 48 | #define SPI0D3_EN 0x40 |
| 49 | |
| 50 | /* switch 2 port A */ |
| 51 | #define PHYINT_EN 0x1 |
| 52 | #define PHY_PWR_DWN_INT 0x2 |
| 53 | #define PHYAD0 0x4 |
| 54 | #define ETHERNET_EN 0x8 |
| 55 | #define WAKE_PUSHBUTTON_EN 0x10 |
| 56 | #define PD0_SPI0D2_EN 0x20 |
| 57 | #define PD1_SPI0D3_EN 0x40 |
| 58 | #define PD2_SPI0MISO_EN 0x80 |
| 59 | |
| 60 | /* switch 2 port B */ |
| 61 | #define PD3_SPI0MOSI_EN 0x1 |
| 62 | #define PD4_SPI0CK_EN 0x2 |
| 63 | |
| 64 | #define IO_PORT_A 0 |
| 65 | #define IO_PORT_B 1 |
| 66 | #define IO_PORT_INPUT 0 |
| 67 | #define IO_PORT_OUTPUT 1 |
| 68 | |
| 69 | int config_switch_bit(int num, int port, int bit, int dir, uchar value); |
| 70 | int setup_board_switches(void); |
| 71 | #endif |