2014-02-20 11:40:44

by Roger Quadros

[permalink] [raw]
Subject: [PATCH v8 00/14] USB Host support for OMAP5 uEVM

Hi Benoit, Tony & Lee,

This patchset brings up USB Host ports and Ethernet port on
the OMAP5 uEVM board.

It also does some cleanup with respect to DT clock binding
for the mfd/omap-usb-host driver.

Please queue these for -next.

Tested on:
- OMAP5 uEVM
- Pandaboard ES Rev. B1
- Beagleboard-XM Rev C2 (DT + Legacy)
- Beagleboard Rev C4 (DT + Legacy)

Changelog:

v8:
- Addressed review comments and split patch
"mfd: omap-usb-host: Get clocks based on hardware revision"
- Removed unnecessary usb host dummy clocks on OMAP3
- Removed unnecessary clock alias "ehci_logic_fck" for OMAP3
- Rebased on 3.14-rc3

v7:
- Rebased on 3.14-rc2
- Removed incompatible ids from DT files and examples

v6:
- Initialized clocks to -ENODEV and split patch 3.

v5:
- Expose all clocks in the DT binding document for mfd:omap-usb-host
and mfd:omap-usb-tll

v4:
- Updated DT binding document for clock binding

v3:
- Rebased on top of 3.13-rc7

cheers,
-roger

---
Roger Quadros (14):
mfd: omap-usb-host: Get clocks based on hardware revision
mfd: omap-usb-host: Always fail on clk_get() error
mfd: omap-usb-host: Use clock names as per function for reference
clocks
mfd: omap-usb-host: Update DT clock binding information
mfd: omap-usb-tll: Update DT clock binding information
CLK: TI: OMAP3: Get rid of unused USB Host dummy clocks
ARM: OMAP3: hwmod data: Remove optional clock from usb_host_hs module
ARM: dts: omap4: Update omap-usb-host node
ARM: dts: omap5: Update omap-usb-host node
ARM: dts: omap4-panda: Provide USB PHY clock
ARM: dts: omap5-uevm: Provide USB PHY clock
ARM: OMAP2+: Remove legacy_init_ehci_clk()
ARM: dts: OMAP2+: Get rid of incompatible ids for USB host nodes
usb: omap: dts: Update DT binding example usage

.../devicetree/bindings/mfd/omap-usb-host.txt | 23 ++++
.../devicetree/bindings/mfd/omap-usb-tll.txt | 10 ++
.../devicetree/bindings/usb/ehci-omap.txt | 2 +-
.../devicetree/bindings/usb/ohci-omap3.txt | 2 +-
arch/arm/boot/dts/omap3.dtsi | 4 +-
arch/arm/boot/dts/omap4-panda-common.dtsi | 8 +-
arch/arm/boot/dts/omap4.dtsi | 10 +-
arch/arm/boot/dts/omap5-uevm.dts | 8 +-
arch/arm/boot/dts/omap5.dtsi | 10 +-
arch/arm/mach-omap2/cclock3xxx_data.c | 4 -
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 6 --
arch/arm/mach-omap2/pdata-quirks.c | 16 ---
drivers/clk/ti/clk-3xxx.c | 4 -
drivers/mfd/omap-usb-host.c | 116 ++++++++++++++-------
14 files changed, 135 insertions(+), 88 deletions(-)

--
1.8.3.2


2014-02-20 11:41:38

by Roger Quadros

[permalink] [raw]
Subject: [PATCH v8 08/14] ARM: dts: omap4: Update omap-usb-host node

The omap-usb-host driver expects a certain name for internal
and external reference clocks. Provide these clocks.

Signed-off-by: Roger Quadros <[email protected]>
---
arch/arm/boot/dts/omap4.dtsi | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index d3f8a6e..39a05ce 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -697,6 +697,12 @@
#address-cells = <1>;
#size-cells = <1>;
ranges;
+ clocks = <&init_60m_fclk>,
+ <&xclk60mhsp1_ck>,
+ <&xclk60mhsp2_ck>;
+ clock-names = "refclk_60m_int",
+ "refclk_60m_ext_p1",
+ "refclk_60m_ext_p2";

usbhsohci: ohci@4a064800 {
compatible = "ti,ohci-omap3", "usb-ohci";
--
1.8.3.2

2014-02-20 11:41:40

by Roger Quadros

[permalink] [raw]
Subject: [PATCH v8 10/14] ARM: dts: omap4-panda: Provide USB PHY clock

The USB PHY gets its clock from AUXCLK3. Provide this
information.

Signed-off-by: Roger Quadros <[email protected]>
---
arch/arm/boot/dts/omap4-panda-common.dtsi | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi
index 88c6a05..50b72966 100644
--- a/arch/arm/boot/dts/omap4-panda-common.dtsi
+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
@@ -83,12 +83,8 @@
compatible = "usb-nop-xceiv";
reset-gpios = <&gpio2 30 GPIO_ACTIVE_LOW>; /* gpio_62 */
vcc-supply = <&hsusb1_power>;
- /**
- * FIXME:
- * put the right clock phandle here when available
- * clocks = <&auxclk3>;
- * clock-names = "main_clk";
- */
+ clocks = <&auxclk3_ck>;
+ clock-names = "main_clk";
clock-frequency = <19200000>;
};

--
1.8.3.2

2014-02-20 11:41:36

by Roger Quadros

[permalink] [raw]
Subject: [PATCH v8 09/14] ARM: dts: omap5: Update omap-usb-host node

The omap-usb-host driver expects a certain name for internal
and external reference clocks. Provide these clocks.

Signed-off-by: Roger Quadros <[email protected]>
---
arch/arm/boot/dts/omap5.dtsi | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index a72813a..d4dae48 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -775,6 +775,12 @@
#address-cells = <1>;
#size-cells = <1>;
ranges;
+ clocks = <&l3init_60m_fclk>,
+ <&xclk60mhsp1_ck>,
+ <&xclk60mhsp2_ck>;
+ clock-names = "refclk_60m_int",
+ "refclk_60m_ext_p1",
+ "refclk_60m_ext_p2";

