diff options
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1002.c | 58 | ||||
-rw-r--r-- | arch/avr32/mach-at32ap/at32ap7000.c | 344 | ||||
-rw-r--r-- | arch/avr32/mach-at32ap/extint.c | 2 | ||||
-rw-r--r-- | arch/avr32/mach-at32ap/pm.h | 4 | ||||
-rw-r--r-- | arch/avr32/mach-at32ap/time-tc.c | 2 | ||||
-rw-r--r-- | include/asm-avr32/arch-at32ap/board.h | 23 |
6 files changed, 429 insertions, 4 deletions
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index 6b9e466104ad..5be0d13f4b03 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | #include <linux/spi/spi.h> | 18 | #include <linux/spi/spi.h> |
19 | #include <linux/spi/at73c213.h> | ||
19 | 20 | ||
20 | #include <video/atmel_lcdc.h> | 21 | #include <video/atmel_lcdc.h> |
21 | 22 | ||
@@ -49,7 +50,26 @@ static struct eth_platform_data __initdata eth_data[2] = { | |||
49 | }; | 50 | }; |
50 | 51 | ||
51 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM | 52 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM |
53 | #ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM | ||
54 | static struct at73c213_board_info at73c213_data = { | ||
55 | .ssc_id = 0, | ||
56 | .shortname = "AVR32 STK1000 external DAC", | ||
57 | }; | ||
58 | #endif | ||
59 | #endif | ||
60 | |||
61 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM | ||
52 | static struct spi_board_info spi0_board_info[] __initdata = { | 62 | static struct spi_board_info spi0_board_info[] __initdata = { |
63 | #ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM | ||
64 | { | ||
65 | /* AT73C213 */ | ||
66 | .modalias = "at73c213", | ||
67 | .max_speed_hz = 200000, | ||
68 | .chip_select = 0, | ||
69 | .mode = SPI_MODE_1, | ||
70 | .platform_data = &at73c213_data, | ||
71 | }, | ||
72 | #endif | ||
53 | { | 73 | { |
54 | /* QVGA display */ | 74 | /* QVGA display */ |
55 | .modalias = "ltv350qv", | 75 | .modalias = "ltv350qv", |
@@ -180,6 +200,38 @@ static void setup_j2_leds(void) | |||
180 | } | 200 | } |
181 | #endif | 201 | #endif |
182 | 202 | ||
203 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM | ||
204 | #ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM | ||
205 | static void __init at73c213_set_clk(struct at73c213_board_info *info) | ||
206 | { | ||
207 | struct clk *gclk; | ||
208 | struct clk *pll; | ||
209 | |||
210 | gclk = clk_get(NULL, "gclk0"); | ||
211 | if (IS_ERR(gclk)) | ||
212 | goto err_gclk; | ||
213 | pll = clk_get(NULL, "pll0"); | ||
214 | if (IS_ERR(pll)) | ||
215 | goto err_pll; | ||
216 | |||
217 | if (clk_set_parent(gclk, pll)) { | ||
218 | pr_debug("STK1000: failed to set pll0 as parent for DAC clock\n"); | ||
219 | goto err_set_clk; | ||
220 | } | ||
221 | |||
222 | at32_select_periph(GPIO_PIN_PA(30), GPIO_PERIPH_A, 0); | ||
223 | info->dac_clk = gclk; | ||
224 | |||
225 | err_set_clk: | ||
226 | clk_put(pll); | ||
227 | err_pll: | ||
228 | clk_put(gclk); | ||
229 | err_gclk: | ||
230 | return; | ||
231 | } | ||
232 | #endif | ||
233 | #endif | ||
234 | |||
183 | void __init setup_board(void) | 235 | void __init setup_board(void) |
184 | { | 236 | { |
185 | #ifdef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM | 237 | #ifdef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM |
@@ -248,6 +300,12 @@ static int __init atstk1002_init(void) | |||
248 | 300 | ||
249 | setup_j2_leds(); | 301 | setup_j2_leds(); |
250 | 302 | ||
303 | #ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM | ||
304 | #ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM | ||
305 | at73c213_set_clk(&at73c213_data); | ||
306 | #endif | ||
307 | #endif | ||
308 | |||
251 | return 0; | 309 | return 0; |
252 | } | 310 | } |
253 | postcore_initcall(atstk1002_init); | 311 | postcore_initcall(atstk1002_init); |
diff --git a/arch/avr32/mach-at32ap/at32ap7000.c b/arch/avr32/mach-at32ap/at32ap7000.c index f6d154ca4d24..a9d9ec081e3d 100644 --- a/arch/avr32/mach-at32ap/at32ap7000.c +++ b/arch/avr32/mach-at32ap/at32ap7000.c | |||
@@ -556,6 +556,17 @@ static struct clk pico_clk = { | |||
556 | .users = 1, | 556 | .users = 1, |
557 | }; | 557 | }; |
558 | 558 | ||
559 | static struct resource dmaca0_resource[] = { | ||
560 | { | ||
561 | .start = 0xff200000, | ||
562 | .end = 0xff20ffff, | ||
563 | .flags = IORESOURCE_MEM, | ||
564 | }, | ||
565 | IRQ(2), | ||
566 | }; | ||
567 | DEFINE_DEV(dmaca, 0); | ||
568 | DEV_CLK(hclk, dmaca0, hsb, 10); | ||
569 | |||
559 | /* -------------------------------------------------------------------- | 570 | /* -------------------------------------------------------------------- |
560 | * HMATRIX | 571 | * HMATRIX |
561 | * -------------------------------------------------------------------- */ | 572 | * -------------------------------------------------------------------- */ |
@@ -655,6 +666,7 @@ void __init at32_add_system_devices(void) | |||
655 | platform_device_register(&at32_eic0_device); | 666 | platform_device_register(&at32_eic0_device); |
656 | platform_device_register(&smc0_device); | 667 | platform_device_register(&smc0_device); |
657 | platform_device_register(&pdc_device); | 668 | platform_device_register(&pdc_device); |
669 | platform_device_register(&dmaca0_device); | ||
658 | 670 | ||
659 | platform_device_register(&at32_systc0_device); | 671 | platform_device_register(&at32_systc0_device); |
660 | 672 | ||
@@ -960,6 +972,96 @@ at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n) | |||
960 | } | 972 | } |
961 | 973 | ||
962 | /* -------------------------------------------------------------------- | 974 | /* -------------------------------------------------------------------- |
975 | * TWI | ||
976 | * -------------------------------------------------------------------- */ | ||
977 | static struct resource atmel_twi0_resource[] __initdata = { | ||
978 | PBMEM(0xffe00800), | ||
979 | IRQ(5), | ||
980 | }; | ||
981 | static struct clk atmel_twi0_pclk = { | ||
982 | .name = "twi_pclk", | ||
983 | .parent = &pba_clk, | ||
984 | .mode = pba_clk_mode, | ||
985 | .get_rate = pba_clk_get_rate, | ||
986 | .index = 2, | ||
987 | }; | ||
988 | |||
989 | struct platform_device *__init at32_add_device_twi(unsigned int id) | ||
990 | { | ||
991 | struct platform_device *pdev; | ||
992 | |||
993 | if (id != 0) | ||
994 | return NULL; | ||
995 | |||
996 | pdev = platform_device_alloc("atmel_twi", id); | ||
997 | if (!pdev) | ||
998 | return NULL; | ||
999 | |||
1000 | if (platform_device_add_resources(pdev, atmel_twi0_resource, | ||
1001 | ARRAY_SIZE(atmel_twi0_resource))) | ||
1002 | goto err_add_resources; | ||
1003 | |||
1004 | select_peripheral(PA(6), PERIPH_A, 0); /* SDA */ | ||
1005 | select_peripheral(PA(7), PERIPH_A, 0); /* SDL */ | ||
1006 | |||
1007 | atmel_twi0_pclk.dev = &pdev->dev; | ||
1008 | |||
1009 | platform_device_add(pdev); | ||
1010 | return pdev; | ||
1011 | |||
1012 | err_add_resources: | ||
1013 | platform_device_put(pdev); | ||
1014 | return NULL; | ||
1015 | } | ||
1016 | |||
1017 | /* -------------------------------------------------------------------- | ||
1018 | * MMC | ||
1019 | * -------------------------------------------------------------------- */ | ||
1020 | static struct resource atmel_mci0_resource[] __initdata = { | ||
1021 | PBMEM(0xfff02400), | ||
1022 | IRQ(28), | ||
1023 | }; | ||
1024 | static struct clk atmel_mci0_pclk = { | ||
1025 | .name = "mci_clk", | ||
1026 | .parent = &pbb_clk, | ||
1027 | .mode = pbb_clk_mode, | ||
1028 | .get_rate = pbb_clk_get_rate, | ||
1029 | .index = 9, | ||
1030 | }; | ||
1031 | |||
1032 | struct platform_device *__init at32_add_device_mci(unsigned int id) | ||
1033 | { | ||
1034 | struct platform_device *pdev; | ||
1035 | |||
1036 | if (id != 0) | ||
1037 | return NULL; | ||
1038 | |||
1039 | pdev = platform_device_alloc("atmel_mci", id); | ||
1040 | if (!pdev) | ||
1041 | return NULL; | ||
1042 | |||
1043 | if (platform_device_add_resources(pdev, atmel_mci0_resource, | ||
1044 | ARRAY_SIZE(atmel_mci0_resource))) | ||
1045 | goto err_add_resources; | ||
1046 | |||
1047 | select_peripheral(PA(10), PERIPH_A, 0); /* CLK */ | ||
1048 | select_peripheral(PA(11), PERIPH_A, 0); /* CMD */ | ||
1049 | select_peripheral(PA(12), PERIPH_A, 0); /* DATA0 */ | ||
1050 | select_peripheral(PA(13), PERIPH_A, 0); /* DATA1 */ | ||
1051 | select_peripheral(PA(14), PERIPH_A, 0); /* DATA2 */ | ||
1052 | select_peripheral(PA(15), PERIPH_A, 0); /* DATA3 */ | ||
1053 | |||
1054 | atmel_mci0_pclk.dev = &pdev->dev; | ||
1055 | |||
1056 | platform_device_add(pdev); | ||
1057 | return pdev; | ||
1058 | |||
1059 | err_add_resources: | ||
1060 | platform_device_put(pdev); | ||
1061 | return NULL; | ||
1062 | } | ||
1063 | |||
1064 | /* -------------------------------------------------------------------- | ||
963 | * LCDC | 1065 | * LCDC |
964 | * -------------------------------------------------------------------- */ | 1066 | * -------------------------------------------------------------------- */ |
965 | static struct atmel_lcdfb_info atmel_lcdfb0_data; | 1067 | static struct atmel_lcdfb_info atmel_lcdfb0_data; |
@@ -1228,6 +1330,241 @@ out_free_pdev: | |||
1228 | } | 1330 | } |
1229 | 1331 | ||
1230 | /* -------------------------------------------------------------------- | 1332 | /* -------------------------------------------------------------------- |
1333 | * IDE / CompactFlash | ||
1334 | * -------------------------------------------------------------------- */ | ||
1335 | static struct resource at32_smc_cs4_resource[] __initdata = { | ||
1336 | { | ||
1337 | .start = 0x04000000, | ||
1338 | .end = 0x07ffffff, | ||
1339 | .flags = IORESOURCE_MEM, | ||
1340 | }, | ||
1341 | IRQ(~0UL), /* Magic IRQ will be overridden */ | ||
1342 | }; | ||
1343 | static struct resource at32_smc_cs5_resource[] __initdata = { | ||
1344 | { | ||
1345 | .start = 0x20000000, | ||
1346 | .end = 0x23ffffff, | ||
1347 | .flags = IORESOURCE_MEM, | ||
1348 | }, | ||
1349 | IRQ(~0UL), /* Magic IRQ will be overridden */ | ||
1350 | }; | ||
1351 | |||
1352 | static int __init at32_init_ide_or_cf(struct platform_device *pdev, | ||
1353 | unsigned int cs, unsigned int extint) | ||
1354 | { | ||
1355 | static unsigned int extint_pin_map[4] __initdata = { | ||
1356 | GPIO_PIN_PB(25), | ||
1357 | GPIO_PIN_PB(26), | ||
1358 | GPIO_PIN_PB(27), | ||
1359 | GPIO_PIN_PB(28), | ||
1360 | }; | ||
1361 | static bool common_pins_initialized __initdata = false; | ||
1362 | unsigned int extint_pin; | ||
1363 | int ret; | ||
1364 | |||
1365 | if (extint >= ARRAY_SIZE(extint_pin_map)) | ||
1366 | return -EINVAL; | ||
1367 | extint_pin = extint_pin_map[extint]; | ||
1368 | |||
1369 | switch (cs) { | ||
1370 | case 4: | ||
1371 | ret = platform_device_add_resources(pdev, | ||
1372 | at32_smc_cs4_resource, | ||
1373 | ARRAY_SIZE(at32_smc_cs4_resource)); | ||
1374 | if (ret) | ||
1375 | return ret; | ||
1376 | |||
1377 | select_peripheral(PE(21), PERIPH_A, 0); /* NCS4 -> OE_N */ | ||
1378 | set_ebi_sfr_bits(HMATRIX_BIT(CS4A)); | ||
1379 | break; | ||
1380 | case 5: | ||
1381 | ret = platform_device_add_resources(pdev, | ||
1382 | at32_smc_cs5_resource, | ||
1383 | ARRAY_SIZE(at32_smc_cs5_resource)); | ||
1384 | if (ret) | ||
1385 | return ret; | ||
1386 | |||
1387 | select_peripheral(PE(22), PERIPH_A, 0); /* NCS5 -> OE_N */ | ||
1388 | set_ebi_sfr_bits(HMATRIX_BIT(CS5A)); | ||
1389 | break; | ||
1390 | default: | ||
1391 | return -EINVAL; | ||
1392 | } | ||
1393 | |||
1394 | if (!common_pins_initialized) { | ||
1395 | select_peripheral(PE(19), PERIPH_A, 0); /* CFCE1 -> CS0_N */ | ||
1396 | select_peripheral(PE(20), PERIPH_A, 0); /* CFCE2 -> CS1_N */ | ||
1397 | select_peripheral(PE(23), PERIPH_A, 0); /* CFRNW -> DIR */ | ||
1398 | select_peripheral(PE(24), PERIPH_A, 0); /* NWAIT <- IORDY */ | ||
1399 | common_pins_initialized = true; | ||
1400 | } | ||
1401 | |||
1402 | at32_select_periph(extint_pin, GPIO_PERIPH_A, AT32_GPIOF_DEGLITCH); | ||
1403 | |||
1404 | pdev->resource[1].start = EIM_IRQ_BASE + extint; | ||
1405 | pdev->resource[1].end = pdev->resource[1].start; | ||
1406 | |||
1407 | return 0; | ||
1408 | } | ||
1409 | |||
1410 | struct platform_device *__init | ||
1411 | at32_add_device_ide(unsigned int id, unsigned int extint, | ||
1412 | struct ide_platform_data *data) | ||
1413 | { | ||
1414 | struct platform_device *pdev; | ||
1415 | |||
1416 | pdev = platform_device_alloc("at32_ide", id); | ||
1417 | if (!pdev) | ||
1418 | goto fail; | ||
1419 | |||
1420 | if (platform_device_add_data(pdev, data, | ||
1421 | sizeof(struct ide_platform_data))) | ||
1422 | goto fail; | ||
1423 | |||
1424 | if (at32_init_ide_or_cf(pdev, data->cs, extint)) | ||
1425 | goto fail; | ||
1426 | |||
1427 | platform_device_add(pdev); | ||
1428 | return pdev; | ||
1429 | |||
1430 | fail: | ||
1431 | platform_device_put(pdev); | ||
1432 | return NULL; | ||
1433 | } | ||
1434 | |||
1435 | struct platform_device *__init | ||
1436 | at32_add_device_cf(unsigned int id, unsigned int extint, | ||
1437 | struct cf_platform_data *data) | ||
1438 | { | ||
1439 | struct platform_device *pdev; | ||
1440 | |||
1441 | pdev = platform_device_alloc("at32_cf", id); | ||
1442 | if (!pdev) | ||
1443 | goto fail; | ||
1444 | |||
1445 | if (platform_device_add_data(pdev, data, | ||
1446 | sizeof(struct cf_platform_data))) | ||
1447 | goto fail; | ||
1448 | |||
1449 | if (at32_init_ide_or_cf(pdev, data->cs, extint)) | ||
1450 | goto fail; | ||
1451 | |||
1452 | if (data->detect_pin != GPIO_PIN_NONE) | ||
1453 | at32_select_gpio(data->detect_pin, AT32_GPIOF_DEGLITCH); | ||
1454 | if (data->reset_pin != GPIO_PIN_NONE) | ||
1455 | at32_select_gpio(data->reset_pin, 0); | ||
1456 | if (data->vcc_pin != GPIO_PIN_NONE) | ||
1457 | at32_select_gpio(data->vcc_pin, 0); | ||
1458 | /* READY is used as extint, so we can't select it as gpio */ | ||
1459 | |||
1460 | platform_device_add(pdev); | ||
1461 | return pdev; | ||
1462 | |||
1463 | fail: | ||
1464 | platform_device_put(pdev); | ||
1465 | return NULL; | ||
1466 | } | ||
1467 | |||
1468 | /* -------------------------------------------------------------------- | ||
1469 | * AC97C | ||
1470 | * -------------------------------------------------------------------- */ | ||
1471 | static struct resource atmel_ac97c0_resource[] __initdata = { | ||
1472 | PBMEM(0xfff02800), | ||
1473 | IRQ(29), | ||
1474 | }; | ||
1475 | static struct clk atmel_ac97c0_pclk = { | ||
1476 | .name = "pclk", | ||
1477 | .parent = &pbb_clk, | ||
1478 | .mode = pbb_clk_mode, | ||
1479 | .get_rate = pbb_clk_get_rate, | ||
1480 | .index = 10, | ||
1481 | }; | ||
1482 | |||
1483 | struct platform_device *__init at32_add_device_ac97c(unsigned int id) | ||
1484 | { | ||
1485 | struct platform_device *pdev; | ||
1486 | |||
1487 | if (id != 0) | ||
1488 | return NULL; | ||
1489 | |||
1490 | pdev = platform_device_alloc("atmel_ac97c", id); | ||
1491 | if (!pdev) | ||
1492 | return NULL; | ||
1493 | |||
1494 | if (platform_device_add_resources(pdev, atmel_ac97c0_resource, | ||
1495 | ARRAY_SIZE(atmel_ac97c0_resource))) | ||
1496 | goto err_add_resources; | ||
1497 | |||
1498 | select_peripheral(PB(20), PERIPH_B, 0); /* SYNC */ | ||
1499 | select_peripheral(PB(21), PERIPH_B, 0); /* SDO */ | ||
1500 | select_peripheral(PB(22), PERIPH_B, 0); /* SDI */ | ||
1501 | select_peripheral(PB(23), PERIPH_B, 0); /* SCLK */ | ||
1502 | |||
1503 | atmel_ac97c0_pclk.dev = &pdev->dev; | ||
1504 | |||
1505 | platform_device_add(pdev); | ||
1506 | return pdev; | ||
1507 | |||
1508 | err_add_resources: | ||
1509 | platform_device_put(pdev); | ||
1510 | return NULL; | ||
1511 | } | ||
1512 | |||
1513 | /* -------------------------------------------------------------------- | ||
1514 | * ABDAC | ||
1515 | * -------------------------------------------------------------------- */ | ||
1516 | static struct resource abdac0_resource[] __initdata = { | ||
1517 | PBMEM(0xfff02000), | ||
1518 | IRQ(27), | ||
1519 | }; | ||
1520 | static struct clk abdac0_pclk = { | ||
1521 | .name = "pclk", | ||
1522 | .parent = &pbb_clk, | ||
1523 | .mode = pbb_clk_mode, | ||
1524 | .get_rate = pbb_clk_get_rate, | ||
1525 | .index = 8, | ||
1526 | }; | ||
1527 | static struct clk abdac0_sample_clk = { | ||
1528 | .name = "sample_clk", | ||
1529 | .mode = genclk_mode, | ||
1530 | .get_rate = genclk_get_rate, | ||
1531 | .set_rate = genclk_set_rate, | ||
1532 | .set_parent = genclk_set_parent, | ||
1533 | .index = 6, | ||
1534 | }; | ||
1535 | |||
1536 | struct platform_device *__init at32_add_device_abdac(unsigned int id) | ||
1537 | { | ||
1538 | struct platform_device *pdev; | ||
1539 | |||
1540 | if (id != 0) | ||
1541 | return NULL; | ||
1542 | |||
1543 | pdev = platform_device_alloc("abdac", id); | ||
1544 | if (!pdev) | ||
1545 | return NULL; | ||
1546 | |||
1547 | if (platform_device_add_resources(pdev, abdac0_resource, | ||
1548 | ARRAY_SIZE(abdac0_resource))) | ||
1549 | goto err_add_resources; | ||
1550 | |||
1551 | select_peripheral(PB(20), PERIPH_A, 0); /* DATA1 */ | ||
1552 | select_peripheral(PB(21), PERIPH_A, 0); /* DATA0 */ | ||
1553 | select_peripheral(PB(22), PERIPH_A, 0); /* DATAN1 */ | ||
1554 | select_peripheral(PB(23), PERIPH_A, 0); /* DATAN0 */ | ||
1555 | |||
1556 | abdac0_pclk.dev = &pdev->dev; | ||
1557 | abdac0_sample_clk.dev = &pdev->dev; | ||
1558 | |||
1559 | platform_device_add(pdev); | ||
1560 | return pdev; | ||
1561 | |||
1562 | err_add_resources: | ||
1563 | platform_device_put(pdev); | ||
1564 | return NULL; | ||
1565 | } | ||
1566 | |||
1567 | /* -------------------------------------------------------------------- | ||
1231 | * GCLK | 1568 | * GCLK |
1232 | * -------------------------------------------------------------------- */ | 1569 | * -------------------------------------------------------------------- */ |
1233 | static struct clk gclk0 = { | 1570 | static struct clk gclk0 = { |
@@ -1290,6 +1627,7 @@ struct clk *at32_clock_list[] = { | |||
1290 | &smc0_mck, | 1627 | &smc0_mck, |
1291 | &pdc_hclk, | 1628 | &pdc_hclk, |
1292 | &pdc_pclk, | 1629 | &pdc_pclk, |
1630 | &dmaca0_hclk, | ||
1293 | &pico_clk, | 1631 | &pico_clk, |
1294 | &pio0_mck, | 1632 | &pio0_mck, |
1295 | &pio1_mck, | 1633 | &pio1_mck, |
@@ -1307,6 +1645,8 @@ struct clk *at32_clock_list[] = { | |||
1307 | &macb1_pclk, | 1645 | &macb1_pclk, |
1308 | &atmel_spi0_spi_clk, | 1646 | &atmel_spi0_spi_clk, |
1309 | &atmel_spi1_spi_clk, | 1647 | &atmel_spi1_spi_clk, |
1648 | &atmel_twi0_pclk, | ||
1649 | &atmel_mci0_pclk, | ||
1310 | &atmel_lcdfb0_hck1, | 1650 | &atmel_lcdfb0_hck1, |
1311 | &atmel_lcdfb0_pixclk, | 1651 | &atmel_lcdfb0_pixclk, |
1312 | &ssc0_pclk, | 1652 | &ssc0_pclk, |
@@ -1314,6 +1654,9 @@ struct clk *at32_clock_list[] = { | |||
1314 | &ssc2_pclk, | 1654 | &ssc2_pclk, |
1315 | &usba0_hclk, | 1655 | &usba0_hclk, |
1316 | &usba0_pclk, | 1656 | &usba0_pclk, |
1657 | &atmel_ac97c0_pclk, | ||
1658 | &abdac0_pclk, | ||
1659 | &abdac0_sample_clk, | ||
1317 | &gclk0, | 1660 | &gclk0, |
1318 | &gclk1, | 1661 | &gclk1, |
1319 | &gclk2, | 1662 | &gclk2, |
@@ -1355,6 +1698,7 @@ void __init at32_clock_init(void) | |||
1355 | genclk_init_parent(&gclk3); | 1698 | genclk_init_parent(&gclk3); |
1356 | genclk_init_parent(&gclk4); | 1699 | genclk_init_parent(&gclk4); |
1357 | genclk_init_parent(&atmel_lcdfb0_pixclk); | 1700 | genclk_init_parent(&atmel_lcdfb0_pixclk); |
1701 | genclk_init_parent(&abdac0_sample_clk); | ||
1358 | 1702 | ||
1359 | /* | 1703 | /* |
1360 | * Turn on all clocks that have at least one user already, and | 1704 | * Turn on all clocks that have at least one user already, and |
diff --git a/arch/avr32/mach-at32ap/extint.c b/arch/avr32/mach-at32ap/extint.c index 8acd01090031..f5bfd4c81fe7 100644 --- a/arch/avr32/mach-at32ap/extint.c +++ b/arch/avr32/mach-at32ap/extint.c | |||
@@ -142,7 +142,7 @@ static int eic_set_irq_type(unsigned int irq, unsigned int flow_type) | |||
142 | return ret; | 142 | return ret; |
143 | } | 143 | } |
144 | 144 | ||
145 | struct irq_chip eic_chip = { | 145 | static struct irq_chip eic_chip = { |
146 | .name = "eic", | 146 | .name = "eic", |
147 | .ack = eic_ack_irq, | 147 | .ack = eic_ack_irq, |
148 | .mask = eic_mask_irq, | 148 | .mask = eic_mask_irq, |
diff --git a/arch/avr32/mach-at32ap/pm.h b/arch/avr32/mach-at32ap/pm.h index 47efd0d1951f..694d521edc2f 100644 --- a/arch/avr32/mach-at32ap/pm.h +++ b/arch/avr32/mach-at32ap/pm.h | |||
@@ -113,8 +113,8 @@ | |||
113 | 113 | ||
114 | /* Register access macros */ | 114 | /* Register access macros */ |
115 | #define pm_readl(reg) \ | 115 | #define pm_readl(reg) \ |
116 | __raw_readl((void __iomem *)AT32_PM_BASE + PM_##reg) | 116 | __raw_readl((void __iomem __force *)AT32_PM_BASE + PM_##reg) |
117 | #define pm_writel(reg,value) \ | 117 | #define pm_writel(reg,value) \ |
118 | __raw_writel((value), (void __iomem *)AT32_PM_BASE + PM_##reg) | 118 | __raw_writel((value), (void __iomem __force *)AT32_PM_BASE + PM_##reg) |
119 | 119 | ||
120 | #endif /* __ARCH_AVR32_MACH_AT32AP_PM_H__ */ | 120 | #endif /* __ARCH_AVR32_MACH_AT32AP_PM_H__ */ |
diff --git a/arch/avr32/mach-at32ap/time-tc.c b/arch/avr32/mach-at32ap/time-tc.c index e3070bdd4bb9..10265863c982 100644 --- a/arch/avr32/mach-at32ap/time-tc.c +++ b/arch/avr32/mach-at32ap/time-tc.c | |||
@@ -79,7 +79,7 @@ static int avr32_timer_calc_div_and_set_jiffies(struct clk *pclk) | |||
79 | { | 79 | { |
80 | unsigned int cycles_max = (clocksource_avr32.mask + 1) / 2; | 80 | unsigned int cycles_max = (clocksource_avr32.mask + 1) / 2; |
81 | unsigned int divs[] = { 4, 8, 16, 32 }; | 81 | unsigned int divs[] = { 4, 8, 16, 32 }; |
82 | int divs_size = sizeof(divs) / sizeof(*divs); | 82 | int divs_size = ARRAY_SIZE(divs); |
83 | int i = 0; | 83 | int i = 0; |
84 | unsigned long count_hz; | 84 | unsigned long count_hz; |
85 | unsigned long shift; | 85 | unsigned long shift; |
diff --git a/include/asm-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h index 7dbd603c38cc..d6993a6b6473 100644 --- a/include/asm-avr32/arch-at32ap/board.h +++ b/include/asm-avr32/arch-at32ap/board.h | |||
@@ -44,6 +44,13 @@ struct usba_platform_data { | |||
44 | struct platform_device * | 44 | struct platform_device * |
45 | at32_add_device_usba(unsigned int id, struct usba_platform_data *data); | 45 | at32_add_device_usba(unsigned int id, struct usba_platform_data *data); |
46 | 46 | ||
47 | struct ide_platform_data { | ||
48 | u8 cs; | ||
49 | }; | ||
50 | struct platform_device * | ||
51 | at32_add_device_ide(unsigned int id, unsigned int extint, | ||
52 | struct ide_platform_data *data); | ||
53 | |||
47 | /* depending on what's hooked up, not all SSC pins will be used */ | 54 | /* depending on what's hooked up, not all SSC pins will be used */ |
48 | #define ATMEL_SSC_TK 0x01 | 55 | #define ATMEL_SSC_TK 0x01 |
49 | #define ATMEL_SSC_TF 0x02 | 56 | #define ATMEL_SSC_TF 0x02 |
@@ -58,4 +65,20 @@ at32_add_device_usba(unsigned int id, struct usba_platform_data *data); | |||
58 | struct platform_device * | 65 | struct platform_device * |
59 | at32_add_device_ssc(unsigned int id, unsigned int flags); | 66 | at32_add_device_ssc(unsigned int id, unsigned int flags); |
60 | 67 | ||
68 | struct platform_device *at32_add_device_twi(unsigned int id); | ||
69 | struct platform_device *at32_add_device_mci(unsigned int id); | ||
70 | struct platform_device *at32_add_device_ac97c(unsigned int id); | ||
71 | struct platform_device *at32_add_device_abdac(unsigned int id); | ||
72 | |||
73 | struct cf_platform_data { | ||
74 | int detect_pin; | ||
75 | int reset_pin; | ||
76 | int vcc_pin; | ||
77 | int ready_pin; | ||
78 | u8 cs; | ||
79 | }; | ||
80 | struct platform_device * | ||
81 | at32_add_device_cf(unsigned int id, unsigned int extint, | ||
82 | struct cf_platform_data *data); | ||
83 | |||
61 | #endif /* __ASM_ARCH_BOARD_H */ | 84 | #endif /* __ASM_ARCH_BOARD_H */ |