2008-08-19 12:08:43 +04:00
|
|
|
/*
|
2010-01-27 06:13:13 +03:00
|
|
|
* OMAP3 powerdomain definitions
|
2008-08-19 12:08:43 +04:00
|
|
|
*
|
2011-09-14 21:34:21 +04:00
|
|
|
* Copyright (C) 2007-2008, 2011 Texas Instruments, Inc.
|
2011-03-08 05:28:15 +03:00
|
|
|
* Copyright (C) 2007-2011 Nokia Corporation
|
2008-08-19 12:08:43 +04:00
|
|
|
*
|
2010-12-22 06:01:20 +03:00
|
|
|
* Paul Walmsley, Jouni Högander
|
2008-08-19 12:08:43 +04:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
|
2010-12-22 06:01:20 +03:00
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/init.h>
|
2012-03-08 05:28:01 +04:00
|
|
|
#include <linux/bug.h>
|
2008-08-19 12:08:43 +04:00
|
|
|
|
2012-08-31 21:59:07 +04:00
|
|
|
#include "soc.h"
|
2010-12-22 07:05:16 +03:00
|
|
|
#include "powerdomain.h"
|
2010-12-22 06:01:20 +03:00
|
|
|
#include "powerdomains2xxx_3xxx_data.h"
|
2008-08-19 12:08:43 +04:00
|
|
|
#include "prcm-common.h"
|
2010-12-22 01:30:55 +03:00
|
|
|
#include "prm2xxx_3xxx.h"
|
2008-08-19 12:08:43 +04:00
|
|
|
#include "prm-regbits-34xx.h"
|
2010-12-22 01:30:55 +03:00
|
|
|
#include "cm2xxx_3xxx.h"
|
2008-08-19 12:08:43 +04:00
|
|
|
#include "cm-regbits-34xx.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 34XX-specific powerdomains, dependencies
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Powerdomains
|
|
|
|
*/
|
|
|
|
|
|
|
|
static struct powerdomain iva2_pwrdm = {
|
|
|
|
.name = "iva2_pwrdm",
|
|
|
|
.prcm_offs = OMAP3430_IVA2_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_RET_ON,
|
|
|
|
.pwrsts_logic_ret = PWRSTS_OFF_RET,
|
|
|
|
.banks = 4,
|
|
|
|
.pwrsts_mem_ret = {
|
|
|
|
[0] = PWRSTS_OFF_RET,
|
|
|
|
[1] = PWRSTS_OFF_RET,
|
|
|
|
[2] = PWRSTS_OFF_RET,
|
|
|
|
[3] = PWRSTS_OFF_RET,
|
|
|
|
},
|
|
|
|
.pwrsts_mem_on = {
|
2011-03-08 05:28:15 +03:00
|
|
|
[0] = PWRSTS_ON,
|
|
|
|
[1] = PWRSTS_ON,
|
2008-08-19 12:08:43 +04:00
|
|
|
[2] = PWRSTS_OFF_ON,
|
2011-03-08 05:28:15 +03:00
|
|
|
[3] = PWRSTS_ON,
|
2008-08-19 12:08:43 +04:00
|
|
|
},
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "mpu_iva" },
|
2008-08-19 12:08:43 +04:00
|
|
|
};
|
|
|
|
|
2010-01-27 06:13:13 +03:00
|
|
|
static struct powerdomain mpu_3xxx_pwrdm = {
|
2008-08-19 12:08:43 +04:00
|
|
|
.name = "mpu_pwrdm",
|
|
|
|
.prcm_offs = MPU_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_RET_ON,
|
|
|
|
.pwrsts_logic_ret = PWRSTS_OFF_RET,
|
2009-12-09 02:33:15 +03:00
|
|
|
.flags = PWRDM_HAS_MPU_QUIRK,
|
2008-08-19 12:08:43 +04:00
|
|
|
.banks = 1,
|
|
|
|
.pwrsts_mem_ret = {
|
|
|
|
[0] = PWRSTS_OFF_RET,
|
|
|
|
},
|
|
|
|
.pwrsts_mem_on = {
|
|
|
|
[0] = PWRSTS_OFF_ON,
|
|
|
|
},
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "mpu_iva" },
|
2008-08-19 12:08:43 +04:00
|
|
|
};
|
|
|
|
|
2012-06-28 04:43:59 +04:00
|
|
|
static struct powerdomain mpu_am35x_pwrdm = {
|
|
|
|
.name = "mpu_pwrdm",
|
|
|
|
.prcm_offs = MPU_MOD,
|
|
|
|
.pwrsts = PWRSTS_ON,
|
|
|
|
.pwrsts_logic_ret = PWRSTS_ON,
|
|
|
|
.flags = PWRDM_HAS_MPU_QUIRK,
|
|
|
|
.banks = 1,
|
|
|
|
.pwrsts_mem_ret = {
|
|
|
|
[0] = PWRSTS_ON,
|
|
|
|
},
|
|
|
|
.pwrsts_mem_on = {
|
|
|
|
[0] = PWRSTS_ON,
|
|
|
|
},
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "mpu_iva" },
|
2012-06-28 04:43:59 +04:00
|
|
|
};
|
|
|
|
|
2010-07-14 17:38:49 +04:00
|
|
|
/*
|
|
|
|
* The USBTLL Save-and-Restore mechanism is broken on
|
2011-03-31 05:57:33 +04:00
|
|
|
* 3430s up to ES3.0 and 3630ES1.0. Hence this feature
|
2010-07-14 17:38:49 +04:00
|
|
|
* needs to be disabled on these chips.
|
|
|
|
* Refer: 3430 errata ID i459 and 3630 errata ID i579
|
2010-11-17 20:52:11 +03:00
|
|
|
*
|
|
|
|
* Note: setting the SAR flag could help for errata ID i478
|
|
|
|
* which applies to 3430 <= ES3.1, but since the SAR feature
|
|
|
|
* is broken, do not use it.
|
2010-07-14 17:38:49 +04:00
|
|
|
*/
|
2010-01-27 06:13:13 +03:00
|
|
|
static struct powerdomain core_3xxx_pre_es3_1_pwrdm = {
|
2008-08-19 12:08:43 +04:00
|
|
|
.name = "core_pwrdm",
|
|
|
|
.prcm_offs = CORE_MOD,
|
2009-02-06 06:45:28 +03:00
|
|
|
.pwrsts = PWRSTS_OFF_RET_ON,
|
2010-02-24 22:05:50 +03:00
|
|
|
.pwrsts_logic_ret = PWRSTS_OFF_RET,
|
2009-02-06 06:45:28 +03:00
|
|
|
.banks = 2,
|
|
|
|
.pwrsts_mem_ret = {
|
|
|
|
[0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */
|
|
|
|
[1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */
|
|
|
|
},
|
|
|
|
.pwrsts_mem_on = {
|
|
|
|
[0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
|
|
|
|
[1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
|
|
|
|
},
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "core" },
|
2009-02-06 06:45:28 +03:00
|
|
|
};
|
|
|
|
|
2010-01-27 06:13:13 +03:00
|
|
|
static struct powerdomain core_3xxx_es3_1_pwrdm = {
|
2009-02-06 06:45:28 +03:00
|
|
|
.name = "core_pwrdm",
|
|
|
|
.prcm_offs = CORE_MOD,
|
2008-08-19 12:08:43 +04:00
|
|
|
.pwrsts = PWRSTS_OFF_RET_ON,
|
2010-02-24 22:05:50 +03:00
|
|
|
.pwrsts_logic_ret = PWRSTS_OFF_RET,
|
2010-11-17 20:52:11 +03:00
|
|
|
/*
|
|
|
|
* Setting the SAR flag for errata ID i478 which applies
|
|
|
|
* to 3430 <= ES3.1
|
|
|
|
*/
|
2009-02-06 06:45:28 +03:00
|
|
|
.flags = PWRDM_HAS_HDWR_SAR, /* for USBTLL only */
|
2008-08-19 12:08:43 +04:00
|
|
|
.banks = 2,
|
|
|
|
.pwrsts_mem_ret = {
|
|
|
|
[0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */
|
|
|
|
[1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */
|
|
|
|
},
|
|
|
|
.pwrsts_mem_on = {
|
|
|
|
[0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
|
|
|
|
[1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
|
|
|
|
},
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "core" },
|
2008-08-19 12:08:43 +04:00
|
|
|
};
|
|
|
|
|
2012-06-28 04:43:59 +04:00
|
|
|
static struct powerdomain core_am35x_pwrdm = {
|
|
|
|
.name = "core_pwrdm",
|
|
|
|
.prcm_offs = CORE_MOD,
|
|
|
|
.pwrsts = PWRSTS_ON,
|
|
|
|
.pwrsts_logic_ret = PWRSTS_ON,
|
|
|
|
.banks = 2,
|
|
|
|
.pwrsts_mem_ret = {
|
|
|
|
[0] = PWRSTS_ON, /* MEM1RETSTATE */
|
|
|
|
[1] = PWRSTS_ON, /* MEM2RETSTATE */
|
|
|
|
},
|
|
|
|
.pwrsts_mem_on = {
|
|
|
|
[0] = PWRSTS_ON, /* MEM1ONSTATE */
|
|
|
|
[1] = PWRSTS_ON, /* MEM2ONSTATE */
|
|
|
|
},
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "core" },
|
2012-06-28 04:43:59 +04:00
|
|
|
};
|
|
|
|
|
2008-08-19 12:08:43 +04:00
|
|
|
static struct powerdomain dss_pwrdm = {
|
|
|
|
.name = "dss_pwrdm",
|
|
|
|
.prcm_offs = OMAP3430_DSS_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_RET_ON,
|
2011-03-08 05:28:15 +03:00
|
|
|
.pwrsts_logic_ret = PWRSTS_RET,
|
2008-08-19 12:08:43 +04:00
|
|
|
.banks = 1,
|
|
|
|
.pwrsts_mem_ret = {
|
2011-03-08 05:28:15 +03:00
|
|
|
[0] = PWRSTS_RET, /* MEMRETSTATE */
|
2008-08-19 12:08:43 +04:00
|
|
|
},
|
|
|
|
.pwrsts_mem_on = {
|
2011-03-08 05:28:15 +03:00
|
|
|
[0] = PWRSTS_ON, /* MEMONSTATE */
|
2008-08-19 12:08:43 +04:00
|
|
|
},
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "core" },
|
2008-08-19 12:08:43 +04:00
|
|
|
};
|
|
|
|
|
2012-06-28 04:43:59 +04:00
|
|
|
static struct powerdomain dss_am35x_pwrdm = {
|
|
|
|
.name = "dss_pwrdm",
|
|
|
|
.prcm_offs = OMAP3430_DSS_MOD,
|
|
|
|
.pwrsts = PWRSTS_ON,
|
|
|
|
.pwrsts_logic_ret = PWRSTS_ON,
|
|
|
|
.banks = 1,
|
|
|
|
.pwrsts_mem_ret = {
|
|
|
|
[0] = PWRSTS_ON, /* MEMRETSTATE */
|
|
|
|
},
|
|
|
|
.pwrsts_mem_on = {
|
|
|
|
[0] = PWRSTS_ON, /* MEMONSTATE */
|
|
|
|
},
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "core" },
|
2012-06-28 04:43:59 +04:00
|
|
|
};
|
|
|
|
|
2009-01-28 05:44:28 +03:00
|
|
|
/*
|
|
|
|
* Although the 34XX TRM Rev K Table 4-371 notes that retention is a
|
|
|
|
* possible SGX powerstate, the SGX device itself does not support
|
|
|
|
* retention.
|
|
|
|
*/
|
2008-08-19 12:08:43 +04:00
|
|
|
static struct powerdomain sgx_pwrdm = {
|
|
|
|
.name = "sgx_pwrdm",
|
|
|
|
.prcm_offs = OMAP3430ES2_SGX_MOD,
|
|
|
|
/* XXX This is accurate for 3430 SGX, but what about GFX? */
|
2009-01-28 05:44:28 +03:00
|
|
|
.pwrsts = PWRSTS_OFF_ON,
|
2011-03-08 05:28:15 +03:00
|
|
|
.pwrsts_logic_ret = PWRSTS_RET,
|
2008-08-19 12:08:43 +04:00
|
|
|
.banks = 1,
|
|
|
|
.pwrsts_mem_ret = {
|
2011-03-08 05:28:15 +03:00
|
|
|
[0] = PWRSTS_RET, /* MEMRETSTATE */
|
2008-08-19 12:08:43 +04:00
|
|
|
},
|
|
|
|
.pwrsts_mem_on = {
|
2011-03-08 05:28:15 +03:00
|
|
|
[0] = PWRSTS_ON, /* MEMONSTATE */
|
2008-08-19 12:08:43 +04:00
|
|
|
},
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "core" },
|
2008-08-19 12:08:43 +04:00
|
|
|
};
|
|
|
|
|
2012-06-28 04:43:59 +04:00
|
|
|
static struct powerdomain sgx_am35x_pwrdm = {
|
|
|
|
.name = "sgx_pwrdm",
|
|
|
|
.prcm_offs = OMAP3430ES2_SGX_MOD,
|
|
|
|
.pwrsts = PWRSTS_ON,
|
|
|
|
.pwrsts_logic_ret = PWRSTS_ON,
|
|
|
|
.banks = 1,
|
|
|
|
.pwrsts_mem_ret = {
|
|
|
|
[0] = PWRSTS_ON, /* MEMRETSTATE */
|
|
|
|
},
|
|
|
|
.pwrsts_mem_on = {
|
|
|
|
[0] = PWRSTS_ON, /* MEMONSTATE */
|
|
|
|
},
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "core" },
|
2012-06-28 04:43:59 +04:00
|
|
|
};
|
|
|
|
|
2008-08-19 12:08:43 +04:00
|
|
|
static struct powerdomain cam_pwrdm = {
|
|
|
|
.name = "cam_pwrdm",
|
|
|
|
.prcm_offs = OMAP3430_CAM_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_RET_ON,
|
2011-03-08 05:28:15 +03:00
|
|
|
.pwrsts_logic_ret = PWRSTS_RET,
|
2008-08-19 12:08:43 +04:00
|
|
|
.banks = 1,
|
|
|
|
.pwrsts_mem_ret = {
|
2011-03-08 05:28:15 +03:00
|
|
|
[0] = PWRSTS_RET, /* MEMRETSTATE */
|
2008-08-19 12:08:43 +04:00
|
|
|
},
|
|
|
|
.pwrsts_mem_on = {
|
2011-03-08 05:28:15 +03:00
|
|
|
[0] = PWRSTS_ON, /* MEMONSTATE */
|
2008-08-19 12:08:43 +04:00
|
|
|
},
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "core" },
|
2008-08-19 12:08:43 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct powerdomain per_pwrdm = {
|
|
|
|
.name = "per_pwrdm",
|
|
|
|
.prcm_offs = OMAP3430_PER_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_RET_ON,
|
|
|
|
.pwrsts_logic_ret = PWRSTS_OFF_RET,
|
|
|
|
.banks = 1,
|
|
|
|
.pwrsts_mem_ret = {
|
2011-03-08 05:28:15 +03:00
|
|
|
[0] = PWRSTS_RET, /* MEMRETSTATE */
|
2008-08-19 12:08:43 +04:00
|
|
|
},
|
|
|
|
.pwrsts_mem_on = {
|
2011-03-08 05:28:15 +03:00
|
|
|
[0] = PWRSTS_ON, /* MEMONSTATE */
|
2008-08-19 12:08:43 +04:00
|
|
|
},
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "core" },
|
2008-08-19 12:08:43 +04:00
|
|
|
};
|
|
|
|
|
2012-06-28 04:43:59 +04:00
|
|
|
static struct powerdomain per_am35x_pwrdm = {
|
|
|
|
.name = "per_pwrdm",
|
|
|
|
.prcm_offs = OMAP3430_PER_MOD,
|
|
|
|
.pwrsts = PWRSTS_ON,
|
|
|
|
.pwrsts_logic_ret = PWRSTS_ON,
|
|
|
|
.banks = 1,
|
|
|
|
.pwrsts_mem_ret = {
|
|
|
|
[0] = PWRSTS_ON, /* MEMRETSTATE */
|
|
|
|
},
|
|
|
|
.pwrsts_mem_on = {
|
|
|
|
[0] = PWRSTS_ON, /* MEMONSTATE */
|
|
|
|
},
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "core" },
|
2012-06-28 04:43:59 +04:00
|
|
|
};
|
|
|
|
|
2008-08-19 12:08:43 +04:00
|
|
|
static struct powerdomain emu_pwrdm = {
|
|
|
|
.name = "emu_pwrdm",
|
|
|
|
.prcm_offs = OMAP3430_EMU_MOD,
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "core" },
|
2008-08-19 12:08:43 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct powerdomain neon_pwrdm = {
|
|
|
|
.name = "neon_pwrdm",
|
|
|
|
.prcm_offs = OMAP3430_NEON_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_RET_ON,
|
2011-03-08 05:28:15 +03:00
|
|
|
.pwrsts_logic_ret = PWRSTS_RET,
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "mpu_iva" },
|
2008-08-19 12:08:43 +04:00
|
|
|
};
|
|
|
|
|
2012-06-28 04:43:59 +04:00
|
|
|
static struct powerdomain neon_am35x_pwrdm = {
|
|
|
|
.name = "neon_pwrdm",
|
|
|
|
.prcm_offs = OMAP3430_NEON_MOD,
|
|
|
|
.pwrsts = PWRSTS_ON,
|
|
|
|
.pwrsts_logic_ret = PWRSTS_ON,
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "mpu_iva" },
|
2012-06-28 04:43:59 +04:00
|
|
|
};
|
|
|
|
|
2008-08-19 12:08:43 +04:00
|
|
|
static struct powerdomain usbhost_pwrdm = {
|
|
|
|
.name = "usbhost_pwrdm",
|
|
|
|
.prcm_offs = OMAP3430ES2_USBHOST_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_RET_ON,
|
2011-03-08 05:28:15 +03:00
|
|
|
.pwrsts_logic_ret = PWRSTS_RET,
|
2009-04-23 14:58:51 +04:00
|
|
|
/*
|
|
|
|
* REVISIT: Enabling usb host save and restore mechanism seems to
|
|
|
|
* leave the usb host domain permanently in ACTIVE mode after
|
|
|
|
* changing the usb host power domain state from OFF to active once.
|
|
|
|
* Disabling for now.
|
|
|
|
*/
|
|
|
|
/*.flags = PWRDM_HAS_HDWR_SAR,*/ /* for USBHOST ctrlr only */
|
2008-08-19 12:08:43 +04:00
|
|
|
.banks = 1,
|
|
|
|
.pwrsts_mem_ret = {
|
2011-03-08 05:28:15 +03:00
|
|
|
[0] = PWRSTS_RET, /* MEMRETSTATE */
|
2008-08-19 12:08:43 +04:00
|
|
|
},
|
|
|
|
.pwrsts_mem_on = {
|
2011-03-08 05:28:15 +03:00
|
|
|
[0] = PWRSTS_ON, /* MEMONSTATE */
|
2008-08-19 12:08:43 +04:00
|
|
|
},
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "core" },
|
2008-08-19 12:08:43 +04:00
|
|
|
};
|
|
|
|
|
2009-01-28 05:44:18 +03:00
|
|
|
static struct powerdomain dpll1_pwrdm = {
|
|
|
|
.name = "dpll1_pwrdm",
|
|
|
|
.prcm_offs = MPU_MOD,
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "mpu_iva" },
|
2009-01-28 05:44:18 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct powerdomain dpll2_pwrdm = {
|
|
|
|
.name = "dpll2_pwrdm",
|
|
|
|
.prcm_offs = OMAP3430_IVA2_MOD,
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "mpu_iva" },
|
2009-01-28 05:44:18 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct powerdomain dpll3_pwrdm = {
|
|
|
|
.name = "dpll3_pwrdm",
|
|
|
|
.prcm_offs = PLL_MOD,
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "core" },
|
2009-01-28 05:44:18 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct powerdomain dpll4_pwrdm = {
|
|
|
|
.name = "dpll4_pwrdm",
|
|
|
|
.prcm_offs = PLL_MOD,
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "core" },
|
2009-01-28 05:44:18 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct powerdomain dpll5_pwrdm = {
|
|
|
|
.name = "dpll5_pwrdm",
|
|
|
|
.prcm_offs = PLL_MOD,
|
2013-01-26 11:58:17 +04:00
|
|
|
.voltdm = { .name = "core" },
|
2009-01-28 05:44:18 +03:00
|
|
|
};
|
|
|
|
|
2013-08-23 14:48:42 +04:00
|
|
|
static struct powerdomain alwon_81xx_pwrdm = {
|
|
|
|
.name = "alwon_pwrdm",
|
|
|
|
.prcm_offs = TI81XX_PRM_ALWON_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_ON,
|
|
|
|
.voltdm = { .name = "core" },
|
|
|
|
};
|
|
|
|
|
2013-05-30 19:04:50 +04:00
|
|
|
static struct powerdomain device_81xx_pwrdm = {
|
|
|
|
.name = "device_pwrdm",
|
|
|
|
.prcm_offs = TI81XX_PRM_DEVICE_MOD,
|
|
|
|
.voltdm = { .name = "core" },
|
|
|
|
};
|
|
|
|
|
2015-07-16 11:55:57 +03:00
|
|
|
static struct powerdomain gem_814x_pwrdm = {
|
|
|
|
.name = "gem_pwrdm",
|
|
|
|
.prcm_offs = TI814X_PRM_DSP_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_ON,
|
|
|
|
.voltdm = { .name = "dsp" },
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct powerdomain ivahd_814x_pwrdm = {
|
|
|
|
.name = "ivahd_pwrdm",
|
|
|
|
.prcm_offs = TI814X_PRM_HDVICP_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_ON,
|
|
|
|
.voltdm = { .name = "iva" },
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct powerdomain hdvpss_814x_pwrdm = {
|
|
|
|
.name = "hdvpss_pwrdm",
|
|
|
|
.prcm_offs = TI814X_PRM_HDVPSS_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_ON,
|
|
|
|
.voltdm = { .name = "dsp" },
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct powerdomain sgx_814x_pwrdm = {
|
|
|
|
.name = "sgx_pwrdm",
|
|
|
|
.prcm_offs = TI814X_PRM_GFX_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_ON,
|
|
|
|
.voltdm = { .name = "core" },
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct powerdomain isp_814x_pwrdm = {
|
|
|
|
.name = "isp_pwrdm",
|
|
|
|
.prcm_offs = TI814X_PRM_ISP_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_ON,
|
|
|
|
.voltdm = { .name = "core" },
|
|
|
|
};
|
|
|
|
|
2015-12-23 02:39:52 +03:00
|
|
|
static struct powerdomain active_81xx_pwrdm = {
|
2013-05-30 19:04:50 +04:00
|
|
|
.name = "active_pwrdm",
|
|
|
|
.prcm_offs = TI816X_PRM_ACTIVE_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_ON,
|
|
|
|
.voltdm = { .name = "core" },
|
|
|
|
};
|
|
|
|
|
2015-12-23 02:39:52 +03:00
|
|
|
static struct powerdomain default_81xx_pwrdm = {
|
2013-05-30 19:04:50 +04:00
|
|
|
.name = "default_pwrdm",
|
|
|
|
.prcm_offs = TI81XX_PRM_DEFAULT_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_ON,
|
|
|
|
.voltdm = { .name = "core" },
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct powerdomain ivahd0_816x_pwrdm = {
|
|
|
|
.name = "ivahd0_pwrdm",
|
|
|
|
.prcm_offs = TI816X_PRM_IVAHD0_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_ON,
|
|
|
|
.voltdm = { .name = "mpu_iva" },
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct powerdomain ivahd1_816x_pwrdm = {
|
|
|
|
.name = "ivahd1_pwrdm",
|
|
|
|
.prcm_offs = TI816X_PRM_IVAHD1_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_ON,
|
|
|
|
.voltdm = { .name = "mpu_iva" },
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct powerdomain ivahd2_816x_pwrdm = {
|
|
|
|
.name = "ivahd2_pwrdm",
|
|
|
|
.prcm_offs = TI816X_PRM_IVAHD2_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_ON,
|
|
|
|
.voltdm = { .name = "mpu_iva" },
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct powerdomain sgx_816x_pwrdm = {
|
|
|
|
.name = "sgx_pwrdm",
|
|
|
|
.prcm_offs = TI816X_PRM_SGX_MOD,
|
|
|
|
.pwrsts = PWRSTS_OFF_ON,
|
|
|
|
.voltdm = { .name = "core" },
|
|
|
|
};
|
|
|
|
|
2010-12-22 06:01:20 +03:00
|
|
|
/* As powerdomains are added or removed above, this list must also be changed */
|
2011-09-14 21:34:21 +04:00
|
|
|
static struct powerdomain *powerdomains_omap3430_common[] __initdata = {
|
2010-12-22 06:01:20 +03:00
|
|
|
&wkup_omap2_pwrdm,
|
|
|
|
&iva2_pwrdm,
|
|
|
|
&mpu_3xxx_pwrdm,
|
|
|
|
&neon_pwrdm,
|
|
|
|
&cam_pwrdm,
|
|
|
|
&dss_pwrdm,
|
|
|
|
&per_pwrdm,
|
|
|
|
&emu_pwrdm,
|
|
|
|
&dpll1_pwrdm,
|
|
|
|
&dpll2_pwrdm,
|
|
|
|
&dpll3_pwrdm,
|
|
|
|
&dpll4_pwrdm,
|
2011-09-14 21:34:21 +04:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct powerdomain *powerdomains_omap3430es1[] __initdata = {
|
|
|
|
&gfx_omap2_pwrdm,
|
|
|
|
&core_3xxx_pre_es3_1_pwrdm,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
/* also includes 3630ES1.0 */
|
|
|
|
static struct powerdomain *powerdomains_omap3430es2_es3_0[] __initdata = {
|
|
|
|
&core_3xxx_pre_es3_1_pwrdm,
|
|
|
|
&sgx_pwrdm,
|
|
|
|
&usbhost_pwrdm,
|
2010-12-22 06:01:20 +03:00
|
|
|
&dpll5_pwrdm,
|
|
|
|
NULL
|
|
|
|
};
|
2008-08-19 12:08:43 +04:00
|
|
|
|
2011-09-14 21:34:21 +04:00
|
|
|
/* also includes 3630ES1.1+ */
|
|
|
|
static struct powerdomain *powerdomains_omap3430es3_1plus[] __initdata = {
|
|
|
|
&core_3xxx_es3_1_pwrdm,
|
|
|
|
&sgx_pwrdm,
|
|
|
|
&usbhost_pwrdm,
|
|
|
|
&dpll5_pwrdm,
|
|
|
|
NULL
|
|
|
|
};
|
2008-08-19 12:08:43 +04:00
|
|
|
|
2012-06-28 04:43:59 +04:00
|
|
|
static struct powerdomain *powerdomains_am35x[] __initdata = {
|
|
|
|
&wkup_omap2_pwrdm,
|
|
|
|
&mpu_am35x_pwrdm,
|
|
|
|
&neon_am35x_pwrdm,
|
|
|
|
&core_am35x_pwrdm,
|
|
|
|
&sgx_am35x_pwrdm,
|
|
|
|
&dss_am35x_pwrdm,
|
|
|
|
&per_am35x_pwrdm,
|
|
|
|
&emu_pwrdm,
|
|
|
|
&dpll1_pwrdm,
|
|
|
|
&dpll3_pwrdm,
|
|
|
|
&dpll4_pwrdm,
|
|
|
|
&dpll5_pwrdm,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2015-07-16 11:55:57 +03:00
|
|
|
static struct powerdomain *powerdomains_ti814x[] __initdata = {
|
|
|
|
&alwon_81xx_pwrdm,
|
|
|
|
&device_81xx_pwrdm,
|
2015-12-23 02:39:52 +03:00
|
|
|
&active_81xx_pwrdm,
|
|
|
|
&default_81xx_pwrdm,
|
2015-07-16 11:55:57 +03:00
|
|
|
&gem_814x_pwrdm,
|
|
|
|
&ivahd_814x_pwrdm,
|
|
|
|
&hdvpss_814x_pwrdm,
|
|
|
|
&sgx_814x_pwrdm,
|
|
|
|
&isp_814x_pwrdm,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct powerdomain *powerdomains_ti816x[] __initdata = {
|
2013-08-23 14:48:42 +04:00
|
|
|
&alwon_81xx_pwrdm,
|
2013-05-30 19:04:50 +04:00
|
|
|
&device_81xx_pwrdm,
|
2015-12-23 02:39:52 +03:00
|
|
|
&active_81xx_pwrdm,
|
|
|
|
&default_81xx_pwrdm,
|
2013-05-30 19:04:50 +04:00
|
|
|
&ivahd0_816x_pwrdm,
|
|
|
|
&ivahd1_816x_pwrdm,
|
|
|
|
&ivahd2_816x_pwrdm,
|
|
|
|
&sgx_816x_pwrdm,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2015-07-16 11:55:57 +03:00
|
|
|
/* TI81XX specific ops */
|
|
|
|
#define TI81XX_PM_PWSTCTRL 0x0000
|
|
|
|
#define TI81XX_RM_RSTCTRL 0x0010
|
|
|
|
#define TI81XX_PM_PWSTST 0x0004
|
|
|
|
|
|
|
|
static int ti81xx_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
|
|
|
|
{
|
|
|
|
omap2_prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK,
|
|
|
|
(pwrst << OMAP_POWERSTATE_SHIFT),
|
|
|
|
pwrdm->prcm_offs, TI81XX_PM_PWSTCTRL);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ti81xx_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
|
|
|
|
{
|
|
|
|
return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
|
|
|
|
TI81XX_PM_PWSTCTRL,
|
|
|
|
OMAP_POWERSTATE_MASK);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ti81xx_pwrdm_read_pwrst(struct powerdomain *pwrdm)
|
|
|
|
{
|
|
|
|
return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
|
|
|
|
(pwrdm->prcm_offs == TI814X_PRM_GFX_MOD) ? TI81XX_RM_RSTCTRL :
|
|
|
|
TI81XX_PM_PWSTST,
|
|
|
|
OMAP_POWERSTATEST_MASK);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ti81xx_pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
|
|
|
|
{
|
|
|
|
return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
|
|
|
|
(pwrdm->prcm_offs == TI814X_PRM_GFX_MOD) ? TI81XX_RM_RSTCTRL :
|
|
|
|
TI81XX_PM_PWSTST,
|
|
|
|
OMAP3430_LOGICSTATEST_MASK);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ti81xx_pwrdm_wait_transition(struct powerdomain *pwrdm)
|
|
|
|
{
|
|
|
|
u32 c = 0;
|
|
|
|
|
|
|
|
while ((omap2_prm_read_mod_reg(pwrdm->prcm_offs,
|
|
|
|
(pwrdm->prcm_offs == TI814X_PRM_GFX_MOD) ? TI81XX_RM_RSTCTRL :
|
|
|
|
TI81XX_PM_PWSTST) &
|
|
|
|
OMAP_INTRANSITION_MASK) &&
|
|
|
|
(c++ < PWRDM_TRANSITION_BAILOUT))
|
|
|
|
udelay(1);
|
|
|
|
|
|
|
|
if (c > PWRDM_TRANSITION_BAILOUT) {
|
|
|
|
pr_err("powerdomain: %s timeout waiting for transition\n",
|
|
|
|
pwrdm->name);
|
|
|
|
return -EAGAIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
pr_debug("powerdomain: completed transition in %d loops\n", c);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* For dm814x we need to fix up fix GFX pwstst and rstctrl reg offsets */
|
|
|
|
static struct pwrdm_ops ti81xx_pwrdm_operations = {
|
|
|
|
.pwrdm_set_next_pwrst = ti81xx_pwrdm_set_next_pwrst,
|
|
|
|
.pwrdm_read_next_pwrst = ti81xx_pwrdm_read_next_pwrst,
|
|
|
|
.pwrdm_read_pwrst = ti81xx_pwrdm_read_pwrst,
|
|
|
|
.pwrdm_read_logic_pwrst = ti81xx_pwrdm_read_logic_pwrst,
|
|
|
|
.pwrdm_wait_transition = ti81xx_pwrdm_wait_transition,
|
|
|
|
};
|
|
|
|
|
2010-12-22 06:01:20 +03:00
|
|
|
void __init omap3xxx_powerdomains_init(void)
|
|
|
|
{
|
2011-09-14 21:34:21 +04:00
|
|
|
unsigned int rev;
|
|
|
|
|
2015-01-15 04:37:16 +03:00
|
|
|
if (!cpu_is_omap34xx() && !cpu_is_ti81xx())
|
2011-09-14 21:34:21 +04:00
|
|
|
return;
|
|
|
|
|
2015-08-07 08:09:40 +03:00
|
|
|
/* Only 81xx needs custom pwrdm_operations */
|
|
|
|
if (!cpu_is_ti81xx())
|
2015-09-17 16:38:05 +03:00
|
|
|
pwrdm_register_platform_funcs(&omap3_pwrdm_operations);
|
2011-09-14 21:34:21 +04:00
|
|
|
|
|
|
|
rev = omap_rev();
|
|
|
|
|
2012-06-28 04:43:59 +04:00
|
|
|
if (rev == AM35XX_REV_ES1_0 || rev == AM35XX_REV_ES1_1) {
|
|
|
|
pwrdm_register_pwrdms(powerdomains_am35x);
|
2015-07-16 11:55:57 +03:00
|
|
|
} else if (rev == TI8148_REV_ES1_0 || rev == TI8148_REV_ES2_0 ||
|
|
|
|
rev == TI8148_REV_ES2_1) {
|
2015-08-07 08:09:40 +03:00
|
|
|
pwrdm_register_platform_funcs(&ti81xx_pwrdm_operations);
|
2015-07-16 11:55:57 +03:00
|
|
|
pwrdm_register_pwrdms(powerdomains_ti814x);
|
2013-05-30 19:04:50 +04:00
|
|
|
} else if (rev == TI8168_REV_ES1_0 || rev == TI8168_REV_ES1_1
|
|
|
|
|| rev == TI8168_REV_ES2_0 || rev == TI8168_REV_ES2_1) {
|
2015-08-07 08:09:40 +03:00
|
|
|
pwrdm_register_platform_funcs(&ti81xx_pwrdm_operations);
|
2015-07-16 11:55:57 +03:00
|
|
|
pwrdm_register_pwrdms(powerdomains_ti816x);
|
2012-06-28 04:43:59 +04:00
|
|
|
} else {
|
|
|
|
pwrdm_register_pwrdms(powerdomains_omap3430_common);
|
|
|
|
|
|
|
|
switch (rev) {
|
|
|
|
case OMAP3430_REV_ES1_0:
|
|
|
|
pwrdm_register_pwrdms(powerdomains_omap3430es1);
|
|
|
|
break;
|
|
|
|
case OMAP3430_REV_ES2_0:
|
|
|
|
case OMAP3430_REV_ES2_1:
|
|
|
|
case OMAP3430_REV_ES3_0:
|
|
|
|
case OMAP3630_REV_ES1_0:
|
|
|
|
pwrdm_register_pwrdms(powerdomains_omap3430es2_es3_0);
|
|
|
|
break;
|
|
|
|
case OMAP3430_REV_ES3_1:
|
|
|
|
case OMAP3430_REV_ES3_1_2:
|
|
|
|
case OMAP3630_REV_ES1_1:
|
|
|
|
case OMAP3630_REV_ES1_2:
|
|
|
|
pwrdm_register_pwrdms(powerdomains_omap3430es3_1plus);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
WARN(1, "OMAP3 powerdomain init: unknown chip type\n");
|
|
|
|
}
|
|
|
|
}
|
2011-09-14 21:34:21 +04:00
|
|
|
|
2011-09-15 02:01:21 +04:00
|
|
|
pwrdm_complete_init();
|
2010-12-22 06:01:20 +03:00
|
|
|
}
|