diff options
author | Hans-Christian Egtvedt <hcegtvedt@atmel.com> | 2008-02-05 09:27:16 -0500 |
---|---|---|
committer | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2008-06-27 09:32:27 -0400 |
commit | 47882cf620bcd7b014f6f7fc11be8c045787adac (patch) | |
tree | f1f91b9b675e917aba5aa3701c5509567c7c914c | |
parent | aafafddb01e259cff61b3d3f5b3466f0a6a65b84 (diff) |
avr32: Add pin configuration choice to LCDC peripheral
This patch lets the board code choose which pin out to use for the LCD
interface.
On AT32AP7000 the LCDC is wired to two sets of pins, which lets the user
choose between dual ethernet and 32-bit EBI. For the ATNGW100 board it
is vital to have the choice to select the alternative pinout since this
pinout is routed to the external headers.
Update ATSTK1002 and ATSTK1004 to use the new interface.
Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1002.c | 2 | ||||
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1004.c | 2 | ||||
-rw-r--r-- | arch/avr32/mach-at32ap/at32ap700x.c | 105 | ||||
-rw-r--r-- | include/asm-avr32/arch-at32ap/board.h | 3 |
4 files changed, 77 insertions, 35 deletions
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index 0e1332686867..86b363c1c25b 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c | |||
@@ -238,7 +238,7 @@ static int __init atstk1002_init(void) | |||
238 | set_hw_addr(at32_add_device_eth(1, ð_data[1])); | 238 | set_hw_addr(at32_add_device_eth(1, ð_data[1])); |
239 | #else | 239 | #else |
240 | at32_add_device_lcdc(0, &atstk1000_lcdc_data, | 240 | at32_add_device_lcdc(0, &atstk1000_lcdc_data, |
241 | fbmem_start, fbmem_size); | 241 | fbmem_start, fbmem_size, 0); |
242 | #endif | 242 | #endif |
243 | at32_add_device_usba(0, NULL); | 243 | at32_add_device_usba(0, NULL); |
244 | #ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM | 244 | #ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM |
diff --git a/arch/avr32/boards/atstk1000/atstk1004.c b/arch/avr32/boards/atstk1000/atstk1004.c index cbf09dd0db53..c7236df74d74 100644 --- a/arch/avr32/boards/atstk1000/atstk1004.c +++ b/arch/avr32/boards/atstk1000/atstk1004.c | |||
@@ -140,7 +140,7 @@ static int __init atstk1004_init(void) | |||
140 | at32_add_device_mci(0); | 140 | at32_add_device_mci(0); |
141 | #endif | 141 | #endif |
142 | at32_add_device_lcdc(0, &atstk1000_lcdc_data, | 142 | at32_add_device_lcdc(0, &atstk1000_lcdc_data, |
143 | fbmem_start, fbmem_size); | 143 | fbmem_start, fbmem_size, 0); |
144 | at32_add_device_usba(0, NULL); | 144 | at32_add_device_usba(0, NULL); |
145 | #ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM | 145 | #ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM |
146 | at32_add_device_ssc(0, ATMEL_SSC_TX); | 146 | at32_add_device_ssc(0, ATMEL_SSC_TX); |
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c index 34b56de4ea60..08115f9243fb 100644 --- a/arch/avr32/mach-at32ap/at32ap700x.c +++ b/arch/avr32/mach-at32ap/at32ap700x.c | |||
@@ -1257,7 +1257,8 @@ static struct clk atmel_lcdfb0_pixclk = { | |||
1257 | 1257 | ||
1258 | struct platform_device *__init | 1258 | struct platform_device *__init |
1259 | at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, | 1259 | at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, |
1260 | unsigned long fbmem_start, unsigned long fbmem_len) | 1260 | unsigned long fbmem_start, unsigned long fbmem_len, |
1261 | unsigned int pin_config) | ||
1261 | { | 1262 | { |
1262 | struct platform_device *pdev; | 1263 | struct platform_device *pdev; |
1263 | struct atmel_lcdfb_info *info; | 1264 | struct atmel_lcdfb_info *info; |
@@ -1284,37 +1285,77 @@ at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, | |||
1284 | switch (id) { | 1285 | switch (id) { |
1285 | case 0: | 1286 | case 0: |
1286 | pdev = &atmel_lcdfb0_device; | 1287 | pdev = &atmel_lcdfb0_device; |
1287 | select_peripheral(PC(19), PERIPH_A, 0); /* CC */ | 1288 | |
1288 | select_peripheral(PC(20), PERIPH_A, 0); /* HSYNC */ | 1289 | switch (pin_config) { |
1289 | select_peripheral(PC(21), PERIPH_A, 0); /* PCLK */ | 1290 | case 0: |
1290 | select_peripheral(PC(22), PERIPH_A, 0); /* VSYNC */ | 1291 | select_peripheral(PC(19), PERIPH_A, 0); /* CC */ |
1291 | select_peripheral(PC(23), PERIPH_A, 0); /* DVAL */ | 1292 | select_peripheral(PC(20), PERIPH_A, 0); /* HSYNC */ |
1292 | select_peripheral(PC(24), PERIPH_A, 0); /* MODE */ | 1293 | select_peripheral(PC(21), PERIPH_A, 0); /* PCLK */ |
1293 | select_peripheral(PC(25), PERIPH_A, 0); /* PWR */ | 1294 | select_peripheral(PC(22), PERIPH_A, 0); /* VSYNC */ |
1294 | select_peripheral(PC(26), PERIPH_A, 0); /* DATA0 */ | 1295 | select_peripheral(PC(23), PERIPH_A, 0); /* DVAL */ |
1295 | select_peripheral(PC(27), PERIPH_A, 0); /* DATA1 */ | 1296 | select_peripheral(PC(24), PERIPH_A, 0); /* MODE */ |
1296 | select_peripheral(PC(28), PERIPH_A, 0); /* DATA2 */ | 1297 | select_peripheral(PC(25), PERIPH_A, 0); /* PWR */ |
1297 | select_peripheral(PC(29), PERIPH_A, 0); /* DATA3 */ | 1298 | select_peripheral(PC(26), PERIPH_A, 0); /* DATA0 */ |
1298 | select_peripheral(PC(30), PERIPH_A, 0); /* DATA4 */ | 1299 | select_peripheral(PC(27), PERIPH_A, 0); /* DATA1 */ |
1299 | select_peripheral(PC(31), PERIPH_A, 0); /* DATA5 */ | 1300 | select_peripheral(PC(28), PERIPH_A, 0); /* DATA2 */ |
1300 | select_peripheral(PD(0), PERIPH_A, 0); /* DATA6 */ | 1301 | select_peripheral(PC(29), PERIPH_A, 0); /* DATA3 */ |
1301 | select_peripheral(PD(1), PERIPH_A, 0); /* DATA7 */ | 1302 | select_peripheral(PC(30), PERIPH_A, 0); /* DATA4 */ |
1302 | select_peripheral(PD(2), PERIPH_A, 0); /* DATA8 */ | 1303 | select_peripheral(PC(31), PERIPH_A, 0); /* DATA5 */ |
1303 | select_peripheral(PD(3), PERIPH_A, 0); /* DATA9 */ | 1304 | select_peripheral(PD(0), PERIPH_A, 0); /* DATA6 */ |
1304 | select_peripheral(PD(4), PERIPH_A, 0); /* DATA10 */ | 1305 | select_peripheral(PD(1), PERIPH_A, 0); /* DATA7 */ |
1305 | select_peripheral(PD(5), PERIPH_A, 0); /* DATA11 */ | 1306 | select_peripheral(PD(2), PERIPH_A, 0); /* DATA8 */ |
1306 | select_peripheral(PD(6), PERIPH_A, 0); /* DATA12 */ | 1307 | select_peripheral(PD(3), PERIPH_A, 0); /* DATA9 */ |
1307 | select_peripheral(PD(7), PERIPH_A, 0); /* DATA13 */ | 1308 | select_peripheral(PD(4), PERIPH_A, 0); /* DATA10 */ |
1308 | select_peripheral(PD(8), PERIPH_A, 0); /* DATA14 */ | 1309 | select_peripheral(PD(5), PERIPH_A, 0); /* DATA11 */ |
1309 | select_peripheral(PD(9), PERIPH_A, 0); /* DATA15 */ | 1310 | select_peripheral(PD(6), PERIPH_A, 0); /* DATA12 */ |
1310 | select_peripheral(PD(10), PERIPH_A, 0); /* DATA16 */ | 1311 | select_peripheral(PD(7), PERIPH_A, 0); /* DATA13 */ |
1311 | select_peripheral(PD(11), PERIPH_A, 0); /* DATA17 */ | 1312 | select_peripheral(PD(8), PERIPH_A, 0); /* DATA14 */ |
1312 | select_peripheral(PD(12), PERIPH_A, 0); /* DATA18 */ | 1313 | select_peripheral(PD(9), PERIPH_A, 0); /* DATA15 */ |
1313 | select_peripheral(PD(13), PERIPH_A, 0); /* DATA19 */ | 1314 | select_peripheral(PD(10), PERIPH_A, 0); /* DATA16 */ |
1314 | select_peripheral(PD(14), PERIPH_A, 0); /* DATA20 */ | 1315 | select_peripheral(PD(11), PERIPH_A, 0); /* DATA17 */ |
1315 | select_peripheral(PD(15), PERIPH_A, 0); /* DATA21 */ | 1316 | select_peripheral(PD(12), PERIPH_A, 0); /* DATA18 */ |
1316 | select_peripheral(PD(16), PERIPH_A, 0); /* DATA22 */ | 1317 | select_peripheral(PD(13), PERIPH_A, 0); /* DATA19 */ |
1317 | select_peripheral(PD(17), PERIPH_A, 0); /* DATA23 */ | 1318 | select_peripheral(PD(14), PERIPH_A, 0); /* DATA20 */ |
1319 | select_peripheral(PD(15), PERIPH_A, 0); /* DATA21 */ | ||
1320 | select_peripheral(PD(16), PERIPH_A, 0); /* DATA22 */ | ||
1321 | select_peripheral(PD(17), PERIPH_A, 0); /* DATA23 */ | ||
1322 | break; | ||
1323 | case 1: | ||
1324 | select_peripheral(PE(0), PERIPH_B, 0); /* CC */ | ||
1325 | select_peripheral(PC(20), PERIPH_A, 0); /* HSYNC */ | ||
1326 | select_peripheral(PC(21), PERIPH_A, 0); /* PCLK */ | ||
1327 | select_peripheral(PC(22), PERIPH_A, 0); /* VSYNC */ | ||
1328 | select_peripheral(PE(1), PERIPH_B, 0); /* DVAL */ | ||
1329 | select_peripheral(PE(2), PERIPH_B, 0); /* MODE */ | ||
1330 | select_peripheral(PC(25), PERIPH_A, 0); /* PWR */ | ||
1331 | select_peripheral(PE(3), PERIPH_B, 0); /* DATA0 */ | ||
1332 | select_peripheral(PE(4), PERIPH_B, 0); /* DATA1 */ | ||
1333 | select_peripheral(PE(5), PERIPH_B, 0); /* DATA2 */ | ||
1334 | select_peripheral(PE(6), PERIPH_B, 0); /* DATA3 */ | ||
1335 | select_peripheral(PE(7), PERIPH_B, 0); /* DATA4 */ | ||
1336 | select_peripheral(PC(31), PERIPH_A, 0); /* DATA5 */ | ||
1337 | select_peripheral(PD(0), PERIPH_A, 0); /* DATA6 */ | ||
1338 | select_peripheral(PD(1), PERIPH_A, 0); /* DATA7 */ | ||
1339 | select_peripheral(PE(8), PERIPH_B, 0); /* DATA8 */ | ||
1340 | select_peripheral(PE(9), PERIPH_B, 0); /* DATA9 */ | ||
1341 | select_peripheral(PE(10), PERIPH_B, 0); /* DATA10 */ | ||
1342 | select_peripheral(PE(11), PERIPH_B, 0); /* DATA11 */ | ||
1343 | select_peripheral(PE(12), PERIPH_B, 0); /* DATA12 */ | ||
1344 | select_peripheral(PD(7), PERIPH_A, 0); /* DATA13 */ | ||
1345 | select_peripheral(PD(8), PERIPH_A, 0); /* DATA14 */ | ||
1346 | select_peripheral(PD(9), PERIPH_A, 0); /* DATA15 */ | ||
1347 | select_peripheral(PE(13), PERIPH_B, 0); /* DATA16 */ | ||
1348 | select_peripheral(PE(14), PERIPH_B, 0); /* DATA17 */ | ||
1349 | select_peripheral(PE(15), PERIPH_B, 0); /* DATA18 */ | ||
1350 | select_peripheral(PE(16), PERIPH_B, 0); /* DATA19 */ | ||
1351 | select_peripheral(PE(17), PERIPH_B, 0); /* DATA20 */ | ||
1352 | select_peripheral(PE(18), PERIPH_B, 0); /* DATA21 */ | ||
1353 | select_peripheral(PD(16), PERIPH_A, 0); /* DATA22 */ | ||
1354 | select_peripheral(PD(17), PERIPH_A, 0); /* DATA23 */ | ||
1355 | break; | ||
1356 | default: | ||
1357 | goto err_invalid_id; | ||
1358 | } | ||
1318 | 1359 | ||
1319 | clk_set_parent(&atmel_lcdfb0_pixclk, &pll0); | 1360 | clk_set_parent(&atmel_lcdfb0_pixclk, &pll0); |
1320 | clk_set_rate(&atmel_lcdfb0_pixclk, clk_get_rate(&pll0)); | 1361 | clk_set_rate(&atmel_lcdfb0_pixclk, clk_get_rate(&pll0)); |
diff --git a/include/asm-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h index cfd3060d5b26..a78206cdb3dc 100644 --- a/include/asm-avr32/arch-at32ap/board.h +++ b/include/asm-avr32/arch-at32ap/board.h | |||
@@ -42,7 +42,8 @@ at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n); | |||
42 | struct atmel_lcdfb_info; | 42 | struct atmel_lcdfb_info; |
43 | struct platform_device * | 43 | struct platform_device * |
44 | at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, | 44 | at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, |
45 | unsigned long fbmem_start, unsigned long fbmem_len); | 45 | unsigned long fbmem_start, unsigned long fbmem_len, |
46 | unsigned int pin_config); | ||
46 | 47 | ||
47 | struct usba_platform_data; | 48 | struct usba_platform_data; |
48 | struct platform_device * | 49 | struct platform_device * |