usbhsohci: ohci@4a064800 {
compatible = "ti,ohci-omap3", "usb-ohci";
--
1.8.3.2

2014-02-20 11:41:34

by Roger Quadros

[permalink] [raw]
Subject: [PATCH v8 07/14] ARM: OMAP3: hwmod data: Remove optional clock from usb_host_hs module

The USB Host driver manages this clock so no need to have it in
the hwmod data. We also get rid of the 'ehci_logic_fck' alias
for 'usbhost_120m_fck' clock.

CC: Paul Walmsley <[email protected]>
Signed-off-by: Roger Quadros <[email protected]>
---
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 6 ------
1 file changed, 6 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 4c3b1e6..ad87f46 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -1955,10 +1955,6 @@ static struct omap_hwmod_class omap3xxx_usb_host_hs_hwmod_class = {
.sysc = &omap3xxx_usb_host_hs_sysc,
};

-static struct omap_hwmod_opt_clk omap3xxx_usb_host_hs_opt_clks[] = {
- { .role = "ehci_logic_fck", .clk = "usbhost_120m_fck", },
-};
-
static struct omap_hwmod_irq_info omap3xxx_usb_host_hs_irqs[] = {
{ .name = "ohci-irq", .irq = 76 + OMAP_INTC_START, },
{ .name = "ehci-irq", .irq = 77 + OMAP_INTC_START, },
@@ -1981,8 +1977,6 @@ static struct omap_hwmod omap3xxx_usb_host_hs_hwmod = {
.idlest_stdby_bit = OMAP3430ES2_ST_USBHOST_STDBY_SHIFT,
},
},
- .opt_clks = omap3xxx_usb_host_hs_opt_clks,
- .opt_clks_cnt = ARRAY_SIZE(omap3xxx_usb_host_hs_opt_clks),

/*
* Errata: USBHOST Configured In Smart-Idle Can Lead To a Deadlock
--
1.8.3.2

2014-02-20 11:41:31

by Roger Quadros

[permalink] [raw]
Subject: [PATCH v8 06/14] CLK: TI: OMAP3: Get rid of unused USB Host dummy clocks

The OMAP USB Host MFD driver no longer expects these non-existing
clocks from the OMAP3 platform, so get rid of them.

CC: Tero Kristo <[email protected]>
CC: Mike Turquette <[email protected]>
Signed-off-by: Roger Quadros <[email protected]>
---
arch/arm/mach-omap2/cclock3xxx_data.c | 4 ----
drivers/clk/ti/clk-3xxx.c | 4 ----
2 files changed, 8 deletions(-)

diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c
index 3b05aea..4299a55 100644
--- a/arch/arm/mach-omap2/cclock3xxx_data.c
+++ b/arch/arm/mach-omap2/cclock3xxx_data.c
@@ -3495,10 +3495,6 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "dss_tv_fck", &dss_tv_fck),
CLK(NULL, "dss_96m_fck", &dss_96m_fck),
CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck),
- CLK(NULL, "utmi_p1_gfclk", &dummy_ck),
- CLK(NULL, "utmi_p2_gfclk", &dummy_ck),
- CLK(NULL, "xclk60mhsp1_ck", &dummy_ck),
- CLK(NULL, "xclk60mhsp2_ck", &dummy_ck),
CLK(NULL, "init_60m_fclk", &dummy_ck),
CLK(NULL, "gpt1_fck", &gpt1_fck),
CLK(NULL, "aes2_ick", &aes2_ick),
diff --git a/drivers/clk/ti/clk-3xxx.c b/drivers/clk/ti/clk-3xxx.c
index d323023..0d1750a 100644
--- a/drivers/clk/ti/clk-3xxx.c
+++ b/drivers/clk/ti/clk-3xxx.c
@@ -130,10 +130,6 @@ static struct ti_dt_clk omap3xxx_clks[] = {
DT_CLK(NULL, "dss_tv_fck", "dss_tv_fck"),
DT_CLK(NULL, "dss_96m_fck", "dss_96m_fck"),
DT_CLK(NULL, "dss2_alwon_fck", "dss2_alwon_fck"),
- DT_CLK(NULL, "utmi_p1_gfclk", "dummy_ck"),
- DT_CLK(NULL, "utmi_p2_gfclk", "dummy_ck"),
- DT_CLK(NULL, "xclk60mhsp1_ck", "dummy_ck"),
- DT_CLK(NULL, "xclk60mhsp2_ck", "dummy_ck"),
DT_CLK(NULL, "init_60m_fclk", "dummy_ck"),
DT_CLK(NULL, "gpt1_fck", "gpt1_fck"),
DT_CLK(NULL, "aes2_ick", "aes2_ick"),
--
1.8.3.2

2014-02-20 11:41:26

by Roger Quadros

[permalink] [raw]
Subject: [PATCH v8 04/14] mfd: omap-usb-host: Update DT clock binding information

The omap-usb-host driver expects certained named clocks.
Add this information to the DT binding document.

CC: Lee Jones <[email protected]>
CC: Samuel Ortiz <[email protected]>
Signed-off-by: Roger Quadros <[email protected]>
---
.../devicetree/bindings/mfd/omap-usb-host.txt | 23 ++++++++++++++++++++++
1 file changed, 23 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
index b381fa6..4721b2d 100644
--- a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
+++ b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
@@ -32,6 +32,29 @@ Optional properties:
- single-ulpi-bypass: Must be present if the controller contains a single
ULPI bypass control bit. e.g. OMAP3 silicon <= ES2.1

+- clocks: a list of phandles and clock-specifier pairs, one for each entry in
+ clock-names.
+
+- clock-names: should include:
+ For OMAP3
+ * "usbhost_120m_fck" - 120MHz Functional clock.
+
+ For OMAP4+
+ * "refclk_60m_int" - 60MHz internal reference clock for UTMI clock mux
+ * "refclk_60m_ext_p1" - 60MHz external ref. clock for Port 1's UTMI clock mux.
+ * "refclk_60m_ext_p2" - 60MHz external ref. clock for Port 2's UTMI clock mux
+ * "utmi_p1_gfclk" - Port 1 UTMI clock mux.
+ * "utmi_p2_gfclk" - Port 2 UTMI clock mux.
+ * "usb_host_hs_utmi_p1_clk" - Port 1 UTMI clock gate.
+ * "usb_host_hs_utmi_p2_clk" - Port 2 UTMI clock gate.
+ * "usb_host_hs_utmi_p3_clk" - Port 3 UTMI clock gate.
+ * "usb_host_hs_hsic480m_p1_clk" - Port 1 480MHz HSIC clock gate.
+ * "usb_host_hs_hsic480m_p2_clk" - Port 2 480MHz HSIC clock gate.
+ * "usb_host_hs_hsic480m_p3_clk" - Port 3 480MHz HSIC clock gate.
+ * "usb_host_hs_hsic60m_p1_clk" - Port 1 60MHz HSIC clock gate.
+ * "usb_host_hs_hsic60m_p2_clk" - Port 2 60MHz HSIC clock gate.
+ * "usb_host_hs_hsic60m_p3_clk" - Port 3 60MHz HSIC clock gate.
+
Required properties if child node exists:

- #address-cells: Must be 1
--
1.8.3.2

2014-02-20 11:43:51

by Roger Quadros

[permalink] [raw]
Subject: [PATCH v8 14/14] usb: omap: dts: Update DT binding example usage

Remove non-compatible id from examples.

CC: Alan Stern <[email protected]>
Signed-off-by: Roger Quadros <[email protected]>
---
Documentation/devicetree/bindings/usb/ehci-omap.txt | 2 +-
Documentation/devicetree/bindings/usb/ohci-omap3.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/ehci-omap.txt b/Documentation/devicetree/bindings/usb/ehci-omap.txt
index 485a9a1..3dc231c 100644
--- a/Documentation/devicetree/bindings/usb/ehci-omap.txt
+++ b/Documentation/devicetree/bindings/usb/ehci-omap.txt
@@ -21,7 +21,7 @@ Documentation/devicetree/bindings/mfd/omap-usb-host.txt
Example for OMAP4:

usbhsehci: ehci@4a064c00 {
- compatible = "ti,ehci-omap", "usb-ehci";
+ compatible = "ti,ehci-omap";
reg = <0x4a064c00 0x400>;
interrupts = <0 77 0x4>;
};
diff --git a/Documentation/devicetree/bindings/usb/ohci-omap3.txt b/Documentation/devicetree/bindings/usb/ohci-omap3.txt
index 14ab428..ce8c47cff 100644
--- a/Documentation/devicetree/bindings/usb/ohci-omap3.txt
+++ b/Documentation/devicetree/bindings/usb/ohci-omap3.txt
@@ -9,7 +9,7 @@ Required properties:
Example for OMAP4:

usbhsohci: ohci@4a064800 {
- compatible = "ti,ohci-omap3", "usb-ohci";
+ compatible = "ti,ohci-omap3";
reg = <0x4a064800 0x400>;
interrupts = <0 76 0x4>;
};
--
1.8.3.2

2014-02-20 11:44:19

by Roger Quadros

[permalink] [raw]
Subject: [PATCH v8 13/14] ARM: dts: OMAP2+: Get rid of incompatible ids for USB host nodes

The OMAP EHCI and OHCI controllers are not compatible with drivers
other than "ti,ehci-omap" and "ti,ohci-omap3" respectively, so get
rid of the incompatible ids.

CC: Alan Stern <[email protected]>
Signed-off-by: Roger Quadros <[email protected]>
---
arch/arm/boot/dts/omap3.dtsi | 4 ++--
arch/arm/boot/dts/omap4.dtsi | 4 ++--
arch/arm/boot/dts/omap5.dtsi | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index a5fc83b..8e7de9e 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -634,14 +634,14 @@
ranges;

usbhsohci: ohci@48064400 {
- compatible = "ti,ohci-omap3", "usb-ohci";
+ compatible = "ti,ohci-omap3";
reg = <0x48064400 0x400>;
interrupt-parent = <&intc>;
interrupts = <76>;
};

usbhsehci: ehci@48064800 {
- compatible = "ti,ehci-omap", "usb-ehci";
+ compatible = "ti,ehci-omap";
reg = <0x48064800 0x400>;
interrupt-parent = <&intc>;
interrupts = <77>;
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 39a05ce..ff1b057 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -705,14 +705,14 @@
"refclk_60m_ext_p2";

usbhsohci: ohci@4a064800 {
- compatible = "ti,ohci-omap3", "usb-ohci";
+ compatible = "ti,ohci-omap3";
reg = <0x4a064800 0x400>;
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
};

usbhsehci: ehci@4a064c00 {
- compatible = "ti,ehci-omap", "usb-ehci";
+ compatible = "ti,ehci-omap";
reg = <0x4a064c00 0x400>;
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index d4dae48..f65aa65 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -783,14 +783,14 @@
"refclk_60m_ext_p2";

usbhsohci: ohci@4a064800 {
- compatible = "ti,ohci-omap3", "usb-ohci";
+ compatible = "ti,ohci-omap3";
reg = <0x4a064800 0x400>;
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
};

usbhsehci: ehci@4a064c00 {
- compatible = "ti,ehci-omap", "usb-ehci";
+ compatible = "ti,ehci-omap";
reg = <0x4a064c00 0x400>;
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
--
1.8.3.2

2014-02-20 11:41:23

by Roger Quadros

[permalink] [raw]
Subject: [PATCH v8 05/14] mfd: omap-usb-tll: Update DT clock binding information

The omap-usb-tll driver needs one clock for each TLL channel.
Add this information to the DT binding document.

CC: Lee Jones <[email protected]>
CC: Samuel Ortiz <[email protected]>
Signed-off-by: Roger Quadros <[email protected]>
---
Documentation/devicetree/bindings/mfd/omap-usb-tll.txt | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-tll.txt b/Documentation/devicetree/bindings/mfd/omap-usb-tll.txt
index 62fe697..c58d704 100644
--- a/Documentation/devicetree/bindings/mfd/omap-usb-tll.txt
+++ b/Documentation/devicetree/bindings/mfd/omap-usb-tll.txt
@@ -7,6 +7,16 @@ Required properties:
- interrupts : should contain the TLL module's interrupt
- ti,hwmod : must contain "usb_tll_hs"

+Optional properties:
+
+- clocks: a list of phandles and clock-specifier pairs, one for each entry in
+ clock-names.
+
+- clock-names: should include:
+ * "usb_tll_hs_usb_ch0_clk" - USB TLL channel 0 clock
+ * "usb_tll_hs_usb_ch1_clk" - USB TLL channel 1 clock
+ * "usb_tll_hs_usb_ch2_clk" - USB TLL channel 2 clock
+
Example:

usbhstll: usbhstll@4a062000 {
--
1.8.3.2

2014-02-20 11:45:28

by Roger Quadros

[permalink] [raw]
Subject: [PATCH v8 12/14] ARM: OMAP2+: Remove legacy_init_ehci_clk()

The necessary clock phandle for the EHCI clock is now provided
via device tree so we no longer need this legacy method.

Signed-off-by: Roger Quadros <[email protected]>
---
arch/arm/mach-omap2/pdata-quirks.c | 16 ----------------
1 file changed, 16 deletions(-)

diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 3d5b24d..f1ecd86 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -31,20 +31,6 @@ struct pdata_init {
struct of_dev_auxdata omap_auxdata_lookup[];
static struct twl4030_gpio_platform_data twl_gpio_auxdata;

-/*
- * Create alias for USB host PHY clock.
- * Remove this when clock phandle can be provided via DT
- */
-static void __init __used legacy_init_ehci_clk(char *clkname)
-{
- int ret;
-
- ret = clk_add_alias("main_clk", NULL, clkname, NULL);
- if (ret)
- pr_err("%s:Failed to add main_clk alias to %s :%d\n",
- __func__, clkname, ret);
-}
-
#if IS_ENABLED(CONFIG_WL12XX)

static struct wl12xx_platform_data wl12xx __initdata;
@@ -182,7 +168,6 @@ static void __init omap4_sdp_legacy_init(void)
static void __init omap4_panda_legacy_init(void)
{
omap4_panda_display_init_of();
- legacy_init_ehci_clk("auxclk3_ck");
legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53);
}
#endif
@@ -190,7 +175,6 @@ static void __init omap4_panda_legacy_init(void)
#ifdef CONFIG_SOC_OMAP5
static void __init omap5_uevm_legacy_init(void)
{
- legacy_init_ehci_clk("auxclk1_ck");
}
#endif

