Devicetree related musb changes for omap3 for v6.2

Recent musb driver regressions eposed two issues for musb legacy
 probing. The changes to use device_set_of_node_from_dev() confuse
 the legacy interconnect code. And we now have to manually populate
 the musb core irq resources.
 
 The musb driver has a fix for these, but it's not a good long term
 solution. To fix the issue properly, let's just update musb to
 probe with ti-sysc interconnect driver with proper devicetree data.
 This allows dropping most of the musb driver workaround later on.
 And with these changes we have the omap2430 musb glue layer behaving
 the same way for all the SoCs using it.
 
 We need to patch the ti-sysc driver quirks, and add devicetree
 data to make things work. And we want to drop the legacy data too
 to avoid pointless warnings.
 
 As we have a musb driver workaround, these changes are not needed as
 fixes and can wait for the merge window.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEkgNvrZJU/QSQYIcQG9Q+yVyrpXMFAmOAewgRHHRvbnlAYXRv
 bWlkZS5jb20ACgkQG9Q+yVyrpXNXqA/9FWruiCc9VLP3SuxgTC0QwSTjxWHz19Ra
 Jnmlf1hLMwfImp6xBcTWujbC/SRkn2BJE0fRUl/NqtpjqwnlaFvLMv+nA0J1OjLp
 wJepVoooc167LzlxREZfUNUR4ncG+upC9ZIFbhvlhwVRT1IguveBz9ycp1koFFS3
 urL4R0GLyQ+nts8O3gzisJmm8qfCkY8pvOdWOnM/K/NCizjqvBd7Ko/3WJcESU/1
 h8lJbYYGDBExhJl2e8mvkpG1RYYLleBzpgpByj2qd4iUVEph32Wos7xX4TocMrRD
 wlQ0RyFL2NPq+uIlwOYYpG2ucrvCO3KCOt4Sxl0DkoUMcWRFTKR7RwLBE0VJDv1p
 83Ae3PjzgUOcoTPeyIqsD3X/d3eNCzffLQKNH0JKhXyiqebfmnevpq1mYAeo/zg2
 Xu/6lYGj90yACJY2E2NWxrQmL4tjebomC4mHQkiECzuKHY5CGruLqcJnWyVyhX0o
 PpEwThYNzaNNqhNI+otRFeczYP7fdbPz3NzXerD5LVPwnfOZjYwqYJWgbD3UiITt
 B/yqm266XSiWtrQpCX4NnN0245eCCDPbNWri+Pdv9/71yu7Q7dlq+gT5qb4Gi1bn
 IDk+juWqdWsTgndqTWPLUd79+omQE8CZ+2SAj4WayTo71WtmSP/d+GOWJu3SdqC0
 ZuNV89T/ZB4=
 =V2rx
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmOHYswACgkQmmx57+YA
 GNmAjQ/9FZ+6rCgSYeOQ68oE0S/sBh/9lAvOdLCp0q8BShk7UWdLQQu7pYTiVpXl
 Iw60AmWpCLlzVOq+EF9XiEMfs59HBTLga5Ma9gOl36pjRUlP0xA233rOTFHY9wtS
 1LeZNfFeEJJUDky1bfBH8Ck6wvjs5ijKAecTZp3G6Lagt4zRgRHd22CCqW0WcTVT
 OJTleLW9iMdiGBKW75OfRu9ZKSXd10IoDLy9sv/cBBKgKwEImidRYgRyJR1ayv2y
 Xa/PNDVeqLl1nMuGZ0YxGW6KQFkGbeQEp2UrlyaaXGgF91DfFbNsjjdLaQiPrU5A
 ogl5PwHEIeXBoL5Zqo7kZmema5c7CTHwahGZaivGyOdmy85yTujBKg6NlzJRcH6m
 ap5cbsMt/lJSsHYaHgepI/Bx8EaOK8sYk5dynRHU8hSYdHWmuejQUGcemysIioRQ
 nPS/6ttohu1LlC1hIMJpYOzvYSPCbR0fHgVIllX3WxZLcNUvPV9d2V5Q9UeGeyrF
 +YXBULGca83da6AXYWYX3y7GToWjbDfLyd0nw4BHWw+w1fcBfvFzovpeF1MKDooJ
 j/5FqwNM06zeUJLnUXVAUxuZLOPKE66xuQZ4xTio1oWiNsyBxFc0Lxn6X6yAzo9x
 ZvkdaggvT4wVQx9/r+583/fRAs9dF2r/iuEvHu+kEoqX8bHw3s0=
 =U6a8
 -----END PGP SIGNATURE-----

