- use timeout helpers for scpsys and infracfg drivers
- use of_device_get_match_data in pmic wrapper and scpsys -----BEGIN PGP SIGNATURE----- iQJLBAABCAA1FiEEiUuSfQSYnG8EMsBltDliWyzx00MFAlr5Z60XHG1hdHRoaWFz LmJnZ0BnbWFpbC5jb20ACgkQtDliWyzx00OjERAAmo+w5WoZTxS3xkZsBGTiB5Ys CLBrdaUlx+vAVvgN4ZiCswIlbGKvA7SeSKt8hFA/0TJ0JwlKshNqwfCtG1vzqMy0 aSzSvU0nBKn00nHPW4regyjcqIiR3Q5dhGPQwGC8fSgh3+Ua26FJ3qQQIcMeNW5y IiSUHs7horUpMr7HuFWlxIkRVsPSqFondvva/WSzZ9WM5CQP8q19msTqLh0xPqY+ Qb+sc6D3Oe7hqR9RqS1hsXYwFI8IVAJ1Do+YGKzFrZvdU6O7GWjSCExWxgHbZUMi xqmf35+rzYCwNUtM99OUCXSFTvPSMiAkwZ5iUCj9MwnSwN6TUcFiOc+EZswT07DN PKh34B/Htj4ODEsXMYzojv2/f+cNXKvtIvfQFODavwTu6uGkvuvAL47DoFNakjWc /j1m442UUePLQ8fto95xaLqjBSU/nvKOLxDAjAOGBEFu+7mflKgWXspvUfbd9OXN sFFNI5LglHgaqd6uQgETiZ1QN8qTvCUT0519qnzHQVr/oHVUDLCFZfoxifnHzHjE w2pPJSJK6Yf+qbMp0UMDdsCr72siGLtJrqskxsfyzXW8ntfD3F55Vj/udwuxBcRV 5+T/Qb6e3+CDfystJS25jPi7c6W80754zPJ74hspM8V7eP7EkPDFhnBCCqKgCAbI 5fHHQFXKXOtxvQgCFdo= =4KAA -----END PGP SIGNATURE----- Merge tag 'v4.17-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into next/drivers - use timeout helpers for scpsys and infracfg drivers - use of_device_get_match_data in pmic wrapper and scpsys * tag 'v4.17-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: soc: mediatek: remove unneeded semicolon soc: mediatek: add a fixed wait for SRAM stable soc: mediatek: introduce a CAPS flag for scp_domain_data soc: mediatek: reuse regmap_read_poll_timeout helpers regmap: include <linux/ktime.h> from include/linux/regmap.h soc: mediatek: reuse read[l,x]_poll_timeout helpers soc: mediatek: use of_device_get_match_data() Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
commit
f6b3f4ac52
|
@ -17,6 +17,9 @@
|
|||
#include <linux/soc/mediatek/infracfg.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
#define MTK_POLL_DELAY_US 10
|
||||
#define MTK_POLL_TIMEOUT (jiffies_to_usecs(HZ))
|
||||
|
||||
#define INFRA_TOPAXI_PROTECTEN 0x0220
|
||||
#define INFRA_TOPAXI_PROTECTSTA1 0x0228
|
||||
#define INFRA_TOPAXI_PROTECTEN_SET 0x0260
|
||||
|
@ -37,7 +40,6 @@
|
|||
int mtk_infracfg_set_bus_protection(struct regmap *infracfg, u32 mask,
|
||||
bool reg_update)
|
||||
{
|
||||
unsigned long expired;
|
||||
u32 val;
|
||||
int ret;
|
||||
|
||||
|
@ -47,22 +49,11 @@ int mtk_infracfg_set_bus_protection(struct regmap *infracfg, u32 mask,
|
|||
else
|
||||
regmap_write(infracfg, INFRA_TOPAXI_PROTECTEN_SET, mask);
|
||||
|
||||
expired = jiffies + HZ;
|
||||
ret = regmap_read_poll_timeout(infracfg, INFRA_TOPAXI_PROTECTSTA1,
|
||||
val, (val & mask) == mask,
|
||||
MTK_POLL_DELAY_US, MTK_POLL_TIMEOUT);
|
||||
|
||||
while (1) {
|
||||
ret = regmap_read(infracfg, INFRA_TOPAXI_PROTECTSTA1, &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if ((val & mask) == mask)
|
||||
break;
|
||||
|
||||
cpu_relax();
|
||||
if (time_after(jiffies, expired))
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -80,30 +71,17 @@ int mtk_infracfg_set_bus_protection(struct regmap *infracfg, u32 mask,
|
|||
int mtk_infracfg_clear_bus_protection(struct regmap *infracfg, u32 mask,
|
||||
bool reg_update)
|
||||
{
|
||||
unsigned long expired;
|
||||
int ret;
|
||||
u32 val;
|
||||
|
||||
if (reg_update)
|
||||
regmap_update_bits(infracfg, INFRA_TOPAXI_PROTECTEN, mask, 0);
|
||||
else
|
||||
regmap_write(infracfg, INFRA_TOPAXI_PROTECTEN_CLR, mask);
|
||||
|
||||
expired = jiffies + HZ;
|
||||
ret = regmap_read_poll_timeout(infracfg, INFRA_TOPAXI_PROTECTSTA1,
|
||||
val, !(val & mask),
|
||||
MTK_POLL_DELAY_US, MTK_POLL_TIMEOUT);
|
||||
|
||||
while (1) {
|
||||
u32 val;
|
||||
|
||||
ret = regmap_read(infracfg, INFRA_TOPAXI_PROTECTSTA1, &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!(val & mask))
|
||||
break;
|
||||
|
||||
cpu_relax();
|
||||
if (time_after(jiffies, expired))
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -1458,19 +1458,12 @@ static int pwrap_probe(struct platform_device *pdev)
|
|||
int ret, irq;
|
||||
struct pmic_wrapper *wrp;
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
const struct of_device_id *of_id =
|
||||
of_match_device(of_pwrap_match_tbl, &pdev->dev);
|
||||
const struct of_device_id *of_slave_id = NULL;
|
||||
struct resource *res;
|
||||
|
||||
if (!of_id) {
|
||||
dev_err(&pdev->dev, "Error: No device match found\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
if (np->child)
|
||||
of_slave_id = of_match_node(of_slave_match_tbl, np->child);
|
||||
|
||||
if (pdev->dev.of_node->child)
|
||||
of_slave_id = of_match_node(of_slave_match_tbl,
|
||||
pdev->dev.of_node->child);
|
||||
if (!of_slave_id) {
|
||||
dev_dbg(&pdev->dev, "slave pmic should be defined in dts\n");
|
||||
return -EINVAL;
|
||||
|
@ -1482,7 +1475,7 @@ static int pwrap_probe(struct platform_device *pdev)
|
|||
|
||||
platform_set_drvdata(pdev, wrp);
|
||||
|
||||
wrp->master = of_id->data;
|
||||
wrp->master = of_device_get_match_data(&pdev->dev);
|
||||
wrp->slave = of_slave_id->data;
|
||||
wrp->dev = &pdev->dev;
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <linux/clk.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
@ -27,6 +28,13 @@
|
|||
#include <dt-bindings/power/mt7623a-power.h>
|
||||
#include <dt-bindings/power/mt8173-power.h>
|
||||
|
||||
#define MTK_POLL_DELAY_US 10
|
||||
#define MTK_POLL_TIMEOUT (jiffies_to_usecs(HZ))
|
||||
|
||||
#define MTK_SCPD_ACTIVE_WAKEUP BIT(0)
|
||||
#define MTK_SCPD_FWAIT_SRAM BIT(1)
|
||||
#define MTK_SCPD_CAPS(_scpd, _x) ((_scpd)->data->caps & (_x))
|
||||
|
||||
#define SPM_VDE_PWR_CON 0x0210
|
||||
#define SPM_MFG_PWR_CON 0x0214
|
||||
#define SPM_VEN_PWR_CON 0x0230
|
||||
|
@ -116,7 +124,7 @@ struct scp_domain_data {
|
|||
u32 sram_pdn_ack_bits;
|
||||
u32 bus_prot_mask;
|
||||
enum clk_id clk_id[MAX_CLKS];
|
||||
bool active_wakeup;
|
||||
u8 caps;
|
||||
};
|
||||
|
||||
struct scp;
|
||||
|
@ -184,12 +192,10 @@ static int scpsys_power_on(struct generic_pm_domain *genpd)
|
|||
{
|
||||
struct scp_domain *scpd = container_of(genpd, struct scp_domain, genpd);
|
||||
struct scp *scp = scpd->scp;
|
||||
unsigned long timeout;
|
||||
bool expired;
|
||||
void __iomem *ctl_addr = scp->base + scpd->data->ctl_offs;
|
||||
u32 sram_pdn_ack = scpd->data->sram_pdn_ack_bits;
|
||||
u32 pdn_ack = scpd->data->sram_pdn_ack_bits;
|
||||
u32 val;
|
||||
int ret;
|
||||
int ret, tmp;
|
||||
int i;
|
||||
|
||||
if (scpd->supply) {
|
||||
|
@ -215,23 +221,10 @@ static int scpsys_power_on(struct generic_pm_domain *genpd)
|
|||
writel(val, ctl_addr);
|
||||
|
||||
/* wait until PWR_ACK = 1 */
|
||||
timeout = jiffies + HZ;
|
||||
expired = false;
|
||||
while (1) {
|
||||
ret = scpsys_domain_is_on(scpd);
|
||||
if (ret > 0)
|
||||
break;
|
||||
|
||||
if (expired) {
|
||||
ret = -ETIMEDOUT;
|
||||
goto err_pwr_ack;
|
||||
}
|
||||
|
||||
cpu_relax();
|
||||
|
||||
if (time_after(jiffies, timeout))
|
||||
expired = true;
|
||||
}
|
||||
ret = readx_poll_timeout(scpsys_domain_is_on, scpd, tmp, tmp > 0,
|
||||
MTK_POLL_DELAY_US, MTK_POLL_TIMEOUT);
|
||||
if (ret < 0)
|
||||
goto err_pwr_ack;
|
||||
|
||||
val &= ~PWR_CLK_DIS_BIT;
|
||||
writel(val, ctl_addr);
|
||||
|
@ -245,20 +238,20 @@ static int scpsys_power_on(struct generic_pm_domain *genpd)
|
|||
val &= ~scpd->data->sram_pdn_bits;
|
||||
writel(val, ctl_addr);
|
||||
|
||||
/* wait until SRAM_PDN_ACK all 0 */
|
||||
timeout = jiffies + HZ;
|
||||
expired = false;
|
||||
while (sram_pdn_ack && (readl(ctl_addr) & sram_pdn_ack)) {
|
||||
/* Either wait until SRAM_PDN_ACK all 0 or have a force wait */
|
||||
if (MTK_SCPD_CAPS(scpd, MTK_SCPD_FWAIT_SRAM)) {
|
||||
/*
|
||||
* Currently, MTK_SCPD_FWAIT_SRAM is necessary only for
|
||||
* MT7622_POWER_DOMAIN_WB and thus just a trivial setup is
|
||||
* applied here.
|
||||
*/
|
||||
usleep_range(12000, 12100);
|
||||
|
||||
if (expired) {
|
||||
ret = -ETIMEDOUT;
|
||||
} else {
|
||||
ret = readl_poll_timeout(ctl_addr, tmp, (tmp & pdn_ack) == 0,
|
||||
MTK_POLL_DELAY_US, MTK_POLL_TIMEOUT);
|
||||
if (ret < 0)
|
||||
goto err_pwr_ack;
|
||||
}
|
||||
|
||||
cpu_relax();
|
||||
|
||||
if (time_after(jiffies, timeout))
|
||||
expired = true;
|
||||
}
|
||||
|
||||
if (scpd->data->bus_prot_mask) {
|
||||
|
@ -289,12 +282,10 @@ static int scpsys_power_off(struct generic_pm_domain *genpd)
|
|||
{
|
||||
struct scp_domain *scpd = container_of(genpd, struct scp_domain, genpd);
|
||||
struct scp *scp = scpd->scp;
|
||||
unsigned long timeout;
|
||||
bool expired;
|
||||
void __iomem *ctl_addr = scp->base + scpd->data->ctl_offs;
|
||||
u32 pdn_ack = scpd->data->sram_pdn_ack_bits;
|
||||
u32 val;
|
||||
int ret;
|
||||
int ret, tmp;
|
||||
int i;
|
||||
|
||||
if (scpd->data->bus_prot_mask) {
|
||||
|
@ -310,19 +301,10 @@ static int scpsys_power_off(struct generic_pm_domain *genpd)
|
|||
writel(val, ctl_addr);
|
||||
|
||||
/* wait until SRAM_PDN_ACK all 1 */
|
||||
timeout = jiffies + HZ;
|
||||
expired = false;
|
||||
while (pdn_ack && (readl(ctl_addr) & pdn_ack) != pdn_ack) {
|
||||
if (expired) {
|
||||
ret = -ETIMEDOUT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
cpu_relax();
|
||||
|
||||
if (time_after(jiffies, timeout))
|
||||
expired = true;
|
||||
}
|
||||
ret = readl_poll_timeout(ctl_addr, tmp, (tmp & pdn_ack) == pdn_ack,
|
||||
MTK_POLL_DELAY_US, MTK_POLL_TIMEOUT);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
|
||||
val |= PWR_ISO_BIT;
|
||||
writel(val, ctl_addr);
|
||||
|
@ -340,23 +322,10 @@ static int scpsys_power_off(struct generic_pm_domain *genpd)
|
|||
writel(val, ctl_addr);
|
||||
|
||||
/* wait until PWR_ACK = 0 */
|
||||
timeout = jiffies + HZ;
|
||||
expired = false;
|
||||
while (1) {
|
||||
ret = scpsys_domain_is_on(scpd);
|
||||
if (ret == 0)
|
||||
break;
|
||||
|
||||
if (expired) {
|
||||
ret = -ETIMEDOUT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
cpu_relax();
|
||||
|
||||
if (time_after(jiffies, timeout))
|
||||
expired = true;
|
||||
}
|
||||
ret = readx_poll_timeout(scpsys_domain_is_on, scpd, tmp, tmp == 0,
|
||||
MTK_POLL_DELAY_US, MTK_POLL_TIMEOUT);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
|
||||
for (i = 0; i < MAX_CLKS && scpd->clk[i]; i++)
|
||||
clk_disable_unprepare(scpd->clk[i]);
|
||||
|
@ -469,7 +438,7 @@ static struct scp *init_scp(struct platform_device *pdev,
|
|||
genpd->name = data->name;
|
||||
genpd->power_off = scpsys_power_off;
|
||||
genpd->power_on = scpsys_power_on;
|
||||
if (scpd->data->active_wakeup)
|
||||
if (MTK_SCPD_CAPS(scpd, MTK_SCPD_ACTIVE_WAKEUP))
|
||||
genpd->flags |= GENPD_FLAG_ACTIVE_WAKEUP;
|
||||
}
|
||||
|
||||
|
@ -522,7 +491,7 @@ static const struct scp_domain_data scp_domain_data_mt2701[] = {
|
|||
.bus_prot_mask = MT2701_TOP_AXI_PROT_EN_CONN_M |
|
||||
MT2701_TOP_AXI_PROT_EN_CONN_S,
|
||||
.clk_id = {CLK_NONE},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2701_POWER_DOMAIN_DISP] = {
|
||||
.name = "disp",
|
||||
|
@ -531,7 +500,7 @@ static const struct scp_domain_data scp_domain_data_mt2701[] = {
|
|||
.sram_pdn_bits = GENMASK(11, 8),
|
||||
.clk_id = {CLK_MM},
|
||||
.bus_prot_mask = MT2701_TOP_AXI_PROT_EN_MM_M0,
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2701_POWER_DOMAIN_MFG] = {
|
||||
.name = "mfg",
|
||||
|
@ -540,7 +509,7 @@ static const struct scp_domain_data scp_domain_data_mt2701[] = {
|
|||
.sram_pdn_bits = GENMASK(11, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(12, 12),
|
||||
.clk_id = {CLK_MFG},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2701_POWER_DOMAIN_VDEC] = {
|
||||
.name = "vdec",
|
||||
|
@ -549,7 +518,7 @@ static const struct scp_domain_data scp_domain_data_mt2701[] = {
|
|||
.sram_pdn_bits = GENMASK(11, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(12, 12),
|
||||
.clk_id = {CLK_MM},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2701_POWER_DOMAIN_ISP] = {
|
||||
.name = "isp",
|
||||
|
@ -558,7 +527,7 @@ static const struct scp_domain_data scp_domain_data_mt2701[] = {
|
|||
.sram_pdn_bits = GENMASK(11, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(13, 12),
|
||||
.clk_id = {CLK_MM},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2701_POWER_DOMAIN_BDP] = {
|
||||
.name = "bdp",
|
||||
|
@ -566,7 +535,7 @@ static const struct scp_domain_data scp_domain_data_mt2701[] = {
|
|||
.ctl_offs = SPM_BDP_PWR_CON,
|
||||
.sram_pdn_bits = GENMASK(11, 8),
|
||||
.clk_id = {CLK_NONE},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2701_POWER_DOMAIN_ETH] = {
|
||||
.name = "eth",
|
||||
|
@ -575,7 +544,7 @@ static const struct scp_domain_data scp_domain_data_mt2701[] = {
|
|||
.sram_pdn_bits = GENMASK(11, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(15, 12),
|
||||
.clk_id = {CLK_ETHIF},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2701_POWER_DOMAIN_HIF] = {
|
||||
.name = "hif",
|
||||
|
@ -584,14 +553,14 @@ static const struct scp_domain_data scp_domain_data_mt2701[] = {
|
|||
.sram_pdn_bits = GENMASK(11, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(15, 12),
|
||||
.clk_id = {CLK_ETHIF},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2701_POWER_DOMAIN_IFR_MSC] = {
|
||||
.name = "ifr_msc",
|
||||
.sta_mask = PWR_STATUS_IFR_MSC,
|
||||
.ctl_offs = SPM_IFR_MSC_PWR_CON,
|
||||
.clk_id = {CLK_NONE},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -606,7 +575,7 @@ static const struct scp_domain_data scp_domain_data_mt2712[] = {
|
|||
.sram_pdn_bits = GENMASK(8, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(12, 12),
|
||||
.clk_id = {CLK_MM},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2712_POWER_DOMAIN_VDEC] = {
|
||||
.name = "vdec",
|
||||
|
@ -615,7 +584,7 @@ static const struct scp_domain_data scp_domain_data_mt2712[] = {
|
|||
.sram_pdn_bits = GENMASK(8, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(12, 12),
|
||||
.clk_id = {CLK_MM, CLK_VDEC},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2712_POWER_DOMAIN_VENC] = {
|
||||
.name = "venc",
|
||||
|
@ -624,7 +593,7 @@ static const struct scp_domain_data scp_domain_data_mt2712[] = {
|
|||
.sram_pdn_bits = GENMASK(11, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(15, 12),
|
||||
.clk_id = {CLK_MM, CLK_VENC, CLK_JPGDEC},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2712_POWER_DOMAIN_ISP] = {
|
||||
.name = "isp",
|
||||
|
@ -633,7 +602,7 @@ static const struct scp_domain_data scp_domain_data_mt2712[] = {
|
|||
.sram_pdn_bits = GENMASK(11, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(13, 12),
|
||||
.clk_id = {CLK_MM},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2712_POWER_DOMAIN_AUDIO] = {
|
||||
.name = "audio",
|
||||
|
@ -642,7 +611,7 @@ static const struct scp_domain_data scp_domain_data_mt2712[] = {
|
|||
.sram_pdn_bits = GENMASK(11, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(15, 12),
|
||||
.clk_id = {CLK_AUDIO},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2712_POWER_DOMAIN_USB] = {
|
||||
.name = "usb",
|
||||
|
@ -651,7 +620,7 @@ static const struct scp_domain_data scp_domain_data_mt2712[] = {
|
|||
.sram_pdn_bits = GENMASK(10, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(14, 12),
|
||||
.clk_id = {CLK_NONE},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2712_POWER_DOMAIN_USB2] = {
|
||||
.name = "usb2",
|
||||
|
@ -660,7 +629,7 @@ static const struct scp_domain_data scp_domain_data_mt2712[] = {
|
|||
.sram_pdn_bits = GENMASK(10, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(14, 12),
|
||||
.clk_id = {CLK_NONE},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2712_POWER_DOMAIN_MFG] = {
|
||||
.name = "mfg",
|
||||
|
@ -670,7 +639,7 @@ static const struct scp_domain_data scp_domain_data_mt2712[] = {
|
|||
.sram_pdn_ack_bits = GENMASK(16, 16),
|
||||
.clk_id = {CLK_MFG},
|
||||
.bus_prot_mask = BIT(14) | BIT(21) | BIT(23),
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2712_POWER_DOMAIN_MFG_SC1] = {
|
||||
.name = "mfg_sc1",
|
||||
|
@ -679,7 +648,7 @@ static const struct scp_domain_data scp_domain_data_mt2712[] = {
|
|||
.sram_pdn_bits = GENMASK(8, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(16, 16),
|
||||
.clk_id = {CLK_NONE},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2712_POWER_DOMAIN_MFG_SC2] = {
|
||||
.name = "mfg_sc2",
|
||||
|
@ -688,7 +657,7 @@ static const struct scp_domain_data scp_domain_data_mt2712[] = {
|
|||
.sram_pdn_bits = GENMASK(8, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(16, 16),
|
||||
.clk_id = {CLK_NONE},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT2712_POWER_DOMAIN_MFG_SC3] = {
|
||||
.name = "mfg_sc3",
|
||||
|
@ -697,7 +666,7 @@ static const struct scp_domain_data scp_domain_data_mt2712[] = {
|
|||
.sram_pdn_bits = GENMASK(8, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(16, 16),
|
||||
.clk_id = {CLK_NONE},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -797,7 +766,7 @@ static const struct scp_domain_data scp_domain_data_mt7622[] = {
|
|||
.sram_pdn_ack_bits = GENMASK(15, 12),
|
||||
.clk_id = {CLK_NONE},
|
||||
.bus_prot_mask = MT7622_TOP_AXI_PROT_EN_ETHSYS,
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT7622_POWER_DOMAIN_HIF0] = {
|
||||
.name = "hif0",
|
||||
|
@ -807,7 +776,7 @@ static const struct scp_domain_data scp_domain_data_mt7622[] = {
|
|||
.sram_pdn_ack_bits = GENMASK(15, 12),
|
||||
.clk_id = {CLK_HIFSEL},
|
||||
.bus_prot_mask = MT7622_TOP_AXI_PROT_EN_HIF0,
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT7622_POWER_DOMAIN_HIF1] = {
|
||||
.name = "hif1",
|
||||
|
@ -817,7 +786,7 @@ static const struct scp_domain_data scp_domain_data_mt7622[] = {
|
|||
.sram_pdn_ack_bits = GENMASK(15, 12),
|
||||
.clk_id = {CLK_HIFSEL},
|
||||
.bus_prot_mask = MT7622_TOP_AXI_PROT_EN_HIF1,
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT7622_POWER_DOMAIN_WB] = {
|
||||
.name = "wb",
|
||||
|
@ -827,7 +796,7 @@ static const struct scp_domain_data scp_domain_data_mt7622[] = {
|
|||
.sram_pdn_ack_bits = 0,
|
||||
.clk_id = {CLK_NONE},
|
||||
.bus_prot_mask = MT7622_TOP_AXI_PROT_EN_WB,
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP | MTK_SCPD_FWAIT_SRAM,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -843,7 +812,7 @@ static const struct scp_domain_data scp_domain_data_mt7623a[] = {
|
|||
.bus_prot_mask = MT2701_TOP_AXI_PROT_EN_CONN_M |
|
||||
MT2701_TOP_AXI_PROT_EN_CONN_S,
|
||||
.clk_id = {CLK_NONE},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT7623A_POWER_DOMAIN_ETH] = {
|
||||
.name = "eth",
|
||||
|
@ -852,7 +821,7 @@ static const struct scp_domain_data scp_domain_data_mt7623a[] = {
|
|||
.sram_pdn_bits = GENMASK(11, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(15, 12),
|
||||
.clk_id = {CLK_ETHIF},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT7623A_POWER_DOMAIN_HIF] = {
|
||||
.name = "hif",
|
||||
|
@ -861,14 +830,14 @@ static const struct scp_domain_data scp_domain_data_mt7623a[] = {
|
|||
.sram_pdn_bits = GENMASK(11, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(15, 12),
|
||||
.clk_id = {CLK_ETHIF},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT7623A_POWER_DOMAIN_IFR_MSC] = {
|
||||
.name = "ifr_msc",
|
||||
.sta_mask = PWR_STATUS_IFR_MSC,
|
||||
.ctl_offs = SPM_IFR_MSC_PWR_CON,
|
||||
.clk_id = {CLK_NONE},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -934,7 +903,7 @@ static const struct scp_domain_data scp_domain_data_mt8173[] = {
|
|||
.sram_pdn_bits = GENMASK(11, 8),
|
||||
.sram_pdn_ack_bits = GENMASK(15, 12),
|
||||
.clk_id = {CLK_NONE},
|
||||
.active_wakeup = true,
|
||||
.caps = MTK_SCPD_ACTIVE_WAKEUP,
|
||||
},
|
||||
[MT8173_POWER_DOMAIN_MFG_ASYNC] = {
|
||||
.name = "mfg_async",
|
||||
|
@ -1067,15 +1036,13 @@ static const struct of_device_id of_scpsys_match_tbl[] = {
|
|||
|
||||
static int scpsys_probe(struct platform_device *pdev)
|
||||
{
|
||||
const struct of_device_id *match;
|
||||
const struct scp_subdomain *sd;
|
||||
const struct scp_soc_data *soc;
|
||||
struct scp *scp;
|
||||
struct genpd_onecell_data *pd_data;
|
||||
int i, ret;
|
||||
|
||||
match = of_match_device(of_scpsys_match_tbl, &pdev->dev);
|
||||
soc = (const struct scp_soc_data *)match->data;
|
||||
soc = of_device_get_match_data(&pdev->dev);
|
||||
|
||||
scp = init_scp(pdev, soc->domains, soc->num_domains, &soc->regs,
|
||||
soc->bus_prot_reg_update);
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include <linux/list.h>
|
||||
#include <linux/rbtree.h>
|
||||
#include <linux/ktime.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/bug.h>
|
||||
|
|
Loading…
Reference in New Issue