--
1.8.3.2

2014-02-20 11:41:20

by Roger Quadros

[permalink] [raw]
Subject: [PATCH v8 03/14] mfd: omap-usb-host: Use clock names as per function for reference clocks

Use a meaningful name for the reference clocks so that it indicates the function.

CC: Lee Jones <[email protected]>
CC: Samuel Ortiz <[email protected]>
Signed-off-by: Roger Quadros <[email protected]>
---
drivers/mfd/omap-usb-host.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 865c276..651e249 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -718,24 +718,24 @@ static int usbhs_omap_probe(struct platform_device *pdev)
goto err_mem;
}

- omap->xclk60mhsp1_ck = devm_clk_get(dev, "xclk60mhsp1_ck");
+ omap->xclk60mhsp1_ck = devm_clk_get(dev, "refclk_60m_ext_p1");
if (IS_ERR(omap->xclk60mhsp1_ck)) {
ret = PTR_ERR(omap->xclk60mhsp1_ck);
- dev_err(dev, "xclk60mhsp1_ck failed error:%d\n", ret);
+ dev_err(dev, "refclk_60m_ext_p1 failed error:%d\n", ret);
goto err_mem;
}

- omap->xclk60mhsp2_ck = devm_clk_get(dev, "xclk60mhsp2_ck");
+ omap->xclk60mhsp2_ck = devm_clk_get(dev, "refclk_60m_ext_p2");
if (IS_ERR(omap->xclk60mhsp2_ck)) {
ret = PTR_ERR(omap->xclk60mhsp2_ck);
- dev_err(dev, "xclk60mhsp2_ck failed error:%d\n", ret);
+ dev_err(dev, "refclk_60m_ext_p2 failed error:%d\n", ret);
goto err_mem;
}

