linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: arm: Add MT6589 Fairphone 1
@ 2021-10-05 20:28 Luca Weiss
  2021-10-05 20:28 ` [PATCH 2/2] arm: dts: mt6589: Add device tree for " Luca Weiss
  2021-10-08 14:33 ` [PATCH 1/2] dt-bindings: arm: Add MT6589 " Matthias Brugger
  0 siblings, 2 replies; 6+ messages in thread
From: Luca Weiss @ 2021-10-05 20:28 UTC (permalink / raw)
  To: linux-mediatek
  Cc: ~postmarketos/upstreaming, Arnd Bergmann, Enric Balletbo i Serra,
	Fabien Parent, Hsin-Yi Wang, Luca Weiss, Matthias Brugger,
	Olof Johansson, Rob Herring, Sean Wang, Seiya Wang, devicetree,
	linux-arm-kernel, linux-kernel, soc

Add the compatible for Fairphone 1 smartphone with MT6589 SoC.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 Documentation/devicetree/bindings/arm/mediatek.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/arm/mediatek.yaml b/Documentation/devicetree/bindings/arm/mediatek.yaml
index 80a05f6fee85..0fa55497b96f 100644
--- a/Documentation/devicetree/bindings/arm/mediatek.yaml
+++ b/Documentation/devicetree/bindings/arm/mediatek.yaml
@@ -32,6 +32,7 @@ properties:
           - const: mediatek,mt6580
       - items:
           - enum:
+              - fairphone,fp1
               - mundoreader,bq-aquaris5
           - const: mediatek,mt6589
       - items:
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] arm: dts: mt6589: Add device tree for Fairphone 1
  2021-10-05 20:28 [PATCH 1/2] dt-bindings: arm: Add MT6589 Fairphone 1 Luca Weiss
@ 2021-10-05 20:28 ` Luca Weiss
  2021-10-08 11:49   ` Matthias Brugger
  2021-10-08 14:33 ` [PATCH 1/2] dt-bindings: arm: Add MT6589 " Matthias Brugger
  1 sibling, 1 reply; 6+ messages in thread
From: Luca Weiss @ 2021-10-05 20:28 UTC (permalink / raw)
  To: linux-mediatek
  Cc: ~postmarketos/upstreaming, Arnd Bergmann, Enric Balletbo i Serra,
	Fabien Parent, Hsin-Yi Wang, Luca Weiss, Matthias Brugger,
	Olof Johansson, Rob Herring, Sean Wang, Seiya Wang, devicetree,
	linux-arm-kernel, linux-kernel, soc

Add rudimentary support for the Fairphone 1, based on MT6589 to boot to
UART console.

The recently added SMP support needs to be disabled for this board as
the kernel panics executing /init with it, even though the CPUs seem to
start up fine - maybe a stability issue.

[    0.072010] smp: Bringing up secondary CPUs ...
[    0.131888] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.191889] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.251890] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.251982] smp: Brought up 1 node, 4 CPUs
[    0.254745] SMP: Total of 4 processors activated (7982.28 BogoMIPS).
[    0.255582] CPU: All CPU(s) started in SVC mode.

[    0.472039] Run /init as init process
[    0.473317] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 arch/arm/boot/dts/Makefile                 |  1 +
 arch/arm/boot/dts/mt6589-fairphone-fp1.dts | 30 ++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 arch/arm/boot/dts/mt6589-fairphone-fp1.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 7e0934180724..24f402db2613 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -1437,6 +1437,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
 	mt2701-evb.dtb \
 	mt6580-evbp1.dtb \
 	mt6589-aquaris5.dtb \
+	mt6589-fairphone-fp1.dtb \
 	mt6592-evb.dtb \
 	mt7623a-rfb-emmc.dtb \
 	mt7623a-rfb-nand.dtb \
diff --git a/arch/arm/boot/dts/mt6589-fairphone-fp1.dts b/arch/arm/boot/dts/mt6589-fairphone-fp1.dts
new file mode 100644
index 000000000000..32c14ecf2244
--- /dev/null
+++ b/arch/arm/boot/dts/mt6589-fairphone-fp1.dts
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2021, Luca Weiss <luca@z3ntu.xyz>
+ */
+
+/dts-v1/;
+#include "mt6589.dtsi"
+
+/ {
+	model = "Fairphone 1";
+	compatible = "fairphone,fp1", "mediatek,mt6589";
+
+	chosen {
+		stdout-path = &uart3;
+	};
+
+	cpus {
+		/* SMP is not stable on this board, makes the kernel panic */
+		/delete-property/ enable-method;
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x40000000>;
+	};
+};
+
+&uart3 {
+	status = "okay";
+};
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] arm: dts: mt6589: Add device tree for Fairphone 1
  2021-10-05 20:28 ` [PATCH 2/2] arm: dts: mt6589: Add device tree for " Luca Weiss
