aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-davinci')
-rw-r--r--arch/arm/mach-davinci/Kconfig1
-rw-r--r--arch/arm/mach-davinci/board-da830-evm.c11
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c113
-rw-r--r--arch/arm/mach-davinci/board-dm355-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-dm355-leopard.c2
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-dm646x-evm.c4
-rw-r--r--arch/arm/mach-davinci/board-mityomapl138.c11
-rw-r--r--arch/arm/mach-davinci/board-neuros-osd2.c2
-rw-r--r--arch/arm/mach-davinci/board-omapl138-hawk.c32
-rw-r--r--arch/arm/mach-davinci/board-sffsdr.c2
-rw-r--r--arch/arm/mach-davinci/board-tnetv107x-evm.c2
-rw-r--r--arch/arm/mach-davinci/clock.c39
-rw-r--r--arch/arm/mach-davinci/clock.h3
-rw-r--r--arch/arm/mach-davinci/cpuidle.c84
-rw-r--r--arch/arm/mach-davinci/da850.c17
-rw-r--r--arch/arm/mach-davinci/da8xx-dt.c11
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c28
-rw-r--r--arch/arm/mach-davinci/include/mach/clock.h3
-rw-r--r--arch/arm/mach-davinci/include/mach/common.h4
-rw-r--r--arch/arm/mach-davinci/include/mach/da8xx.h5
-rw-r--r--arch/arm/mach-davinci/include/mach/psc.h3
-rw-r--r--arch/arm/mach-davinci/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-davinci/psc.c29
-rw-r--r--arch/arm/mach-davinci/time.c7
26 files changed, 231 insertions, 189 deletions
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 0153950f6068..a075b3e0c5c7 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -62,6 +62,7 @@ config MACH_DA8XX_DT
62 bool "Support DA8XX platforms using device tree" 62 bool "Support DA8XX platforms using device tree"
63 default y 63 default y
64 depends on ARCH_DAVINCI_DA8XX 64 depends on ARCH_DAVINCI_DA8XX
65 select PINCTRL
65 help 66 help
66 Say y here to include support for TI DaVinci DA850 based using 67 Say y here to include support for TI DaVinci DA850 based using
67 Flattened Device Tree. More information at Documentation/devicetree 68 Flattened Device Tree. More information at Documentation/devicetree
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index 95b5e102ceb1..6da25eebf911 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -652,8 +652,13 @@ static __init void da830_evm_init(void)
652 if (ret) 652 if (ret)
653 pr_warning("da830_evm_init: rtc setup failed: %d\n", ret); 653 pr_warning("da830_evm_init: rtc setup failed: %d\n", ret);
654 654
655 ret = da8xx_register_spi(0, da830evm_spi_info, 655 ret = spi_register_board_info(da830evm_spi_info,
656 ARRAY_SIZE(da830evm_spi_info)); 656 ARRAY_SIZE(da830evm_spi_info));
657 if (ret)
658 pr_warn("%s: spi info registration failed: %d\n", __func__,
659 ret);
660
661 ret = da8xx_register_spi_bus(0, ARRAY_SIZE(da830evm_spi_info));
657 if (ret) 662 if (ret)
658 pr_warning("da830_evm_init: spi 0 registration failed: %d\n", 663 pr_warning("da830_evm_init: spi 0 registration failed: %d\n",
659 ret); 664 ret);
@@ -679,7 +684,7 @@ MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM")
679 .atag_offset = 0x100, 684 .atag_offset = 0x100,
680 .map_io = da830_evm_map_io, 685 .map_io = da830_evm_map_io,
681 .init_irq = cp_intc_init, 686 .init_irq = cp_intc_init,
682 .timer = &davinci_timer, 687 .init_time = davinci_timer_init,
683 .init_machine = da830_evm_init, 688 .init_machine = da830_evm_init,
684 .init_late = davinci_init_late, 689 .init_late = davinci_init_late,
685 .dma_zone_size = SZ_128M, 690 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index d0e3ec3d49e4..c2dfe06563df 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -349,13 +349,13 @@ static inline void da850_evm_setup_nor_nand(void)
349 if (!HAS_MMC) { 349 if (!HAS_MMC) {
350 ret = davinci_cfg_reg_list(da850_evm_nand_pins); 350 ret = davinci_cfg_reg_list(da850_evm_nand_pins);
351 if (ret) 351 if (ret)
352 pr_warning("da850_evm_init: nand mux setup failed: " 352 pr_warn("%s: NAND mux setup failed: %d\n",
353 "%d\n", ret); 353 __func__, ret);
354 354
355 ret = davinci_cfg_reg_list(da850_evm_nor_pins); 355 ret = davinci_cfg_reg_list(da850_evm_nor_pins);
356 if (ret) 356 if (ret)
357 pr_warning("da850_evm_init: nor mux setup failed: %d\n", 357 pr_warn("%s: NOR mux setup failed: %d\n",
358 ret); 358 __func__, ret);
359 359
360 da850_evm_init_nor(); 360 da850_evm_init_nor();
361 361
@@ -477,19 +477,19 @@ static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
477 477
478 ret = gpio_request(sel_a, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_A]); 478 ret = gpio_request(sel_a, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_A]);
479 if (ret) { 479 if (ret) {
480 pr_warning("Cannot open UI expander pin %d\n", sel_a); 480 pr_warn("Cannot open UI expander pin %d\n", sel_a);
481 goto exp_setup_sela_fail; 481 goto exp_setup_sela_fail;
482 } 482 }
483 483
484 ret = gpio_request(sel_b, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_B]); 484 ret = gpio_request(sel_b, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_B]);
485 if (ret) { 485 if (ret) {
486 pr_warning("Cannot open UI expander pin %d\n", sel_b); 486 pr_warn("Cannot open UI expander pin %d\n", sel_b);
487 goto exp_setup_selb_fail; 487 goto exp_setup_selb_fail;
488 } 488 }
489 489
490 ret = gpio_request(sel_c, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_C]); 490 ret = gpio_request(sel_c, da850_evm_ui_exp[DA850_EVM_UI_EXP_SEL_C]);
491 if (ret) { 491 if (ret) {
492 pr_warning("Cannot open UI expander pin %d\n", sel_c); 492 pr_warn("Cannot open UI expander pin %d\n", sel_c);
493 goto exp_setup_selc_fail; 493 goto exp_setup_selc_fail;
494 } 494 }
495 495
@@ -501,7 +501,7 @@ static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
501 da850_evm_ui_keys_init(gpio); 501 da850_evm_ui_keys_init(gpio);
502 ret = platform_device_register(&da850_evm_ui_keys_device); 502 ret = platform_device_register(&da850_evm_ui_keys_device);
503 if (ret) { 503 if (ret) {
504 pr_warning("Could not register UI GPIO expander push-buttons"); 504 pr_warn("Could not register UI GPIO expander push-buttons");
505 goto exp_setup_keys_fail; 505 goto exp_setup_keys_fail;
506 } 506 }
507 507
@@ -690,14 +690,14 @@ static int da850_evm_bb_expander_setup(struct i2c_client *client,
690 da850_evm_bb_keys_init(gpio); 690 da850_evm_bb_keys_init(gpio);
691 ret = platform_device_register(&da850_evm_bb_keys_device); 691 ret = platform_device_register(&da850_evm_bb_keys_device);
692 if (ret) { 692 if (ret) {
693 pr_warning("Could not register baseboard GPIO expander keys"); 693 pr_warn("Could not register baseboard GPIO expander keys");
694 goto io_exp_setup_sw_fail; 694 goto io_exp_setup_sw_fail;
695 } 695 }
696 696
697 da850_evm_bb_leds_init(gpio); 697 da850_evm_bb_leds_init(gpio);
698 ret = platform_device_register(&da850_evm_bb_leds_device); 698 ret = platform_device_register(&da850_evm_bb_leds_device);
699 if (ret) { 699 if (ret) {
700 pr_warning("Could not register baseboard GPIO expander LEDS"); 700 pr_warn("Could not register baseboard GPIO expander LEDs");
701 goto io_exp_setup_leds_fail; 701 goto io_exp_setup_leds_fail;
702 } 702 }
703 703
@@ -1065,21 +1065,19 @@ static int __init da850_evm_config_emac(void)
1065 } 1065 }
1066 1066
1067 if (ret) 1067 if (ret)
1068 pr_warning("da850_evm_init: cpgmac/rmii mux setup failed: %d\n", 1068 pr_warn("%s: CPGMAC/RMII mux setup failed: %d\n",
1069 ret); 1069 __func__, ret);
1070 1070
1071 /* configure the CFGCHIP3 register for RMII or MII */ 1071 /* configure the CFGCHIP3 register for RMII or MII */
1072 __raw_writel(val, cfg_chip3_base); 1072 __raw_writel(val, cfg_chip3_base);
1073 1073
1074 ret = davinci_cfg_reg(DA850_GPIO2_6); 1074 ret = davinci_cfg_reg(DA850_GPIO2_6);
1075 if (ret) 1075 if (ret)
1076 pr_warning("da850_evm_init:GPIO(2,6) mux setup " 1076 pr_warn("%s:GPIO(2,6) mux setup failed\n", __func__);
1077 "failed\n");
1078 1077
1079 ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en"); 1078 ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en");
1080 if (ret) { 1079 if (ret) {
1081 pr_warning("Cannot open GPIO %d\n", 1080 pr_warn("Cannot open GPIO %d\n", DA850_MII_MDIO_CLKEN_PIN);
1082 DA850_MII_MDIO_CLKEN_PIN);
1083 return ret; 1081 return ret;
1084 } 1082 }
1085 1083
@@ -1090,8 +1088,7 @@ static int __init da850_evm_config_emac(void)
1090 1088
1091 ret = da8xx_register_emac(); 1089 ret = da8xx_register_emac();
1092 if (ret) 1090 if (ret)
1093 pr_warning("da850_evm_init: emac registration failed: %d\n", 1091 pr_warn("%s: EMAC registration failed: %d\n", __func__, ret);
1094 ret);
1095 1092
1096 return 0; 1093 return 0;
1097} 1094}
@@ -1456,57 +1453,53 @@ static __init void da850_evm_init(void)
1456 1453
1457 ret = pmic_tps65070_init(); 1454 ret = pmic_tps65070_init();
1458 if (ret) 1455 if (ret)
1459 pr_warning("da850_evm_init: TPS65070 PMIC init failed: %d\n", 1456 pr_warn("%s: TPS65070 PMIC init failed: %d\n", __func__, ret);
1460 ret);
1461 1457
1462 ret = da850_register_edma(da850_edma_rsv); 1458 ret = da850_register_edma(da850_edma_rsv);
1463 if (ret) 1459 if (ret)
1464 pr_warning("da850_evm_init: edma registration failed: %d\n", 1460 pr_warn("%s: EDMA registration failed: %d\n", __func__, ret);
1465 ret);
1466 1461
1467 ret = davinci_cfg_reg_list(da850_i2c0_pins); 1462 ret = davinci_cfg_reg_list(da850_i2c0_pins);
1468 if (ret) 1463 if (ret)
1469 pr_warning("da850_evm_init: i2c0 mux setup failed: %d\n", 1464 pr_warn("%s: I2C0 mux setup failed: %d\n", __func__, ret);
1470 ret);
1471 1465
1472 ret = da8xx_register_i2c(0, &da850_evm_i2c_0_pdata); 1466 ret = da8xx_register_i2c(0, &da850_evm_i2c_0_pdata);
1473 if (ret) 1467 if (ret)
1474 pr_warning("da850_evm_init: i2c0 registration failed: %d\n", 1468 pr_warn("%s: I2C0 registration failed: %d\n", __func__, ret);
1475 ret);
1476 1469
1477 1470
1478 ret = da8xx_register_watchdog(); 1471 ret = da8xx_register_watchdog();
1479 if (ret) 1472 if (ret)
1480 pr_warning("da830_evm_init: watchdog registration failed: %d\n", 1473 pr_warn("%s: watchdog registration failed: %d\n",
1481 ret); 1474 __func__, ret);
1482 1475
1483 if (HAS_MMC) { 1476 if (HAS_MMC) {
1484 ret = davinci_cfg_reg_list(da850_evm_mmcsd0_pins); 1477 ret = davinci_cfg_reg_list(da850_evm_mmcsd0_pins);
1485 if (ret) 1478 if (ret)
1486 pr_warning("da850_evm_init: mmcsd0 mux setup failed:" 1479 pr_warn("%s: MMCSD0 mux setup failed: %d\n",
1487 " %d\n", ret); 1480 __func__, ret);
1488 1481
1489 ret = gpio_request(DA850_MMCSD_CD_PIN, "MMC CD\n"); 1482 ret = gpio_request(DA850_MMCSD_CD_PIN, "MMC CD\n");
1490 if (ret) 1483 if (ret)
1491 pr_warning("da850_evm_init: can not open GPIO %d\n", 1484 pr_warn("%s: can not open GPIO %d\n",
1492 DA850_MMCSD_CD_PIN); 1485 __func__, DA850_MMCSD_CD_PIN);
1493 gpio_direction_input(DA850_MMCSD_CD_PIN); 1486 gpio_direction_input(DA850_MMCSD_CD_PIN);
1494 1487
1495 ret = gpio_request(DA850_MMCSD_WP_PIN, "MMC WP\n"); 1488 ret = gpio_request(DA850_MMCSD_WP_PIN, "MMC WP\n");
1496 if (ret) 1489 if (ret)
1497 pr_warning("da850_evm_init: can not open GPIO %d\n", 1490 pr_warn("%s: can not open GPIO %d\n",
1498 DA850_MMCSD_WP_PIN); 1491 __func__, DA850_MMCSD_WP_PIN);
1499 gpio_direction_input(DA850_MMCSD_WP_PIN); 1492 gpio_direction_input(DA850_MMCSD_WP_PIN);
1500 1493
1501 ret = da8xx_register_mmcsd0(&da850_mmc_config); 1494 ret = da8xx_register_mmcsd0(&da850_mmc_config);
1502 if (ret) 1495 if (ret)
1503 pr_warning("da850_evm_init: mmcsd0 registration failed:" 1496 pr_warn("%s: MMCSD0 registration failed: %d\n",
1504 " %d\n", ret); 1497 __func__, ret);
1505 1498
1506 ret = da850_wl12xx_init(); 1499 ret = da850_wl12xx_init();
1507 if (ret) 1500 if (ret)
1508 pr_warning("da850_evm_init: wl12xx initialization" 1501 pr_warn("%s: WL12xx initialization failed: %d\n",
1509 " failed: %d\n", ret); 1502 __func__, ret);
1510 } 1503 }
1511 1504
1512 davinci_serial_init(&da850_evm_uart_config); 1505 davinci_serial_init(&da850_evm_uart_config);
@@ -1524,16 +1517,14 @@ static __init void da850_evm_init(void)
1524 1517
1525 ret = davinci_cfg_reg_list(da850_evm_mcasp_pins); 1518 ret = davinci_cfg_reg_list(da850_evm_mcasp_pins);
1526 if (ret) 1519 if (ret)
1527 pr_warning("da850_evm_init: mcasp mux setup failed: %d\n", 1520 pr_warn("%s: McASP mux setup failed: %d\n", __func__, ret);
1528 ret);
1529 1521
1530 da850_evm_snd_data.sram_pool = sram_get_gen_pool(); 1522 da850_evm_snd_data.sram_pool = sram_get_gen_pool();
1531 da8xx_register_mcasp(0, &da850_evm_snd_data); 1523 da8xx_register_mcasp(0, &da850_evm_snd_data);
1532 1524
1533 ret = davinci_cfg_reg_list(da850_lcdcntl_pins); 1525 ret = davinci_cfg_reg_list(da850_lcdcntl_pins);
1534 if (ret) 1526 if (ret)
1535 pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n", 1527 pr_warn("%s: LCDC mux setup failed: %d\n", __func__, ret);
1536 ret);
1537 1528
1538 ret = da8xx_register_uio_pruss(); 1529 ret = da8xx_register_uio_pruss();
1539 if (ret) 1530 if (ret)
@@ -1543,51 +1534,49 @@ static __init void da850_evm_init(void)
1543 /* Handle board specific muxing for LCD here */ 1534 /* Handle board specific muxing for LCD here */
1544 ret = davinci_cfg_reg_list(da850_evm_lcdc_pins); 1535 ret = davinci_cfg_reg_list(da850_evm_lcdc_pins);
1545 if (ret) 1536 if (ret)
1546 pr_warning("da850_evm_init: evm specific lcd mux setup " 1537 pr_warn("%s: EVM specific LCD mux setup failed: %d\n",
1547 "failed: %d\n", ret); 1538 __func__, ret);
1548 1539
1549 ret = da850_lcd_hw_init(); 1540 ret = da850_lcd_hw_init();
1550 if (ret) 1541 if (ret)
1551 pr_warning("da850_evm_init: lcd initialization failed: %d\n", 1542 pr_warn("%s: LCD initialization failed: %d\n", __func__, ret);
1552 ret);
1553 1543
1554 sharp_lk043t1dg01_pdata.panel_power_ctrl = da850_panel_power_ctrl, 1544 sharp_lk043t1dg01_pdata.panel_power_ctrl = da850_panel_power_ctrl,
1555 ret = da8xx_register_lcdc(&sharp_lk043t1dg01_pdata); 1545 ret = da8xx_register_lcdc(&sharp_lk043t1dg01_pdata);
1556 if (ret) 1546 if (ret)
1557 pr_warning("da850_evm_init: lcdc registration failed: %d\n", 1547 pr_warn("%s: LCDC registration failed: %d\n", __func__, ret);
1558 ret);
1559 1548
1560 ret = da8xx_register_rtc(); 1549 ret = da8xx_register_rtc();
1561 if (ret) 1550 if (ret)
1562 pr_warning("da850_evm_init: rtc setup failed: %d\n", ret); 1551 pr_warn("%s: RTC setup failed: %d\n", __func__, ret);
1563 1552
1564 ret = da850_evm_init_cpufreq(); 1553 ret = da850_evm_init_cpufreq();
1565 if (ret) 1554 if (ret)
1566 pr_warning("da850_evm_init: cpufreq registration failed: %d\n", 1555 pr_warn("%s: cpufreq registration failed: %d\n", __func__, ret);
1567 ret);
1568 1556
1569 ret = da8xx_register_cpuidle(); 1557 ret = da8xx_register_cpuidle();
1570 if (ret) 1558 if (ret)
1571 pr_warning("da850_evm_init: cpuidle registration failed: %d\n", 1559 pr_warn("%s: cpuidle registration failed: %d\n", __func__, ret);
1572 ret);
1573 1560
1574 ret = da850_register_pm(&da850_pm_device); 1561 ret = da850_register_pm(&da850_pm_device);
1575 if (ret) 1562 if (ret)
1576 pr_warning("da850_evm_init: suspend registration failed: %d\n", 1563 pr_warn("%s: suspend registration failed: %d\n", __func__, ret);
1577 ret);
1578 1564
1579 da850_vpif_init(); 1565 da850_vpif_init();
1580 1566
1581 ret = da8xx_register_spi(1, da850evm_spi_info, 1567 ret = spi_register_board_info(da850evm_spi_info,
1582 ARRAY_SIZE(da850evm_spi_info)); 1568 ARRAY_SIZE(da850evm_spi_info));
1583 if (ret) 1569 if (ret)
1584 pr_warning("da850_evm_init: spi 1 registration failed: %d\n", 1570 pr_warn("%s: spi info registration failed: %d\n", __func__,
1585 ret); 1571 ret);
1572
1573 ret = da8xx_register_spi_bus(1, ARRAY_SIZE(da850evm_spi_info));
1574 if (ret)
1575 pr_warn("%s: SPI 1 registration failed: %d\n", __func__, ret);
1586 1576
1587 ret = da850_register_sata(DA850EVM_SATA_REFCLKPN_RATE); 1577 ret = da850_register_sata(DA850EVM_SATA_REFCLKPN_RATE);
1588 if (ret) 1578 if (ret)
1589 pr_warning("da850_evm_init: sata registration failed: %d\n", 1579 pr_warn("%s: SATA registration failed: %d\n", __func__, ret);
1590 ret);
1591 1580
1592 da850_evm_setup_mac_addr(); 1581 da850_evm_setup_mac_addr();
1593} 1582}
@@ -1612,7 +1601,7 @@ MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM")
1612 .atag_offset = 0x100, 1601 .atag_offset = 0x100,
1613 .map_io = da850_evm_map_io, 1602 .map_io = da850_evm_map_io,
1614 .init_irq = cp_intc_init, 1603 .init_irq = cp_intc_init,
1615 .timer = &davinci_timer, 1604 .init_time = davinci_timer_init,
1616 .init_machine = da850_evm_init, 1605 .init_machine = da850_evm_init,
1617 .init_late = davinci_init_late, 1606 .init_late = davinci_init_late,
1618 .dma_zone_size = SZ_128M, 1607 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index cdf8d0746e79..147b8e1a4407 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -355,7 +355,7 @@ MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM")
355 .atag_offset = 0x100, 355 .atag_offset = 0x100,
356 .map_io = dm355_evm_map_io, 356 .map_io = dm355_evm_map_io,
357 .init_irq = davinci_irq_init, 357 .init_irq = davinci_irq_init,
358 .timer = &davinci_timer, 358 .init_time = davinci_timer_init,
359 .init_machine = dm355_evm_init, 359 .init_machine = dm355_evm_init,
360 .init_late = davinci_init_late, 360 .init_late = davinci_init_late,
361 .dma_zone_size = SZ_128M, 361 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index d41954507fc2..dff4ddc5ef81 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -274,7 +274,7 @@ MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard")
274 .atag_offset = 0x100, 274 .atag_offset = 0x100,
275 .map_io = dm355_leopard_map_io, 275 .map_io = dm355_leopard_map_io,
276 .init_irq = davinci_irq_init, 276 .init_irq = davinci_irq_init,
277 .timer = &davinci_timer, 277 .init_time = davinci_timer_init,
278 .init_machine = dm355_leopard_init, 278 .init_machine = dm355_leopard_init,
279 .init_late = davinci_init_late, 279 .init_late = davinci_init_late,
280 .dma_zone_size = SZ_128M, 280 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index 5d49c75388ca..c2d4958a0cb6 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -616,7 +616,7 @@ MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM")
616 .atag_offset = 0x100, 616 .atag_offset = 0x100,
617 .map_io = dm365_evm_map_io, 617 .map_io = dm365_evm_map_io,
618 .init_irq = davinci_irq_init, 618 .init_irq = davinci_irq_init,
619 .timer = &davinci_timer, 619 .init_time = davinci_timer_init,
620 .init_machine = dm365_evm_init, 620 .init_machine = dm365_evm_init,
621 .init_late = davinci_init_late, 621 .init_late = davinci_init_late,
622 .dma_zone_size = SZ_128M, 622 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 8e1b4ffb5e54..71735e7797cc 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -825,7 +825,7 @@ MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")
825 .atag_offset = 0x100, 825 .atag_offset = 0x100,
826 .map_io = davinci_evm_map_io, 826 .map_io = davinci_evm_map_io,
827 .init_irq = davinci_irq_init, 827 .init_irq = davinci_irq_init,
828 .timer = &davinci_timer, 828 .init_time = davinci_timer_init,
829 .init_machine = davinci_evm_init, 829 .init_machine = davinci_evm_init,
830 .init_late = davinci_init_late, 830 .init_late = davinci_init_late,
831 .dma_zone_size = SZ_128M, 831 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 6e2f1631df5b..de7adff324dc 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -818,7 +818,7 @@ MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
818 .atag_offset = 0x100, 818 .atag_offset = 0x100,
819 .map_io = davinci_map_io, 819 .map_io = davinci_map_io,
820 .init_irq = davinci_irq_init, 820 .init_irq = davinci_irq_init,
821 .timer = &davinci_timer, 821 .init_time = davinci_timer_init,
822 .init_machine = evm_init, 822 .init_machine = evm_init,
823 .init_late = davinci_init_late, 823 .init_late = davinci_init_late,
824 .dma_zone_size = SZ_128M, 824 .dma_zone_size = SZ_128M,
@@ -829,7 +829,7 @@ MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
829 .atag_offset = 0x100, 829 .atag_offset = 0x100,
830 .map_io = davinci_map_io, 830 .map_io = davinci_map_io,
831 .init_irq = davinci_irq_init, 831 .init_irq = davinci_irq_init,
832 .timer = &davinci_timer, 832 .init_time = davinci_timer_init,
833 .init_machine = evm_init, 833 .init_machine = evm_init,
834 .init_late = davinci_init_late, 834 .init_late = davinci_init_late,
835 .dma_zone_size = SZ_128M, 835 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index 43e4a0d663fa..9549d53aa63f 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -529,8 +529,13 @@ static void __init mityomapl138_init(void)
529 529
530 mityomapl138_setup_nand(); 530 mityomapl138_setup_nand();
531 531
532 ret = da8xx_register_spi(1, mityomapl138_spi_flash_info, 532 ret = spi_register_board_info(mityomapl138_spi_flash_info,
533 ARRAY_SIZE(mityomapl138_spi_flash_info)); 533 ARRAY_SIZE(mityomapl138_spi_flash_info));
534 if (ret)
535 pr_warn("spi info registration failed: %d\n", ret);
536
537 ret = da8xx_register_spi_bus(1,
538 ARRAY_SIZE(mityomapl138_spi_flash_info));
534 if (ret) 539 if (ret)
535 pr_warning("spi 1 registration failed: %d\n", ret); 540 pr_warning("spi 1 registration failed: %d\n", ret);
536 541
@@ -570,7 +575,7 @@ MACHINE_START(MITYOMAPL138, "MityDSP-L138/MityARM-1808")
570 .atag_offset = 0x100, 575 .atag_offset = 0x100,
571 .map_io = mityomapl138_map_io, 576 .map_io = mityomapl138_map_io,
572 .init_irq = cp_intc_init, 577 .init_irq = cp_intc_init,
573 .timer = &davinci_timer, 578 .init_time = davinci_timer_init,
574 .init_machine = mityomapl138_init, 579 .init_machine = mityomapl138_init,
575 .init_late = davinci_init_late, 580 .init_late = davinci_init_late,
576 .dma_zone_size = SZ_128M, 581 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
index 3e3e3afebf88..1c98107527fa 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -237,7 +237,7 @@ MACHINE_START(NEUROS_OSD2, "Neuros OSD2")
237 .atag_offset = 0x100, 237 .atag_offset = 0x100,
238 .map_io = davinci_ntosd2_map_io, 238 .map_io = davinci_ntosd2_map_io,
239 .init_irq = davinci_irq_init, 239 .init_irq = davinci_irq_init,
240 .timer = &davinci_timer, 240 .init_time = davinci_timer_init,
241 .init_machine = davinci_ntosd2_init, 241 .init_machine = davinci_ntosd2_init,
242 .init_late = davinci_init_late, 242 .init_late = davinci_init_late,
243 .dma_zone_size = SZ_128M, 243 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c
index dc1208e9e664..5a2bd44da54d 100644
--- a/arch/arm/mach-davinci/board-omapl138-hawk.c
+++ b/arch/arm/mach-davinci/board-omapl138-hawk.c
@@ -48,8 +48,7 @@ static __init void omapl138_hawk_config_emac(void)
48 val &= ~BIT(8); 48 val &= ~BIT(8);
49 ret = davinci_cfg_reg_list(omapl138_hawk_mii_pins); 49 ret = davinci_cfg_reg_list(omapl138_hawk_mii_pins);
50 if (ret) { 50 if (ret) {
51 pr_warning("%s: cpgmac/mii mux setup failed: %d\n", 51 pr_warn("%s: CPGMAC/MII mux setup failed: %d\n", __func__, ret);
52 __func__, ret);
53 return; 52 return;
54 } 53 }
55 54
@@ -61,8 +60,7 @@ static __init void omapl138_hawk_config_emac(void)
61 60
62 ret = da8xx_register_emac(); 61 ret = da8xx_register_emac();
63 if (ret) 62 if (ret)
64 pr_warning("%s: emac registration failed: %d\n", 63 pr_warn("%s: EMAC registration failed: %d\n", __func__, ret);
65 __func__, ret);
66} 64}
67 65
68/* 66/*
@@ -147,15 +145,14 @@ static __init void omapl138_hawk_mmc_init(void)
147 145
148 ret = davinci_cfg_reg_list(hawk_mmcsd0_pins); 146 ret = davinci_cfg_reg_list(hawk_mmcsd0_pins);
149 if (ret) { 147 if (ret) {
150 pr_warning("%s: MMC/SD0 mux setup failed: %d\n", 148 pr_warn("%s: MMC/SD0 mux setup failed: %d\n", __func__, ret);
151 __func__, ret);
152 return; 149 return;
153 } 150 }
154 151
155 ret = gpio_request_one(DA850_HAWK_MMCSD_CD_PIN, 152 ret = gpio_request_one(DA850_HAWK_MMCSD_CD_PIN,
156 GPIOF_DIR_IN, "MMC CD"); 153 GPIOF_DIR_IN, "MMC CD");
157 if (ret < 0) { 154 if (ret < 0) {
158 pr_warning("%s: can not open GPIO %d\n", 155 pr_warn("%s: can not open GPIO %d\n",
159 __func__, DA850_HAWK_MMCSD_CD_PIN); 156 __func__, DA850_HAWK_MMCSD_CD_PIN);
160 return; 157 return;
161 } 158 }
@@ -163,15 +160,14 @@ static __init void omapl138_hawk_mmc_init(void)
163 ret = gpio_request_one(DA850_HAWK_MMCSD_WP_PIN, 160 ret = gpio_request_one(DA850_HAWK_MMCSD_WP_PIN,
164 GPIOF_DIR_IN, "MMC WP"); 161 GPIOF_DIR_IN, "MMC WP");
165 if (ret < 0) { 162 if (ret < 0) {
166 pr_warning("%s: can not open GPIO %d\n", 163 pr_warn("%s: can not open GPIO %d\n",
167 __func__, DA850_HAWK_MMCSD_WP_PIN); 164 __func__, DA850_HAWK_MMCSD_WP_PIN);
168 goto mmc_setup_wp_fail; 165 goto mmc_setup_wp_fail;
169 } 166 }
170 167
171 ret = da8xx_register_mmcsd0(&da850_mmc_config); 168 ret = da8xx_register_mmcsd0(&da850_mmc_config);
172 if (ret) { 169 if (ret) {
173 pr_warning("%s: MMC/SD0 registration failed: %d\n", 170 pr_warn("%s: MMC/SD0 registration failed: %d\n", __func__, ret);
174 __func__, ret);
175 goto mmc_setup_mmcsd_fail; 171 goto mmc_setup_mmcsd_fail;
176 } 172 }
177 173
@@ -250,8 +246,7 @@ static __init void omapl138_hawk_usb_init(void)
250 246
251 ret = davinci_cfg_reg_list(da850_hawk_usb11_pins); 247 ret = davinci_cfg_reg_list(da850_hawk_usb11_pins);
252 if (ret) { 248 if (ret) {
253 pr_warning("%s: USB 1.1 PinMux setup failed: %d\n", 249 pr_warn("%s: USB 1.1 PinMux setup failed: %d\n", __func__, ret);
254 __func__, ret);
255 return; 250 return;
256 } 251 }
257 252
@@ -280,8 +275,7 @@ static __init void omapl138_hawk_usb_init(void)
280 275
281 ret = da8xx_register_usb11(&omapl138_hawk_usb11_pdata); 276 ret = da8xx_register_usb11(&omapl138_hawk_usb11_pdata);
282 if (ret) { 277 if (ret) {
283 pr_warning("%s: USB 1.1 registration failed: %d\n", 278 pr_warn("%s: USB 1.1 registration failed: %d\n", __func__, ret);
284 __func__, ret);
285 goto usb11_setup_fail; 279 goto usb11_setup_fail;
286 } 280 }
287 281
@@ -307,8 +301,7 @@ static __init void omapl138_hawk_init(void)
307 301
308 ret = da850_register_edma(da850_edma_rsv); 302 ret = da850_register_edma(da850_edma_rsv);
309 if (ret) 303 if (ret)
310 pr_warning("%s: EDMA registration failed: %d\n", 304 pr_warn("%s: EDMA registration failed: %d\n", __func__, ret);
311 __func__, ret);
312 305
313 omapl138_hawk_mmc_init(); 306 omapl138_hawk_mmc_init();
314 307
@@ -316,9 +309,8 @@ static __init void omapl138_hawk_init(void)
316 309
317 ret = da8xx_register_watchdog(); 310 ret = da8xx_register_watchdog();
318 if (ret) 311 if (ret)
319 pr_warning("omapl138_hawk_init: " 312 pr_warn("%s: watchdog registration failed: %d\n",
320 "watchdog registration failed: %d\n", 313 __func__, ret);
321 ret);
322} 314}
323 315
324#ifdef CONFIG_SERIAL_8250_CONSOLE 316#ifdef CONFIG_SERIAL_8250_CONSOLE
@@ -341,7 +333,7 @@ MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard")
341 .atag_offset = 0x100, 333 .atag_offset = 0x100,
342 .map_io = omapl138_hawk_map_io, 334 .map_io = omapl138_hawk_map_io,
343 .init_irq = cp_intc_init, 335 .init_irq = cp_intc_init,
344 .timer = &davinci_timer, 336 .init_time = davinci_timer_init,
345 .init_machine = omapl138_hawk_init, 337 .init_machine = omapl138_hawk_init,
346 .init_late = davinci_init_late, 338 .init_late = davinci_init_late,
347 .dma_zone_size = SZ_128M, 339 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
index 6957787fa7f3..739be7e738fe 100644
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -155,7 +155,7 @@ MACHINE_START(SFFSDR, "Lyrtech SFFSDR")
155 .atag_offset = 0x100, 155 .atag_offset = 0x100,
156 .map_io = davinci_sffsdr_map_io, 156 .map_io = davinci_sffsdr_map_io,
157 .init_irq = davinci_irq_init, 157 .init_irq = davinci_irq_init,
158 .timer = &davinci_timer, 158 .init_time = davinci_timer_init,
159 .init_machine = davinci_sffsdr_init, 159 .init_machine = davinci_sffsdr_init,
160 .init_late = davinci_init_late, 160 .init_late = davinci_init_late,
161 .dma_zone_size = SZ_128M, 161 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/board-tnetv107x-evm.c b/arch/arm/mach-davinci/board-tnetv107x-evm.c
index be3099733b1f..4f416023d4e2 100644
--- a/arch/arm/mach-davinci/board-tnetv107x-evm.c
+++ b/arch/arm/mach-davinci/board-tnetv107x-evm.c
@@ -280,7 +280,7 @@ MACHINE_START(TNETV107X, "TNETV107X EVM")
280 .atag_offset = 0x100, 280 .atag_offset = 0x100,
281 .map_io = tnetv107x_init, 281 .map_io = tnetv107x_init,
282 .init_irq = cp_intc_init, 282 .init_irq = cp_intc_init,
283 .timer = &davinci_timer, 283 .init_time = davinci_timer_init,
284 .init_machine = tnetv107x_evm_board_init, 284 .init_machine = tnetv107x_evm_board_init,
285 .init_late = davinci_init_late, 285 .init_late = davinci_init_late,
286 .dma_zone_size = SZ_128M, 286 .dma_zone_size = SZ_128M,
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
index 34668ead53c7..d458558ee84a 100644
--- a/arch/arm/mach-davinci/clock.c
+++ b/arch/arm/mach-davinci/clock.c
@@ -52,6 +52,40 @@ static void __clk_disable(struct clk *clk)
52 __clk_disable(clk->parent); 52 __clk_disable(clk->parent);
53} 53}
54 54
55int davinci_clk_reset(struct clk *clk, bool reset)
56{
57 unsigned long flags;
58
59 if (clk == NULL || IS_ERR(clk))
60 return -EINVAL;
61
62 spin_lock_irqsave(&clockfw_lock, flags);
63 if (clk->flags & CLK_PSC)
64 davinci_psc_reset(clk->gpsc, clk->lpsc, reset);
65 spin_unlock_irqrestore(&clockfw_lock, flags);
66
67 return 0;
68}
69EXPORT_SYMBOL(davinci_clk_reset);
70
71int davinci_clk_reset_assert(struct clk *clk)
72{
73 if (clk == NULL || IS_ERR(clk) || !clk->reset)
74 return -EINVAL;
75
76 return clk->reset(clk, true);
77}
78EXPORT_SYMBOL(davinci_clk_reset_assert);
79
80int davinci_clk_reset_deassert(struct clk *clk)
81{
82 if (clk == NULL || IS_ERR(clk) || !clk->reset)
83 return -EINVAL;
84
85 return clk->reset(clk, false);
86}
87EXPORT_SYMBOL(davinci_clk_reset_deassert);
88
55int clk_enable(struct clk *clk) 89int clk_enable(struct clk *clk)
56{ 90{
57 unsigned long flags; 91 unsigned long flags;
@@ -535,7 +569,7 @@ int davinci_set_refclk_rate(unsigned long rate)
535} 569}
536 570
537int __init davinci_clk_init(struct clk_lookup *clocks) 571int __init davinci_clk_init(struct clk_lookup *clocks)
538 { 572{
539 struct clk_lookup *c; 573 struct clk_lookup *c;
540 struct clk *clk; 574 struct clk *clk;
541 size_t num_clocks = 0; 575 size_t num_clocks = 0;
@@ -576,6 +610,9 @@ int __init davinci_clk_init(struct clk_lookup *clocks)
576 if (clk->lpsc) 610 if (clk->lpsc)
577 clk->flags |= CLK_PSC; 611 clk->flags |= CLK_PSC;
578 612
613 if (clk->flags & PSC_LRST)
614 clk->reset = davinci_clk_reset;
615
579 clk_register(clk); 616 clk_register(clk);
580 num_clocks++; 617 num_clocks++;
581 618
diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h
index 46f0f1bf1a4c..8694b395fc92 100644
--- a/arch/arm/mach-davinci/clock.h
+++ b/arch/arm/mach-davinci/clock.h
@@ -103,6 +103,7 @@ struct clk {
103 unsigned long (*recalc) (struct clk *); 103 unsigned long (*recalc) (struct clk *);
104 int (*set_rate) (struct clk *clk, unsigned long rate); 104 int (*set_rate) (struct clk *clk, unsigned long rate);
105 int (*round_rate) (struct clk *clk, unsigned long rate); 105 int (*round_rate) (struct clk *clk, unsigned long rate);
106 int (*reset) (struct clk *clk, bool reset);
106}; 107};
107 108
108/* Clock flags: SoC-specific flags start at BIT(16) */ 109/* Clock flags: SoC-specific flags start at BIT(16) */
@@ -112,6 +113,7 @@ struct clk {
112#define PRE_PLL BIT(4) /* source is before PLL mult/div */ 113#define PRE_PLL BIT(4) /* source is before PLL mult/div */
113#define PSC_SWRSTDISABLE BIT(5) /* Disable state is SwRstDisable */ 114#define PSC_SWRSTDISABLE BIT(5) /* Disable state is SwRstDisable */
114#define PSC_FORCE BIT(6) /* Force module state transtition */ 115#define PSC_FORCE BIT(6) /* Force module state transtition */
116#define PSC_LRST BIT(8) /* Use local reset on enable/disable */
115 117
116#define CLK(dev, con, ck) \ 118#define CLK(dev, con, ck) \
117 { \ 119 { \
@@ -126,6 +128,7 @@ int davinci_set_pllrate(struct pll_data *pll, unsigned int prediv,
126int davinci_set_sysclk_rate(struct clk *clk, unsigned long rate); 128int davinci_set_sysclk_rate(struct clk *clk, unsigned long rate);
127int davinci_set_refclk_rate(unsigned long rate); 129int davinci_set_refclk_rate(unsigned long rate);
128int davinci_simple_set_rate(struct clk *clk, unsigned long rate); 130int davinci_simple_set_rate(struct clk *clk, unsigned long rate);
131int davinci_clk_reset(struct clk *clk, bool reset);
129 132
130extern struct platform_device davinci_wdt_device; 133extern struct platform_device davinci_wdt_device;
131extern void davinci_watchdog_reset(struct platform_device *); 134extern void davinci_watchdog_reset(struct platform_device *);
diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c
index 9107691adbdb..5ac9e9384b15 100644
--- a/arch/arm/mach-davinci/cpuidle.c
+++ b/arch/arm/mach-davinci/cpuidle.c
@@ -25,35 +25,44 @@
25 25
26#define DAVINCI_CPUIDLE_MAX_STATES 2 26#define DAVINCI_CPUIDLE_MAX_STATES 2
27 27
28struct davinci_ops { 28static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device);
29 void (*enter) (u32 flags); 29static void __iomem *ddr2_reg_base;
30 void (*exit) (u32 flags); 30static bool ddr2_pdown;
31 u32 flags; 31
32}; 32static void davinci_save_ddr_power(int enter, bool pdown)
33{
34 u32 val;
35
36 val = __raw_readl(ddr2_reg_base + DDR2_SDRCR_OFFSET);
37
38 if (enter) {
39 if (pdown)
40 val |= DDR2_SRPD_BIT;
41 else
42 val &= ~DDR2_SRPD_BIT;
43 val |= DDR2_LPMODEN_BIT;
44 } else {
45 val &= ~(DDR2_SRPD_BIT | DDR2_LPMODEN_BIT);
46 }
47
48 __raw_writel(val, ddr2_reg_base + DDR2_SDRCR_OFFSET);
49}
33 50
34/* Actual code that puts the SoC in different idle states */ 51/* Actual code that puts the SoC in different idle states */
35static int davinci_enter_idle(struct cpuidle_device *dev, 52static int davinci_enter_idle(struct cpuidle_device *dev,
36 struct cpuidle_driver *drv, 53 struct cpuidle_driver *drv,
37 int index) 54 int index)
38{ 55{
39 struct cpuidle_state_usage *state_usage = &dev->states_usage[index]; 56 davinci_save_ddr_power(1, ddr2_pdown);
40 struct davinci_ops *ops = cpuidle_get_statedata(state_usage);
41
42 if (ops && ops->enter)
43 ops->enter(ops->flags);
44 57
45 index = cpuidle_wrap_enter(dev, drv, index, 58 index = cpuidle_wrap_enter(dev, drv, index,
46 arm_cpuidle_simple_enter); 59 arm_cpuidle_simple_enter);
47 60
48 if (ops && ops->exit) 61 davinci_save_ddr_power(0, ddr2_pdown);
49 ops->exit(ops->flags);
50 62
51 return index; 63 return index;
52} 64}
53 65
54/* fields in davinci_ops.flags */
55#define DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN BIT(0)
56
57static struct cpuidle_driver davinci_idle_driver = { 66static struct cpuidle_driver davinci_idle_driver = {
58 .name = "cpuidle-davinci", 67 .name = "cpuidle-davinci",
59 .owner = THIS_MODULE, 68 .owner = THIS_MODULE,
@@ -70,45 +79,6 @@ static struct cpuidle_driver davinci_idle_driver = {
70 .state_count = DAVINCI_CPUIDLE_MAX_STATES, 79 .state_count = DAVINCI_CPUIDLE_MAX_STATES,
71}; 80};
72 81
73static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device);
74static void __iomem *ddr2_reg_base;
75
76static void davinci_save_ddr_power(int enter, bool pdown)
77{
78 u32 val;
79
80 val = __raw_readl(ddr2_reg_base + DDR2_SDRCR_OFFSET);
81
82 if (enter) {
83 if (pdown)
84 val |= DDR2_SRPD_BIT;
85 else
86 val &= ~DDR2_SRPD_BIT;
87 val |= DDR2_LPMODEN_BIT;
88 } else {
89 val &= ~(DDR2_SRPD_BIT | DDR2_LPMODEN_BIT);
90 }
91
92 __raw_writel(val, ddr2_reg_base + DDR2_SDRCR_OFFSET);
93}
94
95static void davinci_c2state_enter(u32 flags)
96{
97 davinci_save_ddr_power(1, !!(flags & DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN));
98}
99
100static void davinci_c2state_exit(u32 flags)
101{
102 davinci_save_ddr_power(0, !!(flags & DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN));
103}
104
105static struct davinci_ops davinci_states[DAVINCI_CPUIDLE_MAX_STATES] = {
106 [1] = {
107 .enter = davinci_c2state_enter,
108 .exit = davinci_c2state_exit,
109 },
110};
111
112static int __init davinci_cpuidle_probe(struct platform_device *pdev) 82static int __init davinci_cpuidle_probe(struct platform_device *pdev)
113{ 83{
114 int ret; 84 int ret;
@@ -124,11 +94,7 @@ static int __init davinci_cpuidle_probe(struct platform_device *pdev)
124 94
125 ddr2_reg_base = pdata->ddr2_ctlr_base; 95 ddr2_reg_base = pdata->ddr2_ctlr_base;
126 96
127 if (pdata->ddr2_pdown) 97 ddr2_pdown = pdata->ddr2_pdown;
128 davinci_states[1].flags |= DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN;
129 cpuidle_set_statedata(&device->states_usage[1], &davinci_states[1]);
130
131 device->state_count = DAVINCI_CPUIDLE_MAX_STATES;
132 98
133 ret = cpuidle_register_driver(&davinci_idle_driver); 99 ret = cpuidle_register_driver(&davinci_idle_driver);
134 if (ret) { 100 if (ret) {
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 6b9154e9f908..0c4a26ddebba 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -76,6 +76,13 @@ static struct clk pll0_aux_clk = {
76 .flags = CLK_PLL | PRE_PLL, 76 .flags = CLK_PLL | PRE_PLL,
77}; 77};
78 78
79static struct clk pll0_sysclk1 = {
80 .name = "pll0_sysclk1",
81 .parent = &pll0_clk,
82 .flags = CLK_PLL,
83 .div_reg = PLLDIV1,
84};
85
79static struct clk pll0_sysclk2 = { 86static struct clk pll0_sysclk2 = {
80 .name = "pll0_sysclk2", 87 .name = "pll0_sysclk2",
81 .parent = &pll0_clk, 88 .parent = &pll0_clk,
@@ -368,10 +375,19 @@ static struct clk sata_clk = {
368 .flags = PSC_FORCE, 375 .flags = PSC_FORCE,
369}; 376};
370 377
378static struct clk dsp_clk = {
379 .name = "dsp",
380 .parent = &pll0_sysclk1,
381 .domain = DAVINCI_GPSC_DSPDOMAIN,
382 .lpsc = DA8XX_LPSC0_GEM,
383 .flags = PSC_LRST | PSC_FORCE,
384};
385
371static struct clk_lookup da850_clks[] = { 386static struct clk_lookup da850_clks[] = {
372 CLK(NULL, "ref", &ref_clk), 387 CLK(NULL, "ref", &ref_clk),
373 CLK(NULL, "pll0", &pll0_clk), 388 CLK(NULL, "pll0", &pll0_clk),
374 CLK(NULL, "pll0_aux", &pll0_aux_clk), 389 CLK(NULL, "pll0_aux", &pll0_aux_clk),
390 CLK(NULL, "pll0_sysclk1", &pll0_sysclk1),
375 CLK(NULL, "pll0_sysclk2", &pll0_sysclk2), 391 CLK(NULL, "pll0_sysclk2", &pll0_sysclk2),
376 CLK(NULL, "pll0_sysclk3", &pll0_sysclk3), 392 CLK(NULL, "pll0_sysclk3", &pll0_sysclk3),
377 CLK(NULL, "pll0_sysclk4", &pll0_sysclk4), 393 CLK(NULL, "pll0_sysclk4", &pll0_sysclk4),
@@ -413,6 +429,7 @@ static struct clk_lookup da850_clks[] = {
413 CLK("spi_davinci.1", NULL, &spi1_clk), 429 CLK("spi_davinci.1", NULL, &spi1_clk),
414 CLK("vpif", NULL, &vpif_clk), 430 CLK("vpif", NULL, &vpif_clk),
415 CLK("ahci", NULL, &sata_clk), 431 CLK("ahci", NULL, &sata_clk),
432 CLK("davinci-rproc.0", NULL, &dsp_clk),
416 CLK(NULL, NULL, NULL), 433 CLK(NULL, NULL, NULL),
417}; 434};
418 435
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index 37c27af18fa0..6b7a0a27fbd1 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -37,11 +37,18 @@ static void __init da8xx_init_irq(void)
37 of_irq_init(da8xx_irq_match); 37 of_irq_init(da8xx_irq_match);
38} 38}
39 39
40struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
41 OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL),
42 OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL),
43 {}
44};
45
40#ifdef CONFIG_ARCH_DAVINCI_DA850 46#ifdef CONFIG_ARCH_DAVINCI_DA850
41 47
42static void __init da850_init_machine(void) 48static void __init da850_init_machine(void)
43{ 49{
44 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 50 of_platform_populate(NULL, of_default_bus_match_table,
51 da850_auxdata_lookup, NULL);
45 52
46 da8xx_uart_clk_enable(); 53 da8xx_uart_clk_enable();
47} 54}
@@ -56,7 +63,7 @@ static const char *da850_boards_compat[] __initdata = {
56DT_MACHINE_START(DA850_DT, "Generic DA850/OMAP-L138/AM18x") 63DT_MACHINE_START(DA850_DT, "Generic DA850/OMAP-L138/AM18x")
57 .map_io = da850_init, 64 .map_io = da850_init,
58 .init_irq = da8xx_init_irq, 65 .init_irq = da8xx_init_irq,
59 .timer = &davinci_timer, 66 .init_time = davinci_timer_init,
60 .init_machine = da850_init_machine, 67 .init_machine = da850_init_machine,
61 .dt_compat = da850_boards_compat, 68 .dt_compat = da850_boards_compat,
62 .init_late = davinci_init_late, 69 .init_late = davinci_init_late,
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 2d5502d84a22..fc50243b1481 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -359,7 +359,7 @@ static struct resource da8xx_watchdog_resources[] = {
359 }, 359 },
360}; 360};
361 361
362struct platform_device da8xx_wdt_device = { 362static struct platform_device da8xx_wdt_device = {
363 .name = "watchdog", 363 .name = "watchdog",
364 .id = -1, 364 .id = -1,
365 .num_resources = ARRAY_SIZE(da8xx_watchdog_resources), 365 .num_resources = ARRAY_SIZE(da8xx_watchdog_resources),
@@ -368,7 +368,15 @@ struct platform_device da8xx_wdt_device = {
368 368
369void da8xx_restart(char mode, const char *cmd) 369void da8xx_restart(char mode, const char *cmd)
370{ 370{
371 davinci_watchdog_reset(&da8xx_wdt_device); 371 struct device *dev;
372
373 dev = bus_find_device_by_name(&platform_bus_type, NULL, "watchdog");
374 if (!dev) {
375 pr_err("%s: failed to find watchdog device\n", __func__);
376 return;
377 }
378
379 davinci_watchdog_reset(to_platform_device(dev));
372} 380}
373 381
374int __init da8xx_register_watchdog(void) 382int __init da8xx_register_watchdog(void)
@@ -751,7 +759,7 @@ void __iomem * __init da8xx_get_mem_ctlr(void)
751 759
752 da8xx_ddr2_ctlr_base = ioremap(DA8XX_DDR2_CTL_BASE, SZ_32K); 760 da8xx_ddr2_ctlr_base = ioremap(DA8XX_DDR2_CTL_BASE, SZ_32K);
753 if (!da8xx_ddr2_ctlr_base) 761 if (!da8xx_ddr2_ctlr_base)
754 pr_warning("%s: Unable to map DDR2 controller", __func__); 762 pr_warn("%s: Unable to map DDR2 controller", __func__);
755 763
756 return da8xx_ddr2_ctlr_base; 764 return da8xx_ddr2_ctlr_base;
757} 765}
@@ -832,7 +840,7 @@ static struct resource da8xx_spi1_resources[] = {
832 }, 840 },
833}; 841};
834 842
835struct davinci_spi_platform_data da8xx_spi_pdata[] = { 843static struct davinci_spi_platform_data da8xx_spi_pdata[] = {
836 [0] = { 844 [0] = {
837 .version = SPI_VERSION_2, 845 .version = SPI_VERSION_2,
838 .intr_line = 1, 846 .intr_line = 1,
@@ -866,20 +874,12 @@ static struct platform_device da8xx_spi_device[] = {
866 }, 874 },
867}; 875};
868 876
869int __init da8xx_register_spi(int instance, const struct spi_board_info *info, 877int __init da8xx_register_spi_bus(int instance, unsigned num_chipselect)
870 unsigned len)
871{ 878{
872 int ret;
873
874 if (instance < 0 || instance > 1) 879 if (instance < 0 || instance > 1)
875 return -EINVAL; 880 return -EINVAL;
876 881
877 ret = spi_register_board_info(info, len); 882 da8xx_spi_pdata[instance].num_chipselect = num_chipselect;
878 if (ret)
879 pr_warning("%s: failed to register board info for spi %d :"
880 " %d\n", __func__, instance, ret);
881
882 da8xx_spi_pdata[instance].num_chipselect = len;
883 883
884 if (instance == 1 && cpu_is_davinci_da850()) { 884 if (instance == 1 && cpu_is_davinci_da850()) {
885 da8xx_spi1_resources[0].start = DA850_SPI1_BASE; 885 da8xx_spi1_resources[0].start = DA850_SPI1_BASE;
diff --git a/arch/arm/mach-davinci/include/mach/clock.h b/arch/arm/mach-davinci/include/mach/clock.h
index a3b040219876..3e8af6a0b64c 100644
--- a/arch/arm/mach-davinci/include/mach/clock.h
+++ b/arch/arm/mach-davinci/include/mach/clock.h
@@ -18,4 +18,7 @@ struct clk;
18extern int clk_register(struct clk *clk); 18extern int clk_register(struct clk *clk);
19extern void clk_unregister(struct clk *clk); 19extern void clk_unregister(struct clk *clk);
20 20
21int davinci_clk_reset_assert(struct clk *c);
22int davinci_clk_reset_deassert(struct clk *c);
23
21#endif 24#endif
diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h
index 046c7238a3d6..b124b77c90c5 100644
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -15,9 +15,7 @@
15#include <linux/compiler.h> 15#include <linux/compiler.h>
16#include <linux/types.h> 16#include <linux/types.h>
17 17
18struct sys_timer; 18extern void davinci_timer_init(void);
19
20extern struct sys_timer davinci_timer;
21 19
22extern void davinci_irq_init(void); 20extern void davinci_irq_init(void);
23extern void __iomem *davinci_intc_base; 21extern void __iomem *davinci_intc_base;
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index 700d311c6854..de439b7b9af1 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -82,8 +82,7 @@ void __init da850_init(void);
82int da830_register_edma(struct edma_rsv_info *rsv); 82int da830_register_edma(struct edma_rsv_info *rsv);
83int da850_register_edma(struct edma_rsv_info *rsv[2]); 83int da850_register_edma(struct edma_rsv_info *rsv[2]);
84int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata); 84int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata);
85int da8xx_register_spi(int instance, 85int da8xx_register_spi_bus(int instance, unsigned num_chipselect);
86 const struct spi_board_info *info, unsigned len);
87int da8xx_register_watchdog(void); 86int da8xx_register_watchdog(void);
88int da8xx_register_usb20(unsigned mA, unsigned potpgt); 87int da8xx_register_usb20(unsigned mA, unsigned potpgt);
89int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata); 88int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata);
@@ -110,9 +109,7 @@ extern struct platform_device da8xx_serial_device;
110extern struct emac_platform_data da8xx_emac_pdata; 109extern struct emac_platform_data da8xx_emac_pdata;
111extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata; 110extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata;
112extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata; 111extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata;
113extern struct davinci_spi_platform_data da8xx_spi_pdata[];
114 112
115extern struct platform_device da8xx_wdt_device;
116 113
117extern const short da830_emif25_pins[]; 114extern const short da830_emif25_pins[];
118extern const short da830_spi0_pins[]; 115extern const short da830_spi0_pins[];
diff --git a/arch/arm/mach-davinci/include/mach/psc.h b/arch/arm/mach-davinci/include/mach/psc.h
index 40a0027838e8..0a22710493fd 100644
--- a/arch/arm/mach-davinci/include/mach/psc.h
+++ b/arch/arm/mach-davinci/include/mach/psc.h
@@ -246,6 +246,7 @@
246 246
247#define MDSTAT_STATE_MASK 0x3f 247#define MDSTAT_STATE_MASK 0x3f
248#define PDSTAT_STATE_MASK 0x1f 248#define PDSTAT_STATE_MASK 0x1f
249#define MDCTL_LRST BIT(8)
249#define MDCTL_FORCE BIT(31) 250#define MDCTL_FORCE BIT(31)
250#define PDCTL_NEXT BIT(0) 251#define PDCTL_NEXT BIT(0)
251#define PDCTL_EPCGOOD BIT(8) 252#define PDCTL_EPCGOOD BIT(8)
@@ -253,6 +254,8 @@
253#ifndef __ASSEMBLER__ 254#ifndef __ASSEMBLER__
254 255
255extern int davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id); 256extern int davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id);
257extern void davinci_psc_reset(unsigned int ctlr, unsigned int id,
258 bool reset);
256extern void davinci_psc_config(unsigned int domain, unsigned int ctlr, 259extern void davinci_psc_config(unsigned int domain, unsigned int ctlr,
257 unsigned int id, bool enable, u32 flags); 260 unsigned int id, bool enable, u32 flags);
258 261
diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h
index 3a0ff905a69b..f49c2916aa3a 100644
--- a/arch/arm/mach-davinci/include/mach/uncompress.h
+++ b/arch/arm/mach-davinci/include/mach/uncompress.h
@@ -101,4 +101,3 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
101} 101}
102 102
103#define arch_decomp_setup() __arch_decomp_setup(arch_id) 103#define arch_decomp_setup() __arch_decomp_setup(arch_id)
104#define arch_decomp_wdog()
diff --git a/arch/arm/mach-davinci/psc.c b/arch/arm/mach-davinci/psc.c
index d7e210f4b55c..82fdc69d5728 100644
--- a/arch/arm/mach-davinci/psc.c
+++ b/arch/arm/mach-davinci/psc.c
@@ -35,7 +35,7 @@ int __init davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id)
35 struct davinci_soc_info *soc_info = &davinci_soc_info; 35 struct davinci_soc_info *soc_info = &davinci_soc_info;
36 36
37 if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) { 37 if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) {
38 pr_warning("PSC: Bad psc data: 0x%x[%d]\n", 38 pr_warn("PSC: Bad psc data: 0x%x[%d]\n",
39 (int)soc_info->psc_bases, ctlr); 39 (int)soc_info->psc_bases, ctlr);
40 return 0; 40 return 0;
41 } 41 }
@@ -48,6 +48,31 @@ int __init davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id)
48 return mdstat & BIT(12); 48 return mdstat & BIT(12);
49} 49}
50 50
51/* Control "reset" line associated with PSC domain */
52void davinci_psc_reset(unsigned int ctlr, unsigned int id, bool reset)
53{
54 u32 mdctl;
55 void __iomem *psc_base;
56 struct davinci_soc_info *soc_info = &davinci_soc_info;
57
58 if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) {
59 pr_warn("PSC: Bad psc data: 0x%x[%d]\n",
60 (int)soc_info->psc_bases, ctlr);
61 return;
62 }
63
64 psc_base = ioremap(soc_info->psc_bases[ctlr], SZ_4K);
65
66 mdctl = readl(psc_base + MDCTL + 4 * id);
67 if (reset)
68 mdctl &= ~MDCTL_LRST;
69 else
70 mdctl |= MDCTL_LRST;
71 writel(mdctl, psc_base + MDCTL + 4 * id);
72
73 iounmap(psc_base);
74}
75
51/* Enable or disable a PSC domain */ 76/* Enable or disable a PSC domain */
52void davinci_psc_config(unsigned int domain, unsigned int ctlr, 77void davinci_psc_config(unsigned int domain, unsigned int ctlr,
53 unsigned int id, bool enable, u32 flags) 78 unsigned int id, bool enable, u32 flags)
@@ -58,7 +83,7 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr,
58 u32 next_state = PSC_STATE_ENABLE; 83 u32 next_state = PSC_STATE_ENABLE;
59 84
60 if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) { 85 if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) {
61 pr_warning("PSC: Bad psc data: 0x%x[%d]\n", 86 pr_warn("PSC: Bad psc data: 0x%x[%d]\n",
62 (int)soc_info->psc_bases, ctlr); 87 (int)soc_info->psc_bases, ctlr);
63 return; 88 return;
64 } 89 }
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index 9847938785ca..bad361ec1666 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -337,7 +337,7 @@ static struct clock_event_device clockevent_davinci = {
337}; 337};
338 338
339 339
340static void __init davinci_timer_init(void) 340void __init davinci_timer_init(void)
341{ 341{
342 struct clk *timer_clk; 342 struct clk *timer_clk;
343 struct davinci_soc_info *soc_info = &davinci_soc_info; 343 struct davinci_soc_info *soc_info = &davinci_soc_info;
@@ -410,11 +410,6 @@ static void __init davinci_timer_init(void)
410 timer32_config(&timers[i]); 410 timer32_config(&timers[i]);
411} 411}
412 412
413struct sys_timer davinci_timer = {
414 .init = davinci_timer_init,
415};
416
417
418/* reset board using watchdog timer */ 413/* reset board using watchdog timer */
419void davinci_watchdog_reset(struct platform_device *pdev) 414void davinci_watchdog_reset(struct platform_device *pdev)
420{ 415{