- omap->init_60m_fclk = devm_clk_get(dev, "init_60m_fclk");
+ omap->init_60m_fclk = devm_clk_get(dev, "refclk_60m_int");
if (IS_ERR(omap->init_60m_fclk)) {
ret = PTR_ERR(omap->init_60m_fclk);
- dev_err(dev, "init_60m_fclk failed error:%d\n", ret);
+ dev_err(dev, "refclk_60m_int failed error:%d\n", ret);
goto err_mem;
}

--
1.8.3.2

2014-02-20 11:41:18

by Roger Quadros

[permalink] [raw]
Subject: [PATCH v8 02/14] mfd: omap-usb-host: Always fail on clk_get() error

Be more strict and always fail on clk_get() error.

For OMAP3 platforms, get the 120MHz EHCI clock by its proper name
'usbhost_120m_fck' instead of its alias 'ehci_logic_fck'.

CC: Lee Jones <[email protected]>
CC: Samuel Ortiz <[email protected]>
Signed-off-by: Roger Quadros <[email protected]>
---
drivers/mfd/omap-usb-host.c | 65 +++++++++++++++++++++++++++++----------------
1 file changed, 42 insertions(+), 23 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index c63bfdf..865c276 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -692,10 +692,12 @@ static int usbhs_omap_probe(struct platform_device *pdev)

if (need_logic_fck) {
omap->ehci_logic_fck = devm_clk_get(dev,
- "ehci_logic_fck");
+ "usbhost_120m_fck");
if (IS_ERR(omap->ehci_logic_fck)) {
ret = PTR_ERR(omap->ehci_logic_fck);
- dev_dbg(dev, "ehci_logic_fck failed:%d\n", ret);
+ dev_err(dev, "usbhost_120m_fck failed:%d\n",
+ ret);
+ goto err_mem;
}
}
goto initialize;
@@ -749,51 +751,68 @@ static int usbhs_omap_probe(struct platform_device *pdev)
* them
*/
omap->utmi_clk[i] = devm_clk_get(dev, clkname);
- if (IS_ERR(omap->utmi_clk[i]))
- dev_dbg(dev, "Failed to get clock : %s : %ld\n",
- clkname, PTR_ERR(omap->utmi_clk[i]));
+ if (IS_ERR(omap->utmi_clk[i])) {
+ ret = PTR_ERR(omap->utmi_clk[i]);
+ dev_err(dev, "Failed to get clock : %s : %d\n",
+ clkname, ret);
+ goto err_mem;
+ }

snprintf(clkname, sizeof(clkname),
"usb_host_hs_hsic480m_p%d_clk", i + 1);
omap->hsic480m_clk[i] = devm_clk_get(dev, clkname);
- if (IS_ERR(omap->hsic480m_clk[i]))
- dev_dbg(dev, "Failed to get clock : %s : %ld\n",
- clkname, PTR_ERR(omap->hsic480m_clk[i]));
+ if (IS_ERR(omap->hsic480m_clk[i])) {
+ ret = PTR_ERR(omap->hsic480m_clk[i]);
+ dev_err(dev, "Failed to get clock : %s : %d\n",
+ clkname, ret);
+ goto err_mem;
+ }

snprintf(clkname, sizeof(clkname),
"usb_host_hs_hsic60m_p%d_clk", i + 1);
omap->hsic60m_clk[i] = devm_clk_get(dev, clkname);
- if (IS_ERR(omap->hsic60m_clk[i]))
- dev_dbg(dev, "Failed to get clock : %s : %ld\n",
- clkname, PTR_ERR(omap->hsic60m_clk[i]));
+ if (IS_ERR(omap->hsic60m_clk[i])) {
+ ret = PTR_ERR(omap->hsic60m_clk[i]);
+ dev_err(dev, "Failed to get clock : %s : %d\n",
+ clkname, ret);
+ goto err_mem;
+ }
}

if (is_ehci_phy_mode(pdata->port_mode[0])) {
ret = clk_set_parent(omap->utmi_p1_gfclk,
omap->xclk60mhsp1_ck);
- if (ret != 0)
- dev_dbg(dev, "xclk60mhsp1_ck set parent failed: %d\n",
- ret);
+ if (ret != 0) {
+ dev_err(dev, "xclk60mhsp1_ck set parent failed: %d\n",
+ ret);
+ goto err_mem;
+ }
} else if (is_ehci_tll_mode(pdata->port_mode[0])) {
ret = clk_set_parent(omap->utmi_p1_gfclk,
omap->init_60m_fclk);
- if (ret != 0)
- dev_dbg(dev, "P0 init_60m_fclk set parent failed: %d\n",
- ret);
+ if (ret != 0) {
+ dev_err(dev, "P0 init_60m_fclk set parent failed: %d\n",
+ ret);
+ goto err_mem;
+ }
}

if (is_ehci_phy_mode(pdata->port_mode[1])) {
ret = clk_set_parent(omap->utmi_p2_gfclk,
omap->xclk60mhsp2_ck);
- if (ret != 0)
- dev_dbg(dev, "xclk60mhsp2_ck set parent failed: %d\n",
- ret);
+ if (ret != 0) {
+ dev_err(dev, "xclk60mhsp2_ck set parent failed: %d\n",
+ ret);
+ goto err_mem;
+ }
} else if (is_ehci_tll_mode(pdata->port_mode[1])) {
ret = clk_set_parent(omap->utmi_p2_gfclk,
omap->init_60m_fclk);
- if (ret != 0)
- dev_dbg(dev, "P1 init_60m_fclk set parent failed: %d\n",
- ret);
+ if (ret != 0) {
+ dev_err(dev, "P1 init_60m_fclk set parent failed: %d\n",
+ ret);
+ goto err_mem;
+ }
}

initialize:
--
1.8.3.2

2014-02-20 11:41:15

by Roger Quadros

[permalink] [raw]
Subject: [PATCH v8 01/14] mfd: omap-usb-host: Get clocks based on hardware revision

Not all revisions have all the clocks so get the necessary clocks
based on hardware revision.

This should avoid un-necessary clk_get failure messages that were
observed earlier.

