16e01478aSPaul Walmsley /* 26e01478aSPaul Walmsley * OMAP3 powerdomain definitions 36e01478aSPaul Walmsley * 46e01478aSPaul Walmsley * Copyright (C) 2007-2008 Texas Instruments, Inc. 56e01478aSPaul Walmsley * Copyright (C) 2007-2010 Nokia Corporation 66e01478aSPaul Walmsley * 76e01478aSPaul Walmsley * Paul Walmsley, Jouni Högander 86e01478aSPaul Walmsley * 96e01478aSPaul Walmsley * This program is free software; you can redistribute it and/or modify 106e01478aSPaul Walmsley * it under the terms of the GNU General Public License version 2 as 116e01478aSPaul Walmsley * published by the Free Software Foundation. 126e01478aSPaul Walmsley */ 136e01478aSPaul Walmsley 146e01478aSPaul Walmsley #include <linux/kernel.h> 156e01478aSPaul Walmsley #include <linux/init.h> 166e01478aSPaul Walmsley 17*72e06d08SPaul Walmsley #include "powerdomain.h" 186e01478aSPaul Walmsley #include "powerdomains2xxx_3xxx_data.h" 196e01478aSPaul Walmsley 206e01478aSPaul Walmsley #include "prcm-common.h" 2159fb659bSPaul Walmsley #include "prm2xxx_3xxx.h" 226e01478aSPaul Walmsley #include "prm-regbits-34xx.h" 2359fb659bSPaul Walmsley #include "cm2xxx_3xxx.h" 246e01478aSPaul Walmsley #include "cm-regbits-34xx.h" 256e01478aSPaul Walmsley 266e01478aSPaul Walmsley /* 276e01478aSPaul Walmsley * 34XX-specific powerdomains, dependencies 286e01478aSPaul Walmsley */ 296e01478aSPaul Walmsley 306e01478aSPaul Walmsley #ifdef CONFIG_ARCH_OMAP3 316e01478aSPaul Walmsley 326e01478aSPaul Walmsley /* 336e01478aSPaul Walmsley * Powerdomains 346e01478aSPaul Walmsley */ 356e01478aSPaul Walmsley 366e01478aSPaul Walmsley static struct powerdomain iva2_pwrdm = { 376e01478aSPaul Walmsley .name = "iva2_pwrdm", 386e01478aSPaul Walmsley .prcm_offs = OMAP3430_IVA2_MOD, 396e01478aSPaul Walmsley .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 406e01478aSPaul Walmsley .pwrsts = PWRSTS_OFF_RET_ON, 416e01478aSPaul Walmsley .pwrsts_logic_ret = PWRSTS_OFF_RET, 426e01478aSPaul Walmsley .banks = 4, 436e01478aSPaul Walmsley .pwrsts_mem_ret = { 446e01478aSPaul Walmsley [0] = PWRSTS_OFF_RET, 456e01478aSPaul Walmsley [1] = PWRSTS_OFF_RET, 466e01478aSPaul Walmsley [2] = PWRSTS_OFF_RET, 476e01478aSPaul Walmsley [3] = PWRSTS_OFF_RET, 486e01478aSPaul Walmsley }, 496e01478aSPaul Walmsley .pwrsts_mem_on = { 506e01478aSPaul Walmsley [0] = PWRDM_POWER_ON, 516e01478aSPaul Walmsley [1] = PWRDM_POWER_ON, 526e01478aSPaul Walmsley [2] = PWRSTS_OFF_ON, 536e01478aSPaul Walmsley [3] = PWRDM_POWER_ON, 546e01478aSPaul Walmsley }, 556e01478aSPaul Walmsley }; 566e01478aSPaul Walmsley 576e01478aSPaul Walmsley static struct powerdomain mpu_3xxx_pwrdm = { 586e01478aSPaul Walmsley .name = "mpu_pwrdm", 596e01478aSPaul Walmsley .prcm_offs = MPU_MOD, 606e01478aSPaul Walmsley .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 616e01478aSPaul Walmsley .pwrsts = PWRSTS_OFF_RET_ON, 626e01478aSPaul Walmsley .pwrsts_logic_ret = PWRSTS_OFF_RET, 636e01478aSPaul Walmsley .flags = PWRDM_HAS_MPU_QUIRK, 646e01478aSPaul Walmsley .banks = 1, 656e01478aSPaul Walmsley .pwrsts_mem_ret = { 666e01478aSPaul Walmsley [0] = PWRSTS_OFF_RET, 676e01478aSPaul Walmsley }, 686e01478aSPaul Walmsley .pwrsts_mem_on = { 696e01478aSPaul Walmsley [0] = PWRSTS_OFF_ON, 706e01478aSPaul Walmsley }, 716e01478aSPaul Walmsley }; 726e01478aSPaul Walmsley 736e01478aSPaul Walmsley /* 746e01478aSPaul Walmsley * The USBTLL Save-and-Restore mechanism is broken on 756e01478aSPaul Walmsley * 3430s upto ES3.0 and 3630ES1.0. Hence this feature 766e01478aSPaul Walmsley * needs to be disabled on these chips. 776e01478aSPaul Walmsley * Refer: 3430 errata ID i459 and 3630 errata ID i579 786e01478aSPaul Walmsley * 796e01478aSPaul Walmsley * Note: setting the SAR flag could help for errata ID i478 806e01478aSPaul Walmsley * which applies to 3430 <= ES3.1, but since the SAR feature 816e01478aSPaul Walmsley * is broken, do not use it. 826e01478aSPaul Walmsley */ 836e01478aSPaul Walmsley static struct powerdomain core_3xxx_pre_es3_1_pwrdm = { 846e01478aSPaul Walmsley .name = "core_pwrdm", 856e01478aSPaul Walmsley .prcm_offs = CORE_MOD, 866e01478aSPaul Walmsley .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 | 876e01478aSPaul Walmsley CHIP_IS_OMAP3430ES2 | 886e01478aSPaul Walmsley CHIP_IS_OMAP3430ES3_0 | 896e01478aSPaul Walmsley CHIP_IS_OMAP3630ES1), 906e01478aSPaul Walmsley .pwrsts = PWRSTS_OFF_RET_ON, 916e01478aSPaul Walmsley .pwrsts_logic_ret = PWRSTS_OFF_RET, 926e01478aSPaul Walmsley .banks = 2, 936e01478aSPaul Walmsley .pwrsts_mem_ret = { 946e01478aSPaul Walmsley [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */ 956e01478aSPaul Walmsley [1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */ 966e01478aSPaul Walmsley }, 976e01478aSPaul Walmsley .pwrsts_mem_on = { 986e01478aSPaul Walmsley [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */ 996e01478aSPaul Walmsley [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */ 1006e01478aSPaul Walmsley }, 1016e01478aSPaul Walmsley }; 1026e01478aSPaul Walmsley 1036e01478aSPaul Walmsley static struct powerdomain core_3xxx_es3_1_pwrdm = { 1046e01478aSPaul Walmsley .name = "core_pwrdm", 1056e01478aSPaul Walmsley .prcm_offs = CORE_MOD, 1066e01478aSPaul Walmsley .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES3_1 | 1076e01478aSPaul Walmsley CHIP_GE_OMAP3630ES1_1), 1086e01478aSPaul Walmsley .pwrsts = PWRSTS_OFF_RET_ON, 1096e01478aSPaul Walmsley .pwrsts_logic_ret = PWRSTS_OFF_RET, 1106e01478aSPaul Walmsley /* 1116e01478aSPaul Walmsley * Setting the SAR flag for errata ID i478 which applies 1126e01478aSPaul Walmsley * to 3430 <= ES3.1 1136e01478aSPaul Walmsley */ 1146e01478aSPaul Walmsley .flags = PWRDM_HAS_HDWR_SAR, /* for USBTLL only */ 1156e01478aSPaul Walmsley .banks = 2, 1166e01478aSPaul Walmsley .pwrsts_mem_ret = { 1176e01478aSPaul Walmsley [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */ 1186e01478aSPaul Walmsley [1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */ 1196e01478aSPaul Walmsley }, 1206e01478aSPaul Walmsley .pwrsts_mem_on = { 1216e01478aSPaul Walmsley [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */ 1226e01478aSPaul Walmsley [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */ 1236e01478aSPaul Walmsley }, 1246e01478aSPaul Walmsley }; 1256e01478aSPaul Walmsley 1266e01478aSPaul Walmsley static struct powerdomain dss_pwrdm = { 1276e01478aSPaul Walmsley .name = "dss_pwrdm", 1286e01478aSPaul Walmsley .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 1296e01478aSPaul Walmsley .prcm_offs = OMAP3430_DSS_MOD, 1306e01478aSPaul Walmsley .pwrsts = PWRSTS_OFF_RET_ON, 1316e01478aSPaul Walmsley .pwrsts_logic_ret = PWRDM_POWER_RET, 1326e01478aSPaul Walmsley .banks = 1, 1336e01478aSPaul Walmsley .pwrsts_mem_ret = { 1346e01478aSPaul Walmsley [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 1356e01478aSPaul Walmsley }, 1366e01478aSPaul Walmsley .pwrsts_mem_on = { 1376e01478aSPaul Walmsley [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 1386e01478aSPaul Walmsley }, 1396e01478aSPaul Walmsley }; 1406e01478aSPaul Walmsley 1416e01478aSPaul Walmsley /* 1426e01478aSPaul Walmsley * Although the 34XX TRM Rev K Table 4-371 notes that retention is a 1436e01478aSPaul Walmsley * possible SGX powerstate, the SGX device itself does not support 1446e01478aSPaul Walmsley * retention. 1456e01478aSPaul Walmsley */ 1466e01478aSPaul Walmsley static struct powerdomain sgx_pwrdm = { 1476e01478aSPaul Walmsley .name = "sgx_pwrdm", 1486e01478aSPaul Walmsley .prcm_offs = OMAP3430ES2_SGX_MOD, 1496e01478aSPaul Walmsley .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), 1506e01478aSPaul Walmsley /* XXX This is accurate for 3430 SGX, but what about GFX? */ 1516e01478aSPaul Walmsley .pwrsts = PWRSTS_OFF_ON, 1526e01478aSPaul Walmsley .pwrsts_logic_ret = PWRDM_POWER_RET, 1536e01478aSPaul Walmsley .banks = 1, 1546e01478aSPaul Walmsley .pwrsts_mem_ret = { 1556e01478aSPaul Walmsley [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 1566e01478aSPaul Walmsley }, 1576e01478aSPaul Walmsley .pwrsts_mem_on = { 1586e01478aSPaul Walmsley [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 1596e01478aSPaul Walmsley }, 1606e01478aSPaul Walmsley }; 1616e01478aSPaul Walmsley 1626e01478aSPaul Walmsley static struct powerdomain cam_pwrdm = { 1636e01478aSPaul Walmsley .name = "cam_pwrdm", 1646e01478aSPaul Walmsley .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 1656e01478aSPaul Walmsley .prcm_offs = OMAP3430_CAM_MOD, 1666e01478aSPaul Walmsley .pwrsts = PWRSTS_OFF_RET_ON, 1676e01478aSPaul Walmsley .pwrsts_logic_ret = PWRDM_POWER_RET, 1686e01478aSPaul Walmsley .banks = 1, 1696e01478aSPaul Walmsley .pwrsts_mem_ret = { 1706e01478aSPaul Walmsley [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 1716e01478aSPaul Walmsley }, 1726e01478aSPaul Walmsley .pwrsts_mem_on = { 1736e01478aSPaul Walmsley [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 1746e01478aSPaul Walmsley }, 1756e01478aSPaul Walmsley }; 1766e01478aSPaul Walmsley 1776e01478aSPaul Walmsley static struct powerdomain per_pwrdm = { 1786e01478aSPaul Walmsley .name = "per_pwrdm", 1796e01478aSPaul Walmsley .prcm_offs = OMAP3430_PER_MOD, 1806e01478aSPaul Walmsley .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 1816e01478aSPaul Walmsley .pwrsts = PWRSTS_OFF_RET_ON, 1826e01478aSPaul Walmsley .pwrsts_logic_ret = PWRSTS_OFF_RET, 1836e01478aSPaul Walmsley .banks = 1, 1846e01478aSPaul Walmsley .pwrsts_mem_ret = { 1856e01478aSPaul Walmsley [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 1866e01478aSPaul Walmsley }, 1876e01478aSPaul Walmsley .pwrsts_mem_on = { 1886e01478aSPaul Walmsley [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 1896e01478aSPaul Walmsley }, 1906e01478aSPaul Walmsley }; 1916e01478aSPaul Walmsley 1926e01478aSPaul Walmsley static struct powerdomain emu_pwrdm = { 1936e01478aSPaul Walmsley .name = "emu_pwrdm", 1946e01478aSPaul Walmsley .prcm_offs = OMAP3430_EMU_MOD, 1956e01478aSPaul Walmsley .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 1966e01478aSPaul Walmsley }; 1976e01478aSPaul Walmsley 1986e01478aSPaul Walmsley static struct powerdomain neon_pwrdm = { 1996e01478aSPaul Walmsley .name = "neon_pwrdm", 2006e01478aSPaul Walmsley .prcm_offs = OMAP3430_NEON_MOD, 2016e01478aSPaul Walmsley .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 2026e01478aSPaul Walmsley .pwrsts = PWRSTS_OFF_RET_ON, 2036e01478aSPaul Walmsley .pwrsts_logic_ret = PWRDM_POWER_RET, 2046e01478aSPaul Walmsley }; 2056e01478aSPaul Walmsley 2066e01478aSPaul Walmsley static struct powerdomain usbhost_pwrdm = { 2076e01478aSPaul Walmsley .name = "usbhost_pwrdm", 2086e01478aSPaul Walmsley .prcm_offs = OMAP3430ES2_USBHOST_MOD, 2096e01478aSPaul Walmsley .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), 2106e01478aSPaul Walmsley .pwrsts = PWRSTS_OFF_RET_ON, 2116e01478aSPaul Walmsley .pwrsts_logic_ret = PWRDM_POWER_RET, 2126e01478aSPaul Walmsley /* 2136e01478aSPaul Walmsley * REVISIT: Enabling usb host save and restore mechanism seems to 2146e01478aSPaul Walmsley * leave the usb host domain permanently in ACTIVE mode after 2156e01478aSPaul Walmsley * changing the usb host power domain state from OFF to active once. 2166e01478aSPaul Walmsley * Disabling for now. 2176e01478aSPaul Walmsley */ 2186e01478aSPaul Walmsley /*.flags = PWRDM_HAS_HDWR_SAR,*/ /* for USBHOST ctrlr only */ 2196e01478aSPaul Walmsley .banks = 1, 2206e01478aSPaul Walmsley .pwrsts_mem_ret = { 2216e01478aSPaul Walmsley [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 2226e01478aSPaul Walmsley }, 2236e01478aSPaul Walmsley .pwrsts_mem_on = { 2246e01478aSPaul Walmsley [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 2256e01478aSPaul Walmsley }, 2266e01478aSPaul Walmsley }; 2276e01478aSPaul Walmsley 2286e01478aSPaul Walmsley static struct powerdomain dpll1_pwrdm = { 2296e01478aSPaul Walmsley .name = "dpll1_pwrdm", 2306e01478aSPaul Walmsley .prcm_offs = MPU_MOD, 2316e01478aSPaul Walmsley .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 2326e01478aSPaul Walmsley }; 2336e01478aSPaul Walmsley 2346e01478aSPaul Walmsley static struct powerdomain dpll2_pwrdm = { 2356e01478aSPaul Walmsley .name = "dpll2_pwrdm", 2366e01478aSPaul Walmsley .prcm_offs = OMAP3430_IVA2_MOD, 2376e01478aSPaul Walmsley .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 2386e01478aSPaul Walmsley }; 2396e01478aSPaul Walmsley 2406e01478aSPaul Walmsley static struct powerdomain dpll3_pwrdm = { 2416e01478aSPaul Walmsley .name = "dpll3_pwrdm", 2426e01478aSPaul Walmsley .prcm_offs = PLL_MOD, 2436e01478aSPaul Walmsley .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 2446e01478aSPaul Walmsley }; 2456e01478aSPaul Walmsley 2466e01478aSPaul Walmsley static struct powerdomain dpll4_pwrdm = { 2476e01478aSPaul Walmsley .name = "dpll4_pwrdm", 2486e01478aSPaul Walmsley .prcm_offs = PLL_MOD, 2496e01478aSPaul Walmsley .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 2506e01478aSPaul Walmsley }; 2516e01478aSPaul Walmsley 2526e01478aSPaul Walmsley static struct powerdomain dpll5_pwrdm = { 2536e01478aSPaul Walmsley .name = "dpll5_pwrdm", 2546e01478aSPaul Walmsley .prcm_offs = PLL_MOD, 2556e01478aSPaul Walmsley .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), 2566e01478aSPaul Walmsley }; 2576e01478aSPaul Walmsley 2586e01478aSPaul Walmsley /* As powerdomains are added or removed above, this list must also be changed */ 2596e01478aSPaul Walmsley static struct powerdomain *powerdomains_omap3xxx[] __initdata = { 2606e01478aSPaul Walmsley 2616e01478aSPaul Walmsley &wkup_omap2_pwrdm, 2626e01478aSPaul Walmsley &gfx_omap2_pwrdm, 2636e01478aSPaul Walmsley &iva2_pwrdm, 2646e01478aSPaul Walmsley &mpu_3xxx_pwrdm, 2656e01478aSPaul Walmsley &neon_pwrdm, 2666e01478aSPaul Walmsley &core_3xxx_pre_es3_1_pwrdm, 2676e01478aSPaul Walmsley &core_3xxx_es3_1_pwrdm, 2686e01478aSPaul Walmsley &cam_pwrdm, 2696e01478aSPaul Walmsley &dss_pwrdm, 2706e01478aSPaul Walmsley &per_pwrdm, 2716e01478aSPaul Walmsley &emu_pwrdm, 2726e01478aSPaul Walmsley &sgx_pwrdm, 2736e01478aSPaul Walmsley &usbhost_pwrdm, 2746e01478aSPaul Walmsley &dpll1_pwrdm, 2756e01478aSPaul Walmsley &dpll2_pwrdm, 2766e01478aSPaul Walmsley &dpll3_pwrdm, 2776e01478aSPaul Walmsley &dpll4_pwrdm, 2786e01478aSPaul Walmsley &dpll5_pwrdm, 2796e01478aSPaul Walmsley #endif 2806e01478aSPaul Walmsley NULL 2816e01478aSPaul Walmsley }; 2826e01478aSPaul Walmsley 2836e01478aSPaul Walmsley 2846e01478aSPaul Walmsley void __init omap3xxx_powerdomains_init(void) 2856e01478aSPaul Walmsley { 2866e01478aSPaul Walmsley pwrdm_init(powerdomains_omap3xxx, &omap3_pwrdm_operations); 2876e01478aSPaul Walmsley } 288