Re: [PATCH 5/5] arm64: dts: meson: add initial device-tree for ODROID-HC4

2021-01-28 Thread Christian Hewitt


> On 29 Jan 2021, at 10:51 am, Christian Hewitt  
> wrote:
> 
> ODROID-HC4 is a derivative of the C4 with minor differences:
> 
> - 128MB SPI-NOR flash

^ should be 16MB, I forgot to amend. I can send a v2 series if needed.

HC4:~ # dmesg | grep spi
[0.453235] spi-nor spi0.0: xt25f128b (16384 Kbytes)

Christian



[PATCH 5/5] arm64: dts: meson: add initial device-tree for ODROID-HC4

2021-01-28 Thread Christian Hewitt
ODROID-HC4 is a derivative of the C4 with minor differences:

- 128MB SPI-NOR flash
- 2x SATA ports via ASM1061 PCIe to SATA controller
- 7-pin header with SPI and I2C for 1-inch OLED display and RTC
- 1x USB 2.0 host port

Signed-off-by: Christian Hewitt 
---
 arch/arm64/boot/dts/amlogic/Makefile  |  1 +
 .../boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 96 +++
 2 files changed, 97 insertions(+)
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts

diff --git a/arch/arm64/boot/dts/amlogic/Makefile 
b/arch/arm64/boot/dts/amlogic/Makefile
index f3c8a85fe987..78a569d7fa20 100644
--- a/arch/arm64/boot/dts/amlogic/Makefile
+++ b/arch/arm64/boot/dts/amlogic/Makefile
@@ -47,5 +47,6 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxm-vega-s96.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxm-wetek-core2.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-sm1-khadas-vim3l.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-sm1-odroid-c4.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-sm1-odroid-hc4.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-sm1-sei610.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-a1-ad401.dtb
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts 
b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
new file mode 100644
index ..bf15700c4b15
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
@@ -0,0 +1,96 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2020 Dongjin Kim 
+ */
+
+/dts-v1/;
+
+#include "meson-sm1-odroid.dtsi"
+
+/ {
+   compatible = "hardkernel,odroid-hc4", "amlogic,sm1";
+   model = "Hardkernel ODROID-HC4";
+
+   aliases {
+   rtc0 = 
+   rtc1 = 
+   };
+
+   fan0: pwm-fan {
+   compatible = "pwm-fan";
+   #cooling-cells = <2>;
+   cooling-min-state = <0>;
+   cooling-max-state = <3>;
+   cooling-levels = <0 120 170 220>;
+   pwms = <_cd 1 4 0>;
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   led-blue {
+   color = ;
+   function = LED_FUNCTION_STATUS;
+   gpios = <_ao GPIOAO_11 GPIO_ACTIVE_HIGH>;
+   linux,default-trigger = "heartbeat";
+   panic-indicator;
+   };
+
+   led-red {
+   color = ;
+   function = LED_FUNCTION_POWER;
+   gpios = <_ao GPIOAO_7 GPIO_ACTIVE_HIGH>;
+   default-state = "on";
+   };
+   };
+
+   sound {
+   model = "ODROID-HC4";
+   };
+};
+
+_thermal {
+   cooling-maps {
+   map {
+   trip = <_passive>;
+   cooling-device = < THERMAL_NO_LIMIT 
THERMAL_NO_LIMIT>;
+   };
+   };
+};
+
+ {
+   linux,rc-map-name = "rc-odroid";
+};
+
+ {
+   status = "okay";
+   pinctrl-0 = <_sda_x_pins>, <_sck_x_pins>;
+   pinctrl-names = "default";
+
+   rtc: rtc@51 {
+   status = "okay";
+   compatible = "nxp,pcf8563";
+   reg = <0x51>;
+   wakeup-source;
+   };
+};
+
+ {
+   status = "okay";
+   reset-gpios = < GPIOH_4 GPIO_ACTIVE_LOW>;
+};
+
+_cd {
+   status = "okay";
+   pinctrl-names = "default";
+   pinctrl-0 = <_d_x6_pins>;
+};
+
+_emmc_c {
+   status = "disabled";
+};
+
+ {
+   phys = <_phy0>, <_phy1>;
+   phy-names = "usb2-phy0", "usb2-phy1";
+};
-- 
2.17.1