CC: Lee Jones <[email protected]>
CC: Samuel Ortiz <[email protected]>
Signed-off-by: Roger Quadros <[email protected]>
---
drivers/mfd/omap-usb-host.c | 43 ++++++++++++++++++++++++++++++++-----------
1 file changed, 32 insertions(+), 11 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 0c3c9a0..c63bfdf 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -665,22 +665,43 @@ static int usbhs_omap_probe(struct platform_device *pdev)
goto err_mem;
}

- need_logic_fck = false;
+ /* Set all clocks as invalid to begin with */
+ omap->ehci_logic_fck = ERR_PTR(-ENODEV);
+ omap->init_60m_fclk = ERR_PTR(-ENODEV);
+ omap->utmi_p1_gfclk = ERR_PTR(-ENODEV);
+ omap->utmi_p2_gfclk = ERR_PTR(-ENODEV);
+ omap->xclk60mhsp1_ck = ERR_PTR(-ENODEV);
+ omap->xclk60mhsp2_ck = ERR_PTR(-ENODEV);
+
for (i = 0; i < omap->nports; i++) {
- if (is_ehci_phy_mode(i) || is_ehci_tll_mode(i) ||
- is_ehci_hsic_mode(i))
- need_logic_fck |= true;
+ omap->utmi_clk[i] = ERR_PTR(-ENODEV);
+ omap->hsic480m_clk[i] = ERR_PTR(-ENODEV);
+ omap->hsic60m_clk[i] = ERR_PTR(-ENODEV);
}

- omap->ehci_logic_fck = ERR_PTR(-EINVAL);
- if (need_logic_fck) {
- omap->ehci_logic_fck = devm_clk_get(dev, "ehci_logic_fck");
- if (IS_ERR(omap->ehci_logic_fck)) {
- ret = PTR_ERR(omap->ehci_logic_fck);
- dev_dbg(dev, "ehci_logic_fck failed:%d\n", ret);
+ /* for OMAP3 i.e. USBHS REV1 */
+ if (omap->usbhs_rev == OMAP_USBHS_REV1) {
+ need_logic_fck = false;
+ for (i = 0; i < omap->nports; i++) {
+ if (is_ehci_phy_mode(pdata->port_mode[i]) ||
+ is_ehci_tll_mode(pdata->port_mode[i]) ||
+ is_ehci_hsic_mode(pdata->port_mode[i]))
+
+ need_logic_fck |= true;
+ }
+
+ if (need_logic_fck) {
+ omap->ehci_logic_fck = devm_clk_get(dev,
+ "ehci_logic_fck");
+ if (IS_ERR(omap->ehci_logic_fck)) {
+ ret = PTR_ERR(omap->ehci_logic_fck);
+ dev_dbg(dev, "ehci_logic_fck failed:%d\n", ret);
+ }
}
+ goto initialize;
}

+ /* for OMAP4+ i.e. USBHS REV2+ */
omap->utmi_p1_gfclk = devm_clk_get(dev, "utmi_p1_gfclk");
if (IS_ERR(omap->utmi_p1_gfclk)) {
ret = PTR_ERR(omap->utmi_p1_gfclk);
@@ -748,7 +769,6 @@ static int usbhs_omap_probe(struct platform_device *pdev)
}

if (is_ehci_phy_mode(pdata->port_mode[0])) {
- /* for OMAP3, clk_set_parent fails */
ret = clk_set_parent(omap->utmi_p1_gfclk,
omap->xclk60mhsp1_ck);
if (ret != 0)
@@ -776,6 +796,7 @@ static int usbhs_omap_probe(struct platform_device *pdev)
ret);
}

+initialize:
omap_usbhs_init(dev);

if (dev->of_node) {
--
1.8.3.2

2014-02-20 11:46:33

by Roger Quadros

[permalink] [raw]
Subject: [PATCH v8 11/14] ARM: dts: omap5-uevm: Provide USB PHY clock

The HS USB 2 PHY gets its clock from AUXCLK1. Provide this
information.

Signed-off-by: Roger Quadros <[email protected]>
---
arch/arm/boot/dts/omap5-uevm.dts | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts
index 002fa70..3b99ec2 100644
--- a/arch/arm/boot/dts/omap5-uevm.dts
+++ b/arch/arm/boot/dts/omap5-uevm.dts
@@ -31,12 +31,8 @@
hsusb2_phy: hsusb2_phy {
compatible = "usb-nop-xceiv";
reset-gpios = <&gpio3 16 GPIO_ACTIVE_LOW>; /* gpio3_80 HUB_NRESET */
- /**
- * FIXME
- * Put the right clock phandle here when available
- * clocks = <&auxclk1>;
- * clock-names = "main_clk";
- */
+ clocks = <&auxclk1_ck>;
+ clock-names = "main_clk";
clock-frequency = <19200000>;
};

--
1.8.3.2

2014-02-25 08:43:37

by Mike Turquette

[permalink] [raw]
Subject: Re: [PATCH v8 06/14] CLK: TI: OMAP3: Get rid of unused USB Host dummy clocks

Quoting Roger Quadros (2014-02-20 03:40:01)
> The OMAP USB Host MFD driver no longer expects these non-existing
> clocks from the OMAP3 platform, so get rid of them.

Looks good to me.

Regards,
Mike

>
> CC: Tero Kristo <[email protected]>
> CC: Mike Turquette <[email protected]>
> Signed-off-by: Roger Quadros <[email protected]>
> ---
> arch/arm/mach-omap2/cclock3xxx_data.c | 4 ----
> drivers/clk/ti/clk-3xxx.c | 4 ----
> 2 files changed, 8 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c
> index 3b05aea..4299a55 100644
> --- a/arch/arm/mach-omap2/cclock3xxx_data.c
> +++ b/arch/arm/mach-omap2/cclock3xxx_data.c
> @@ -3495,10 +3495,6 @@ static struct omap_clk omap3xxx_clks[] = {
> CLK(NULL, "dss_tv_fck", &dss_tv_fck),
> CLK(NULL, "dss_96m_fck", &dss_96m_fck),
> CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck),
> - CLK(NULL, "utmi_p1_gfclk", &dummy_ck),
> - CLK(NULL, "utmi_p2_gfclk", &dummy_ck),
> - CLK(NULL, "xclk60mhsp1_ck", &dummy_ck),
> - CLK(NULL, "xclk60mhsp2_ck", &dummy_ck),
> CLK(NULL, "init_60m_fclk", &dummy_ck),
> CLK(NULL, "gpt1_fck", &gpt1_fck),
> CLK(NULL, "aes2_ick", &aes2_ick),
> diff --git a/drivers/clk/ti/clk-3xxx.c b/drivers/clk/ti/clk-3xxx.c
> index d323023..0d1750a 100644
> --- a/drivers/clk/ti/clk-3xxx.c
> +++ b/drivers/clk/ti/clk-3xxx.c
> @@ -130,10 +130,6 @@ static struct ti_dt_clk omap3xxx_clks[] = {
> DT_CLK(NULL, "dss_tv_fck", "dss_tv_fck"),
> DT_CLK(NULL, "dss_96m_fck", "dss_96m_fck"),
> DT_CLK(NULL, "dss2_alwon_fck", "dss2_alwon_fck"),
> - DT_CLK(NULL, "utmi_p1_gfclk", "dummy_ck"),
> - DT_CLK(NULL, "utmi_p2_gfclk", "dummy_ck"),
> - DT_CLK(NULL, "xclk60mhsp1_ck", "dummy_ck"),
> - DT_CLK(NULL, "xclk60mhsp2_ck", "dummy_ck"),
> DT_CLK(NULL, "init_60m_fclk", "dummy_ck"),
> DT_CLK(NULL, "gpt1_fck", "gpt1_fck"),
> DT_CLK(NULL, "aes2_ick", "aes2_ick"),
> --
> 1.8.3.2
>

2014-02-25 08:52:44

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v8 03/14] mfd: omap-usb-host: Use clock names as per function for reference clocks

> Use a meaningful name for the reference clocks so that it indicates the function.
>
> CC: Lee Jones <[email protected]>
> CC: Samuel Ortiz <[email protected]>
> Signed-off-by: Roger Quadros <[email protected]>
> ---
> drivers/mfd/omap-usb-host.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
> index 865c276..651e249 100644
> --- a/drivers/mfd/omap-usb-host.c
> +++ b/drivers/mfd/omap-usb-host.c
> @@ -718,24 +718,24 @@ static int usbhs_omap_probe(struct platform_device *pdev)
> goto err_mem;
> }
>
> - omap->xclk60mhsp1_ck = devm_clk_get(dev, "xclk60mhsp1_ck");
> + omap->xclk60mhsp1_ck = devm_clk_get(dev, "refclk_60m_ext_p1");
> if (IS_ERR(omap->xclk60mhsp1_ck)) {
> ret = PTR_ERR(omap->xclk60mhsp1_ck);
> - dev_err(dev, "xclk60mhsp1_ck failed error:%d\n", ret);
> + dev_err(dev, "refclk_60m_ext_p1 failed error:%d\n", ret);
> goto err_mem;
> }

Will anything break if I were to apply the MFD patches seperately?

> - omap->xclk60mhsp2_ck = devm_clk_get(dev, "xclk60mhsp2_ck");
> + omap->xclk60mhsp2_ck = devm_clk_get(dev, "refclk_60m_ext_p2");
> if (IS_ERR(omap->xclk60mhsp2_ck)) {
> ret = PTR_ERR(omap->xclk60mhsp2_ck);
> - dev_err(dev, "xclk60mhsp2_ck failed error:%d\n", ret);
> + dev_err(dev, "refclk_60m_ext_p2 failed error:%d\n", ret);
> goto err_mem;
> }
>
> - omap->init_60m_fclk = devm_clk_get(dev, "init_60m_fclk");
> + omap->init_60m_fclk = devm_clk_get(dev, "refclk_60m_int");
> if (IS_ERR(omap->init_60m_fclk)) {
> ret = PTR_ERR(omap->init_60m_fclk);
> - dev_err(dev, "init_60m_fclk failed error:%d\n", ret);
> + dev_err(dev, "refclk_60m_int failed error:%d\n", ret);
> goto err_mem;
> }
>

--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2014-02-25 09:03:16

by Roger Quadros

[permalink] [raw]
Subject: Re: [PATCH v8 03/14] mfd: omap-usb-host: Use clock names as per function for reference clocks

Hi,

On 02/25/2014 10:52 AM, Lee Jones wrote:
>> Use a meaningful name for the reference clocks so that it indicates the function.
>>
>> CC: Lee Jones <[email protected]>
>> CC: Samuel Ortiz <[email protected]>
>> Signed-off-by: Roger Quadros <[email protected]>
>> ---
>> drivers/mfd/omap-usb-host.c | 12 ++++++------
>> 1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
>> index 865c276..651e249 100644
>> --- a/drivers/mfd/omap-usb-host.c
>> +++ b/drivers/mfd/omap-usb-host.c
>> @@ -718,24 +718,24 @@ static int usbhs_omap_probe(struct platform_device *pdev)
>> goto err_mem;
>> }
>>
>> - omap->xclk60mhsp1_ck = devm_clk_get(dev, "xclk60mhsp1_ck");
>> + omap->xclk60mhsp1_ck = devm_clk_get(dev, "refclk_60m_ext_p1");
>> if (IS_ERR(omap->xclk60mhsp1_ck)) {
>> ret = PTR_ERR(omap->xclk60mhsp1_ck);
>> - dev_err(dev, "xclk60mhsp1_ck failed error:%d\n", ret);
>> + dev_err(dev, "refclk_60m_ext_p1 failed error:%d\n", ret);
>> goto err_mem;
>> }
>
> Will anything break if I were to apply the MFD patches seperately?
>

