Skip to content

Commit 93e0aca

Browse files
committed
Merge tag 'ti-driver-soc-for-v6.6' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into soc/drivers
TI SoC driver updates for v6.6 - Generic fixups: Explicitly include correct DT include. - omap_prm: Cosmetic fixups for using devm_ api for ioremap_resource - ti_sci: Documentation fixups, Using system_state to determine if polling is needed. - k3-ringcc: Documentation fixups, cleanup of log messages, using devm_ to handle ioremap_resource. - k3-socinfo: Add AM62PX detection. * tag 'ti-driver-soc-for-v6.6' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: soc: ti: k3-socinfo.c: Add JTAG ID for AM62PX soc: ti: Use devm_platform_ioremap_resource_byname simplify logic soc: ti: k3-ringacc: remove non-fatal probe deferral log soc: ti: Explicitly include correct DT includes soc: ti: omap-prm: Use devm_platform_get_and_ioremap_resource() soc: ti: k3-ringacc: Fixup documentation errors firmware: ti_sci: Fixup documentation errors firmware: ti_sci: Use system_state to determine polling Link: https://lore.kernel.org/r/20230814160633.my3xbk5k2pxkvjyi@degrease Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents f15897c + 443012d commit 93e0aca

File tree

6 files changed

+30
-71
lines changed

6 files changed

+30
-71
lines changed