Merge tag 'musb-for-v6.2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into soc/dt

Devicetree related musb changes for omap3 for v6.2

Recent musb driver regressions eposed two issues for musb legacy
probing. The changes to use device_set_of_node_from_dev() confuse
the legacy interconnect code. And we now have to manually populate
the musb core irq resources.

The musb driver has a fix for these, but it's not a good long term
solution. To fix the issue properly, let's just update musb to
probe with ti-sysc interconnect driver with proper devicetree data.
This allows dropping most of the musb driver workaround later on.
And with these changes we have the omap2430 musb glue layer behaving
the same way for all the SoCs using it.

We need to patch the ti-sysc driver quirks, and add devicetree
data to make things work. And we want to drop the legacy data too
to avoid pointless warnings.

As we have a musb driver workaround, these changes are not needed as
fixes and can wait for the merge window.

* tag 'musb-for-v6.2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP2+: Drop legacy hwmod data for omap3 otg
  ARM: dts: Update omap3 musb to probe with ti-sysc
  bus: ti-sysc: Add otg quirk flags for omap3 musb

Link: https://lore.kernel.org/r/pull-1669364566-84575@atomide.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Arnd Bergmann 2022-11-30 15:03:42 +01:00
commit 799423ec5a
6 changed files with 75 additions and 116 deletions

View file

