Sonic Zhang | e7b9aa9 | 2011-11-29 15:05:35 +0800 | [diff] [blame] | 1 | /* |
Bin Meng | a187559 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 2 | * U-Boot - main board file |
Sonic Zhang | e7b9aa9 | 2011-11-29 15:05:35 +0800 | [diff] [blame] | 3 | * |
| 4 | * Copyright (c) 2008-2011 Analog Devices Inc. |
| 5 | * |
| 6 | * Licensed under the GPL-2 or later. |
| 7 | */ |
| 8 | |
Bob Liu | 7d861d9 | 2013-02-05 19:05:41 +0800 | [diff] [blame] | 9 | #ifndef __BOARD_SOFT_SWITCH_H__ |
| 10 | #define __BOARD_SOFT_SWITCH_H__ |
| 11 | |
| 12 | #include <asm/soft_switch.h> |
Sonic Zhang | e7b9aa9 | 2011-11-29 15:05:35 +0800 | [diff] [blame] | 13 | |
| 14 | /* switch 0 port A */ |
| 15 | #define CAN_EN 0x1 |
| 16 | #define CAN_STB 0x2 |
| 17 | #define CAN0_ERR_EN 0x4 |
| 18 | #define CAN0RX_EN 0x8 |
| 19 | #define CNT0UD_EN 0x10 |
| 20 | #define CNT0DG_EN 0x20 |
| 21 | #define CNT0ZM_EN 0x40 |
| 22 | #define RMII_CLK_EN 0x80 |
| 23 | |
| 24 | /* switch 0 port B */ |
| 25 | #define UART0RTS_EN 0x1 |
| 26 | #define UART0RX_EN 0x2 |
| 27 | #define UART0CTS_EN 0x4 |
| 28 | #define UART0CTS_RTS_LPBK 0x8 |
| 29 | #define UART0CTS_RST_EN 0x10 |
| 30 | #define UART0CTS_146_EN 0x20 |
| 31 | #define TEMP_IRQ_EN 0x40 |
| 32 | #define TEMP_THERM_EN 0x80 |
| 33 | |
| 34 | /* switch 1 port A */ |
| 35 | #define OVERRIDE_SMC0_LP0_BOOT 0x1 |
| 36 | #define SMC0_EPPI2_LP1_SWITCH 0x2 |
| 37 | #define SMC0_LP0_EN 0x8 |
| 38 | #define LED1_GPIO_EN 0x10 |
| 39 | #define LED2_GPIO_EN 0x20 |
| 40 | #define LED3_GPIO_EN 0x40 |
| 41 | #define LED4_GPIO_EN 0x80 |
| 42 | |
| 43 | /* switch 1 port B */ |
| 44 | #define PUSHBUTTON1_EN 0x1 |
| 45 | #define PUSHBUTTON2_EN 0x2 |
| 46 | #define SD_CD_EN 0x4 |
| 47 | #define SD_WP_EN 0x8 |
| 48 | #define SPIFLASH_CS_EN 0x10 |
| 49 | #define SPI0D2_EN 0x20 |
| 50 | #define SPI0D3_EN 0x40 |
| 51 | |
| 52 | /* switch 2 port A */ |
| 53 | #define PHYINT_EN 0x1 |
| 54 | #define PHY_PWR_DWN_INT 0x2 |
| 55 | #define PHYAD0 0x4 |
| 56 | #define ETHERNET_EN 0x8 |
| 57 | #define WAKE_PUSHBUTTON_EN 0x10 |
| 58 | #define PD0_SPI0D2_EN 0x20 |
| 59 | #define PD1_SPI0D3_EN 0x40 |
| 60 | #define PD2_SPI0MISO_EN 0x80 |
| 61 | |
| 62 | /* switch 2 port B */ |
| 63 | #define PD3_SPI0MOSI_EN 0x1 |
| 64 | #define PD4_SPI0CK_EN 0x2 |
| 65 | |
Bob Liu | 7d861d9 | 2013-02-05 19:05:41 +0800 | [diff] [blame] | 66 | #ifdef CONFIG_BFIN_BOARD_VERSION_1_0 |
| 67 | #define SWITCH_ADDR 0x21 |
| 68 | #else |
| 69 | #define SWITCH_ADDR 0x20 |
Sonic Zhang | e7b9aa9 | 2011-11-29 15:05:35 +0800 | [diff] [blame] | 70 | #endif |
Bob Liu | 7d861d9 | 2013-02-05 19:05:41 +0800 | [diff] [blame] | 71 | |
| 72 | #define NUM_SWITCH 3 |
| 73 | #define IODIRA 0x0 |
| 74 | #define IODIRB 0x1 |
| 75 | #define OLATA 0x14 |
| 76 | #define OLATB 0x15 |
| 77 | |
| 78 | int setup_board_switches(void); |
| 79 | |
| 80 | #endif /* __BOARD_SOFT_SWITCH_H__ */ |