@ 2021-10-08 11:49   ` Matthias Brugger
  2021-10-12 17:54     ` Luca Weiss
  0 siblings, 1 reply; 6+ messages in thread
From: Matthias Brugger @ 2021-10-08 11:49 UTC (permalink / raw)
  To: Luca Weiss, linux-mediatek
  Cc: ~postmarketos/upstreaming, Arnd Bergmann, Enric Balletbo i Serra,
	Fabien Parent, Hsin-Yi Wang, Olof Johansson, Rob Herring,
	Sean Wang, Seiya Wang, devicetree, linux-arm-kernel,
	linux-kernel, soc



On 05/10/2021 22:28, Luca Weiss wrote:
> Add rudimentary support for the Fairphone 1, based on MT6589 to boot to
> UART console.
> 
> The recently added SMP support needs to be disabled for this board as
> the kernel panics executing /init with it, even though the CPUs seem to
> start up fine - maybe a stability issue.
> 
> [    0.072010] smp: Bringing up secondary CPUs ...
> [    0.131888] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
> [    0.191889] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
> [    0.251890] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
> [    0.251982] smp: Brought up 1 node, 4 CPUs
> [    0.254745] SMP: Total of 4 processors activated (7982.28 BogoMIPS).
> [    0.255582] CPU: All CPU(s) started in SVC mode.
> 
> [    0.472039] Run /init as init process
> [    0.473317] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
> 

Would be nice to find out why. Did you tried to boot the system with 
enable-method set but with bringing up just one or two cpus?

> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>   arch/arm/boot/dts/Makefile                 |  1 +
>   arch/arm/boot/dts/mt6589-fairphone-fp1.dts | 30 ++++++++++++++++++++++
>   2 files changed, 31 insertions(+)
>   create mode 100644 arch/arm/boot/dts/mt6589-fairphone-fp1.dts
> 
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index 7e0934180724..24f402db2613 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -1437,6 +1437,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
>   	mt2701-evb.dtb \
>   	mt6580-evbp1.dtb \
>   	mt6589-aquaris5.dtb \
> +	mt6589-fairphone-fp1.dtb \
>   	mt6592-evb.dtb \
>   	mt7623a-rfb-emmc.dtb \
>   	mt7623a-rfb-nand.dtb \
> diff --git a/arch/arm/boot/dts/mt6589-fairphone-fp1.dts b/arch/arm/boot/dts/mt6589-fairphone-fp1.dts
> new file mode 100644
> index 000000000000..32c14ecf2244
> --- /dev/null
> +++ b/arch/arm/boot/dts/mt6589-fairphone-fp1.dts
> @@ -0,0 +1,30 @@
> +// SPDX-License-Identifier: BSD-3-Clause
> +/*
> + * Copyright (c) 2021, Luca Weiss <luca@z3ntu.xyz>
> + */
> +
> +/dts-v1/;
> +#include "mt6589.dtsi"
> +
> +/ {
> +	model = "Fairphone 1";
> +	compatible = "fairphone,fp1", "mediatek,mt6589";
> +
> +	chosen {
> +		stdout-path = &uart3;
> +	};
> +
> +	cpus {

I'd expected "&cpus" why can we overwrite delete the node property like this here?

> +		/* SMP is not stable on this board, makes the kernel panic */
> +		/delete-property/ enable-method;
> +	};
> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0x80000000 0x40000000>;
> +	};
> +};
> +
> +&uart3 {
> +	status = "okay";
> +};
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] dt-bindings: arm: Add MT6589 Fairphone 1
  2021-10-05 20:28 [PATCH 1/2] dt-bindings: arm: Add MT6589 Fairphone 1 Luca Weiss
  2021-10-05 20:28 ` [PATCH 2/2] arm: dts: mt6589: Add device tree for " Luca Weiss
@ 2021-10-08 14:33 ` Matthias Brugger
  1 sibling, 0 replies; 6+ messages in thread