@ -49,13 +49,35 @@ opp100-600000000 {
};
ocp@68000000 {
am35x_otg_hs: am35x_otg_hs@5c040000 {
compatible = "ti,omap3-musb";
ti,hwmods = "am35x_otg_hs";
status = "disabled";
reg = <0x5c040000 0x1000>;
interrupts = <71>;
interrupt-names = "mc";
target-module@5c040000 {
compatible = "ti,sysc-omap2", "ti,sysc";
reg = <0x5c040400 0x4>,
<0x5c040404 0x4>,
<0x5c040408 0x4>;
reg-names = "rev", "sysc", "syss";
ti,sysc-mask = <(SYSC_OMAP2_ENAWAKEUP |
SYSC_OMAP2_SOFTRESET |
SYSC_OMAP2_AUTOIDLE)>;
ti,sysc-midle = <SYSC_IDLE_FORCE>,
<SYSC_IDLE_NO>,
<SYSC_IDLE_SMART>;
ti,sysc-sidle = <SYSC_IDLE_FORCE>,
<SYSC_IDLE_NO>,
<SYSC_IDLE_SMART>;
ti,syss-mask = <1>;
clocks = <&hsotgusb_ick_am35xx>;
clock-names = "fck";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0x0 0x5c040000 0x1000>;
am35x_otg_hs: am35x_otg_hs@0 {
compatible = "ti,omap3-musb";
status = "disabled";
reg = <0 0x1000>;
interrupts = <71>;
interrupt-names = "mc";
};
};
davinci_emac: ethernet@5c000000 {
@ -154,7 +176,7 @@ &rng_target {
};
/* Table Table 5-79 of the TRM shows 480ab000 is reserved */
&usb_otg_hs {
&usb_otg_target {
status = "disabled";
};

View file

@ -893,15 +893,37 @@ gpmc: gpmc@6e000000 {
#gpio-cells = <2>;
};
usb_otg_hs: usb_otg_hs@480ab000 {
compatible = "ti,omap3-musb";
reg = <0x480ab000 0x1000>;
interrupts = <92>, <93>;
interrupt-names = "mc", "dma";
ti,hwmods = "usb_otg_hs";
multipoint = <1>;
num-eps = <16>;
ram-bits = <12>;
usb_otg_target: target-module@480ab000 {
compatible = "ti,sysc-omap2", "ti,sysc";
reg = <0x480ab400 0x4>,
<0x480ab404 0x4>,
<0x480ab408 0x4>;
reg-names = "rev", "sysc", "syss";
ti,sysc-mask = <(SYSC_OMAP2_ENAWAKEUP |
SYSC_OMAP2_SOFTRESET |
SYSC_OMAP2_AUTOIDLE)>;
ti,sysc-midle = <SYSC_IDLE_FORCE>,
<SYSC_IDLE_NO>,
<SYSC_IDLE_SMART>;
ti,sysc-sidle = <SYSC_IDLE_FORCE>,
<SYSC_IDLE_NO>,
<SYSC_IDLE_SMART>;
ti,syss-mask = <1>;
/* Clock defined in the SoC specific dtsi file */
clock-names = "fck";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0x0 0x480ab000 0x1000>;
usb_otg_hs: usb@0 {
compatible = "ti,omap3-musb";
reg = <0 0x1000>;
interrupts = <92>, <93>;
interrupt-names = "mc", "dma";
multipoint = <1>;
num-eps = <16>;
ram-bits = <12>;
};
};
dss: dss@48050000 {

View file

@ -189,6 +189,10 @@ &ssi {
"ssi_ick";
};
&usb_otg_target {
clocks = <&hsotgusb_ick_3430es2>;
};
/include/ "omap34xx-omap36xx-clocks.dtsi"
/include/ "omap36xx-omap3430es2plus-clocks.dtsi"
/include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi"

View file

@ -240,6 +240,10 @@ &ssi {
"ssi_ick";
};
&usb_otg_target {
clocks = <&hsotgusb_ick_3430es2>;
};
/include/ "omap34xx-omap36xx-clocks.dtsi"
/include/ "omap36xx-omap3430es2plus-clocks.dtsi"
/include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi"

View file

@ -1135,65 +1135,6 @@ static struct omap_hwmod omap34xx_mcspi4 = {
.class = &omap34xx_mcspi_class,
};
/* usbhsotg */
static struct omap_hwmod_class_sysconfig omap3xxx_usbhsotg_sysc = {
.rev_offs = 0x0400,
.sysc_offs = 0x0404,
.syss_offs = 0x0408,
.sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE|
SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
SYSC_HAS_AUTOIDLE),
.idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
.sysc_fields = &omap_hwmod_sysc_type1,
};
static struct omap_hwmod_class usbotg_class = {
.name = "usbotg",
.sysc = &omap3xxx_usbhsotg_sysc,
};
/* usb_otg_hs */
static struct omap_hwmod omap3xxx_usbhsotg_hwmod = {
.name = "usb_otg_hs",
.main_clk = "hsotgusb_ick",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT,
},
},
.class = &usbotg_class,
/*
* Erratum ID: i479 idle_req / idle_ack mechanism potentially
* broken when autoidle is enabled
* workaround is to disable the autoidle bit at module level.
*
* Enabling the device in any other MIDLEMODE setting but force-idle
* causes core_pwrdm not enter idle states at least on OMAP3630.
* Note that musb has OTG_FORCESTDBY register that controls MSTANDBY
* signal when MIDLEMODE is set to force-idle.
*/
.flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE |
HWMOD_FORCE_MSTANDBY | HWMOD_RECONFIG_IO_CHAIN,
};
/* usb_otg_hs */
static struct omap_hwmod_class am35xx_usbotg_class = {
.name = "am35xx_usbotg",
};
static struct omap_hwmod am35xx_usbhsotg_hwmod = {
.name = "am35x_otg_hs",
.main_clk = "hsotgusb_fck",
.class = &am35xx_usbotg_class,
.flags = HWMOD_NO_IDLEST,
};
/* MMC/SD/SDIO common */
static struct omap_hwmod_class_sysconfig omap34xx_mmc_sysc = {
.rev_offs = 0x1fc,
@ -1561,22 +1502,6 @@ static struct omap_hwmod_ocp_if omap3xxx_dss__l3 = {
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l3_core -> usbhsotg interface */
static struct omap_hwmod_ocp_if omap3xxx_usbhsotg__l3 = {
.master = &omap3xxx_usbhsotg_hwmod,
.slave = &omap3xxx_l3_main_hwmod,
.clk = "core_l3_ick",
.user = OCP_USER_MPU,
};
/* l3_core -> am35xx_usbhsotg interface */
static struct omap_hwmod_ocp_if am35xx_usbhsotg__l3 = {
.master = &am35xx_usbhsotg_hwmod,
.slave = &omap3xxx_l3_main_hwmod,
.clk = "hsotgusb_ick",
.user = OCP_USER_MPU,
};
/* l3_core -> sad2d interface */
static struct omap_hwmod_ocp_if omap3xxx_sad2d__l3 = {
.master = &omap3xxx_sad2d_hwmod,
@ -1758,24 +1683,6 @@ static struct omap_hwmod_ocp_if omap36xx_l4_core__sr2 = {
.user = OCP_USER_MPU,
};
/* l4_core -> usbhsotg */
static struct omap_hwmod_ocp_if omap3xxx_l4_core__usbhsotg = {
.master = &omap3xxx_l4_core_hwmod,
.slave = &omap3xxx_usbhsotg_hwmod,
.clk = "l4_ick",
.user = OCP_USER_MPU,
};
/* l4_core -> usbhsotg */
static struct omap_hwmod_ocp_if am35xx_l4_core__usbhsotg = {
.master = &omap3xxx_l4_core_hwmod,
.slave = &am35xx_usbhsotg_hwmod,
.clk = "hsotgusb_ick",
.user = OCP_USER_MPU,
};
/* L4_WKUP -> L4_SEC interface */
static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__l4_sec = {
.master = &omap3xxx_l4_wkup_hwmod,
@ -2465,8 +2372,6 @@ static struct omap_hwmod_ocp_if *omap3430es1_hwmod_ocp_ifs[] __initdata = {
static struct omap_hwmod_ocp_if *omap3430es2plus_hwmod_ocp_ifs[] __initdata = {
&omap3xxx_dss__l3,
&omap3xxx_l4_core__dss,
&omap3xxx_usbhsotg__l3,
&omap3xxx_l4_core__usbhsotg,
&omap3xxx_usb_host_hs__l3_main_2,
&omap3xxx_l4_core__usb_host_hs,
&omap3xxx_l4_core__usb_tll_hs,
@ -2509,8 +2414,6 @@ static struct omap_hwmod_ocp_if *omap36xx_hwmod_ocp_ifs[] __initdata = {
&omap3xxx_l4_core__dss,
&omap36xx_l4_core__sr1,
&omap36xx_l4_core__sr2,
&omap3xxx_usbhsotg__l3,
&omap3xxx_l4_core__usbhsotg,
&omap3xxx_l4_core__mailbox,
&omap3xxx_usb_host_hs__l3_main_2,
&omap3xxx_l4_core__usb_host_hs,
@ -2528,8 +2431,6 @@ static struct omap_hwmod_ocp_if *omap36xx_hwmod_ocp_ifs[] __initdata = {
static struct omap_hwmod_ocp_if *am35xx_hwmod_ocp_ifs[] __initdata = {
&omap3xxx_dss__l3,
&omap3xxx_l4_core__dss,
&am35xx_usbhsotg__l3,
&am35xx_l4_core__usbhsotg,
&am35xx_l4_core__uart4,
&omap3xxx_usb_host_hs__l3_main_2,
&omap3xxx_l4_core__usb_host_hs,

View file

@ -1610,6 +1610,12 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY),
SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, -ENODEV, 0x50700101, 0xffffffff,
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY),
SYSC_QUIRK("usb_otg_hs", 0, 0x400, 0x404, 0x408, 0x00000033,
0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY |
SYSC_MODULE_QUIRK_OTG),
SYSC_QUIRK("usb_otg_hs", 0, 0x400, 0x404, 0x408, 0x00000040,
0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY |
SYSC_MODULE_QUIRK_OTG),
SYSC_QUIRK("usb_otg_hs", 0, 0x400, 0x404, 0x408, 0x00000050,
0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY |
SYSC_MODULE_QUIRK_OTG),