* [GIT PULL] Ux500 pin changes
From: Arnd Bergmann @ 2012-11-15 11:48 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121115112032.GB21682@gmail.com>
On Thursday 15 November 2012, Lee Jones wrote:
> On Thu, 15 Nov 2012, Linus Walleij wrote:
>
> > On Mon, Nov 12, 2012 at 11:35 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > > u8500_defconfig now gives me two new errors in arm-soc/for-next when building with
> > > -Werror:
> > >
> > > arch/arm/mach-ux500/board-mop500-pins.c:73:22: error: 'out_hi_wkup_pdis' defined but not used [-Werror=unused-variable]
> >
> > I've sent a fix for this, could you apply that patch directly to the
> > drivers branch?
> >
> > > and the existing:
> > >
> > > ERROR (phandle_references): Reference to non-existent node or label "tc3589x_gpio"
> > >
> > > Can you provide patches to fix these up?
> >
> > What on earth is that? Lee, do you know how to fix this one up, I shamelessly
> > assume it to be related to commit:
> > commit 3113e679021a3a6bace1c62a8432cc0ec27c09ab
> > "gpio: Enable the tc3298x GPIO expander driver for Device Tree"
>
> I haven't seen this error.
>
> Which kernel is this? How do I reproduce?
>
It's currently in arm-soc/for-next. Reproduce with "make u8500_defconfig && make".
I haven't bisected the problem, but it's obvious that some dts files reference
the "tc3589x_gpio" file that is not defined anywhere.
Arnd
^ permalink raw reply
* [PATCH v2 2/3] serial: mxs-auart: add the DMA support for mx28
From: Lauri Hintsala @ 2012-11-15 11:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <50A4B1CE.5070203@freescale.com>
Hi,
On 11/15/2012 11:11 AM, Huang Shijie wrote:
>> I tested linux-next-20121114 on apx4devkit (imx28 based device) and I
>> got the same error message:
>>
>> # stty -F /dev/ttyAPP0 crtscts; microcom /dev/ttyAPP0 -s 115200
>> [ 133.710000] mxs-auart 8006a000.serial: step 1 error
>> [ 133.720000] mxs-auart 8006a000.serial: We can not start up the DMA.
> Could you test this patch?
I don't get error messages with your latest patch but the CPU freezes
after it has received first byte. Freezing happens only if flow control
(and of course DMA) is enabled. Sending data doesn't freeze the CPU. Are
you able to send data without freezing?
I used busybox's microcom to transfer data.
Lauri
^ permalink raw reply
* [PATCH] arm/dts: Add basic support for gta04 (Openmoko next generation) board.
From: Grant Likely @ 2012-11-15 11:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAAfyv34D4bTO=k8niM42CDQFb0tP4uOnvX_KPT3+F6z59jPg3Q@mail.gmail.com>
On Wed, 14 Nov 2012 21:26:58 +0100, Belisko Marek <marek.belisko@gmail.com> wrote:
> CC' Grant & Rob
Hi Marek
Since this is an OMAP board, you should send the changes to Tony and
they should be merged through the arm-soc tree.
g.
>
> On Tue, Oct 30, 2012 at 10:42 PM, Marek Belisko
> <marek.belisko@open-nandra.com> wrote:
> > Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
> > ---
> > arch/arm/boot/dts/omap3-gta04.dts | 65 +++++++++++++++++++++++++++++++++++++
> > 1 file changed, 65 insertions(+)
> > create mode 100644 arch/arm/boot/dts/omap3-gta04.dts
> >
> > diff --git a/arch/arm/boot/dts/omap3-gta04.dts b/arch/arm/boot/dts/omap3-gta04.dts
> > new file mode 100644
> > index 0000000..76efd13
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/omap3-gta04.dts
> > @@ -0,0 +1,65 @@
> > +/*
> > + * Copyright (C) 2012 Marek Belisko <marek.belisko@open-nandra.com>
> > + *
> > + * Based on omap3-beagle-xm.dts
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + */
> > +/dts-v1/;
> > +
> > +/include/ "omap3.dtsi"
> > +
> > +/ {
> > + model = "OMAP3 GTA04";
> > + compatible = "ti,omap3-gta04", "ti,omap3";
> > +
> > + memory {
> > + device_type = "memory";
> > + reg = <0x80000000 0x20000000>; /* 512 MB */
> > + };
> > +
> > + gpio-keys {
> > + compatible = "gpio-keys";
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > + aux-button {
> > + label = "AUX";
> > + linux,code = <169>;
> > + gpios = <&gpio1 7 1>;
> > + gpio-key,wakeup;
> > + };
> > + };
> > +};
> > +
> > +&i2c1 {
> > + clock-frequency = <2600000>;
> > +
> > + twl: twl at 48 {
> > + reg = <0x48>;
> > + interrupts = <7>; /* SYS_NIRQ cascaded to intc */
> > + interrupt-parent = <&intc>;
> > + };
> > +};
> > +
> > +/include/ "twl4030.dtsi"
> > +
> > +&i2c2 {
> > + clock-frequency = <400000>;
> > + /* Pressure Sensor */
> > + bmp085 at 77 {
> > + compatible = "bosch,bmp085";
> > + reg = <0x77>;
> > + };
> > +};
> > +
> > +&i2c3 {
> > + clock-frequency = <100000>;
> > +};
> > +
> > +&mmc1 {
> > + vmmc-supply = <&vmmc1>;
> > + bus-width = <4>;
> > +};
> > +
> > --
> > 1.7.9.5
> >
>
>
>
> --
> as simple and primitive as possible
> -------------------------------------------------
> Marek Belisko - OPEN-NANDRA
> Freelance Developer
>
> Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
> Tel: +421 915 052 184
> skype: marekwhite
> twitter: #opennandra
> web: http://open-nandra.com
--
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.
^ permalink raw reply
* [PATCH v2 0/7] support other fsl SoCs with usbmisc + small fixes
From: Michael Grzeschik @ 2012-11-15 12:03 UTC (permalink / raw)
To: linux-arm-kernel
Nearly every SoC from Freescale has this non-core usb registers. This series
adds support for more users of this driver.
This series is based on Peter Chen's work. Its needed to merge his master branch
before applying this series:
https://github.com/hzpeterchen/linux-usb.git
Thanks,
Michael
Marc Kleine-Budde (4):
usb: chipidea: usbmisc: unset global varibale usbmisc on driver remove
usb: chipidea: usbmisc: fix a potential race condition
usb: chipidea: usbmisc: prepare driver to handle more than one soc
usb: chipidea: usbmisc: add support for ahb, ipg and per clock
Michael Grzeschik (3):
usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx
usb: chipidea: usbmisc: add mx53 support
usb: chipidea: usbmisc: add post handling and errata fix for mx25
.../devicetree/bindings/usb/ci13xxx-imx.txt | 2 +
drivers/usb/chipidea/Makefile | 2 +-
drivers/usb/chipidea/ci13xxx_imx.c | 12 +
drivers/usb/chipidea/ci13xxx_imx.h | 3 +
drivers/usb/chipidea/usbmisc_imx.c | 256 ++++++++++++++++++++
drivers/usb/chipidea/usbmisc_imx6q.c | 162 -------------
6 files changed, 274 insertions(+), 163 deletions(-)
create mode 100644 drivers/usb/chipidea/usbmisc_imx.c
delete mode 100644 drivers/usb/chipidea/usbmisc_imx6q.c
--
1.7.10.4
^ permalink raw reply
* [PATCH v2 1/7] usb: chipidea: usbmisc: rename file, struct and functions to usbmisc_imx
From: Michael Grzeschik @ 2012-11-15 12:03 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352981028-14312-1-git-send-email-m.grzeschik@pengutronix.de>
This driver will be used for every Freescale SoC which has this misc
memory layout to control the basic usb handling. So better name this
driver, function and struct names in a more generic way.
Reported-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Changes since v1:
* added Makefile change to be build as well
* moved this patch infront all other
drivers/usb/chipidea/Makefile | 2 +-
.../chipidea/{usbmisc_imx6q.c => usbmisc_imx.c} | 38 ++++++++++----------
2 files changed, 20 insertions(+), 20 deletions(-)
rename drivers/usb/chipidea/{usbmisc_imx6q.c => usbmisc_imx.c} (75%)
diff --git a/drivers/usb/chipidea/Makefile b/drivers/usb/chipidea/Makefile
index 11f513c..146ecd7 100644
--- a/drivers/usb/chipidea/Makefile
+++ b/drivers/usb/chipidea/Makefile
@@ -17,5 +17,5 @@ ifneq ($(CONFIG_PCI),)
endif
ifneq ($(CONFIG_OF_DEVICE),)
- obj-$(CONFIG_USB_CHIPIDEA) += ci13xxx_imx.o usbmisc_imx6q.o
+ obj-$(CONFIG_USB_CHIPIDEA) += ci13xxx_imx.o usbmisc_imx.o
endif
diff --git a/drivers/usb/chipidea/usbmisc_imx6q.c b/drivers/usb/chipidea/usbmisc_imx.c
similarity index 75%
rename from drivers/usb/chipidea/usbmisc_imx6q.c
rename to drivers/usb/chipidea/usbmisc_imx.c
index 416e3fc..5da379a 100644
--- a/drivers/usb/chipidea/usbmisc_imx6q.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -21,14 +21,14 @@
#define BM_OVER_CUR_DIS BIT(7)
-struct imx6q_usbmisc {
+struct imx_usbmisc {
void __iomem *base;
spinlock_t lock;
struct clk *clk;
struct usbmisc_usb_device usbdev[USB_DEV_MAX];
};
-static struct imx6q_usbmisc *usbmisc;
+static struct imx_usbmisc *usbmisc;
static struct usbmisc_usb_device *get_usbdev(struct device *dev)
{
@@ -77,15 +77,15 @@ static const struct usbmisc_ops imx6q_usbmisc_ops = {
.init = usbmisc_imx6q_init,
};
-static const struct of_device_id usbmisc_imx6q_dt_ids[] = {
+static const struct of_device_id usbmisc_imx_dt_ids[] = {
{ .compatible = "fsl,imx6q-usbmisc"},
{ /* sentinel */ }
};
-static int __devinit usbmisc_imx6q_probe(struct platform_device *pdev)
+static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
{
struct resource *res;
- struct imx6q_usbmisc *data;
+ struct imx_usbmisc *data;
int ret;
if (usbmisc)
@@ -127,36 +127,36 @@ static int __devinit usbmisc_imx6q_probe(struct platform_device *pdev)
return 0;
}
-static int __devexit usbmisc_imx6q_remove(struct platform_device *pdev)
+static int __devexit usbmisc_imx_remove(struct platform_device *pdev)
{
usbmisc_unset_ops(&imx6q_usbmisc_ops);
clk_disable_unprepare(usbmisc->clk);
return 0;
}
-static struct platform_driver usbmisc_imx6q_driver = {
- .probe = usbmisc_imx6q_probe,
- .remove = __devexit_p(usbmisc_imx6q_remove),
+static struct platform_driver usbmisc_imx_driver = {
+ .probe = usbmisc_imx_probe,
+ .remove = __devexit_p(usbmisc_imx_remove),
.driver = {
- .name = "usbmisc_imx6q",
+ .name = "usbmisc_imx",
.owner = THIS_MODULE,
- .of_match_table = usbmisc_imx6q_dt_ids,
+ .of_match_table = usbmisc_imx_dt_ids,
},
};
-int __init usbmisc_imx6q_drv_init(void)
+int __init usbmisc_imx_drv_init(void)
{
- return platform_driver_register(&usbmisc_imx6q_driver);
+ return platform_driver_register(&usbmisc_imx_driver);
}
-subsys_initcall(usbmisc_imx6q_drv_init);
+subsys_initcall(usbmisc_imx_drv_init);
-void __exit usbmisc_imx6q_drv_exit(void)
+void __exit usbmisc_imx_drv_exit(void)
{
- platform_driver_unregister(&usbmisc_imx6q_driver);
+ platform_driver_unregister(&usbmisc_imx_driver);
}
-module_exit(usbmisc_imx6q_drv_exit);
+module_exit(usbmisc_imx_drv_exit);
-MODULE_ALIAS("platform:usbmisc-imx6q");
+MODULE_ALIAS("platform:usbmisc-imx");
MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("driver for imx6q usb non-core registers");
+MODULE_DESCRIPTION("driver for imx usb non-core registers");
MODULE_AUTHOR("Richard Zhao <richard.zhao@freescale.com>");
--
1.7.10.4
^ permalink raw reply related
* [PATCH v2 2/7] usb: chipidea: usbmisc: unset global varibale usbmisc on driver remove
From: Michael Grzeschik @ 2012-11-15 12:03 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352981028-14312-1-git-send-email-m.grzeschik@pengutronix.de>
From: Marc Kleine-Budde <mkl@pengutronix.de>
The probe function checks usbmisc to be NULL in the beginning. Without
this patch the can only be loaded once.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
Changes since v1:
* split previous patch into two seperate.
drivers/usb/chipidea/usbmisc_imx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 5da379a..552c63f 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -131,6 +131,7 @@ static int __devexit usbmisc_imx_remove(struct platform_device *pdev)
{
usbmisc_unset_ops(&imx6q_usbmisc_ops);
clk_disable_unprepare(usbmisc->clk);
+ usbmisc = NULL;
return 0;
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH v2 3/7] usb: chipidea: usbmisc: fix a potential race condition
From: Michael Grzeschik @ 2012-11-15 12:03 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352981028-14312-1-git-send-email-m.grzeschik@pengutronix.de>
From: Marc Kleine-Budde <mkl@pengutronix.de>
This fixes a potential race condition where the ci13xxx_imx glue code
could be fast enough to call one of the usbmisc_ops before he got a
valid value on the static usbmisc pointer. To fix that we first set
usbmisc, then call usbmisc_set_ops().
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
Changes since v1:
* split previous patch into two seperate.
drivers/usb/chipidea/usbmisc_imx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 552c63f..9145e04 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -116,14 +116,14 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
return ret;
}
+ usbmisc = data;
ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
if (ret) {
+ usbmisc = NULL;
clk_disable_unprepare(data->clk);
return ret;
}
- usbmisc = data;
-
return 0;
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH v2 4/7] usb: chipidea: usbmisc: prepare driver to handle more than one soc
From: Michael Grzeschik @ 2012-11-15 12:03 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352981028-14312-1-git-send-email-m.grzeschik@pengutronix.de>
From: Marc Kleine-Budde <mkl@pengutronix.de>
This attaches the usbmisc_ops to the of_device_id data and
makes it possible to define special functions per soc.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
drivers/usb/chipidea/usbmisc_imx.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 9145e04..4b1ed7c 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -26,6 +26,7 @@ struct imx_usbmisc {
spinlock_t lock;
struct clk *clk;
struct usbmisc_usb_device usbdev[USB_DEV_MAX];
+ const struct usbmisc_ops *ops;
};
static struct imx_usbmisc *usbmisc;
@@ -78,7 +79,7 @@ static const struct usbmisc_ops imx6q_usbmisc_ops = {
};
static const struct of_device_id usbmisc_imx_dt_ids[] = {
- { .compatible = "fsl,imx6q-usbmisc"},
+ { .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
{ /* sentinel */ }
};
@@ -87,6 +88,7 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
struct resource *res;
struct imx_usbmisc *data;
int ret;
+ struct of_device_id *tmp_dev;
if (usbmisc)
return -EBUSY;
@@ -116,8 +118,11 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
return ret;
}
+ tmp_dev = (struct of_device_id *)
+ of_match_device(usbmisc_imx_dt_ids, &pdev->dev);
+ data->ops = (const struct usbmisc_ops *)tmp_dev->data;
usbmisc = data;
- ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
+ ret = usbmisc_set_ops(data->ops);
if (ret) {
usbmisc = NULL;
clk_disable_unprepare(data->clk);
@@ -129,7 +134,7 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
static int __devexit usbmisc_imx_remove(struct platform_device *pdev)
{
- usbmisc_unset_ops(&imx6q_usbmisc_ops);
+ usbmisc_unset_ops(usbmisc->ops);
clk_disable_unprepare(usbmisc->clk);
usbmisc = NULL;
return 0;
--
1.7.10.4
^ permalink raw reply related
* [PATCH v2 5/7] usb: chipidea: usbmisc: add support for ahb, ipg and per clock
From: Michael Grzeschik @ 2012-11-15 12:03 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352981028-14312-1-git-send-email-m.grzeschik@pengutronix.de>
From: Marc Kleine-Budde <mkl@pengutronix.de>
This patch adds support for a second and third clock to the usbmisc driver. On
modern freescale ARM cores like the imx51, imx53 and imx6q three clocks ("ahb",
"ipg" and "per") must be enabled in order to access the USB core.
ahb - AMBA High-Performance Bus clock domain
ipg - IP-Bus Gate clock domain
per - Peripheral clock domain
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
Changes since v1:
* changed patch description
drivers/usb/chipidea/usbmisc_imx.c | 60 +++++++++++++++++++++++++++---------
1 file changed, 45 insertions(+), 15 deletions(-)
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 4b1ed7c..913e414 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -24,7 +24,9 @@
struct imx_usbmisc {
void __iomem *base;
spinlock_t lock;
- struct clk *clk;
+ struct clk *clk_ahb;
+ struct clk *clk_ipg;
+ struct clk *clk_per;
struct usbmisc_usb_device usbdev[USB_DEV_MAX];
const struct usbmisc_ops *ops;
};
@@ -104,38 +106,66 @@ static int __devinit usbmisc_imx_probe(struct platform_device *pdev)
if (!data->base)
return -EADDRNOTAVAIL;
- data->clk = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(data->clk)) {
+ data->clk_ahb = devm_clk_get(&pdev->dev, "ahb");
+ if (IS_ERR(data->clk_ahb)) {
dev_err(&pdev->dev,
- "failed to get clock, err=%ld\n", PTR_ERR(data->clk));
- return PTR_ERR(data->clk);
+ "failed to get ahb clock, err=%ld\n", PTR_ERR(data->clk_ahb));
+ return PTR_ERR(data->clk_ahb);
}
- ret = clk_prepare_enable(data->clk);
- if (ret) {
+ data->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
+ if (IS_ERR(data->clk_ipg)) {
dev_err(&pdev->dev,
- "clk_prepare_enable failed, err=%d\n", ret);
- return ret;
+ "failed to get ipg clock, err=%ld\n", PTR_ERR(data->clk_ipg));
+ return PTR_ERR(data->clk_ipg);
}
+ data->clk_per = devm_clk_get(&pdev->dev, "per");
+ if (IS_ERR(data->clk_per)) {
+ dev_err(&pdev->dev,
+ "failed to get per clock, err=%ld\n", PTR_ERR(data->clk_per));
+ return PTR_ERR(data->clk_per);
+ }
+
+ ret = clk_prepare_enable(data->clk_ahb);
+ if (ret)
+ return ret;
+
+ ret = clk_prepare_enable(data->clk_ipg);
+ if (ret)
+ goto err_ipg_failed;
+
+ ret = clk_prepare_enable(data->clk_per);
+ if (ret)
+ goto err_per_failed;
+
tmp_dev = (struct of_device_id *)
of_match_device(usbmisc_imx_dt_ids, &pdev->dev);
data->ops = (const struct usbmisc_ops *)tmp_dev->data;
usbmisc = data;
ret = usbmisc_set_ops(data->ops);
- if (ret) {
- usbmisc = NULL;
- clk_disable_unprepare(data->clk);
- return ret;
- }
+ if (ret)
+ goto err_set_ops_failed;
return 0;
+
+ err_set_ops_failed:
+ usbmisc = NULL;
+ clk_disable_unprepare(data->clk_per);
+ err_per_failed:
+ clk_disable_unprepare(data->clk_ipg);
+ err_ipg_failed:
+ clk_disable_unprepare(data->clk_ahb);
+
+ return ret;
}
static int __devexit usbmisc_imx_remove(struct platform_device *pdev)
{
usbmisc_unset_ops(usbmisc->ops);
- clk_disable_unprepare(usbmisc->clk);
+ clk_disable_unprepare(usbmisc->clk_per);
+ clk_disable_unprepare(usbmisc->clk_ipg);
+ clk_disable_unprepare(usbmisc->clk_ahb);
usbmisc = NULL;
return 0;
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH v2 6/7] usb: chipidea: usbmisc: add mx53 support
From: Michael Grzeschik @ 2012-11-15 12:03 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352981028-14312-1-git-send-email-m.grzeschik@pengutronix.de>
This adds mx53 as the next user of the usbmisc driver and makes it
possible to disable the overcurrent-detection of the internal phy.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/usb/chipidea/usbmisc_imx.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 913e414..9718500 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -54,6 +54,29 @@ static struct usbmisc_usb_device *get_usbdev(struct device *dev)
return &usbmisc->usbdev[i];
}
+static int usbmisc_imx53_init(struct device *dev)
+{
+ struct usbmisc_usb_device *usbdev;
+ void __iomem *reg;
+ unsigned long flags;
+ u32 val;
+
+ usbdev = get_usbdev(dev);
+ if (IS_ERR(usbdev))
+ return PTR_ERR(usbdev);
+
+ reg = usbmisc->base + usbdev->index * 8;
+
+ if (usbdev->disable_oc) {
+ spin_lock_irqsave(&usbmisc->lock, flags);
+ val = readl(reg);
+ writel(val | (1 << 5), reg);
+ spin_unlock_irqrestore(&usbmisc->lock, flags);
+ }
+
+ return 0;
+}
+
static int usbmisc_imx6q_init(struct device *dev)
{
@@ -76,11 +99,16 @@ static int usbmisc_imx6q_init(struct device *dev)
return 0;
}
+static const struct usbmisc_ops imx53_usbmisc_ops = {
+ .init = usbmisc_imx53_init,
+};
+
static const struct usbmisc_ops imx6q_usbmisc_ops = {
.init = usbmisc_imx6q_init,
};
static const struct of_device_id usbmisc_imx_dt_ids[] = {
+ { .compatible = "fsl,imx53-usbmisc", .data = (void *)&imx53_usbmisc_ops },
{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
{ /* sentinel */ }
};
--
1.7.10.4
^ permalink raw reply related
* [PATCH v2 7/7] usb: chipidea: usbmisc: add post handling and errata fix for mx25
From: Michael Grzeschik @ 2012-11-15 12:03 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352981028-14312-1-git-send-email-m.grzeschik@pengutronix.de>
This adds a post handling routine which is called after
ci13xxx_add_device was called. The first user is the mx25, which has to
disable the external-vbus-divider after the udc has started.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
.../devicetree/bindings/usb/ci13xxx-imx.txt | 2 ++
drivers/usb/chipidea/ci13xxx_imx.c | 12 ++++++++
drivers/usb/chipidea/ci13xxx_imx.h | 3 ++
drivers/usb/chipidea/usbmisc_imx.c | 30 ++++++++++++++++++++
4 files changed, 47 insertions(+)
diff --git a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
index 5778b9c..1c04a4c 100644
--- a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
+++ b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
@@ -11,6 +11,7 @@ Optional properties:
that indicate usb controller index
- vbus-supply: regulator for vbus
- disable-over-current: disable over current detect
+- external-vbus-divider: enables off-chip resistor divider for Vbus
Examples:
usb at 02184000 { /* USB OTG */
@@ -20,4 +21,5 @@ usb at 02184000 { /* USB OTG */
fsl,usbphy = <&usbphy1>;
fsl,usbmisc = <&usbmisc 0>;
disable-over-current;
+ external-vbus-divider;
};
diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
index 935de97..d346c99 100644
--- a/drivers/usb/chipidea/ci13xxx_imx.c
+++ b/drivers/usb/chipidea/ci13xxx_imx.c
@@ -79,6 +79,9 @@ int usbmisc_get_init_data(struct device *dev, struct usbmisc_usb_device *usbdev)
if (of_find_property(np, "disable-over-current", NULL))
usbdev->disable_oc = 1;
+ if (of_find_property(np, "external-vbus-divider", NULL))
+ usbdev->evdo = 1;
+
return 0;
}
EXPORT_SYMBOL_GPL(usbmisc_get_init_data);
@@ -213,6 +216,15 @@ static int __devinit ci13xxx_imx_probe(struct platform_device *pdev)
goto put_np;
}
+ if (usbmisc_ops && usbmisc_ops->post) {
+ ret = usbmisc_ops->post(&pdev->dev);
+ if (ret) {
+ dev_err(&pdev->dev,
+ "usbmisc post failed, ret=%d\n", ret);
+ goto put_np;
+ }
+ }
+
data->ci_pdev = plat_ci;
platform_set_drvdata(pdev, data);
diff --git a/drivers/usb/chipidea/ci13xxx_imx.h b/drivers/usb/chipidea/ci13xxx_imx.h
index 2e88acc..d065273 100644
--- a/drivers/usb/chipidea/ci13xxx_imx.h
+++ b/drivers/usb/chipidea/ci13xxx_imx.h
@@ -13,6 +13,8 @@
struct usbmisc_ops {
/* It's called once when probe a usb device */
int (*init)(struct device *dev);
+ /* It's called once after adding a usb device */
+ int (*post)(struct device *dev);
};
struct usbmisc_usb_device {
@@ -20,6 +22,7 @@ struct usbmisc_usb_device {
int index;
int disable_oc:1; /* over current detect disabled */
+ int evdo:1; /* set external vbus divider option */
};
int usbmisc_set_ops(const struct usbmisc_ops *ops);
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 9718500..acca109 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -14,6 +14,7 @@
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/io.h>
+#include <linux/delay.h>
#include "ci13xxx_imx.h"
@@ -54,6 +55,30 @@ static struct usbmisc_usb_device *get_usbdev(struct device *dev)
return &usbmisc->usbdev[i];
}
+static int usbmisc_imx25_post(struct device *dev)
+{
+ struct usbmisc_usb_device *usbdev;
+ void __iomem *reg;
+ unsigned long flags;
+ u32 val;
+
+ usbdev = get_usbdev(dev);
+ if (IS_ERR(usbdev))
+ return PTR_ERR(usbdev);
+
+ reg = usbmisc->base + 0x08;
+
+ if (usbdev->evdo) {
+ spin_lock_irqsave(&usbmisc->lock, flags);
+ val = readl(reg);
+ writel(val | (1 << 23), reg);
+ spin_unlock_irqrestore(&usbmisc->lock, flags);
+ mdelay(5); /* needed to stabilize voltage */
+ }
+
+ return 0;
+}
+
static int usbmisc_imx53_init(struct device *dev)
{
struct usbmisc_usb_device *usbdev;
@@ -99,6 +124,10 @@ static int usbmisc_imx6q_init(struct device *dev)
return 0;
}
+static const struct usbmisc_ops imx25_usbmisc_ops = {
+ .post = usbmisc_imx25_post,
+};
+
static const struct usbmisc_ops imx53_usbmisc_ops = {
.init = usbmisc_imx53_init,
};
@@ -108,6 +137,7 @@ static const struct usbmisc_ops imx6q_usbmisc_ops = {
};
static const struct of_device_id usbmisc_imx_dt_ids[] = {
+ { .compatible = "fsl,imx25-usbmisc", .data = (void *)&imx25_usbmisc_ops },
{ .compatible = "fsl,imx53-usbmisc", .data = (void *)&imx53_usbmisc_ops },
{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
{ /* sentinel */ }
--
1.7.10.4
^ permalink raw reply related
* [PATCH] ARM: pxa: remove pxa95x support
From: Arnd Bergmann @ 2012-11-15 12:06 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352970366-7154-1-git-send-email-haojian.zhuang@gmail.com>
On Thursday 15 November 2012, Haojian Zhuang wrote:
> PXA95x isn't widely used. And it adds the effort on supporting
> multiple platform. So remove it.
>
> Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Looks good to me, thanks for going through this.
Acked-by: Arnd Bergmann <arnd@arndb.de>
Should I apply this straight into the arm-soc tree, or are you
going to send a pull request?
^ permalink raw reply
* [PATCH] ARM: pxa: remove pxa95x support
From: Haojian Zhuang @ 2012-11-15 12:10 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <201211151206.33461.arnd@arndb.de>
On Thu, Nov 15, 2012 at 8:06 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Thursday 15 November 2012, Haojian Zhuang wrote:
>> PXA95x isn't widely used. And it adds the effort on supporting
>> multiple platform. So remove it.
>>
>> Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
>
> Looks good to me, thanks for going through this.
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> Should I apply this straight into the arm-soc tree, or are you
> going to send a pull request?
Yes, please apply it into arm-soc tree directly.
Regards
Haojian
^ permalink raw reply
* [PATCH 0/4] i2c-s3c2410: Fix a bug and optimize code
From: Naveen Krishna Chatradhi @ 2012-11-15 12:13 UTC (permalink / raw)
To: linux-arm-kernel
The following set of patches fixes a bug in i2c-s3c2410 driver
with respect to the functioning of dedicated HDMIPHY channel.
1. Removing unwanted spinlock
2. Correcting the Stop sequence
3. Optimizing the wait loop for bus idle.
4. Removing unnecessary HDMI special cases
Respectively.
Daniel Kurtz (4):
i2c-s3c2410: grab adapter lock while changing i2c clock
i2c-s3c2410: do not generate STOP for QUIRK_HDMIPHY
i2c-s3c2410: use exponential back off while polling for bus idle
i2c-s3c2410: do not special case HDMIPHY stuck bus detection
drivers/i2c/busses/i2c-s3c2410.c | 134 ++++++++++++++++++++++++++------------
1 file changed, 91 insertions(+), 43 deletions(-)
--
1.7.9.5
^ permalink raw reply
* [PATCH 1/4] i2c-s3c2410: grab adapter lock while changing i2c clock
From: Naveen Krishna Chatradhi @ 2012-11-15 12:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352981613-2098-1-git-send-email-ch.naveen@samsung.com>
From: Daniel Kurtz <djkurtz@chromium.org>
We probably don't want to change I2C frequency while a transfer is in
progress. The current implementation grabs a spinlock, but that only
protected the writes to IICCON when starting a message, it didn't protect
against clock changes in the middle of a transaction.
Note: The i2c-core already grabs the adapter lock before calling
s3c24xx_i2c_doxfer(), which ensures that only one caller is issuing a
xfer at a time. This means it is not necessary to disable interrupts
(spin_lock_irqsave) when changing frequencies, since there won't be
any i2c interrupts if there is no on-going xfer.
Lastly, i2c_lock_adapter() may cause the cpufreq_transition to sleep if
if a xfer is in progress, but this is ok since cpufreq notifiers are
called in a kernel thread, and there are already cases where it could
sleep, such as when using i2c to update the output of a voltage
regulator.
Note: the cpufreq part of this change has no functional affect on
exynos, where the i2c clock is independent of the cpufreq.
But, there is a slight perfomance boost since we no longer need to
lock/unlock an additional spinlock.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Cc: Olof Johansson <olofj@chromium.org>
Cc: Doug Anderson <dianders@chromium.org>
Cc: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
---
drivers/i2c/busses/i2c-s3c2410.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 3e0335f..155cb04 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -59,7 +59,6 @@ enum s3c24xx_i2c_state {
};
struct s3c24xx_i2c {
- spinlock_t lock;
wait_queue_head_t wait;
unsigned int quirks;
unsigned int suspended:1;
@@ -540,8 +539,6 @@ static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c,
goto out;
}
- spin_lock_irq(&i2c->lock);
-
i2c->msg = msgs;
i2c->msg_num = num;
i2c->msg_ptr = 0;
@@ -550,7 +547,6 @@ static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c,
s3c24xx_i2c_enable_irq(i2c);
s3c24xx_i2c_message_start(i2c, msgs);
- spin_unlock_irq(&i2c->lock);
timeout = wait_event_timeout(i2c->wait, i2c->msg_num == 0, HZ * 5);
@@ -740,7 +736,6 @@ static int s3c24xx_i2c_cpufreq_transition(struct notifier_block *nb,
unsigned long val, void *data)
{
struct s3c24xx_i2c *i2c = freq_to_i2c(nb);
- unsigned long flags;
unsigned int got;
int delta_f;
int ret;
@@ -754,9 +749,9 @@ static int s3c24xx_i2c_cpufreq_transition(struct notifier_block *nb,
if ((val == CPUFREQ_POSTCHANGE && delta_f < 0) ||
(val == CPUFREQ_PRECHANGE && delta_f > 0)) {
- spin_lock_irqsave(&i2c->lock, flags);
+ i2c_lock_adapter(&i2c->adap);
ret = s3c24xx_i2c_clockrate(i2c, &got);
- spin_unlock_irqrestore(&i2c->lock, flags);
+ i2c_unlock_adapter(&i2c->adap);
if (ret < 0)
dev_err(i2c->dev, "cannot find frequency\n");
@@ -962,7 +957,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
i2c->adap.class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
i2c->tx_setup = 50;
- spin_lock_init(&i2c->lock);
init_waitqueue_head(&i2c->wait);
/* find the clock and enable it */
--
1.7.9.5
^ permalink raw reply related
* [PATCH 2/4] i2c-s3c2410: do not generate STOP for QUIRK_HDMIPHY
From: Naveen Krishna Chatradhi @ 2012-11-15 12:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352981613-2098-1-git-send-email-ch.naveen@samsung.com>
From: Daniel Kurtz <djkurtz@chromium.org>
buses
The datasheet says that the STOP sequence should be:
1) I2CSTAT.5 = 0 - Clear BUSY (or 'generate STOP')
2) I2CCON.4 = 0 - Clear IRQPEND
3) Wait until the stop condition takes effect.
4*) I2CSTAT.4 = 0 - Clear TXRXEN
Where, step "4*" is only for buses with the "HDMIPHY" quirk.
However, after much experimentation, it appears that:
a) normal buses automatically clear BUSY and transition from
Master->Slave when they complete generating a STOP condition.
Therefore, step (3) can be done in doxfer() by polling I2CCON.4
after starting the STOP generation here.
b) HDMIPHY bus does neither, so there is no way to do step 3.
There is no indication when this bus has finished generating STOP.
In fact, we have found that as soon as the IRQPEND bit is cleared in
step 2, the HDMIPHY bus generates the STOP condition, and then immediately
starts transferring another data byte, even though the bus is supposedly
stopped. This is presumably because the bus is still in "Master" mode,
and its BUSY bit is still set.
To avoid these extra post-STOP transactions on HDMI phy devices, we just
disable Serial Output on the bus (I2CSTAT.4 = 0) directly, instead of
first generating a proper STOP condition. This should float SDA & SCK
terminating the transfer. Subsequent transfers start with a proper START
condition, and proceed normally.
The HDMIPHY bus is an internal bus that always has exactly two devices,
the host as Master and the HDMIPHY device as the slave. Skipping the STOP
condition has been tested on this bus and works.
Also, since we disable the bus directly from the isr, we can skip the bus
idle polling loop at the end of doxfer().
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Cc: Doug Anderson <dianders@chromium.org>
Cc: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
---
drivers/i2c/busses/i2c-s3c2410.c | 47 ++++++++++++++++++++++++++++++++++++--
1 file changed, 45 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 155cb04..fc4bf35 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -234,8 +234,47 @@ static inline void s3c24xx_i2c_stop(struct s3c24xx_i2c *i2c, int ret)
dev_dbg(i2c->dev, "STOP\n");
- /* stop the transfer */
- iicstat &= ~S3C2410_IICSTAT_START;
+ /*
+ * The datasheet says that the STOP sequence should be:
+ * 1) I2CSTAT.5 = 0 - Clear BUSY (or 'generate STOP')
+ * 2) I2CCON.4 = 0 - Clear IRQPEND
+ * 3) Wait until the stop condition takes effect.
+ * 4*) I2CSTAT.4 = 0 - Clear TXRXEN
+ *
+ * Where, step "4*" is only for buses with the "HDMIPHY" quirk.
+ *
+ * However, after much experimentation, it appears that:
+ * a) normal buses automatically clear BUSY and transition from
+ * Master->Slave when they complete generating a STOP condition.
+ * Therefore, step (3) can be done in doxfer() by polling I2CCON.4
+ * after starting the STOP generation here.
+ * b) HDMIPHY bus does neither, so there is no way to do step 3.
+ * There is no indication when this bus has finished generating
+ * STOP.
+ *
+ * In fact, we have found that as soon as the IRQPEND bit is cleared in
+ * step 2, the HDMIPHY bus generates the STOP condition, and then
+ * immediately starts transferring another data byte, even though the
+ * bus is supposedly stopped. This is presumably because the bus is
+ * still in "Master" mode, and its BUSY bit is still set.
+ *
+ * To avoid these extra post-STOP transactions on HDMI phy devices, we
+ * just disable Serial Output on the bus (I2CSTAT.4 = 0) directly,
+ * instead of first generating a proper STOP condition. This should
+ * float SDA & SCK terminating the transfer. Subsequent transfers
+ * start with a proper START condition, and proceed normally.
+ *
+ * The HDMIPHY bus is an internal bus that always has exactly two
+ * devices, the host as Master and the HDMIPHY device as the slave.
+ * Skipping the STOP condition has been tested on this bus and works.
+ */
+ if (i2c->quirks & QUIRK_HDMIPHY) {
+ /* Stop driving the I2C pins */
+ iicstat &= ~S3C2410_IICSTAT_TXRXEN;
+ } else {
+ /* stop the transfer */
+ iicstat &= ~S3C2410_IICSTAT_START;
+ }
writel(iicstat, i2c->regs + S3C2410_IICSTAT);
i2c->state = STATE_STOP;
@@ -560,6 +599,10 @@ static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c,
else if (ret != num)
dev_dbg(i2c->dev, "incomplete xfer (%d)\n", ret);
+ /* For QUIRK_HDMIPHY, bus is already disabled */
+ if (i2c->quirks & QUIRK_HDMIPHY)
+ goto out;
+
/* ensure the stop has been through the bus */
dev_dbg(i2c->dev, "waiting for bus idle\n");
--
1.7.9.5
^ permalink raw reply related
* [PATCH 3/4] i2c-s3c2410: use exponential back off while polling for bus idle
From: Naveen Krishna Chatradhi @ 2012-11-15 12:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352981613-2098-1-git-send-email-ch.naveen@samsung.com>
From: Daniel Kurtz <djkurtz@chromium.org>
Usually, the i2c controller has finished emitting the i2c STOP before the
driver reaches the bus idle polling loop. Optimize for this most common
case by reading IICSTAT first and potentially skipping the loop.
If the cpu is faster than the hardware, we wait for bus idle in a polling
loop. However, since the duration of one iteration of the loop is
dependent on cpu freq, and this i2c IP is used on many different systems,
use a time based loop timeout (5 ms).
We would like very low latencies to detect bus idle for the normal
'fast' case. However, if a device is slow to release the bus for some
reason, it could hold off the STOP generation for up to several
milliseconds. Rapidly polling for bus idle would seriously load the CPU
while waiting for it to release the bus. So, use a partial exponential
backoff as a compromise between idle detection latency and cpu load.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Cc: Olof Johansson <olofj@chromium.org>
Cc: Benson Leung <bleung@chromium.org>
Cc: Doug Anderson <dianders@chromium.org>
Cc: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
---
drivers/i2c/busses/i2c-s3c2410.c | 67 ++++++++++++++++++++++++++------------
1 file changed, 47 insertions(+), 20 deletions(-)
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index fc4bf35..362a307 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -49,6 +49,9 @@
#define QUIRK_HDMIPHY (1 << 1)
#define QUIRK_NO_GPIO (1 << 2)
+/* Max time to wait for bus to become idle after a xfer (in us) */
+#define S3C2410_IDLE_TIMEOUT 5000
+
/* i2c controller state */
enum s3c24xx_i2c_state {
STATE_IDLE,
@@ -556,6 +559,48 @@ static int s3c24xx_i2c_set_master(struct s3c24xx_i2c *i2c)
return -ETIMEDOUT;
}
+/* s3c24xx_i2c_wait_idle
+ *
+ * wait for the i2c bus to become idle.
+*/
+
+static void s3c24xx_i2c_wait_idle(struct s3c24xx_i2c *i2c)
+{
+ unsigned long iicstat;
+ ktime_t start, now;
+ unsigned long delay;
+
+ /* ensure the stop has been through the bus */
+
+ dev_dbg(i2c->dev, "waiting for bus idle\n");
+
+ start = now = ktime_get();
+
+ /*
+ * Most of the time, the bus is already idle within a few usec of the
+ * end of a transaction. However, really slow i2c devices can stretch
+ * the clock, delaying STOP generation.
+ *
+ * As a compromise between idle detection latency for the normal, fast
+ * case, and system load in the slow device case, use an exponential
+ * back off in the polling loop, up to 1/10th of the total timeout,
+ * then continue to poll at a constant rate up to the timeout.
+ */
+ iicstat = readl(i2c->regs + S3C2410_IICSTAT);
+ delay = 1;
+ while ((iicstat & S3C2410_IICSTAT_START) &&
+ ktime_us_delta(now, start) < S3C2410_IDLE_TIMEOUT) {
+ usleep_range(delay, 2 * delay);
+ if (delay < S3C2410_IDLE_TIMEOUT / 10)
+ delay <<= 1;
+ now = ktime_get();
+ iicstat = readl(i2c->regs + S3C2410_IICSTAT);
+ }
+
+ if (iicstat & S3C2410_IICSTAT_START)
+ dev_warn(i2c->dev, "timeout waiting for bus idle\n");
+}
+
/* s3c24xx_i2c_doxfer
*
* this starts an i2c transfer
@@ -564,8 +609,7 @@ static int s3c24xx_i2c_set_master(struct s3c24xx_i2c *i2c)
static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c,
struct i2c_msg *msgs, int num)
{
- unsigned long iicstat, timeout;
- int spins = 20;
+ unsigned long timeout;
int ret;
if (i2c->suspended)
@@ -603,24 +647,7 @@ static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c,
if (i2c->quirks & QUIRK_HDMIPHY)
goto out;
- /* ensure the stop has been through the bus */
-
- dev_dbg(i2c->dev, "waiting for bus idle\n");
-
- /* first, try busy waiting briefly */
- do {
- cpu_relax();
- iicstat = readl(i2c->regs + S3C2410_IICSTAT);
- } while ((iicstat & S3C2410_IICSTAT_START) && --spins);
-
- /* if that timed out sleep */
- if (!spins) {
- msleep(1);
- iicstat = readl(i2c->regs + S3C2410_IICSTAT);
- }
-
- if (iicstat & S3C2410_IICSTAT_START)
- dev_warn(i2c->dev, "timeout waiting for bus idle\n");
+ s3c24xx_i2c_wait_idle(i2c);
out:
return ret;
--
1.7.9.5
^ permalink raw reply related
* [PATCH 4/4] i2c-s3c2410: do not special case HDMIPHY stuck bus detection
From: Naveen Krishna Chatradhi @ 2012-11-15 12:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352981613-2098-1-git-send-email-ch.naveen@samsung.com>
From: Daniel Kurtz <djkurtz@chromium.org>
Commit "i2c-s3c2410: Add HDMIPHY quirk for S3C2440" added support for
HDMIPHY with some special handling in s3c24xx_i2c_set_master:
"due to unknown reason (probably HW bug in HDMIPHY and/or the controller)
a transfer fails to finish. The controller hangs after sending the last
byte, the workaround for this bug is resetting the controller after each
transfer"
The "unknown reason" was that the proper sequence for generating a STOP
condition wasn't being followed as per the datasheet. Since this is fixed
by "PATCH: i2c-s3c2410: do not generate STOP for QUIRK_HDMIPHY buses",
remove the special handling.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Cc: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
---
drivers/i2c/busses/i2c-s3c2410.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 362a307..c76ca7c 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -531,13 +531,6 @@ static int s3c24xx_i2c_set_master(struct s3c24xx_i2c *i2c)
unsigned long iicstat;
int timeout = 400;
- /* the timeout for HDMIPHY is reduced to 10 ms because
- * the hangup is expected to happen, so waiting 400 ms
- * causes only unnecessary system hangup
- */
- if (i2c->quirks & QUIRK_HDMIPHY)
- timeout = 10;
-
while (timeout-- > 0) {
iicstat = readl(i2c->regs + S3C2410_IICSTAT);
@@ -547,15 +540,6 @@ static int s3c24xx_i2c_set_master(struct s3c24xx_i2c *i2c)
msleep(1);
}
- /* hang-up of bus dedicated for HDMIPHY occurred, resetting */
- if (i2c->quirks & QUIRK_HDMIPHY) {
- writel(0, i2c->regs + S3C2410_IICCON);
- writel(0, i2c->regs + S3C2410_IICSTAT);
- writel(0, i2c->regs + S3C2410_IICDS);
-
- return 0;
- }
-
return -ETIMEDOUT;
}
--
1.7.9.5
^ permalink raw reply related
* [PATCH] ARM: pxa: remove pxa95x support
From: Arnd Bergmann @ 2012-11-15 12:14 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <201211151206.33461.arnd@arndb.de>
On Thursday 15 November 2012, Arnd Bergmann wrote:
> On Thursday 15 November 2012, Haojian Zhuang wrote:
> > PXA95x isn't widely used. And it adds the effort on supporting
> > multiple platform. So remove it.
> >
> > Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
>
> Looks good to me, thanks for going through this.
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> Should I apply this straight into the arm-soc tree, or are you
> going to send a pull request?
>
One more comment: It would be good to put a disclaimer into the
changeset text like
"The assumption is that nobody will miss this support. If you are
reading this text because you actually require pxa95x support on
a new kernel, we can work out a way to revert this patch or add
support to the mmp platform".
Arnd
^ permalink raw reply
* [PATCH] ARM: ux500: fix pin warning
From: Arnd Bergmann @ 2012-11-15 12:17 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352976439-24133-1-git-send-email-linus.walleij@stericsson.com>
On Thursday 15 November 2012, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
>
> Recent pin changes produce this warning:
>
> arch/arm/mach-ux500/board-mop500-pins.c:73:22:
> error: 'out_hi_wkup_pdis' defined but not used
> [-Werror=unused-variable]
>
> Fix this by deleting the offending definition.
>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Applied on drivers branch, thanks!
Arnd
^ permalink raw reply
* [PATCH 0/2] clk: ux500: Make mtu driver use apb_pclock
From: Arnd Bergmann @ 2012-11-15 12:21 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CACRpkdYmPvRLcEjSNwC51sZw+g3iH3a5r7+7USEWJONmR4q4JQ@mail.gmail.com>
On Thursday 15 November 2012, Linus Walleij wrote:
> On Mon, Nov 12, 2012 at 7:36 PM, Mike Turquette <mturquette@ti.com> wrote:
> > Quoting Linus Walleij (2012-11-11 10:47:46)
>
> >> I don't know quite how ingenious git is in detecting
> >> patches on moved files, but if it's causing trouble
> >> I think it's better if you could ACK them and we
> >> could reubmit them to ARM SoC on the multiplatform
> >> branch. i.e. this one:
> >> http://git.kernel.org/?p=linux/kernel/git/arm/arm-soc.git;a=shortlog;h=refs/heads/next/multiplatform
> >>
> >
> > Those patches have my ACK. Do you want to wait to see if something goes
> > boom or would you rather I drop them from clk-next preemptively?
>
> Hm that's basically a question of how smart git is when
> merging these trees together.
>
> Arnd, Olof: what is your experience? If one tree is moving
> files and another tree is patching them, should we try to
> rebase these onto your branch in ARM SoC and submit
> them there instead?
rename vs change conflicts are usually handled, but not always.
The one thing that never works is when part of one file is moved
into another file (or two files get merged into one) and another
patch changes the same file.
If I understand the problem at hand correctly, the safe solution
should be to base the ux500 clk changes on top of c3b9d1db23c4e,
which is in the nomadik/plat-removal branch in arm-soc that got
merged into next/multiplatform. I would prefer if you use that
as a base instead of the larger next/multiplatform branch that
also contains vt8500 and other changes.
Arnd
^ permalink raw reply
* [PATCH 1/1] ARM: ux500: Describe UART platform registering issues more accurately
From: Arnd Bergmann @ 2012-11-15 12:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352968401-6092-1-git-send-email-lee.jones@linaro.org>
On Thursday 15 November 2012, Lee Jones wrote:
> UARTs no longer require call-back information, since the reset
> call-back was removed in 43b5f0d69291374f602ad8e1817f329573a59010.
> The only AUXDATA dependencies remaining for UARTs are DMA settings.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
What is the state of the DMA binding now? We originally wanted to merge
it for 3.7, but that didn't work out, so I hope we can get it done for
3.8.
Arnd
^ permalink raw reply
* [PATCH] ARM: pxa: remove pxa95x support
From: Haojian Zhuang @ 2012-11-15 12:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <201211151214.47073.arnd@arndb.de>
On Thu, Nov 15, 2012 at 8:14 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Thursday 15 November 2012, Arnd Bergmann wrote:
>> On Thursday 15 November 2012, Haojian Zhuang wrote:
>> > PXA95x isn't widely used. And it adds the effort on supporting
>> > multiple platform. So remove it.
>> >
>> > Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
>>
>> Looks good to me, thanks for going through this.
>>
>> Acked-by: Arnd Bergmann <arnd@arndb.de>
>>
>> Should I apply this straight into the arm-soc tree, or are you
>> going to send a pull request?
>>
>
> One more comment: It would be good to put a disclaimer into the
> changeset text like
>
> "The assumption is that nobody will miss this support. If you are
> reading this text because you actually require pxa95x support on
> a new kernel, we can work out a way to revert this patch or add
> support to the mmp platform".
>
> Arnd
Yes, it's great. Please help to paste it into the changeset.
Best Regards
Haojian
^ permalink raw reply
* [PATCH 1/2] Boottime: A tool for automatic measurement of kernel/bootloader boot time
From: Arnd Bergmann @ 2012-11-15 12:25 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121115112543.GC21682@gmail.com>
On Thursday 15 November 2012, Lee Jones wrote:
>
> > > +/* for automatic boot timing testcases */
> > > +#define ATAG_BOOTTIME 0x41000403
> > Where can I refer this ATAG usage? can you point out the reference URL
> > or patches?
>
> I assumed this would be in Mainline u-boot, but apparently not.
> On closer inspection of the internal ST-Ericsson u-boot, this
> functionality appears to be provided by patches which currently
> exist as delta. So in essence, the bootloader you use will have
> to be patched in a similar way for you to retrieve information
> surrounding bootloader boot times.
>
> And there was me thinking it was magic. ;)
>
And since we're moving away from ATAG on ux500 towards DT, it won't
even work in the future. How essential is this part for the operation
of your code?
Arnd
^ permalink raw reply
* [PATCH 1/1] ARM: ux500: Describe UART platform registering issues more accurately
From: Lee Jones @ 2012-11-15 12:33 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <201211151223.46989.arnd@arndb.de>
On Thu, 15 Nov 2012, Arnd Bergmann wrote:
> On Thursday 15 November 2012, Lee Jones wrote:
> > UARTs no longer require call-back information, since the reset
> > call-back was removed in 43b5f0d69291374f602ad8e1817f329573a59010.
> > The only AUXDATA dependencies remaining for UARTs are DMA settings.
> >
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> What is the state of the DMA binding now? We originally wanted to merge
> it for 3.7, but that didn't work out, so I hope we can get it done for
> 3.8.
It's dead. The conversation has been stale for weeks.
Perhaps you'd like to go and poke it? :)
--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox