* [PATCH v2] char: hw_random: atmel-rng: disable TRNG during suspend
From: Wenyou Yang @ 2016-10-25 0:56 UTC (permalink / raw)
To: linux-arm-kernel
To fix the over consumption on the VDDCore due to the TRNG enabled,
disable the TRNG during suspend, not only disable the user interface
clock (which is controlled by PMC). Because the user interface clock
is independent from any clock that may be used in the entropy source
logic circuitry.
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
Changes in v2:
- Enable the user interface first, then enable the internal clock
when resume.
drivers/char/hw_random/atmel-rng.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
index 0fcc9e6..ae7cae5 100644
--- a/drivers/char/hw_random/atmel-rng.c
+++ b/drivers/char/hw_random/atmel-rng.c
@@ -48,6 +48,16 @@ static int atmel_trng_read(struct hwrng *rng, void *buf, size_t max,
return 0;
}
+static void atmel_trng_enable(struct atmel_trng *trng)
+{
+ writel(TRNG_KEY | 1, trng->base + TRNG_CR);
+}
+
+static void atmel_trng_disable(struct atmel_trng *trng)
+{
+ writel(TRNG_KEY, trng->base + TRNG_CR);
+}
+
static int atmel_trng_probe(struct platform_device *pdev)
{
struct atmel_trng *trng;
@@ -71,7 +81,7 @@ static int atmel_trng_probe(struct platform_device *pdev)
if (ret)
return ret;
- writel(TRNG_KEY | 1, trng->base + TRNG_CR);
+ atmel_trng_enable(trng);
trng->rng.name = pdev->name;
trng->rng.read = atmel_trng_read;
@@ -94,7 +104,7 @@ static int atmel_trng_remove(struct platform_device *pdev)
hwrng_unregister(&trng->rng);
- writel(TRNG_KEY, trng->base + TRNG_CR);
+ atmel_trng_disable(trng);
clk_disable_unprepare(trng->clk);
return 0;
@@ -105,6 +115,7 @@ static int atmel_trng_suspend(struct device *dev)
{
struct atmel_trng *trng = dev_get_drvdata(dev);
+ atmel_trng_disable(trng);
clk_disable_unprepare(trng->clk);
return 0;
@@ -113,8 +124,15 @@ static int atmel_trng_suspend(struct device *dev)
static int atmel_trng_resume(struct device *dev)
{
struct atmel_trng *trng = dev_get_drvdata(dev);
+ int ret;
+
+ ret = clk_prepare_enable(trng->clk);
+ if (ret)
+ return ret;
- return clk_prepare_enable(trng->clk);
+ atmel_trng_enable(trng);
+
+ return 0;
}
static const struct dev_pm_ops atmel_trng_pm_ops = {
--
2.7.4
^ permalink raw reply related
* [PATCH/RFT v2 16/17] USB: ohci-da8xx: Allow probing from DT
From: David Lechner @ 2016-10-25 0:53 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161024164634.4330-17-ahaslam@baylibre.com>
On 10/24/2016 11:46 AM, ahaslam at baylibre.com wrote:
> From: Axel Haslam <ahaslam@baylibre.com>
>
> This adds the compatible string to the ohci driver
> to be able to probe from DT
>
> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
> ---
> drivers/usb/host/ohci-da8xx.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c
> index bebc3f0..1a8db25 100644
> --- a/drivers/usb/host/ohci-da8xx.c
> +++ b/drivers/usb/host/ohci-da8xx.c
> @@ -273,6 +273,13 @@ static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
> }
>
> /*-------------------------------------------------------------------------*/
> +#ifdef CONFIG_OF
#ifdef CONFIG_OF is probably not needed here...
> +static const struct of_device_id da8xx_ohci_ids[] = {
> + { .compatible = "ti,da830-ohci" },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, da8xx_ohci_ids);
> +#endif
>
> static int ohci_da8xx_probe(struct platform_device *pdev)
> {
> @@ -421,6 +428,7 @@ static int ohci_da8xx_resume(struct platform_device *dev)
> #endif
> .driver = {
> .name = "ohci",
> + .of_match_table = da8xx_ohci_ids,
...otherwise, da8xx_ohci_ids will not be defined here
> },
> };
>
>
^ permalink raw reply
* [PATCH v1] char: hw_random: atmel-rng: disable TRNG during suspend
From: Wenyou.Yang at microchip.com @ 2016-10-25 0:48 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <b0554c1e-e13a-9fe3-ebf4-5d8b0aa16b15@atmel.com>
> -----Original Message-----
> From: Nicolas Ferre [mailto:nicolas.ferre at atmel.com]
> Sent: 2016?10?24? 20:07
> To: Wenyou Yang - A41535 <Wenyou.Yang@microchip.com>; Herbert Xu
> <herbert@gondor.apana.org.au>; Matt Mackall <mpm@selenic.com>
> Cc: linux-crypto at vger.kernel.org; Wenyou Yang - A41535
> <Wenyou.Yang@microchip.com>; linux-arm-kernel at lists.infradead.org
> Subject: Re: [PATCH v1] char: hw_random: atmel-rng: disable TRNG during
> suspend
>
> Le 24/10/2016 ? 10:03, Wenyou Yang a ?crit :
> > To fix the over consumption on the VDDCore due to the TRNG enabled,
> > disable the TRNG during suspend, not only disable the user interface
> > clock (which is controlled by PMC). Because the user interface clock
> > is independent from any clock that may be used in the entropy source
> > logic circuitry.
> >
> > Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> > ---
> >
> > drivers/char/hw_random/atmel-rng.c | 16 ++++++++++++++--
> > 1 file changed, 14 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/char/hw_random/atmel-rng.c
> > b/drivers/char/hw_random/atmel-rng.c
> > index 0fcc9e6..2e2d09a 100644
> > --- a/drivers/char/hw_random/atmel-rng.c
> > +++ b/drivers/char/hw_random/atmel-rng.c
> > @@ -48,6 +48,16 @@ static int atmel_trng_read(struct hwrng *rng, void *buf,
> size_t max,
> > return 0;
> > }
> >
> > +static void atmel_trng_enable(struct atmel_trng *trng) {
> > + writel(TRNG_KEY | 1, trng->base + TRNG_CR); }
> > +
> > +static void atmel_trng_disable(struct atmel_trng *trng) {
> > + writel(TRNG_KEY, trng->base + TRNG_CR); }
> > +
> > static int atmel_trng_probe(struct platform_device *pdev) {
> > struct atmel_trng *trng;
> > @@ -71,7 +81,7 @@ static int atmel_trng_probe(struct platform_device *pdev)
> > if (ret)
> > return ret;
> >
> > - writel(TRNG_KEY | 1, trng->base + TRNG_CR);
> > + atmel_trng_enable(trng);
> > trng->rng.name = pdev->name;
> > trng->rng.read = atmel_trng_read;
> >
> > @@ -94,7 +104,7 @@ static int atmel_trng_remove(struct platform_device
> > *pdev)
> >
> > hwrng_unregister(&trng->rng);
> >
> > - writel(TRNG_KEY, trng->base + TRNG_CR);
> > + atmel_trng_disable(trng);
> > clk_disable_unprepare(trng->clk);
> >
> > return 0;
> > @@ -105,6 +115,7 @@ static int atmel_trng_suspend(struct device *dev)
> > {
> > struct atmel_trng *trng = dev_get_drvdata(dev);
> >
> > + atmel_trng_disable(trng);
> > clk_disable_unprepare(trng->clk);
> >
> > return 0;
> > @@ -114,6 +125,7 @@ static int atmel_trng_resume(struct device *dev)
> > {
> > struct atmel_trng *trng = dev_get_drvdata(dev);
> >
> > + atmel_trng_enable(trng);
> > return clk_prepare_enable(trng->clk);
>
> Isn't it the other way around:
> enable the user interface first, then enable the internal clock? like:
>
> clk_prepare_enable(trng->clk);
> atmel_trng_enable(trng);
Yes, I thought so.
But the datasheet said, "The user interface clock is independent from any clock that may be used in the entropy source logic circuitry.
The source of entropy can be enabled before enabling the user interface clock."
It seems the TRNG can be enabled before enabling the peripheral clock.
Best Regards,
Wenyou Yang
^ permalink raw reply
* [PATCH/RFT v2 17/17] ARM: dts: da850: add usb device node
From: David Lechner @ 2016-10-25 0:48 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161024164634.4330-18-ahaslam@baylibre.com>
On 10/24/2016 11:46 AM, ahaslam at baylibre.com wrote:
> From: Axel Haslam <ahaslam@baylibre.com>
>
> This adds the usb (ohci) device node for the da850 soc.
> Also it enables it for the lcdk board
>
> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
> ---
> arch/arm/boot/dts/da850-lcdk.dts | 8 ++++++++
> arch/arm/boot/dts/da850.dtsi | 8 ++++++++
> 2 files changed, 16 insertions(+)
>
> diff --git a/arch/arm/boot/dts/da850-lcdk.dts b/arch/arm/boot/dts/da850-lcdk.dts
> index 7b8ab21..fa91339 100644
> --- a/arch/arm/boot/dts/da850-lcdk.dts
> +++ b/arch/arm/boot/dts/da850-lcdk.dts
> @@ -86,6 +86,14 @@
> };
> };
>
> +&usb_phy {
> + status = "okay";
> +};
> +
> +&usb {
> + status = "okay";
Don't you need to specify a regulator here using the vbus-supply property?
> +};
> +
> &serial2 {
> pinctrl-names = "default";
> pinctrl-0 = <&serial2_rxtx_pins>;
> diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
> index 33fcdce..ec2cec3 100644
> --- a/arch/arm/boot/dts/da850.dtsi
> +++ b/arch/arm/boot/dts/da850.dtsi
> @@ -381,6 +381,14 @@
> #phy-cells = <1>;
> status = "disabled";
> };
> + usb: usb at 0225000 {
Don't need the leading 0 on usb at 225000
The alias (usb:) might need to be more specific since there is a second
usb device that will be added later for musb. (The comments in the
previous review only referred to the "usb" in "usb@", not the alias.)
> + compatible = "ti,da830-ohci";
> + reg = <0x225000 0x1000>;
> + interrupts = <59>;
> + phys = <&usb_phy 1>;
> + phy-names = "usb-phy";
> + status = "disabled";
> + };
> gpio: gpio at 226000 {
> compatible = "ti,dm6441-gpio";
> gpio-controller;
>
^ permalink raw reply
* [PATCH] asm-generic: Drop getrlimit and setrlimit syscalls from default list
From: Ley Foon Tan @ 2016-10-25 0:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161024090931.GR7370@jhogan-linux.le.imgtec.org>
On Mon, Oct 24, 2016 at 5:09 PM, James Hogan <james.hogan@imgtec.com> wrote:
> On Sat, Oct 22, 2016 at 03:14:04PM +0300, Yury Norov wrote:
>> The newer prlimit64 syscall provides all the functionality provided by
>> the getrlimit and setrlimit syscalls and adds the pid of target process,
>> so future architectures won't need to include getrlimit and setrlimit.
>>
>> Therefore drop getrlimit and setrlimit syscalls from the generic syscall
>> list unless __ARCH_WANT_SET_GET_RLIMIT is defined by the architecture's
>> unistd.h prior to including asm-generic/unistd.h, and adjust all
>> architectures using the generic syscall list to define it so that no
>> in-tree architectures are affected.
>>
>> Cc: Vineet Gupta <vgupta@synopsys.com>
>> Cc: Catalin Marinas <catalin.marinas@arm.com>
>> Cc: Will Deacon <will.deacon@arm.com>
>> Cc: Mark Salter <msalter@redhat.com>
>> Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
>> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
>> Cc: Richard Kuo <rkuo@codeaurora.org>
>> Cc: James Hogan <james.hogan@imgtec.com>
>> Cc: Ley Foon Tan <lftan@altera.com>
>> Cc: Jonas Bonn <jonas@southpole.se>
>> Cc: Chen Liqin <liqin.linux@gmail.com>
>> Cc: Lennox Wu <lennox.wu@gmail.com>
>> Cc: Chris Metcalf <cmetcalf@mellanox.com>
>> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
>> Cc: Arnd Bergmann <arnd@arndb.de>
>> Cc: Andrew Pinski <Andrew.Pinski@cavium.com>
>> Cc: linux-snps-arc at lists.infradead.org
>> Cc: linux-kernel at vger.kernel.org
>> Cc: linux-arm-kernel at lists.infradead.org
>> Cc: linux-c6x-dev at linux-c6x.org
>> Cc: uclinux-h8-devel at lists.sourceforge.jp
>> Cc: linux-hexagon at vger.kernel.org
>> Cc: linux-metag at vger.kernel.org
>> Cc: nios2-dev at lists.rocketboards.org
>> Cc: linux-arch at vger.kernel.or
>> Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
>>
>> ---
>> arch/arc/include/uapi/asm/unistd.h | 1 +
>> arch/arm64/include/uapi/asm/unistd.h | 1 +
>> arch/c6x/include/uapi/asm/unistd.h | 1 +
>> arch/h8300/include/uapi/asm/unistd.h | 1 +
>> arch/hexagon/include/uapi/asm/unistd.h | 1 +
>> arch/metag/include/uapi/asm/unistd.h | 1 +
>
> Acked-by: James Hogan <james.hogan@imgtec.com> [metag]
>
> Cheers
> James
>
>> arch/nios2/include/uapi/asm/unistd.h | 1 +
Acked-by: Ley Foon Tan <lftan@altera.com> [nios2]
>> arch/openrisc/include/uapi/asm/unistd.h | 1 +
>> arch/score/include/uapi/asm/unistd.h | 1 +
>> arch/tile/include/uapi/asm/unistd.h | 1 +
>> arch/unicore32/include/uapi/asm/unistd.h | 1 +
>> include/uapi/asm-generic/unistd.h | 5 +++++
>> 12 files changed, 16 insertions(+)
>>
>> diff --git a/arch/arc/include/uapi/asm/unistd.h b/arch/arc/include/uapi/asm/unistd.h
>> index 41fa2ec..928546d 100644
>> --- a/arch/arc/include/uapi/asm/unistd.h
>> +++ b/arch/arc/include/uapi/asm/unistd.h
>> @@ -16,6 +16,7 @@
>> #define _UAPI_ASM_ARC_UNISTD_H
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>> #define __ARCH_WANT_SYS_EXECVE
>> #define __ARCH_WANT_SYS_CLONE
>> #define __ARCH_WANT_SYS_VFORK
>> diff --git a/arch/arm64/include/uapi/asm/unistd.h b/arch/arm64/include/uapi/asm/unistd.h
>> index 043d17a..48355a6 100644
>> --- a/arch/arm64/include/uapi/asm/unistd.h
>> +++ b/arch/arm64/include/uapi/asm/unistd.h
>> @@ -15,5 +15,6 @@
>> */
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>>
>> #include <asm-generic/unistd.h>
>> diff --git a/arch/c6x/include/uapi/asm/unistd.h b/arch/c6x/include/uapi/asm/unistd.h
>> index 12d73d9..f676231 100644
>> --- a/arch/c6x/include/uapi/asm/unistd.h
>> +++ b/arch/c6x/include/uapi/asm/unistd.h
>> @@ -15,6 +15,7 @@
>> */
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>> #define __ARCH_WANT_SYS_CLONE
>>
>> /* Use the standard ABI for syscalls. */
>> diff --git a/arch/h8300/include/uapi/asm/unistd.h b/arch/h8300/include/uapi/asm/unistd.h
>> index 7dd20ef..2f98394 100644
>> --- a/arch/h8300/include/uapi/asm/unistd.h
>> +++ b/arch/h8300/include/uapi/asm/unistd.h
>> @@ -1,5 +1,6 @@
>> #define __ARCH_NOMMU
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>>
>> #include <asm-generic/unistd.h>
>> diff --git a/arch/hexagon/include/uapi/asm/unistd.h b/arch/hexagon/include/uapi/asm/unistd.h
>> index 2151760..52d585c 100644
>> --- a/arch/hexagon/include/uapi/asm/unistd.h
>> +++ b/arch/hexagon/include/uapi/asm/unistd.h
>> @@ -28,6 +28,7 @@
>>
>> #define sys_mmap2 sys_mmap_pgoff
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>> #define __ARCH_WANT_SYS_EXECVE
>> #define __ARCH_WANT_SYS_CLONE
>> #define __ARCH_WANT_SYS_VFORK
>> diff --git a/arch/metag/include/uapi/asm/unistd.h b/arch/metag/include/uapi/asm/unistd.h
>> index 459b6ec..16b5cb3 100644
>> --- a/arch/metag/include/uapi/asm/unistd.h
>> +++ b/arch/metag/include/uapi/asm/unistd.h
>> @@ -8,6 +8,7 @@
>> */
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>>
>> /* Use the standard ABI for syscalls. */
>> #include <asm-generic/unistd.h>
>> diff --git a/arch/nios2/include/uapi/asm/unistd.h b/arch/nios2/include/uapi/asm/unistd.h
>> index 51a32c7..b0dda4d 100644
>> --- a/arch/nios2/include/uapi/asm/unistd.h
>> +++ b/arch/nios2/include/uapi/asm/unistd.h
>> @@ -18,6 +18,7 @@
>> #define sys_mmap2 sys_mmap_pgoff
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>>
>> /* Use the standard ABI for syscalls */
>> #include <asm-generic/unistd.h>
>> diff --git a/arch/openrisc/include/uapi/asm/unistd.h b/arch/openrisc/include/uapi/asm/unistd.h
>> index 471905b..6812d81 100644
>> --- a/arch/openrisc/include/uapi/asm/unistd.h
>> +++ b/arch/openrisc/include/uapi/asm/unistd.h
>> @@ -21,6 +21,7 @@
>> #define sys_mmap2 sys_mmap_pgoff
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>> #define __ARCH_WANT_SYS_FORK
>> #define __ARCH_WANT_SYS_CLONE
>>
>> diff --git a/arch/score/include/uapi/asm/unistd.h b/arch/score/include/uapi/asm/unistd.h
>> index d4008c3..7ad1bdc 100644
>> --- a/arch/score/include/uapi/asm/unistd.h
>> +++ b/arch/score/include/uapi/asm/unistd.h
>> @@ -1,6 +1,7 @@
>> #define __ARCH_HAVE_MMU
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>> #define __ARCH_WANT_SYSCALL_NO_AT
>> #define __ARCH_WANT_SYSCALL_NO_FLAGS
>> #define __ARCH_WANT_SYSCALL_OFF_T
>> diff --git a/arch/tile/include/uapi/asm/unistd.h b/arch/tile/include/uapi/asm/unistd.h
>> index 24e9187..cf0505f 100644
>> --- a/arch/tile/include/uapi/asm/unistd.h
>> +++ b/arch/tile/include/uapi/asm/unistd.h
>> @@ -13,6 +13,7 @@
>> */
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>> #if !defined(__LP64__) || defined(__SYSCALL_COMPAT)
>> /* Use the flavor of this syscall that matches the 32-bit API better. */
>> #define __ARCH_WANT_SYNC_FILE_RANGE2
>> diff --git a/arch/unicore32/include/uapi/asm/unistd.h b/arch/unicore32/include/uapi/asm/unistd.h
>> index 1f63c47..ef25aec 100644
>> --- a/arch/unicore32/include/uapi/asm/unistd.h
>> +++ b/arch/unicore32/include/uapi/asm/unistd.h
>> @@ -11,6 +11,7 @@
>> */
>>
>> #define __ARCH_WANT_RENAMEAT
>> +#define __ARCH_WANT_SET_GET_RLIMIT
>>
>> /* Use the standard ABI for syscalls. */
>> #include <asm-generic/unistd.h>
>> diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
>> index 9b1462e..bbaeac0 100644
>> --- a/include/uapi/asm-generic/unistd.h
>> +++ b/include/uapi/asm-generic/unistd.h
>> @@ -465,10 +465,15 @@ __SYSCALL(__NR_uname, sys_newuname)
>> __SYSCALL(__NR_sethostname, sys_sethostname)
>> #define __NR_setdomainname 162
>> __SYSCALL(__NR_setdomainname, sys_setdomainname)
>> +
>> +#ifdef __ARCH_WANT_SET_GET_RLIMIT
>> +/* getrlimit and setrlimit are superseded with prlimit64 */
>> #define __NR_getrlimit 163
>> __SC_COMP(__NR_getrlimit, sys_getrlimit, compat_sys_getrlimit)
>> #define __NR_setrlimit 164
>> __SC_COMP(__NR_setrlimit, sys_setrlimit, compat_sys_setrlimit)
>> +#endif
>> +
>> #define __NR_getrusage 165
>> __SC_COMP(__NR_getrusage, sys_getrusage, compat_sys_getrusage)
>> #define __NR_umask 166
>> --
>> 2.7.4
>>
^ permalink raw reply
* [PATCH] of: Add vendor prefix for Aries Embedded GmbH
From: Marek Vasut @ 2016-10-25 0:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAL_JsqL4NUoonJ+Lw0tbhyKk0xM4ke65BNQ1VNndfUrqLZsgLw@mail.gmail.com>
On 10/25/2016 02:14 AM, Rob Herring wrote:
> On Mon, Oct 24, 2016 at 6:38 AM, Marek Vasut <marex@denx.de> wrote:
>> On 09/19/2016 11:38 PM, Marek Vasut wrote:
>>> Add vendor prefix for Aries Embedded GmbH
>>> http://www.aries-embedded.de/
>>>
>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>> Cc: Rob Herring <robh@kernel.org>
>>
>> Hi, bump ?
>
> Looks fine, but please resend to the DT list so that patchwork picks
> this up and it will be in my queue.
OK, done.
--
Best regards,
Marek Vasut
^ permalink raw reply
* [PATCH] drm/sun4i: Add a few formats
From: Chen-Yu Tsai @ 2016-10-25 0:42 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161024144014.occkqw2v5c2ghx4w@lukather>
On Mon, Oct 24, 2016 at 10:40 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi,
>
> On Fri, Oct 21, 2016 at 11:15:32AM +0800, Chen-Yu Tsai wrote:
>> On Tue, Oct 18, 2016 at 4:46 PM, Maxime Ripard
>> <maxime.ripard@free-electrons.com> wrote:
>> > The planes can do more than what was previously exposed. Add support for
>> > them.
>> >
>> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>> > ---
>> > drivers/gpu/drm/sun4i/sun4i_backend.c | 20 ++++++++++++++++++++
>> > drivers/gpu/drm/sun4i/sun4i_layer.c | 6 ++++++
>> > 2 files changed, 26 insertions(+)
>> >
>> > diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c
>> > index afb7ddf660ef..b184a476a480 100644
>> > --- a/drivers/gpu/drm/sun4i/sun4i_backend.c
>> > +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c
>> > @@ -96,6 +96,22 @@ static int sun4i_backend_drm_format_to_layer(struct drm_plane *plane,
>> > *mode = SUN4I_BACKEND_LAY_FBFMT_ARGB8888;
>> > break;
>> >
>> > + case DRM_FORMAT_ARGB4444:
>> > + *mode = SUN4I_BACKEND_LAY_FBFMT_ARGB4444;
>> > + break;
>> > +
>> > + case DRM_FORMAT_ARGB1555:
>> > + *mode = SUN4I_BACKEND_LAY_FBFMT_ARGB1555;
>> > + break;
>> > +
>> > + case DRM_FORMAT_RGBA5551:
>> > + *mode = SUN4I_BACKEND_LAY_FBFMT_RGBA5551;
>> > + break;
>> > +
>> > + case DRM_FORMAT_RGBA4444:
>> > + *mode = SUN4I_BACKEND_LAY_FBFMT_RGBA4444;
>>
>> The A20 manual only lists ARGB4444, not RGBA4444. There might be
>> some discrepancy here. We can deal with them
>
> Hmm, yes, that's weird. But I guess this would be part of porting it
> to the A20.
>
>> Also there are some more formats missing from the list, could you
>> add them as well?
>
> Which one do you refer to?
RGB556 and RGB655.
>
>> > + break;
>> > +
>> > case DRM_FORMAT_XRGB8888:
>> > *mode = SUN4I_BACKEND_LAY_FBFMT_XRGB8888;
>> > break;
>> > @@ -104,6 +120,10 @@ static int sun4i_backend_drm_format_to_layer(struct drm_plane *plane,
>> > *mode = SUN4I_BACKEND_LAY_FBFMT_RGB888;
>> > break;
>> >
>> > + case DRM_FORMAT_RGB565:
>> > + *mode = SUN4I_BACKEND_LAY_FBFMT_RGB565;
>> > + break;
>> > +
>> > default:
>> > return -EINVAL;
>> > }
>> > diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
>> > index f0035bf5efea..5d53c977bca5 100644
>> > --- a/drivers/gpu/drm/sun4i/sun4i_layer.c
>> > +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
>> > @@ -73,12 +73,18 @@ static const struct drm_plane_funcs sun4i_backend_layer_funcs = {
>> > static const uint32_t sun4i_backend_layer_formats_primary[] = {
>> > DRM_FORMAT_ARGB8888,
>> > DRM_FORMAT_RGB888,
>> > + DRM_FORMAT_RGB565,
>> > DRM_FORMAT_XRGB8888,
>> > };
>> >
>> > static const uint32_t sun4i_backend_layer_formats_overlay[] = {
>> > DRM_FORMAT_ARGB8888,
>> > + DRM_FORMAT_ARGB4444,
>> > + DRM_FORMAT_ARGB1555,
>> > + DRM_FORMAT_RGBA5551,
>> > + DRM_FORMAT_RGBA4444,
>> > DRM_FORMAT_RGB888,
>> > + DRM_FORMAT_RGB565,
>> > DRM_FORMAT_XRGB8888,
>>
>> Could you explain in the commit log why these 2 aren't the same?
>
> Yep, I will.
Cool! Thanks.
ChenYu
>
> Thanks!
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
^ permalink raw reply
* [PATCH/RFT v2 11/17] USB: OHCI: make ohci-da8xx a separate driver
From: David Lechner @ 2016-10-25 0:38 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161024164634.4330-12-ahaslam@baylibre.com>
On 10/24/2016 11:46 AM, ahaslam at baylibre.com wrote:
> From: Manjunath Goudar <manjunath.goudar@linaro.org>
>
> Separate the Davinci OHCI host controller driver from ohci-hcd
> host code so that it can be built as a separate driver module.
> This work is part of enabling multi-platform kernels on ARM;
> it would be nice to have in 3.11.
No need for comment about kernel 3.11.
>
> Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
> ---
> drivers/usb/host/Kconfig | 2 +-
> drivers/usb/host/Makefile | 1 +
> drivers/usb/host/ohci-da8xx.c | 185 +++++++++++++++++-------------------------
> drivers/usb/host/ohci-hcd.c | 18 ----
> 4 files changed, 76 insertions(+), 130 deletions(-)
>
> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> index 83b6cec..642c6fe8 100644
> --- a/drivers/usb/host/Kconfig
> +++ b/drivers/usb/host/Kconfig
> @@ -479,7 +479,7 @@ config USB_OHCI_HCD_OMAP3
> OMAP3 and later chips.
>
> config USB_OHCI_HCD_DAVINCI
> - bool "OHCI support for TI DaVinci DA8xx"
> + tristate "OHCI support for TI DaVinci DA8xx"
> depends on ARCH_DAVINCI_DA8XX
> depends on USB_OHCI_HCD=y
Need to drop the "=y" here, otherwise you still can't compile this as a
module.
> select PHY_DA8XX_USB
> diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
> index 6ef785b..2644537 100644
> --- a/drivers/usb/host/Makefile
> +++ b/drivers/usb/host/Makefile
> @@ -61,6 +61,7 @@ obj-$(CONFIG_USB_OHCI_HCD_AT91) += ohci-at91.o
> obj-$(CONFIG_USB_OHCI_HCD_S3C2410) += ohci-s3c2410.o
> obj-$(CONFIG_USB_OHCI_HCD_LPC32XX) += ohci-nxp.o
> obj-$(CONFIG_USB_OHCI_HCD_PXA27X) += ohci-pxa27x.o
> +obj-$(CONFIG_USB_OHCI_HCD_DAVINCI) += ohci-da8xx.o
>
> obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
> obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
> diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c
> index e98066d..5585d9e 100644
> --- a/drivers/usb/host/ohci-da8xx.c
> +++ b/drivers/usb/host/ohci-da8xx.c
> @@ -11,16 +11,31 @@
> * kind, whether express or implied.
> */
>
> +#include <linux/clk.h>
> +#include <linux/io.h>
> #include <linux/interrupt.h>
> #include <linux/jiffies.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> #include <linux/platform_device.h>
> -#include <linux/clk.h>
> #include <linux/phy/phy.h>
> #include <linux/platform_data/usb-davinci.h>
> +#include <linux/platform_device.h>
linux/platform_device.h is listed twice
> +#include <linux/usb.h>
> +#include <linux/usb/hcd.h>
> +#include <asm/unaligned.h>
>
> -#ifndef CONFIG_ARCH_DAVINCI_DA8XX
> -#error "This file is DA8xx bus glue. Define CONFIG_ARCH_DAVINCI_DA8XX."
> -#endif
> +#include "ohci.h"
> +
> +#define DRIVER_DESC "OHCI DA8XX driver"
> +
> +static const char hcd_name[] = "ohci-da8xx";
why static const char instead of #define? This is only used one time in
a pr_info, so it seems kind of pointless anyway.
> +
> +static struct hc_driver __read_mostly ohci_da8xx_hc_driver;
> +
> +static int (*orig_ohci_hub_control)(struct usb_hcd *hcd, u16 typeReq,
> + u16 wValue, u16 wIndex, char *buf, u16 wLength);
> +static int (*orig_ohci_hub_status_data)(struct usb_hcd *hcd, char *buf);
>
> static struct clk *usb11_clk;
> static struct phy *usb11_phy;
> @@ -73,7 +88,7 @@ static void ohci_da8xx_ocic_handler(struct da8xx_ohci_root_hub *hub)
> hub->set_power(0);
> }
>
> -static int ohci_da8xx_init(struct usb_hcd *hcd)
> +static int ohci_da8xx_reset(struct usb_hcd *hcd)
> {
> struct device *dev = hcd->self.controller;
> struct da8xx_ohci_root_hub *hub = dev_get_platdata(dev);
> @@ -93,7 +108,7 @@ static int ohci_da8xx_init(struct usb_hcd *hcd)
> */
> ohci->num_ports = 1;
>
> - result = ohci_init(ohci);
> + result = ohci_setup(hcd);
> if (result < 0) {
> ohci_da8xx_disable();
> return result;
> @@ -121,30 +136,12 @@ static int ohci_da8xx_init(struct usb_hcd *hcd)
> return result;
> }
>
> -static void ohci_da8xx_stop(struct usb_hcd *hcd)
> -{
> - ohci_stop(hcd);
> - ohci_da8xx_disable();
> -}
> -
> -static int ohci_da8xx_start(struct usb_hcd *hcd)
> -{
> - struct ohci_hcd *ohci = hcd_to_ohci(hcd);
> - int result;
> -
> - result = ohci_run(ohci);
> - if (result < 0)
> - ohci_da8xx_stop(hcd);
> -
> - return result;
> -}
> -
> /*
> * Update the status data from the hub with the over-current indicator change.
> */
> static int ohci_da8xx_hub_status_data(struct usb_hcd *hcd, char *buf)
> {
> - int length = ohci_hub_status_data(hcd, buf);
> + int length = orig_ohci_hub_status_data(hcd, buf);
>
> /* See if we have OCIC flag set */
> if (ocic_flag) {
> @@ -226,66 +223,13 @@ static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
> }
> }
>
> - return ohci_hub_control(hcd, typeReq, wValue, wIndex, buf, wLength);
> + return orig_ohci_hub_control(hcd, typeReq, wValue,
> + wIndex, buf, wLength);
> }
>
> -static const struct hc_driver ohci_da8xx_hc_driver = {
> - .description = hcd_name,
> - .product_desc = "DA8xx OHCI",
> - .hcd_priv_size = sizeof(struct ohci_hcd),
> -
> - /*
> - * generic hardware linkage
> - */
> - .irq = ohci_irq,
> - .flags = HCD_USB11 | HCD_MEMORY,
> -
> - /*
> - * basic lifecycle operations
> - */
> - .reset = ohci_da8xx_init,
> - .start = ohci_da8xx_start,
> - .stop = ohci_da8xx_stop,
> - .shutdown = ohci_shutdown,
> -
> - /*
> - * managing i/o requests and associated device resources
> - */
> - .urb_enqueue = ohci_urb_enqueue,
> - .urb_dequeue = ohci_urb_dequeue,
> - .endpoint_disable = ohci_endpoint_disable,
> -
> - /*
> - * scheduling support
> - */
> - .get_frame_number = ohci_get_frame,
> -
> - /*
> - * root hub support
> - */
> - .hub_status_data = ohci_da8xx_hub_status_data,
> - .hub_control = ohci_da8xx_hub_control,
> -
> -#ifdef CONFIG_PM
> - .bus_suspend = ohci_bus_suspend,
> - .bus_resume = ohci_bus_resume,
> -#endif
> - .start_port_reset = ohci_start_port_reset,
> -};
> -
> /*-------------------------------------------------------------------------*/
>
> -
> -/**
> - * usb_hcd_da8xx_probe - initialize DA8xx-based HCDs
> - * Context: !in_interrupt()
> - *
> - * Allocates basic resources for this USB host controller, and
> - * then invokes the start() method for the HCD associated with it
> - * through the hotplug entry's driver_data.
> - */
> -static int usb_hcd_da8xx_probe(const struct hc_driver *driver,
> - struct platform_device *pdev)
> +static int ohci_da8xx_probe(struct platform_device *pdev)
> {
> struct da8xx_ohci_root_hub *hub = dev_get_platdata(&pdev->dev);
> struct usb_hcd *hcd;
> @@ -295,6 +239,11 @@ static int usb_hcd_da8xx_probe(const struct hc_driver *driver,
> if (hub == NULL)
> return -ENODEV;
>
> + hcd = usb_create_hcd(&ohci_da8xx_hc_driver, &pdev->dev,
> + dev_name(&pdev->dev));
> + if (!hcd)
> + return -ENOMEM;
> +
Won't this leak hdc if there is an error later?
> usb11_clk = devm_clk_get(&pdev->dev, "usb11");
> if (IS_ERR(usb11_clk)) {
> if (PTR_ERR(usb11_clk) != -EPROBE_DEFER)
> @@ -309,9 +258,6 @@ static int usb_hcd_da8xx_probe(const struct hc_driver *driver,
> return PTR_ERR(usb11_phy);
> }
>
> - hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev));
> - if (!hcd)
> - return -ENOMEM;
Why does this need to be moved?
>
> mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> hcd->regs = devm_ioremap_resource(&pdev->dev, mem);
> @@ -323,13 +269,12 @@ static int usb_hcd_da8xx_probe(const struct hc_driver *driver,
> hcd->rsrc_start = mem->start;
> hcd->rsrc_len = resource_size(mem);
>
> - ohci_hcd_init(hcd_to_ohci(hcd));
> -
> irq = platform_get_irq(pdev, 0);
> if (irq < 0) {
> error = -ENODEV;
> goto err;
> }
> +
> error = usb_add_hcd(hcd, irq, 0);
> if (error)
> goto err;
> @@ -348,35 +293,14 @@ static int usb_hcd_da8xx_probe(const struct hc_driver *driver,
> return error;
> }
>
> -/**
> - * usb_hcd_da8xx_remove - shutdown processing for DA8xx-based HCDs
> - * @dev: USB Host Controller being removed
> - * Context: !in_interrupt()
> - *
> - * Reverses the effect of usb_hcd_da8xx_probe(), first invoking
> - * the HCD's stop() method. It is always called from a thread
> - * context, normally "rmmod", "apmd", or something similar.
> - */
> -static inline void
> -usb_hcd_da8xx_remove(struct usb_hcd *hcd, struct platform_device *pdev)
> +static int ohci_da8xx_remove(struct platform_device *pdev)
> {
> + struct usb_hcd *hcd = platform_get_drvdata(pdev);
> struct da8xx_ohci_root_hub *hub = dev_get_platdata(&pdev->dev);
>
> hub->ocic_notify(NULL);
> usb_remove_hcd(hcd);
> usb_put_hcd(hcd);
> -}
> -
> -static int ohci_hcd_da8xx_drv_probe(struct platform_device *dev)
> -{
> - return usb_hcd_da8xx_probe(&ohci_da8xx_hc_driver, dev);
> -}
> -
> -static int ohci_hcd_da8xx_drv_remove(struct platform_device *dev)
> -{
> - struct usb_hcd *hcd = platform_get_drvdata(dev);
> -
> - usb_hcd_da8xx_remove(hcd, dev);
>
> return 0;
> }
> @@ -426,12 +350,16 @@ static int ohci_da8xx_resume(struct platform_device *dev)
> }
> #endif
>
> +static const struct ohci_driver_overrides da8xx_overrides __initconst = {
> + .reset = ohci_da8xx_reset
> +};
> +
> /*
> * Driver definition to register with platform structure.
> */
> static struct platform_driver ohci_hcd_da8xx_driver = {
> - .probe = ohci_hcd_da8xx_drv_probe,
> - .remove = ohci_hcd_da8xx_drv_remove,
> + .probe = ohci_da8xx_probe,
> + .remove = ohci_da8xx_remove,
> .shutdown = usb_hcd_platform_shutdown,
> #ifdef CONFIG_PM
> .suspend = ohci_da8xx_suspend,
It would probably be a good idea to change the driver name here.
Currently it is "ohci". Although this would be better in a separate
patch if the name has to be changed to match in other files as well.
> @@ -442,4 +370,39 @@ static int ohci_da8xx_resume(struct platform_device *dev)
> },
> };
>
> +static int __init ohci_da8xx_init(void)
> +{
> +
> + if (usb_disabled())
> + return -ENODEV;
> +
> + pr_info("%s: " DRIVER_DESC "\n", hcd_name);
> + ohci_init_driver(&ohci_da8xx_hc_driver, &da8xx_overrides);
> +
> + /*
> + * The Davinci da8xx HW has some unusual quirks, which require
> + * da8xx-specific workarounds. We override certain hc_driver
> + * functions here to achieve that. We explicitly do not enhance
> + * ohci_driver_overrides to allow this more easily, since this
> + * is an unusual case, and we don't want to encourage others to
> + * override these functions by making it too easy.
> + */
> +
> + orig_ohci_hub_control = ohci_da8xx_hc_driver.hub_control;
> + orig_ohci_hub_status_data = ohci_da8xx_hc_driver.hub_status_data;
> +
> + ohci_da8xx_hc_driver.hub_status_data = ohci_da8xx_hub_status_data;
> + ohci_da8xx_hc_driver.hub_control = ohci_da8xx_hub_control;
> +
> + return platform_driver_register(&ohci_hcd_da8xx_driver);
> +}
> +module_init(ohci_da8xx_init);
> +
> +static void __exit ohci_da8xx_cleanup(void)
ohci_da8xx_exit would be a better name
> +{
> + platform_driver_unregister(&ohci_hcd_da8xx_driver);
> +}
> +module_exit(ohci_da8xx_cleanup);
> +MODULE_DESCRIPTION(DRIVER_DESC);
> +MODULE_LICENSE("GPL");
> MODULE_ALIAS("platform:ohci");
this will need to be changed too if you change the driver name
> diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
> index 1700908..8de174a 100644
> --- a/drivers/usb/host/ohci-hcd.c
> +++ b/drivers/usb/host/ohci-hcd.c
> @@ -1219,11 +1219,6 @@ void ohci_init_driver(struct hc_driver *drv,
> #define SA1111_DRIVER ohci_hcd_sa1111_driver
> #endif
>
> -#ifdef CONFIG_USB_OHCI_HCD_DAVINCI
> -#include "ohci-da8xx.c"
> -#define DAVINCI_PLATFORM_DRIVER ohci_hcd_da8xx_driver
> -#endif
> -
> #ifdef CONFIG_USB_OHCI_HCD_PPC_OF
> #include "ohci-ppc-of.c"
> #define OF_PLATFORM_DRIVER ohci_hcd_ppc_of_driver
> @@ -1303,19 +1298,9 @@ static int __init ohci_hcd_mod_init(void)
> goto error_tmio;
> #endif
>
> -#ifdef DAVINCI_PLATFORM_DRIVER
> - retval = platform_driver_register(&DAVINCI_PLATFORM_DRIVER);
> - if (retval < 0)
> - goto error_davinci;
> -#endif
> -
> return retval;
>
> /* Error path */
> -#ifdef DAVINCI_PLATFORM_DRIVER
> - platform_driver_unregister(&DAVINCI_PLATFORM_DRIVER);
> - error_davinci:
> -#endif
> #ifdef TMIO_OHCI_DRIVER
> platform_driver_unregister(&TMIO_OHCI_DRIVER);
> error_tmio:
> @@ -1351,9 +1336,6 @@ static int __init ohci_hcd_mod_init(void)
>
> static void __exit ohci_hcd_mod_exit(void)
> {
> -#ifdef DAVINCI_PLATFORM_DRIVER
> - platform_driver_unregister(&DAVINCI_PLATFORM_DRIVER);
> -#endif
> #ifdef TMIO_OHCI_DRIVER
> platform_driver_unregister(&TMIO_OHCI_DRIVER);
> #endif
>
^ permalink raw reply
* [PATCH] of: Add vendor prefix for Aries Embedded GmbH
From: Rob Herring @ 2016-10-25 0:14 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <ae228088-b8bc-7445-f621-52d20850d49e@denx.de>
On Mon, Oct 24, 2016 at 6:38 AM, Marek Vasut <marex@denx.de> wrote:
> On 09/19/2016 11:38 PM, Marek Vasut wrote:
>> Add vendor prefix for Aries Embedded GmbH
>> http://www.aries-embedded.de/
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Cc: Rob Herring <robh@kernel.org>
>
> Hi, bump ?
Looks fine, but please resend to the DT list so that patchwork picks
this up and it will be in my queue.
Rob
^ permalink raw reply
* [PATCH v4 0/9] PM / Domains: DT support for domain idle states & atomic PM domains
From: Lina Iyer @ 2016-10-24 23:05 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <2068597.AeryDFjO6y@vostro.rjw.lan>
On Tue, Oct 25 2016 at 16:23 -0600, Rafael J. Wysocki wrote:
>On Monday, October 24, 2016 03:20:59 PM Lina Iyer wrote:
>> Hi all,
>>
>> Changes since v3 [5] -
>> - Added "domain-idle-state" compatible to arm/idle-states.txt
>> - Updated documentation for defining PM domain idle states
>> - Updated documentation for devices and PM domains.
>> - Updated code to look for "domain-idle-state" instead of "arm,idle-state" compatible.
>> - The series is available at [6].
>
>Is this the series I've already queued up?
>
Yes. It is the update to the series that you already queued up.
>If so, can you please send a delta patch only with a proper changelog?
>
Sure. Will do that.
Thanks,
Lina
^ permalink raw reply
* [PATCH] convert orion5x ls-chl to device tree
From: Ash Hughes @ 2016-10-24 23:04 UTC (permalink / raw)
To: linux-arm-kernel
Hi all,
This patch converts my orion5x ls-chl Linkstation device to device tree.
Signed-off-by: Ashley Hughes <ashley.hughes@blueyonder.co.uk>
---
arch/arm/boot/dts/Makefile | 1 +
arch/arm/boot/dts/orion5x-lschl.dts | 171 ++++++++++++++++++
arch/arm/mach-orion5x/Kconfig | 4 +-
arch/arm/mach-orion5x/Makefile | 1 -
arch/arm/mach-orion5x/ls-chl-setup.c | 331 -----------------------------------
5 files changed, 174 insertions(+), 334 deletions(-)
create mode 100644 arch/arm/boot/dts/orion5x-lschl.dts
delete mode 100644 arch/arm/mach-orion5x/ls-chl-setup.c
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index befcd26..4853049 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -597,6 +597,7 @@ dtb-$(CONFIG_ARCH_ORION5X) += \
orion5x-lacie-ethernet-disk-mini-v2.dtb \
orion5x-linkstation-lsgl.dtb \
orion5x-linkstation-lswtgl.dtb \
+ orion5x-lschl.dtb \
orion5x-lswsgl.dtb \
orion5x-maxtor-shared-storage-2.dtb \
orion5x-netgear-wnr854t.dtb \
diff --git a/arch/arm/boot/dts/orion5x-lschl.dts b/arch/arm/boot/dts/orion5x-lschl.dts
new file mode 100644
index 0000000..9474092
--- /dev/null
+++ b/arch/arm/boot/dts/orion5x-lschl.dts
@@ -0,0 +1,171 @@
+/*
+ * Device Tree file for Buffalo Linkstation LS-CHLv3
+ *
+ * Copyright (C) 2016 Ash Hughes <ashley.hughes@blueyonder.co.uk>
+ * Copyright (C) 2015, 2016
+ * Roger Shimizu <rogershimizu@gmail.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ * a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ * b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+
+#include "orion5x-linkstation.dtsi"
+#include "mvebu-linkstation-gpio-simple.dtsi"
+#include "mvebu-linkstation-fan.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+ model = "Buffalo Linkstation Live v3 (LS-CHL)";
+ compatible = "buffalo,lschl", "marvell,orion5x-88f5182", "marvell,orion5x";
+
+ memory { /* 128 MB */
+ device_type = "memory";
+ reg = <0x00000000 0x8000000>;
+ };
+
+ gpio_keys {
+ func {
+ label = "Function Button";
+ linux,code = <KEY_OPTION>;
+ gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
+ };
+
+ power-on-switch {
+ gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
+ };
+
+ power-auto-switch {
+ gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ gpio_leds {
+ pinctrl-0 = <&pmx_led_power &pmx_led_alarm &pmx_led_info &pmx_led_func>;
+ blue-power-led {
+ gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
+ };
+
+ red-alarm-led {
+ gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
+ };
+
+ amber-info-led {
+ gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
+ };
+
+ func {
+ label = "lschl:func:blue:top";
+ gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ gpio_fan {
+ gpios = <&gpio0 14 GPIO_ACTIVE_LOW
+ &gpio0 16 GPIO_ACTIVE_LOW>;
+
+ alarm-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+ };
+};
+
+&pinctrl {
+ pmx_led_power: pmx-leds {
+ marvell,pins = "mpp0";
+ marvell,function = "gpio";
+ };
+
+ pmx_power_hdd: pmx-power-hdd {
+ marvell,pins = "mpp1";
+ marvell,function = "gpio";
+ };
+
+ pmx_led_alarm: pmx-leds {
+ marvell,pins = "mpp2";
+ marvell,function = "gpio";
+ };
+
+ pmx_led_info: pmx-leds {
+ marvell,pins = "mpp3";
+ marvell,function = "gpio";
+ };
+
+ pmx_fan_lock: pmx-fan-lock {
+ marvell,pins = "mpp6";
+ marvell,function = "gpio";
+ };
+
+ pmx_power_switch: pmx-power-switch {
+ marvell,pins = "mpp8", "mpp10", "mpp15";
+ marvell,function = "gpio";
+ };
+
+ pmx_power_usb: pmx-power-usb {
+ marvell,pins = "mpp9";
+ marvell,function = "gpio";
+ };
+
+ pmx_fan_high: pmx-fan-high {
+ marvell,pins = "mpp14";
+ marvell,function = "gpio";
+ };
+
+ pmx_fan_low: pmx-fan-low {
+ marvell,pins = "mpp16";
+ marvell,function = "gpio";
+ };
+
+ pmx_led_func: pmx-leds {
+ marvell,pins = "mpp17";
+ marvell,function = "gpio";
+ };
+
+ pmx_sw_init: pmx-sw-init {
+ marvell,pins = "mpp7";
+ marvell,function = "gpio";
+ };
+};
+
+&hdd_power {
+ gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
+};
+
+&usb_power {
+ gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
+};
+
diff --git a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig
index 89bb0fc..793efa9 100644
--- a/arch/arm/mach-orion5x/Kconfig
+++ b/arch/arm/mach-orion5x/Kconfig
@@ -85,8 +85,8 @@ config MACH_LINKSTATION_PRO
v2 devices are supported.
config MACH_LINKSTATION_LSCHL
- bool "Buffalo Linkstation Live v3 (LS-CHL)"
- select I2C_BOARDINFO if I2C
+ bool "Buffalo Linkstation Live v3 (LS-CHL) (Flattened Device Tree)"
+ select ARCH_ORION5X_DT
help
Say 'Y' here if you want your kernel to support the
Buffalo Linkstation Live v3 (LS-CHL) platform.
diff --git a/arch/arm/mach-orion5x/Makefile b/arch/arm/mach-orion5x/Makefile
index 4b2502b..ae91872 100644
--- a/arch/arm/mach-orion5x/Makefile
+++ b/arch/arm/mach-orion5x/Makefile
@@ -18,7 +18,6 @@ obj-$(CONFIG_MACH_WNR854T) += wnr854t-setup.o
obj-$(CONFIG_MACH_RD88F5181L_GE) += rd88f5181l-ge-setup.o
obj-$(CONFIG_MACH_RD88F5181L_FXO) += rd88f5181l-fxo-setup.o
obj-$(CONFIG_MACH_RD88F6183AP_GE) += rd88f6183ap-ge-setup.o
-obj-$(CONFIG_MACH_LINKSTATION_LSCHL) += ls-chl-setup.o
obj-$(CONFIG_ARCH_ORION5X_DT) += board-dt.o
obj-$(CONFIG_MACH_D2NET_DT) += board-d2net.o
diff --git a/arch/arm/mach-orion5x/ls-chl-setup.c b/arch/arm/mach-orion5x/ls-chl-setup.c
deleted file mode 100644
index dfdaa8a..0000000
--- a/arch/arm/mach-orion5x/ls-chl-setup.c
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * arch/arm/mach-orion5x/ls-chl-setup.c
- *
- * Maintainer: Ash Hughes <ashley.hughes@blueyonder.co.uk>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/leds.h>
-#include <linux/gpio_keys.h>
-#include <linux/gpio-fan.h>
-#include <linux/input.h>
-#include <linux/i2c.h>
-#include <linux/ata_platform.h>
-#include <linux/gpio.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include "common.h"
-#include "mpp.h"
-#include "orion5x.h"
-
-/*****************************************************************************
- * Linkstation LS-CHL Info
- ****************************************************************************/
-
-/*
- * 256K NOR flash Device bus boot chip select
- */
-
-#define LSCHL_NOR_BOOT_BASE 0xf4000000
-#define LSCHL_NOR_BOOT_SIZE SZ_256K
-
-/*****************************************************************************
- * 256KB NOR Flash on BOOT Device
- ****************************************************************************/
-
-static struct physmap_flash_data lschl_nor_flash_data = {
- .width = 1,
-};
-
-static struct resource lschl_nor_flash_resource = {
- .flags = IORESOURCE_MEM,
- .start = LSCHL_NOR_BOOT_BASE,
- .end = LSCHL_NOR_BOOT_BASE + LSCHL_NOR_BOOT_SIZE - 1,
-};
-
-static struct platform_device lschl_nor_flash = {
- .name = "physmap-flash",
- .id = 0,
- .dev = {
- .platform_data = &lschl_nor_flash_data,
- },
- .num_resources = 1,
- .resource = &lschl_nor_flash_resource,
-};
-
-/*****************************************************************************
- * Ethernet
- ****************************************************************************/
-
-static struct mv643xx_eth_platform_data lschl_eth_data = {
- .phy_addr = MV643XX_ETH_PHY_ADDR(8),
-};
-
-/*****************************************************************************
- * RTC 5C372a on I2C bus
- ****************************************************************************/
-
-static struct i2c_board_info __initdata lschl_i2c_rtc = {
- I2C_BOARD_INFO("rs5c372a", 0x32),
-};
-
-/*****************************************************************************
- * LEDs attached to GPIO
- ****************************************************************************/
-
-#define LSCHL_GPIO_LED_ALARM 2
-#define LSCHL_GPIO_LED_INFO 3
-#define LSCHL_GPIO_LED_FUNC 17
-#define LSCHL_GPIO_LED_PWR 0
-
-static struct gpio_led lschl_led_pins[] = {
- {
- .name = "alarm:red",
- .gpio = LSCHL_GPIO_LED_ALARM,
- .active_low = 1,
- }, {
- .name = "info:amber",
- .gpio = LSCHL_GPIO_LED_INFO,
- .active_low = 1,
- }, {
- .name = "func:blue:top",
- .gpio = LSCHL_GPIO_LED_FUNC,
- .active_low = 1,
- }, {
- .name = "power:blue:bottom",
- .gpio = LSCHL_GPIO_LED_PWR,
- },
-};
-
-static struct gpio_led_platform_data lschl_led_data = {
- .leds = lschl_led_pins,
- .num_leds = ARRAY_SIZE(lschl_led_pins),
-};
-
-static struct platform_device lschl_leds = {
- .name = "leds-gpio",
- .id = -1,
- .dev = {
- .platform_data = &lschl_led_data,
- },
-};
-
-/*****************************************************************************
- * SATA
- ****************************************************************************/
-static struct mv_sata_platform_data lschl_sata_data = {
- .n_ports = 2,
-};
-
-/*****************************************************************************
- * LS-CHL specific power off method: reboot
- ****************************************************************************/
-/*
- * On the LS-CHL, the shutdown process is following:
- * - Userland monitors key events until the power switch goes to off position
- * - The board reboots
- * - U-boot starts and goes into an idle mode waiting for the user
- * to move the switch to ON position
- *
- */
-
-static void lschl_power_off(void)
-{
- orion5x_restart(REBOOT_HARD, NULL);
-}
-
-/*****************************************************************************
- * General Setup
- ****************************************************************************/
-#define LSCHL_GPIO_USB_POWER 9
-#define LSCHL_GPIO_AUTO_POWER 17
-#define LSCHL_GPIO_POWER 18
-
-/****************************************************************************
- * GPIO Attached Keys
- ****************************************************************************/
-#define LSCHL_GPIO_KEY_FUNC 15
-#define LSCHL_GPIO_KEY_POWER 8
-#define LSCHL_GPIO_KEY_AUTOPOWER 10
-#define LSCHL_SW_POWER 0x00
-#define LSCHL_SW_AUTOPOWER 0x01
-#define LSCHL_SW_FUNC 0x02
-
-static struct gpio_keys_button lschl_buttons[] = {
- {
- .type = EV_SW,
- .code = LSCHL_SW_POWER,
- .gpio = LSCHL_GPIO_KEY_POWER,
- .desc = "Power-on Switch",
- .active_low = 1,
- }, {
- .type = EV_SW,
- .code = LSCHL_SW_AUTOPOWER,
- .gpio = LSCHL_GPIO_KEY_AUTOPOWER,
- .desc = "Power-auto Switch",
- .active_low = 1,
- }, {
- .type = EV_SW,
- .code = LSCHL_SW_FUNC,
- .gpio = LSCHL_GPIO_KEY_FUNC,
- .desc = "Function Switch",
- .active_low = 1,
- },
-};
-
-static struct gpio_keys_platform_data lschl_button_data = {
- .buttons = lschl_buttons,
- .nbuttons = ARRAY_SIZE(lschl_buttons),
-};
-
-static struct platform_device lschl_button_device = {
- .name = "gpio-keys",
- .id = -1,
- .num_resources = 0,
- .dev = {
- .platform_data = &lschl_button_data,
- },
-};
-
-#define LSCHL_GPIO_HDD_POWER 1
-
-/****************************************************************************
- * GPIO Fan
- ****************************************************************************/
-
-#define LSCHL_GPIO_FAN_LOW 16
-#define LSCHL_GPIO_FAN_HIGH 14
-#define LSCHL_GPIO_FAN_LOCK 6
-
-static struct gpio_fan_alarm lschl_alarm = {
- .gpio = LSCHL_GPIO_FAN_LOCK,
-};
-
-static struct gpio_fan_speed lschl_speeds[] = {
- {
- .rpm = 0,
- .ctrl_val = 3,
- }, {
- .rpm = 1500,
- .ctrl_val = 2,
- }, {
- .rpm = 3250,
- .ctrl_val = 1,
- }, {
- .rpm = 5000,
- .ctrl_val = 0,
- },
-};
-
-static int lschl_gpio_list[] = {
- LSCHL_GPIO_FAN_HIGH, LSCHL_GPIO_FAN_LOW,
-};
-
-static struct gpio_fan_platform_data lschl_fan_data = {
- .num_ctrl = ARRAY_SIZE(lschl_gpio_list),
- .ctrl = lschl_gpio_list,
- .alarm = &lschl_alarm,
- .num_speed = ARRAY_SIZE(lschl_speeds),
- .speed = lschl_speeds,
-};
-
-static struct platform_device lschl_fan_device = {
- .name = "gpio-fan",
- .id = -1,
- .num_resources = 0,
- .dev = {
- .platform_data = &lschl_fan_data,
- },
-};
-
-/****************************************************************************
- * GPIO Data
- ****************************************************************************/
-
-static unsigned int lschl_mpp_modes[] __initdata = {
- MPP0_GPIO, /* LED POWER */
- MPP1_GPIO, /* HDD POWER */
- MPP2_GPIO, /* LED ALARM */
- MPP3_GPIO, /* LED INFO */
- MPP4_UNUSED,
- MPP5_UNUSED,
- MPP6_GPIO, /* FAN LOCK */
- MPP7_GPIO, /* SW INIT */
- MPP8_GPIO, /* SW POWER */
- MPP9_GPIO, /* USB POWER */
- MPP10_GPIO, /* SW AUTO POWER */
- MPP11_UNUSED,
- MPP12_UNUSED,
- MPP13_UNUSED,
- MPP14_GPIO, /* FAN HIGH */
- MPP15_GPIO, /* SW FUNC */
- MPP16_GPIO, /* FAN LOW */
- MPP17_GPIO, /* LED FUNC */
- MPP18_UNUSED,
- MPP19_UNUSED,
- 0,
-};
-
-static void __init lschl_init(void)
-{
- /*
- * Setup basic Orion functions. Needs to be called early.
- */
- orion5x_init();
-
- orion5x_mpp_conf(lschl_mpp_modes);
-
- /*
- * Configure peripherals.
- */
- orion5x_ehci0_init();
- orion5x_ehci1_init();
- orion5x_eth_init(&lschl_eth_data);
- orion5x_i2c_init();
- orion5x_sata_init(&lschl_sata_data);
- orion5x_uart0_init();
- orion5x_xor_init();
-
- mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
- ORION_MBUS_DEVBUS_BOOT_ATTR,
- LSCHL_NOR_BOOT_BASE,
- LSCHL_NOR_BOOT_SIZE);
- platform_device_register(&lschl_nor_flash);
-
- platform_device_register(&lschl_leds);
-
- platform_device_register(&lschl_button_device);
-
- platform_device_register(&lschl_fan_device);
-
- i2c_register_board_info(0, &lschl_i2c_rtc, 1);
-
- /* usb power on */
- gpio_set_value(LSCHL_GPIO_USB_POWER, 1);
-
- /* register power-off method */
- pm_power_off = lschl_power_off;
-
- pr_info("%s: finished\n", __func__);
-}
-
-MACHINE_START(LINKSTATION_LSCHL, "Buffalo Linkstation LiveV3 (LS-CHL)")
- /* Maintainer: Ash Hughes <ashley.hughes@blueyonder.co.uk> */
- .atag_offset = 0x100,
- .nr_irqs = ORION5X_NR_IRQS,
- .init_machine = lschl_init,
- .map_io = orion5x_map_io,
- .init_early = orion5x_init_early,
- .init_irq = orion5x_init_irq,
- .init_time = orion5x_timer_init,
- .fixup = tag_fixup_mem32,
- .restart = orion5x_restart,
-MACHINE_END
-- 2.7.4
^ permalink raw reply related
* [PATCH] ARM: davinci: Enable PHY_DA8XX_USB by default
From: David Lechner @ 2016-10-24 23:03 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1477349298-10315-1-git-send-email-david@lechnology.com>
On 10/24/2016 05:48 PM, David Lechner wrote:
> Enable the DA8xx USB PHY driver by default. This driver used by several
> davinci family devices.
>
> Signed-off-by: David Lechner <david@lechnology.com>
> ---
> arch/arm/configs/davinci_all_defconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig
> index a5fca37..c58ae1c 100644
> --- a/arch/arm/configs/davinci_all_defconfig
> +++ b/arch/arm/configs/davinci_all_defconfig
> @@ -187,6 +187,7 @@ CONFIG_DMADEVICES=y
> CONFIG_TI_EDMA=y
> CONFIG_MEMORY=y
> CONFIG_TI_AEMIF=m
> +CONFIG_PHY_DA8XX_USB=m
> CONFIG_EXT2_FS=y
> CONFIG_EXT3_FS=y
> CONFIG_XFS_FS=m
>
Please disregard. This driver is selected by the USB drivers that
consume it.
^ permalink raw reply
* [PATCH] ARM: davinci: Enable PHY_DA8XX_USB by default
From: David Lechner @ 2016-10-24 22:48 UTC (permalink / raw)
To: linux-arm-kernel
Enable the DA8xx USB PHY driver by default. This driver used by several
davinci family devices.
Signed-off-by: David Lechner <david@lechnology.com>
---
arch/arm/configs/davinci_all_defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig
index a5fca37..c58ae1c 100644
--- a/arch/arm/configs/davinci_all_defconfig
+++ b/arch/arm/configs/davinci_all_defconfig
@@ -187,6 +187,7 @@ CONFIG_DMADEVICES=y
CONFIG_TI_EDMA=y
CONFIG_MEMORY=y
CONFIG_TI_AEMIF=m
+CONFIG_PHY_DA8XX_USB=m
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_XFS_FS=m
--
2.7.4
^ permalink raw reply related
* [PATCH v1 0/3] Add support for Broadcom OTP controller
From: Markus Mayer @ 2016-10-24 22:45 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CA+55aFxeu9YKb=zAba8MVRgxmJoQJ8W6u3NNJv7rP6mwxj+nVA@mail.gmail.com>
FWIW, this thread ends up in the spam folder for me also on my private
e-mail account. And it's not the only Broadcom thread. Quite a few
Broadcom e-mails end up there. The thread was sent to me via
infradead.org. My private e-mail is also hosted by Gmail.
I get this:
SPF: PASS with IP 2001:1868:205:0:0:0:0:9 Learn more
DKIM: NEUTRAL with domain null Learn more
DMARC: FAIL Learn more
So, it's not DKIM for me, but DMARC that's failing.
The actual headers:
Received: from bombadil.infradead.org (bombadil.infradead.org.
[2001:1868:205::9])
by mx.google.com with ESMTPS id
r127si16944054pgr.251.2016.10.24.12.13.37
for <mmayer@mmayer.net>
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Mon, 24 Oct 2016 12:13:37 -0700 (PDT)
Received-SPF: pass (google.com: best guess record for domain of
linux-arm-kernel-bounces+mmayer=mmayer.net at lists.infradead.org
designates 2001:1868:205::9 as permitted sender)
client-ip=2001:1868:205::9;
Authentication-Results: mx.google.com;
dkim=neutral (body hash did not verify) header.i=@broadcom.com;
spf=pass (google.com: best guess record for domain of
linux-arm-kernel-bounces+mmayer=mmayer.net at lists.infradead.org
designates 2001:1868:205::9 as permitted sender)
smtp.mailfrom=linux-arm-kernel-bounces+mmayer=mmayer.net at lists.infradead.org;
dmarc=fail (p=QUARANTINE dis=NONE) header.from=broadcom.com
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by
bombadil.infradead.org
Regards,
-Markus
^ permalink raw reply
* [PATCH v4 0/9] PM / Domains: DT support for domain idle states & atomic PM domains
From: Rafael J. Wysocki @ 2016-10-24 22:30 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1477347668-41901-1-git-send-email-lina.iyer@linaro.org>
On Monday, October 24, 2016 03:20:59 PM Lina Iyer wrote:
> Hi all,
>
> Changes since v3 [5] -
> - Added "domain-idle-state" compatible to arm/idle-states.txt
> - Updated documentation for defining PM domain idle states
> - Updated documentation for devices and PM domains.
> - Updated code to look for "domain-idle-state" instead of "arm,idle-state" compatible.
> - The series is available at [6].
Is this the series I've already queued up?
If so, can you please send a delta patch only with a proper changelog?
Thanks,
Rafael
^ permalink raw reply
* [PATCH 2/2 v5] ARM: dts: add SMSC ethernet on the APQ8060 Dragonboard
From: Andy Gross @ 2016-10-24 22:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1477347740-10432-1-git-send-email-linus.walleij@linaro.org>
On Tue, Oct 25, 2016 at 12:22:20AM +0200, Linus Walleij wrote:
> The SMSC9112 ethernet controller is connected to chip select 2
> on the EBI2 bus on the APQ8060 Dragonboard. We set this up by
> activating EBI2, creating a chipselect entry as a subnode, and then
> putting the ethernet controller in a subnode of the chipselect.
>
> After the chipselect is configured, the SMSC device will be
> instantiated.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Thanks. Picked this one up.
Andy
^ permalink raw reply
* [PATCH 1/2 v5] ARM: dts: add EBI2 to the Qualcomm MSM8660 DTSI
From: Andy Gross @ 2016-10-24 22:25 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1477347732-10385-1-git-send-email-linus.walleij@linaro.org>
On Tue, Oct 25, 2016 at 12:22:12AM +0200, Linus Walleij wrote:
> This adds the external bus interface EBI2 to the MSM8660 device
> tree, albeit with status = "disabled" so that devices actually
> using EBI2 can turn it on if needed.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
Thanks. Queued it.
Andy
^ permalink raw reply
* [PATCH 01/18] 32-bit ABI: introduce ARCH_32BIT_OFF_T config option
From: Arnd Bergmann @ 2016-10-24 22:22 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <7d5ef8e8-38f1-92fe-b584-242cc2924558@mellanox.com>
On Monday, October 24, 2016 12:30:47 PM CEST Chris Metcalf wrote:
> On 10/21/2016 4:33 PM, Yury Norov wrote:
> > All new 32-bit architectures should have 64-bit off_t type, but existing
> > architectures has 32-bit ones.
> >
> > [...]
> > For syscalls sys_openat() and sys_open_by_handle_at() force_o_largefile()
> > is called, to set O_LARGEFILE flag, and this is the only difference
> > comparing to compat versions. All compat ABIs are already turned to use
> > 64-bit off_t, except tile. So, compat versions for this syscalls are not
> > needed anymore. Tile is handled explicitly.
> >
> > [...]
> > --- a/arch/tile/kernel/compat.c
> > +++ b/arch/tile/kernel/compat.c
> > @@ -103,6 +103,9 @@ COMPAT_SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned int, offset_high,
> > #define compat_sys_readahead sys32_readahead
> > #define sys_llseek compat_sys_llseek
> >
> > +#define sys_openat compat_sys_openat
> > +#define sys_open_by_handle_at compat_sys_open_by_handle_at
> > +
> > /* Call the assembly trampolines where necessary. */
> > #define compat_sys_rt_sigreturn _compat_sys_rt_sigreturn
> > #define sys_clone _sys_clone
>
> This patch accomplishes two goals that could be completely separated.
> It's confusing to have them mixed in the same patch without any
> discussion of why they are in the same patch.
>
> First, you want to modify the default <asm/unistd.h> behavior for
> compat syscalls so that the default is sys_openat (etc) rather than
> the existing compat_sys_openat, and then use that new behavior for
> arm64 ILP32. This lets you force O_LARGEFILE for arm64 ILP32 to
> support having a 64-bit off_t at all times. To do that, you fix the
> asm-generic header, and then make tile have a special override.
> This seems reasonable enough.
>
> Second, you introduce ARCH_32BIT_OFF_T basically as a synonym for
> "BITS_PER_WORD == 32", so that new 32-bit architectures can choose not
> to enable it. This is fine in the abstract, but I'm a bit troubled by
> the fact that you are not actually introducing a new 32-bit
> architecture here (just a new 32-bit mode for the arm 64-bit kernel).
> Shouldn't this part of the change wait until someone actually has a
> new 32-bit kernel to drive this forward?
I asked for this specifically because we identified the problem
during the review of the aarch64 ilp32 code, and it might not
be noticed in the next architecture submission.
The most important aspect from my perspective is that the new
ilp32 ABI on aarch64 behaves the same way that any native 32-bit
architecture does, and when we change the default, it should
be done for both compat mode and native mode at the same time.
> If you want to push forward the ARCH_32BIT_OFF_T change in the absence
> of an architecture that supports it, I would think it would be a lot
> less confusing to have these two in separate patches, and make it
> clear that the ARCH_32BIT_OFF_T change is just laying groundwork
> for some hypothetical future architecture.
>
> The existing commit language itself is also confusing. You write "All
> compat ABIs are already turned to use 64-bit off_t, except tile."
> First, I'm not sure what you mean by "turned" here. And, tile is just
> one of many compat ABIs that allow O_LARGEFILE not to be part of the
> open call: see arm64's AArch32 ABI, MIPS o32, s390 31-bit emulation,
> sparc64's 32-bit mode, and of course x86's 32-bit compat mode.
> Presumably your point here is that tile is the only pre-existing
> architecture that #includes <asm/unistd.h> to create its compat
> syscall table, and so I think "all except tile" here is particularly
> confusing, since there are no architectures except tile that use the
> __SYSCALL_COMPAT functionality in the current tree.
Agreed, this could be made clearer, and splitting the patch up
in two also seems reasonable, though I didn't see it as important.
Arnd
^ permalink raw reply
* [PATCH 2/2 v5] ARM: dts: add SMSC ethernet on the APQ8060 Dragonboard
From: Linus Walleij @ 2016-10-24 22:22 UTC (permalink / raw)
To: linux-arm-kernel
The SMSC9112 ethernet controller is connected to chip select 2
on the EBI2 bus on the APQ8060 Dragonboard. We set this up by
activating EBI2, creating a chipselect entry as a subnode, and then
putting the ethernet controller in a subnode of the chipselect.
After the chipselect is configured, the SMSC device will be
instantiated.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v4->v5:
- Rename "ebi2@" to "external-bus@"
- Drop double comment.
- Drop double "only" in comment.
- Can we apply this now?
ChangeLog v3->v4:
- Rebase on kernel v4.9-rc1
- Bindings and driver are merged so should be clear to apply.
ChangeLog v2->v3:
- Name chipselected device to ethernet-ebi2 at 2,0
- Update to the latest (v5) version of the bindings and what
the EBI2 driver expects.
- The SMSC911x bindings were ACKed by Arnd Bergmann and are merged
to the netdev tree by David Miller.
- The EBI2 bindings were ACKed by Rob Herring and a pull request
for both bindings and driver is pending for ARM SoC.
- This should be safe to merge for v4.9.
ChangeLog v1->v2:
- Use the new bindings with the first address cell indicating
the chipselect
- Use offset zero into the range in the EBI2 node (the range
defines the base address of the chipselect)
- Move all the XMEM setup to arrays in the EBI2 node
---
arch/arm/boot/dts/qcom-apq8060-dragonboard.dts | 119 +++++++++++++++++++++++++
1 file changed, 119 insertions(+)
diff --git a/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts b/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts
index 6c0038398ef2..4b8872cc8bf9 100644
--- a/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts
+++ b/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts
@@ -51,6 +51,29 @@
regulator-boot-on;
};
+ /* GPIO controlled ethernet power regulator */
+ dragon_veth: xc622a331mrg {
+ compatible = "regulator-fixed";
+ regulator-name = "XC6222A331MR-G";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ vin-supply = <&vph>;
+ gpio = <&pm8058_gpio 40 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ pinctrl-names = "default";
+ pinctrl-0 = <&dragon_veth_gpios>;
+ regulator-always-on;
+ };
+
+ /* VDDvario fixed regulator */
+ dragon_vario: nds332p {
+ compatible = "regulator-fixed";
+ regulator-name = "NDS332P";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ vin-supply = <&pm8058_s3>;
+ };
+
/* This is a levelshifter for SDCC5 */
dragon_vio_txb: txb0104rgyr {
compatible = "regulator-fixed";
@@ -167,6 +190,36 @@
bias-pull-up;
};
};
+
+ dragon_ebi2_pins: ebi2 {
+ /*
+ * Pins used by EBI2 on the Dragonboard, actually only
+ * CS2 is used by a real peripheral. CS0 is just
+ * routed to a test point.
+ */
+ mux0 {
+ pins =
+ /* "gpio39", CS1A_N this is not good to mux */
+ "gpio40", /* CS2A_N */
+ "gpio134"; /* CS0_N testpoint TP29 */
+ function = "ebi2cs";
+ };
+ mux1 {
+ pins =
+ /* EBI2_ADDR_7 downto EBI2_ADDR_0 address bus */
+ "gpio123", "gpio124", "gpio125", "gpio126",
+ "gpio127", "gpio128", "gpio129", "gpio130",
+ /* EBI2_DATA_15 downto EBI2_DATA_0 data bus */
+ "gpio135", "gpio136", "gpio137", "gpio138",
+ "gpio139", "gpio140", "gpio141", "gpio142",
+ "gpio143", "gpio144", "gpio145", "gpio146",
+ "gpio147", "gpio148", "gpio149", "gpio150",
+ "gpio151", /* EBI2_OE_N */
+ "gpio153", /* EBI2_ADV */
+ "gpio157"; /* EBI2_WE_N */
+ function = "ebi2";
+ };
+ };
};
qcom,ssbi at 500000 {
@@ -201,6 +254,15 @@
};
gpio at 150 {
+ dragon_ethernet_gpios: ethernet-gpios {
+ pinconf {
+ pins = "gpio7";
+ function = "normal";
+ input-enable;
+ bias-disable;
+ power-source = <PM8058_GPIO_S3>;
+ };
+ };
dragon_bmp085_gpios: bmp085-gpios {
pinconf {
pins = "gpio16";
@@ -238,6 +300,14 @@
power-source = <PM8058_GPIO_S3>;
};
};
+ dragon_veth_gpios: veth-gpios {
+ pinconf {
+ pins = "gpio40";
+ function = "normal";
+ bias-disable;
+ drive-push-pull;
+ };
+ };
};
led at 48 {
@@ -322,6 +392,55 @@
};
};
+ external-bus at 1a100000 {
+ /* The EBI2 will instantiate first, then populate its children */
+ status = "ok";
+ pinctrl-names = "default";
+ pinctrl-0 = <&dragon_ebi2_pins>;
+
+ /*
+ * An on-board SMSC LAN9221 chip for "debug ethernet",
+ * which is actually just an ordinary ethernet on the
+ * EBI2. This has a 25MHz chrystal next to it, so no
+ * clocking is needed.
+ */
+ ethernet-ebi2 at 2,0 {
+ compatible = "smsc,lan9221", "smsc,lan9115";
+ reg = <2 0x0 0x100>;
+ /*
+ * GPIO7 has interrupt 198 on the PM8058
+ * The second interrupt is the PME interrupt
+ * for network wakeup, connected to the TLMM.
+ */
+ interrupts-extended = <&pmicintc 198 IRQ_TYPE_EDGE_FALLING>,
+ <&tlmm 29 IRQ_TYPE_EDGE_RISING>;
+ reset-gpios = <&tlmm 30 GPIO_ACTIVE_LOW>;
+ vdd33a-supply = <&dragon_veth>;
+ vddvario-supply = <&dragon_vario>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&dragon_ethernet_gpios>;
+ phy-mode = "mii";
+ reg-io-width = <2>;
+ smsc,force-external-phy;
+ /* IRQ on edge falling = active low */
+ smsc,irq-active-low;
+ smsc,irq-push-pull;
+
+ /*
+ * SLOW chipselect config
+ * Delay 9 cycles (140ns at 64MHz) between SMSC
+ * LAN9221 Ethernet controller reads and writes
+ * on CS2.
+ */
+ qcom,xmem-recovery-cycles = <0>;
+ qcom,xmem-write-hold-cycles = <3>;
+ qcom,xmem-write-delta-cycles = <31>;
+ qcom,xmem-read-delta-cycles = <28>;
+ qcom,xmem-write-wait-cycles = <9>;
+ qcom,xmem-read-wait-cycles = <9>;
+ };
+ };
+
rpm at 104000 {
/*
* Set up of the PMIC RPM regulators for this board
--
2.7.4
^ permalink raw reply related
* [PATCH 1/2 v5] ARM: dts: add EBI2 to the Qualcomm MSM8660 DTSI
From: Linus Walleij @ 2016-10-24 22:22 UTC (permalink / raw)
To: linux-arm-kernel
This adds the external bus interface EBI2 to the MSM8660 device
tree, albeit with status = "disabled" so that devices actually
using EBI2 can turn it on if needed.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v4->v5:
- Rename "ebi2@" to "external-bus@"
- Can we apply this now?
ChangeLog v3->v4:
- Rebase on kernel v4.9-rc1
- Bindings and driver are merged so should be clear to apply.
ChangeLog v2->v3:
- Use the new #address-cells = <2> for indicating the CS in the
first address cell
- Use the ranges property properly for defining the six different
CS address windows
- Define CS3 to properly map over 128MB
- The EBI2 bindings are now ACKed by Rob Herring and a pull request
to ARM SoC for both binding and driver is pending.
- This should be safe to merge for v4.9
---
arch/arm/boot/dts/qcom-msm8660.dtsi | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/arch/arm/boot/dts/qcom-msm8660.dtsi b/arch/arm/boot/dts/qcom-msm8660.dtsi
index 8c65e0d82559..4d828f810746 100644
--- a/arch/arm/boot/dts/qcom-msm8660.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8660.dtsi
@@ -141,6 +141,23 @@
};
};
+ external-bus at 1a100000 {
+ compatible = "qcom,msm8660-ebi2";
+ #address-cells = <2>;
+ #size-cells = <1>;
+ ranges = <0 0x0 0x1a800000 0x00800000>,
+ <1 0x0 0x1b000000 0x00800000>,
+ <2 0x0 0x1b800000 0x00800000>,
+ <3 0x0 0x1d000000 0x08000000>,
+ <4 0x0 0x1c800000 0x00800000>,
+ <5 0x0 0x1c000000 0x00800000>;
+ reg = <0x1a100000 0x1000>, <0x1a110000 0x1000>;
+ reg-names = "ebi2", "xmem";
+ clocks = <&gcc EBI2_2X_CLK>, <&gcc EBI2_CLK>;
+ clock-names = "ebi2x", "ebi2";
+ status = "disabled";
+ };
+
qcom,ssbi at 500000 {
compatible = "qcom,ssbi";
reg = <0x500000 0x1000>;
--
2.7.4
^ permalink raw reply related
* [PATCH v4 9/9] PM / doc: Update device documentation for devices in IRQ safe PM domains
From: Lina Iyer @ 2016-10-24 22:21 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1477347668-41901-1-git-send-email-lina.iyer@linaro.org>
Update documentation to reflect the changes made to support IRQ safe PM
domains.
Signed-off-by: Lina Iyer <lina.iyer@linaro.org>
Signed-off-by: Rafael J. Wysocki <rjw@rjwysocki.net>
---
Documentation/power/devices.txt | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt
index 8ba6625..73ddea3 100644
--- a/Documentation/power/devices.txt
+++ b/Documentation/power/devices.txt
@@ -607,7 +607,9 @@ individually. Instead, a set of devices sharing a power resource can be put
into a low-power state together at the same time by turning off the shared
power resource. Of course, they also need to be put into the full-power state
together, by turning the shared power resource on. A set of devices with this
-property is often referred to as a power domain.
+property is often referred to as a power domain. A power domain may also be
+nested inside another power domain. The nested domain is referred to as the
+sub-domain of the parent domain.
Support for power domains is provided through the pm_domain field of struct
device. This field is a pointer to an object of type struct dev_pm_domain,
@@ -629,6 +631,16 @@ support for power domains into subsystem-level callbacks, for example by
modifying the platform bus type. Other platforms need not implement it or take
it into account in any way.
+Devices may be defined as IRQ-safe which indicates to the PM core that their
+runtime PM callbacks may be invoked with disabled interrupts (see
+Documentation/power/runtime_pm.txt for more information). If an IRQ-safe
+device belongs to a PM domain, the runtime PM of the domain will be
+disallowed, unless the domain itself is defined as IRQ-safe. However, it
+makes sense to define a PM domain as IRQ-safe only if all the devices in it
+are IRQ-safe. Moreover, if an IRQ-safe domain has a parent domain, the runtime
+PM of the parent is only allowed if the parent itself is IRQ-safe too with the
+additional restriction that all child domains of an IRQ-safe parent must also
+be IRQ-safe.
Device Low Power (suspend) States
---------------------------------
--
2.7.4
^ permalink raw reply related
* [PATCH v4 8/9] PM / Domains: Support IRQ safe PM domains
From: Lina Iyer @ 2016-10-24 22:21 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1477347668-41901-1-git-send-email-lina.iyer@linaro.org>
Generic Power Domains currently support turning on/off only in process
context. This prevents the usage of PM domains for domains that could be
powered on/off in a context where IRQs are disabled. Many such domains
exist today and do not get powered off, when the IRQ safe devices in
that domain are powered off, because of this limitation.
However, not all domains can operate in IRQ safe contexts. Genpd
therefore, has to support both cases where the domain may or may not
operate in IRQ safe contexts. Configuring genpd to use an appropriate
lock for that domain, would allow domains that have IRQ safe devices to
runtime suspend and resume, in atomic context.
To achieve domain specific locking, set the domain's ->flag to
GENPD_FLAG_IRQ_SAFE while defining the domain. This indicates that genpd
should use a spinlock instead of a mutex for locking the domain. Locking
is abstracted through genpd_lock() and genpd_unlock() functions that use
the flag to determine the appropriate lock to be used for that domain.
Domains that have lower latency to suspend and resume and can operate
with IRQs disabled may now be able to save power, when the component
devices and sub-domains are idle at runtime.
The restriction this imposes on the domain hierarchy is that non-IRQ
safe domains may not have IRQ-safe subdomains, but IRQ safe domains may
have IRQ safe and non-IRQ safe subdomains and devices.
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Kevin Hilman <khilman@kernel.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Signed-off-by: Lina Iyer <lina.iyer@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/base/power/domain.c | 111 ++++++++++++++++++++++++++++++++++++++++----
include/linux/pm_domain.h | 10 +++-
2 files changed, 110 insertions(+), 11 deletions(-)
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 1ad42f2..07ed835 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -74,11 +74,70 @@ static const struct genpd_lock_ops genpd_mtx_ops = {
.unlock = genpd_unlock_mtx,
};
+static void genpd_lock_spin(struct generic_pm_domain *genpd)
+ __acquires(&genpd->slock)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&genpd->slock, flags);
+ genpd->lock_flags = flags;
+}
+
+static void genpd_lock_nested_spin(struct generic_pm_domain *genpd,
+ int depth)
+ __acquires(&genpd->slock)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave_nested(&genpd->slock, flags, depth);
+ genpd->lock_flags = flags;
+}
+
+static int genpd_lock_interruptible_spin(struct generic_pm_domain *genpd)
+ __acquires(&genpd->slock)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&genpd->slock, flags);
+ genpd->lock_flags = flags;
+ return 0;
+}
+
+static void genpd_unlock_spin(struct generic_pm_domain *genpd)
+ __releases(&genpd->slock)
+{
+ spin_unlock_irqrestore(&genpd->slock, genpd->lock_flags);
+}
+
+static const struct genpd_lock_ops genpd_spin_ops = {
+ .lock = genpd_lock_spin,
+ .lock_nested = genpd_lock_nested_spin,
+ .lock_interruptible = genpd_lock_interruptible_spin,
+ .unlock = genpd_unlock_spin,
+};
+
#define genpd_lock(p) p->lock_ops->lock(p)
#define genpd_lock_nested(p, d) p->lock_ops->lock_nested(p, d)
#define genpd_lock_interruptible(p) p->lock_ops->lock_interruptible(p)
#define genpd_unlock(p) p->lock_ops->unlock(p)
+#define genpd_is_irq_safe(genpd) (genpd->flags & GENPD_FLAG_IRQ_SAFE)
+
+static inline bool irq_safe_dev_in_no_sleep_domain(struct device *dev,
+ struct generic_pm_domain *genpd)
+{
+ bool ret;
+
+ ret = pm_runtime_is_irq_safe(dev) && !genpd_is_irq_safe(genpd);
+
+ /* Warn once for each IRQ safe dev in no sleep domain */
+ if (ret)
+ dev_warn_once(dev, "PM domain %s will not be powered off\n",
+ genpd->name);
+
+ return ret;
+}
+
/*
* Get the generic PM domain for a particular struct device.
* This validates the struct device pointer, the PM domain pointer,
@@ -343,7 +402,12 @@ static int genpd_poweroff(struct generic_pm_domain *genpd, bool is_async)
if (stat > PM_QOS_FLAGS_NONE)
return -EBUSY;
- if (!pm_runtime_suspended(pdd->dev) || pdd->dev->power.irq_safe)
+ /*
+ * Do not allow PM domain to be powered off, when an IRQ safe
+ * device is part of a non-IRQ safe domain.
+ */
+ if (!pm_runtime_suspended(pdd->dev) ||
+ irq_safe_dev_in_no_sleep_domain(pdd->dev, genpd))
not_suspended++;
}
@@ -506,10 +570,10 @@ static int genpd_runtime_suspend(struct device *dev)
}
/*
- * If power.irq_safe is set, this routine will be run with interrupts
- * off, so it can't use mutexes.
+ * If power.irq_safe is set, this routine may be run with
+ * IRQs disabled, so suspend only if the PM domain also is irq_safe.
*/
- if (dev->power.irq_safe)
+ if (irq_safe_dev_in_no_sleep_domain(dev, genpd))
return 0;
genpd_lock(genpd);
@@ -543,8 +607,11 @@ static int genpd_runtime_resume(struct device *dev)
if (IS_ERR(genpd))
return -EINVAL;
- /* If power.irq_safe, the PM domain is never powered off. */
- if (dev->power.irq_safe) {
+ /*
+ * As we don't power off a non IRQ safe domain, which holds
+ * an IRQ safe device, we don't need to restore power to it.
+ */
+ if (irq_safe_dev_in_no_sleep_domain(dev, genpd)) {
timed = false;
goto out;
}
@@ -586,7 +653,8 @@ static int genpd_runtime_resume(struct device *dev)
err_stop:
genpd_stop_dev(genpd, dev);
err_poweroff:
- if (!dev->power.irq_safe) {
+ if (!pm_runtime_is_irq_safe(dev) ||
+ (pm_runtime_is_irq_safe(dev) && genpd_is_irq_safe(genpd))) {
genpd_lock(genpd);
genpd_poweroff(genpd, 0);
genpd_unlock(genpd);
@@ -1223,6 +1291,17 @@ static int genpd_add_subdomain(struct generic_pm_domain *genpd,
|| genpd == subdomain)
return -EINVAL;
+ /*
+ * If the domain can be powered on/off in an IRQ safe
+ * context, ensure that the subdomain can also be
+ * powered on/off in that context.
+ */
+ if (!genpd_is_irq_safe(genpd) && genpd_is_irq_safe(subdomain)) {
+ WARN("Parent %s of subdomain %s must be IRQ safe\n",
+ genpd->name, subdomain->name);
+ return -EINVAL;
+ }
+
link = kzalloc(sizeof(*link), GFP_KERNEL);
if (!link)
return -ENOMEM;
@@ -1337,6 +1416,17 @@ static int genpd_set_default_power_state(struct generic_pm_domain *genpd)
return 0;
}
+static void genpd_lock_init(struct generic_pm_domain *genpd)
+{
+ if (genpd->flags & GENPD_FLAG_IRQ_SAFE) {
+ spin_lock_init(&genpd->slock);
+ genpd->lock_ops = &genpd_spin_ops;
+ } else {
+ mutex_init(&genpd->mlock);
+ genpd->lock_ops = &genpd_mtx_ops;
+ }
+}
+
/**
* pm_genpd_init - Initialize a generic I/O PM domain object.
* @genpd: PM domain object to initialize.
@@ -1356,8 +1446,7 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
INIT_LIST_HEAD(&genpd->master_links);
INIT_LIST_HEAD(&genpd->slave_links);
INIT_LIST_HEAD(&genpd->dev_list);
- mutex_init(&genpd->mlock);
- genpd->lock_ops = &genpd_mtx_ops;
+ genpd_lock_init(genpd);
genpd->gov = gov;
INIT_WORK(&genpd->power_off_work, genpd_power_off_work_fn);
atomic_set(&genpd->sd_count, 0);
@@ -2131,7 +2220,9 @@ static int pm_genpd_summary_one(struct seq_file *s,
}
list_for_each_entry(pm_data, &genpd->dev_list, list_node) {
- kobj_path = kobject_get_path(&pm_data->dev->kobj, GFP_KERNEL);
+ kobj_path = kobject_get_path(&pm_data->dev->kobj,
+ genpd_is_irq_safe(genpd) ?
+ GFP_ATOMIC : GFP_KERNEL);
if (kobj_path == NULL)
continue;
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 811b968..81ece61 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -15,9 +15,11 @@
#include <linux/err.h>
#include <linux/of.h>
#include <linux/notifier.h>
+#include <linux/spinlock.h>
/* Defines used for the flags field in the struct generic_pm_domain */
#define GENPD_FLAG_PM_CLK (1U << 0) /* PM domain uses PM clk */
+#define GENPD_FLAG_IRQ_SAFE (1U << 1) /* PM domain operates in atomic */
enum gpd_status {
GPD_STATE_ACTIVE = 0, /* PM domain is active */
@@ -76,7 +78,13 @@ struct generic_pm_domain {
unsigned int state_idx; /* state that genpd will go to when off */
void *free; /* Free the state that was allocated for default */
const struct genpd_lock_ops *lock_ops;
- struct mutex mlock;
+ union {
+ struct mutex mlock;
+ struct {
+ spinlock_t slock;
+ unsigned long lock_flags;
+ };
+ };
};
--
2.7.4
^ permalink raw reply related
* [PATCH v4 7/9] PM / Domains: Abstract genpd locking
From: Lina Iyer @ 2016-10-24 22:21 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1477347668-41901-1-git-send-email-lina.iyer@linaro.org>
Abstract genpd lock/unlock calls, in preparation for domain specific
locks added in the following patches.
Cc: Kevin Hilman <khilman@kernel.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Signed-off-by: Lina Iyer <lina.iyer@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/base/power/domain.c | 121 +++++++++++++++++++++++++++++---------------
include/linux/pm_domain.h | 5 +-
2 files changed, 85 insertions(+), 41 deletions(-)
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index f056c80..1ad42f2 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -39,6 +39,46 @@
static LIST_HEAD(gpd_list);
static DEFINE_MUTEX(gpd_list_lock);
+struct genpd_lock_ops {
+ void (*lock)(struct generic_pm_domain *genpd);
+ void (*lock_nested)(struct generic_pm_domain *genpd, int depth);
+ int (*lock_interruptible)(struct generic_pm_domain *genpd);
+ void (*unlock)(struct generic_pm_domain *genpd);
+};
+
+static void genpd_lock_mtx(struct generic_pm_domain *genpd)
+{
+ mutex_lock(&genpd->mlock);
+}
+
+static void genpd_lock_nested_mtx(struct generic_pm_domain *genpd,
+ int depth)
+{
+ mutex_lock_nested(&genpd->mlock, depth);
+}
+
+static int genpd_lock_interruptible_mtx(struct generic_pm_domain *genpd)
+{
+ return mutex_lock_interruptible(&genpd->mlock);
+}
+
+static void genpd_unlock_mtx(struct generic_pm_domain *genpd)
+{
+ return mutex_unlock(&genpd->mlock);
+}
+
+static const struct genpd_lock_ops genpd_mtx_ops = {
+ .lock = genpd_lock_mtx,
+ .lock_nested = genpd_lock_nested_mtx,
+ .lock_interruptible = genpd_lock_interruptible_mtx,
+ .unlock = genpd_unlock_mtx,
+};
+
+#define genpd_lock(p) p->lock_ops->lock(p)
+#define genpd_lock_nested(p, d) p->lock_ops->lock_nested(p, d)
+#define genpd_lock_interruptible(p) p->lock_ops->lock_interruptible(p)
+#define genpd_unlock(p) p->lock_ops->unlock(p)
+
/*
* Get the generic PM domain for a particular struct device.
* This validates the struct device pointer, the PM domain pointer,
@@ -200,9 +240,9 @@ static int genpd_poweron(struct generic_pm_domain *genpd, unsigned int depth)
genpd_sd_counter_inc(master);
- mutex_lock_nested(&master->lock, depth + 1);
+ genpd_lock_nested(master, depth + 1);
ret = genpd_poweron(master, depth + 1);
- mutex_unlock(&master->lock);
+ genpd_unlock(master);
if (ret) {
genpd_sd_counter_dec(master);
@@ -255,9 +295,9 @@ static int genpd_dev_pm_qos_notifier(struct notifier_block *nb,
spin_unlock_irq(&dev->power.lock);
if (!IS_ERR(genpd)) {
- mutex_lock(&genpd->lock);
+ genpd_lock(genpd);
genpd->max_off_time_changed = true;
- mutex_unlock(&genpd->lock);
+ genpd_unlock(genpd);
}
dev = dev->parent;
@@ -354,9 +394,9 @@ static void genpd_power_off_work_fn(struct work_struct *work)
genpd = container_of(work, struct generic_pm_domain, power_off_work);
- mutex_lock(&genpd->lock);
+ genpd_lock(genpd);
genpd_poweroff(genpd, true);
- mutex_unlock(&genpd->lock);
+ genpd_unlock(genpd);
}
/**
@@ -472,9 +512,9 @@ static int genpd_runtime_suspend(struct device *dev)
if (dev->power.irq_safe)
return 0;
- mutex_lock(&genpd->lock);
+ genpd_lock(genpd);
genpd_poweroff(genpd, false);
- mutex_unlock(&genpd->lock);
+ genpd_unlock(genpd);
return 0;
}
@@ -509,9 +549,9 @@ static int genpd_runtime_resume(struct device *dev)
goto out;
}
- mutex_lock(&genpd->lock);
+ genpd_lock(genpd);
ret = genpd_poweron(genpd, 0);
- mutex_unlock(&genpd->lock);
+ genpd_unlock(genpd);
if (ret)
return ret;
@@ -547,9 +587,9 @@ err_stop:
genpd_stop_dev(genpd, dev);
err_poweroff:
if (!dev->power.irq_safe) {
- mutex_lock(&genpd->lock);
+ genpd_lock(genpd);
genpd_poweroff(genpd, 0);
- mutex_unlock(&genpd->lock);
+ genpd_unlock(genpd);
}
return ret;
@@ -732,20 +772,20 @@ static int pm_genpd_prepare(struct device *dev)
if (resume_needed(dev, genpd))
pm_runtime_resume(dev);
- mutex_lock(&genpd->lock);
+ genpd_lock(genpd);
if (genpd->prepared_count++ == 0)
genpd->suspended_count = 0;
- mutex_unlock(&genpd->lock);
+ genpd_unlock(genpd);
ret = pm_generic_prepare(dev);
if (ret) {
- mutex_lock(&genpd->lock);
+ genpd_lock(genpd);
genpd->prepared_count--;
- mutex_unlock(&genpd->lock);
+ genpd_unlock(genpd);
}
return ret;
@@ -936,13 +976,13 @@ static void pm_genpd_complete(struct device *dev)
pm_generic_complete(dev);
- mutex_lock(&genpd->lock);
+ genpd_lock(genpd);
genpd->prepared_count--;
if (!genpd->prepared_count)
genpd_queue_power_off_work(genpd);
- mutex_unlock(&genpd->lock);
+ genpd_unlock(genpd);
}
/**
@@ -1071,7 +1111,7 @@ static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
if (IS_ERR(gpd_data))
return PTR_ERR(gpd_data);
- mutex_lock(&genpd->lock);
+ genpd_lock(genpd);
if (genpd->prepared_count > 0) {
ret = -EAGAIN;
@@ -1088,7 +1128,7 @@ static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
list_add_tail(&gpd_data->base.list_node, &genpd->dev_list);
out:
- mutex_unlock(&genpd->lock);
+ genpd_unlock(genpd);
if (ret)
genpd_free_dev_data(dev, gpd_data);
@@ -1130,7 +1170,7 @@ static int genpd_remove_device(struct generic_pm_domain *genpd,
gpd_data = to_gpd_data(pdd);
dev_pm_qos_remove_notifier(dev, &gpd_data->nb);
- mutex_lock(&genpd->lock);
+ genpd_lock(genpd);
if (genpd->prepared_count > 0) {
ret = -EAGAIN;
@@ -1145,14 +1185,14 @@ static int genpd_remove_device(struct generic_pm_domain *genpd,
list_del_init(&pdd->list_node);
- mutex_unlock(&genpd->lock);
+ genpd_unlock(genpd);
genpd_free_dev_data(dev, gpd_data);
return 0;
out:
- mutex_unlock(&genpd->lock);
+ genpd_unlock(genpd);
dev_pm_qos_add_notifier(dev, &gpd_data->nb);
return ret;
@@ -1187,8 +1227,8 @@ static int genpd_add_subdomain(struct generic_pm_domain *genpd,
if (!link)
return -ENOMEM;
- mutex_lock(&subdomain->lock);
- mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
+ genpd_lock(subdomain);
+ genpd_lock_nested(genpd, SINGLE_DEPTH_NESTING);
if (genpd->status == GPD_STATE_POWER_OFF
&& subdomain->status != GPD_STATE_POWER_OFF) {
@@ -1211,8 +1251,8 @@ static int genpd_add_subdomain(struct generic_pm_domain *genpd,
genpd_sd_counter_inc(genpd);
out:
- mutex_unlock(&genpd->lock);
- mutex_unlock(&subdomain->lock);
+ genpd_unlock(genpd);
+ genpd_unlock(subdomain);
if (ret)
kfree(link);
return ret;
@@ -1250,8 +1290,8 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(subdomain))
return -EINVAL;
- mutex_lock(&subdomain->lock);
- mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING);
+ genpd_lock(subdomain);
+ genpd_lock_nested(genpd, SINGLE_DEPTH_NESTING);
if (!list_empty(&subdomain->master_links) || subdomain->device_count) {
pr_warn("%s: unable to remove subdomain %s\n", genpd->name,
@@ -1275,8 +1315,8 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
}
out:
- mutex_unlock(&genpd->lock);
- mutex_unlock(&subdomain->lock);
+ genpd_unlock(genpd);
+ genpd_unlock(subdomain);
return ret;
}
@@ -1316,7 +1356,8 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
INIT_LIST_HEAD(&genpd->master_links);
INIT_LIST_HEAD(&genpd->slave_links);
INIT_LIST_HEAD(&genpd->dev_list);
- mutex_init(&genpd->lock);
+ mutex_init(&genpd->mlock);
+ genpd->lock_ops = &genpd_mtx_ops;
genpd->gov = gov;
INIT_WORK(&genpd->power_off_work, genpd_power_off_work_fn);
atomic_set(&genpd->sd_count, 0);
@@ -1364,16 +1405,16 @@ static int genpd_remove(struct generic_pm_domain *genpd)
if (IS_ERR_OR_NULL(genpd))
return -EINVAL;
- mutex_lock(&genpd->lock);
+ genpd_lock(genpd);
if (genpd->has_provider) {
- mutex_unlock(&genpd->lock);
+ genpd_unlock(genpd);
pr_err("Provider present, unable to remove %s\n", genpd->name);
return -EBUSY;
}
if (!list_empty(&genpd->master_links) || genpd->device_count) {
- mutex_unlock(&genpd->lock);
+ genpd_unlock(genpd);
pr_err("%s: unable to remove %s\n", __func__, genpd->name);
return -EBUSY;
}
@@ -1385,7 +1426,7 @@ static int genpd_remove(struct generic_pm_domain *genpd)
}
list_del(&genpd->gpd_list_node);
- mutex_unlock(&genpd->lock);
+ genpd_unlock(genpd);
cancel_work_sync(&genpd->power_off_work);
kfree(genpd->free);
pr_debug("%s: removed %s\n", __func__, genpd->name);
@@ -1909,9 +1950,9 @@ int genpd_dev_pm_attach(struct device *dev)
dev->pm_domain->detach = genpd_dev_pm_detach;
dev->pm_domain->sync = genpd_dev_pm_sync;
- mutex_lock(&pd->lock);
+ genpd_lock(pd);
ret = genpd_poweron(pd, 0);
- mutex_unlock(&pd->lock);
+ genpd_unlock(pd);
out:
return ret ? -EPROBE_DEFER : 0;
}
@@ -2064,7 +2105,7 @@ static int pm_genpd_summary_one(struct seq_file *s,
char state[16];
int ret;
- ret = mutex_lock_interruptible(&genpd->lock);
+ ret = genpd_lock_interruptible(genpd);
if (ret)
return -ERESTARTSYS;
@@ -2101,7 +2142,7 @@ static int pm_genpd_summary_one(struct seq_file *s,
seq_puts(s, "\n");
exit:
- mutex_unlock(&genpd->lock);
+ genpd_unlock(genpd);
return 0;
}
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 6a89881..811b968 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -42,13 +42,14 @@ struct genpd_power_state {
struct fwnode_handle *fwnode;
};
+struct genpd_lock_ops;
+
struct generic_pm_domain {
struct dev_pm_domain domain; /* PM domain operations */
struct list_head gpd_list_node; /* Node in the global PM domains list */
struct list_head master_links; /* Links with PM domain as a master */
struct list_head slave_links; /* Links with PM domain as a slave */
struct list_head dev_list; /* List of devices */
- struct mutex lock;
struct dev_power_governor *gov;
struct work_struct power_off_work;
struct fwnode_handle *provider; /* Identity of the domain provider */
@@ -74,6 +75,8 @@ struct generic_pm_domain {
unsigned int state_count; /* number of states */
unsigned int state_idx; /* state that genpd will go to when off */
void *free; /* Free the state that was allocated for default */
+ const struct genpd_lock_ops *lock_ops;
+ struct mutex mlock;
};
--
2.7.4
^ permalink raw reply related
* [PATCH v4 6/9] PM / Domains: Save the fwnode in genpd_power_state
From: Lina Iyer @ 2016-10-24 22:21 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1477347668-41901-1-git-send-email-lina.iyer@linaro.org>
Save the fwnode for the genpd state in the state node. PM Domain clients
may use the fwnode to read in the platform specific domain state
properties and associate them with the state.
Signed-off-by: Lina Iyer <lina.iyer@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/base/power/domain.c | 1 +
include/linux/pm_domain.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 0e59f1d..f056c80 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1956,6 +1956,7 @@ static int genpd_parse_state(struct genpd_power_state *genpd_state,
genpd_state->power_on_latency_ns = 1000 * exit_latency;
genpd_state->power_off_latency_ns = 1000 * entry_latency;
+ genpd_state->fwnode = &state_node->fwnode;
return 0;
}
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index b489496..6a89881 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -39,6 +39,7 @@ struct genpd_power_state {
s64 power_off_latency_ns;
s64 power_on_latency_ns;
s64 residency_ns;
+ struct fwnode_handle *fwnode;
};
struct generic_pm_domain {
--
2.7.4
^ permalink raw reply related
* [PATCH v4 5/9] dt-bindings: Update binding for PM domain idle states
From: Lina Iyer @ 2016-10-24 22:21 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1477347668-41901-1-git-send-email-lina.iyer@linaro.org>
Update DT bindings to describe idle states of PM domains.
This patch is based on the original patch by Marc Titinger.
Cc: <devicetree@vger.kernel.org>
Signed-off-by: Marc Titinger <mtitinger+renesas@baylibre.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Lina Iyer <lina.iyer@linaro.org>
---
.../devicetree/bindings/power/power_domain.txt | 44 ++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/Documentation/devicetree/bindings/power/power_domain.txt b/Documentation/devicetree/bindings/power/power_domain.txt
index 025b5e7..3c926b5 100644
--- a/Documentation/devicetree/bindings/power/power_domain.txt
+++ b/Documentation/devicetree/bindings/power/power_domain.txt
@@ -29,6 +29,16 @@ Optional properties:
specified by this binding. More details about power domain specifier are
available in the next section.
+- domain-idle-states : A phandle of an idle-state that shall be soaked into a
+ generic domain power state. The idle state definitions must be
+ compatible with "domain-idle-state" as well as
+ "arm,idle-state" as defined in [1].
+ The domain-idle-state property reflects the idle state of this PM domain and
+ not the idle states of the devices or sub-domains in the PM domain. Devices
+ and sub-domains have their own idle-states independent of the parent
+ domain's idle states. In the absence of this property, the domain would be
+ considered as capable of being powered-on or powered-off.
+
Example:
power: power-controller at 12340000 {
@@ -59,6 +69,38 @@ The nodes above define two power controllers: 'parent' and 'child'.
Domains created by the 'child' power controller are subdomains of '0' power
domain provided by the 'parent' power controller.
+Example 3:
+ parent: power-controller at 12340000 {
+ compatible = "foo,power-controller";
+ reg = <0x12340000 0x1000>;
+ #power-domain-cells = <0>;
+ domain-idle-states = <&DOMAIN_RET>, <&DOMAIN_PWR_DN>;
+ };
+
+ child: power-controller at 12341000 {
+ compatible = "foo,power-controller";
+ reg = <0x12341000 0x1000>;
+ power-domains = <&parent 0>;
+ #power-domain-cells = <0>;
+ domain-idle-states = <&DOMAIN_PWR_DN>;
+ };
+
+ DOMAIN_RET: state at 0 {
+ compatible = "domain-idle-state", "arm,idle-state";
+ reg = <0x0>;
+ entry-latency-us = <1000>;
+ exit-latency-us = <2000>;
+ min-residency-us = <10000>;
+ };
+
+ DOMAIN_PWR_DN: state at 1 {
+ compatible = "domain-idle-state", "arm,idle-state";
+ reg = <0x1>;
+ entry-latency-us = <5000>;
+ exit-latency-us = <8000>;
+ min-residency-us = <7000>;
+ };
+
==PM domain consumers==
Required properties:
@@ -76,3 +118,5 @@ Example:
The node above defines a typical PM domain consumer device, which is located
inside a PM domain with index 0 of a power controller represented by a node
with the label "power".
+
+[1]. Documentation/devicetree/bindings/arm/idle-states.txt
--
2.7.4
^ permalink raw reply related
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