diff mbox series

[v5,4/4] arm64: dts: meson: Add MagicBox M16S support

Message ID tencent_9D885D188E51B537DB904A774CEC35E4180A@qq.com (mailing list archive)
State New, archived
Headers show
Series [v5,1/4] media: rc: add keymap for MagicBox M16S remote | expand

Commit Message

Zhang Ning July 24, 2022, 11:17 p.m. UTC
MagicBox M16S or MagicBox 3Pro is popular Tv box in China.
with spec:

 - Amlogic S912-H (S912 with dolby and dts)
 - 2G ddr3
 - 16G emmc
 - Marvell sd8897 BT/wifi module
 - 100M ethernet
 - IR reciever
 - 4K HDMI
 - AV out
 - Rest hole
 - 5V2A power input
 - white LED

it's q201_v1 according u-boot log.
and it's almost same as Q201 reference design.

add a simple dts to support this Tv box.

Signed-off-by: Zhang Ning <zhangn1985@qq.com>
---
 arch/arm64/boot/dts/amlogic/Makefile          |  1 +
 .../dts/amlogic/meson-gxm-magicbox-m16s.dts   | 40 +++++++++++++++++++
 2 files changed, 41 insertions(+)
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts

Comments

Krzysztof Kozlowski July 25, 2022, 4:32 p.m. UTC | #1
On 25/07/2022 01:17, Zhang Ning wrote:
> MagicBox M16S or MagicBox 3Pro is popular Tv box in China.
> with spec:
> 
>  - Amlogic S912-H (S912 with dolby and dts)
>  - 2G ddr3
>  - 16G emmc
>  - Marvell sd8897 BT/wifi module
>  - 100M ethernet
>  - IR reciever
>  - 4K HDMI
>  - AV out
>  - Rest hole
>  - 5V2A power input
>  - white LED
> 
> it's q201_v1 according u-boot log.
> and it's almost same as Q201 reference design.
> 
> add a simple dts to support this Tv box.
> 
> Signed-off-by: Zhang Ning <zhangn1985@qq.com>
> ---
>  arch/arm64/boot/dts/amlogic/Makefile          |  1 +
>  .../dts/amlogic/meson-gxm-magicbox-m16s.dts   | 40 +++++++++++++++++++
>  2 files changed, 41 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
> 
> diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile
> index 8773211df50e..e0907fb41829 100644
> --- a/arch/arm64/boot/dts/amlogic/Makefile
> +++ b/arch/arm64/boot/dts/amlogic/Makefile
> @@ -44,6 +44,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-libretech-cc.dtb
>  dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-nexbox-a95x.dtb
>  dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-p212.dtb
>  dtb-$(CONFIG_ARCH_MESON) += meson-gxm-khadas-vim2.dtb
> +dtb-$(CONFIG_ARCH_MESON) += meson-gxm-magicbox-m16s.dtb
>  dtb-$(CONFIG_ARCH_MESON) += meson-gxm-mecool-kiii-pro.dtb
>  dtb-$(CONFIG_ARCH_MESON) += meson-gxm-minix-neo-u9h.dtb
>  dtb-$(CONFIG_ARCH_MESON) += meson-gxm-nexbox-a1.dtb
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
> new file mode 100644
> index 000000000000..69e72687ac9c
> --- /dev/null
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
> @@ -0,0 +1,40 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +/*
> + * Copyright (c) 2022 Zhang Ning <zhangn1985@qq.com>
> + */
> +
> +/dts-v1/;
> +
> +#include "meson-gxm.dtsi"
> +#include "meson-gx-p23x-q20x.dtsi"
> +#include <dt-bindings/input/input.h>
> +
> +/ {
> +	compatible = "magicbox,m16s", "amlogic,s912", "amlogic,meson-gxm";
> +	model = "MagicBox M16S";
> +
> +	gpio-keys-polled {

Just gpio-keys (or even "keys").

> +		compatible = "gpio-keys-polled";
> +		#address-cells = <1>;
> +		#size-cells = <0>;

Address/size cells are not correct.

> +		poll-interval = <100>;
> +
> +		button-power {
> +			label = "power";
> +			linux,code = <KEY_POWER>;
> +			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
> +		};
> +	};
> +};

Missing blank line.