drivers/firmware/ti_sci.c

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ struct ti_sci_desc {
9797
* @node: list head
9898
* @host_id: Host ID
9999
* @users: Number of users of this instance
100-
* @is_suspending: Flag set to indicate in suspend path.
101100
*/
102101
struct ti_sci_info {
103102
struct device *dev;
@@ -116,7 +115,6 @@ struct ti_sci_info {
116115
u8 host_id;
117116
/* protected by ti_sci_list_mutex */
118117
int users;
119-
bool is_suspending;
120118
};
121119

122120
#define cl_to_ti_sci_info(c) container_of(c, struct ti_sci_info, cl)
@@ -418,14 +416,14 @@ static inline int ti_sci_do_xfer(struct ti_sci_info *info,
418416

419417
ret = 0;
420418

421-
if (!info->is_suspending) {
419+
if (system_state <= SYSTEM_RUNNING) {
422420
/* And we wait for the response. */
423421
timeout = msecs_to_jiffies(info->desc->max_rx_timeout_ms);
424422
if (!wait_for_completion_timeout(&xfer->done, timeout))
425423
ret = -ETIMEDOUT;
426424
} else {
427425
/*
428-
* If we are suspending, we cannot use wait_for_completion_timeout
426+
* If we are !running, we cannot use wait_for_completion_timeout
429427
* during noirq phase, so we must manually poll the completion.
430428
*/
431429
ret = read_poll_timeout_atomic(try_wait_for_completion, done_state,
@@ -1978,8 +1976,6 @@ static int ti_sci_free_irq(const struct ti_sci_handle *handle, u32 valid_params,
19781976
* @src_index: IRQ source index within the source device
19791977
* @dst_id: Device ID of the IRQ destination
19801978
* @dst_host_irq: IRQ number of the destination device
1981-
* @vint_irq: Boolean specifying if this interrupt belongs to
1982-
* Interrupt Aggregator.
19831979
*
19841980
* Return: 0 if all went fine, else return appropriate error.
19851981
*/
@@ -2026,8 +2022,6 @@ static int ti_sci_cmd_set_event_map(const struct ti_sci_handle *handle,
20262022
* @src_index: IRQ source index within the source device
20272023
* @dst_id: Device ID of the IRQ destination
20282024
* @dst_host_irq: IRQ number of the destination device
2029-
* @vint_irq: Boolean specifying if this interrupt belongs to
2030-
* Interrupt Aggregator.
20312025
*
20322026
* Return: 0 if all went fine, else return appropriate error.
20332027
*/
@@ -2620,6 +2614,7 @@ static int ti_sci_cmd_proc_handover(const struct ti_sci_handle *handle,
26202614
* configuration flags
26212615
* @handle: Pointer to TI SCI handle
26222616
* @proc_id: Processor ID this request is for
2617+
* @bootvector: Processor Boot vector (start address)
26232618
* @config_flags_set: Configuration flags to be set
26242619
* @config_flags_clear: Configuration flags to be cleared.
26252620
*
@@ -2736,9 +2731,13 @@ static int ti_sci_cmd_proc_set_control(const struct ti_sci_handle *handle,
27362731
}
27372732

27382733
/**
2739-
* ti_sci_cmd_get_boot_status() - Command to get the processor boot status
2734+
* ti_sci_cmd_proc_get_status() - Command to get the processor boot status
27402735
* @handle: Pointer to TI SCI handle
27412736
* @proc_id: Processor ID this request is for
2737+
* @bv: Processor Boot vector (start address)
2738+
* @cfg_flags: Processor specific configuration flags
2739+
* @ctrl_flags: Processor specific control flags
2740+
* @sts_flags: Processor specific status flags
27422741
*
27432742
* Return: 0 if all went well, else returns appropriate error value.
27442743
*/
@@ -3256,7 +3255,7 @@ EXPORT_SYMBOL_GPL(devm_ti_sci_get_of_resource);
32563255
* @handle: TISCI handle
32573256
* @dev: Device pointer to which the resource is assigned
32583257
* @dev_id: TISCI device id to which the resource is assigned
3259-
* @suub_type: TISCI resource subytpe representing the resource.
3258+
* @sub_type: TISCI resource subytpe representing the resource.
32603259
*
32613260
* Return: Pointer to ti_sci_resource if all went well else appropriate
32623261
* error pointer.
@@ -3281,35 +3280,6 @@ static int tisci_reboot_handler(struct notifier_block *nb, unsigned long mode,
32813280
return NOTIFY_BAD;
32823281
}
32833282

3284-
static void ti_sci_set_is_suspending(struct ti_sci_info *info, bool is_suspending)
3285-
{
3286-
info->is_suspending = is_suspending;
3287-
}
3288-
3289-
static int ti_sci_suspend(struct device *dev)
3290-
{
3291-
struct ti_sci_info *info = dev_get_drvdata(dev);
3292-
/*
3293-
* We must switch operation to polled mode now as drivers and the genpd
3294-
* layer may make late TI SCI calls to change clock and device states
3295-
* from the noirq phase of suspend.
3296-
*/
3297-
ti_sci_set_is_suspending(info, true);
3298-
3299-
return 0;
3300-
}
3301-
3302-
static int ti_sci_resume(struct device *dev)
3303-
{
3304-
struct ti_sci_info *info = dev_get_drvdata(dev);
3305-
3306-
ti_sci_set_is_suspending(info, false);
3307-
3308-
return 0;
3309-
}
3310-
3311-
static DEFINE_SIMPLE_DEV_PM_OPS(ti_sci_pm_ops, ti_sci_suspend, ti_sci_resume);
3312-
33133283
/* Description for K2G */
33143284
static const struct ti_sci_desc ti_sci_pmmc_k2g_desc = {
33153285
.default_host_id = 2,
@@ -3516,7 +3486,6 @@ static struct platform_driver ti_sci_driver = {
35163486
.driver = {
35173487
.name = "ti-sci",
35183488
.of_match_table = of_match_ptr(ti_sci_of_match),
3519-
.pm = &ti_sci_pm_ops,
35203489
},
35213490
};
35223491
module_platform_driver(ti_sci_driver);

drivers/genpd/ti/omap_prm.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <linux/iopoll.h>
1414
#include <linux/module.h>
1515
#include <linux/of.h>
16-
#include <linux/of_device.h>
1716
#include <linux/platform_device.h>
1817
#include <linux/pm_clock.h>
1918
#include <linux/pm_domain.h>
@@ -943,10 +942,6 @@ static int omap_prm_probe(struct platform_device *pdev)
943942
struct omap_prm *prm;
944943
int ret;
945944

946-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
947-
if (!res)
948-
return -ENODEV;
949-
950945
data = of_device_get_match_data(&pdev->dev);
951946
if (!data)
952947
return -ENOTSUPP;
@@ -955,6 +950,10 @@ static int omap_prm_probe(struct platform_device *pdev)
955950
if (!prm)
956951
return -ENOMEM;
957952

953+
prm->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
954+
if (IS_ERR(prm->base))
955+
return PTR_ERR(prm->base);
956+
958957
while (data->base != res->start) {
959958
if (!data->base)
960959
return -EINVAL;
@@ -963,10 +962,6 @@ static int omap_prm_probe(struct platform_device *pdev)
963962

964963
prm->data = data;
965964

966-
prm->base = devm_ioremap_resource(&pdev->dev, res);
967-
if (IS_ERR(prm->base))
968-
return PTR_ERR(prm->base);
969-
970965
ret = omap_prm_domain_init(&pdev->dev, prm);
971966
if (ret)
972967
return ret;

drivers/soc/ti/k3-ringacc.c

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <linux/io.h>
1010
#include <linux/module.h>
1111
#include <linux/of.h>
12-
#include <linux/of_device.h>
1312
#include <linux/platform_device.h>
1413
#include <linux/sys_soc.h>
1514
#include <linux/dma/ti-cppi5.h>
@@ -125,6 +124,7 @@ struct k3_ring_ops {
125124
* @occ: Occupancy
126125
* @windex: Write index
127126
* @rindex: Read index
127+
* @tdown_complete: Tear down complete state
128128
*/
129129
struct k3_ring_state {
130130
u32 free;
@@ -192,7 +192,7 @@ struct k3_ringacc_ops {
192192
* @num_rings: number of ring in RA
193193
* @rings_inuse: bitfield for ring usage tracking
194194
* @rm_gp_range: general purpose rings range from tisci
195-
* @dma_ring_reset_quirk: DMA reset w/a enable
195+
* @dma_ring_reset_quirk: DMA reset workaround enable
196196
* @num_proxies: number of RA proxies
197197
* @proxy_inuse: bitfield for proxy usage tracking
198198
* @rings: array of rings descriptors (struct @k3_ring)
@@ -229,9 +229,9 @@ struct k3_ringacc {
229229
};
230230

231231
/**
232-
* struct k3_ringacc - Rings accelerator SoC data
232+
* struct k3_ringacc_soc_data - Rings accelerator SoC data
233233
*
234-
* @dma_ring_reset_quirk: DMA reset w/a enable
234+
* @dma_ring_reset_quirk: DMA reset workaround enable
235235
*/
236236
struct k3_ringacc_soc_data {
237237
unsigned dma_ring_reset_quirk:1;
@@ -1368,15 +1368,12 @@ static int k3_ringacc_init(struct platform_device *pdev,
13681368
const struct soc_device_attribute *soc;
13691369
void __iomem *base_fifo, *base_rt;
13701370
struct device *dev = &pdev->dev;
1371-
struct resource *res;
13721371
int ret, i;
13731372

13741373
dev->msi.domain = of_msi_get_domain(dev, dev->of_node,
13751374
DOMAIN_BUS_TI_SCI_INTA_MSI);
1376-
if (!dev->msi.domain) {
1377-
dev_err(dev, "Failed to get MSI domain\n");
1375+
if (!dev->msi.domain)
13781376
return -EPROBE_DEFER;
1379-
}
13801377

13811378
ret = k3_ringacc_probe_dt(ringacc);
13821379
if (ret)
@@ -1389,24 +1386,20 @@ static int k3_ringacc_init(struct platform_device *pdev,
13891386
ringacc->dma_ring_reset_quirk = soc_data->dma_ring_reset_quirk;
13901387
}
13911388

1392-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rt");
1393-
base_rt = devm_ioremap_resource(dev, res);
1389+
base_rt = devm_platform_ioremap_resource_byname(pdev, "rt");
13941390
if (IS_ERR(base_rt))
13951391
return PTR_ERR(base_rt);
13961392

1397-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fifos");
1398-
base_fifo = devm_ioremap_resource(dev, res);
1393+
base_fifo = devm_platform_ioremap_resource_byname(pdev, "fifos");
13991394
if (IS_ERR(base_fifo))
14001395
return PTR_ERR(base_fifo);
14011396

1402-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "proxy_gcfg");
1403-
ringacc->proxy_gcfg = devm_ioremap_resource(dev, res);
1397+
ringacc->proxy_gcfg = devm_platform_ioremap_resource_byname(pdev, "proxy_gcfg");
14041398
if (IS_ERR(ringacc->proxy_gcfg))
14051399
return PTR_ERR(ringacc->proxy_gcfg);
14061400

1407-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
1408-
"proxy_target");
1409-
ringacc->proxy_target_base = devm_ioremap_resource(dev, res);
1401+
ringacc->proxy_target_base = devm_platform_ioremap_resource_byname(pdev,
1402+
"proxy_target");
14101403
if (IS_ERR(ringacc->proxy_target_base))
14111404
return PTR_ERR(ringacc->proxy_target_base);
14121405

@@ -1473,7 +1466,6 @@ struct k3_ringacc *k3_ringacc_dmarings_init(struct platform_device *pdev,
14731466
struct device *dev = &pdev->dev;
14741467
struct k3_ringacc *ringacc;
14751468
void __iomem *base_rt;
1476-
struct resource *res;
14771469
int i;
14781470

14791471
ringacc = devm_kzalloc(dev, sizeof(*ringacc), GFP_KERNEL);
@@ -1488,8 +1480,7 @@ struct k3_ringacc *k3_ringacc_dmarings_init(struct platform_device *pdev,
14881480

14891481
mutex_init(&ringacc->req_lock);
14901482

1491-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ringrt");
1492-
base_rt = devm_ioremap_resource(dev, res);
1483+
base_rt = devm_platform_ioremap_resource_byname(pdev, "ringrt");
14931484
if (IS_ERR(base_rt))
14941485
return ERR_CAST(base_rt);
14951486

drivers/soc/ti/k3-socinfo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ static const struct k3_soc_id {
4545
{ 0xBB7E, "AM62X" },
4646
{ 0xBB80, "J784S4" },
4747
{ 0xBB8D, "AM62AX" },
48+
{ 0xBB9D, "AM62PX" },
4849
};
4950

5051
static int

drivers/soc/ti/pruss.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
#include <linux/io.h>
1515
#include <linux/mfd/syscon.h>
1616
#include <linux/module.h>
17+
#include <linux/of.h>
1718
#include <linux/of_address.h>
18-
#include <linux/of_device.h>
19+
#include <linux/of_platform.h>
20+
#include <linux/platform_device.h>
1921
#include <linux/pm_runtime.h>
2022
#include <linux/pruss_driver.h>
2123
#include <linux/regmap.h>

drivers/soc/ti/ti_sci_inta_msi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
#include <linux/irq.h>
1010
#include <linux/irqdomain.h>
1111
#include <linux/msi.h>
12+
#include <linux/of.h>
1213
#include <linux/of_address.h>
13-
#include <linux/of_device.h>
1414
#include <linux/of_irq.h>
15+
#include <linux/platform_device.h>
1516
#include <linux/soc/ti/ti_sci_inta_msi.h>
1617
#include <linux/soc/ti/ti_sci_protocol.h>
1718

0 commit comments

Comments
 (0)