summaryrefslogtreecommitdiffstats
path: root/drivers/bus
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-12-31 20:32:35 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-12-31 20:32:35 -0500
commitd36377c6eb071e3d0751e9e0e3c19198c58d9a5d (patch)
treebf1d28abd5fac5c826079c4b760ca34263f0fab4 /drivers/bus
parent0922275ef157ba8ac93e7e7857087eb0442d5397 (diff)
parenta6f119a06960ef1dc30570401e43b71f9ebdd2c2 (diff)
Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver updates from Olof Johansson: "Misc driver updates for platforms, many of them power related. - Rockchip adds power domain support for rk3066 and rk3188 - Amlogic adds a power measurement driver - Allwinner adds SRAM support for three platforms (F1C100, H5, A64 C1) - Wakeup and ti-sysc (platform bus) fixes for OMAP/DRA7 - Broadcom fixes suspend/resume with Thumb2 kernels, and improves stability of a handful of firmware/platform interfaces - PXA completes their conversion to dmaengine framework - Renesas does a bunch of PM cleanups across many platforms - Tegra adds support for suspend/resume on T186/T194, which includes some driver cleanups and addition of wake events - Tegra also adds a driver for memory controller (EMC) on Tegra2 - i.MX tweaks power domain bindings, and adds support for i.MX8MQ in GPC - Atmel adds identifiers and LPDDR2 support for a new SoC, SAM9X60 and misc cleanups across several platforms" * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (73 commits) ARM: at91: add support in soc driver for new SAM9X60 ARM: at91: add support in soc driver for LPDDR2 SiP memory: omap-gpmc: Use of_node_name_eq for node name comparisons bus: ti-sysc: Check for no-reset and no-idle flags at the child level ARM: OMAP2+: Check also the first dts child for hwmod flags soc: amlogic: meson-clk-measure: Add missing REGMAP_MMIO dependency soc: imx: gpc: Increase GPC_CLK_MAX to 7 soc: renesas: rcar-sysc: Fix power domain control after system resume soc: renesas: rcar-sysc: Merge PM Domain registration and linking soc: renesas: rcar-sysc: Remove rcar_sysc_power_{down,up}() helpers soc: renesas: r8a77990-sysc: Fix initialization order of 3DG-{A,B} dt-bindings: sram: sunxi: Add compatible for the A64 SRAM C1 dt-bindings: sram: sunxi: Add bindings for the H5 with SRAM C1 dt-bindings: sram: Add Allwinner suniv F1C100s soc: sunxi: sram: Add support for the H5 SoC system control soc: sunxi: sram: Enable EMAC clock access for H3 variant soc: imx: gpcv2: add support for i.MX8MQ SoC soc: imx: gpcv2: move register access table to domain data soc: imx: gpcv2: prefix i.MX7 specific defines dmaengine: pxa: make the filter function internal ...
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/brcmstb_gisb.c12
-rw-r--r--drivers/bus/ti-sysc.c55
2 files changed, 50 insertions, 17 deletions
diff --git a/drivers/bus/brcmstb_gisb.c b/drivers/bus/brcmstb_gisb.c
index 68ac3e93b600..f58ff67e97ac 100644
--- a/drivers/bus/brcmstb_gisb.c
+++ b/drivers/bus/brcmstb_gisb.c
@@ -150,8 +150,7 @@ static ssize_t gisb_arb_get_timeout(struct device *dev,
150 struct device_attribute *attr, 150 struct device_attribute *attr,
151 char *buf) 151 char *buf)
152{ 152{
153 struct platform_device *pdev = to_platform_device(dev); 153 struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev);
154 struct brcmstb_gisb_arb_device *gdev = platform_get_drvdata(pdev);
155 u32 timeout; 154 u32 timeout;
156 155
157 mutex_lock(&gdev->lock); 156 mutex_lock(&gdev->lock);
@@ -165,8 +164,7 @@ static ssize_t gisb_arb_set_timeout(struct device *dev,
165 struct device_attribute *attr, 164 struct device_attribute *attr,
166 const char *buf, size_t count) 165 const char *buf, size_t count)
167{ 166{
168 struct platform_device *pdev = to_platform_device(dev); 167 struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev);
169 struct brcmstb_gisb_arb_device *gdev = platform_get_drvdata(pdev);
170 int val, ret; 168 int val, ret;
171 169
172 ret = kstrtoint(buf, 10, &val); 170 ret = kstrtoint(buf, 10, &val);
@@ -418,8 +416,7 @@ static int __init brcmstb_gisb_arb_probe(struct platform_device *pdev)
418#ifdef CONFIG_PM_SLEEP 416#ifdef CONFIG_PM_SLEEP
419static int brcmstb_gisb_arb_suspend(struct device *dev) 417static int brcmstb_gisb_arb_suspend(struct device *dev)
420{ 418{
421 struct platform_device *pdev = to_platform_device(dev); 419 struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev);
422 struct brcmstb_gisb_arb_device *gdev = platform_get_drvdata(pdev);
423 420
424 gdev->saved_timeout = gisb_read(gdev, ARB_TIMER); 421 gdev->saved_timeout = gisb_read(gdev, ARB_TIMER);
425 422
@@ -431,8 +428,7 @@ static int brcmstb_gisb_arb_suspend(struct device *dev)
431 */ 428 */
432static int brcmstb_gisb_arb_resume_noirq(struct device *dev) 429static int brcmstb_gisb_arb_resume_noirq(struct device *dev)
433{ 430{
434 struct platform_device *pdev = to_platform_device(dev); 431 struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev);
435 struct brcmstb_gisb_arb_device *gdev = platform_get_drvdata(pdev);
436 432
437 gisb_write(gdev, gdev->saved_timeout, ARB_TIMER); 433 gisb_write(gdev, gdev->saved_timeout, ARB_TIMER);
438 434
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index a3a2d39280d9..f94d33525771 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -91,6 +91,9 @@ struct sysc {
91 struct delayed_work idle_work; 91 struct delayed_work idle_work;
92}; 92};
93 93
94static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np,
95 bool is_child);
96
94void sysc_write(struct sysc *ddata, int offset, u32 value) 97void sysc_write(struct sysc *ddata, int offset, u32 value)
95{ 98{
96 writel_relaxed(value, ddata->module_va + offset); 99 writel_relaxed(value, ddata->module_va + offset);
@@ -214,8 +217,13 @@ static int sysc_get_clocks(struct sysc *ddata)
214 if (!ddata->clocks) 217 if (!ddata->clocks)
215 return -ENOMEM; 218 return -ENOMEM;
216 219
217 for (i = 0; i < ddata->nr_clocks; i++) { 220 for (i = 0; i < SYSC_MAX_CLOCKS; i++) {
218 error = sysc_get_one_clock(ddata, ddata->clock_roles[i]); 221 const char *name = ddata->clock_roles[i];
222
223 if (!name)
224 continue;
225
226 error = sysc_get_one_clock(ddata, name);
219 if (error && error != -ENOENT) 227 if (error && error != -ENOENT)
220 return error; 228 return error;
221 } 229 }
@@ -374,6 +382,7 @@ static int sysc_check_one_child(struct sysc *ddata,
374 dev_warn(ddata->dev, "really a child ti,hwmods property?"); 382 dev_warn(ddata->dev, "really a child ti,hwmods property?");
375 383
376 sysc_check_quirk_stdout(ddata, np); 384 sysc_check_quirk_stdout(ddata, np);
385 sysc_parse_dts_quirks(ddata, np, true);
377 386
378 return 0; 387 return 0;
379} 388}
@@ -815,6 +824,7 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
815 SYSC_QUIRK("ocp2scp", 0, 0, 0x10, 0x14, 0x50060005, 0xfffffff0, 0), 824 SYSC_QUIRK("ocp2scp", 0, 0, 0x10, 0x14, 0x50060005, 0xfffffff0, 0),
816 SYSC_QUIRK("ocp2scp", 0, 0, -1, -1, 0x50060007, 0xffffffff, 0), 825 SYSC_QUIRK("ocp2scp", 0, 0, -1, -1, 0x50060007, 0xffffffff, 0),
817 SYSC_QUIRK("padconf", 0, 0, 0x10, -1, 0x4fff0800, 0xffffffff, 0), 826 SYSC_QUIRK("padconf", 0, 0, 0x10, -1, 0x4fff0800, 0xffffffff, 0),
827 SYSC_QUIRK("padconf", 0, 0, -1, -1, 0x40001100, 0xffffffff, 0),
818 SYSC_QUIRK("prcm", 0, 0, -1, -1, 0x40000100, 0xffffffff, 0), 828 SYSC_QUIRK("prcm", 0, 0, -1, -1, 0x40000100, 0xffffffff, 0),
819 SYSC_QUIRK("prcm", 0, 0, -1, -1, 0x00004102, 0xffffffff, 0), 829 SYSC_QUIRK("prcm", 0, 0, -1, -1, 0x00004102, 0xffffffff, 0),
820 SYSC_QUIRK("prcm", 0, 0, -1, -1, 0x40000400, 0xffffffff, 0), 830 SYSC_QUIRK("prcm", 0, 0, -1, -1, 0x40000400, 0xffffffff, 0),
@@ -833,7 +843,9 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
833 SYSC_QUIRK("rtc", 0, 0x74, 0x78, -1, 0x4eb01908, 0xffff00f0, 0), 843 SYSC_QUIRK("rtc", 0, 0x74, 0x78, -1, 0x4eb01908, 0xffff00f0, 0),
834 SYSC_QUIRK("timer32k", 0, 0, 0x4, -1, 0x00000060, 0xffffffff, 0), 844 SYSC_QUIRK("timer32k", 0, 0, 0x4, -1, 0x00000060, 0xffffffff, 0),
835 SYSC_QUIRK("usbhstll", 0, 0, 0x10, 0x14, 0x00000004, 0xffffffff, 0), 845 SYSC_QUIRK("usbhstll", 0, 0, 0x10, 0x14, 0x00000004, 0xffffffff, 0),
846 SYSC_QUIRK("usbhstll", 0, 0, 0x10, 0x14, 0x00000008, 0xffffffff, 0),
836 SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, 0x14, 0x50700100, 0xffffffff, 0), 847 SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, 0x14, 0x50700100, 0xffffffff, 0),
848 SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, -1, 0x50700101, 0xffffffff, 0),
837 SYSC_QUIRK("usb_otg_hs", 0, 0x400, 0x404, 0x408, 0x00000050, 849 SYSC_QUIRK("usb_otg_hs", 0, 0x400, 0x404, 0x408, 0x00000050,
838 0xffffffff, 0), 850 0xffffffff, 0),
839 SYSC_QUIRK("wdt", 0, 0, 0x10, 0x14, 0x502a0500, 0xfffff0f0, 0), 851 SYSC_QUIRK("wdt", 0, 0, 0x10, 0x14, 0x502a0500, 0xfffff0f0, 0),
@@ -1271,23 +1283,37 @@ static const struct sysc_dts_quirk sysc_dts_quirks[] = {
1271 .mask = SYSC_QUIRK_NO_RESET_ON_INIT, }, 1283 .mask = SYSC_QUIRK_NO_RESET_ON_INIT, },
1272}; 1284};
1273 1285
1274static int sysc_init_dts_quirks(struct sysc *ddata) 1286static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np,
1287 bool is_child)
1275{ 1288{
1276 struct device_node *np = ddata->dev->of_node;
1277 const struct property *prop; 1289 const struct property *prop;
1278 int i, len, error; 1290 int i, len;
1279 u32 val;
1280
1281 ddata->legacy_mode = of_get_property(np, "ti,hwmods", NULL);
1282 1291
1283 for (i = 0; i < ARRAY_SIZE(sysc_dts_quirks); i++) { 1292 for (i = 0; i < ARRAY_SIZE(sysc_dts_quirks); i++) {
1284 prop = of_get_property(np, sysc_dts_quirks[i].name, &len); 1293 const char *name = sysc_dts_quirks[i].name;
1294
1295 prop = of_get_property(np, name, &len);
1285 if (!prop) 1296 if (!prop)
1286 continue; 1297 continue;
1287 1298
1288 ddata->cfg.quirks |= sysc_dts_quirks[i].mask; 1299 ddata->cfg.quirks |= sysc_dts_quirks[i].mask;
1300 if (is_child) {
1301 dev_warn(ddata->dev,
1302 "dts flag should be at module level for %s\n",
1303 name);
1304 }
1289 } 1305 }
1306}
1290 1307
1308static int sysc_init_dts_quirks(struct sysc *ddata)
1309{
1310 struct device_node *np = ddata->dev->of_node;
1311 int error;
1312 u32 val;
1313
1314 ddata->legacy_mode = of_get_property(np, "ti,hwmods", NULL);
1315
1316 sysc_parse_dts_quirks(ddata, np, false);
1291 error = of_property_read_u32(np, "ti,sysc-delay-us", &val); 1317 error = of_property_read_u32(np, "ti,sysc-delay-us", &val);
1292 if (!error) { 1318 if (!error) {
1293 if (val > 255) { 1319 if (val > 255) {
@@ -1498,6 +1524,16 @@ static const struct sysc_regbits sysc_regbits_omap4_mcasp = {
1498static const struct sysc_capabilities sysc_omap4_mcasp = { 1524static const struct sysc_capabilities sysc_omap4_mcasp = {
1499 .type = TI_SYSC_OMAP4_MCASP, 1525 .type = TI_SYSC_OMAP4_MCASP,
1500 .regbits = &sysc_regbits_omap4_mcasp, 1526 .regbits = &sysc_regbits_omap4_mcasp,
1527 .mod_quirks = SYSC_QUIRK_OPT_CLKS_NEEDED,
1528};
1529
1530/*
1531 * McASP found on dra7 and later
1532 */
1533static const struct sysc_capabilities sysc_dra7_mcasp = {
1534 .type = TI_SYSC_OMAP4_SIMPLE,
1535 .regbits = &sysc_regbits_omap4_simple,
1536 .mod_quirks = SYSC_QUIRK_OPT_CLKS_NEEDED,
1501}; 1537};
1502 1538
1503/* 1539/*
@@ -1726,6 +1762,7 @@ static const struct of_device_id sysc_match[] = {
1726 { .compatible = "ti,sysc-omap3-sham", .data = &sysc_omap3_sham, }, 1762 { .compatible = "ti,sysc-omap3-sham", .data = &sysc_omap3_sham, },
1727 { .compatible = "ti,sysc-omap-aes", .data = &sysc_omap3_aes, }, 1763 { .compatible = "ti,sysc-omap-aes", .data = &sysc_omap3_aes, },
1728 { .compatible = "ti,sysc-mcasp", .data = &sysc_omap4_mcasp, }, 1764 { .compatible = "ti,sysc-mcasp", .data = &sysc_omap4_mcasp, },
1765 { .compatible = "ti,sysc-dra7-mcasp", .data = &sysc_dra7_mcasp, },
1729 { .compatible = "ti,sysc-usb-host-fs", 1766 { .compatible = "ti,sysc-usb-host-fs",
1730 .data = &sysc_omap4_usb_host_fs, }, 1767 .data = &sysc_omap4_usb_host_fs, },
1731 { .compatible = "ti,sysc-dra7-mcan", .data = &sysc_dra7_mcan, }, 1768 { .compatible = "ti,sysc-dra7-mcan", .data = &sysc_dra7_mcan, },