[PATCH RFC 19/20] mips: dts: Add Skytone Alpha 400

Lubomir Rintel lkundrak at v3.sk
Tue Nov 17 22:00:17 CET 2020


This generally comes from a mipsbook400 Letux git repository [1], not
mainline. It seems to be the work of Paul Boddie and H. Nikolaus Schaller.

[1] https://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/letux/dt-mipsbook400

Some more things need to be addressed here:

1.) Linux upstream review of the bindings.
    The tree is generally very nice and complete and bindings look good,
    but an upstream review could still cut off some rough edges. In
    particular I think the gpio/pinctrl bindings don't seem to describe
    the hardware in a very useful way (GPIO split into multiple nodes for
    ports slaves to the pinctrl node).

2.) Missing copyright/license notices.
    Probably an oversignt.

3.) I've made some changes that I need to split out into separate patches
    for upstream and document.

Cc: Paul Boddie <paul at boddie.org.uk>
Cc: H. Nikolaus Schaller <hns at goldelico.com>
Signed-off-by: Lubomir Rintel <lkundrak at v3.sk>
---
 arch/mips/dts/Makefile     |   1 +
 arch/mips/dts/alpha400.dts | 542 +++++++++++++++++++++++++++++++++++++
 2 files changed, 543 insertions(+)
 create mode 100644 arch/mips/dts/alpha400.dts

diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile
index dc85901dcaa..62ee25ff341 100644
--- a/arch/mips/dts/Makefile
+++ b/arch/mips/dts/Makefile
@@ -25,6 +25,7 @@ dtb-$(CONFIG_BOARD_SAGEM_FAST1704) += sagem,f at st1704.dtb
 dtb-$(CONFIG_BOARD_SFR_NB4_SER) += sfr,nb4-ser.dtb
 dtb-$(CONFIG_BOARD_TPLINK_WDR4300) += tplink_wdr4300.dtb
 dtb-$(CONFIG_BOARD_VOCORE2) += vocore_vocore2.dtb
+dtb-$(CONFIG_TARGET_JZ4730_ALPHA400) += alpha400.dtb
 dtb-$(CONFIG_TARGET_JZ4780_CI20) += ci20.dtb
 dtb-$(CONFIG_SOC_LUTON) += luton_pcb090.dtb luton_pcb091.dtb
 dtb-$(CONFIG_SOC_OCELOT) += ocelot_pcb120.dtb ocelot_pcb123.dtb
