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.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE+KKGk1TrgjIXoxo03bWEnRc2JJ0FAmTaSAgACgkQ3bWEnRc2
 JJ2bHhAArQBIlE2hSKOhQp2voNiSywrs94YOrrFKX+rb4DZFPUt3PtqMut8N86oS
 Hq8HeztxyCL5Lsi5p4eqi4DICAT6cdLqLQu4o1Nk8G+/1xC9bUSMxxDAvp9WqcKe
 VRjSnDrO5USU/FSQh2OVtBzYYqeNtrXtHIhih/XurH2C0RMev27RIMg2IeMq1ZBg
 OqerwxoV9FdjnUB74RrLhWPehSMGO3P7x2rwS8EndZ7CbQekHyhWDNW7SrIyvfre
 X5GpdRjOT4eCEKpEVvDoHPZZkwvGSYtXEuRKq0W3faCv+uHL3CAvWVuYWwZvYUUK
 SbJfJb/j94U24B75MynOSLYYyzDVwz1vvrfKeA+ZS+v/T1HqOPVHyCR8rff+fvBa
 jbk950oMwqJdRJ0wyrtlhQXCzXJ+8kVG5VOYW8eef0bMUsqVt/r+40V3imyVmn3E
 SqYisWOXUSZBgMdUiQwCw6+ZNeZEeBwT7328y+tpLBbNtp5psDLH9NWii79f0JiL
 Gy8hbYAzVnozLYd0Z0IHueQ7zTHJ/GLR1NphArwlj9nL9ZOlxWibADMdyc0rsp8h
 RSxTmbxY8/wwh+8wqgAoafzxeigL4Aer6KOb3xpbVqxUTx8aq9Bh0Jg6izhZCSrj
 cd2TQuamXE8lIKpmQfsHIlaTpP/YelSOSZgMpIHwnUJzEaGYHvA=
 =vMl/
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTaVbMACgkQYKtH/8kJ
 Uid/Sw//ar4Qf8XWgGThf08hP2Xv6fQEHwNiCOxP6+Jozfr8cKW3nX/ZXLSoGfC3
 fSThkm8Nny2b45cZax03JSaBOkFZMxBshISVkl9mUSelEGPMIfQejx+P1xQVW+V4
 50NbxE62Ezs6NPpF6yIOE8OYURZyMNUNioiKy6j3mlIPCVHuLixPdh1192SfHg8N
 GyIE6SEPA29j0rr8OwyXTIIct2ol0UStvrK8zx4Qmp14P+XbxMZI6YMNHXDJPy3i
 l/0HqSS0hFWCiLq8pa/Fl03QWfqDTYBSiBn2onYuMSg6msQgIkH6IPEA2NfY5itJ
 AFutvTH4YtUdfyGGac+zchtcVQHUDm2oJQxMHBpluU8695DWNWmqw7/ttP9gCwtk
 x2qtnwgu+k0C+fLWjMhv/hCg1tfB4j4aVZxAL9WKKpV4S4E7oWf8KCOJ8bn1DWUI
 slLKTVPSYSs4D9+66imjBYRF7tNqk+LDVYuRMQPW3bUFMRRIsK0ZVLBdYxC9w9Yj
 jFHeKvDmeMhCHjIB8pDC7626J7lTndHF0uRVLA591IYaRd3z8Oh4MCv0BsIVExPH
 31FPoEKIrhv6sQyShF6fYcO4V4I46rLaXszq+uRPOcucRrNQpQwIEa5DUJtr23ha
 n05PtlaOniNS7O2a2J9/kgyBupQCoO1IMS089IvLB/9wEaqV7j8=
 =wz6q
 -----END PGP SIGNATURE-----

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>
This commit is contained in:
Arnd Bergmann 2023-08-14 18:26:20 +02:00
commit 93e0acaec3
6 changed files with 30 additions and 71 deletions

View File