Nothing will break for OMAP3, but OMAP4 USB host will break (e.g. Panda board).
OMAP5 USB host was never working so it doesn't matter there.

To make sure nothing breaks, we need at least these 2 patches to go in together with mfd changes.

[PATCH v8 08/14] ARM: dts: omap4: Update omap-usb-host node
[PATCH v8 09/14] ARM: dts: omap5: Update omap-usb-host node

Any suggestions about how we can proceed?

cheers,
-roger

>> - omap->xclk60mhsp2_ck = devm_clk_get(dev, "xclk60mhsp2_ck");
>> + omap->xclk60mhsp2_ck = devm_clk_get(dev, "refclk_60m_ext_p2");
>> if (IS_ERR(omap->xclk60mhsp2_ck)) {
>> ret = PTR_ERR(omap->xclk60mhsp2_ck);
>> - dev_err(dev, "xclk60mhsp2_ck failed error:%d\n", ret);
>> + dev_err(dev, "refclk_60m_ext_p2 failed error:%d\n", ret);
>> goto err_mem;
>> }
>>
>> - omap->init_60m_fclk = devm_clk_get(dev, "init_60m_fclk");
>> + omap->init_60m_fclk = devm_clk_get(dev, "refclk_60m_int");
>> if (IS_ERR(omap->init_60m_fclk)) {
>> ret = PTR_ERR(omap->init_60m_fclk);
>> - dev_err(dev, "init_60m_fclk failed error:%d\n", ret);
>> + dev_err(dev, "refclk_60m_int failed error:%d\n", ret);
>> goto err_mem;
>> }
>>
>

2014-02-25 09:18:54

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v8 03/14] mfd: omap-usb-host: Use clock names as per function for reference clocks

