* [PATCH 0/3] arm64: kexec,kdump: fix boot failures on acpi-only system
From: AKASHI Takahiro @ 2018-06-18 5:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <81a9a385-3b9f-113d-96f0-379be74c19f0@arm.com>
James,
Thank you for follow-up explanation.
I have nothing to add :)
-Takahiro AKASHI
On Fri, Jun 15, 2018 at 05:29:32PM +0100, James Morse wrote:
> Hi Akashi,
>
> Thanks for putting this together,
>
> On 15/06/18 08:56, AKASHI Takahiro wrote:
> > This patch series is a set of bug fixes to address kexec/kdump
> > failures which are sometimes observed on ACPI-only system and reported
> > in LAK-ML before.
> >
> > In short, the phenomena are:
> > 1. kexec'ed kernel can fail to boot because some ACPI table is corrupted
> > by a new kernel (or other data) being loaded into System RAM. Currently
> > kexec may possibly allocate space ignoring such "reserved" regions.
> > We will see no messages after "Bye!"
> >
> > 2. crash dump (kdump) kernel can fail to boot and get into panic due to
> > an alignment fault when accessing ACPI tables. This can happen because
> > those tables are not always properly aligned while they are mapped
> > non-cacheable (ioremap'ed) as they are not recognized as part of System
> > RAM under the current implementation.
> >
> > After discussing several possibilities to address those issues,
> > the agreed approach, in my understanding, is
> > * to add resource entries for every "reserved", i.e. memblock_reserve(),
> > regions to /proc/iomem.
> > (NOMAP regions, also marked as "reserved," remains at top-level for
> > backward compatibility.)
>
> This means user-space can tell the difference between reserved-system-ram and
> reserved-address-space.
>
>
> > * For case (1), user space (kexec-tools) should rule out such regions
> > in searching for free space for loaded data.
>
> ... but doesn't today, because it fails to account for second-level entries.
> We've always had second-level entries, so this is a user-space bug. We need both
> fixed to fix the issue.
>
> Our attempts to fix this just in the kernel reached a dead end, because Kdump
> needs to include reserved-system-ram, whereas kexec has to avoid it. User-space
> needs to be able to tell reserved-system-ram and reserved-address-space apart.
> Hence we need to expose that information, and pick it up in user-space.
>
> Patched-kernel and unpatch-user-space will work the same way it does today, as
> the additional reserved regions are ignored by user-space.
>
> Unpatched-kernel and patched-user-space will also work the same way it does
> today as the additional reserved regions are missing.
>
> I think this is the only way forwards on this issue...
>
>
> > * For case (2), the kernel should access ACPI tables by mapping
> > them with appropriate memory attributes described in UEFI memory map.
> > (This means that it doesn't require any changes in /proc/iomem, and
> > hence user space.)
>
> (this one is handled entirely in the kernel)
>
>
> Thanks,
>
> James
^ permalink raw reply
* [PATCH v4 23/26] devicetree: fix a series of wrong file references
From: Lee Jones @ 2018-06-18 5:49 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <266e5f874b36aa83f3327879d85921fab52d5461.1529079120.git.mchehab+samsung@kernel.org>
On Fri, 15 Jun 2018, Mauro Carvalho Chehab wrote:
> As files got renamed, their references broke.
>
> Manually fix a series of broken refs at the DT bindings.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
> ---
> .../devicetree/bindings/input/rmi4/rmi_2d_sensor.txt | 2 +-
> Documentation/devicetree/bindings/mfd/sun6i-prcm.txt | 2 +-
Acked-by: Lee Jones <lee.jones@linaro.org>
> .../devicetree/bindings/pci/hisilicon-pcie.txt | 2 +-
> Documentation/devicetree/bindings/pci/kirin-pcie.txt | 2 +-
> .../devicetree/bindings/pci/pci-keystone.txt | 4 ++--
> .../devicetree/bindings/sound/st,stm32-i2s.txt | 2 +-
> .../devicetree/bindings/sound/st,stm32-sai.txt | 2 +-
> MAINTAINERS | 12 ++++++------
> 8 files changed, 14 insertions(+), 14 deletions(-)
--
Lee Jones [???]
Linaro Services Technical Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
* [PATCH v2 1/4] arm: dts: Fix error in Aspeed OpenPower Romulus device-tree
From: Benjamin Herrenschmidt @ 2018-06-18 5:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180618045902.11453-2-benh@kernel.crashing.org>
On Mon, 2018-06-18 at 14:58 +1000, Benjamin Herrenschmidt wrote:
> The reserved memory for the VGA frame buffer is at the wrong address
> for this system.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Note: These are pre-reqs for subsequent work, so if they are accepted,
I will put them in the fsi tree that I send to Greg (though it can also
be in an ARM soc tree).
Let me know if you prefer that I create a topic branch to pull on both
sides on k.org
> ---
> arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
> index 0b9b37d4d6ef..7d28c03a9e0b 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
> @@ -21,9 +21,9 @@
> #size-cells = <1>;
> ranges;
>
> - vga_memory: framebuffer at bf000000 {
> + vga_memory: framebuffer at 9f000000 {
> no-map;
> - reg = <0xbf000000 0x01000000>; /* 16M */
> + reg = <0x9f000000 0x01000000>; /* 16M */
> };
>
> flash_memory: region at 98000000 {
^ permalink raw reply
* [PATCH v1 6/6] perf cs-etm: Generate branch sample for CS_ETM_TRACE_ON packet
From: Leo Yan @ 2018-06-18 5:09 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1529298599-3876-1-git-send-email-leo.yan@linaro.org>
CS_ETM_TRACE_ON packet itself can give the info that there have a
discontinuity in the trace, this patch is to add branch sample for
CS_ETM_TRACE_ON packet if it is inserted in the middle of CS_ETM_RANGE
packets; as result we can have hint for the trace discontinuity.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
tools/perf/util/cs-etm.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index d3b7942..2ae6402 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -910,13 +910,23 @@ static int cs_etm__sample(struct cs_etm_queue *etmq)
etmq->period_instructions = instrs_over;
}
- if (etm->sample_branches &&
- etmq->prev_packet &&
- etmq->prev_packet->sample_type == CS_ETM_RANGE &&
- etmq->prev_packet->last_instr_taken_branch) {
- ret = cs_etm__synth_branch_sample(etmq);
- if (ret)
- return ret;
+ if (etm->sample_branches && etmq->prev_packet) {
+ bool generate_sample = false;
+
+ /* Generate sample for tracing on packet */
+ if (etmq->prev_packet->sample_type == CS_ETM_TRACE_ON)
+ generate_sample = true;
+
+ /* Generate sample for branch taken packet */
+ if (etmq->prev_packet->sample_type == CS_ETM_RANGE &&
+ etmq->prev_packet->last_instr_taken_branch)
+ generate_sample = true;
+
+ if (generate_sample) {
+ ret = cs_etm__synth_branch_sample(etmq);
+ if (ret)
+ return ret;
+ }
}
if (etm->sample_branches || etm->synth_opts.last_branch) {
--
2.7.4
^ permalink raw reply related
* [PATCH v1 5/6] perf cs-etm: Generate branch sample when receiving a CS_ETM_TRACE_ON packet
From: Leo Yan @ 2018-06-18 5:09 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1529298599-3876-1-git-send-email-leo.yan@linaro.org>
If one CS_ETM_TRACE_ON packet is inserted, we miss to generate branch
sample for the previous CS_ETM_RANGE packet.
This patch is to generate branch sample when receiving a CS_ETM_TRACE_ON
packet, so this can save complete info for the previous CS_ETM_RANGE
packet just before CS_ETM_TRACE_ON packet.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
tools/perf/util/cs-etm.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 976db84..d3b7942 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -935,6 +935,7 @@ static int cs_etm__sample(struct cs_etm_queue *etmq)
static int cs_etm__flush(struct cs_etm_queue *etmq)
{
int err = 0;
+ struct cs_etm_auxtrace *etm = etmq->etm;
struct cs_etm_packet *tmp;
if (!etmq->prev_packet)
@@ -965,6 +966,13 @@ static int cs_etm__flush(struct cs_etm_queue *etmq)
}
+ if (etm->sample_branches &&
+ etmq->prev_packet->sample_type == CS_ETM_RANGE) {
+ err = cs_etm__synth_branch_sample(etmq);
+ if (err)
+ return err;
+ }
+
swap_packet:
if (etmq->etm->synth_opts.last_branch) {
/*
--
2.7.4
^ permalink raw reply related
* [PATCH v1 4/6] perf cs-etm: Support dummy address value for CS_ETM_TRACE_ON packet
From: Leo Yan @ 2018-06-18 5:09 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1529298599-3876-1-git-send-email-leo.yan@linaro.org>
For CS_ETM_TRACE_ON packet, its fields 'packet->start_addr' and
'packet->end_addr' equal to 0xdeadbeefdeadbeefUL which are emitted in
the decoder layer as dummy value, but the dummy value is pointless for
branch sample when we use 'perf script' command to check program flow.
This patch is a preparation to support CS_ETM_TRACE_ON packet for
branch sample, it converts the dummy address value to zero for more
readable; this is accomplished by cs_etm__last_executed_instr() and
cs_etm__first_executed_instr(). The later one is a new function
introduced by this patch.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
tools/perf/util/cs-etm.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index ae7c9c88..976db84 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -494,6 +494,10 @@ static inline void cs_etm__reset_last_branch_rb(struct cs_etm_queue *etmq)
static inline u64 cs_etm__last_executed_instr(struct cs_etm_packet *packet)
{
+ /* Returns 0 for the CS_ETM_TRACE_ON packet */
+ if (packet->sample_type == CS_ETM_TRACE_ON)
+ return 0;
+
/*
* The packet records the execution range with an exclusive end address
*
@@ -505,6 +509,15 @@ static inline u64 cs_etm__last_executed_instr(struct cs_etm_packet *packet)
return packet->end_addr - A64_INSTR_SIZE;
}
+static inline u64 cs_etm__first_executed_instr(struct cs_etm_packet *packet)
+{
+ /* Returns 0 for the CS_ETM_TRACE_ON packet */
+ if (packet->sample_type == CS_ETM_TRACE_ON)
+ return 0;
+
+ return packet->start_addr;
+}
+
static inline u64 cs_etm__instr_count(const struct cs_etm_packet *packet)
{
/*
@@ -546,7 +559,7 @@ static void cs_etm__update_last_branch_rb(struct cs_etm_queue *etmq)
be = &bs->entries[etmq->last_branch_pos];
be->from = cs_etm__last_executed_instr(etmq->prev_packet);
- be->to = etmq->packet->start_addr;
+ be->to = cs_etm__first_executed_instr(etmq->packet);
/* No support for mispredict */
be->flags.mispred = 0;
be->flags.predicted = 1;
@@ -701,7 +714,7 @@ static int cs_etm__synth_branch_sample(struct cs_etm_queue *etmq)
sample.ip = cs_etm__last_executed_instr(etmq->prev_packet);
sample.pid = etmq->pid;
sample.tid = etmq->tid;
- sample.addr = etmq->packet->start_addr;
+ sample.addr = cs_etm__first_executed_instr(etmq->packet);
sample.id = etmq->etm->branches_id;
sample.stream_id = etmq->etm->branches_id;
sample.period = 1;
--
2.7.4
^ permalink raw reply related
* [PATCH v1 3/6] perf cs-etm: Fix start tracing packet handling
From: Leo Yan @ 2018-06-18 5:09 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1529298599-3876-1-git-send-email-leo.yan@linaro.org>
Usually the start tracing packet is a CS_ETM_TRACE_ON packet, this
packet is passed to cs_etm__flush(); cs_etm__flush() will check the
condition 'prev_packet->sample_type == CS_ETM_RANGE' but 'prev_packet'
is allocated by zalloc() so 'prev_packet->sample_type' is zero in
initialization and this condition is false. So cs_etm__flush() will
directly bail out without handling the start tracing packet.
This patch is to introduce a new sample type CS_ETM_EMPTY, which is used
to indicate the packet is an empty packet. cs_etm__flush() will swap
packets when it finds the previous packet is empty, so this can record
the start tracing packet into 'etmq->prev_packet'.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 1 +
tools/perf/util/cs-etm.c | 19 ++++++++++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h
index 743f5f4..612b575 100644
--- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h
+++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h
@@ -23,6 +23,7 @@ struct cs_etm_buffer {
};
enum cs_etm_sample_type {
+ CS_ETM_EMPTY = 0,
CS_ETM_RANGE = 1 << 0,
CS_ETM_TRACE_ON = 1 << 1,
};
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 8b2c099..ae7c9c88 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -924,8 +924,14 @@ static int cs_etm__flush(struct cs_etm_queue *etmq)
int err = 0;
struct cs_etm_packet *tmp;
+ if (!etmq->prev_packet)
+ return 0;
+
+ /* Handle start tracing packet */
+ if (etmq->prev_packet->sample_type == CS_ETM_EMPTY)
+ goto swap_packet;
+
if (etmq->etm->synth_opts.last_branch &&
- etmq->prev_packet &&
etmq->prev_packet->sample_type == CS_ETM_RANGE) {
/*
* Generate a last branch event for the branches left in the
@@ -944,6 +950,10 @@ static int cs_etm__flush(struct cs_etm_queue *etmq)
etmq->period_instructions = 0;
+ }
+
+swap_packet:
+ if (etmq->etm->synth_opts.last_branch) {
/*
* Swap PACKET with PREV_PACKET: PACKET becomes PREV_PACKET for
* the next incoming packet.
@@ -1023,6 +1033,13 @@ static int cs_etm__run_decoder(struct cs_etm_queue *etmq)
*/
cs_etm__flush(etmq);
break;
+ case CS_ETM_EMPTY:
+ /*
+ * Should not receive empty packet,
+ * report error.
+ */
+ pr_err("CS ETM Trace: empty packet\n");
+ return -EINVAL;
default:
break;
}
--
2.7.4
^ permalink raw reply related
* [PATCH v1 2/6] perf cs-etm: Bail out immediately for instruction sample failure
From: Leo Yan @ 2018-06-18 5:09 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1529298599-3876-1-git-send-email-leo.yan@linaro.org>
If the instruction sample failure has happened, it isn't necessary to
execute to the end of the function cs_etm__flush(). This commit is to
bail out immediately and return the error code.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
tools/perf/util/cs-etm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 822ba91..8b2c099 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -939,6 +939,9 @@ static int cs_etm__flush(struct cs_etm_queue *etmq)
err = cs_etm__synth_instruction_sample(
etmq, addr,
etmq->period_instructions);
+ if (err)
+ return err;
+
etmq->period_instructions = 0;
/*
--
2.7.4
^ permalink raw reply related
* [PATCH v1 1/6] perf cs-etm: Introduce invalid address macro
From: Leo Yan @ 2018-06-18 5:09 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1529298599-3876-1-git-send-email-leo.yan@linaro.org>
This patch introduces invalid address macro and uses it to replace dummy
value '0xdeadbeefdeadbeefUL'.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
index 4d5fc37..938def6 100644
--- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
+++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
@@ -31,6 +31,8 @@
#endif
#endif
+#define CS_ETM_INVAL_ADDR 0xdeadbeefdeadbeefUL
+
struct cs_etm_decoder {
void *data;
void (*packet_printer)(const char *msg);
@@ -261,8 +263,8 @@ static void cs_etm_decoder__clear_buffer(struct cs_etm_decoder *decoder)
decoder->tail = 0;
decoder->packet_count = 0;
for (i = 0; i < MAX_BUFFER; i++) {
- decoder->packet_buffer[i].start_addr = 0xdeadbeefdeadbeefUL;
- decoder->packet_buffer[i].end_addr = 0xdeadbeefdeadbeefUL;
+ decoder->packet_buffer[i].start_addr = CS_ETM_INVAL_ADDR;
+ decoder->packet_buffer[i].end_addr = CS_ETM_INVAL_ADDR;
decoder->packet_buffer[i].last_instr_taken_branch = false;
decoder->packet_buffer[i].exc = false;
decoder->packet_buffer[i].exc_ret = false;
@@ -295,8 +297,8 @@ cs_etm_decoder__buffer_packet(struct cs_etm_decoder *decoder,
decoder->packet_buffer[et].exc = false;
decoder->packet_buffer[et].exc_ret = false;
decoder->packet_buffer[et].cpu = *((int *)inode->priv);
- decoder->packet_buffer[et].start_addr = 0xdeadbeefdeadbeefUL;
- decoder->packet_buffer[et].end_addr = 0xdeadbeefdeadbeefUL;
+ decoder->packet_buffer[et].start_addr = CS_ETM_INVAL_ADDR;
+ decoder->packet_buffer[et].end_addr = CS_ETM_INVAL_ADDR;
if (decoder->packet_count == MAX_BUFFER - 1)
return OCSD_RESP_WAIT;
--
2.7.4
^ permalink raw reply related
* [PATCH v1 0/6] perf cs-etm: Fix tracing packet handling and minor refactoring
From: Leo Yan @ 2018-06-18 5:09 UTC (permalink / raw)
To: linux-arm-kernel
Due the current code is missing to handle cs-etm start tracing packet
and CS_ETM_TRACE_ON packet, we fail to generate branch sample for them.
This patch series is to fix cs-etm tracing packet handling:
Patch 0001 is to add invalid address macro for readable coding;
Patch 0002 is one minor fixing to return error code for instruction
sample failure;
Patches 0003~0006 are fixing patches for start tracing packet
and CS_ETM_TRACE_ON packet.
This patch series is applied on acme tree [1] on branch perf/core with
latest commit: e238cf2e3d2e ("perf intel-pt: Fix packet decoding of CYC
packets"). Also applied successfully this patch series on Linus tree
on 4.18-rc1.
This patch series has been verified on Hikey620 platform with below two
commands:
perf script --itrace=i10000il128 -F cpu,event,ip,addr,sym -k ./vmlinux
perf script -F cpu,event,ip,addr,sym -k ./vmlinux
[1] https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git
Leo Yan (6):
perf cs-etm: Introduce invalid address macro
perf cs-etm: Bail out immediately for instruction sample failure
perf cs-etm: Fix start tracing packet handling
perf cs-etm: Support dummy address value for CS_ETM_TRACE_ON packet
perf cs-etm: Generate branch sample when receiving a CS_ETM_TRACE_ON
packet
perf cs-etm: Generate branch sample for CS_ETM_TRACE_ON packet
tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 10 ++--
tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 1 +
tools/perf/util/cs-etm.c | 71 +++++++++++++++++++++----
3 files changed, 68 insertions(+), 14 deletions(-)
--
2.7.4
^ permalink raw reply
* [PATCH v2 4/4] arm: dts: Update AST2400 device-tree
From: Benjamin Herrenschmidt @ 2018-06-18 4:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180618045902.11453-1-benh@kernel.crashing.org>
Add the missing node for the CVIC (the coprocessor interrupt
controller) and add a label to the SRAM node so it can be
referenced from the board device-tree file.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/arm/boot/dts/aspeed-g4.dtsi | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi
index 75df1573380e..b1a19f99a4c9 100644
--- a/arch/arm/boot/dts/aspeed-g4.dtsi
+++ b/arch/arm/boot/dts/aspeed-g4.dtsi
@@ -92,6 +92,12 @@
reg = <0x1e6c0080 0x80>;
};
+ cvic: copro-interrupt-controller at 1e6c2000 {
+ compatible = "aspeed,ast2400-cvic", "aspeed-cvic";
+ valid-sources = <0x7fffffff>;
+ reg = <0x1e6c2000 0x80>;
+ };
+
mac0: ethernet at 1e660000 {
compatible = "aspeed,ast2400-mac", "faraday,ftgmac100";
reg = <0x1e660000 0x180>;
@@ -161,7 +167,7 @@
status = "disabled";
};
- sram at 1e720000 {
+ sram: sram at 1e720000 {
compatible = "mmio-sram";
reg = <0x1e720000 0x8000>; // 32K
};
--
2.17.1
^ permalink raw reply related
* [PATCH v2 3/4] arm: dts: Update AST2500 device-tree
From: Benjamin Herrenschmidt @ 2018-06-18 4:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180618045902.11453-1-benh@kernel.crashing.org>
Add the missing node for the CVIC (the coprocessor interrupt
controller) and add a label to the SRAM node so it can be
referenced from the board device-tree file.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/arm/boot/dts/aspeed-g5.dtsi | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
index 17f2714d18a7..21141ca1bfa4 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
@@ -127,6 +127,13 @@
reg = <0x1e6c0080 0x80>;
};
+ cvic: copro-interrupt-controller at 1e6c2000 {
+ compatible = "aspeed,ast2500-cvic", "aspeed-cvic";
+ valid-sources = <0xffffffff>;
+ copro-sw-interrupts = <1>;
+ reg = <0x1e6c2000 0x80>;
+ };
+
mac0: ethernet at 1e660000 {
compatible = "aspeed,ast2500-mac", "faraday,ftgmac100";
reg = <0x1e660000 0x180>;
@@ -211,7 +218,7 @@
status = "disabled";
};
- sram at 1e720000 {
+ sram: sram at 1e720000 {
compatible = "mmio-sram";
reg = <0x1e720000 0x9000>; // 36K
};
--
2.17.1
^ permalink raw reply related
* [PATCH v2 2/4] dt-bindings: misc: Aspeed coprocessor interrupt controller
From: Benjamin Herrenschmidt @ 2018-06-18 4:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180618045902.11453-1-benh@kernel.crashing.org>
Add the device-tree binding definition for the AST2400
and AST2500 coprocessor interrupt controller
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
.../devicetree/bindings/misc/aspeed,cvic.txt | 35 +++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 Documentation/devicetree/bindings/misc/aspeed,cvic.txt
diff --git a/Documentation/devicetree/bindings/misc/aspeed,cvic.txt b/Documentation/devicetree/bindings/misc/aspeed,cvic.txt
new file mode 100644
index 000000000000..2562e2991e4d
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/aspeed,cvic.txt
@@ -0,0 +1,35 @@
+* Aspeed AST2400 and AST2500 coprocessor interrupt controller
+
+This file describes the bindings for the interrupt controller present
+in the AST2400 and AST2500 BMC SoCs which provides interrupt to the
+ColdFire coprocessor.
+
+It is not a normal interrupt controller and it would be rather
+inconvenient to create an interrupt tree for it as it somewhat shares
+some of the same sources as the main ARM interrupt controller but with
+different numbers.
+
+The AST2500 supports a SW generated interrupt
+
+Required properties:
+- reg: address and length of the register for the device.
+- compatible: "aspeed,cvic" and one of:
+ "aspeed,ast2400-cvic"
+ or
+ "aspeed,ast2500-cvic"
+
+- valid-sources: One cell, bitmap of supported sources for the implementation
+
+Optional properties;
+- copro-sw-interrupts: List of interrupt numbers that can be used as
+ SW interrupts from the ARM to the coprocessor.
+ (AST2500 only)
+
+Example:
+
+ cvic: copro-interrupt-controller at 1e6c2000 {
+ compatible = "aspeed,ast2500-cvic";
+ valid-sources = <0xffffffff>;
+ copro-sw-interrupts = <1>;
+ reg = <0x1e6c2000 0x80>;
+ };
--
2.17.1
^ permalink raw reply related
* [PATCH v2 1/4] arm: dts: Fix error in Aspeed OpenPower Romulus device-tree
From: Benjamin Herrenschmidt @ 2018-06-18 4:58 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180618045902.11453-1-benh@kernel.crashing.org>
The reserved memory for the VGA frame buffer is at the wrong address
for this system.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
---
arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
index 0b9b37d4d6ef..7d28c03a9e0b 100644
--- a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
@@ -21,9 +21,9 @@
#size-cells = <1>;
ranges;
- vga_memory: framebuffer at bf000000 {
+ vga_memory: framebuffer at 9f000000 {
no-map;
- reg = <0xbf000000 0x01000000>; /* 16M */
+ reg = <0x9f000000 0x01000000>; /* 16M */
};
flash_memory: region at 98000000 {
--
2.17.1
^ permalink raw reply related
* [PATCH v2 0/4] arm: dts: Aspeed SoC device-tree update
From: Benjamin Herrenschmidt @ 2018-06-18 4:58 UTC (permalink / raw)
To: linux-arm-kernel
This series fixes a few things in some Aspeed BMC device trees:
- Fix an error in a memory reserve address on Romulus systems
- Update AST2400 and AST2500 device-trees to add a label to the
SRAM node and add the coprocessor interrupts controller node
along with a binding.
^ permalink raw reply
* Re: [PATCH v11 00/27] ARM: davinci: convert to common clock framework
From: Sekhar Nori @ 2018-06-18 4:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <89b599d3-c43a-255f-8da6-9bea6cf53a5d@lechnology.com>
Hi David,
On Sunday 17 June 2018 09:18 PM, David Lechner wrote:
> Hi Sekhar,
>
> On 05/22/2018 04:38 AM, Sekhar Nori wrote:
>> Hi David,
>>
>> On Friday 18 May 2018 10:18 PM, David Lechner wrote:
>>> This series converts mach-davinci to use the common clock framework.
>>>
>>> The series works like this, the first 3 patches fix some issues with
>>> the clock
>>> drivers that have already been accepted into the mainline kernel.
>>>
>>> Then, starting with "ARM: davinci: pass clock as parameter to
>>> davinci_timer_init()", we get the mach code ready for the switch by
>>> adding the
>>> code needed for the new clock drivers and adding #ifndef
>>> CONFIG_COMMON_CLK
>>> around the legacy clocks so that we can switch easily between the old
>>> and the
>>> new.
>>>
>>> "ARM: davinci: switch to common clock framework" actually flips the
>>> switch
>>> to start using the new clock drivers. Then the next 8 patches remove all
>>> of the old clock code.
>>>
>>> The final four patches add device tree clock support to the one SoC that
>>> supports it.
>>>
>>> This series has been tested on TI OMAP-L138 LCDK (both device tree
>>> and legacy
>>> board file).
>>
>> If you do end up sending a v12, you can leave out the mach-davinci
>> portions unless there are any changes you need to make. I will pick them
>> up from this series once the driver dependencies are merged.
>>
>> I do hope the drivers/clk/* changes can be merged from v4.18.
>>
>> Thanks,
>> Sekhar
>>
>
> Are you going to pick up the arch patches from this series now that
> the 4.18 merge window is closed?
>
> All of the clk patches landed in 4.18.
yes!
Thanks,
Sekhar
^ permalink raw reply
* [PATCHv4 1/2] ARM: imx53: add secure-reg-access support for PMU
From: Fabio Estevam @ 2018-06-18 4:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180226134741.neqkpge33zo3pfzt@earth.universe>
Hi Sebastian,
[Adding Martin on Cc who also tried to enable DBGEN bit in a previous patch]
On Mon, Feb 26, 2018 at 10:47 AM, Sebastian Reichel
<sebastian.reichel@collabora.co.uk> wrote:
> Hi Shawn,
>
> On Sat, Feb 24, 2018 at 03:45:44PM +0800, Shawn Guo wrote:
>> On Mon, Feb 12, 2018 at 01:39:44PM +0100, Sebastian Reichel wrote:
>> > On i.MX53 it is necessary to set the DBG_EN bit in the
>> > platform GPC register to enable access to PMU counters
>> > other than the cycle counter.
>> >
>> > Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
>> > ---
>> > arch/arm/mach-imx/mach-imx53.c | 39 ++++++++++++++++++++++++++++++++++++++-
>> > 1 file changed, 38 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c
>> > index 07c2e8dca494..658e28604dca 100644
>> > --- a/arch/arm/mach-imx/mach-imx53.c
>> > +++ b/arch/arm/mach-imx/mach-imx53.c
>> > @@ -28,10 +28,47 @@ static void __init imx53_init_early(void)
>> > mxc_set_cpu_type(MXC_CPU_MX53);
>> > }
>> >
>> > +#define MXC_CORTEXA8_PLAT_GPC 0x63fa0004
>>
>> The base address should be retrieved from device tree.
>
> DT has no entry for 0x63fa0000-0x63fa3fff. iMX53 TRM lists it as "ARM Platform"
> with 8 platform specific 32 bit registers. Do you think it's worth the trouble
> adding a new binding? Do you have a suggestion for a compatible value?
I also think we should add a compatible string for the "ARM platform" region.
This way both mx51 and mx53 could retrieve the base address from the
device tree.
What about:
--- a/arch/arm/boot/dts/imx53.dtsi
+++ b/arch/arm/boot/dts/imx53.dtsi
@@ -672,6 +672,11 @@
status = "disabled";
};
+ arm_plat: arm-plat at 63fa0000 {
+ compatible = "fsl,imx53-arm-plat",
"fsl,imx51-arm-plat";
+ reg = <0x63fa0000 0x4000>;
+ };
+
owire: owire at 63fa4000 {
compatible = "fsl,imx53-owire",
"fsl,imx21-owire";
reg = <0x63fa4000 0x4000>;
^ permalink raw reply
* [PATCH v3 0/4] allwinner: a64: add SRAM controller / system control
From: Chen-Yu Tsai @ 2018-06-18 2:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180615091413.pbdtrpa7txe6i4ee@flea>
On Fri, Jun 15, 2018 at 5:14 PM, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:
> On Thu, Jun 14, 2018 at 11:35:44PM +0800, Chen-Yu Tsai wrote:
>> Hi,
>>
>> This series is the remaining A64 syscon changes from the R40 DWMAC
>> series. The series aligns how the A64 system control exports a regmap
>> for the sun8i DWMAC driver to access with what we've done for the R40.
>>
>> Originally the A64 used the generic syscon for this bit of hardware.
>> But this block also contains mapping bits for the onboard SRAM, used
>> by various peripherals, and other vendor specific bits we may use in
>> the future. It is by no means generic. And we already have a device
>> tree binding and driver for the SRAM part.
>>
>> The first patch make the SRAM control device export a regmap, exposing
>> a single EMAC control register, for the DWMAC driver to consume.
>>
>> The second and third patches rename the A64 compatible string to read
>> "system control", which is what the block is named in the user manual.
>>
>> The last patch fixes up the device node, and also adds the lone mappable
>> SRAM block, which is needed by the Display Engine.
>
> For the serie:
> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Cool. I'll apply them once you've rebased and pushed out any patches you
queued up during the merge window.
ChenYu
^ permalink raw reply
* [PATCH] ARM: S3C24XX: fix typo in guard macro for s3c2412.h
From: efremov at linux.com @ 2018-06-17 19:46 UTC (permalink / raw)
To: linux-arm-kernel
The guard macro __ARCH_ARM_REGS_S3C24XX_S3C2412_H in header s3c2412.h
doesn't match the #ifndef macro __ARCH_ARM_MACH_S3C24XX_S3C2412_H.
This patch defines the guard correctly.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Denis Efremov <efremov@linux.com>
---
arch/arm/mach-s3c24xx/include/mach/s3c2412.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-s3c24xx/include/mach/s3c2412.h b/arch/arm/mach-s3c24xx/include/mach/s3c2412.h
index b6b32724ace8..4ff83f956cfb 100644
--- a/arch/arm/mach-s3c24xx/include/mach/s3c2412.h
+++ b/arch/arm/mach-s3c24xx/include/mach/s3c2412.h
@@ -6,7 +6,7 @@
*/
#ifndef __ARCH_ARM_MACH_S3C24XX_S3C2412_H
-#define __ARCH_ARM_REGS_S3C24XX_S3C2412_H __FILE__
+#define __ARCH_ARM_MACH_S3C24XX_S3C2412_H __FILE__
#define S3C2412_MEMREG(x) (S3C24XX_VA_MEMCTRL + (x))
#define S3C2412_EBIREG(x) (S3C2412_VA_EBI + (x))
--
2.17.1
^ permalink raw reply related
* [PATCH v3 09/14] ASoC: pxa: remove the dmaengine compat need
From: Daniel Mack @ 2018-06-17 18:17 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180617170217.24177-10-robert.jarzmik@free.fr>
Hi Mark,
I prepared a series of patches for 4.18 that conflict with this one.
Instead of letting other people resolve this down the road, I'd prefer
if this one went through the ASoC tree, if you don't mind.
I've talked to Robert off-list, and he's fine with this approach.
Thanks,
Daniel
On Sunday, June 17, 2018 07:02 PM, Robert Jarzmik wrote:
> As the pxa architecture switched towards the dmaengine slave map, the
> old compatibility mechanism to acquire the dma requestor line number and
> priority are not needed anymore.
>
> This patch simplifies the dma resource acquisition, using the more
> generic function dma_request_slave_channel().
>
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> Reviewed-by: Daniel Mack <daniel@zonque.org>
> Acked-by: Mark Brown <broonie@kernel.org>
> ---
> sound/arm/pxa2xx-ac97.c | 14 ++------------
> sound/arm/pxa2xx-pcm-lib.c | 6 +++---
> sound/soc/pxa/pxa2xx-ac97.c | 32 +++++---------------------------
> sound/soc/pxa/pxa2xx-i2s.c | 6 ++----
> 4 files changed, 12 insertions(+), 46 deletions(-)
>
> diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c
> index 4bc244c40f80..236a63cdaf9f 100644
> --- a/sound/arm/pxa2xx-ac97.c
> +++ b/sound/arm/pxa2xx-ac97.c
> @@ -63,28 +63,18 @@ static struct snd_ac97_bus_ops pxa2xx_ac97_ops = {
> .reset = pxa2xx_ac97_legacy_reset,
> };
>
> -static struct pxad_param pxa2xx_ac97_pcm_out_req = {
> - .prio = PXAD_PRIO_LOWEST,
> - .drcmr = 12,
> -};
> -
> static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_out = {
> .addr = __PREG(PCDR),
> .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
> + .chan_name = "pcm_pcm_stereo_out",
> .maxburst = 32,
> - .filter_data = &pxa2xx_ac97_pcm_out_req,
> -};
> -
> -static struct pxad_param pxa2xx_ac97_pcm_in_req = {
> - .prio = PXAD_PRIO_LOWEST,
> - .drcmr = 11,
> };
>
> static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_in = {
> .addr = __PREG(PCDR),
> .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
> + .chan_name = "pcm_pcm_stereo_in",
> .maxburst = 32,
> - .filter_data = &pxa2xx_ac97_pcm_in_req,
> };
>
> static struct snd_pcm *pxa2xx_ac97_pcm;
> diff --git a/sound/arm/pxa2xx-pcm-lib.c b/sound/arm/pxa2xx-pcm-lib.c
> index e8da3b8ee721..dcbe7ecc1835 100644
> --- a/sound/arm/pxa2xx-pcm-lib.c
> +++ b/sound/arm/pxa2xx-pcm-lib.c
> @@ -125,9 +125,9 @@ int __pxa2xx_pcm_open(struct snd_pcm_substream *substream)
> if (ret < 0)
> return ret;
>
> - return snd_dmaengine_pcm_open_request_chan(substream,
> - pxad_filter_fn,
> - dma_params->filter_data);
> + return snd_dmaengine_pcm_open(
> + substream, dma_request_slave_channel(rtd->cpu_dai->dev,
> + dma_params->chan_name));
> }
> EXPORT_SYMBOL(__pxa2xx_pcm_open);
>
> diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
> index 803818aabee9..1b41c0f2a8fb 100644
> --- a/sound/soc/pxa/pxa2xx-ac97.c
> +++ b/sound/soc/pxa/pxa2xx-ac97.c
> @@ -68,61 +68,39 @@ static struct snd_ac97_bus_ops pxa2xx_ac97_ops = {
> .reset = pxa2xx_ac97_cold_reset,
> };
>
> -static struct pxad_param pxa2xx_ac97_pcm_stereo_in_req = {
> - .prio = PXAD_PRIO_LOWEST,
> - .drcmr = 11,
> -};
> -
> static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = {
> .addr = __PREG(PCDR),
> .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
> + .chan_name = "pcm_pcm_stereo_in",
> .maxburst = 32,
> - .filter_data = &pxa2xx_ac97_pcm_stereo_in_req,
> -};
> -
> -static struct pxad_param pxa2xx_ac97_pcm_stereo_out_req = {
> - .prio = PXAD_PRIO_LOWEST,
> - .drcmr = 12,
> };
>
> static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = {
> .addr = __PREG(PCDR),
> .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
> + .chan_name = "pcm_pcm_stereo_out",
> .maxburst = 32,
> - .filter_data = &pxa2xx_ac97_pcm_stereo_out_req,
> };
>
> -static struct pxad_param pxa2xx_ac97_pcm_aux_mono_out_req = {
> - .prio = PXAD_PRIO_LOWEST,
> - .drcmr = 10,
> -};
> static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_out = {
> .addr = __PREG(MODR),
> .addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
> + .chan_name = "pcm_aux_mono_out",
> .maxburst = 16,
> - .filter_data = &pxa2xx_ac97_pcm_aux_mono_out_req,
> };
>
> -static struct pxad_param pxa2xx_ac97_pcm_aux_mono_in_req = {
> - .prio = PXAD_PRIO_LOWEST,
> - .drcmr = 9,
> -};
> static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_in = {
> .addr = __PREG(MODR),
> .addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
> + .chan_name = "pcm_aux_mono_in",
> .maxburst = 16,
> - .filter_data = &pxa2xx_ac97_pcm_aux_mono_in_req,
> };
>
> -static struct pxad_param pxa2xx_ac97_pcm_aux_mic_mono_req = {
> - .prio = PXAD_PRIO_LOWEST,
> - .drcmr = 8,
> -};
> static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_mic_mono_in = {
> .addr = __PREG(MCDR),
> .addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
> + .chan_name = "pcm_aux_mic_mono",
> .maxburst = 16,
> - .filter_data = &pxa2xx_ac97_pcm_aux_mic_mono_req,
> };
>
> static int pxa2xx_ac97_hifi_startup(struct snd_pcm_substream *substream,
> diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c
> index 3fb60baf6eab..e7184de0de04 100644
> --- a/sound/soc/pxa/pxa2xx-i2s.c
> +++ b/sound/soc/pxa/pxa2xx-i2s.c
> @@ -82,20 +82,18 @@ static struct pxa_i2s_port pxa_i2s;
> static struct clk *clk_i2s;
> static int clk_ena = 0;
>
> -static unsigned long pxa2xx_i2s_pcm_stereo_out_req = 3;
> static struct snd_dmaengine_dai_dma_data pxa2xx_i2s_pcm_stereo_out = {
> .addr = __PREG(SADR),
> .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
> + .chan_name = "tx",
> .maxburst = 32,
> - .filter_data = &pxa2xx_i2s_pcm_stereo_out_req,
> };
>
> -static unsigned long pxa2xx_i2s_pcm_stereo_in_req = 2;
> static struct snd_dmaengine_dai_dma_data pxa2xx_i2s_pcm_stereo_in = {
> .addr = __PREG(SADR),
> .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
> + .chan_name = "rx",
> .maxburst = 32,
> - .filter_data = &pxa2xx_i2s_pcm_stereo_in_req,
> };
>
> static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream,
>
^ permalink raw reply
* [PATCH v3 06/14] mtd: rawnand: marvell: remove the dmaengine compat need
From: Daniel Mack @ 2018-06-17 18:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180617170217.24177-7-robert.jarzmik@free.fr>
On Sunday, June 17, 2018 07:02 PM, Robert Jarzmik wrote:
> As the pxa architecture switched towards the dmaengine slave map, the
> old compatibility mechanism to acquire the dma requestor line number and
> priority are not needed anymore.
>
> This patch simplifies the dma resource acquisition, using the more
> generic function dma_request_slave_channel().
>
> Signed-off-by: Signed-off-by: Daniel Mack <daniel@zonque.org>
Something went wrong here, but you can simply fix that when applying the
series :)
Daniel
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
> drivers/mtd/nand/raw/marvell_nand.c | 17 +----------------
> 1 file changed, 1 insertion(+), 16 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> index 10e953218948..64618254d6de 100644
> --- a/drivers/mtd/nand/raw/marvell_nand.c
> +++ b/drivers/mtd/nand/raw/marvell_nand.c
> @@ -2613,8 +2613,6 @@ static int marvell_nfc_init_dma(struct marvell_nfc *nfc)
> dev);
> struct dma_slave_config config = {};
> struct resource *r;
> - dma_cap_mask_t mask;
> - struct pxad_param param;
> int ret;
>
> if (!IS_ENABLED(CONFIG_PXA_DMA)) {
> @@ -2627,20 +2625,7 @@ static int marvell_nfc_init_dma(struct marvell_nfc *nfc)
> if (ret)
> return ret;
>
> - r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
> - if (!r) {
> - dev_err(nfc->dev, "No resource defined for data DMA\n");
> - return -ENXIO;
> - }
> -
> - param.drcmr = r->start;
> - param.prio = PXAD_PRIO_LOWEST;
> - dma_cap_zero(mask);
> - dma_cap_set(DMA_SLAVE, mask);
> - nfc->dma_chan =
> - dma_request_slave_channel_compat(mask, pxad_filter_fn,
> - ¶m, nfc->dev,
> - "data");
> + nfc->dma_chan = dma_request_slave_channel(nfc->dev, "data");
> if (!nfc->dma_chan) {
> dev_err(nfc->dev,
> "Unable to request data DMA channel\n");
>
^ permalink raw reply
* [PATCH v3 14/14] ARM: pxa: change SSP DMA channels allocation
From: Robert Jarzmik @ 2018-06-17 17:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180617170217.24177-1-robert.jarzmik@free.fr>
Now the dma_slave_map is available for PXA architecture, switch the SSP
device to it.
This specifically means that :
- for platform data based machines, the DMA requestor channels are
extracted from the slave map, where pxa-ssp-dai.<N> is a 1-1 match to
ssp.<N>, and the channels are either "rx" or "tx".
- for device tree platforms, the dma node should be hooked into the
pxa2xx-ac97 or pxa-ssp-dai node.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Daniel Mack <daniel@zonque.org>
---
Since v1: Removed channel names from platform_data
Since v2: Added Daniel's ack
---
arch/arm/plat-pxa/ssp.c | 47 ----------------------------------------------
include/linux/pxa2xx_ssp.h | 2 --
sound/soc/pxa/pxa-ssp.c | 5 ++---
3 files changed, 2 insertions(+), 52 deletions(-)
diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index ba13f793fbce..ed36dcab80f1 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -127,53 +127,6 @@ static int pxa_ssp_probe(struct platform_device *pdev)
if (IS_ERR(ssp->clk))
return PTR_ERR(ssp->clk);
- if (dev->of_node) {
- struct of_phandle_args dma_spec;
- struct device_node *np = dev->of_node;
- int ret;
-
- /*
- * FIXME: we should allocate the DMA channel from this
- * context and pass the channel down to the ssp users.
- * For now, we lookup the rx and tx indices manually
- */
-
- /* rx */
- ret = of_parse_phandle_with_args(np, "dmas", "#dma-cells",
- 0, &dma_spec);
-
- if (ret) {
- dev_err(dev, "Can't parse dmas property\n");
- return -ENODEV;
- }
- ssp->drcmr_rx = dma_spec.args[0];
- of_node_put(dma_spec.np);
-
- /* tx */
- ret = of_parse_phandle_with_args(np, "dmas", "#dma-cells",
- 1, &dma_spec);
- if (ret) {
- dev_err(dev, "Can't parse dmas property\n");
- return -ENODEV;
- }
- ssp->drcmr_tx = dma_spec.args[0];
- of_node_put(dma_spec.np);
- } else {
- res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
- if (res == NULL) {
- dev_err(dev, "no SSP RX DRCMR defined\n");
- return -ENODEV;
- }
- ssp->drcmr_rx = res->start;
-
- res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
- if (res == NULL) {
- dev_err(dev, "no SSP TX DRCMR defined\n");
- return -ENODEV;
- }
- ssp->drcmr_tx = res->start;
- }
-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res == NULL) {
dev_err(dev, "no memory resource defined\n");
diff --git a/include/linux/pxa2xx_ssp.h b/include/linux/pxa2xx_ssp.h
index 8461b18e4608..03a7ca46735b 100644
--- a/include/linux/pxa2xx_ssp.h
+++ b/include/linux/pxa2xx_ssp.h
@@ -212,8 +212,6 @@ struct ssp_device {
int type;
int use_count;
int irq;
- int drcmr_rx;
- int drcmr_tx;
struct device_node *of_node;
};
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
index 0291c7cb64eb..e09368d89bbc 100644
--- a/sound/soc/pxa/pxa-ssp.c
+++ b/sound/soc/pxa/pxa-ssp.c
@@ -104,9 +104,8 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream,
dma = kzalloc(sizeof(struct snd_dmaengine_dai_dma_data), GFP_KERNEL);
if (!dma)
return -ENOMEM;
-
- dma->filter_data = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
- &ssp->drcmr_tx : &ssp->drcmr_rx;
+ dma->chan_name = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
+ "tx" : "rx";
snd_soc_dai_set_dma_data(cpu_dai, substream, dma);
--
2.11.0
^ permalink raw reply related
* [PATCH v3 13/14] ARM: pxa: remove the DMA IO resources
From: Robert Jarzmik @ 2018-06-17 17:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180617170217.24177-1-robert.jarzmik@free.fr>
As the last driver using the former mechanism to acquire the DMA
requestor line has be converted to the dma_slave_map, remove all these
resources from the PXA devices.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
arch/arm/mach-pxa/devices.c | 136 --------------------------------------------
1 file changed, 136 deletions(-)
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index 1e8915fc340d..5a16ea74e28a 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -60,16 +60,6 @@ static struct resource pxamci_resources[] = {
.end = IRQ_MMC,
.flags = IORESOURCE_IRQ,
},
- [2] = {
- .start = 21,
- .end = 21,
- .flags = IORESOURCE_DMA,
- },
- [3] = {
- .start = 22,
- .end = 22,
- .flags = IORESOURCE_DMA,
- },
};
static u64 pxamci_dmamask = 0xffffffffUL;
@@ -407,16 +397,6 @@ static struct resource pxa_ir_resources[] = {
.end = 0x40700023,
.flags = IORESOURCE_MEM,
},
- [5] = {
- .start = 17,
- .end = 17,
- .flags = IORESOURCE_DMA,
- },
- [6] = {
- .start = 18,
- .end = 18,
- .flags = IORESOURCE_DMA,
- },
};
struct platform_device pxa_device_ficp = {
@@ -545,18 +525,6 @@ static struct resource pxa25x_resource_ssp[] = {
.end = IRQ_SSP,
.flags = IORESOURCE_IRQ,
},
- [2] = {
- /* DRCMR for RX */
- .start = 13,
- .end = 13,
- .flags = IORESOURCE_DMA,
- },
- [3] = {
- /* DRCMR for TX */
- .start = 14,
- .end = 14,
- .flags = IORESOURCE_DMA,
- },
};
struct platform_device pxa25x_device_ssp = {
@@ -583,18 +551,6 @@ static struct resource pxa25x_resource_nssp[] = {
.end = IRQ_NSSP,
.flags = IORESOURCE_IRQ,
},
- [2] = {
- /* DRCMR for RX */
- .start = 15,
- .end = 15,
- .flags = IORESOURCE_DMA,
- },
- [3] = {
- /* DRCMR for TX */
- .start = 16,
- .end = 16,
- .flags = IORESOURCE_DMA,
- },
};
struct platform_device pxa25x_device_nssp = {
@@ -621,18 +577,6 @@ static struct resource pxa25x_resource_assp[] = {
.end = IRQ_ASSP,
.flags = IORESOURCE_IRQ,
},
- [2] = {
- /* DRCMR for RX */
- .start = 23,
- .end = 23,
- .flags = IORESOURCE_DMA,
- },
- [3] = {
- /* DRCMR for TX */
- .start = 24,
- .end = 24,
- .flags = IORESOURCE_DMA,
- },
};
struct platform_device pxa25x_device_assp = {
@@ -751,18 +695,6 @@ static struct resource pxa27x_resource_ssp1[] = {
.end = IRQ_SSP,
.flags = IORESOURCE_IRQ,
},
- [2] = {
- /* DRCMR for RX */
- .start = 13,
- .end = 13,
- .flags = IORESOURCE_DMA,
- },
- [3] = {
- /* DRCMR for TX */
- .start = 14,
- .end = 14,
- .flags = IORESOURCE_DMA,
- },
};
struct platform_device pxa27x_device_ssp1 = {
@@ -789,18 +721,6 @@ static struct resource pxa27x_resource_ssp2[] = {
.end = IRQ_SSP2,
.flags = IORESOURCE_IRQ,
},
- [2] = {
- /* DRCMR for RX */
- .start = 15,
- .end = 15,
- .flags = IORESOURCE_DMA,
- },
- [3] = {
- /* DRCMR for TX */
- .start = 16,
- .end = 16,
- .flags = IORESOURCE_DMA,
- },
};
struct platform_device pxa27x_device_ssp2 = {
@@ -827,18 +747,6 @@ static struct resource pxa27x_resource_ssp3[] = {
.end = IRQ_SSP3,
.flags = IORESOURCE_IRQ,
},
- [2] = {
- /* DRCMR for RX */
- .start = 66,
- .end = 66,
- .flags = IORESOURCE_DMA,
- },
- [3] = {
- /* DRCMR for TX */
- .start = 67,
- .end = 67,
- .flags = IORESOURCE_DMA,
- },
};
struct platform_device pxa27x_device_ssp3 = {
@@ -895,16 +803,6 @@ static struct resource pxa3xx_resources_mci2[] = {
.end = IRQ_MMC2,
.flags = IORESOURCE_IRQ,
},
- [2] = {
- .start = 93,
- .end = 93,
- .flags = IORESOURCE_DMA,
- },
- [3] = {
- .start = 94,
- .end = 94,
- .flags = IORESOURCE_DMA,
- },
};
struct platform_device pxa3xx_device_mci2 = {
@@ -934,16 +832,6 @@ static struct resource pxa3xx_resources_mci3[] = {
.end = IRQ_MMC3,
.flags = IORESOURCE_IRQ,
},
- [2] = {
- .start = 100,
- .end = 100,
- .flags = IORESOURCE_DMA,
- },
- [3] = {
- .start = 101,
- .end = 101,
- .flags = IORESOURCE_DMA,
- },
};
struct platform_device pxa3xx_device_mci3 = {
@@ -1021,18 +909,6 @@ static struct resource pxa3xx_resources_nand[] = {
.end = IRQ_NAND,
.flags = IORESOURCE_IRQ,
},
- [2] = {
- /* DRCMR for Data DMA */
- .start = 97,
- .end = 97,
- .flags = IORESOURCE_DMA,
- },
- [3] = {
- /* DRCMR for Command DMA */
- .start = 99,
- .end = 99,
- .flags = IORESOURCE_DMA,
- },
};
static u64 pxa3xx_nand_dma_mask = DMA_BIT_MASK(32);
@@ -1066,18 +942,6 @@ static struct resource pxa3xx_resource_ssp4[] = {
.end = IRQ_SSP4,
.flags = IORESOURCE_IRQ,
},
- [2] = {
- /* DRCMR for RX */
- .start = 2,
- .end = 2,
- .flags = IORESOURCE_DMA,
- },
- [3] = {
- /* DRCMR for TX */
- .start = 3,
- .end = 3,
- .flags = IORESOURCE_DMA,
- },
};
/*
--
2.11.0
^ permalink raw reply related
* [PATCH v3 12/14] dmaengine: pxa: make the filter function internal
From: Robert Jarzmik @ 2018-06-17 17:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180617170217.24177-1-robert.jarzmik@free.fr>
As the pxa architecture and all its related drivers do not rely anymore
on the filter function, thanks to the slave map conversion, make
pxad_filter_fn() static, and remove it from the global namespace.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Vinod Koul <vkoul@kernel.org>
---
Since v1: added Vinod's ack
---
drivers/dma/pxa_dma.c | 5 ++---
include/linux/dma/pxa-dma.h | 11 -----------
2 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c
index b31c28b67ad3..0db29bd1b096 100644
--- a/drivers/dma/pxa_dma.c
+++ b/drivers/dma/pxa_dma.c
@@ -179,7 +179,7 @@ static unsigned int pxad_drcmr(unsigned int line)
return 0x1000 + line * 4;
}
-bool pxad_filter_fn(struct dma_chan *chan, void *param);
+static bool pxad_filter_fn(struct dma_chan *chan, void *param);
/*
* Debug fs
@@ -1501,7 +1501,7 @@ static struct platform_driver pxad_driver = {
.remove = pxad_remove,
};
-bool pxad_filter_fn(struct dma_chan *chan, void *param)
+static bool pxad_filter_fn(struct dma_chan *chan, void *param)
{
struct pxad_chan *c = to_pxad_chan(chan);
struct pxad_param *p = param;
@@ -1514,7 +1514,6 @@ bool pxad_filter_fn(struct dma_chan *chan, void *param)
return true;
}
-EXPORT_SYMBOL_GPL(pxad_filter_fn);
module_platform_driver(pxad_driver);
diff --git a/include/linux/dma/pxa-dma.h b/include/linux/dma/pxa-dma.h
index 9fc594f69eff..fceb5df07097 100644
--- a/include/linux/dma/pxa-dma.h
+++ b/include/linux/dma/pxa-dma.h
@@ -23,15 +23,4 @@ struct pxad_param {
enum pxad_chan_prio prio;
};
-struct dma_chan;
-
-#ifdef CONFIG_PXA_DMA
-bool pxad_filter_fn(struct dma_chan *chan, void *param);
-#else
-static inline bool pxad_filter_fn(struct dma_chan *chan, void *param)
-{
- return false;
-}
-#endif
-
#endif /* _PXA_DMA_H_ */
--
2.11.0
^ permalink raw reply related
* [PATCH v3 11/14] dmaengine: pxa: document pxad_param
From: Robert Jarzmik @ 2018-06-17 17:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20180617170217.24177-1-robert.jarzmik@free.fr>
Add some documentation for the pxad_param structure, and describe the
contract behind the minimal required priority of a DMA channel.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Vinod Koul <vkoul@kernel.org>
---
Since v1: added Vinod's ack
---
include/linux/dma/pxa-dma.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/linux/dma/pxa-dma.h b/include/linux/dma/pxa-dma.h
index e56ec7af4fd7..9fc594f69eff 100644
--- a/include/linux/dma/pxa-dma.h
+++ b/include/linux/dma/pxa-dma.h
@@ -9,6 +9,15 @@ enum pxad_chan_prio {
PXAD_PRIO_LOWEST,
};
+/**
+ * struct pxad_param - dma channel request parameters
+ * @drcmr: requestor line number
+ * @prio: minimal mandatory priority of the channel
+ *
+ * If a requested channel is granted, its priority will be at least @prio,
+ * ie. if PXAD_PRIO_LOW is required, the requested channel will be either
+ * PXAD_PRIO_LOW, PXAD_PRIO_NORMAL or PXAD_PRIO_HIGHEST.
+ */
struct pxad_param {
unsigned int drcmr;
enum pxad_chan_prio prio;
--
2.11.0
^ 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