From: Matthias Brugger @ 2021-10-08 14:33 UTC (permalink / raw)
  To: Luca Weiss, linux-mediatek
  Cc: ~postmarketos/upstreaming, Arnd Bergmann, Enric Balletbo i Serra,
	Fabien Parent, Hsin-Yi Wang, Olof Johansson, Rob Herring,
	Sean Wang, Seiya Wang, devicetree, linux-arm-kernel,
	linux-kernel, soc



On 05/10/2021 22:28, Luca Weiss wrote:
> Add the compatible for Fairphone 1 smartphone with MT6589 SoC.
> 
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---

This patch is now applied to v5.15-next/dts32

Thanks!

>   Documentation/devicetree/bindings/arm/mediatek.yaml | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/arm/mediatek.yaml b/Documentation/devicetree/bindings/arm/mediatek.yaml
> index 80a05f6fee85..0fa55497b96f 100644
> --- a/Documentation/devicetree/bindings/arm/mediatek.yaml
> +++ b/Documentation/devicetree/bindings/arm/mediatek.yaml
> @@ -32,6 +32,7 @@ properties:
>             - const: mediatek,mt6580
>         - items:
>             - enum:
> +              - fairphone,fp1
>                 - mundoreader,bq-aquaris5
>             - const: mediatek,mt6589
>         - items:
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] arm: dts: mt6589: Add device tree for Fairphone 1
  2021-10-08 11:49   ` Matthias Brugger
@ 2021-10-12 17:54     ` Luca Weiss
  2021-10-13 16:20       ` Matthias Brugger
  0 siblings, 1 reply; 6+ messages in thread
From: Luca Weiss @ 2021-10-12 17:54 UTC (permalink / raw)
  To: linux-mediatek, Matthias Brugger
  Cc: ~postmarketos/upstreaming, Arnd Bergmann, Enric Balletbo i Serra,
	Fabien Parent, Hsin-Yi Wang, Olof Johansson, Rob Herring,
	Sean Wang, Seiya Wang, devicetree, linux-arm-kernel,
	linux-kernel, soc

Hi Matthias,

On Freitag, 8. Oktober 2021 13:49:25 CEST Matthias Brugger wrote:
> On 05/10/2021 22:28, Luca Weiss wrote:
> > Add rudimentary support for the Fairphone 1, based on MT6589 to boot to
> > UART console.
> > 
> > The recently added SMP support needs to be disabled for this board as
> > the kernel panics executing /init with it, even though the CPUs seem to
> > start up fine - maybe a stability issue.
> > 
> > [    0.072010] smp: Bringing up secondary CPUs ...
> > [    0.131888] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
> > [    0.191889] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
> > [    0.251890] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
> > [    0.251982] smp: Brought up 1 node, 4 CPUs
> > [    0.254745] SMP: Total of 4 processors activated (7982.28 BogoMIPS).
> > [    0.255582] CPU: All CPU(s) started in SVC mode.
> > 
> > [    0.472039] Run /init as init process
> > [    0.473317] Kernel panic - not syncing: Attempted to kill init!
> > exitcode=0x00000004
> Would be nice to find out why. Did you tried to boot the system with
> enable-method set but with bringing up just one or two cpus?

Answered further down.

> 
> > Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> > ---
> > 
> >   arch/arm/boot/dts/Makefile                 |  1 +
> >   arch/arm/boot/dts/mt6589-fairphone-fp1.dts | 30 ++++++++++++++++++++++
> >   2 files changed, 31 insertions(+)
> >   create mode 100644 arch/arm/boot/dts/mt6589-fairphone-fp1.dts
> > 
> > diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> > index 7e0934180724..24f402db2613 100644
> > --- a/arch/arm/boot/dts/Makefile
> > +++ b/arch/arm/boot/dts/Makefile
> > @@ -1437,6 +1437,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
> > 
> >   	mt2701-evb.dtb \
> >   	mt6580-evbp1.dtb \
> >   	mt6589-aquaris5.dtb \
> > 
> > +	mt6589-fairphone-fp1.dtb \
> > 
> >   	mt6592-evb.dtb \
> >   	mt7623a-rfb-emmc.dtb \
> >   	mt7623a-rfb-nand.dtb \
> > 
> > diff --git a/arch/arm/boot/dts/mt6589-fairphone-fp1.dts
> > b/arch/arm/boot/dts/mt6589-fairphone-fp1.dts new file mode 100644
> > index 000000000000..32c14ecf2244
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/mt6589-fairphone-fp1.dts
> > @@ -0,0 +1,30 @@
> > +// SPDX-License-Identifier: BSD-3-Clause
> > +/*
> > + * Copyright (c) 2021, Luca Weiss <luca@z3ntu.xyz>
> > + */
> > +
> > +/dts-v1/;
> > +#include "mt6589.dtsi"
> > +
> > +/ {
> > +	model = "Fairphone 1";
> > +	compatible = "fairphone,fp1", "mediatek,mt6589";
> > +
> > +	chosen {
> > +		stdout-path = &uart3;
> > +	};
> > +
> > +	cpus {
> 
> I'd expected "&cpus" why can we overwrite delete the node property like this
> here?

Both results in the same, dtc just merges everything together, so as long as 
the node name is identical, it works.
Also I cannot use &cpus because cpus in mt6589.dtsi doesn't have a label set.

Regarding SMP:
I have tried setting maxcpus=2 in cmdline and that still makes the kernel 
panic. With maxcpus=1 and leaving the deleting out of the dts the kernel is 
stable and works properly.

So I think it's better to leave this out of the dts and keep maxcpus=1 in 
cmdline (until this gets fixed).

I've also heard from the person adding enable-method to mt6589.dtsi that it 
still works on their board, so something's different, maybe a different SoC 
revision, different bootloader behavior or whatever.

If that's fine with you, I'll send a v2 with that fixed.

> > +		/* SMP is not stable on this board, makes the kernel 
panic */
> > +		/delete-property/ enable-method;
> > +	};
> > +
> > +	memory {

Also I was told off-list that this should be called memory@80000000 because of 
the reg, will fix in v2.

Regards
Luca

> > +		device_type = "memory";
> > +		reg = <0x80000000 0x40000000>;
> > +	};
> > +};
> > +
> > +&uart3 {
> > +	status = "okay";
> > +};





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] arm: dts: mt6589: Add device tree for Fairphone 1
  2021-10-12 17:54     ` Luca Weiss