> >> Use a meaningful name for the reference clocks so that it indicates the function.
> >>
> >> CC: Lee Jones <[email protected]>
> >> CC: Samuel Ortiz <[email protected]>
> >> Signed-off-by: Roger Quadros <[email protected]>
> >> ---
> >> drivers/mfd/omap-usb-host.c | 12 ++++++------
> >> 1 file changed, 6 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
> >> index 865c276..651e249 100644
> >> --- a/drivers/mfd/omap-usb-host.c
> >> +++ b/drivers/mfd/omap-usb-host.c
> >> @@ -718,24 +718,24 @@ static int usbhs_omap_probe(struct platform_device *pdev)
> >> goto err_mem;
> >> }
> >>
> >> - omap->xclk60mhsp1_ck = devm_clk_get(dev, "xclk60mhsp1_ck");
> >> + omap->xclk60mhsp1_ck = devm_clk_get(dev, "refclk_60m_ext_p1");
> >> if (IS_ERR(omap->xclk60mhsp1_ck)) {
> >> ret = PTR_ERR(omap->xclk60mhsp1_ck);
> >> - dev_err(dev, "xclk60mhsp1_ck failed error:%d\n", ret);
> >> + dev_err(dev, "refclk_60m_ext_p1 failed error:%d\n", ret);
> >> goto err_mem;
> >> }
> >
> > Will anything break if I were to apply the MFD patches seperately?
> >
>
> Nothing will break for OMAP3, but OMAP4 USB host will break (e.g. Panda board).
> OMAP5 USB host was never working so it doesn't matter there.
>
> To make sure nothing breaks, we need at least these 2 patches to go in together with mfd changes.
>
> [PATCH v8 08/14] ARM: dts: omap4: Update omap-usb-host node
> [PATCH v8 09/14] ARM: dts: omap5: Update omap-usb-host node
>
> Any suggestions about how we can proceed?

Yes, unfortunately you have to squash each of the patches into one
patch. Applying a patch which breaks a build, then applying another one
immediately after which subsequently fixes the break is not an acceptable
way of working I'm afraid. What would happen if we were to fall into
the middle of the two patches when bisecting?

--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2014-02-25 09:26:27

by Roger Quadros

[permalink] [raw]
Subject: Re: [PATCH v8 03/14] mfd: omap-usb-host: Use clock names as per function for reference clocks

On 02/25/2014 11:18 AM, Lee Jones wrote:
>>>> Use a meaningful name for the reference clocks so that it indicates the function.
>>>>
>>>> CC: Lee Jones <[email protected]>
>>>> CC: Samuel Ortiz <[email protected]>
>>>> Signed-off-by: Roger Quadros <[email protected]>
>>>> ---
>>>> drivers/mfd/omap-usb-host.c | 12 ++++++------
>>>> 1 file changed, 6 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
>>>> index 865c276..651e249 100644
>>>> --- a/drivers/mfd/omap-usb-host.c
>>>> +++ b/drivers/mfd/omap-usb-host.c
>>>> @@ -718,24 +718,24 @@ static int usbhs_omap_probe(struct platform_device *pdev)
>>>> goto err_mem;
>>>> }
>>>>
>>>> - omap->xclk60mhsp1_ck = devm_clk_get(dev, "xclk60mhsp1_ck");
>>>> + omap->xclk60mhsp1_ck = devm_clk_get(dev, "refclk_60m_ext_p1");
>>>> if (IS_ERR(omap->xclk60mhsp1_ck)) {
>>>> ret = PTR_ERR(omap->xclk60mhsp1_ck);
>>>> - dev_err(dev, "xclk60mhsp1_ck failed error:%d\n", ret);
>>>> + dev_err(dev, "refclk_60m_ext_p1 failed error:%d\n", ret);
>>>> goto err_mem;
>>>> }
>>>
>>> Will anything break if I were to apply the MFD patches seperately?
>>>
>>
>> Nothing will break for OMAP3, but OMAP4 USB host will break (e.g. Panda board).
>> OMAP5 USB host was never working so it doesn't matter there.
>>
>> To make sure nothing breaks, we need at least these 2 patches to go in together with mfd changes.
>>
>> [PATCH v8 08/14] ARM: dts: omap4: Update omap-usb-host node
>> [PATCH v8 09/14] ARM: dts: omap5: Update omap-usb-host node
>>
>> Any suggestions about how we can proceed?
>
> Yes, unfortunately you have to squash each of the patches into one
> patch. Applying a patch which breaks a build, then applying another one
> immediately after which subsequently fixes the break is not an acceptable
> way of working I'm afraid. What would happen if we were to fall into
> the middle of the two patches when bisecting?
>

OK, I'll squash patches 8 and 9 into patch 3.

cheers,
-roger

2014-02-25 09:32:51

by Roger Quadros

[permalink] [raw]
Subject: Re: [PATCH v8 06/14] CLK: TI: OMAP3: Get rid of unused USB Host dummy clocks

Hi Mike,

On 02/25/2014 10:43 AM, Mike Turquette wrote:
> Quoting Roger Quadros (2014-02-20 03:40:01)
>> The OMAP USB Host MFD driver no longer expects these non-existing
>> clocks from the OMAP3 platform, so get rid of them.
>
> Looks good to me.

Is it OK if I squash this patch with [1] and take it through the MFD tree?
Keeping them separate could break functionality if both don't go in together.

[1] - http://article.gmane.org/gmane.linux.ports.arm.kernel/303266

cheers,
-roger

>
>>
>> CC: Tero Kristo <[email protected]>
>> CC: Mike Turquette <[email protected]>
>> Signed-off-by: Roger Quadros <[email protected]>
>> ---
>> arch/arm/mach-omap2/cclock3xxx_data.c | 4 ----
>> drivers/clk/ti/clk-3xxx.c | 4 ----
>> 2 files changed, 8 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c
>> index 3b05aea..4299a55 100644
>> --- a/arch/arm/mach-omap2/cclock3xxx_data.c
>> +++ b/arch/arm/mach-omap2/cclock3xxx_data.c
>> @@ -3495,10 +3495,6 @@ static struct omap_clk omap3xxx_clks[] = {
>> CLK(NULL, "dss_tv_fck", &dss_tv_fck),
>> CLK(NULL, "dss_96m_fck", &dss_96m_fck),
>> CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck),
>> - CLK(NULL, "utmi_p1_gfclk", &dummy_ck),
>> - CLK(NULL, "utmi_p2_gfclk", &dummy_ck),
>> - CLK(NULL, "xclk60mhsp1_ck", &dummy_ck),
>> - CLK(NULL, "xclk60mhsp2_ck", &dummy_ck),
>> CLK(NULL, "init_60m_fclk", &dummy_ck),
>> CLK(NULL, "gpt1_fck", &gpt1_fck),
>> CLK(NULL, "aes2_ick", &aes2_ick),
>> diff --git a/drivers/clk/ti/clk-3xxx.c b/drivers/clk/ti/clk-3xxx.c
>> index d323023..0d1750a 100644
>> --- a/drivers/clk/ti/clk-3xxx.c
>> +++ b/drivers/clk/ti/clk-3xxx.c
>> @@ -130,10 +130,6 @@ static struct ti_dt_clk omap3xxx_clks[] = {
>> DT_CLK(NULL, "dss_tv_fck", "dss_tv_fck"),
>> DT_CLK(NULL, "dss_96m_fck", "dss_96m_fck"),
>> DT_CLK(NULL, "dss2_alwon_fck", "dss2_alwon_fck"),
>> - DT_CLK(NULL, "utmi_p1_gfclk", "dummy_ck"),
>> - DT_CLK(NULL, "utmi_p2_gfclk", "dummy_ck"),
>> - DT_CLK(NULL, "xclk60mhsp1_ck", "dummy_ck"),
>> - DT_CLK(NULL, "xclk60mhsp2_ck", "dummy_ck"),
>> DT_CLK(NULL, "init_60m_fclk", "dummy_ck"),
>> DT_CLK(NULL, "gpt1_fck", "gpt1_fck"),
>> DT_CLK(NULL, "aes2_ick", "aes2_ick"),
>> --
>> 1.8.3.2
>>

2014-02-25 09:40:54

by Roger Quadros

[permalink] [raw]
Subject: Re: [PATCH v8 01/14] mfd: omap-usb-host: Get clocks based on hardware revision

On 02/25/2014 11:37 AM, Lee Jones wrote:
>> Not all revisions have all the clocks so get the necessary clocks
>> based on hardware revision.
>>
>> This should avoid un-necessary clk_get failure messages that were
>> observed earlier.
>>
>> CC: Lee Jones <[email protected]>
>> CC: Samuel Ortiz <[email protected]>
>> Signed-off-by: Roger Quadros <[email protected]>
>> ---
>> drivers/mfd/omap-usb-host.c | 43 ++++++++++++++++++++++++++++++++-----------
>> 1 file changed, 32 insertions(+), 11 deletions(-)
>
> What about patches 1 and 2. Are these safe to go in alone?
>
patch 6 must not go in without 1. I've just asked Mike if we can squash it into 1.

patch 2 can go alone.

cheers,
-roger

2014-02-25 09:38:10

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v8 01/14] mfd: omap-usb-host: Get clocks based on hardware revision

