From: "Radosław Pietrzyk" <radoslaw.pietrzyk@gmail.com>
To: Bruno Herrera <bruherrera@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>,
mark.rutland@arm.com, devicetree@vger.kernel.org,
Arnd Bergmann <arnd@arndb.de>,
linux@armlinux.org.uk, ">" <peter.griffin@linaro.org>,
">" <robh+dt@kernel.org>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Lee Jones <lee.jones@linaro.org>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: DT: stm32: move dma translation to board files
Date: Mon, 31 Oct 2016 19:58:15 +0100 [thread overview]
Message-ID: <CAFvLkMTCkRcwbRc8GVNBoJFAvKWHYDjOPabueQPjTseZrucadA@mail.gmail.com> (raw)
In-Reply-To: <CAF3+Tqdz+92yxuSwZHdQ01d-G-bBNtzayKyP2-_On2APvFyLNA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 11046 bytes --]
I think wlcore driver searches dma-ranges in its parent that's why sdio
node needs it.
2016-10-31 17:41 GMT+01:00 Bruno Herrera <bruherrera@gmail.com>:
> On Mon, Oct 31, 2016 at 12:14 PM, Radosław Pietrzyk
> <radoslaw.pietrzyk@gmail.com> wrote:
> > This is weird because dma ddresses are recalculated using parent's
> > dma-ranges property and soc already has it so there should be absolutely
> no
> > problem.
>
> These are my DTS and DTSI file.
> >
> > 2016-10-31 11:27 GMT+01:00 Bruno Herrera <bruherrera@gmail.com>:
> >>
> >> On Fri, Oct 28, 2016 at 5:09 AM, Radosław Pietrzyk
> >> <radoslaw.pietrzyk@gmail.com> wrote:
> >> > Have you defined your sdio node within soc node ?
> >>
> >> It is in the SOC node of the DSTI file.
> >>
> >> >
> >> > 2016-10-27 14:57 GMT+02:00 Bruno Herrera <bruherrera@gmail.com>:
> >> >>
> >> >> Hi Alex,
> >> >>
> >> >> On Thu, Oct 27, 2016 at 10:21 AM, Alexandre Torgue
> >> >> <alexandre.torgue@st.com> wrote:
> >> >> > Hi Bruno,
> >> >> >
> >> >> >
> >> >> > On 10/27/2016 12:43 PM, Bruno Herrera wrote:
> >> >> >>
> >> >> >> Hi Alex,
> >> >> >>
> >> >> >> On Wed, Oct 26, 2016 at 7:09 AM, Alexandre Torgue
> >> >> >> <alexandre.torgue@st.com> wrote:
> >> >> >>>
> >> >> >>> Hi Bruno,
> >> >> >>>
> >> >> >>> On 10/25/2016 11:06 PM, Bruno Herrera wrote:
> >> >> >>>>
> >> >> >>>>
> >> >> >>>> Hi Alexandre,
> >> >> >>>>
> >> >> >>>>>
> >> >> >>>>> stm32f469-disco and stm32f429-eval boards use SDRAM start
> address
> >> >> >>>>> remapping
> >> >> >>>>> (to @0) to boost performances. A DMA translation through
> >> >> >>>>> "dma-ranges"
> >> >> >>>>> property was needed for other masters than the M4 CPU.
> >> >> >>>>> stm32f429-disco doesn't use remapping so doesn't need this DMA
> >> >> >>>>> translation.
> >> >> >>>>> This patches moves this DMA translation definition from
> stm32f429
> >> >> >>>>> soc
> >> >> >>>>> file
> >> >> >>>>> to board files.
> >> >> >>>>>
> >> >> >>>>> Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com>
> >> >> >>>>>
> >> >> >>>>> diff --git a/arch/arm/boot/dts/stm32429i-eval.dts
> >> >> >>>>> b/arch/arm/boot/dts/stm32429i-eval.dts
> >> >> >>>>> index 13c7cd2..a763c15 100644
> >> >> >>>>> --- a/arch/arm/boot/dts/stm32429i-eval.dts
> >> >> >>>>> +++ b/arch/arm/boot/dts/stm32429i-eval.dts
> >> >> >>>>> @@ -82,6 +82,10 @@
> >> >> >>>>> };
> >> >> >>>>> };
> >> >> >>>>>
> >> >> >>>>> + soc {
> >> >> >>>>> + dma-ranges = <0xc0000000 0x0 0x10000000>;
> >> >> >>>>> + };
> >> >> >>>>> +
> >> >> >>>>> usbotg_hs_phy: usbphy {
> >> >> >>>>> #phy-cells = <0>;
> >> >> >>>>> compatible = "usb-nop-xceiv";
> >> >> >>>>
> >> >> >>>>
> >> >> >>>>
> >> >> >>>> Shouldn't also the peripheral dma-ranges property move to board
> >> >> >>>> specific
> >> >> >>>> too?
> >> >> >>>> I had this patch for while but I didn't had the time to submit:
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>> Well spot I forgot it. Actually, discussing with Arnd ysterday on
> >> >> >>> IIRC,
> >> >> >>> empty dma-ranges is not needed. Can you test on your side by
> >> >> >>> removing
> >> >> >>> dma-ranges in usb node please ?
> >> >> >>
> >> >> >> Unfortunately will take a time for me to set up this environment
> on
> >> >> >> the STM32F4-EVAL board.
> >> >> >> And on the discovery boards we dont have this scenario. That was
> the
> >> >> >> main reason I did not submit the patch right away.
> >> >> >> My conclusion and I might be wrong but is based on the my tests
> with
> >> >> >> SDIO device at STM32F469I-DISCO board.
> >> >> >>
> >> >> >> I started this issue as discussion at ST Forum but Maxime gave me
> >> >> >> the
> >> >> >> hint.
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> https://my.st.com/public/STe2ecommunities/mcu/Lists/
> cortex_mx_stm32/Flat.aspx?RootFolder=https%3a%2f%2fmy%2est%2ecom%2fpublic%
> 2fSTe2ecommunities%2fmcu%2fLists%2fcortex_mx_stm32%
> 2fDMA2%20and%20SYSCFG_MEMRMP%20relationship&FolderCTID=
> 0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46
> A77F0FFD06506F5B¤tviews=44
> >> >> >>
> >> >> >>> I will push a v2 by removing empty dma-ranges if tests are ok in
> >> >> >>> your
> >> >> >>> side.
> >> >> >>
> >> >> >>
> >> >> >> From my understating/conclusion is: when empty
> property(dma-ranges)
> >> >> >> is
> >> >> >> the device node, the mapping will be taken in consideration when
> >> >> >> using
> >> >> >> DMA otherwise the mapping is ignored.
> >> >> >> And in the SDIO case it is needed for DEV->MEM(SDRAM) and
> >> >> >> MEM(SDRAM)->DEV. If it is not the case for the devices in question
> >> >> >> so
> >> >> >> I suppose it can work without the property.
> >> >> >
> >> >> >
> >> >> > For sure translation has to be done but I'm not sure that an empty
> >> >> > "dma-ranges" is needed in device node to activate it. For Ethernet
> >> >> > empty
> >> >> > "dma-ranges" is not needed. I will try with usb.
> >> >>
> >> >> In the case of SDIO it is needed. As example this is my working SDIO
> >> >> node:
> >> >>
> >> >> sdio: sdio@40012c00 {
> >> >> compatible = "arm,pl18x", "arm,primecell";
> >> >> arm,primecell-periphid = <0x00480181>;
> >> >> reg = <0x40012c00 0x400>;
> >> >> dmas = <&dma2 6 4 0x10400 0x3>, /* Logical - DevToMem */
> >> >> <&dma2 3 4 0x10400 0x3>; /* Logical - MemToDev */
> >> >> dma-names = "rx", "tx";
> >> >> clocks = <&rcc 0 171>;
> >> >> clock-names = "apb_pclk";
> >> >> interrupts = <49>;
> >> >> status = "disabled";
> >> >> };
> >> >>
> >> >> &sdio {
> >> >> status = "okay";
> >> >> vmmc-supply = <&wlan_en>;
> >> >> bus-width = <4>;
> >> >> max-frequency = <24000000>;
> >> >> pinctrl-names = "default";
> >> >> pinctrl-0 = <&sdio_pins>;
> >> >> ti,non-removable;
> >> >> ti,needs-special-hs-handling;
> >> >> dma-ranges;
> >> >> cap-power-off-card;
> >> >> keep-power-in-suspend;
> >> >>
> >> >> #address-cells = <1>;
> >> >> #size-cells = <0>;
> >> >> wlcore: wlcore@0 {
> >> >> compatible = "ti,wl1835";
> >> >> reg = <2>;
> >> >> interrupt-parent = <&gpioa>;
> >> >> interrupts = <8 IRQ_TYPE_EDGE_RISING>;
> >> >> };
> >> >> };
> >> >>
> >> >> >
> >> >> > alex
> >> >> >
> >> >> >
> >> >> >>
> >> >> >>>
> >> >> >>> Thanks in advance
> >> >> >>> Alex
> >> >> >>>
> >> >> >>>
> >> >> >>>>
> >> >> >>>> Author: Bruno Herrera <bruherrera@gmail.com>
> >> >> >>>> Date: Sun Oct 16 14:50:00 2016 -0200
> >> >> >>>>
> >> >> >>>> ARM: DT: STM32: Use dma-ranges property per board not at
> dtsi
> >> >> >>>> file
> >> >> >>>>
> >> >> >>>> diff --git a/arch/arm/boot/dts/stm32429i-eval.dts
> >> >> >>>> b/arch/arm/boot/dts/stm32429i-eval.dts
> >> >> >>>> index 6bfc595..2a22a82 100644
> >> >> >>>> --- a/arch/arm/boot/dts/stm32429i-eval.dts
> >> >> >>>> +++ b/arch/arm/boot/dts/stm32429i-eval.dts
> >> >> >>>> @@ -52,6 +52,10 @@
> >> >> >>>> model = "STMicroelectronics STM32429i-EVAL board";
> >> >> >>>> compatible = "st,stm32429i-eval", "st,stm32f429";
> >> >> >>>>
> >> >> >>>> + soc {
> >> >> >>>> + dma-ranges = <0xC0000000 0x0 0x10000000>;
> >> >> >>>> + };
> >> >> >>>> +
> >> >> >>>> chosen {
> >> >> >>>> bootargs = "root=/dev/ram rdinit=/linuxrc";
> >> >> >>>> stdout-path = "serial0:115200n8";
> >> >> >>>> @@ -96,6 +100,7 @@
> >> >> >>>>
> >> >> >>>> ðernet0 {
> >> >> >>>> status = "okay";
> >> >> >>>> + dma-ranges;
> >> >> >>>> pinctrl-0 = <ðernet0_mii>;
> >> >> >>>> pinctrl-names = "default";
> >> >> >>>> phy-mode = "mii-id";
> >> >> >>>> @@ -116,6 +121,7 @@
> >> >> >>>> };
> >> >> >>>>
> >> >> >>>> &usbotg_hs {
> >> >> >>>> + dma-ranges;
> >> >> >>>> dr_mode = "host";
> >> >> >>>> phys = <&usbotg_hs_phy>;
> >> >> >>>> phy-names = "usb2-phy";
> >> >> >>>> diff --git a/arch/arm/boot/dts/stm32f429.dtsi
> >> >> >>>> b/arch/arm/boot/dts/stm32f429.dtsi
> >> >> >>>> index 7d624a2..697a133 100644
> >> >> >>>> --- a/arch/arm/boot/dts/stm32f429.dtsi
> >> >> >>>> +++ b/arch/arm/boot/dts/stm32f429.dtsi
> >> >> >>>> @@ -59,7 +59,6 @@
> >> >> >>>> };
> >> >> >>>>
> >> >> >>>> soc {
> >> >> >>>> - dma-ranges = <0xc0000000 0x0 0x10000000>;
> >> >> >>>>
> >> >> >>>> timer2: timer@40000000 {
> >> >> >>>> compatible = "st,stm32-timer";
> >> >> >>>> @@ -472,13 +471,11 @@
> >> >> >>>> st,syscon = <&syscfg 0x4>;
> >> >> >>>> snps,pbl = <8>;
> >> >> >>>> snps,mixed-burst;
> >> >> >>>> - dma-ranges;
> >> >> >>>> status = "disabled";
> >> >> >>>> };
> >> >> >>>>
> >> >> >>>> usbotg_hs: usb@40040000 {
> >> >> >>>> compatible = "snps,dwc2";
> >> >> >>>> - dma-ranges;
> >> >> >>>> reg = <0x40040000 0x40000>;
> >> >> >>>> interrupts = <77>;
> >> >> >>>> clocks = <&rcc 0 29>;
> >> >> >>>>
> >> >> >>>>
> >> >> >>>>> diff --git a/arch/arm/boot/dts/stm32f429.dtsi
> >> >> >>>>> b/arch/arm/boot/dts/stm32f429.dtsi
> >> >> >>>>> index 0596d60..3a1cfdd 100644
> >> >> >>>>> --- a/arch/arm/boot/dts/stm32f429.dtsi
> >> >> >>>>> +++ b/arch/arm/boot/dts/stm32f429.dtsi
> >> >> >>>>> @@ -59,8 +59,6 @@
> >> >> >>>>> };
> >> >> >>>>>
> >> >> >>>>> soc {
> >> >> >>>>> - dma-ranges = <0xc0000000 0x0 0x10000000>;
> >> >> >>>>> -
> >> >> >>>>> timer2: timer@40000000 {
> >> >> >>>>> compatible = "st,stm32-timer";
> >> >> >>>>> reg = <0x40000000 0x400>;
> >> >> >>>>> diff --git a/arch/arm/boot/dts/stm32f469-disco.dts
> >> >> >>>>> b/arch/arm/boot/dts/stm32f469-disco.dts
> >> >> >>>>> index 9e73656..c2213c0 100644
> >> >> >>>>> --- a/arch/arm/boot/dts/stm32f469-disco.dts
> >> >> >>>>> +++ b/arch/arm/boot/dts/stm32f469-disco.dts
> >> >> >>>>> @@ -64,6 +64,10 @@
> >> >> >>>>> aliases {
> >> >> >>>>> serial0 = &usart3;
> >> >> >>>>> };
> >> >> >>>>> +
> >> >> >>>>> + soc {
> >> >> >>>>> + dma-ranges = <0xc0000000 0x0 0x10000000>;
> >> >> >>>>> + };
> >> >> >>>>> };
> >> >> >>>>>
> >> >> >>>>> &clk_hse {
> >> >> >>>>> --
> >> >> >>>>
> >> >> >>>>
> >> >> >>>>
> >> >> >>>>
> >> >> >>>> Br.,
> >> >> >>>> Bruno
> >> >> >>>>
> >> >> >>>
> >> >> >
> >> >>
> >> >> _______________________________________________
> >> >> linux-arm-kernel mailing list
> >> >> linux-arm-kernel@lists.infradead.org
> >> >> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> >> >
> >> >
> >
> >
>
[-- Attachment #2: Type: text/html, Size: 19849 bytes --]
next prev parent reply other threads:[~2016-10-31 18:58 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-25 21:06 [PATCH] ARM: DT: stm32: move dma translation to board files Bruno Herrera
[not found] ` <CAF3+Tqd2MGmz+8XhLXhaZiEc78QOwHSpVrQA65-p1AcfT+_xgg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-26 9:09 ` Alexandre Torgue
2016-10-27 10:43 ` Bruno Herrera
2016-10-27 12:21 ` Alexandre Torgue
2016-10-27 12:57 ` Bruno Herrera
2016-10-28 7:09 ` Radosław Pietrzyk
[not found] ` <CAFvLkMQGVygLb9SQ8o+2Q=bg7vvRjpHypmSyjRyLkdcHypoFHw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-31 10:27 ` Bruno Herrera
2016-10-31 14:14 ` Radosław Pietrzyk
[not found] ` <CAFvLkMQ6YMg4sf2Ug8x4-YshwnjbLz3aVzm+JpKP6zG9r-WU4Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-31 16:41 ` Bruno Herrera
2016-10-31 18:58 ` Radosław Pietrzyk [this message]
[not found] ` <CAFvLkMTCkRcwbRc8GVNBoJFAvKWHYDjOPabueQPjTseZrucadA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-11-02 14:32 ` Alexandre Torgue
[not found] ` <3e854414-f51d-3e59-6cee-142106cef40f-qxv4g6HH51o@public.gmane.org>
2016-11-02 16:07 ` Bruno Herrera
[not found] ` <CAF3+TqeiPjtG7Fs1-cpbcHGxxtSS1UOGD=S=sggpaZahFLJhEQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-11-02 16:14 ` Alexandre Torgue
[not found] ` <edf05ad5-924d-87d8-fd8d-57e8e0a72052-qxv4g6HH51o@public.gmane.org>
2016-11-02 18:24 ` Bruno Herrera
2016-11-02 18:05 ` Radosław Pietrzyk
[not found] ` <CAFvLkMSViXggGr0Set0qnQan_+bXUNzJx5WtZHP-Jyje=ZzDVw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-11-02 18:23 ` Bruno Herrera
2016-11-03 7:43 ` Radosław Pietrzyk
2016-11-03 8:40 ` Alexandre Torgue
-- strict thread matches above, loose matches on Subject: below --
2016-10-25 16:16 Alexandre TORGUE
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFvLkMTCkRcwbRc8GVNBoJFAvKWHYDjOPabueQPjTseZrucadA@mail.gmail.com \
--to=radoslaw.pietrzyk@gmail.com \
--cc=alexandre.torgue@st.com \
--cc=arnd@arndb.de \
--cc=bruherrera@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=mark.rutland@arm.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=peter.griffin@linaro.org \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).