forked from Minki/linux
soc: Keystone SOC drivers for v5.15
The pull request contains: - ICSSG subsystem support for Keystone3 AM64x SOCs - Removes smartrefelx PM dependency for deeper low power states -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJhEwSGAAoJEHJsHOdBp5c/YQQP/1hVcPGUOWWVnfsybbgihEIl 1b3OvbJ5UOloQ8iUw9Q9tZGOqgXypXEQAAzFoq7xmG+OoN1mFCkyFupKS4vGmYAW weSJudgSs8E2Gxqzm8XRm3+cgaIKI0Y1m6dh+Kg2OlCW3jAomLhmbh/kpPcnMb03 JdiBwvfn2WVnOWz+33qLQzp7qsSpWGXuu5J3WdNZPiXhfYPk1Q7CQx2LUiYi3r3W a+oH7H8cwsOtdousR7XwfrO0xw2iY53iZDcOAJ0PNHc2anT2dKznCihgBwW3CZce DuPWhwTDfvFbTSrCmsAhWdX2T5bDBWL1YHSonwgWJoA9VXeFptg2E5jk1i1zkyhC xwWX/FzYARyXg3NL46NKQWkYxREHIBA+ERQe0qcY6+h1xvzWGKsUcAhFyQiytT7x 52bpp9462jNnRj85wAM6I8ADw9rL1mfJvyaWvb47QPGWernSfezOFig8MHc41whl r2TA6diOo1TKgzHJWKxMFuOeRuHnNqKn+yLyjBfbjvKBwa2YjHQWQKW6nSA4or/1 tqsWTEPvFdrOqRQ3s50z6EHYTglXx+xMmV2/JHVu46RBmj00BlNXBXEDRVfrLP/X 6OfeRDU/eLr2L+xaUQuYvHpbKa9C+IaYzGfJ2LKDqXzt7IG5NqLXjSWcHisBKgPv +g9TadUV6wjpgGLL++hx =lMDp -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmEVhp8ACgkQmmx57+YA GNkS6RAAuPiXBQwLBNDLxzvCCqVUDhE5NvVE/+K2V7n3P+uwc+mQWgKLE7ViAQtE uZOepgEAqw0LD7Xz1AEnNBcmEz9enVllDAv4Sj8McD7EziWVYoTYcQVLOKFuW7J7 mGzKFctqhWtgrCSPAhWLdhP9m4shBtHZ76fN5mi5tbkrLO7a0BOkiEg6kJADvywT yw8k958mmDhkVoryClhWEhQkWSWfMfBaWS2wpeILDzwJAeTKRJqSxr7veErI1FoS twzltWyQmnZBljJG5zNyxqMeRtd5owy0+uyKOTR9rKE2tTZAWJNt9BPM/yi9X9q1 4PyKDTXwqbY77nsJ8wlpsd+vKoS7XfoNle3bi5P9IzQLDZPUeBpHfpUKXUC0cjqc HbndA9U8yFzRQC0yWkzmZQYojhO7ZbEQ2HA4aexo7xwlYw42oGoMo1BqC8FVLKRJ sI5lxRUeibn41K4dDaQuLsdYSlQkbIxAJNYvwJWhc0cUJQxajk/2aYcpsVpqsBIA 1cUMh6B+4baSp+yQXks6QMsAsh9BwVbsAu40H89BrcS4euBeftEwpLGWicLWPeY8 1vZtDhnnx64uqHATk/70uLTh0DRvvRTgjqfslJRdrirb8sezT7F4H2TCs8gpHjYP gpn51joB8Dtdf21bwLS6IxLpVTh782InrmioxpC0Yo+byMGTVZk= =oB/6 -----END PGP SIGNATURE----- Merge tag 'drivers_soc_for_5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone into arm/drivers soc: Keystone SOC drivers for v5.15 The pull request contains: - ICSSG subsystem support for Keystone3 AM64x SOCs - Removes smartrefelx PM dependency for deeper low power states * tag 'drivers_soc_for_5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone: dt-bindings: soc: ti: pruss: Add dma-coherent property soc: ti: Remove pm_runtime_irq_safe() usage for smartreflex soc: ti: pruss: Enable support for ICSSG subsystems on K3 AM64x SoCs dt-bindings: soc: ti: pruss: Update bindings for K3 AM64x SoCs Link: https://lore.kernel.org/r/0A637A41-2353-4900-962C-DBE50BBDE75A@oracle.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
commit
866e1691ed
@ -68,6 +68,7 @@ properties:
|
||||
- ti,k2g-pruss # for 66AK2G SoC family
|
||||
- ti,am654-icssg # for K3 AM65x SoC family
|
||||
- ti,j721e-icssg # for K3 J721E SoC family
|
||||
- ti,am642-icssg # for K3 AM64x SoC family
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
@ -84,6 +85,8 @@ properties:
|
||||
dma-ranges:
|
||||
maxItems: 1
|
||||
|
||||
dma-coherent: true
|
||||
|
||||
power-domains:
|
||||
description: |
|
||||
This property is as per sci-pm-domain.txt.
|
||||
@ -231,8 +234,8 @@ patternProperties:
|
||||
description: |
|
||||
Industrial Ethernet Peripheral to manage/generate Industrial Ethernet
|
||||
functions such as time stamping. Each PRUSS has either 1 IEP (on AM335x,
|
||||
AM437x, AM57xx & 66AK2G SoCs) or 2 IEPs (on K3 AM65x & J721E SoCs ). IEP
|
||||
is used for creating PTP clocks and generating PPS signals.
|
||||
AM437x, AM57xx & 66AK2G SoCs) or 2 IEPs (on K3 AM65x, J721E & AM64x SoCs).
|
||||
IEP is used for creating PTP clocks and generating PPS signals.
|
||||
|
||||
type: object
|
||||
|
||||
@ -323,17 +326,29 @@ additionalProperties: false
|
||||
# - interrupt-controller
|
||||
# - pru
|
||||
|
||||
if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- ti,k2g-pruss
|
||||
- ti,am654-icssg
|
||||
- ti,j721e-icssg
|
||||
then:
|
||||
required:
|
||||
- power-domains
|
||||
allOf:
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- ti,k2g-pruss
|
||||
- ti,am654-icssg
|
||||
- ti,j721e-icssg
|
||||
- ti,am642-icssg
|
||||
then:
|
||||
required:
|
||||
- power-domains
|
||||
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- ti,k2g-pruss
|
||||
then:
|
||||
required:
|
||||
- dma-coherent
|
||||
|
||||
examples:
|
||||
- |
|
||||
|
@ -1446,10 +1446,6 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
|
||||
SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_OPT_CLKS_IN_RESET),
|
||||
SYSC_QUIRK("sham", 0, 0x100, 0x110, 0x114, 0x40000c03, 0xffffffff,
|
||||
SYSC_QUIRK_LEGACY_IDLE),
|
||||
SYSC_QUIRK("smartreflex", 0, -ENODEV, 0x24, -ENODEV, 0x00000000, 0xffffffff,
|
||||
SYSC_QUIRK_LEGACY_IDLE),
|
||||
SYSC_QUIRK("smartreflex", 0, -ENODEV, 0x38, -ENODEV, 0x00000000, 0xffffffff,
|
||||
SYSC_QUIRK_LEGACY_IDLE),
|
||||
SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000046, 0xffffffff,
|
||||
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_LEGACY_IDLE),
|
||||
SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000052, 0xffffffff,
|
||||
@ -1586,6 +1582,8 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
|
||||
SYSC_QUIRK("sdma", 0, 0, 0x2c, 0x28, 0x00010900, 0xffffffff, 0),
|
||||
SYSC_QUIRK("slimbus", 0, 0, 0x10, -ENODEV, 0x40000902, 0xffffffff, 0),
|
||||
SYSC_QUIRK("slimbus", 0, 0, 0x10, -ENODEV, 0x40002903, 0xffffffff, 0),
|
||||
SYSC_QUIRK("smartreflex", 0, -ENODEV, 0x24, -ENODEV, 0x00000000, 0xffffffff, 0),
|
||||
SYSC_QUIRK("smartreflex", 0, -ENODEV, 0x38, -ENODEV, 0x00000000, 0xffffffff, 0),
|
||||
SYSC_QUIRK("spinlock", 0, 0, 0x10, -ENODEV, 0x50020000, 0xffffffff, 0),
|
||||
SYSC_QUIRK("rng", 0, 0x1fe0, 0x1fe4, -ENODEV, 0x00000020, 0xffffffff, 0),
|
||||
SYSC_QUIRK("timer", 0, 0, 0x10, 0x14, 0x00000013, 0xffffffff, 0),
|
||||
|
@ -338,6 +338,7 @@ static const struct of_device_id pruss_of_match[] = {
|
||||
{ .compatible = "ti,k2g-pruss" },
|
||||
{ .compatible = "ti,am654-icssg", .data = &am65x_j721e_pruss_data, },
|
||||
{ .compatible = "ti,j721e-icssg", .data = &am65x_j721e_pruss_data, },
|
||||
{ .compatible = "ti,am642-icssg", .data = &am65x_j721e_pruss_data, },
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, pruss_of_match);
|
||||
|
@ -126,23 +126,13 @@ static irqreturn_t sr_interrupt(int irq, void *data)
|
||||
|
||||
static void sr_set_clk_length(struct omap_sr *sr)
|
||||
{
|
||||
struct clk *fck;
|
||||
u32 fclk_speed;
|
||||
|
||||
/* Try interconnect target module fck first if it already exists */
|
||||
fck = clk_get(sr->pdev->dev.parent, "fck");
|
||||
if (IS_ERR(fck)) {
|
||||
fck = clk_get(&sr->pdev->dev, "fck");
|
||||
if (IS_ERR(fck)) {
|
||||
dev_err(&sr->pdev->dev,
|
||||
"%s: unable to get fck for device %s\n",
|
||||
__func__, dev_name(&sr->pdev->dev));
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (IS_ERR(sr->fck))
|
||||
return;
|
||||
|
||||
fclk_speed = clk_get_rate(fck);
|
||||
clk_put(fck);
|
||||
fclk_speed = clk_get_rate(sr->fck);
|
||||
|
||||
switch (fclk_speed) {
|
||||
case 12000000:
|
||||
@ -587,21 +577,25 @@ int sr_enable(struct omap_sr *sr, unsigned long volt)
|
||||
/* errminlimit is opp dependent and hence linked to voltage */
|
||||
sr->err_minlimit = nvalue_row->errminlimit;
|
||||
|
||||
pm_runtime_get_sync(&sr->pdev->dev);
|
||||
clk_enable(sr->fck);
|
||||
|
||||
/* Check if SR is already enabled. If yes do nothing */
|
||||
if (sr_read_reg(sr, SRCONFIG) & SRCONFIG_SRENABLE)
|
||||
return 0;
|
||||
goto out_enabled;
|
||||
|
||||
/* Configure SR */
|
||||
ret = sr_class->configure(sr);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto out_enabled;
|
||||
|
||||
sr_write_reg(sr, NVALUERECIPROCAL, nvalue_row->nvalue);
|
||||
|
||||
/* SRCONFIG - enable SR */
|
||||
sr_modify_reg(sr, SRCONFIG, SRCONFIG_SRENABLE, SRCONFIG_SRENABLE);
|
||||
|
||||
out_enabled:
|
||||
sr->enabled = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -621,7 +615,7 @@ void sr_disable(struct omap_sr *sr)
|
||||
}
|
||||
|
||||
/* Check if SR clocks are already disabled. If yes do nothing */
|
||||
if (pm_runtime_suspended(&sr->pdev->dev))
|
||||
if (!sr->enabled)
|
||||
return;
|
||||
|
||||
/*
|
||||
@ -642,7 +636,8 @@ void sr_disable(struct omap_sr *sr)
|
||||
}
|
||||
}
|
||||
|
||||
pm_runtime_put_sync_suspend(&sr->pdev->dev);
|
||||
clk_disable(sr->fck);
|
||||
sr->enabled = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -851,8 +846,12 @@ static int omap_sr_probe(struct platform_device *pdev)
|
||||
|
||||
irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
||||
|
||||
sr_info->fck = devm_clk_get(pdev->dev.parent, "fck");
|
||||
if (IS_ERR(sr_info->fck))
|
||||
return PTR_ERR(sr_info->fck);
|
||||
clk_prepare(sr_info->fck);
|
||||
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
pm_runtime_irq_safe(&pdev->dev);
|
||||
|
||||
snprintf(sr_info->name, SMARTREFLEX_NAME_LEN, "%s", pdata->name);
|
||||
|
||||
@ -878,12 +877,6 @@ static int omap_sr_probe(struct platform_device *pdev)
|
||||
|
||||
list_add(&sr_info->node, &sr_list);
|
||||
|
||||
ret = pm_runtime_get_sync(&pdev->dev);
|
||||
if (ret < 0) {
|
||||
pm_runtime_put_noidle(&pdev->dev);
|
||||
goto err_list_del;
|
||||
}
|
||||
|
||||
/*
|
||||
* Call into late init to do initializations that require
|
||||
* both sr driver and sr class driver to be initiallized.
|
||||
@ -933,16 +926,13 @@ static int omap_sr_probe(struct platform_device *pdev)
|
||||
|
||||
}
|
||||
|
||||
pm_runtime_put_sync(&pdev->dev);
|
||||
|
||||
return ret;
|
||||
|
||||
err_debugfs:
|
||||
debugfs_remove_recursive(sr_info->dbg_dir);
|
||||
err_list_del:
|
||||
list_del(&sr_info->node);
|
||||
|
||||
pm_runtime_put_sync(&pdev->dev);
|
||||
clk_unprepare(sr_info->fck);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -950,6 +940,7 @@ err_list_del:
|
||||
static int omap_sr_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct omap_sr_data *pdata = pdev->dev.platform_data;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct omap_sr *sr_info;
|
||||
|
||||
if (!pdata) {
|
||||
@ -968,7 +959,8 @@ static int omap_sr_remove(struct platform_device *pdev)
|
||||
sr_stop_vddautocomp(sr_info);
|
||||
debugfs_remove_recursive(sr_info->dbg_dir);
|
||||
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
pm_runtime_disable(dev);
|
||||
clk_unprepare(sr_info->fck);
|
||||
list_del(&sr_info->node);
|
||||
return 0;
|
||||
}
|
||||
|
@ -155,6 +155,7 @@ struct omap_sr {
|
||||
struct voltagedomain *voltdm;
|
||||
struct dentry *dbg_dir;
|
||||
unsigned int irq;
|
||||
struct clk *fck;
|
||||
int srid;
|
||||
int ip_type;
|
||||
int nvalue_count;
|
||||
@ -169,6 +170,7 @@ struct omap_sr {
|
||||
u32 senp_mod;
|
||||
u32 senn_mod;
|
||||
void __iomem *base;
|
||||
unsigned long enabled:1;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user