@ -97,7 +97,6 @@ struct ti_sci_desc {
* @node: list head
* @host_id: Host ID
* @users: Number of users of this instance
* @is_suspending: Flag set to indicate in suspend path.
*/
struct ti_sci_info {
struct device *dev;
@ -116,7 +115,6 @@ struct ti_sci_info {
u8 host_id;
/* protected by ti_sci_list_mutex */
int users;
bool is_suspending;
};
#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,
ret = 0;
if (!info->is_suspending) {
if (system_state <= SYSTEM_RUNNING) {
/* And we wait for the response. */
timeout = msecs_to_jiffies(info->desc->max_rx_timeout_ms);
if (!wait_for_completion_timeout(&xfer->done, timeout))
ret = -ETIMEDOUT;
} else {
/*
* If we are suspending, we cannot use wait_for_completion_timeout
* If we are !running, we cannot use wait_for_completion_timeout
* during noirq phase, so we must manually poll the completion.
*/
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,
* @src_index: IRQ source index within the source device
* @dst_id: Device ID of the IRQ destination
* @dst_host_irq: IRQ number of the destination device
* @vint_irq: Boolean specifying if this interrupt belongs to
* Interrupt Aggregator.
*
* Return: 0 if all went fine, else return appropriate error.
*/
@ -2026,8 +2022,6 @@ static int ti_sci_cmd_set_event_map(const struct ti_sci_handle *handle,
* @src_index: IRQ source index within the source device
* @dst_id: Device ID of the IRQ destination
* @dst_host_irq: IRQ number of the destination device
* @vint_irq: Boolean specifying if this interrupt belongs to
* Interrupt Aggregator.
*
* Return: 0 if all went fine, else return appropriate error.
*/
@ -2620,6 +2614,7 @@ fail:
* configuration flags
* @handle: Pointer to TI SCI handle
* @proc_id: Processor ID this request is for
* @bootvector: Processor Boot vector (start address)
* @config_flags_set: Configuration flags to be set
* @config_flags_clear: Configuration flags to be cleared.
*
@ -2736,9 +2731,13 @@ fail:
}
/**
* ti_sci_cmd_get_boot_status() - Command to get the processor boot status
* ti_sci_cmd_proc_get_status() - Command to get the processor boot status
* @handle: Pointer to TI SCI handle
* @proc_id: Processor ID this request is for
* @bv: Processor Boot vector (start address)
* @cfg_flags: Processor specific configuration flags
* @ctrl_flags: Processor specific control flags
* @sts_flags: Processor specific status flags
*
* Return: 0 if all went well, else returns appropriate error value.
*/
@ -3256,7 +3255,7 @@ EXPORT_SYMBOL_GPL(devm_ti_sci_get_of_resource);
* @handle: TISCI handle
* @dev: Device pointer to which the resource is assigned
* @dev_id: TISCI device id to which the resource is assigned
* @suub_type: TISCI resource subytpe representing the resource.
* @sub_type: TISCI resource subytpe representing the resource.
*
* Return: Pointer to ti_sci_resource if all went well else appropriate
* error pointer.
@ -3281,35 +3280,6 @@ static int tisci_reboot_handler(struct notifier_block *nb, unsigned long mode,
return NOTIFY_BAD;
}
static void ti_sci_set_is_suspending(struct ti_sci_info *info, bool is_suspending)
{
info->is_suspending = is_suspending;
}
static int ti_sci_suspend(struct device *dev)
{
struct ti_sci_info *info = dev_get_drvdata(dev);
/*
* We must switch operation to polled mode now as drivers and the genpd
* layer may make late TI SCI calls to change clock and device states
* from the noirq phase of suspend.
*/
ti_sci_set_is_suspending(info, true);
return 0;
}
static int ti_sci_resume(struct device *dev)
{
struct ti_sci_info *info = dev_get_drvdata(dev);
ti_sci_set_is_suspending(info, false);
return 0;
}
static DEFINE_SIMPLE_DEV_PM_OPS(ti_sci_pm_ops, ti_sci_suspend, ti_sci_resume);
/* Description for K2G */
static const struct ti_sci_desc ti_sci_pmmc_k2g_desc = {
.default_host_id = 2,
@ -3516,7 +3486,6 @@ static struct platform_driver ti_sci_driver = {
.driver = {
.name = "ti-sci",
.of_match_table = of_match_ptr(ti_sci_of_match),
.pm = &ti_sci_pm_ops,
},
};
module_platform_driver(ti_sci_driver);

View File

@ -13,7 +13,6 @@
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/pm_clock.h>
#include <linux/pm_domain.h>
@ -943,10 +942,6 @@ static int omap_prm_probe(struct platform_device *pdev)
struct omap_prm *prm;
int ret;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENODEV;
data = of_device_get_match_data(&pdev->dev);
if (!data)
return -ENOTSUPP;
@ -955,6 +950,10 @@ static int omap_prm_probe(struct platform_device *pdev)
if (!prm)
return -ENOMEM;
prm->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(prm->base))
return PTR_ERR(prm->base);
while (data->base != res->start) {
if (!data->base)
return -EINVAL;
@ -963,10 +962,6 @@ static int omap_prm_probe(struct platform_device *pdev)
prm->data = data;
prm->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(prm->base))
return PTR_ERR(prm->base);
ret = omap_prm_domain_init(&pdev->dev, prm);
if (ret)
return ret;

View File

@ -9,7 +9,6 @@
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/sys_soc.h>
#include <linux/dma/ti-cppi5.h>
@ -125,6 +124,7 @@ struct k3_ring_ops {
* @occ: Occupancy
* @windex: Write index
* @rindex: Read index
* @tdown_complete: Tear down complete state
*/
struct k3_ring_state {
u32 free;
@ -192,7 +192,7 @@ struct k3_ringacc_ops {
* @num_rings: number of ring in RA
* @rings_inuse: bitfield for ring usage tracking
* @rm_gp_range: general purpose rings range from tisci
* @dma_ring_reset_quirk: DMA reset w/a enable
* @dma_ring_reset_quirk: DMA reset workaround enable
* @num_proxies: number of RA proxies
* @proxy_inuse: bitfield for proxy usage tracking
* @rings: array of rings descriptors (struct @k3_ring)
@ -229,9 +229,9 @@ struct k3_ringacc {
};
/**
* struct k3_ringacc - Rings accelerator SoC data
* struct k3_ringacc_soc_data - Rings accelerator SoC data
*
* @dma_ring_reset_quirk: DMA reset w/a enable
* @dma_ring_reset_quirk: DMA reset workaround enable
*/
struct k3_ringacc_soc_data {
unsigned dma_ring_reset_quirk:1;
@ -1368,15 +1368,12 @@ static int k3_ringacc_init(struct platform_device *pdev,
const struct soc_device_attribute *soc;
void __iomem *base_fifo, *base_rt;
struct device *dev = &pdev->dev;
struct resource *res;
int ret, i;
dev->msi.domain = of_msi_get_domain(dev, dev->of_node,
DOMAIN_BUS_TI_SCI_INTA_MSI);
if (!dev->msi.domain) {
dev_err(dev, "Failed to get MSI domain\n");
if (!dev->msi.domain)
return -EPROBE_DEFER;
}
ret = k3_ringacc_probe_dt(ringacc);
if (ret)
@ -1389,24 +1386,20 @@ static int k3_ringacc_init(struct platform_device *pdev,
ringacc->dma_ring_reset_quirk = soc_data->dma_ring_reset_quirk;
}
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rt");
base_rt = devm_ioremap_resource(dev, res);
base_rt = devm_platform_ioremap_resource_byname(pdev, "rt");
if (IS_ERR(base_rt))
return PTR_ERR(base_rt);
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fifos");
base_fifo = devm_ioremap_resource(dev, res);
base_fifo = devm_platform_ioremap_resource_byname(pdev, "fifos");
if (IS_ERR(base_fifo))
return PTR_ERR(base_fifo);
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "proxy_gcfg");
ringacc->proxy_gcfg = devm_ioremap_resource(dev, res);
ringacc->proxy_gcfg = devm_platform_ioremap_resource_byname(pdev, "proxy_gcfg");
if (IS_ERR(ringacc->proxy_gcfg))
return PTR_ERR(ringacc->proxy_gcfg);
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
"proxy_target");
ringacc->proxy_target_base = devm_ioremap_resource(dev, res);
ringacc->proxy_target_base = devm_platform_ioremap_resource_byname(pdev,
"proxy_target");
if (IS_ERR(ringacc->proxy_target_base))
return PTR_ERR(ringacc->proxy_target_base);
@ -1473,7 +1466,6 @@ struct k3_ringacc *k3_ringacc_dmarings_init(struct platform_device *pdev,
struct device *dev = &pdev->dev;
struct k3_ringacc *ringacc;
void __iomem *base_rt;
struct resource *res;
int i;
ringacc = devm_kzalloc(dev, sizeof(*ringacc), GFP_KERNEL);
@ -1488,8 +1480,7 @@ struct k3_ringacc *k3_ringacc_dmarings_init(struct platform_device *pdev,
mutex_init(&ringacc->req_lock);
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ringrt");
base_rt = devm_ioremap_resource(dev, res);
base_rt = devm_platform_ioremap_resource_byname(pdev, "ringrt");
if (IS_ERR(base_rt))
return ERR_CAST(base_rt);

View File

@ -45,6 +45,7 @@ static const struct k3_soc_id {
{ 0xBB7E, "AM62X" },
{ 0xBB80, "J784S4" },
{ 0xBB8D, "AM62AX" },
{ 0xBB9D, "AM62PX" },
};
static int

View File

@ -14,8 +14,10 @@
#include <linux/io.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/pruss_driver.h>
#include <linux/regmap.h>

View File

@ -9,9 +9,10 @@
#include <linux/irq.h>
#include <linux/irqdomain.h>
#include <linux/msi.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h>
#include <linux/soc/ti/ti_sci_inta_msi.h>
#include <linux/soc/ti/ti_sci_protocol.h>