Skip to content

Commit a72b44a

Browse files
committed
Merge tag 'omap-for-v4.19/fixes-v2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes
Fixes for omap variants against v4.19-rc1 These are mostly fixes related to using ti-sysc interconnect target module driver for accessing right register offsets for sgx and cpsw and for no_console_suspend regression. There is also a droid4 emmc fix where emmc may not get detected for some models, and vibrator dts mismerge fix. And we have a file permission fix for am335x-osd3358-sm-red.dts that just got added. And we must tag RTC as system-power-controller for am437x for PMIC to shut down during poweroff. * tag 'omap-for-v4.19/fixes-v2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: omap4-droid4: Fix emmc errors seen on some devices ARM: dts: Fix file permission for am335x-osd3358-sm-red.dts arm: dts: am4372: setup rtc as system-power-controller ARM: dts: omap4-droid4: fix vibrations on Droid 4 bus: ti-sysc: Fix no_console_suspend handling bus: ti-sysc: Fix module register ioremap for larger offsets ARM: OMAP2+: Fix module address for modules using mpu_rt_idx ARM: OMAP2+: Fix null hwmod for ti-sysc debug Signed-off-by: Olof Johansson <olof@lixom.net>
2 parents 67e6ddb + 2d59bb6 commit a72b44a

File tree

5 files changed

+66
-31
lines changed

5 files changed

+66
-31
lines changed

arch/arm/boot/dts/am335x-osd3358-sm-red.dts

100755100644
File mode changed.

arch/arm/boot/dts/am4372.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@
469469
ti,hwmods = "rtc";
470470
clocks = <&clk_32768_ck>;
471471
clock-names = "int-clk";
472+
system-power-controller;
472473
status = "disabled";
473474
};
474475

arch/arm/boot/dts/omap4-droid4-xt894.dts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@
354354
&mmc2 {
355355
vmmc-supply = <&vsdio>;
356356
bus-width = <8>;
357-
non-removable;
357+
ti,non-removable;
358358
};
359359

360360
&mmc3 {
@@ -621,15 +621,6 @@
621621
OMAP4_IOPAD(0x10c, PIN_INPUT | MUX_MODE1) /* abe_mcbsp3_fsx */
622622
>;
623623
};
624-
};
625-
626-
&omap4_pmx_wkup {
627-
usb_gpio_mux_sel2: pinmux_usb_gpio_mux_sel2_pins {
628-
/* gpio_wk0 */
629-
pinctrl-single,pins = <
630-
OMAP4_IOPAD(0x040, PIN_OUTPUT_PULLDOWN | MUX_MODE3)
631-
>;
632-
};
633624

634625
vibrator_direction_pin: pinmux_vibrator_direction_pin {
635626
pinctrl-single,pins = <
@@ -644,6 +635,15 @@
644635
};
645636
};
646637

