* [PATCH v5 2/2] PCI: quirks: Fix ThunderX2 dma alias handling
From: Jayachandran C @ 2017-04-17 17:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAErSpo731xSzrnKF+G+8SA_UUHy7ROA1V9oFkpwKi85GQf9VAg@mail.gmail.com>
On Fri, Apr 14, 2017 at 09:00:06PM -0500, Bjorn Helgaas wrote:
> On Fri, Apr 14, 2017 at 4:06 PM, Jayachandran C
> <jnair@caviumnetworks.com> wrote:
> > On Thu, Apr 13, 2017 at 07:19:11PM -0500, Bjorn Helgaas wrote:
> >> I tentatively applied both patches to pci/host-thunder for v4.12.
> >>
> >> However, I am concerned about the topology here:
> >>
> >> On Thu, Apr 13, 2017 at 08:30:45PM +0000, Jayachandran C wrote:
> >> > On Cavium ThunderX2 arm64 SoCs (called Broadcom Vulcan earlier), the
> >> > PCI topology is slightly unusual. For a multi-node system, it looks
> >> > like:
> >> >
> >> > 00:00.0 [PCI] bridge to [bus 01-1e]
> >> > 01:0a.0 [PCI-PCIe bridge, type 8] bridge to [bus 02-04]
> >> > 02:00.0 [PCIe root port, type 4] bridge to [bus 03-04] (XLATE_ROOT)
> >> > 03:00.0 PCIe Endpoint
> >>
> >> A root port normally has a single PCIe link leading downstream.
> >> According to this, 02:00.0 is a root port that has the usual
> >> downstream link leading to 03:00.0, but it also has an upstream link
> >> to 01:0a.0.
> >
> > The PCI topology is a bit broken due to the way that the PCIe IP block
> > was integrated into SoC PCI bridges and devices. The current mechanism
> > of adding a PCI-PCIe bridge to glue these together is not ideal.
>
> Yeah, that's definitely broken.
>
> >> Maybe this example is omitting details that are not relevant to DMA
> >> aliases? The PCIe capability only contains one set of link-related
> >> registers, so I don't know how we could manage a single device that
> >> has two links.
> >
> > The root port is standard and has just one link to the EP (or whatever
> > is on the external PCIe slot). The fallout of the current hw design is
> > that the PCI-PCIe bridge has a link that does not follow standard and
> > does not have a counterpart (as you noted).
> >
> >> A device with two links would break things like ASPM. In
> >> set_pcie_port_type(), for example, we have this comment:
> >>
> >> * A Root Port or a PCI-to-PCIe bridge is always the upstream end
> >> * of a Link. No PCIe component has two Links. Two Links are
> >> * connected by a Switch that has a Port on each Link and internal
> >> * logic to connect the two Ports.
> >>
> >> The topology above breaks these assumptions, which will make
> >> pdev->has_secondary_link incorrect, which means ASPM won't work
> >> correctly.
> >
> > Given the current hardware, the pcieport driver seems to work reasonably
> > for the root port at 02:00.0, with AER support. I will take a look at the
> > ASPM part.
>
> I don't think pcieport itself cares much about links. ASPM does, but
> it looks like set_pcie_port_type() actually is smart enough to know
> that PCI-to-PCIe bridges and Root Ports always have links on their
> secondary sides. So has_secondary_link probably does get set
> correctly.
>
> But I think you'll hit the VIA "strange chipset" thing in
> pcie_aspm_init_link_state(), which will probably prevent us from doing
> ASPM on the link from 02:00.0 to 03:00.0.
>
> Could you collect "lspci -vv" output from this system? I'd like to
> archive that as background for this IOMMU issue and the ASPM tweaks I
> suspect we'll have to do. I *wish* we had more information about that
> VIA thing, because I suspect we could get rid of it if we had more
> details.
The full logs are slightly large, so I have kept them at:
https://github.com/jchandra-cavm/thunderx2/blob/master/logs/
The lspci -vv output is lspci-vv.txt and lspci -tvn output is lspci-tvn.txt
The output is from 2 socket system, the cards are not on the first slot
like the example above, so the bus and device numbers are different.
Looks like I have to spend some time on ASPM next.
Thanks,
JC.
^ permalink raw reply
* [PATCH] coresight: etm_perf: Fix using uninitialised work
From: Mathieu Poirier @ 2017-04-17 17:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAJ9a7VhXVAeMR_KAtqST0HpUczk6COWfWCupBYD=7Bg0aXbKQA@mail.gmail.com>
On Fri, Apr 07, 2017 at 03:48:10PM +0100, Mike Leach wrote:
> Tested against the 4.11-rc1 OpenCSD perf tree - reproduced the problem
> and confirmed the patch fixes it on Juno r1.
> Noted that the command line
> ./perf record -e cs_etm/@20010000.etf/ uname
> also causes the same problem,
>
> Larger question that may need future investigation in the openCSD
> project is why the sink provided in the perf command line is not being
> enabled?
The above command defines a per-cpu event rather than a per-thread event. This
has the same effect as using the -C option to define a specific set of CPUs to
trace on.
Once upon a time we fixed the enable_sink flag issue by flipping it back to
false when the configuration has been recorded. That works well when working
with a per-thread scenario because a single event with cpu == -1 is sent down to
the kernel.
When working with a per-cpu scenario an event is generated for each CPU that is
present in the system. When the driver receives the first event for CPU0 it
records the sink and flip the sysfs enable_sink flag back, so when events for
the other CPUs are received no sink is selected (as it was just flipped back)
and the whole thing fails.
Fixing this won't be easy. I looked at the problem before and the only solution
(at least that I could see) was to send down the sink information to the kernel
with each event that is received. That way any event is independent from the
other and we don't need to play with the sysfs enable_sink flag in the kernel
anymore.
That approach was rejected because of the way event attributes are communicated
to the kernel as part of the system call. We will have the same problem when we
enhance the solution to support one sink per tracer so I have to start working
on this.
In the mean time I have applied Suzuki's patch as it fix a real problem.
Thanks,
Mathieu
>
> Regards
>
> Mike
>
> On 31 March 2017 at 19:18, Suzuki K Poulose <suzuki.poulose@arm.com> wrote:
> > With 4.11-rc4, the following command triggers a WARN_ON,
> > when a sink is not enabled.
> >
> > perf record -e cs_etm/@20010000.etf/
> >
> > [88286.547741] ------------[ cut here ]------------
> > [88286.552332] WARNING: CPU: 3 PID: 2156 at kernel/workqueue.c:1442 __queue_work+0x29c/0x3b8
> > [88286.560427] Modules linked in:
> > [88286.563451]
> > [88286.564928] CPU: 3 PID: 2156 Comm: perf_v4.11 Not tainted 4.11.0-rc4 #217
> > [88286.573453] Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform, BIOS EDK II Aug 15
> > 2016
> > [88286.584128] task: ffff80097597c200 task.stack: ffff8009768b0000
> > [88286.589990] PC is at __queue_work+0x29c/0x3b8
> > [88286.594303] LR is at __queue_work+0x104/0x3b8
> > [88286.598614] pc : [<ffff0000080d8c7c>] lr : [<ffff0000080d8ae4>] pstate: a00001c5
> > [88286.605934] sp : ffff8009768b3aa0
> > [88286.609212] x29: ffff8009768b3aa0 x28: ffff80097ff3da00
> > [88286.614477] x27: ffff80097ff89c00 x26: ffff8009751b0e00
> > [88286.619741] x25: ffff000008c9f000 x24: 0000000000000003
> > [88286.625004] x23: 0000000000000040 x22: ffff000008d3dab8
> > [88286.630268] x21: ffff800977804400 x20: 0000000000000007
> > [88286.635532] x19: ffff000008c54000 x18: 0000fffff9185160
> > [88286.640795] x17: 0000ffffb33d9a38 x16: ffff000008088270
> > [88286.646059] x15: 0000ffffb345b590 x14: 0000000000000000
> > [88286.651322] x13: 0000000000000004 x12: 0000000000000040
> > [88286.656586] x11: 0000000000000068 x10: 0000000000000000
> > [88286.661849] x9 : ffff800977400028 x8 : 0000000000000000
> > [88286.667113] x7 : 0000000000000000 x6 : ffff0000080d8ae4
> > [88286.672376] x5 : 0000000000000000 x4 : 0000000000000080
> > [88286.677639] x3 : 0000000000000000 x2 : 0000000000000000
> > [88286.682903] x1 : 0000000000000000 x0 : ffff8009751b0e08
> > [88286.688166]
> > [88286.689638] ---[ end trace 31633f18fd33d4cb ]---
> > [88286.694206] Call trace:
> > [88286.696627] Exception stack(0xffff8009768b38d0 to 0xffff8009768b3a00)
> > [88286.703004] 38c0: ffff000008c54000 0001000000000000
> > [88286.710757] 38e0: ffff8009768b3aa0 ffff0000080d8c7c ffff8009768b3b50 ffff80097ff8a5b0
> > [88286.718511] 3900: 0000800977325000 0000000000000000 0000000000000040 ffff80097ffc6180
> > [88286.726264] 3920: ffff8009768b3940 ffff0000088a8694 ffff80097ffc5800 0000000000000000
> > [88286.734017] 3940: ffff8009768b3960 ffff0000081919c0 ffff80097ffc5280 0000000000000001
> > [88286.741771] 3960: ffff8009768b3a50 ffff00000819206c ffff8009751b0e08 0000000000000000
> > [88286.749523] 3980: 0000000000000000 0000000000000000 0000000000000080 0000000000000000
> > [88286.757277] 39a0: ffff0000080d8ae4 0000000000000000 0000000000000000 ffff800977400028
> > [88286.765029] 39c0: 0000000000000000 0000000000000068 0000000000000040 0000000000000004
> > [88286.772783] 39e0: 0000000000000000 0000ffffb345b590 ffff000008088270 0000ffffb33d9a38
> > [88286.780537] [<ffff0000080d8c7c>] __queue_work+0x29c/0x3b8
> > [88286.785883] [<ffff0000080d8df8>] queue_work_on+0x60/0x78
> > [88286.791146] [<ffff000008764c68>] etm_setup_aux+0x178/0x238
> > [88286.796578] [<ffff000008183600>] rb_alloc_aux+0x228/0x310
> > [88286.801925] [<ffff00000817e564>] perf_mmap+0x404/0x5a8
> > [88286.807015] [<ffff0000081c60cc>] mmap_region+0x394/0x5c0
> > [88286.812276] [<ffff0000081c654c>] do_mmap+0x254/0x388
> > [88286.817191] [<ffff0000081a989c>] vm_mmap_pgoff+0xbc/0xe0
> > [88286.822452] [<ffff0000081c3ffc>] SyS_mmap_pgoff+0xac/0x228
> > [88286.827884] [<ffff000008088288>] sys_mmap+0x18/0x28
> > [88286.832714] [<ffff000008082f30>] el0_svc_naked+0x24/0x28
> >
> > The patch makes sure that the event_data->work is initialised
> > properly before we could possibly use it.
> >
> > Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> > Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> > ---
> > drivers/hwtracing/coresight/coresight-etm-perf.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c
> > index 26cfac3..df63315 100644
> > --- a/drivers/hwtracing/coresight/coresight-etm-perf.c
> > +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c
> > @@ -201,6 +201,7 @@ static void *etm_setup_aux(int event_cpu, void **pages,
> > event_data = alloc_event_data(event_cpu);
> > if (!event_data)
> > return NULL;
> > + INIT_WORK(&event_data->work, free_event_data);
> >
> > /*
> > * In theory nothing prevent tracers in a trace session from being
> > @@ -217,8 +218,6 @@ static void *etm_setup_aux(int event_cpu, void **pages,
> > if (!sink)
> > goto err;
> >
> > - INIT_WORK(&event_data->work, free_event_data);
> > -
> > mask = &event_data->mask;
> >
> > /* Setup the path for each CPU in a trace session */
> > --
> > 2.7.4
> >
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
>
>
> --
> Mike Leach
> Principal Engineer, ARM Ltd.
> Blackburn Design Centre. UK
^ permalink raw reply
* [PATCH] coresight: etm_perf: Fix using uninitialised work
From: Mathieu Poirier @ 2017-04-17 17:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1490984331-12231-1-git-send-email-suzuki.poulose@arm.com>
On Fri, Mar 31, 2017 at 07:18:51PM +0100, Suzuki K Poulose wrote:
> With 4.11-rc4, the following command triggers a WARN_ON,
> when a sink is not enabled.
>
> perf record -e cs_etm/@20010000.etf/
>
> [88286.547741] ------------[ cut here ]------------
> [88286.552332] WARNING: CPU: 3 PID: 2156 at kernel/workqueue.c:1442 __queue_work+0x29c/0x3b8
> [88286.560427] Modules linked in:
> [88286.563451]
> [88286.564928] CPU: 3 PID: 2156 Comm: perf_v4.11 Not tainted 4.11.0-rc4 #217
> [88286.573453] Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform, BIOS EDK II Aug 15
> 2016
> [88286.584128] task: ffff80097597c200 task.stack: ffff8009768b0000
> [88286.589990] PC is at __queue_work+0x29c/0x3b8
> [88286.594303] LR is at __queue_work+0x104/0x3b8
> [88286.598614] pc : [<ffff0000080d8c7c>] lr : [<ffff0000080d8ae4>] pstate: a00001c5
> [88286.605934] sp : ffff8009768b3aa0
> [88286.609212] x29: ffff8009768b3aa0 x28: ffff80097ff3da00
> [88286.614477] x27: ffff80097ff89c00 x26: ffff8009751b0e00
> [88286.619741] x25: ffff000008c9f000 x24: 0000000000000003
> [88286.625004] x23: 0000000000000040 x22: ffff000008d3dab8
> [88286.630268] x21: ffff800977804400 x20: 0000000000000007
> [88286.635532] x19: ffff000008c54000 x18: 0000fffff9185160
> [88286.640795] x17: 0000ffffb33d9a38 x16: ffff000008088270
> [88286.646059] x15: 0000ffffb345b590 x14: 0000000000000000
> [88286.651322] x13: 0000000000000004 x12: 0000000000000040
> [88286.656586] x11: 0000000000000068 x10: 0000000000000000
> [88286.661849] x9 : ffff800977400028 x8 : 0000000000000000
> [88286.667113] x7 : 0000000000000000 x6 : ffff0000080d8ae4
> [88286.672376] x5 : 0000000000000000 x4 : 0000000000000080
> [88286.677639] x3 : 0000000000000000 x2 : 0000000000000000
> [88286.682903] x1 : 0000000000000000 x0 : ffff8009751b0e08
> [88286.688166]
> [88286.689638] ---[ end trace 31633f18fd33d4cb ]---
> [88286.694206] Call trace:
> [88286.696627] Exception stack(0xffff8009768b38d0 to 0xffff8009768b3a00)
> [88286.703004] 38c0: ffff000008c54000 0001000000000000
> [88286.710757] 38e0: ffff8009768b3aa0 ffff0000080d8c7c ffff8009768b3b50 ffff80097ff8a5b0
> [88286.718511] 3900: 0000800977325000 0000000000000000 0000000000000040 ffff80097ffc6180
> [88286.726264] 3920: ffff8009768b3940 ffff0000088a8694 ffff80097ffc5800 0000000000000000
> [88286.734017] 3940: ffff8009768b3960 ffff0000081919c0 ffff80097ffc5280 0000000000000001
> [88286.741771] 3960: ffff8009768b3a50 ffff00000819206c ffff8009751b0e08 0000000000000000
> [88286.749523] 3980: 0000000000000000 0000000000000000 0000000000000080 0000000000000000
> [88286.757277] 39a0: ffff0000080d8ae4 0000000000000000 0000000000000000 ffff800977400028
> [88286.765029] 39c0: 0000000000000000 0000000000000068 0000000000000040 0000000000000004
> [88286.772783] 39e0: 0000000000000000 0000ffffb345b590 ffff000008088270 0000ffffb33d9a38
> [88286.780537] [<ffff0000080d8c7c>] __queue_work+0x29c/0x3b8
> [88286.785883] [<ffff0000080d8df8>] queue_work_on+0x60/0x78
> [88286.791146] [<ffff000008764c68>] etm_setup_aux+0x178/0x238
> [88286.796578] [<ffff000008183600>] rb_alloc_aux+0x228/0x310
> [88286.801925] [<ffff00000817e564>] perf_mmap+0x404/0x5a8
> [88286.807015] [<ffff0000081c60cc>] mmap_region+0x394/0x5c0
> [88286.812276] [<ffff0000081c654c>] do_mmap+0x254/0x388
> [88286.817191] [<ffff0000081a989c>] vm_mmap_pgoff+0xbc/0xe0
> [88286.822452] [<ffff0000081c3ffc>] SyS_mmap_pgoff+0xac/0x228
> [88286.827884] [<ffff000008088288>] sys_mmap+0x18/0x28
> [88286.832714] [<ffff000008082f30>] el0_svc_naked+0x24/0x28
>
> The patch makes sure that the event_data->work is initialised
> properly before we could possibly use it.
>
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
> drivers/hwtracing/coresight/coresight-etm-perf.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c
> index 26cfac3..df63315 100644
> --- a/drivers/hwtracing/coresight/coresight-etm-perf.c
> +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c
> @@ -201,6 +201,7 @@ static void *etm_setup_aux(int event_cpu, void **pages,
> event_data = alloc_event_data(event_cpu);
> if (!event_data)
> return NULL;
> + INIT_WORK(&event_data->work, free_event_data);
>
> /*
> * In theory nothing prevent tracers in a trace session from being
> @@ -217,8 +218,6 @@ static void *etm_setup_aux(int event_cpu, void **pages,
> if (!sink)
> goto err;
>
> - INIT_WORK(&event_data->work, free_event_data);
> -
> mask = &event_data->mask;
>
Applied,
Thanks, Mathieu
> /* Setup the path for each CPU in a trace session */
> --
> 2.7.4
>
^ permalink raw reply
* [PATCH V3 2/2] ARM64: dts: hi6220-hikey: Add clock binding for the pmic mfd
From: Daniel Lezcano @ 2017-04-17 17:19 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1492449567-31399-1-git-send-email-daniel.lezcano@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
Documentation/devicetree/bindings/mfd/hisilicon,hi655x.txt | 6 ++++++
arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts | 1 +
2 files changed, 7 insertions(+)
diff --git a/Documentation/devicetree/bindings/mfd/hisilicon,hi655x.txt b/Documentation/devicetree/bindings/mfd/hisilicon,hi655x.txt
index 0548569..9630ac0 100644
--- a/Documentation/devicetree/bindings/mfd/hisilicon,hi655x.txt
+++ b/Documentation/devicetree/bindings/mfd/hisilicon,hi655x.txt
@@ -16,6 +16,11 @@ Required properties:
- reg: Base address of PMIC on Hi6220 SoC.
- interrupt-controller: Hi655x has internal IRQs (has own IRQ domain).
- pmic-gpios: The GPIO used by PMIC IRQ.
+- #clock-cells: From common clock binding; shall be set to 0
+
+Optional properties:
+- clock-output-names: From common clock binding to override the
+ default output clock name
Example:
pmic: pmic at f8000000 {
@@ -24,4 +29,5 @@ Example:
interrupt-controller;
#interrupt-cells = <2>;
pmic-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
+ #clock-cells = <0>;
}
diff --git a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
index dba3c13..e0496f7 100644
--- a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
+++ b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
@@ -325,6 +325,7 @@
pmic: pmic at f8000000 {
compatible = "hisilicon,hi655x-pmic";
reg = <0x0 0xf8000000 0x0 0x1000>;
+ #clock-cells = <0>;
interrupt-controller;
#interrupt-cells = <2>;
pmic-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
--
1.9.1
^ permalink raw reply related
* [PATCH v3 1/8] trace: ras: add ARM processor error information trace event
From: Baicar, Tyler @ 2017-04-17 17:18 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <8aa30f6a-d18d-1cce-57dc-08efb52d822e@huawei.com>
On 4/16/2017 9:16 PM, Xie XiuQi wrote:
> On 2017/4/17 11:08, Xie XiuQi wrote:
>>> On 3/30/2017 4:31 AM, Xie XiuQi wrote:
>>>> Add a new trace event for ARM processor error information, so that
>>>> the user will know what error occurred. With this information the
>>>> user may take appropriate action.
>>>>
>>>> These trace events are consistent with the ARM processor error
>>>> information table which defined in UEFI 2.6 spec section N.2.4.4.1.
>>>>
>>>> ---
>>>> v2: add trace enabled condition as Steven's suggestion.
>>>> fix a typo.
>>>> ---
>>>>
>>>> Cc: Steven Rostedt <rostedt@goodmis.org>
>>>> Cc: Tyler Baicar <tbaicar@codeaurora.org>
>>>> Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
>>>> ---
>>>
...
>>>> +/*
>>>> + * First define the enums in MM_ACTION_RESULT to be exported to userspace
>>>> + * via TRACE_DEFINE_ENUM().
>>>> + */
>>>> +#undef EM
>>>> +#undef EMe
>>>> +#define EM(a, b) TRACE_DEFINE_ENUM(a);
>>>> +#define EMe(a, b) TRACE_DEFINE_ENUM(a);
>>>> +
>>>> +ARM_PROC_ERR_TYPE
>>>> +ARM_PROC_ERR_FLAGS
>>> Are the above two lines supposed to be here?
>>>> +
>>>> +/*
>>>> + * Now redefine the EM() and EMe() macros to map the enums to the strings
>>>> + * that will be printed in the output.
>>>> + */
>>>> +#undef EM
>>>> +#undef EMe
>>>> +#define EM(a, b) { a, b },
>>>> +#define EMe(a, b) { a, b }
>>>> +
>>>> +TRACE_EVENT(arm_proc_err,
>>> I think it would be better to keep this similar to the naming of the current RAS trace events (right now we have mc_event, arm_event, aer_event, etc.). I would suggest using "arm_err_info_event" since this is handling the error information structures of the arm errors.
>>>> +
>>>> + TP_PROTO(const struct cper_arm_err_info *err),
>>>> +
>>>> + TP_ARGS(err),
>>>> +
>>>> + TP_STRUCT__entry(
>>>> + __field(u8, type)
>>>> + __field(u16, multiple_error)
>>>> + __field(u8, flags)
>>>> + __field(u64, error_info)
>>>> + __field(u64, virt_fault_addr)
>>>> + __field(u64, physical_fault_addr)
>>> Validation bits should also be a part of this structure that way user space tools will know which of these fields are valid.
>> Could we use the default value to check the validation which we have checked in TP_fast_assign?
Yes, true...I guess we really don't need the validation bits then.
>>>> + ),
>>>> +
>>>> + TP_fast_assign(
>>>> + __entry->type = err->type;
>>>> +
>>>> + if (err->validation_bits & CPER_ARM_INFO_VALID_MULTI_ERR)
>>>> + __entry->multiple_error = err->multiple_error;
>>>> + else
>>>> + __entry->multiple_error = ~0;
>>>> +
>>>> + if (err->validation_bits & CPER_ARM_INFO_VALID_FLAGS)
>>>> + __entry->flags = err->flags;
>>>> + else
>>>> + __entry->flags = ~0;
>>>> +
>>>> + if (err->validation_bits & CPER_ARM_INFO_VALID_ERR_INFO)
>>>> + __entry->error_info = err->error_info;
>>>> + else
>>>> + __entry->error_info = 0ULL;
>>>> +
>>>> + if (err->validation_bits & CPER_ARM_INFO_VALID_VIRT_ADDR)
>>>> + __entry->virt_fault_addr = err->virt_fault_addr;
>>>> + else
>>>> + __entry->virt_fault_addr = 0ULL;
>>>> +
>>>> + if (err->validation_bits & CPER_ARM_INFO_VALID_PHYSICAL_ADDR)
>>>> + __entry->physical_fault_addr = err->physical_fault_addr;
>>>> + else
>>>> + __entry->physical_fault_addr = 0ULL;
>>>> + ),
>>>> +
>>>> + TP_printk("ARM Processor Error: type %s; count: %u; flags: %s;"
>>> I think the "ARM Processor Error:" part of this should just be removed. Here's the output with this removed and the trace event renamed to arm_err_info_event. I think this looks much cleaner and matches the style used with the arm_event.
>>>
>>> <idle>-0 [020] .ns. 366.592434: arm_event: affinity level: 2; MPIDR: 0000000000000000; MIDR: 00000000510f8000; running state: 1; PSCI state: 0
>>> <idle>-0 [020] .ns. 366.592437: arm_err_info_event: type cache error; count: 0; flags: 0x3; error info: 0000000000c20058; virtual address: 0000000000000000; physical address: 0000000000000000
> As this section is ARM Processor Error Section, how about use arm_proc_err_event?
This is not for the ARM Processor Error Section, that is what the
arm_event is handling. What you are adding this trace support for here
is called the ARM Processor Error Information (UEFI 2.6 spec section
N.2.4.4.1). So I think your trace event here should be called
arm_err_info_event. This will also be consistent with the other two
trace events that I'm planning on adding:
arm_ctx_info_event: ARM Processor Context Information (UEFI 2.6 section
N.2.4.4.2)
arm_vendor_info_event: This is the "Vendor Specific Error Information"
in the ARM Processor Error Section (Table 260). It's possible I may just
add this into the arm_event trace event, but I haven't looked into it
enough yet.
Thanks,
Tyler
--
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
^ permalink raw reply
* [PATCH] net: thunderx: Fix set_max_bgx_per_node for 81xx rgx
From: David Miller @ 2017-04-17 17:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1492068301-1141-1-git-send-email-george.cherian@cavium.com>
From: George Cherian <george.cherian@cavium.com>
Date: Thu, 13 Apr 2017 07:25:01 +0000
> Add the PCI_SUBSYS_DEVID_81XX_RGX and use the same to set
> the max bgx per node count.
>
> This fixes the issue intoduced by following commit
> 78aacb6f6 net: thunderx: Fix invalid mac addresses for node1 interfaces
> With this commit the max_bgx_per_node for 81xx is set as 2 instead of 3
> because of which num_vfs is always calculated as zero.
>
> Signed-off-by: George Cherian <george.cherian@cavium.com>
Applied.
^ permalink raw reply
* [PATCH V2] PM / OPP: Use - instead of @ for DT entries
From: Rafael J. Wysocki @ 2017-04-17 16:40 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <22966574.2zMrIUgKz4@aspire.rjw.lan>
On Monday, April 17, 2017 06:35:25 PM Rafael J. Wysocki wrote:
> On Monday, April 17, 2017 11:07:51 AM Masahiro Yamada wrote:
> > 2017-04-15 7:47 GMT+09:00 Rafael J. Wysocki <rjw@rjwysocki.net>:
> > > On Monday, April 10, 2017 02:51:35 PM Viresh Kumar wrote:
> > >> Compiling the DT file with W=1, DTC warns like follows:
> > >>
> > >> Warning (unit_address_vs_reg): Node /opp_table0/opp at 1000000000 has a
> > >> unit name, but no reg property
> > >>
> > >> Fix this by replacing '@' with '-' as the OPP nodes will never have a
> > >> "reg" property.
> > >>
> > >> Reported-by: Krzysztof Kozlowski <krzk@kernel.org>
> > >> Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > >> Suggested-by: Mark Rutland <mark.rutland@arm.com>
> > >> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> > >> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> (sunxi)
> > >> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
> > >> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
> > >
> > > OK, so any ACKs from the DT side? Rob?
> > >
> > > Thanks,
> > > Rafael
> >
> >
> >
> > I see Rob's Acked-by.
> >
> > https://lkml.org/lkml/2017/4/13/648
>
> Indeed. Thanks!
But it doesn't apply on top of -rc7 for me, so I guess there is new 4.12-candidate
material in the DTS tree that conflicts with this, in which case it is better to route
it through the DTS tree IMO.
Thanks,
Rafael
^ permalink raw reply
* [PATCH V8 4/5] PCI/ASPM: save power on values during bridge init
From: Bjorn Helgaas @ 2017-04-17 16:38 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <66168dde-7719-6f74-3f06-8e4724dd2918@codeaurora.org>
On Fri, Apr 14, 2017 at 5:17 PM, Sinan Kaya <okaya@codeaurora.org> wrote:
> On 4/14/2017 5:44 PM, Bjorn Helgaas wrote:
>> I think there's an argument to be made that if we care about ASPM
>> configuration, we should be using a non-POLICY_DEFAULT setting. And I
>> think there's value in having POLICY_DEFAULT be the absolute lowest-
>> risk setting, which I think means option 1.
>>
>> What do you think?
>
> I see your point. The counter argument is that most of the users do not
> know what an ASPM kernel command line is unless they understand PCI
> language.
I don't think the answer is using the "pcie_aspm.policy=" boot
argument. I certainly don't want users to have to deal with that. I
wish we didn't even have that parameter.
I think we need runtime knobs instead (and I guess we already have
/sys/module/pcie_aspm/parameters/policy and /sys/.../link_state), and
distro userspace should use them. I'm envisioning something in
"System Settings / Power" or similar. Basically I think the policy
doesn't *have* to be dictated by a kernel boot-time parameter, so it
should not be.
> I have been using the powersave policy option until now. I recently realized
> that nobody except me is using this option. Therefore, we are wasting
> power by default following a hotplug insertion.
>
> This is the case where I'm trying to avoid. With the introduction of NVMe
> u.2 drives, hotplug is becoming more and more mainstream. I decided to
> take the matters into my hand with this series for this very reason.
>
> Like you said, BIOS is out of the picture with pciehp. There is nobody
> to configure ASPM following a hotplug insertion.
>
> I can also claim that If user wants performance, they should boot with
> the performance policy or pcie_aspm=off parameters.
>
> I saw this recommendation in multiple DPDK tuning documents.
>
> Like you said, what do we do by default is the question. Should we opt
> for safe like we are doing, or try to save some power.
I think safety is paramount. Every user should be able to boot safely
without any kernel parameters. We don't want users to have a problem
booting and then have to search for a workaround like booting with
"pcie_aspm=off". Most users will never do that.
Here's a long-term strawman proposal, see what you think:
- Deprecate CONFIG_PCIEASPM_DEFAULT, CONFIG_PCIEASPM_POWERSAVE, etc.
- Default aspm_policy is POLICY_DEFAULT always.
- POLICY_DEFAULT means Linux doesn't touch anything: if BIOS enabled
ASPM, we leave it that way; we leave ASPM disabled on hot-added
devices.
- Deprecate kernel boot parameters (possibly keep pcie_aspm=off for
debugging use).
- Use /sys/module/pcie_aspm/parameters/policy for run-time
system-wide control, including for future hot-added devices.
- Remove CONFIG_PCIEASPM_DEBUG and enable that code always, so we
have fine-grained run-time control.
> Maybe, we are missing a HPP option from the PCI spec.
That's an interesting idea. _HPX does have provision for manipulating
Link Control bits (see ACPI r5.0, sec 6.2.8.3), but I don't think very
many systems implement it. And there's currently no connection
between program_hpp_type2() and aspm.c, so I'm a little worried that
we might have issues if a system did implement an _HPX that sets any
of the ASPM bits.
Bjorn
^ permalink raw reply
* [PATCH v2 0/3] perf: xgene: Add support for SoC PMU version 3
From: Hoan Tran @ 2017-04-17 16:36 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1491238077-20666-1-git-send-email-hotran@apm.com>
Hi All,
Do you have any comments on this patch set?
Thanks
On Mon, Apr 3, 2017 at 9:47 AM, Hoan Tran <hotran@apm.com> wrote:
> This patch set adds support for SoC-wide (AKA uncore) Performance Monitoring
> Unit version 3.
>
> It can support up to
> - 2 IOB PMU instances
> - 8 L3C PMU instances
> - 2 MCB PMU instances
> - 8 MCU PMU instances
>
> v2:
> * Split into separate patches
> * Use the function pointers for the PMU leaf functions
> * Parse PMU subnode by the match table
> * Dont allow user change agent id by config1 for SoC PMU v3
>
> Hoan Tran (3):
> perf: xgene: Parse PMU subnode from the match table
> perf: xgene: Move PMU leaf functions into function pointer structure
> perf: xgene: Add support for SoC PMU version 3
>
> drivers/perf/xgene_pmu.c | 695 +++++++++++++++++++++++++++++++++++++++++------
> 1 file changed, 619 insertions(+), 76 deletions(-)
>
> --
> 1.9.1
>
^ permalink raw reply
* [PATCH V2] PM / OPP: Use - instead of @ for DT entries
From: Rafael J. Wysocki @ 2017-04-17 16:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAK7LNAQ7Uf1Jkj64-Ykdk5TSeWvkq7=BaqUMJo6KqrN7BhYvsQ@mail.gmail.com>
On Monday, April 17, 2017 11:07:51 AM Masahiro Yamada wrote:
> 2017-04-15 7:47 GMT+09:00 Rafael J. Wysocki <rjw@rjwysocki.net>:
> > On Monday, April 10, 2017 02:51:35 PM Viresh Kumar wrote:
> >> Compiling the DT file with W=1, DTC warns like follows:
> >>
> >> Warning (unit_address_vs_reg): Node /opp_table0/opp at 1000000000 has a
> >> unit name, but no reg property
> >>
> >> Fix this by replacing '@' with '-' as the OPP nodes will never have a
> >> "reg" property.
> >>
> >> Reported-by: Krzysztof Kozlowski <krzk@kernel.org>
> >> Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> >> Suggested-by: Mark Rutland <mark.rutland@arm.com>
> >> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> >> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> (sunxi)
> >> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
> >> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
> >
> > OK, so any ACKs from the DT side? Rob?
> >
> > Thanks,
> > Rafael
>
>
>
> I see Rob's Acked-by.
>
> https://lkml.org/lkml/2017/4/13/648
Indeed. Thanks!
Regards,
Rafael
^ permalink raw reply
* [PATCH] ARM: dts: BCM5301X: Add CPU thermal sensor and zone
From: Rafał Miłecki @ 2017-04-17 16:14 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAC3K-4pQNnezT7gk45DoyW5hmZ1Vqshcx-tx-bS6mOVRNUooog@mail.gmail.com>
On 17 April 2017 at 16:54, Jon Mason <jon.mason@broadcom.com> wrote:
> On Fri, Apr 14, 2017 at 5:42 PM, Rafa? Mi?ecki <zajec5@gmail.com> wrote:
>> From: Rafa? Mi?ecki <rafal@milecki.pl>
>>
>> This uses CPU thermal sensor available on every Northstar chipset to
>> monitor temperature. We don't have any cooling or throttling so only a
>> critical trip was added.
>
> Haha! You beat me to it (as I had a similar patch queued).
>
> This looks good to me.
>
> Acked-by: Jon Mason <jon.mason@broadcom.com>
:) Thanks
I'd appreciate adding thermal to NSP DT. I don't have any NSP unit to
try it on my own.
^ permalink raw reply
* [PATCH] ARM: dts: BCM5301X: Add CPU thermal sensor and zone
From: Jon Mason @ 2017-04-17 14:54 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20170414214228.32521-1-zajec5@gmail.com>
On Fri, Apr 14, 2017 at 5:42 PM, Rafa? Mi?ecki <zajec5@gmail.com> wrote:
> From: Rafa? Mi?ecki <rafal@milecki.pl>
>
> This uses CPU thermal sensor available on every Northstar chipset to
> monitor temperature. We don't have any cooling or throttling so only a
> critical trip was added.
Haha! You beat me to it (as I had a similar patch queued).
This looks good to me.
Acked-by: Jon Mason <jon.mason@broadcom.com>
>
> Signed-off-by: Rafa? Mi?ecki <rafal@milecki.pl>
> ---
> arch/arm/boot/dts/bcm5301x.dtsi | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi
> index 6a2afe7880ae..bbf39deb89f3 100644
> --- a/arch/arm/boot/dts/bcm5301x.dtsi
> +++ b/arch/arm/boot/dts/bcm5301x.dtsi
> @@ -356,6 +356,12 @@
> "sata2";
> };
>
> + thermal: thermal at 1800c2c0 {
> + compatible = "brcm,ns-thermal";
> + reg = <0x1800c2c0 0x10>;
> + #thermal-sensor-cells = <0>;
> + };
> +
> srab: srab at 18007000 {
> compatible = "brcm,bcm5301x-srab";
> reg = <0x18007000 0x1000>;
> @@ -419,4 +425,24 @@
> status = "disabled";
> };
> };
> +
> + thermal-zones {
> + cpu_thermal: cpu-thermal {
> + polling-delay-passive = <0>;
> + polling-delay = <1000>;
> + coefficients = <(-556) 418000>;
> + thermal-sensors = <&thermal>;
> +
> + trips {
> + cpu-crit {
> + temperature = <125000>;
> + hysteresis = <0>;
> + type = "critical";
> + };
> + };
> +
> + cooling-maps {
> + };
> + };
> + };
> };
> --
> 2.11.0
>
^ permalink raw reply
* [PATCH v2 7/7] clk: spear: fix ADC clock definition on SPEAr600
From: Thomas Petazzoni @ 2017-04-17 12:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1492433205-13376-1-git-send-email-thomas.petazzoni@free-electrons.com>
There is no SPEAr600 device named "adc". Instead, the description of the
ADC was recently added to the Device Tree, and the device name is
"d820b000.adc", so we should associate the ADC gatable clock to this
device name.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/clk/spear/spear6xx_clock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/spear/spear6xx_clock.c b/drivers/clk/spear/spear6xx_clock.c
index 7c9383c..f911d9f 100644
--- a/drivers/clk/spear/spear6xx_clock.c
+++ b/drivers/clk/spear/spear6xx_clock.c
@@ -313,7 +313,7 @@ void __init spear6xx_clk_init(void __iomem *misc_base)
/* clock derived from apb clk */
clk = clk_register_gate(NULL, "adc_clk", "apb_clk", 0, PERIP1_CLK_ENB,
ADC_CLK_ENB, 0, &_lock);
- clk_register_clkdev(clk, NULL, "adc");
+ clk_register_clkdev(clk, NULL, "d820b000.adc");
clk = clk_register_fixed_factor(NULL, "gpio0_clk", "apb_clk", 0, 1, 1);
clk_register_clkdev(clk, NULL, "f0100000.gpio");
--
2.7.4
^ permalink raw reply related
* [PATCH v2 6/7] arm: spear6xx: add DT description of the ADC on SPEAr600
From: Thomas Petazzoni @ 2017-04-17 12:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1492433205-13376-1-git-send-email-thomas.petazzoni@free-electrons.com>
The SPEAr600 has a built-in ADC, which already has a Device Tree binding
described in
Documentation/devicetree/bindings/staging/iio/adc/spear-adc.txt. This
commit adds the description in the SPEAr600 Device Tree of this ADC
device.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
arch/arm/boot/dts/spear600.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/spear600.dtsi b/arch/arm/boot/dts/spear600.dtsi
index 8459286..6b32d20 100644
--- a/arch/arm/boot/dts/spear600.dtsi
+++ b/arch/arm/boot/dts/spear600.dtsi
@@ -204,6 +204,14 @@
interrupt-parent = <&vic0>;
interrupts = <16>;
};
+
+ adc: adc at d820b000 {
+ compatible = "st,spear600-adc";
+ reg = <0xd820b000 0x1000>;
+ interrupt-parent = <&vic1>;
+ interrupts = <6>;
+ status = "disabled";
+ };
};
};
};
--
2.7.4
^ permalink raw reply related
* [PATCH v2 5/7] arm: spear6xx: remove unneeded pinctrl properties in spear600-evb
From: Thomas Petazzoni @ 2017-04-17 12:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1492433205-13376-1-git-send-email-thomas.petazzoni@free-electrons.com>
The spear6xx doesn't have a pinctrl driver, since the pinmux is globally
defined through a single register, generally configured by the
firmware/bootloader.
Therefore, the pinctrl related properties in spear600-evb.dts are not
necessary.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
arch/arm/boot/dts/spear600-evb.dts | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/arm/boot/dts/spear600-evb.dts b/arch/arm/boot/dts/spear600-evb.dts
index f36603f..c67e76c 100644
--- a/arch/arm/boot/dts/spear600-evb.dts
+++ b/arch/arm/boot/dts/spear600-evb.dts
@@ -96,14 +96,10 @@
&uart0 {
status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <>;
};
&uart1 {
status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <>;
};
&rtc {
--
2.7.4
^ permalink raw reply related
* [PATCH v2 4/7] arm: spear6xx: switch spear600-evb to the new flash partition DT binding
From: Thomas Petazzoni @ 2017-04-17 12:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1492433205-13376-1-git-send-email-thomas.petazzoni@free-electrons.com>
This commit moves spear600-evb.dts to use the new flash partition Device
Tree binding documented in
Documentation/devicetree/bindings/mtd/partition.txt.
As this Device Tree binding document says: "For backwards compatibility
partitions as direct subnodes of the mtd device are supported. This use
is discouraged."
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
arch/arm/boot/dts/spear600-evb.dts | 54 ++++++++++++++++++++------------------
1 file changed, 29 insertions(+), 25 deletions(-)
diff --git a/arch/arm/boot/dts/spear600-evb.dts b/arch/arm/boot/dts/spear600-evb.dts
index 32a44b6..f36603f 100644
--- a/arch/arm/boot/dts/spear600-evb.dts
+++ b/arch/arm/boot/dts/spear600-evb.dts
@@ -58,34 +58,38 @@
clock-rate = <50000000>;
flash at f8000000 {
- #address-cells = <1>;
- #size-cells = <1>;
reg = <0xf8000000 0x800000>;
st,smi-fast-mode;
- partition at 0 {
- label = "xloader";
- reg = <0x0 0x10000>;
- };
- partition at 10000 {
- label = "u-boot";
- reg = <0x10000 0x50000>;
- };
- partition at 60000 {
- label = "environment";
- reg = <0x60000 0x10000>;
- };
- partition at 70000 {
- label = "dtb";
- reg = <0x70000 0x10000>;
- };
- partition at 80000 {
- label = "linux";
- reg = <0x80000 0x310000>;
- };
- partition at 390000 {
- label = "rootfs";
- reg = <0x390000 0x0>;
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition at 0 {
+ label = "xloader";
+ reg = <0x0 0x10000>;
+ };
+ partition at 10000 {
+ label = "u-boot";
+ reg = <0x10000 0x50000>;
+ };
+ partition at 60000 {
+ label = "environment";
+ reg = <0x60000 0x10000>;
+ };
+ partition at 70000 {
+ label = "dtb";
+ reg = <0x70000 0x10000>;
+ };
+ partition at 80000 {
+ label = "linux";
+ reg = <0x80000 0x310000>;
+ };
+ partition at 390000 {
+ label = "rootfs";
+ reg = <0x390000 0x0>;
+ };
};
};
};
--
2.7.4
^ permalink raw reply related
* [PATCH v2 3/7] arm: spear6xx: fix spaces in spear600-evb.dts
From: Thomas Petazzoni @ 2017-04-17 12:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1492433205-13376-1-git-send-email-thomas.petazzoni@free-electrons.com>
This commit fixes a minor coding style issue in spear600-evb.dts:
missing spaces around equal sign.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
arch/arm/boot/dts/spear600-evb.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/spear600-evb.dts b/arch/arm/boot/dts/spear600-evb.dts
index 375eb61..32a44b6 100644
--- a/arch/arm/boot/dts/spear600-evb.dts
+++ b/arch/arm/boot/dts/spear600-evb.dts
@@ -55,7 +55,7 @@
&smi {
status = "okay";
- clock-rate=<50000000>;
+ clock-rate = <50000000>;
flash at f8000000 {
#address-cells = <1>;
--
2.7.4
^ permalink raw reply related
* [PATCH v2 2/7] arm: spear6xx: use node labels in spear600-evb.dts
From: Thomas Petazzoni @ 2017-04-17 12:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1492433205-13376-1-git-send-email-thomas.petazzoni@free-electrons.com>
Now that we have introduced node labels in spear600.dtsi, we can use
them for spear600-evb.dts.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
arch/arm/boot/dts/spear600-evb.dts | 156 ++++++++++++++++++-------------------
1 file changed, 76 insertions(+), 80 deletions(-)
diff --git a/arch/arm/boot/dts/spear600-evb.dts b/arch/arm/boot/dts/spear600-evb.dts
index d865a89..375eb61 100644
--- a/arch/arm/boot/dts/spear600-evb.dts
+++ b/arch/arm/boot/dts/spear600-evb.dts
@@ -22,95 +22,91 @@
device_type = "memory";
reg = <0 0x10000000>;
};
+};
- ahb {
- clcd at fc200000 {
- status = "okay";
- };
+&clcd {
+ status = "okay";
+};
- dma at fc400000 {
- status = "okay";
- };
+&dmac {
+ status = "okay";
+};
- ehci at e1800000 {
- status = "okay";
- };
+&ehci_usb0 {
+ status = "okay";
+};
- ehci at e2000000 {
- status = "okay";
- };
+&ehci_usb1 {
+ status = "okay";
+};
- gmac: ethernet at e0800000 {
- phy-mode = "gmii";
- status = "okay";
- };
+&gmac {
+ phy-mode = "gmii";
+ status = "okay";
+};
- ohci at e1900000 {
- status = "okay";
- };
+&ohci_usb0 {
+ status = "okay";
+};
- ohci at e2100000 {
- status = "okay";
- };
+&ohci_usb1 {
+ status = "okay";
+};
- smi: flash at fc000000 {
- status = "okay";
- clock-rate=<50000000>;
-
- flash at f8000000 {
- #address-cells = <1>;
- #size-cells = <1>;
- reg = <0xf8000000 0x800000>;
- st,smi-fast-mode;
-
- partition at 0 {
- label = "xloader";
- reg = <0x0 0x10000>;
- };
- partition at 10000 {
- label = "u-boot";
- reg = <0x10000 0x50000>;
- };
- partition at 60000 {
- label = "environment";
- reg = <0x60000 0x10000>;
- };
- partition at 70000 {
- label = "dtb";
- reg = <0x70000 0x10000>;
- };
- partition at 80000 {
- label = "linux";
- reg = <0x80000 0x310000>;
- };
- partition at 390000 {
- label = "rootfs";
- reg = <0x390000 0x0>;
- };
- };
- };
+&smi {
+ status = "okay";
+ clock-rate=<50000000>;
+
+ flash at f8000000 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ reg = <0xf8000000 0x800000>;
+ st,smi-fast-mode;
- apb {
- serial at d0000000 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <>;
- };
-
- serial at d0080000 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <>;
- };
-
- rtc at fc900000 {
- status = "okay";
- };
-
- i2c at d0200000 {
- clock-frequency = <400000>;
- status = "okay";
- };
+ partition at 0 {
+ label = "xloader";
+ reg = <0x0 0x10000>;
+ };
+ partition at 10000 {
+ label = "u-boot";
+ reg = <0x10000 0x50000>;
+ };
+ partition at 60000 {
+ label = "environment";
+ reg = <0x60000 0x10000>;
+ };
+ partition at 70000 {
+ label = "dtb";
+ reg = <0x70000 0x10000>;
+ };
+ partition at 80000 {
+ label = "linux";
+ reg = <0x80000 0x310000>;
+ };
+ partition at 390000 {
+ label = "rootfs";
+ reg = <0x390000 0x0>;
};
};
};
+
+&uart0 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <>;
+};
+
+&uart1 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <>;
+};
+
+&rtc {
+ status = "okay";
+};
+
+&i2c {
+ clock-frequency = <400000>;
+ status = "okay";
+};
--
2.7.4
^ permalink raw reply related
* [PATCH v2 1/7] arm: spear6xx: add labels to various nodes in spear600.dtsi
From: Thomas Petazzoni @ 2017-04-17 12:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1492433205-13376-1-git-send-email-thomas.petazzoni@free-electrons.com>
Having labels allows to more easily reference nodes in .dts files
including spear600.dtsi.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
arch/arm/boot/dts/spear600.dtsi | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/arm/boot/dts/spear600.dtsi b/arch/arm/boot/dts/spear600.dtsi
index 9f60a7b..8459286 100644
--- a/arch/arm/boot/dts/spear600.dtsi
+++ b/arch/arm/boot/dts/spear600.dtsi
@@ -49,7 +49,7 @@
#interrupt-cells = <1>;
};
- clcd at fc200000 {
+ clcd: clcd at fc200000 {
compatible = "arm,pl110", "arm,primecell";
reg = <0xfc200000 0x1000>;
interrupt-parent = <&vic1>;
@@ -57,7 +57,7 @@
status = "disabled";
};
- dma at fc400000 {
+ dmac: dma at fc400000 {
compatible = "arm,pl080", "arm,primecell";
reg = <0xfc400000 0x1000>;
interrupt-parent = <&vic1>;
@@ -97,7 +97,7 @@
status = "disabled";
};
- ehci at e1800000 {
+ ehci_usb0: ehci at e1800000 {
compatible = "st,spear600-ehci", "usb-ehci";
reg = <0xe1800000 0x1000>;
interrupt-parent = <&vic1>;
@@ -105,7 +105,7 @@
status = "disabled";
};
- ehci at e2000000 {
+ ehci_usb1: ehci at e2000000 {
compatible = "st,spear600-ehci", "usb-ehci";
reg = <0xe2000000 0x1000>;
interrupt-parent = <&vic1>;
@@ -113,7 +113,7 @@
status = "disabled";
};
- ohci at e1900000 {
+ ohci_usb0: ohci at e1900000 {
compatible = "st,spear600-ohci", "usb-ohci";
reg = <0xe1900000 0x1000>;
interrupt-parent = <&vic1>;
@@ -121,7 +121,7 @@
status = "disabled";
};
- ohci at e2100000 {
+ ohci_usb1: ohci at e2100000 {
compatible = "st,spear600-ohci", "usb-ohci";
reg = <0xe2100000 0x1000>;
interrupt-parent = <&vic1>;
@@ -135,7 +135,7 @@
compatible = "simple-bus";
ranges = <0xd0000000 0xd0000000 0x30000000>;
- serial at d0000000 {
+ uart0: serial at d0000000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0xd0000000 0x1000>;
interrupt-parent = <&vic0>;
@@ -143,7 +143,7 @@
status = "disabled";
};
- serial at d0080000 {
+ uart1: serial at d0080000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0xd0080000 0x1000>;
interrupt-parent = <&vic0>;
@@ -181,7 +181,7 @@
interrupts = <4>;
};
- i2c at d0200000 {
+ i2c: i2c at d0200000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "snps,designware-i2c";
@@ -191,7 +191,7 @@
status = "disabled";
};
- rtc at fc900000 {
+ rtc: rtc at fc900000 {
compatible = "st,spear600-rtc";
reg = <0xfc900000 0x1000>;
interrupts = <10>;
--
2.7.4
^ permalink raw reply related
* [PATCH v2 0/7] ARM: SPEAr600 updates
From: Thomas Petazzoni @ 2017-04-17 12:46 UTC (permalink / raw)
To: linux-arm-kernel
Arnd, Olof, Mike, Stephen,
Here are a set of patches touching the support of the SPEAr600
platform, for which the platform maintained Viresh Kumar has Acked the
patches, but would like the arm-soc and clk maintainers to pick up the
patches directly, see
http://lists.infradead.org/pipermail/linux-arm-kernel/2017-April/501653.html.
Arnd, Olof, could you pick patches 1 to 6 directly in your arm-soc tree ?
Mike, Stephen, could you pick patch 7 directly in your clk tree ?
Thanks a lot,
Thomas Petazzoni
Thomas Petazzoni (7):
arm: spear6xx: add labels to various nodes in spear600.dtsi
arm: spear6xx: use node labels in spear600-evb.dts
arm: spear6xx: fix spaces in spear600-evb.dts
arm: spear6xx: switch spear600-evb to the new flash partition DT
binding
arm: spear6xx: remove unneeded pinctrl properties in spear600-evb
arm: spear6xx: add DT description of the ADC on SPEAr600
clk: spear: fix ADC clock definition on SPEAr600
arch/arm/boot/dts/spear600-evb.dts | 148 ++++++++++++++++++-------------------
arch/arm/boot/dts/spear600.dtsi | 28 ++++---
drivers/clk/spear/spear6xx_clock.c | 2 +-
3 files changed, 91 insertions(+), 87 deletions(-)
--
2.7.4
^ permalink raw reply
* [PATCH v3 12/12] arm64: allwinner: a64: enable Wi-Fi for Pine64
From: Icenowy Zheng @ 2017-04-17 11:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20170417115747.7300-1-icenowy@aosc.io>
The Wi-Fi module of Pine64 is powered via DLDO4 and ELDO1 (the latter
one provides I/O voltage).
Add device node for it.
Although the Wi-Fi module is an external module which should be inserted
to a header, according to my personal talk with TL Lim, he does not want
this header to be used as GPIO (so it's with 2.0mm pitch, not 2.54mm as
other GPIO headers).
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
Changes in v3:
- Added explaination on 2.0mm pitch.
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
index 7da074f95065..9d90bb32aa87 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
@@ -64,6 +64,11 @@
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};
+
+ wifi_pwrseq: wifi_pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
+ };
};
&ehci1 {
@@ -91,6 +96,17 @@
status = "okay";
};
+&mmc1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc1_pins>;
+ vmmc-supply = <®_dldo4>;
+ vqmmc-supply = <®_eldo1>;
+ mmc-pwrseq = <&wifi_pwrseq>;
+ non-removable;
+ bus-width = <4>;
+ status = "okay";
+};
+
&ohci1 {
status = "okay";
};
--
2.12.2
^ permalink raw reply related
* [PATCH v3 11/12] arm64: allwinner: a64: enable AXP803 regulators for Pine64
From: Icenowy Zheng @ 2017-04-17 11:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20170417115747.7300-1-icenowy@aosc.io>
Add support of AXP803 regulators in the Pine64 device tree, in order to
enable many future functionalities, e.g. Wi-Fi.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
.../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 109 +++++++++++++++++++++
1 file changed, 109 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
index 2132d8e6cb3d..7da074f95065 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
@@ -106,6 +106,115 @@
};
};
+#include "axp803.dtsi"
+
+®_aldo1 {
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-name = "vcc-csi";
+};
+
+®_aldo2 {
+ regulator-always-on;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-pl";
+};
+
+®_aldo3 {
+ regulator-always-on;
+ regulator-min-microvolt = <2700000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-pll-avcc";
+};
+
+®_dc1sw {
+ regulator-name = "vcc-phy";
+};
+
+®_dcdc1 {
+ regulator-always-on;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-3v3";
+};
+
+®_dcdc2 {
+ regulator-always-on;
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1300000>;
+ regulator-name = "vdd-cpux";
+};
+
+/* DCDC3 is polyphased with DCDC2 */
+
+®_dcdc5 {
+ regulator-always-on;
+ regulator-min-microvolt = <1500000>;
+ regulator-max-microvolt = <1500000>;
+ regulator-name = "vcc-dram";
+};
+
+®_dcdc6 {
+ regulator-always-on;
+ regulator-min-microvolt = <1100000>;
+ regulator-max-microvolt = <1100000>;
+ regulator-name = "vdd-sys";
+};
+
+®_dldo1 {
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-hdmi";
+};
+
+®_dldo2 {
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-mipi";
+};
+
+®_dldo3 {
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "avdd-csi";
+};
+
+®_dldo4 {
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-wifi";
+};
+
+®_eldo1 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-name = "cpvdd";
+};
+
+®_eldo3 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-name = "vdd-1v8-csi";
+};
+
+®_fldo1 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-name = "vcc-1v2-hsic";
+};
+
+®_fldo2 {
+ regulator-always-on;
+ regulator-min-microvolt = <1100000>;
+ regulator-max-microvolt = <1100000>;
+ regulator-name = "vdd-cpus";
+};
+
+®_rtc_ldo {
+ regulator-name = "vcc-rtc";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pins_a>;
--
2.12.2
^ permalink raw reply related
* [PATCH v3 10/12] arm64: allwinner: a64: add DTSI file for AXP803 PMIC
From: Icenowy Zheng @ 2017-04-17 11:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20170417115747.7300-1-icenowy@aosc.io>
As nearly all A64 boards are using AXP803 PMIC, add a DTSI file for it,
like the old DTSI files for AXP20x/22x, for the common parts of the
PMIC.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
arch/arm64/boot/dts/allwinner/axp803.dtsi | 150 ++++++++++++++++++++++++++++++
1 file changed, 150 insertions(+)
create mode 100644 arch/arm64/boot/dts/allwinner/axp803.dtsi
diff --git a/arch/arm64/boot/dts/allwinner/axp803.dtsi b/arch/arm64/boot/dts/allwinner/axp803.dtsi
new file mode 100644
index 000000000000..f0e53a7fffbd
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/axp803.dtsi
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2017 Icenowy Zheng <icenowy@aosc.xyz>
+ *
+ * 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 "AS IS", 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.
+ */
+
+/*
+ * AXP803 Integrated Power Management Chip
+ * http://files.pine64.org/doc/datasheet/pine64/AXP803_Datasheet_V1.0.pdf
+ */
+
+&axp803 {
+ interrupt-controller;
+ #interrupt-cells = <1>;
+
+ regulators {
+ /* Default work frequency for buck regulators */
+ x-powers,dcdc-freq = <3000>;
+
+ reg_dcdc1: dcdc1 {
+ regulator-name = "dcdc1";
+ };
+
+ reg_dcdc2: dcdc2 {
+ regulator-name = "dcdc2";
+ };
+
+ reg_dcdc3: dcdc3 {
+ regulator-name = "dcdc3";
+ };
+
+ reg_dcdc4: dcdc4 {
+ regulator-name = "dcdc4";
+ };
+
+ reg_dcdc5: dcdc5 {
+ regulator-name = "dcdc5";
+ };
+
+ reg_dcdc6: dcdc6 {
+ regulator-name = "dcdc6";
+ };
+
+ reg_dc1sw: dc1sw {
+ regulator-name = "dc1sw";
+ };
+
+ reg_aldo1: aldo1 {
+ regulator-name = "aldo1";
+ };
+
+ reg_aldo2: aldo2 {
+ regulator-name = "aldo2";
+ };
+
+ reg_aldo3: aldo3 {
+ regulator-name = "aldo3";
+ };
+
+ reg_dldo1: dldo1 {
+ regulator-name = "dldo1";
+ };
+
+ reg_dldo2: dldo2 {
+ regulator-name = "dldo2";
+ };
+
+ reg_dldo3: dldo3 {
+ regulator-name = "dldo3";
+ };
+
+ reg_dldo4: dldo4 {
+ regulator-name = "dldo4";
+ };
+
+ reg_eldo1: eldo1 {
+ regulator-name = "eldo1";
+ };
+
+ reg_eldo2: eldo2 {
+ regulator-name = "eldo2";
+ };
+
+ reg_eldo3: eldo3 {
+ regulator-name = "eldo3";
+ };
+
+ reg_fldo1: fldo1 {
+ regulator-name = "fldo1";
+ };
+
+ reg_fldo2: fldo2 {
+ regulator-name = "fldo2";
+ };
+
+ reg_ldo_io0: ldo_io0 {
+ regulator-name = "ldo_io0";
+ status = "disabled";
+ };
+
+ reg_ldo_io1: ldo_io1 {
+ regulator-name = "ldo_io1";
+ status = "disabled";
+ };
+
+ reg_rtc_ldo: rtc_ldo {
+ /* RTC_LDO is a fixed, always-on regulator */
+ regulator-always-on;
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3000000>;
+ regulator-name = "rtc_ldo";
+ };
+ };
+};
--
2.12.2
^ permalink raw reply related
* [PATCH v3 09/12] mfd: axp20x: add axp20x-regulator cell for AXP803
From: Icenowy Zheng @ 2017-04-17 11:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20170417115747.7300-1-icenowy@aosc.io>
As axp20x-regulator now supports AXP803, add a cell for it.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
Changes in v3:
- Make the new cell one-liner.
drivers/mfd/axp20x.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index 1dc6235778eb..431b7f118606 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -848,7 +848,8 @@ static struct mfd_cell axp803_cells[] = {
.name = "axp20x-pek",
.num_resources = ARRAY_SIZE(axp803_pek_resources),
.resources = axp803_pek_resources,
- }
+ },
+ { .name = "axp20x-regulator" }
};
static struct mfd_cell axp806_cells[] = {
--
2.12.2
^ permalink raw reply related
* [PATCH v3 08/12] regulator: axp20x-regulator: add support for AXP803
From: Icenowy Zheng @ 2017-04-17 11:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20170417115747.7300-1-icenowy@aosc.io>
AXP803 PMIC also have a series of regulators (DCDCs and LDOs)
controllable via I2C/RSB bus.
Add support for them.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
Changes in v2:
- Place AXP803 codes before AXP806/809 ones.
- Fixed some errors in regulator description.
- Reuse AXP803 DLDO2 range for AXP806 CLDO2 & AXP809 DLDO1.
drivers/regulator/axp20x-regulator.c | 153 ++++++++++++++++++++++++++++++-----
include/linux/mfd/axp20x.h | 37 +++++++++
2 files changed, 168 insertions(+), 22 deletions(-)
diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index 0b9d4e3e52c7..2ed15e4a7a82 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -244,6 +244,82 @@ static const struct regulator_desc axp22x_drivevbus_regulator = {
.ops = &axp20x_ops_sw,
};
+static const struct regulator_linear_range axp803_dcdc234_ranges[] = {
+ REGULATOR_LINEAR_RANGE(500000, 0x0, 0x46, 10000),
+ REGULATOR_LINEAR_RANGE(1220000, 0x47, 0x4b, 20000),
+};
+
+static const struct regulator_linear_range axp803_dcdc5_ranges[] = {
+ REGULATOR_LINEAR_RANGE(800000, 0x0, 0x20, 10000),
+ REGULATOR_LINEAR_RANGE(1140000, 0x21, 0x44, 20000),
+};
+
+static const struct regulator_linear_range axp803_dcdc6_ranges[] = {
+ REGULATOR_LINEAR_RANGE(600000, 0x0, 0x32, 10000),
+ REGULATOR_LINEAR_RANGE(1120000, 0x33, 0x47, 20000),
+};
+
+/* AXP806's CLDO2 and AXP809's DLDO1 shares the same range */
+static const struct regulator_linear_range axp803_dldo2_ranges[] = {
+ REGULATOR_LINEAR_RANGE(700000, 0x0, 0x1a, 100000),
+ REGULATOR_LINEAR_RANGE(3400000, 0x1b, 0x1f, 200000),
+};
+
+static const struct regulator_desc axp803_regulators[] = {
+ AXP_DESC(AXP803, DCDC1, "dcdc1", "vin1", 1600, 3400, 100,
+ AXP803_DCDC1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(0)),
+ AXP_DESC_RANGES(AXP803, DCDC2, "dcdc2", "vin2", axp803_dcdc234_ranges,
+ 76, AXP803_DCDC2_V_OUT, 0x7f, AXP22X_PWR_OUT_CTRL1,
+ BIT(1)),
+ AXP_DESC_RANGES(AXP803, DCDC3, "dcdc3", "vin3", axp803_dcdc234_ranges,
+ 76, AXP803_DCDC3_V_OUT, 0x7f, AXP22X_PWR_OUT_CTRL1,
+ BIT(2)),
+ AXP_DESC_RANGES(AXP803, DCDC4, "dcdc4", "vin4", axp803_dcdc234_ranges,
+ 76, AXP803_DCDC4_V_OUT, 0x7f, AXP22X_PWR_OUT_CTRL1,
+ BIT(3)),
+ AXP_DESC_RANGES(AXP803, DCDC5, "dcdc5", "vin5", axp803_dcdc5_ranges,
+ 68, AXP803_DCDC5_V_OUT, 0x7f, AXP22X_PWR_OUT_CTRL1,
+ BIT(4)),
+ AXP_DESC_RANGES(AXP803, DCDC6, "dcdc6", "vin6", axp803_dcdc6_ranges,
+ 72, AXP803_DCDC6_V_OUT, 0x7f, AXP22X_PWR_OUT_CTRL1,
+ BIT(5)),
+ /* secondary switchable output of DCDC1 */
+ AXP_DESC_SW(AXP803, DC1SW, "dc1sw", NULL, AXP22X_PWR_OUT_CTRL2,
+ BIT(7)),
+ AXP_DESC(AXP803, ALDO1, "aldo1", "aldoin", 700, 3300, 100,
+ AXP22X_ALDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL3, BIT(5)),
+ AXP_DESC(AXP803, ALDO2, "aldo2", "aldoin", 700, 3300, 100,
+ AXP22X_ALDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL3, BIT(6)),
+ AXP_DESC(AXP803, ALDO3, "aldo3", "aldoin", 700, 3300, 100,
+ AXP22X_ALDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL3, BIT(7)),
+ AXP_DESC(AXP803, DLDO1, "dldo1", "dldoin", 700, 3300, 100,
+ AXP22X_DLDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(3)),
+ AXP_DESC_RANGES(AXP803, DLDO2, "dldo2", "dldoin", axp803_dldo2_ranges,
+ 32, AXP22X_DLDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2,
+ BIT(4)),
+ AXP_DESC(AXP803, DLDO3, "dldo3", "dldoin", 700, 3300, 100,
+ AXP22X_DLDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(5)),
+ AXP_DESC(AXP803, DLDO4, "dldo4", "dldoin", 700, 3300, 100,
+ AXP22X_DLDO4_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(6)),
+ AXP_DESC(AXP803, ELDO1, "eldo1", "eldoin", 700, 1900, 50,
+ AXP22X_ELDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(0)),
+ AXP_DESC(AXP803, ELDO2, "eldo2", "eldoin", 700, 1900, 50,
+ AXP22X_ELDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(1)),
+ AXP_DESC(AXP803, ELDO3, "eldo3", "eldoin", 700, 1900, 50,
+ AXP22X_ELDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(2)),
+ AXP_DESC(AXP803, FLDO1, "fldo1", "fldoin", 700, 1450, 50,
+ AXP803_FLDO1_V_OUT, 0x0f, AXP22X_PWR_OUT_CTRL3, BIT(2)),
+ AXP_DESC(AXP803, FLDO2, "fldo2", "fldoin", 700, 1450, 50,
+ AXP803_FLDO2_V_OUT, 0x0f, AXP22X_PWR_OUT_CTRL3, BIT(3)),
+ AXP_DESC_IO(AXP803, LDO_IO0, "ldo_io0", "ips", 700, 3300, 100,
+ AXP22X_LDO_IO0_V_OUT, 0x1f, AXP20X_GPIO0_CTRL, 0x07,
+ AXP22X_IO_ENABLED, AXP22X_IO_DISABLED),
+ AXP_DESC_IO(AXP803, LDO_IO1, "ldo_io1", "ips", 700, 3300, 100,
+ AXP22X_LDO_IO1_V_OUT, 0x1f, AXP20X_GPIO1_CTRL, 0x07,
+ AXP22X_IO_ENABLED, AXP22X_IO_DISABLED),
+ AXP_DESC_FIXED(AXP803, RTC_LDO, "rtc_ldo", "ips", 3000),
+};
+
static const struct regulator_linear_range axp806_dcdca_ranges[] = {
REGULATOR_LINEAR_RANGE(600000, 0x0, 0x32, 10000),
REGULATOR_LINEAR_RANGE(1120000, 0x33, 0x47, 20000),
@@ -254,11 +330,6 @@ static const struct regulator_linear_range axp806_dcdcd_ranges[] = {
REGULATOR_LINEAR_RANGE(1600000, 0x2e, 0x3f, 100000),
};
-static const struct regulator_linear_range axp806_cldo2_ranges[] = {
- REGULATOR_LINEAR_RANGE(700000, 0x0, 0x1a, 100000),
- REGULATOR_LINEAR_RANGE(3400000, 0x1b, 0x1f, 200000),
-};
-
static const struct regulator_desc axp806_regulators[] = {
AXP_DESC_RANGES(AXP806, DCDCA, "dcdca", "vina", axp806_dcdca_ranges,
72, AXP806_DCDCA_V_CTRL, 0x7f, AXP806_PWR_OUT_CTRL1,
@@ -289,7 +360,7 @@ static const struct regulator_desc axp806_regulators[] = {
AXP806_BLDO4_V_CTRL, 0x0f, AXP806_PWR_OUT_CTRL2, BIT(3)),
AXP_DESC(AXP806, CLDO1, "cldo1", "cldoin", 700, 3300, 100,
AXP806_CLDO1_V_CTRL, 0x1f, AXP806_PWR_OUT_CTRL2, BIT(4)),
- AXP_DESC_RANGES(AXP806, CLDO2, "cldo2", "cldoin", axp806_cldo2_ranges,
+ AXP_DESC_RANGES(AXP806, CLDO2, "cldo2", "cldoin", axp803_dldo2_ranges,
32, AXP806_CLDO2_V_CTRL, 0x1f, AXP806_PWR_OUT_CTRL2,
BIT(5)),
AXP_DESC(AXP806, CLDO3, "cldo3", "cldoin", 700, 3300, 100,
@@ -326,7 +397,7 @@ static const struct regulator_desc axp809_regulators[] = {
AXP22X_ALDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(7)),
AXP_DESC(AXP809, ALDO3, "aldo3", "aldoin", 700, 3300, 100,
AXP22X_ALDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(5)),
- AXP_DESC_RANGES(AXP809, DLDO1, "dldo1", "dldoin", axp806_cldo2_ranges,
+ AXP_DESC_RANGES(AXP809, DLDO1, "dldo1", "dldoin", axp803_dldo2_ranges,
32, AXP22X_DLDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2,
BIT(3)),
AXP_DESC(AXP809, DLDO2, "dldo2", "dldoin", 700, 3300, 100,
@@ -369,14 +440,21 @@ static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
def = 1500;
step = 75;
break;
- case AXP806_ID:
+ case AXP803_ID:
/*
- * AXP806 DCDC work frequency setting has the same range and
+ * AXP803 DCDC work frequency setting has the same range and
* step as AXP22X, but at a different register.
* Fall through to the check below.
* (See include/linux/mfd/axp20x.h)
*/
- reg = AXP806_DCDC_FREQ_CTRL;
+ reg = AXP803_DCDC_FREQ_CTRL;
+ case AXP806_ID:
+ /*
+ * AXP806 also have DCDC work frequency setting register at a
+ * different position.
+ */
+ if (axp20x->variant == AXP806_ID)
+ reg = AXP806_DCDC_FREQ_CTRL;
case AXP221_ID:
case AXP223_ID:
case AXP809_ID:
@@ -475,6 +553,14 @@ static int axp20x_set_dcdc_workmode(struct regulator_dev *rdev, int id, u32 work
workmode <<= id - AXP22X_DCDC1;
break;
+ case AXP803_ID:
+ if (id < AXP803_DCDC1 || id > AXP803_DCDC6)
+ return -EINVAL;
+
+ mask = AXP22X_WORKMODE_DCDCX_MASK(id - AXP803_DCDC1);
+ workmode <<= id - AXP803_DCDC1;
+ break;
+
default:
/* should not happen */
WARN_ON(1);
@@ -492,20 +578,38 @@ static bool axp20x_is_polyphase_slave(struct axp20x_dev *axp20x, int id)
{
u32 reg = 0;
- /* Only AXP806 has poly-phase outputs */
- if (axp20x->variant != AXP806_ID)
- return false;
+ /*
+ * Currently in our supported AXP variants, only AXP806 and AXP803
+ * have polyphase regulators.
+ */
+ switch (axp20x->variant) {
+ case AXP803_ID:
+ regmap_read(axp20x->regmap, AXP803_POLYPHASE_CTRL, ®);
+
+ switch (id) {
+ case AXP803_DCDC3:
+ return !!(reg & BIT(6));
+ case AXP803_DCDC6:
+ return !!(reg & BIT(7));
+ }
+ break;
- regmap_read(axp20x->regmap, AXP806_DCDC_MODE_CTRL2, ®);
+ case AXP806_ID:
+ regmap_read(axp20x->regmap, AXP806_DCDC_MODE_CTRL2, ®);
+
+ switch (id) {
+ case AXP806_DCDCB:
+ return (((reg & GENMASK(7, 6)) == BIT(6)) ||
+ ((reg & GENMASK(7, 6)) == BIT(7)));
+ case AXP806_DCDCC:
+ return ((reg & GENMASK(7, 6)) == BIT(7));
+ case AXP806_DCDCE:
+ return !!(reg & BIT(5));
+ }
+ break;
- switch (id) {
- case AXP806_DCDCB:
- return (((reg & GENMASK(7, 6)) == BIT(6)) ||
- ((reg & GENMASK(7, 6)) == BIT(7)));
- case AXP806_DCDCC:
- return ((reg & GENMASK(7, 6)) == BIT(7));
- case AXP806_DCDCE:
- return !!(reg & BIT(5));
+ default:
+ return false;
}
return false;
@@ -540,6 +644,10 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
drivevbus = of_property_read_bool(pdev->dev.parent->of_node,
"x-powers,drive-vbus-en");
break;
+ case AXP803_ID:
+ regulators = axp803_regulators;
+ nregulators = AXP803_REG_ID_MAX;
+ break;
case AXP806_ID:
regulators = axp806_regulators;
nregulators = AXP806_REG_ID_MAX;
@@ -579,6 +687,7 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
* name.
*/
if ((regulators == axp22x_regulators && i == AXP22X_DC1SW) ||
+ (regulators == axp803_regulators && i == AXP803_DC1SW) ||
(regulators == axp809_regulators && i == AXP809_DC1SW)) {
new_desc = devm_kzalloc(&pdev->dev, sizeof(*desc),
GFP_KERNEL);
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
index cde56cfe8446..965b027e31b3 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
@@ -119,6 +119,17 @@ enum axp20x_variants {
#define AXP806_BUS_ADDR_EXT 0xfe
#define AXP806_REG_ADDR_EXT 0xff
+#define AXP803_POLYPHASE_CTRL 0x14
+#define AXP803_FLDO1_V_OUT 0x1c
+#define AXP803_FLDO2_V_OUT 0x1d
+#define AXP803_DCDC1_V_OUT 0x20
+#define AXP803_DCDC2_V_OUT 0x21
+#define AXP803_DCDC3_V_OUT 0x22
+#define AXP803_DCDC4_V_OUT 0x23
+#define AXP803_DCDC5_V_OUT 0x24
+#define AXP803_DCDC6_V_OUT 0x25
+#define AXP803_DCDC_FREQ_CTRL 0x3b
+
/* Interrupt */
#define AXP152_IRQ1_EN 0x40
#define AXP152_IRQ2_EN 0x41
@@ -350,6 +361,32 @@ enum {
AXP809_REG_ID_MAX,
};
+enum {
+ AXP803_DCDC1 = 0,
+ AXP803_DCDC2,
+ AXP803_DCDC3,
+ AXP803_DCDC4,
+ AXP803_DCDC5,
+ AXP803_DCDC6,
+ AXP803_DC1SW,
+ AXP803_ALDO1,
+ AXP803_ALDO2,
+ AXP803_ALDO3,
+ AXP803_DLDO1,
+ AXP803_DLDO2,
+ AXP803_DLDO3,
+ AXP803_DLDO4,
+ AXP803_ELDO1,
+ AXP803_ELDO2,
+ AXP803_ELDO3,
+ AXP803_FLDO1,
+ AXP803_FLDO2,
+ AXP803_RTC_LDO,
+ AXP803_LDO_IO0,
+ AXP803_LDO_IO1,
+ AXP803_REG_ID_MAX,
+};
+
/* IRQs */
enum {
AXP152_IRQ_LDO0IN_CONNECT = 1,
--
2.12.2
^ 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