@ 2021-10-13 16:20       ` Matthias Brugger
  0 siblings, 0 replies; 6+ messages in thread
From: Matthias Brugger @ 2021-10-13 16:20 UTC (permalink / raw)
  To: Luca Weiss, linux-mediatek
  Cc: ~postmarketos/upstreaming, Arnd Bergmann, Enric Balletbo i Serra,
	Fabien Parent, Hsin-Yi Wang, Olof Johansson, Rob Herring,
	Sean Wang, Seiya Wang, devicetree, linux-arm-kernel,
	linux-kernel, soc



On 12/10/2021 19:54, Luca Weiss wrote:
> Hi Matthias,
> 
> On Freitag, 8. Oktober 2021 13:49:25 CEST Matthias Brugger wrote:
>> On 05/10/2021 22:28, Luca Weiss wrote:
>>> Add rudimentary support for the Fairphone 1, based on MT6589 to boot to
>>> UART console.
>>>
>>> The recently added SMP support needs to be disabled for this board as
>>> the kernel panics executing /init with it, even though the CPUs seem to
>>> start up fine - maybe a stability issue.
>>>
>>> [    0.072010] smp: Bringing up secondary CPUs ...
>>> [    0.131888] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
>>> [    0.191889] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
>>> [    0.251890] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
>>> [    0.251982] smp: Brought up 1 node, 4 CPUs
>>> [    0.254745] SMP: Total of 4 processors activated (7982.28 BogoMIPS).
>>> [    0.255582] CPU: All CPU(s) started in SVC mode.
>>>
>>> [    0.472039] Run /init as init process
>>> [    0.473317] Kernel panic - not syncing: Attempted to kill init!
>>> exitcode=0x00000004
>> Would be nice to find out why. Did you tried to boot the system with
>> enable-method set but with bringing up just one or two cpus?
> 
> Answered further down.
> 
>>
>>> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
>>> ---
>>>
>>>    arch/arm/boot/dts/Makefile                 |  1 +
>>>    arch/arm/boot/dts/mt6589-fairphone-fp1.dts | 30 ++++++++++++++++++++++
>>>    2 files changed, 31 insertions(+)
>>>    create mode 100644 arch/arm/boot/dts/mt6589-fairphone-fp1.dts
>>>
>>> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
>>> index 7e0934180724..24f402db2613 100644
>>> --- a/arch/arm/boot/dts/Makefile
>>> +++ b/arch/arm/boot/dts/Makefile
>>> @@ -1437,6 +1437,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
>>>
>>>    	mt2701-evb.dtb \
>>>    	mt6580-evbp1.dtb \
>>>    	mt6589-aquaris5.dtb \
>>>
>>> +	mt6589-fairphone-fp1.dtb \
>>>
>>>    	mt6592-evb.dtb \
>>>    	mt7623a-rfb-emmc.dtb \
>>>    	mt7623a-rfb-nand.dtb \
>>>
>>> diff --git a/arch/arm/boot/dts/mt6589-fairphone-fp1.dts
>>> b/arch/arm/boot/dts/mt6589-fairphone-fp1.dts new file mode 100644
>>> index 000000000000..32c14ecf2244
>>> --- /dev/null
>>> +++ b/arch/arm/boot/dts/mt6589-fairphone-fp1.dts
>>> @@ -0,0 +1,30 @@
>>> +// SPDX-License-Identifier: BSD-3-Clause
>>> +/*
>>> + * Copyright (c) 2021, Luca Weiss <luca@z3ntu.xyz>
>>> + */
>>> +
>>> +/dts-v1/;
>>> +#include "mt6589.dtsi"
>>> +
>>> +/ {
>>> +	model = "Fairphone 1";
>>> +	compatible = "fairphone,fp1", "mediatek,mt6589";
>>> +
>>> +	chosen {
>>> +		stdout-path = &uart3;
>>> +	};
>>> +
>>> +	cpus {
>>
>> I'd expected "&cpus" why can we overwrite delete the node property like this
>> here?
> 
> Both results in the same, dtc just merges everything together, so as long as
> the node name is identical, it works.
> Also I cannot use &cpus because cpus in mt6589.dtsi doesn't have a label set.
> 

Then I think we should add a label and use &cpus, as this is the standard way to go.

> Regarding SMP:
> I have tried setting maxcpus=2 in cmdline and that still makes the kernel
> panic. With maxcpus=1 and leaving the deleting out of the dts the kernel is
> stable and works properly.
> 
> So I think it's better to leave this out of the dts and keep maxcpus=1 in
> cmdline (until this gets fixed).
> 

I'd prefer to disable the enable-method in DTS. You can see the four cores up 
and running without that, so it seems that is already done in the FW, right?

> I've also heard from the person adding enable-method to mt6589.dtsi that it
> still works on their board, so something's different, maybe a different SoC
> revision, different bootloader behavior or whatever.
> 

Sounds like a different bootloader behaviour.

> If that's fine with you, I'll send a v2 with that fixed.
> 
>>> +		/* SMP is not stable on this board, makes the kernel
> panic */
>>> +		/delete-property/ enable-method;
>>> +	};
>>> +
>>> +	memory {
> 
> Also I was told off-list that this should be called memory@80000000 because of
> the reg, will fix in v2.
> 

Correct :)

Thanks,
Matthias

> Regards
> Luca
> 
>>> +		device_type = "memory";
>>> +		reg = <0x80000000 0x40000000>;
>>> +	};
>>> +};
>>> +
>>> +&uart3 {
>>> +	status = "okay";
>>> +};
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-13 16:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05 20:28 [PATCH 1/2] dt-bindings: arm: Add MT6589 Fairphone 1 Luca Weiss
2021-10-05 20:28 ` [PATCH 2/2] arm: dts: mt6589: Add device tree for " Luca Weiss
2021-10-08 11:49   ` Matthias Brugger
2021-10-12 17:54     ` Luca Weiss
2021-10-13 16:20       ` Matthias Brugger
2021-10-08 14:33 ` [PATCH 1/2] dt-bindings: arm: Add MT6589 " Matthias Brugger

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).