> +&ethmac {


Best regards,
Krzysztof
Zhang Ning July 26, 2022, 12:04 a.m. UTC | #2
On Mon, Jul 25, 2022 at 06:32:17PM +0200, Krzysztof Kozlowski wrote:
> On 25/07/2022 01:17, Zhang Ning wrote:
> > MagicBox M16S or MagicBox 3Pro is popular Tv box in China.
> > with spec:
> > 
> >  - Amlogic S912-H (S912 with dolby and dts)
> >  - 2G ddr3
> >  - 16G emmc
> >  - Marvell sd8897 BT/wifi module
> >  - 100M ethernet
> >  - IR reciever
> >  - 4K HDMI
> >  - AV out
> >  - Rest hole
> >  - 5V2A power input
> >  - white LED
> > 
> > it's q201_v1 according u-boot log.
> > and it's almost same as Q201 reference design.
> > 
> > add a simple dts to support this Tv box.
> > 
> > Signed-off-by: Zhang Ning <zhangn1985@qq.com>
> > ---
> >  arch/arm64/boot/dts/amlogic/Makefile          |  1 +
> >  .../dts/amlogic/meson-gxm-magicbox-m16s.dts   | 40 +++++++++++++++++++
> >  2 files changed, 41 insertions(+)
> >  create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
> > 
> > diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile
> > index 8773211df50e..e0907fb41829 100644
> > --- a/arch/arm64/boot/dts/amlogic/Makefile
> > +++ b/arch/arm64/boot/dts/amlogic/Makefile
> > @@ -44,6 +44,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-libretech-cc.dtb
> >  dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-nexbox-a95x.dtb
> >  dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-p212.dtb
> >  dtb-$(CONFIG_ARCH_MESON) += meson-gxm-khadas-vim2.dtb
> > +dtb-$(CONFIG_ARCH_MESON) += meson-gxm-magicbox-m16s.dtb
> >  dtb-$(CONFIG_ARCH_MESON) += meson-gxm-mecool-kiii-pro.dtb
> >  dtb-$(CONFIG_ARCH_MESON) += meson-gxm-minix-neo-u9h.dtb
> >  dtb-$(CONFIG_ARCH_MESON) += meson-gxm-nexbox-a1.dtb
> > diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
> > new file mode 100644
> > index 000000000000..69e72687ac9c
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
> > @@ -0,0 +1,40 @@
> > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> > +/*
> > + * Copyright (c) 2022 Zhang Ning <zhangn1985@qq.com>
> > + */
> > +
> > +/dts-v1/;
> > +
> > +#include "meson-gxm.dtsi"
> > +#include "meson-gx-p23x-q20x.dtsi"
> > +#include <dt-bindings/input/input.h>
> > +
> > +/ {
> > +	compatible = "magicbox,m16s", "amlogic,s912", "amlogic,meson-gxm";
> > +	model = "MagicBox M16S";
> > +
> > +	gpio-keys-polled {
> 
> Just gpio-keys (or even "keys").
I see all dts for amlogic platform are using gpio-keys-polled, could I
keep current name?
> 
> > +		compatible = "gpio-keys-polled";
> > +		#address-cells = <1>;
> > +		#size-cells = <0>;
> 
> Address/size cells are not correct.
Yes, this has been already pointed out in V3's review, but I forgot to
delete these 2 lines.
thank you review it again.

> 
> > +		poll-interval = <100>;
> > +
> > +		button-power {
> > +			label = "power";
> > +			linux,code = <KEY_POWER>;
> > +			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
> > +		};
> > +	};
> > +};
> 
> Missing blank line.
thank you, will add it in next version.
> 
> > +&ethmac {
> 
> 
> Best regards,
> Krzysztof
Krzysztof Kozlowski July 26, 2022, 6:48 a.m. UTC | #3
On 26/07/2022 02:04, Zhang Ning wrote:

>>> +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
>>> @@ -0,0 +1,40 @@
>>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>>> +/*
>>> + * Copyright (c) 2022 Zhang Ning <zhangn1985@qq.com>
>>> + */
>>> +
>>> +/dts-v1/;
>>> +
>>> +#include "meson-gxm.dtsi"
>>> +#include "meson-gx-p23x-q20x.dtsi"
>>> +#include <dt-bindings/input/input.h>
>>> +
>>> +/ {
>>> +	compatible = "magicbox,m16s", "amlogic,s912", "amlogic,meson-gxm";
>>> +	model = "MagicBox M16S";
>>> +
>>> +	gpio-keys-polled {
>>
>> Just gpio-keys (or even "keys").
> I see all dts for amlogic platform are using gpio-keys-polled, could I
> keep current name?

Node names should be generic.
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation


Best regards,
Krzysztof
Zhang Ning July 26, 2022, 8:51 a.m. UTC | #4
On Tue, Jul 26, 2022 at 08:48:45AM +0200, Krzysztof Kozlowski wrote:
> On 26/07/2022 02:04, Zhang Ning wrote:
> 
> >>> +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
> >>> @@ -0,0 +1,40 @@
> >>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> >>> +/*
> >>> + * Copyright (c) 2022 Zhang Ning <zhangn1985@qq.com>
> >>> + */
> >>> +
> >>> +/dts-v1/;
> >>> +
> >>> +#include "meson-gxm.dtsi"
> >>> +#include "meson-gx-p23x-q20x.dtsi"
> >>> +#include <dt-bindings/input/input.h>
> >>> +
> >>> +/ {
> >>> +	compatible = "magicbox,m16s", "amlogic,s912", "amlogic,meson-gxm";
> >>> +	model = "MagicBox M16S";
> >>> +
> >>> +	gpio-keys-polled {
> >>
> >> Just gpio-keys (or even "keys").
> > I see all dts for amlogic platform are using gpio-keys-polled, could I
> > keep current name?
> 
> Node names should be generic.
> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
thank you let me know this, I will update in next version.
> 
> 
> Best regards,
> Krzysztof
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile
index 8773211df50e..e0907fb41829 100644
--- a/arch/arm64/boot/dts/amlogic/Makefile
+++ b/arch/arm64/boot/dts/amlogic/Makefile
@@ -44,6 +44,7 @@  dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-libretech-cc.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-nexbox-a95x.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-p212.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxm-khadas-vim2.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-gxm-magicbox-m16s.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxm-mecool-kiii-pro.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxm-minix-neo-u9h.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxm-nexbox-a1.dtb
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
new file mode 100644
index 000000000000..69e72687ac9c
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
@@ -0,0 +1,40 @@ 
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2022 Zhang Ning <zhangn1985@qq.com>
+ */
+
+/dts-v1/;
+
+#include "meson-gxm.dtsi"
+#include "meson-gx-p23x-q20x.dtsi"
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "magicbox,m16s", "amlogic,s912", "amlogic,meson-gxm";
+	model = "MagicBox M16S";
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <100>;
+
+		button-power {
+			label = "power";
+			linux,code = <KEY_POWER>;
+			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+&ethmac {
+        phy-mode = "rmii";
+        phy-handle = <&internal_phy>;
+};
+
+&sdio_pwrseq {
+	reset-gpios = <&gpio GPIODV_2 GPIO_ACTIVE_LOW>;
+};
+
+&ir {
+        linux,rc-map-name = "rc-magicbox";
+};