2020-09-10 05:50:41

by Hsin-Yi Wang

[permalink] [raw]
Subject: [PATCH 1/2] arm64: dts: mt8173: elm: Set uart0 to mmio32 iotype

Set uart0 iotype to mmio32 to make earlycon work with stdout-path.

Signed-off-by: Hsin-Yi Wang <[email protected]>
---
arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
index a5a12b2599a4a..d54e62f72c65d 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
@@ -1160,6 +1160,8 @@ &thermal {
};

&uart0 {
+ reg-io-width = <4>;
+ reg-shift = <2>;
status = "okay";
};

--
2.28.0.526.ge36021eeef-goog


2020-09-10 05:51:41

by Hsin-Yi Wang

[permalink] [raw]
Subject: [PATCH 2/2] arm64: dts: mt8183: kukui: Set uart0 to mmio32 iotype

Set uart0 iotype to mmio32 to make earlycon work with stdout-path.

Signed-off-by: Hsin-Yi Wang <[email protected]>
---
arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
index f0a070535b340..f6991bdaac1c6 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
@@ -750,6 +750,8 @@ &u3phy {
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pins_default>;
+ reg-io-width = <4>;
+ reg-shift = <2>;
status = "okay";
};

--
2.28.0.526.ge36021eeef-goog

2020-09-10 07:22:48

by Enric Balletbo i Serra

[permalink] [raw]
Subject: Re: [PATCH 1/2] arm64: dts: mt8173: elm: Set uart0 to mmio32 iotype

Hi Hsin-Yi,

On 10/9/20 7:46, Hsin-Yi Wang wrote:
> Set uart0 iotype to mmio32 to make earlycon work with stdout-path.
>
> Signed-off-by: Hsin-Yi Wang <[email protected]>
> ---
> arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
> index a5a12b2599a4a..d54e62f72c65d 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
> @@ -1160,6 +1160,8 @@ &thermal {
> };
>
> &uart0 {
> + reg-io-width = <4>;
> + reg-shift = <2>;

I am wondering if these properties are common enough to go to mt8173.dtsi
instead of here.

> status = "okay";
> };
>
>

2020-09-10 08:00:46

by Hsin-Yi Wang

[permalink] [raw]
Subject: Re: [PATCH 1/2] arm64: dts: mt8173: elm: Set uart0 to mmio32 iotype

On Thu, Sep 10, 2020 at 3:20 PM Enric Balletbo i Serra
<[email protected]> wrote:
>
> Hi Hsin-Yi,
>
> On 10/9/20 7:46, Hsin-Yi Wang wrote:
> > Set uart0 iotype to mmio32 to make earlycon work with stdout-path.
> >
> > Signed-off-by: Hsin-Yi Wang <[email protected]>
> > ---
> > arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
> > index a5a12b2599a4a..d54e62f72c65d 100644
> > --- a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
> > +++ b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
> > @@ -1160,6 +1160,8 @@ &thermal {
> > };
> >
> > &uart0 {
> > + reg-io-width = <4>;
> > + reg-shift = <2>;
>
> I am wondering if these properties are common enough to go to mt8173.dtsi
> instead of here.
>
Since stdout-path is set on elm.dtsi (using uart0), so I add this
attribute here.

2020-09-10 08:28:07

by Enric Balletbo i Serra

[permalink] [raw]
Subject: Re: [PATCH 1/2] arm64: dts: mt8173: elm: Set uart0 to mmio32 iotype

Hi Hsin-Yi,

On 10/9/20 9:57, Hsin-Yi Wang wrote:
> On Thu, Sep 10, 2020 at 3:20 PM Enric Balletbo i Serra
> <[email protected]> wrote:
>>
>> Hi Hsin-Yi,
>>
>> On 10/9/20 7:46, Hsin-Yi Wang wrote:
>>> Set uart0 iotype to mmio32 to make earlycon work with stdout-path.
>>>
>>> Signed-off-by: Hsin-Yi Wang <[email protected]>
>>> ---
>>> arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
>>> index a5a12b2599a4a..d54e62f72c65d 100644
>>> --- a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
>>> +++ b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
>>> @@ -1160,6 +1160,8 @@ &thermal {
>>> };
>>>
>>> &uart0 {
>>> + reg-io-width = <4>;
>>> + reg-shift = <2>;
>>
>> I am wondering if these properties are common enough to go to mt8173.dtsi
>> instead of here.
>>
> Since stdout-path is set on elm.dtsi (using uart0), so I add this
> attribute here.
>

Why needs to be defined in the same place that stdout-path is set?

My guess is that reg-io-width and reg-shift are SoC specific, as they define how
the IO access to the register is done. In fact, I think that these properties
should be added in all the uarts, not only the one that has defined the stdout-path.

Cheers,
Enric

2020-09-10 08:48:32

by Hsin-Yi Wang

[permalink] [raw]
Subject: Re: [PATCH 1/2] arm64: dts: mt8173: elm: Set uart0 to mmio32 iotype

On Thu, Sep 10, 2020 at 4:16 PM Enric Balletbo i Serra
<[email protected]> wrote:
>
> Hi Hsin-Yi,
>
> On 10/9/20 9:57, Hsin-Yi Wang wrote:
> > On Thu, Sep 10, 2020 at 3:20 PM Enric Balletbo i Serra
> > <[email protected]> wrote:
> >>
> >> Hi Hsin-Yi,
> >>
> >> On 10/9/20 7:46, Hsin-Yi Wang wrote:
> >>> Set uart0 iotype to mmio32 to make earlycon work with stdout-path.
> >>>
> >>> Signed-off-by: Hsin-Yi Wang <[email protected]>
> >>> ---
> >>> arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 2 ++
> >>> 1 file changed, 2 insertions(+)
> >>>
> >>> diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
> >>> index a5a12b2599a4a..d54e62f72c65d 100644
> >>> --- a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
> >>> +++ b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
> >>> @@ -1160,6 +1160,8 @@ &thermal {
> >>> };
> >>>
> >>> &uart0 {
> >>> + reg-io-width = <4>;
> >>> + reg-shift = <2>;
> >>
> >> I am wondering if these properties are common enough to go to mt8173.dtsi
> >> instead of here.
> >>
> > Since stdout-path is set on elm.dtsi (using uart0), so I add this
> > attribute here.
> >
>
> Why needs to be defined in the same place that stdout-path is set?
>
> My guess is that reg-io-width and reg-shift are SoC specific, as they define how
> the IO access to the register is done. In fact, I think that these properties
> should be added in all the uarts, not only the one that has defined the stdout-path.
>
Okay, I'll apply them to all uart. Thanks.