Patch "usb: chipidea: imx: Do not access CLKONOFF on i.MX51" has been added to the 4.11-stable tree
Subsystems (4)
This is a note to let you know that I've just added the patch titled
usb: chipidea: imx: Do not access CLKONOFF on i.MX51
to the 4.11-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
usb-chipidea-imx-do-not-access-clkonoff-on-i.mx51.patch
and it can be found in the queue-4.11 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
62b97d502bb76c6e8d589e42e02bfcb7bdff0453Mon Sep 17 00:00:00 2001
From: Andrey Smirnov <[email protected]>
Date: Mon, 15 May 2017 06:48:58 -0700
Subject: usb: chipidea: imx: Do not access CLKONOFF on i.MX51
From: Andrey Smirnov <[email protected]>
commit 62b97d502bb76c6e8d589e42e02bfcb7bdff0453 upstream.
Unlike i.MX53, i.MX51's USBOH3 register file does not implemenent registers past offset 0x018, which includes MX53_USB_CLKONOFF_CTRL_OFFSET and trying to access that register on said platform results in external abort.
Fix it by enabling CLKONOFF accessing codepath only for i.MX53.
Fixes 3be3251db088 ("usb: chipidea: imx: Disable internal 60Mhz clock with ULPI PHY")
--- drivers/usb/chipidea/usbmisc_imx.c | 41 ++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-)
drivers/usb/chipidea/usbmisc_imx.c +32 -9
@@ -108,6 +108,8 @@ struct imx_usbmisc {const struct usbmisc_ops *ops; }; +static inline bool is_imx53_usbmisc (struct imx_usbmisc_data *data); +static int usbmisc_imx25_init (struct imx_usbmisc_data *data) {struct imx_usbmisc *usbmisc =dev_get_drvdata (data->dev);
@@ -242,10 +244,15 @@ static int usbmisc_imx53_init(struct imx val =readl (reg) | MX53_USB_UHx_CTRL_WAKE_UP_EN | MX53_USB_UHx_CTRL_ULPI_INT_EN;writel (val, reg); -/* Disable internal 60Mhz clock */ - reg = usbmisc->base +MX53_USB_CLKONOFF_CTRL_OFFSET ; - val =readl (reg) |MX53_USB_CLKONOFF_CTRL_H2_INT60CKOFF ; -writel (val, reg); +if (is_imx53_usbmisc (data)) { +/* Disable internal 60Mhz clock */ + reg = usbmisc->base + +MX53_USB_CLKONOFF_CTRL_OFFSET ; + val =readl (reg) | +MX53_USB_CLKONOFF_CTRL_H2_INT60CKOFF ; +writel (val, reg); + } + }if (data->disable_oc) { reg = usbmisc->base +MX53_USB_UH2_CTRL_OFFSET ;
@@ -267,10 +274,15 @@ static int usbmisc_imx53_init(struct imx val =readl (reg) | MX53_USB_UHx_CTRL_WAKE_UP_EN | MX53_USB_UHx_CTRL_ULPI_INT_EN;writel (val, reg); -/* Disable internal 60Mhz clock */ - reg = usbmisc->base +MX53_USB_CLKONOFF_CTRL_OFFSET ; - val =readl (reg) |MX53_USB_CLKONOFF_CTRL_H3_INT60CKOFF ; -writel (val, reg); + +if (is_imx53_usbmisc (data)) { +/* Disable internal 60Mhz clock */ + reg = usbmisc->base + +MX53_USB_CLKONOFF_CTRL_OFFSET ; + val =readl (reg) | +MX53_USB_CLKONOFF_CTRL_H3_INT60CKOFF ; +writel (val, reg); + } }if (data->disable_oc) { reg = usbmisc->base +MX53_USB_UH3_CTRL_OFFSET ;
@@ -456,6 +468,10 @@ static const struct usbmisc_ops imx27_us .init = usbmisc_imx27_init, }; +static const struct usbmisc_ops imx51_usbmisc_ops = { + .init = usbmisc_imx53_init, +}; +static const struct usbmisc_ops imx53_usbmisc_ops = { .init = usbmisc_imx53_init, };
@@ -479,6 +495,13 @@ static const struct usbmisc_ops imx7d_us .set_wakeup = usbmisc_imx7d_set_wakeup, }; +static inline bool is_imx53_usbmisc (struct imx_usbmisc_data *data) +{ +struct imx_usbmisc *usbmisc =dev_get_drvdata (data->dev); + +return usbmisc->ops == &imx53_usbmisc_ops; +} +int imx_usbmisc_init (struct imx_usbmisc_data *data) {struct imx_usbmisc *usbmisc;
@@ -536,7 +559,7 @@ static const struct of_device_id usbmisc }, { .compatible = "fsl,imx51-usbmisc", - .data = &imx53_usbmisc_ops, + .data = &imx51_usbmisc_ops, }, { .compatible = "fsl,imx53-usbmisc",
Patches currently in stable-queue which might be from [email protected] are
queue-4.11/usb-chipidea-imx-do-not-access-clkonoff-on-i.mx51.patch