638+
&omap4_pmx_wkup {
639+
usb_gpio_mux_sel2: pinmux_usb_gpio_mux_sel2_pins {
640+
/* gpio_wk0 */
641+
pinctrl-single,pins = <
642+
OMAP4_IOPAD(0x040, PIN_OUTPUT_PULLDOWN | MUX_MODE3)
643+
>;
644+
};
645+
};
646+
647647
/*
648648
* As uart1 is wired to mdm6600 with rts and cts, we can use the cts pin for
649649
* uart1 wakeirq.

arch/arm/mach-omap2/omap_hwmod.c

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2160,6 +2160,37 @@ static int of_dev_hwmod_lookup(struct device_node *np,
21602160
return -ENODEV;
21612161
}
21622162

2163+
/**
2164+
* omap_hwmod_fix_mpu_rt_idx - fix up mpu_rt_idx register offsets
2165+
*
2166+
* @oh: struct omap_hwmod *
2167+
* @np: struct device_node *
2168+
*
2169+
* Fix up module register offsets for modules with mpu_rt_idx.
2170+
* Only needed for cpsw with interconnect target module defined
2171+
* in device tree while still using legacy hwmod platform data
2172+
* for rev, sysc and syss registers.
2173+
*
2174+
* Can be removed when all cpsw hwmod platform data has been
2175+
* dropped.
2176+
*/
2177+
static void omap_hwmod_fix_mpu_rt_idx(struct omap_hwmod *oh,
2178+
struct device_node *np,
2179+
struct resource *res)
2180+
{
2181+
struct device_node *child = NULL;
2182+
int error;
2183+
2184+
child = of_get_next_child(np, child);
2185+
if (!child)
2186+
return;
2187+
2188+
error = of_address_to_resource(child, oh->mpu_rt_idx, res);
2189+
if (error)
2190+
pr_err("%s: error mapping mpu_rt_idx: %i\n",
2191+
__func__, error);
2192+
}
2193+
21632194
/**
21642195
* omap_hwmod_parse_module_range - map module IO range from device tree
21652196
* @oh: struct omap_hwmod *
@@ -2220,7 +2251,13 @@ int omap_hwmod_parse_module_range(struct omap_hwmod *oh,
22202251
size = be32_to_cpup(ranges);
22212252

22222253
pr_debug("omap_hwmod: %s %s at 0x%llx size 0x%llx\n",
2223-
oh->name, np->name, base, size);
2254+
oh ? oh->name : "", np->name, base, size);
2255+
2256+
if (oh && oh->mpu_rt_idx) {
2257+
omap_hwmod_fix_mpu_rt_idx(oh, np, res);
2258+
2259+
return 0;
2260+
}
22242261

22252262
res->start = base;
22262263
res->end = base + size - 1;

drivers/bus/ti-sysc.c

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -498,32 +498,29 @@ static int sysc_check_registers(struct sysc *ddata)
498498

499499
/**
500500
* syc_ioremap - ioremap register space for the interconnect target module
501-
* @ddata: deviec driver data
501+
* @ddata: device driver data
502502
*
503503
* Note that the interconnect target module registers can be anywhere
504-
* within the first child device address space. For example, SGX has
505-
* them at offset 0x1fc00 in the 32MB module address space. We just
506-
* what we need around the interconnect target module registers.
504+
* within the interconnect target module range. For example, SGX has
505+
* them at offset 0x1fc00 in the 32MB module address space. And cpsw
506+
* has them at offset 0x1200 in the CPSW_WR child. Usually the
507+
* the interconnect target module registers are at the beginning of
508+
* the module range though.
507509
*/
508510
static int sysc_ioremap(struct sysc *ddata)
509511
{
510-
u32 size = 0;
511-
512-
if (ddata->offsets[SYSC_SYSSTATUS] >= 0)
513-
size = ddata->offsets[SYSC_SYSSTATUS];
514-
else if (ddata->offsets[SYSC_SYSCONFIG] >= 0)
515-
size = ddata->offsets[SYSC_SYSCONFIG];
516-
else if (ddata->offsets[SYSC_REVISION] >= 0)
517-
size = ddata->offsets[SYSC_REVISION];
518-
else
519-
return -EINVAL;
512+
int size;
520513

521-
size &= 0xfff00;
522-
size += SZ_256;
514+
size = max3(ddata->offsets[SYSC_REVISION],
515+
ddata->offsets[SYSC_SYSCONFIG],
516+
ddata->offsets[SYSC_SYSSTATUS]);
517+
518+
if (size < 0 || (size + sizeof(u32)) > ddata->module_size)
519+
return -EINVAL;
523520

524521
ddata->module_va = devm_ioremap(ddata->dev,
525522
ddata->module_pa,
526-
size);
523+
size + sizeof(u32));
527524
if (!ddata->module_va)
528525
return -EIO;
529526

@@ -1224,10 +1221,10 @@ static int sysc_child_suspend_noirq(struct device *dev)
12241221
if (!pm_runtime_status_suspended(dev)) {
12251222
error = pm_generic_runtime_suspend(dev);
12261223
if (error) {
1227-
dev_err(dev, "%s error at %i: %i\n",
1228-
__func__, __LINE__, error);
1224+
dev_warn(dev, "%s busy at %i: %i\n",
1225+
__func__, __LINE__, error);
12291226

1230-
return error;
1227+
return 0;
12311228
}
12321229

12331230
error = sysc_runtime_suspend(ddata->dev);

0 commit comments

Comments
 (0)