Skip to content

Commit 866e169

Browse files
committed
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/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 0dc76ec + 62e8ce8 commit 866e169

File tree

5 files changed

+55
-47
lines changed

5 files changed

+55
-47
lines changed

Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ properties:
6868
- ti,k2g-pruss # for 66AK2G SoC family
6969
- ti,am654-icssg # for K3 AM65x SoC family
7070
- ti,j721e-icssg # for K3 J721E SoC family
71+
- ti,am642-icssg # for K3 AM64x SoC family
7172

7273
reg:
7374
maxItems: 1
@@ -84,6 +85,8 @@ properties:
8485
dma-ranges:
8586
maxItems: 1
8687

88+
dma-coherent: true
89+
8790
power-domains:
8891
description: |
8992
This property is as per sci-pm-domain.txt.
@@ -231,8 +234,8 @@ patternProperties:
231234
description: |
232235
Industrial Ethernet Peripheral to manage/generate Industrial Ethernet
233236
functions such as time stamping. Each PRUSS has either 1 IEP (on AM335x,
234-
AM437x, AM57xx & 66AK2G SoCs) or 2 IEPs (on K3 AM65x & J721E SoCs ). IEP
235-
is used for creating PTP clocks and generating PPS signals.
237+
AM437x, AM57xx & 66AK2G SoCs) or 2 IEPs (on K3 AM65x, J721E & AM64x SoCs).
238+
IEP is used for creating PTP clocks and generating PPS signals.
236239
237240
type: object
238241

@@ -323,17 +326,29 @@ additionalProperties: false
323326
# - interrupt-controller
324327
# - pru
325328

326-
if:
327-
properties:
328-
compatible:
329-
contains:
330-
enum:
331-
- ti,k2g-pruss
332-
- ti,am654-icssg
333-
- ti,j721e-icssg
334-
then:
335-
required:
336-
- power-domains
329+
allOf:
330+
- if:
331+
properties:
332+
compatible:
333+
contains:
334+
enum:
335+
- ti,k2g-pruss
336+
- ti,am654-icssg
337+
- ti,j721e-icssg
338+
- ti,am642-icssg
339+
then:
340+
required:
341+
- power-domains
342+
343+
- if:
344+
properties:
345+
compatible:
346+
contains:
347+
enum:
348+
- ti,k2g-pruss
349+
then:
350+
required:
351+
- dma-coherent
337352

338353
examples:
339354
- |

drivers/bus/ti-sysc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,10 +1446,6 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
14461446
SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_OPT_CLKS_IN_RESET),
14471447
SYSC_QUIRK("sham", 0, 0x100, 0x110, 0x114, 0x40000c03, 0xffffffff,
14481448
SYSC_QUIRK_LEGACY_IDLE),
1449-
SYSC_QUIRK("smartreflex", 0, -ENODEV, 0x24, -ENODEV, 0x00000000, 0xffffffff,
1450-
SYSC_QUIRK_LEGACY_IDLE),
1451-
SYSC_QUIRK("smartreflex", 0, -ENODEV, 0x38, -ENODEV, 0x00000000, 0xffffffff,
1452-
SYSC_QUIRK_LEGACY_IDLE),
14531449
SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000046, 0xffffffff,
14541450
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_LEGACY_IDLE),
14551451
SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000052, 0xffffffff,
@@ -1586,6 +1582,8 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
15861582
SYSC_QUIRK("sdma", 0, 0, 0x2c, 0x28, 0x00010900, 0xffffffff, 0),
15871583
SYSC_QUIRK("slimbus", 0, 0, 0x10, -ENODEV, 0x40000902, 0xffffffff, 0),
15881584
SYSC_QUIRK("slimbus", 0, 0, 0x10, -ENODEV, 0x40002903, 0xffffffff, 0),
1585+
SYSC_QUIRK("smartreflex", 0, -ENODEV, 0x24, -ENODEV, 0x00000000, 0xffffffff, 0),
1586+
SYSC_QUIRK("smartreflex", 0, -ENODEV, 0x38, -ENODEV, 0x00000000, 0xffffffff, 0),
15891587
SYSC_QUIRK("spinlock", 0, 0, 0x10, -ENODEV, 0x50020000, 0xffffffff, 0),
15901588
SYSC_QUIRK("rng", 0, 0x1fe0, 0x1fe4, -ENODEV, 0x00000020, 0xffffffff, 0),
15911589
SYSC_QUIRK("timer", 0, 0, 0x10, 0x14, 0x00000013, 0xffffffff, 0),

drivers/soc/ti/pruss.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ static const struct of_device_id pruss_of_match[] = {
338338
{ .compatible = "ti,k2g-pruss" },
339339
{ .compatible = "ti,am654-icssg", .data = &am65x_j721e_pruss_data, },
340340
{ .compatible = "ti,j721e-icssg", .data = &am65x_j721e_pruss_data, },
341+
{ .compatible = "ti,am642-icssg", .data = &am65x_j721e_pruss_data, },
341342
{},
342343
};
343344
MODULE_DEVICE_TABLE(of, pruss_of_match);

drivers/soc/ti/smartreflex.c

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -126,23 +126,13 @@ static irqreturn_t sr_interrupt(int irq, void *data)
126126