diff --git a/arch/mips/dts/alpha400.dts b/arch/mips/dts/alpha400.dts
new file mode 100644
index 00000000000..fa02f841d1a
--- /dev/null
+++ b/arch/mips/dts/alpha400.dts
@@ -0,0 +1,542 @@
+/dts-v1/;
+
+#include "jz4730.dtsi"
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	compatible = "letux400,minipc", "ingenic,jz4730";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	wdt-reboot {
+		compatible = "wdt-reboot";
+		wdt = <&watchdog>;
+	};
+
+	vcc: regulator at 0 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc";
+
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-always-on;
+	};
+
+	vmmc_reg: regulator at 1 {
+		compatible = "regulator-fixed";
+		regulator-name = "vmmc";
+
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&gpa 21 GPIO_ACTIVE_LOW>;
+	};
+
+	clk_usb: clk-usb {
+		compatible = "gpio-gate-clock";
+		clocks = <&cgu JZ4730_CLK_UHC>;
+		#clock-cells = <0>;
+		enable-gpios = <&gpa 29 GPIO_ACTIVE_HIGH>;
+	};
+
+	keyboard {
+		linux,wakeup;
+
+		compatible = "gpio-matrix-keypad";
+		debounce-delay-ms = <10>;
+		col-scan-delay-us = <10>;
+
+		row-gpios = <&gpa 0 0 &gpa 1 0 &gpa 2 0 &gpa 3 0
+			     &gpa 4 0 &gpa 5 0 &gpa 6 0 &gpa 7 0>;
+
+		col-gpios = <&gpd 0 0 &gpd 1 0 &gpd 2 0 &gpd 3 0
+			     &gpd 4 0 &gpd 5 0 &gpd 6 0 &gpd 7 0
+			     &gpd 8 0 &gpd 9 0 &gpd 10 0 &gpd 11 0
+			     &gpd 12 0 &gpd 13 0 &gpd 14 0 &gpd 15 0
+			     &gpd 29 0>;
+		gpio-activelow;
+
+		/*
+		 * Keymap column-by-column, based on...
+		 * https://web.archive.org/web/20120214204001/http://projects.kwaak.net/twiki/bin/view/Epc700/KeyBoard
+		 * ...and subsequently verified.
+		 */
+
+		linux,keymap = <
+			MATRIX_KEY(0, 0, KEY_PAUSE)
+			MATRIX_KEY(1, 0, 0)
+			MATRIX_KEY(2, 0, 0)
+			MATRIX_KEY(3, 0, 0)
+			MATRIX_KEY(4, 0, 0)
+			MATRIX_KEY(5, 0, 0)
+			MATRIX_KEY(6, 0, KEY_LEFTCTRL)
+			MATRIX_KEY(7, 0, KEY_F5)
+
+			MATRIX_KEY(0, 1, KEY_Q)
+			MATRIX_KEY(1, 1, KEY_TAB)
+			MATRIX_KEY(2, 1, KEY_A)
+			MATRIX_KEY(3, 1, KEY_ESC)
+			MATRIX_KEY(4, 1, KEY_Z)
+			MATRIX_KEY(5, 1, 0)
+			MATRIX_KEY(6, 1, KEY_GRAVE)
+			MATRIX_KEY(7, 1, KEY_1)
+
+			MATRIX_KEY(0, 2, KEY_W)
+			MATRIX_KEY(1, 2, KEY_CAPSLOCK)
+			MATRIX_KEY(2, 2, KEY_S)
+			MATRIX_KEY(3, 2, KEY_102ND)
+			MATRIX_KEY(4, 2, KEY_X)
+			MATRIX_KEY(5, 2, 0)
+			MATRIX_KEY(6, 2, 0)
+			MATRIX_KEY(7, 2, KEY_2)
+
+			MATRIX_KEY(0, 3, KEY_E)
+			MATRIX_KEY(1, 3, KEY_F3)
+			MATRIX_KEY(2, 3, KEY_D)
+			MATRIX_KEY(3, 3, KEY_F4)
+			MATRIX_KEY(4, 3, KEY_C)
+			MATRIX_KEY(5, 3, 0)
+			MATRIX_KEY(6, 3, 0)
+			MATRIX_KEY(7, 3, KEY_3)
+
+			MATRIX_KEY(0, 4, KEY_R)
+			MATRIX_KEY(1, 4, KEY_T)
+			MATRIX_KEY(2, 4, KEY_F)
+			MATRIX_KEY(3, 4, KEY_G)
+			MATRIX_KEY(4, 4, KEY_V)
+			MATRIX_KEY(5, 4, KEY_B)
+			MATRIX_KEY(6, 4, KEY_5)
+			MATRIX_KEY(7, 4, KEY_4)
+
+			MATRIX_KEY(0, 5, KEY_U)
+			MATRIX_KEY(1, 5, KEY_Y)
+			MATRIX_KEY(2, 5, KEY_J)
+			MATRIX_KEY(3, 5, KEY_H)
+			MATRIX_KEY(4, 5, KEY_M)
+			MATRIX_KEY(5, 5, KEY_N)
+			MATRIX_KEY(6, 5, KEY_6)
+			MATRIX_KEY(7, 5, KEY_7)
+
+			MATRIX_KEY(0, 6, KEY_I)
+			MATRIX_KEY(1, 6, KEY_RIGHTBRACE)
+			MATRIX_KEY(2, 6, KEY_K)
+			MATRIX_KEY(3, 6, KEY_F6)
+			MATRIX_KEY(4, 6, KEY_COMMA)
+			MATRIX_KEY(5, 6, 0)
+			MATRIX_KEY(6, 6, KEY_EQUAL)
+			MATRIX_KEY(7, 6, KEY_8)
+
+			MATRIX_KEY(0, 7, KEY_O)
+			MATRIX_KEY(1, 7, KEY_F7)
+			MATRIX_KEY(2, 7, KEY_L)
+			MATRIX_KEY(3, 7, 0)
+			MATRIX_KEY(4, 7, KEY_DOT)
+			MATRIX_KEY(5, 7, KEY_F19)
+			MATRIX_KEY(6, 7, KEY_F8)
+			MATRIX_KEY(7, 7, KEY_9)
+
+			MATRIX_KEY(0, 8, 0)
+			MATRIX_KEY(1, 8, 0)
+			MATRIX_KEY(2, 8, 0)
+			MATRIX_KEY(3, 8, KEY_SPACE)
+			MATRIX_KEY(4, 8, KEY_NUMLOCK)
+			MATRIX_KEY(5, 8, 0)
+			MATRIX_KEY(6, 8, KEY_DELETE)
+			MATRIX_KEY(7, 8, 0)
+
+			MATRIX_KEY(0, 9, 0)
+			MATRIX_KEY(1, 9, KEY_BACKSPACE)
+			MATRIX_KEY(2, 9, 0)
+			MATRIX_KEY(3, 9, 0)
+			MATRIX_KEY(4, 9, KEY_ENTER)
+			MATRIX_KEY(5, 9, 0)
+			MATRIX_KEY(6, 9, KEY_F9)
+			MATRIX_KEY(7, 9, 0)
+
+			MATRIX_KEY(0, 10, 0)
+			MATRIX_KEY(1, 10, 0)
+			MATRIX_KEY(2, 10, 0)
+			MATRIX_KEY(3, 10, KEY_LEFTALT)
+			MATRIX_KEY(4, 10, 0)
+			MATRIX_KEY(5, 10, 0)
+			MATRIX_KEY(6, 10, 0)
+			MATRIX_KEY(7, 10, KEY_SYSRQ)
+
+			MATRIX_KEY(0, 11, KEY_P)
+			MATRIX_KEY(1, 11, KEY_LEFTBRACE)
+			MATRIX_KEY(2, 11, KEY_SEMICOLON)
+			MATRIX_KEY(3, 11, KEY_APOSTROPHE)
+			MATRIX_KEY(4, 11, KEY_BACKSLASH)
+			MATRIX_KEY(5, 11, KEY_SLASH)
+			MATRIX_KEY(6, 11, KEY_MINUS)
+			MATRIX_KEY(7, 11, KEY_0)
+
+			MATRIX_KEY(0, 12, 0)
+			MATRIX_KEY(1, 12, KEY_F20)
+			MATRIX_KEY(2, 12, 0)
+			MATRIX_KEY(3, 12, 0)
+			MATRIX_KEY(4, 12, 0)
+			MATRIX_KEY(5, 12, 0)
+			MATRIX_KEY(6, 12, 0)
+			MATRIX_KEY(7, 12, KEY_F10)
+
+			MATRIX_KEY(0, 13, 0)
+			MATRIX_KEY(1, 13, 0)
+			MATRIX_KEY(2, 13, 0)
+			MATRIX_KEY(3, 13, 0)
+			MATRIX_KEY(4, 13, 0)
+			MATRIX_KEY(5, 13, 0)
+			MATRIX_KEY(6, 13, KEY_F2)
+			MATRIX_KEY(7, 13, 0)
+
+			MATRIX_KEY(0, 14, 0)
+			MATRIX_KEY(1, 14, 0)
+			MATRIX_KEY(2, 14, 0)
+			MATRIX_KEY(3, 14, 0)
+			MATRIX_KEY(4, 14, 0)
+			MATRIX_KEY(5, 14, 0)
+			MATRIX_KEY(6, 14, KEY_INSERT)
+			MATRIX_KEY(7, 14, 0)
+
+			MATRIX_KEY(0, 15, 0)
+			MATRIX_KEY(1, 15, 0)
+			MATRIX_KEY(2, 15, KEY_UP)
+			MATRIX_KEY(3, 15, KEY_DOWN)
+			MATRIX_KEY(4, 15, KEY_LEFT)
+			MATRIX_KEY(5, 15, KEY_RIGHT)
+			MATRIX_KEY(6, 15, 0)
+			MATRIX_KEY(7, 15, 0)
+
+			MATRIX_KEY(0, 16, 0)
+			MATRIX_KEY(1, 16, KEY_LEFTSHIFT)
+			MATRIX_KEY(2, 16, KEY_RIGHTSHIFT)
+			MATRIX_KEY(3, 16, 0)
+			MATRIX_KEY(4, 16, 0)
+			MATRIX_KEY(5, 16, 0)
+			MATRIX_KEY(6, 16, KEY_F1)
+			MATRIX_KEY(7, 16, KEY_FN)
+			>;
+	};
+
+	buttons {
+		compatible = "gpio-keys";
+
+		#address-cells = <7>;
+		#size-cells = <0>;
+
+		left_touchpad {
+			label = "Touchpad Left";
+			linux,code = <0x110>;	/* BTN_LEFT */
+			gpios = <&gpa 16 GPIO_ACTIVE_LOW>;
+			gpio-key,wakeup;
+		};
+
+		right_touchpad {
+			label = "Touchpad Right";
+			linux,code = <0x111>;	/* BTN_RIGHT */
+			gpios = <&gpa 9 GPIO_ACTIVE_LOW>;
+			gpio-key,wakeup;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		scroll_lock {
+			label = "scroll_lock";
+			gpios = <&gpa 9 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "scroll_lock";
+			default-state = "off";
+		};
+
+		caps_lock {
+			label = "caps_lock";
+			gpios = <&gpa 27 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "caps_lock";
+			default-state = "off";
+		};
+
+		num_lock {
+			label = "num_lock";
+			gpios = <&gpc 22 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "num_lock";
+			default-state = "off";
+		};
+	};
+
+	sound: sound {
+		compatible = "simple-scu-audio-card";
+
+		simple-audio-card,name = "sound";
+		simple-audio-card,format = "left_j";
+		simple-audio-card,bitclock-master = <&sndcodec>;
+		simple-audio-card,frame-master = <&sndcodec>;
+
+		simple-audio-card,convert-rate = <48000>;
+
+		simple-audio-card,prefix = "ak4642";
+		simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback",
+				"DAI0 Capture", "ak4642 Capture";
+
+		sndcpu: simple-audio-card,cpu {
+			sound-dai = <&i2s>;
+		};
+
+		sndcodec: simple-audio-card,codec {
+			sound-dai = <&ak4642>;
+			system-clock-frequency = <11289600>;
+		};
+	};
+
+	backlight: backlight {
+		compatible = "pwm-backlight";
+
+		pwms = <&pwm 0 3906250>;
+		power-supply = <&vcc>;
+
+		brightness-levels = <150 200 250 300>;
+		default-brightness-level = <2>;
+
+		default-on;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&pins_pwm0>;
+	};
+
+	panel: claa070vc01 {
+		compatible = "chunghwa,claa070vc01", "panel-dpi";
+
+		width-mm = <150>;
+		height-mm = <90>;
+
+		backlight = <&backlight>;
+
+		panel-timing {
+			clock-frequency = <26400000>;
+			hactive = <800>;
+			vactive = <480>;
+			hfront-porch = <0>;
+			hback-porch = <0>;
+			hsync-len = <80>;
+			vfront-porch = <0>;
+			vback-porch = <0>;
+			vsync-len = <20>;
+			hsync-active = <0>;
+			vsync-active = <0>;
+			de-active = <1>;
+			pixelclk-active = <0>;
+		};
+
+		port {
+			panel_input: endpoint {
+				remote-endpoint = <&lcd_output>;
+			};
+		};
+	};
+};
+
+&ext {
+	clock-frequency = <3686400>;
+};
+
+&rtc_dev {
+	system-power-controller;
+};
+
+&lcd {
+	pinctrl-names = "default", "sleep";
+	pinctrl-0 = <&pins_lcd0>;
+	pinctrl-1 = <&pins_lcd1>;
+
+	port {
+		lcd_output: endpoint {
+			remote-endpoint = <&panel_input>;
+		};
+	};
+};
+
+&mmc {
+	status = "okay";
+
+	bus-width = <4>;
+	cd-gpios = <&gpc 0 GPIO_ACTIVE_LOW>;
+	wp-gpios = <&gpc 2 GPIO_ACTIVE_LOW>;
+	vmmc-supply = <&vmmc_reg>;
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&pins_mmc>;
+};
+
+&nand {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pins_nand>;
+
+	nand0: nand at 0 {
+		#address-cells = <0>;
+		#size-cells = <0>;
+		reg = <0>;
+		wp-gpios = <&gpc 23 GPIO_ACTIVE_LOW>;
+
+		nand-on-flash-bbt;
+		nand-bus-width = <8>;
+
+		nand-ecc-mode = "none";
+
+		partitions {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fixed-partitions";
+
+			bootloader at 0 {
+				label = "bootloader";
+				reg = <0x00000000 0x00100000>;
+			};
+
+			kernel at 100000 {
+				label = "kernel";
+				reg = <0x00100000 0x00300000>;
+			};
+
+			mac at 400000 {
+				label = "mac";
+				reg = <0x00400000 0x00100000>;
+			};
+
+			recovery at 500000 {
+				label = "mini rootfs";
+				reg = <0x00500000 0x00500000>;
+			};
+
+			root at a00000 {
+				label = "yaffs2 rootfs";
+				reg = <0x00a00000 0x3f600000>;
+			};
+
+			extend at 40000000 {
+				label = "extend 1G flash";
+				reg = <0x40000000 0x40000000>;
+			};
+		};
+	};
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pins_uart0>;
+};
+
+&pinctrl {
+	pins_lcd0: lcd0 {
+		function = "lcd";
+		groups = "lcd-8bit", "lcd-16bit", "lcd-16bit-tft";
+	};
+
+	pins_lcd1: lcd1 {
+		function = "sleep";
+		groups = "lcd-no-pins";
+	};
+
+	pins_mmc: mmc {
+		mmc {
+			function = "mmc";
+			groups = "mmc-1bit", "mmc-4bit";
+		};
+
+		mmc_ctrl {
+			function = "mmc";
+			pins = "PC0", "PC2", "PA21";
+			bias-disable;
+		};
+	};
+
+	pins_nand: pins_nand {
+		function = "nand";
+		groups = "nand-cs3";
+	};
+
+	pins_pwm0: pwm0 {
+		function = "pwm0";
+		groups = "pwm0";
+	};
+
+	pins_pwm1: pwm1 {
+		function = "pwm1";
+		groups = "pwm1";
+	};
+
+	pins_uart0: uart0 {
+		function = "uart0";
+		groups = "uart0-data";
+		bias-disable;
+	};
+
+	pins_usb_clk: usb {
+		pins = "PA29";
+		bias-disable;
+	};
+
+	pins_mac: pins_mac {
+		function = "mac";
+		groups = "mac";
+	};
+};
+
+&i2c {
+	power_controller at 28 {
+		compatible = "minipc,mcu";
+		reg = <0x28>;
+	};
+
+	ak4642: codec at 12 {
+		compatible = "asahi-kasei,ak4642";
+		reg = <0x12>;
+		#clock-cells = <0>;
+		clock-frequency = <12000000>;
+		clock-output-names = "ak4643_mcko";
+	};
+
+	rtc at 51 {
+		compatible = "nxp,pcf8563";
+		reg = <0x51>;
+		#clock-cells = <0>;
+	};
+
+};
+
+&uhc {
+	clocks = <&clk_usb>;
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&pins_usb_clk>;
+};
+
+&ethernet {
+	phy-handle = <&ethphy>;
+	phy-mode = "mii";
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&pins_mac>;
+};
+
+&mdio {
+	ethphy: ethernet-phy at 16 {
+		device_type = "ethernet-phy";
+		compatible = "realtek,rtl8201cl", "ethernet-phy-ieee802.3-c22";
+		reg = <16>;
+	};
+};
+
+/*
+ * TODO:
+ * add LCD
+ * add proper Pinmux
+ * finalize sound / codec setup
+ * add i2c and i2s drivers to the SoC
+ * add special driver to probe two gpios to detect battery charging and AC present
+ */
-- 
2.28.0



More information about the U-Boot mailing list