[PATCH v2] rockchip: rk3328: add support for FriendlyARM NanoPi NEO3

Brian Norris computersforpeace at gmail.com
Fri Feb 25 19:53:23 PST 2022


Hi,

On Sun, Jan 23, 2022 at 05:19:19PM +0100, Julian Pidancet wrote:
> This patch adds support for FriendlyARM NanoPi NEO3
> 
> Soc:      RockChip RK3328
> RAM:      1GB/2GB DDR4
> LAN:      10/100/1000M Ethernet with unique MAC
> USB Host: 1x USB3.0 Type A and 2x USB2.0 on 2.54mm pin header
> MicroSD:  x 1 for system boot and storage
> LED:      Power LED x 1, System LED x 1
> Key:      User Button x 1
> Fan:      2 Pin JST ZH 1.5mm Connector for 5V Fan
> GPIO:     26 pin-header, include I2C, UART, SPI, I2S, GPIO
> Power:    5V/1A, via Type-C or GPIO
> 
> Signed-off-by: Julian Pidancet <julian at pidancet.net>

> --- a/arch/arm64/boot/dts/rockchip/Makefile
> +++ b/arch/arm64/boot/dts/rockchip/Makefile
> @@ -10,6 +10,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3326-odroid-go2.dtb
>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-a1.dtb
>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-evb.dtb
>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-r2s.dtb
> +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-neo3.dtb

Alphabetical order; neo3 goes before r2s.

>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-rock64.dtb
>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-rock-pi-e.dtb
>  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-roc-cc.dtb
> diff --git a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-neo3.dts b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-neo3.dts
> new file mode 100644
> index 000000000..1eb7fd5f7
> --- /dev/null
> +++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-neo3.dts
> @@ -0,0 +1,396 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +/*
> + * Copyright (c) 2020 David Bauer <mail at david-bauer.net>
> + * Copyright (c) 2022 Julian Pidancet <julian at pidancet.net>
> + */
> +
> +/dts-v1/;
> +
> +#include <dt-bindings/input/input.h>
> +#include <dt-bindings/gpio/gpio.h>

Alphabetical order? So this goes before ../input.

> +#include "rk3328.dtsi"
> +
> +/ {
> +	model = "FriendlyElec NanoPi NEO3";
> +	compatible = "friendlyarm,nanopi-neo3", "rockchip,rk3328";
> +
> +	aliases {
> +		led-boot = &stat_led;
> +		led-failsafe = &stat_led;
> +		led-running = &stat_led;
> +		led-upgrade = &stat_led;

I'm pretty sure all these led-* aliases are OpenWRT extensions and
probably shouldn't be included in upstream device trees.

> +	};
...
> +	leds {
> +		compatible = "gpio-leds";
> +		pinctrl-0 = <&stat_led_pin>;
> +		pinctrl-names = "default";
> +
> +		stat_led: led-0 {
> +			gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
> +			label = "nanopi-neo4:green:stat";

This property is deprecated in favor of "color" and "function". For
function, maybe LED_FUNCTION_STATUS? See
Documentation/devicetree/bindings/leds/common.yaml.

> +		};
> +	};

...

> +&usbdrd_dwc3 {
> +	dr_mode = "host";
> +	status = "okay";
> +
> +	usb-eth at 2 {
> +		compatible = "realtek,rtl8153";
> +		reg = <2>;
> +
> +		realtek,led-data = <0x87>;

This compatible and property are all downstream OpenWRT; they don't
exist upstream. So you should drop them if you're trying to get this DTS
merged upstream.

You might also be able to head off some similar issues by running
through the schema checks. See:

Documentation/devicetree/writing-schema.rst
and
make dtbs_check

Brian

> +	};
> +};



More information about the linux-arm-kernel mailing list