> Not all revisions have all the clocks so get the necessary clocks
> based on hardware revision.
>
> This should avoid un-necessary clk_get failure messages that were
> observed earlier.
>
> CC: Lee Jones <[email protected]>
> CC: Samuel Ortiz <[email protected]>
> Signed-off-by: Roger Quadros <[email protected]>
> ---
> drivers/mfd/omap-usb-host.c | 43 ++++++++++++++++++++++++++++++++-----------
> 1 file changed, 32 insertions(+), 11 deletions(-)

What about patches 1 and 2. Are these safe to go in alone?

--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2014-02-25 09:59:26

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v8 02/14] mfd: omap-usb-host: Always fail on clk_get() error

> Be more strict and always fail on clk_get() error.
>
> For OMAP3 platforms, get the 120MHz EHCI clock by its proper name
> 'usbhost_120m_fck' instead of its alias 'ehci_logic_fck'.
>
> CC: Lee Jones <[email protected]>
> CC: Samuel Ortiz <[email protected]>
> Signed-off-by: Roger Quadros <[email protected]>
> ---
> drivers/mfd/omap-usb-host.c | 65 +++++++++++++++++++++++++++++----------------
> 1 file changed, 42 insertions(+), 23 deletions(-)

Appied, thanks.

--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2014-02-25 10:29:12

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v8 02/14] mfd: omap-usb-host: Always fail on clk_get() error

On Tue, 25 Feb 2014, Lee Jones wrote:

> > Be more strict and always fail on clk_get() error.
> >
> > For OMAP3 platforms, get the 120MHz EHCI clock by its proper name
> > 'usbhost_120m_fck' instead of its alias 'ehci_logic_fck'.
> >
> > CC: Lee Jones <[email protected]>
> > CC: Samuel Ortiz <[email protected]>
> > Signed-off-by: Roger Quadros <[email protected]>
> > ---
> > drivers/mfd/omap-usb-host.c | 65 +++++++++++++++++++++++++++++----------------
> > 1 file changed, 42 insertions(+), 23 deletions(-)
>
> Appied, thanks.

Won't apply. I guess this depends on the changes made in patch 1.

I'll wait for the next drop.

--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2014-02-26 20:56:30

by Mike Turquette

[permalink] [raw]
Subject: Re: [PATCH v8 06/14] CLK: TI: OMAP3: Get rid of unused USB Host dummy clocks

Quoting Roger Quadros (2014-02-25 01:32:19)
> Hi Mike,
>
> On 02/25/2014 10:43 AM, Mike Turquette wrote:
> > Quoting Roger Quadros (2014-02-20 03:40:01)
> >> The OMAP USB Host MFD driver no longer expects these non-existing
> >> clocks from the OMAP3 platform, so get rid of them.
> >
> > Looks good to me.
>
> Is it OK if I squash this patch with [1] and take it through the MFD tree?
> Keeping them separate could break functionality if both don't go in together.

Acked-by: Mike Turquette <[email protected]>

>
> [1] - http://article.gmane.org/gmane.linux.ports.arm.kernel/303266
>
> cheers,
> -roger
>
> >
> >>
> >> CC: Tero Kristo <[email protected]>
> >> CC: Mike Turquette <[email protected]>
> >> Signed-off-by: Roger Quadros <[email protected]>
> >> ---
> >> arch/arm/mach-omap2/cclock3xxx_data.c | 4 ----
> >> drivers/clk/ti/clk-3xxx.c | 4 ----
> >> 2 files changed, 8 deletions(-)
> >>
> >> diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c
> >> index 3b05aea..4299a55 100644
> >> --- a/arch/arm/mach-omap2/cclock3xxx_data.c
> >> +++ b/arch/arm/mach-omap2/cclock3xxx_data.c
> >> @@ -3495,10 +3495,6 @@ static struct omap_clk omap3xxx_clks[] = {
> >> CLK(NULL, "dss_tv_fck", &dss_tv_fck),
> >> CLK(NULL, "dss_96m_fck", &dss_96m_fck),
> >> CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck),
> >> - CLK(NULL, "utmi_p1_gfclk", &dummy_ck),
> >> - CLK(NULL, "utmi_p2_gfclk", &dummy_ck),
> >> - CLK(NULL, "xclk60mhsp1_ck", &dummy_ck),
> >> - CLK(NULL, "xclk60mhsp2_ck", &dummy_ck),
> >> CLK(NULL, "init_60m_fclk", &dummy_ck),
> >> CLK(NULL, "gpt1_fck", &gpt1_fck),
> >> CLK(NULL, "aes2_ick", &aes2_ick),
> >> diff --git a/drivers/clk/ti/clk-3xxx.c b/drivers/clk/ti/clk-3xxx.c
> >> index d323023..0d1750a 100644
> >> --- a/drivers/clk/ti/clk-3xxx.c
> >> +++ b/drivers/clk/ti/clk-3xxx.c
> >> @@ -130,10 +130,6 @@ static struct ti_dt_clk omap3xxx_clks[] = {
> >> DT_CLK(NULL, "dss_tv_fck", "dss_tv_fck"),
> >> DT_CLK(NULL, "dss_96m_fck", "dss_96m_fck"),
> >> DT_CLK(NULL, "dss2_alwon_fck", "dss2_alwon_fck"),
> >> - DT_CLK(NULL, "utmi_p1_gfclk", "dummy_ck"),
> >> - DT_CLK(NULL, "utmi_p2_gfclk", "dummy_ck"),
> >> - DT_CLK(NULL, "xclk60mhsp1_ck", "dummy_ck"),
> >> - DT_CLK(NULL, "xclk60mhsp2_ck", "dummy_ck"),
> >> DT_CLK(NULL, "init_60m_fclk", "dummy_ck"),
> >> DT_CLK(NULL, "gpt1_fck", "gpt1_fck"),
> >> DT_CLK(NULL, "aes2_ick", "aes2_ick"),
> >> --
> >> 1.8.3.2
> >>
>