Skip to content

Commit 1c37b63

Browse files
committed
Merge tag 'imx-drivers-6.17' of https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/drivers
i.MX drivers changes for 6.17: - A couple of MAINTAINERS updates - A new bus driver for i.MX AIPSTZ bridge and a follow-up fix from Laurentiu Mihalcea * tag 'imx-drivers-6.17' of https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: bus: imx-aipstz: allow creating pdevs for child buses MAINTAINERS: Update i.MX entry bus: add driver for IMX AIPSTZ bridge MAINTAINERS: add NXP S32G RTC driver Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 62bd59c + 5080cf6 commit 1c37b63

File tree

4 files changed

+119
-0
lines changed

4 files changed

+119
-0
lines changed

MAINTAINERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,6 +2585,8 @@ L: [email protected]
25852585
L: [email protected] (moderated for non-subscribers)
25862586
S: Maintained
25872587
T: git git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git
2588+
F: Documentation/devicetree/bindings/firmware/fsl*
2589+
F: Documentation/devicetree/bindings/firmware/nxp*
25882590
F: arch/arm/boot/dts/nxp/imx/
25892591
F: arch/arm/boot/dts/nxp/mxs/
25902592
F: arch/arm64/boot/dts/freescale/
@@ -3000,8 +3002,10 @@ R: Ghennadi Procopciuc <[email protected]>
30003002
R: NXP S32 Linux Team <[email protected]>
30013003
L: [email protected] (moderated for non-subscribers)
30023004
S: Maintained
3005+
F: Documentation/devicetree/bindings/rtc/nxp,s32g-rtc.yaml
30033006
F: arch/arm64/boot/dts/freescale/s32g*.dts*
30043007
F: drivers/pinctrl/nxp/
3008+
F: drivers/rtc/rtc-s32g.c
30053009

30063010
ARM/NXP S32G/S32R DWMAC ETHERNET DRIVER
30073011
M: Jan Petrous <[email protected]>

drivers/bus/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ config HISILICON_LPC
8787
Driver to enable I/O access to devices attached to the Low Pin
8888
Count bus on the HiSilicon Hip06/7 SoC.
8989

90+
config IMX_AIPSTZ
91+
tristate "Support for IMX Secure AHB to IP Slave bus (AIPSTZ) bridge"
92+
depends on ARCH_MXC
93+
help
94+
Enable support for IMX AIPSTZ bridge.
95+
9096
config IMX_WEIM
9197
bool "Freescale EIM DRIVER"
9298
depends on ARCH_MXC || COMPILE_TEST

drivers/bus/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ obj-$(CONFIG_FSL_MC_BUS) += fsl-mc/
1515

1616
obj-$(CONFIG_BT1_APB) += bt1-apb.o
1717
obj-$(CONFIG_BT1_AXI) += bt1-axi.o
18+
obj-$(CONFIG_IMX_AIPSTZ) += imx-aipstz.o
1819
obj-$(CONFIG_IMX_WEIM) += imx-weim.o
1920
obj-$(CONFIG_INTEL_IXP4XX_EB) += intel-ixp4xx-eb.o
2021
obj-$(CONFIG_MIPS_CDMM) += mips_cdmm.o

drivers/bus/imx-aipstz.c

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* Copyright 2025 NXP
4+
*/
5+
6+
#include <linux/module.h>
7+
#include <linux/of.h>
8+
#include <linux/of_platform.h>
9+
#include <linux/platform_device.h>
10+
#include <linux/pm_runtime.h>
11+
#include <linux/regmap.h>
12+
13+
#define IMX_AIPSTZ_MPR0 0x0
14+
15+
struct imx_aipstz_config {
16+
u32 mpr0;
17+
};
18+
19+
struct imx_aipstz_data {
20+
void __iomem *base;
21+
const struct imx_aipstz_config *default_cfg;
22+
};
23+
24+
static void imx_aipstz_apply_default(struct imx_aipstz_data *data)
25+
{
26+
writel(data->default_cfg->mpr0, data->base + IMX_AIPSTZ_MPR0);
27+
}
28+
29+
static const struct of_device_id imx_aipstz_match_table[] = {
30+
{ .compatible = "simple-bus", },
31+
{ }
32+
};
33+
34+
static int imx_aipstz_probe(struct platform_device *pdev)
35+
{
36+
struct imx_aipstz_data *data;
37+
38+
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
39+
if (!data)
40+
return dev_err_probe(&pdev->dev, -ENOMEM,
41+
"failed to allocate data memory\n");
42+
43+
data->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
44+
if (IS_ERR(data->base))
45+
return dev_err_probe(&pdev->dev, -ENOMEM,
46+
"failed to get/ioremap AC memory\n");
47+
48+
data->default_cfg = of_device_get_match_data(&pdev->dev);
49+
50+
imx_aipstz_apply_default(data);
51+
52+
dev_set_drvdata(&pdev->dev, data);
53+
54+
pm_runtime_set_active(&pdev->dev);
55+
devm_pm_runtime_enable(&pdev->dev);
56+
57+
return of_platform_populate(pdev->dev.of_node, imx_aipstz_match_table,
58+
NULL, &pdev->dev);
59+
}
60+
61+
static void imx_aipstz_remove(struct platform_device *pdev)
62+
{
63+
of_platform_depopulate(&pdev->dev);
64+
}
65+
66+
static int imx_aipstz_runtime_resume(struct device *dev)
67+
{
68+
struct imx_aipstz_data *data = dev_get_drvdata(dev);
69+
70+
/* restore potentially lost configuration during domain power-off */
71+
imx_aipstz_apply_default(data);
72+
73+
return 0;
74+
}
75+
76+
static const struct dev_pm_ops imx_aipstz_pm_ops = {
77+
RUNTIME_PM_OPS(NULL, imx_aipstz_runtime_resume, NULL)
78+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
79+
};
80+
81+
/*
82+
* following configuration is equivalent to:
83+
* masters 0-7 => trusted for R/W + use AHB's HPROT[1] to det. privilege
84+
*/
85+
static const struct imx_aipstz_config imx8mp_aipstz_default_cfg = {
86+
.mpr0 = 0x77777777,
87+
};
88+
89+
static const struct of_device_id imx_aipstz_of_ids[] = {
90+
{ .compatible = "fsl,imx8mp-aipstz", .data = &imx8mp_aipstz_default_cfg },
91+
{ }
92+
};
93+
MODULE_DEVICE_TABLE(of, imx_aipstz_of_ids);
94+
95+
static struct platform_driver imx_aipstz_of_driver = {
96+
.probe = imx_aipstz_probe,
97+
.remove = imx_aipstz_remove,
98+
.driver = {
99+
.name = "imx-aipstz",
100+
.of_match_table = imx_aipstz_of_ids,
101+
.pm = pm_ptr(&imx_aipstz_pm_ops),
102+
},
103+
};
104+
module_platform_driver(imx_aipstz_of_driver);
105+
106+
MODULE_LICENSE("GPL");
107+
MODULE_DESCRIPTION("IMX secure AHB to IP Slave bus (AIPSTZ) bridge driver");
108+
MODULE_AUTHOR("Laurentiu Mihalcea <[email protected]>");

0 commit comments

Comments
 (0)