127127
static void sr_set_clk_length(struct omap_sr *sr)
128128
{
129-
struct clk *fck;
130129
u32 fclk_speed;
131130

132131
/* Try interconnect target module fck first if it already exists */
133-
fck = clk_get(sr->pdev->dev.parent, "fck");
134-
if (IS_ERR(fck)) {
135-
fck = clk_get(&sr->pdev->dev, "fck");
136-
if (IS_ERR(fck)) {
137-
dev_err(&sr->pdev->dev,
138-
"%s: unable to get fck for device %s\n",
139-
__func__, dev_name(&sr->pdev->dev));
140-
return;
141-
}
142-
}
132+
if (IS_ERR(sr->fck))
133+
return;
143134

144-
fclk_speed = clk_get_rate(fck);
145-
clk_put(fck);
135+
fclk_speed = clk_get_rate(sr->fck);
146136

147137
switch (fclk_speed) {
148138
case 12000000:
@@ -587,21 +577,25 @@ int sr_enable(struct omap_sr *sr, unsigned long volt)
587577
/* errminlimit is opp dependent and hence linked to voltage */
588578
sr->err_minlimit = nvalue_row->errminlimit;
589579

590-
pm_runtime_get_sync(&sr->pdev->dev);
580+
clk_enable(sr->fck);
591581

592582
/* Check if SR is already enabled. If yes do nothing */
593583
if (sr_read_reg(sr, SRCONFIG) & SRCONFIG_SRENABLE)
594-
return 0;
584+
goto out_enabled;
595585

596586
/* Configure SR */
597587
ret = sr_class->configure(sr);
598588
if (ret)
599-
return ret;
589+
goto out_enabled;
600590

601591
sr_write_reg(sr, NVALUERECIPROCAL, nvalue_row->nvalue);
602592

603593
/* SRCONFIG - enable SR */
604594
sr_modify_reg(sr, SRCONFIG, SRCONFIG_SRENABLE, SRCONFIG_SRENABLE);
595+
596+
out_enabled:
597+
sr->enabled = 1;
598+
605599
return 0;
606600
}
607601

@@ -621,7 +615,7 @@ void sr_disable(struct omap_sr *sr)
621615
}
622616

623617
/* Check if SR clocks are already disabled. If yes do nothing */
624-
if (pm_runtime_suspended(&sr->pdev->dev))
618+
if (!sr->enabled)
625619
return;
626620

627621
/*
@@ -642,7 +636,8 @@ void sr_disable(struct omap_sr *sr)
642636
}
643637
}
644638

645-
pm_runtime_put_sync_suspend(&sr->pdev->dev);
639+
clk_disable(sr->fck);
640+
sr->enabled = 0;
646641
}
647642

648643
/**
@@ -851,8 +846,12 @@ static int omap_sr_probe(struct platform_device *pdev)
851846

852847
irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
853848

849+
sr_info->fck = devm_clk_get(pdev->dev.parent, "fck");
850+
if (IS_ERR(sr_info->fck))
851+
return PTR_ERR(sr_info->fck);
852+
clk_prepare(sr_info->fck);
853+
854854
pm_runtime_enable(&pdev->dev);
855-
pm_runtime_irq_safe(&pdev->dev);
856855

857856
snprintf(sr_info->name, SMARTREFLEX_NAME_LEN, "%s", pdata->name);
858857

@@ -878,12 +877,6 @@ static int omap_sr_probe(struct platform_device *pdev)
878877

879878
list_add(&sr_info->node, &sr_list);
880879

881-
ret = pm_runtime_get_sync(&pdev->dev);
882-
if (ret < 0) {
883-
pm_runtime_put_noidle(&pdev->dev);
884-
goto err_list_del;
885-
}
886-
887880
/*
888881
* Call into late init to do initializations that require
889882
* both sr driver and sr class driver to be initiallized.
@@ -933,23 +926,21 @@ static int omap_sr_probe(struct platform_device *pdev)
933926

934927
}
935928

936-
pm_runtime_put_sync(&pdev->dev);
937-
938929
return ret;
939930

940931
err_debugfs:
941932
debugfs_remove_recursive(sr_info->dbg_dir);
942933
err_list_del:
943934
list_del(&sr_info->node);
944-
945-
pm_runtime_put_sync(&pdev->dev);
935+
clk_unprepare(sr_info->fck);
946936

947937
return ret;
948938
}
949939

950940
static int omap_sr_remove(struct platform_device *pdev)
951941
{
952942
struct omap_sr_data *pdata = pdev->dev.platform_data;
943+
struct device *dev = &pdev->dev;
953944
struct omap_sr *sr_info;
954945

955946
if (!pdata) {
@@ -968,7 +959,8 @@ static int omap_sr_remove(struct platform_device *pdev)
968959
sr_stop_vddautocomp(sr_info);
969960
debugfs_remove_recursive(sr_info->dbg_dir);
970961

971-
pm_runtime_disable(&pdev->dev);
962+
pm_runtime_disable(dev);
963+
clk_unprepare(sr_info->fck);
972964
list_del(&sr_info->node);
973965
return 0;
974966
}

include/linux/power/smartreflex.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ struct omap_sr {
155155
struct voltagedomain *voltdm;
156156
struct dentry *dbg_dir;
157157
unsigned int irq;
158+
struct clk *fck;
158159
int srid;
159160
int ip_type;
160161
int nvalue_count;
@@ -169,6 +170,7 @@ struct omap_sr {
169170
u32 senp_mod;
170171
u32 senn_mod;
171172
void __iomem *base;
173+
unsigned long enabled:1;
172174
};
173175

174176
/**

0 commit comments

Comments
 (0)