All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/2] Add Khadas VIM2 board support
@ 2018-10-03 10:02 Loic Devulder
  2018-10-03 10:02 ` [U-Boot] [PATCH 1/2] ARM: meson: Add Khadas VIM2 board DT Loic Devulder
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Loic Devulder @ 2018-10-03 10:02 UTC (permalink / raw)
  To: u-boot

This adds platform code for the Khadas VIM2 board based on a
Meson GXM (S912) SoC with the Meson GXM configuration.

This initial submission supports UART, MMC/SDCard and Ethernet.
USB is partially supported.

All the code is from Neil Armstrong! I just rebased the code, do
some cleanup and tested on my board.

Loic Devulder (2):
  ARM: meson: Add Khadas VIM2 board DT
  ARM: meson: Add Khadas VIM2 board support

 arch/arm/dts/Makefile                   |   3 +-
 arch/arm/dts/meson-gxm-khadas-vim2.dts  | 412 ++++++++++++++++++++++++++++++++
 arch/arm/dts/meson-gxm.dtsi             | 119 +++++++++
 arch/arm/mach-meson/Kconfig             |  23 ++
 board/amlogic/khadas-vim2/Kconfig       |  12 +
 board/amlogic/khadas-vim2/MAINTAINERS   |   6 +
 board/amlogic/khadas-vim2/Makefile      |   6 +
 board/amlogic/khadas-vim2/README        | 103 ++++++++
 board/amlogic/khadas-vim2/khadas-vim2.c |  62 +++++
 configs/khadas-vim2_defconfig           |  51 ++++
 include/configs/khadas-vim2.h           |  18 ++
 11 files changed, 814 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/meson-gxm-khadas-vim2.dts
 create mode 100644 arch/arm/dts/meson-gxm.dtsi
 create mode 100644 board/amlogic/khadas-vim2/Kconfig
 create mode 100644 board/amlogic/khadas-vim2/MAINTAINERS
 create mode 100644 board/amlogic/khadas-vim2/Makefile
 create mode 100644 board/amlogic/khadas-vim2/README
 create mode 100644 board/amlogic/khadas-vim2/khadas-vim2.c
 create mode 100644 configs/khadas-vim2_defconfig
 create mode 100644 include/configs/khadas-vim2.h

-- 
2.16.4

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

* [U-Boot] [PATCH 1/2] ARM: meson: Add Khadas VIM2 board DT
  2018-10-03 10:02 [U-Boot] [PATCH 0/2] Add Khadas VIM2 board support Loic Devulder
@ 2018-10-03 10:02 ` Loic Devulder
  2018-10-03 10:56   ` Neil Armstrong
  2018-10-11 14:11   ` [U-Boot] [U-Boot,1/2] " Tom Rini
  2018-10-03 10:02 ` [U-Boot] [PATCH 2/2] ARM: meson: Add Khadas VIM2 board support Loic Devulder
  2018-10-03 10:58 ` [U-Boot] [PATCH 0/2] " Neil Armstrong
  2 siblings, 2 replies; 9+ messages in thread
From: Loic Devulder @ 2018-10-03 10:02 UTC (permalink / raw)
  To: u-boot

This adds Device Tree for the Khadas VIM2 board.

The meson-gxm-khadas-vim2.dts is synchronized from Linux 4.18.10.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Loic Devulder <ldevulder@suse.de>
---
 arch/arm/dts/Makefile                  |   3 +-
 arch/arm/dts/meson-gxm-khadas-vim2.dts | 412 +++++++++++++++++++++++++++++++++
 arch/arm/dts/meson-gxm.dtsi            | 119 ++++++++++
 3 files changed, 533 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/meson-gxm-khadas-vim2.dts
 create mode 100644 arch/arm/dts/meson-gxm.dtsi

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 44ebc50bfa..dfe9335a04 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -58,7 +58,8 @@ dtb-$(CONFIG_ARCH_MESON) += \
 	meson-gxbb-nanopi-k2.dtb \
 	meson-gxl-s905x-p212.dtb \
 	meson-gxl-s905x-libretech-cc.dtb \
-	meson-gxl-s905x-khadas-vim.dtb
+	meson-gxl-s905x-khadas-vim.dtb \
+	meson-gxm-khadas-vim2.dtb
 dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
 	tegra20-medcom-wide.dtb \
 	tegra20-paz00.dtb \
diff --git a/arch/arm/dts/meson-gxm-khadas-vim2.dts b/arch/arm/dts/meson-gxm-khadas-vim2.dts
new file mode 100644
index 0000000000..0868da476e
--- /dev/null
+++ b/arch/arm/dts/meson-gxm-khadas-vim2.dts
@@ -0,0 +1,412 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2017 Martin Blumenstingl <martin.blumenstingl@googlemail.com>.
+ * Copyright (c) 2017 BayLibre, SAS
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/thermal/thermal.h>
+
+#include "meson-gxm.dtsi"
+
+/ {
+	compatible = "khadas,vim2", "amlogic,s912", "amlogic,meson-gxm";
+	model = "Khadas VIM2";
+
+	aliases {
+		serial0 = &uart_AO;
+		serial1 = &uart_A;
+		serial2 = &uart_AO_B;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory at 0 {
+		device_type = "memory";
+		reg = <0x0 0x0 0x0 0x80000000>;
+	};
+
+	adc-keys {
+		compatible = "adc-keys";
+		io-channels = <&saradc 0>;
+		io-channel-names = "buttons";
+		keyup-threshold-microvolt = <1710000>;
+
+		button-function {
+			label = "Function";
+			linux,code = <KEY_FN>;
+			press-threshold-microvolt = <10000>;
+		};
+	};
+
+	emmc_pwrseq: emmc-pwrseq {
+		compatible = "mmc-pwrseq-emmc";
+		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
+	};
+
+	gpio_fan: gpio-fan {
+		compatible = "gpio-fan";
+		gpios = <&gpio GPIODV_14 GPIO_ACTIVE_HIGH
+			 &gpio GPIODV_15 GPIO_ACTIVE_HIGH>;
+		/* Dummy RPM values since fan is optional */
+		gpio-fan,speed-map = <0 0
+				      1 1
+				      2 2
+				      3 3>;
+		#cooling-cells = <2>;
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <100>;
+
+		button at 0 {
+			label = "power";
+			linux,code = <KEY_POWER>;
+			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	hdmi-connector {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_connector_in: endpoint {
+				remote-endpoint = <&hdmi_tx_tmds_out>;
+			};
+		};
+	};
+
+	pwmleds {
+		compatible = "pwm-leds";
+
+		power {
+			label = "vim:red:power";
+			pwms = <&pwm_AO_ab 1 7812500 0>;
+			max-brightness = <255>;
+			linux,default-trigger = "default-on";
+		};
+	};
+
+	sdio_pwrseq: sdio-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
+		clocks = <&wifi32k>;
+		clock-names = "ext_clock";
+	};
+
+	thermal-zones {
+		cpu-thermal {
+			polling-delay-passive = <250>; /* milliseconds */
+			polling-delay = <1000>; /* milliseconds */
+
+			thermal-sensors = <&scpi_sensors 0>;
+
+			trips {
+				cpu_alert0: cpu-alert0 {
+					temperature = <70000>; /* millicelsius */
+					hysteresis = <2000>; /* millicelsius */
+					type = "active";
+				};
+
+				cpu_alert1: cpu-alert1 {
+					temperature = <80000>; /* millicelsius */
+					hysteresis = <2000>; /* millicelsius */
+					type = "passive";
+				};
+			};
+
+			cooling-maps {
+				map0 {
+					trip = <&cpu_alert0>;
+					cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
+				};
+
+				map1 {
+					trip = <&cpu_alert1>;
+					cooling-device = <&gpio_fan 2 THERMAL_NO_LIMIT>;
+				};
+
+				map2 {
+					trip = <&cpu_alert1>;
+					cooling-device =
+						<&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+				};
+
+				map3 {
+					trip = <&cpu_alert1>;
+					cooling-device =
+						<&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+				};
+			};
+		};
+	};
+
+	hdmi_5v: regulator-hdmi-5v {
+		compatible = "regulator-fixed";
+
+		regulator-name = "HDMI_5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+
+		gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-always-on;
+	};
+
+	vcc_3v3: regulator-vcc_3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "VCC_3V3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
+
+	vddio_ao18: regulator-vddio_ao18 {
+		compatible = "regulator-fixed";
+		regulator-name = "VDDIO_AO18";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+
+	vddio_boot: regulator-vddio_boot {
+		compatible = "regulator-fixed";
+		regulator-name = "VDDIO_BOOT";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+
+	vddao_3v3: regulator-vddao_3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "VDDAO_3V3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
+
+	wifi32k: wifi32k {
+		compatible = "pwm-clock";
+		#clock-cells = <0>;
+		clock-frequency = <32768>;
+		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
+	};
+};
+
+&cec_AO {
+	status = "okay";
+	pinctrl-0 = <&ao_cec_pins>;
+	pinctrl-names = "default";
+	hdmi-phandle = <&hdmi_tx>;
+};
+
+&cpu0 {
+	#cooling-cells = <2>;
+};
+
+&cpu4 {
+	#cooling-cells = <2>;
+};
+
+&ethmac {
+	pinctrl-0 = <&eth_pins>;
+	pinctrl-names = "default";
+
+	/* Select external PHY by default */
+	phy-handle = <&external_phy>;
+
+	amlogic,tx-delay-ns = <2>;
+
+	/* External PHY reset is shared with internal PHY Led signals */
+	snps,reset-gpio = <&gpio GPIOZ_14 0>;
+	snps,reset-delays-us = <0 10000 1000000>;
+	snps,reset-active-low;
+
+	/* External PHY is in RGMII */
+	phy-mode = "rgmii";
+
+	status = "okay";
+};
+
+&external_mdio {
+	external_phy: ethernet-phy at 0 {
+		/* Realtek RTL8211F (0x001cc916) */
+		reg = <0>;
+		interrupt-parent = <&gpio_intc>;
+		/* MAC_INTR on GPIOZ_15 */
+		interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
+	};
+};
+
+&hdmi_tx {
+	status = "okay";
+	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
+	pinctrl-names = "default";
+};
+
+&hdmi_tx_tmds_port {
+	hdmi_tx_tmds_out: endpoint {
+		remote-endpoint = <&hdmi_connector_in>;
+	};
+};
+
+&i2c_A {
+	status = "okay";
+	pinctrl-0 = <&i2c_a_pins>;
+	pinctrl-names = "default";
+};
+
+&i2c_B {
+	status = "okay";
+	pinctrl-0 = <&i2c_b_pins>;
+	pinctrl-names = "default";
+
+	rtc: rtc at 51 {
+		/* has to be enabled manually when a battery is connected: */
+		status = "disabled";
+		compatible = "haoyu,hym8563";
+		reg = <0x51>;
+		#clock-cells = <0>;
+		clock-frequency = <32768>;
+		clock-output-names = "xin32k";
+	};
+};
+
+&ir {
+	status = "okay";
+	pinctrl-0 = <&remote_input_ao_pins>;
+	pinctrl-names = "default";
+	linux,rc-map-name = "rc-geekbox";
+};
+
+&pwm_AO_ab {
+	status = "okay";
+	pinctrl-0 = <&pwm_ao_a_3_pins>, <&pwm_ao_b_pins>;
+	pinctrl-names = "default";
+	clocks = <&clkc CLKID_FCLK_DIV4>;
+	clock-names = "clkin0";
+};
+
+&pwm_ef {
+	status = "okay";
+	pinctrl-0 = <&pwm_e_pins>, <&pwm_f_clk_pins>;
+	pinctrl-names = "default";
+	clocks = <&clkc CLKID_FCLK_DIV4>;
+	clock-names = "clkin0";
+};
+
+&sd_emmc_a {
+	status = "okay";
+	pinctrl-0 = <&sdio_pins>;
+	pinctrl-names = "default";
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	bus-width = <4>;
+	max-frequency = <100000000>;
+
+	non-removable;
+	disable-wp;
+
+	mmc-pwrseq = <&sdio_pwrseq>;
+
+	vmmc-supply = <&vddao_3v3>;
+	vqmmc-supply = <&vddio_boot>;
+
+	brcmf: wifi at 1 {
+		reg = <1>;
+		compatible = "brcm,bcm4329-fmac";
+	};
+};
+
+/* SD card */
+&sd_emmc_b {
+	status = "okay";
+	pinctrl-0 = <&sdcard_pins>;
+	pinctrl-names = "default";
+
+	bus-width = <4>;
+	cap-sd-highspeed;
+	max-frequency = <100000000>;
+	disable-wp;
+
+	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
+	cd-inverted;
+
+	vmmc-supply = <&vddao_3v3>;
+	vqmmc-supply = <&vddio_boot>;
+};
+
+/* eMMC */
+&sd_emmc_c {
+	status = "okay";
+	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
+	pinctrl-names = "default";
+
+	bus-width = <8>;
+	cap-sd-highspeed;
+	cap-mmc-highspeed;
+	max-frequency = <200000000>;
+	non-removable;
+	disable-wp;
+	mmc-ddr-1_8v;
+	mmc-hs200-1_8v;
+	mmc-hs400-1_8v;
+
+	mmc-pwrseq = <&emmc_pwrseq>;
+	vmmc-supply = <&vcc_3v3>;
+	vqmmc-supply = <&vddio_boot>;
+};
+
+/*
+ * EMMC_DS pin is shared between SPI NOR CS and eMMC Data Strobe
+ * Remove emmc_ds_pins from sd_emmc_c pinctrl-0 then spifc can be enabled
+ */
+&spifc {
+	status = "disabled";
+	pinctrl-0 = <&nor_pins>;
+	pinctrl-names = "default";
+
+	w25q32: spi-flash at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "winbond,w25q16", "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <3000000>;
+	};
+};
+
+/* This one is connected to the Bluetooth module */
+&uart_A {
+	status = "okay";
+	pinctrl-0 = <&uart_a_pins>;
+	pinctrl-names = "default";
+};
+
+/* This is brought out on the Linux_RX (18) and Linux_TX (19) pins: */
+&uart_AO {
+	status = "okay";
+	pinctrl-0 = <&uart_ao_a_pins>;
+	pinctrl-names = "default";
+};
+
+/* This is brought out on the UART_RX_AO_B (15) and UART_TX_AO_B (16) pins: */
+&uart_AO_B {
+	status = "okay";
+	pinctrl-0 = <&uart_ao_b_pins>;
+	pinctrl-names = "default";
+};
+
+&saradc {
+	status = "okay";
+	vref-supply = <&vddio_ao18>;
+};
+
+&usb0 {
+	status = "okay";
+};
diff --git a/arch/arm/dts/meson-gxm.dtsi b/arch/arm/dts/meson-gxm.dtsi
new file mode 100644
index 0000000000..247888d68a
--- /dev/null
+++ b/arch/arm/dts/meson-gxm.dtsi
@@ -0,0 +1,119 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2016 Endless Computers, Inc.
+ * Author: Carlo Caione <carlo@endlessm.com>
+ */
+
+#include "meson-gxl.dtsi"
+
+/ {
+	compatible = "amlogic,meson-gxm";
+
+	cpus {
+		cpu-map {
+			cluster0 {
+				core0 {
+					cpu = <&cpu0>;
+				};
+				core1 {
+					cpu = <&cpu1>;
+				};
+				core2 {
+					cpu = <&cpu2>;
+				};
+				core3 {
+					cpu = <&cpu3>;
+				};
+			};
+
+			cluster1 {
+				core0 {
+					cpu = <&cpu4>;
+				};
+				core1 {
+					cpu = <&cpu5>;
+				};
+				core2 {
+					cpu = <&cpu6>;
+				};
+				core3 {
+					cpu = <&cpu7>;
+				};
+			};
+		};
+
+		cpu4: cpu at 100 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a53", "arm,armv8";
+			reg = <0x0 0x100>;
+			enable-method = "psci";
+			next-level-cache = <&l2>;
+			clocks = <&scpi_dvfs 1>;
+		};
+
+		cpu5: cpu at 101 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a53", "arm,armv8";
+			reg = <0x0 0x101>;
+			enable-method = "psci";
+			next-level-cache = <&l2>;
+			clocks = <&scpi_dvfs 1>;
+		};
+
+		cpu6: cpu at 102 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a53", "arm,armv8";
+			reg = <0x0 0x102>;
+			enable-method = "psci";
+			next-level-cache = <&l2>;
+			clocks = <&scpi_dvfs 1>;
+		};
+
+		cpu7: cpu at 103 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a53", "arm,armv8";
+			reg = <0x0 0x103>;
+			enable-method = "psci";
+			next-level-cache = <&l2>;
+			clocks = <&scpi_dvfs 1>;
+		};
+	};
+};
+
+&apb {
+	usb2_phy2: phy at 78040 {
+		compatible = "amlogic,meson-gxl-usb2-phy";
+		#phy-cells = <0>;
+		reg = <0x0 0x78040 0x0 0x20>;
+		clocks = <&clkc CLKID_USB>;
+		clock-names = "phy";
+		resets = <&reset RESET_USB_OTG>;
+		reset-names = "phy";
+		status = "okay";
+	};
+};
+
+&clkc_AO {
+	compatible = "amlogic,meson-gxm-aoclkc", "amlogic,meson-gx-aoclkc";
+};
+
+&saradc {
+	compatible = "amlogic,meson-gxm-saradc", "amlogic,meson-saradc";
+};
+
+&scpi_dvfs {
+	clock-indices = <0 1>;
+	clock-output-names = "vbig", "vlittle";
+};
+
+&vpu {
+	compatible = "amlogic,meson-gxm-vpu", "amlogic,meson-gx-vpu";
+};
+
+&hdmi_tx {
+	compatible = "amlogic,meson-gxm-dw-hdmi", "amlogic,meson-gx-dw-hdmi";
+};
+
+&dwc3 {
+	phys = <&usb3_phy>, <&usb2_phy0>, <&usb2_phy1>, <&usb2_phy2>;
+};
-- 
2.16.4

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

* [U-Boot] [PATCH 2/2] ARM: meson: Add Khadas VIM2 board support
  2018-10-03 10:02 [U-Boot] [PATCH 0/2] Add Khadas VIM2 board support Loic Devulder
  2018-10-03 10:02 ` [U-Boot] [PATCH 1/2] ARM: meson: Add Khadas VIM2 board DT Loic Devulder
@ 2018-10-03 10:02 ` Loic Devulder
  2018-10-03 10:56   ` Neil Armstrong
  2018-10-11 14:11   ` [U-Boot] [U-Boot, " Tom Rini
  2018-10-03 10:58 ` [U-Boot] [PATCH 0/2] " Neil Armstrong
  2 siblings, 2 replies; 9+ messages in thread
From: Loic Devulder @ 2018-10-03 10:02 UTC (permalink / raw)
  To: u-boot

This adds platform code for the Khadas VIM2 board based on a
Meson GXM (S912) SoC with the Meson GXM configuration.

This initial submission supports UART, MMC/SDCard and Ethernet.
USB is partially supported.

All the code is from Neil Armstrong! I just rebased the code, do
some cleanup and tested on my board.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Loic Devulder <ldevulder@suse.de>
---
 arch/arm/mach-meson/Kconfig             |  23 +++++++
 board/amlogic/khadas-vim2/Kconfig       |  12 ++++
 board/amlogic/khadas-vim2/MAINTAINERS   |   6 ++
 board/amlogic/khadas-vim2/Makefile      |   6 ++
 board/amlogic/khadas-vim2/README        | 103 ++++++++++++++++++++++++++++++++
 board/amlogic/khadas-vim2/khadas-vim2.c |  62 +++++++++++++++++++
 configs/khadas-vim2_defconfig           |  51 ++++++++++++++++
 include/configs/khadas-vim2.h           |  18 ++++++
 8 files changed, 281 insertions(+)
 create mode 100644 board/amlogic/khadas-vim2/Kconfig
 create mode 100644 board/amlogic/khadas-vim2/MAINTAINERS
 create mode 100644 board/amlogic/khadas-vim2/Makefile
 create mode 100644 board/amlogic/khadas-vim2/README
 create mode 100644 board/amlogic/khadas-vim2/khadas-vim2.c
 create mode 100644 configs/khadas-vim2_defconfig
 create mode 100644 include/configs/khadas-vim2.h

diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig
index ee8b1cdcf6..cc943443b3 100644
--- a/arch/arm/mach-meson/Kconfig
+++ b/arch/arm/mach-meson/Kconfig
@@ -22,6 +22,16 @@ config MESON_GXL
 	  The Amlogic Meson GXL (S905X and S905D) is an ARM SoC with a
 	  quad-core Cortex-A53 CPU and a Mali-450 GPU.
 
+config MESON_GXM
+	bool "Support Meson GXM"
+	select ARM64
+	select CLK
+	select DM
+	select DM_SERIAL
+	help
+	  The Amlogic Meson GXM (S912) is an ARM SoC with an
+	  octo-core Cortex-A53 CPU and a Mali-T860 GPU.
+
 if MESON_GXBB
 
 config TARGET_ODROID_C2
@@ -64,6 +74,17 @@ config TARGET_KHADAS_VIM
 
 endif
 
+if MESON_GXM
+
+config TARGET_KHADAS_VIM2
+	bool "KHADAS-VIM2"
+	help
+	  Khadas VIM2 is a single board computer based on Meson GXM
+	  with 2/3 GiB of RAM, Ethernet, HDMI, 4 USB, micro-SD slot,
+	  eMMC, IR receiver and a 40-pin GPIO header.
+
+endif
+
 config SYS_SOC
 	default "meson"
 
@@ -80,4 +101,6 @@ source "board/amlogic/libretech-cc/Kconfig"
 
 source "board/amlogic/khadas-vim/Kconfig"
 
+source "board/amlogic/khadas-vim2/Kconfig"
+
 endif
diff --git a/board/amlogic/khadas-vim2/Kconfig b/board/amlogic/khadas-vim2/Kconfig
new file mode 100644
index 0000000000..d0af36264d
--- /dev/null
+++ b/board/amlogic/khadas-vim2/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_KHADAS_VIM2
+
+config SYS_BOARD
+	default "khadas-vim2"
+
+config SYS_VENDOR
+	default "amlogic"
+
+config SYS_CONFIG_NAME
+	default "khadas-vim2"
+
+endif
diff --git a/board/amlogic/khadas-vim2/MAINTAINERS b/board/amlogic/khadas-vim2/MAINTAINERS
new file mode 100644
index 0000000000..ca63e311c6
--- /dev/null
+++ b/board/amlogic/khadas-vim2/MAINTAINERS
@@ -0,0 +1,6 @@
+KHADAS-VIM2
+M:	Neil Armstrong <narmstrong@baylibre.com>
+S:	Maintained
+F:	board/amlogic/khadas-vim2/
+F:	include/configs/khadas-vim2.h
+F:	configs/khadas-vim2_defconfig
diff --git a/board/amlogic/khadas-vim2/Makefile b/board/amlogic/khadas-vim2/Makefile
new file mode 100644
index 0000000000..4e7c9a0592
--- /dev/null
+++ b/board/amlogic/khadas-vim2/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2016 BayLibre, SAS
+# Author: Neil Armstrong <narmstrong@baylibre.com>
+
+obj-y	:= khadas-vim2.o
diff --git a/board/amlogic/khadas-vim2/README b/board/amlogic/khadas-vim2/README
new file mode 100644
index 0000000000..578693fd2d
--- /dev/null
+++ b/board/amlogic/khadas-vim2/README
@@ -0,0 +1,103 @@
+U-Boot for Khadas VIM2
+=======================
+
+Khadas VIM2 is an Open Source DIY Box manufactured by Shenzhen Wesion
+Technology Co., Ltd with the following specifications:
+
+ - Amlogic S912 ARM Cortex-A53 octo-core SoC @ 1.5GHz
+ - ARM Mali T860 GPU
+ - 2/3GB DDR4 SDRAM
+ - 10/100/1000 Ethernet
+ - HDMI 2.0 4K/60Hz display
+ - 40-pin GPIO header
+ - 2 x USB 2.0 Host, 1 x USB 2.0 Type-C OTG
+ - 16GB/32GB/64GB eMMC
+ - 2MB SPI Flash
+ - microSD
+ - SDIO Wifi Module, Bluetooth
+ - Two channels IR receiver
+
+Currently the u-boot port supports the following devices:
+ - serial
+ - eMMC, microSD
+ - Ethernet
+ - I2C
+ - Regulators
+ - Reset controller
+ - Clock controller
+ - USB Host
+ - ADC
+
+U-Boot compilation
+==================
+
+ > export ARCH=arm
+ > export CROSS_COMPILE=aarch64-none-elf-
+ > make khadas-vim2_defconfig
+ > make
+
+Image creation
+==============
+
+Amlogic doesn't provide sources for the firmware and for tools needed
+to create the bootloader image, so it is necessary to obtain them from
+the git tree published by the board vendor:
+
+ > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+ > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+ > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH
+ > git clone https://github.com/khadas/u-boot -b Vim vim-u-boot
+ > cd vim-u-boot
+ > make kvim_defconfig
+ > make
+ > export FIPDIR=$PWD/fip
+
+Go back to mainline U-Boot source tree then :
+ > mkdir fip
+
+ > cp $FIPDIR/gxl/bl2.bin fip/
+ > cp $FIPDIR/gxl/acs.bin fip/
+ > cp $FIPDIR/gxl/bl21.bin fip/
+ > cp $FIPDIR/gxl/bl30.bin fip/
+ > cp $FIPDIR/gxl/bl301.bin fip/
+ > cp $FIPDIR/gxl/bl31.img fip/
+ > cp u-boot.bin fip/bl33.bin
+
+ > $FIPDIR/blx_fix.sh \
+	fip/bl30.bin \
+	fip/zero_tmp \
+	fip/bl30_zero.bin \
+	fip/bl301.bin \
+	fip/bl301_zero.bin \
+	fip/bl30_new.bin \
+	bl30
+
+ > python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
+
+ > $FIPDIR/blx_fix.sh \
+	fip/bl2_acs.bin \
+	fip/zero_tmp \
+	fip/bl2_zero.bin \
+	fip/bl21.bin \
+	fip/bl21_zero.bin \
+	fip/bl2_new.bin \
+	bl2
+
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin
+ > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig
+ > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \
+		--output fip/u-boot.bin \
+		--bl2 fip/bl2.n.bin.sig \
+		--bl30 fip/bl30_new.bin.enc \
+		--bl31 fip/bl31.img.enc \
+		--bl33 fip/bl33.bin.enc
+
+and then write the image to SD with:
+
+ > DEV=/dev/your_sd_device
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
+ > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444
diff --git a/board/amlogic/khadas-vim2/khadas-vim2.c b/board/amlogic/khadas-vim2/khadas-vim2.c
new file mode 100644
index 0000000000..ff56569f17
--- /dev/null
+++ b/board/amlogic/khadas-vim2/khadas-vim2.c
@@ -0,0 +1,62 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2016 BayLibre, SAS
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <environment.h>
+#include <asm/io.h>
+#include <asm/arch/gx.h>
+#include <asm/arch/mem.h>
+#include <asm/arch/sm.h>
+#include <asm/arch/eth.h>
+
+#define EFUSE_SN_OFFSET		20
+#define EFUSE_SN_SIZE		16
+#define EFUSE_MAC_OFFSET	52
+#define EFUSE_MAC_SIZE		6
+
+int board_init(void)
+{
+	return 0;
+}
+
+int misc_init_r(void)
+{
+	u8 mac_addr[EFUSE_MAC_SIZE];
+	char serial[EFUSE_SN_SIZE];
+	ssize_t len;
+
+	meson_gx_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
+
+	/* Reset PHY on GPIOZ_14 */
+	clrbits_le32(GX_GPIO_EN(3), BIT(14));
+	clrbits_le32(GX_GPIO_OUT(3), BIT(14));
+	mdelay(10);
+	setbits_le32(GX_GPIO_OUT(3), BIT(14));
+
+	if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
+		len = meson_sm_read_efuse(EFUSE_MAC_OFFSET,
+					  mac_addr, EFUSE_MAC_SIZE);
+		if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr))
+			eth_env_set_enetaddr("ethaddr", mac_addr);
+	}
+
+	if (!env_get("serial#")) {
+		len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial,
+					  EFUSE_SN_SIZE);
+		if (len == EFUSE_SN_SIZE)
+			env_set("serial#", serial);
+	}
+
+	return 0;
+}
+
+int ft_board_setup(void *blob, bd_t *bd)
+{
+	meson_gx_init_reserved_memory(blob);
+
+	return 0;
+}
diff --git a/configs/khadas-vim2_defconfig b/configs/khadas-vim2_defconfig
new file mode 100644
index 0000000000..f21e3a8ddf
--- /dev/null
+++ b/configs/khadas-vim2_defconfig
@@ -0,0 +1,51 @@
+CONFIG_ARM=y
+CONFIG_ARCH_MESON=y
+CONFIG_SYS_TEXT_BASE=0x01000000
+CONFIG_MESON_GXM=y
+CONFIG_TARGET_KHADAS_VIM2=y
+CONFIG_DEBUG_UART_BASE=0xc81004c0
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_IDENT_STRING=" khadas-vim2"
+CONFIG_DEFAULT_DEVICE_TREE="meson-gxm-khadas-vim2"
+CONFIG_DEBUG_UART=y
+CONFIG_OF_BOARD_SETUP=y
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+# CONFIG_CMD_BDI is not set
+# CONFIG_CMD_IMI is not set
+CONFIG_CMD_ADC=y
+CONFIG_CMD_GPIO=y
+# CONFIG_CMD_LOADS is not set
+CONFIG_CMD_MMC=y
+CONFIG_CMD_USB=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_REGULATOR=y
+CONFIG_ADC=y
+CONFIG_SARADC_MESON=y
+CONFIG_OF_CONTROL=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DM_GPIO=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_RESET=y
+CONFIG_DM_MMC=y
+CONFIG_MMC_MESON_GX=y
+CONFIG_DM_ETH=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_MESON_GXL=y
+CONFIG_DEBUG_UART_MESON=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
+CONFIG_DEBUG_UART_SKIP_INIT=y
+CONFIG_MESON_SERIAL=y
+CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_STORAGE=y
+CONFIG_PHY=y
+CONFIG_MESON_GXL_USB_PHY=y
+CONFIG_MTD=y
diff --git a/include/configs/khadas-vim2.h b/include/configs/khadas-vim2.h
new file mode 100644
index 0000000000..7ef8f42bd2
--- /dev/null
+++ b/include/configs/khadas-vim2.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Configuration for Khadas VIM2
+ *
+ * Copyright (C) 2017 Baylibre, SAS
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define CONFIG_MISC_INIT_R
+
+#define MESON_FDTFILE_SETTING "fdtfile=amlogic/meson-gxm-khadas-vim2.dtb\0"
+
+#include <configs/meson-gx-common.h>
+
+#endif /* __CONFIG_H */
-- 
2.16.4

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

* [U-Boot] [PATCH 2/2] ARM: meson: Add Khadas VIM2 board support
  2018-10-03 10:02 ` [U-Boot] [PATCH 2/2] ARM: meson: Add Khadas VIM2 board support Loic Devulder
@ 2018-10-03 10:56   ` Neil Armstrong
  2018-10-11 14:11   ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 0 replies; 9+ messages in thread
From: Neil Armstrong @ 2018-10-03 10:56 UTC (permalink / raw)
  To: u-boot

Hi Loic,

Thanks for pushing this !

On 03/10/2018 12:02, Loic Devulder wrote:
> This adds platform code for the Khadas VIM2 board based on a
> Meson GXM (S912) SoC with the Meson GXM configuration.
> 
> This initial submission supports UART, MMC/SDCard and Ethernet.
> USB is partially supported.
> 
> All the code is from Neil Armstrong! I just rebased the code, do
> some cleanup and tested on my board.
> 
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> Signed-off-by: Loic Devulder <ldevulder@suse.de>

Acked-by: Neil Armstrong <narmstrong@baylibre.com>

Neil

> ---
>  arch/arm/mach-meson/Kconfig             |  23 +++++++
>  board/amlogic/khadas-vim2/Kconfig       |  12 ++++
>  board/amlogic/khadas-vim2/MAINTAINERS   |   6 ++
>  board/amlogic/khadas-vim2/Makefile      |   6 ++
>  board/amlogic/khadas-vim2/README        | 103 ++++++++++++++++++++++++++++++++
>  board/amlogic/khadas-vim2/khadas-vim2.c |  62 +++++++++++++++++++
>  configs/khadas-vim2_defconfig           |  51 ++++++++++++++++
>  include/configs/khadas-vim2.h           |  18 ++++++
>  8 files changed, 281 insertions(+)
>  create mode 100644 board/amlogic/khadas-vim2/Kconfig
>  create mode 100644 board/amlogic/khadas-vim2/MAINTAINERS
>  create mode 100644 board/amlogic/khadas-vim2/Makefile
>  create mode 100644 board/amlogic/khadas-vim2/README
>  create mode 100644 board/amlogic/khadas-vim2/khadas-vim2.c
>  create mode 100644 configs/khadas-vim2_defconfig
>  create mode 100644 include/configs/khadas-vim2.h
> 
> diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig
> index ee8b1cdcf6..cc943443b3 100644
> --- a/arch/arm/mach-meson/Kconfig
> +++ b/arch/arm/mach-meson/Kconfig
> @@ -22,6 +22,16 @@ config MESON_GXL
>  	  The Amlogic Meson GXL (S905X and S905D) is an ARM SoC with a
>  	  quad-core Cortex-A53 CPU and a Mali-450 GPU.
>  
> +config MESON_GXM
> +	bool "Support Meson GXM"
> +	select ARM64
> +	select CLK
> +	select DM
> +	select DM_SERIAL
> +	help
> +	  The Amlogic Meson GXM (S912) is an ARM SoC with an
> +	  octo-core Cortex-A53 CPU and a Mali-T860 GPU.
> +
>  if MESON_GXBB
>  
>  config TARGET_ODROID_C2
> @@ -64,6 +74,17 @@ config TARGET_KHADAS_VIM
>  
>  endif
>  
> +if MESON_GXM
> +
> +config TARGET_KHADAS_VIM2
> +	bool "KHADAS-VIM2"
> +	help
> +	  Khadas VIM2 is a single board computer based on Meson GXM
> +	  with 2/3 GiB of RAM, Ethernet, HDMI, 4 USB, micro-SD slot,
> +	  eMMC, IR receiver and a 40-pin GPIO header.
> +
> +endif
> +
>  config SYS_SOC
>  	default "meson"
>  
> @@ -80,4 +101,6 @@ source "board/amlogic/libretech-cc/Kconfig"
>  
>  source "board/amlogic/khadas-vim/Kconfig"
>  
> +source "board/amlogic/khadas-vim2/Kconfig"
> +
>  endif
> diff --git a/board/amlogic/khadas-vim2/Kconfig b/board/amlogic/khadas-vim2/Kconfig
> new file mode 100644
> index 0000000000..d0af36264d
> --- /dev/null
> +++ b/board/amlogic/khadas-vim2/Kconfig
> @@ -0,0 +1,12 @@
> +if TARGET_KHADAS_VIM2
> +
> +config SYS_BOARD
> +	default "khadas-vim2"
> +
> +config SYS_VENDOR
> +	default "amlogic"
> +
> +config SYS_CONFIG_NAME
> +	default "khadas-vim2"
> +
> +endif
> diff --git a/board/amlogic/khadas-vim2/MAINTAINERS b/board/amlogic/khadas-vim2/MAINTAINERS
> new file mode 100644
> index 0000000000..ca63e311c6
> --- /dev/null
> +++ b/board/amlogic/khadas-vim2/MAINTAINERS
> @@ -0,0 +1,6 @@
> +KHADAS-VIM2
> +M:	Neil Armstrong <narmstrong@baylibre.com>
> +S:	Maintained
> +F:	board/amlogic/khadas-vim2/
> +F:	include/configs/khadas-vim2.h
> +F:	configs/khadas-vim2_defconfig
> diff --git a/board/amlogic/khadas-vim2/Makefile b/board/amlogic/khadas-vim2/Makefile
> new file mode 100644
> index 0000000000..4e7c9a0592
> --- /dev/null
> +++ b/board/amlogic/khadas-vim2/Makefile
> @@ -0,0 +1,6 @@
> +# SPDX-License-Identifier: GPL-2.0+
> +#
> +# (C) Copyright 2016 BayLibre, SAS
> +# Author: Neil Armstrong <narmstrong@baylibre.com>
> +
> +obj-y	:= khadas-vim2.o
> diff --git a/board/amlogic/khadas-vim2/README b/board/amlogic/khadas-vim2/README
> new file mode 100644
> index 0000000000..578693fd2d
> --- /dev/null
> +++ b/board/amlogic/khadas-vim2/README
> @@ -0,0 +1,103 @@
> +U-Boot for Khadas VIM2
> +=======================
> +
> +Khadas VIM2 is an Open Source DIY Box manufactured by Shenzhen Wesion
> +Technology Co., Ltd with the following specifications:
> +
> + - Amlogic S912 ARM Cortex-A53 octo-core SoC @ 1.5GHz
> + - ARM Mali T860 GPU
> + - 2/3GB DDR4 SDRAM
> + - 10/100/1000 Ethernet
> + - HDMI 2.0 4K/60Hz display
> + - 40-pin GPIO header
> + - 2 x USB 2.0 Host, 1 x USB 2.0 Type-C OTG
> + - 16GB/32GB/64GB eMMC
> + - 2MB SPI Flash
> + - microSD
> + - SDIO Wifi Module, Bluetooth
> + - Two channels IR receiver
> +
> +Currently the u-boot port supports the following devices:
> + - serial
> + - eMMC, microSD
> + - Ethernet
> + - I2C
> + - Regulators
> + - Reset controller
> + - Clock controller
> + - USB Host
> + - ADC
> +
> +U-Boot compilation
> +==================
> +
> + > export ARCH=arm
> + > export CROSS_COMPILE=aarch64-none-elf-
> + > make khadas-vim2_defconfig
> + > make
> +
> +Image creation
> +==============
> +
> +Amlogic doesn't provide sources for the firmware and for tools needed
> +to create the bootloader image, so it is necessary to obtain them from
> +the git tree published by the board vendor:
> +
> + > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
> + > wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
> + > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
> + > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
> + > export PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH
> + > git clone https://github.com/khadas/u-boot -b Vim vim-u-boot
> + > cd vim-u-boot
> + > make kvim_defconfig
> + > make
> + > export FIPDIR=$PWD/fip
> +
> +Go back to mainline U-Boot source tree then :
> + > mkdir fip
> +
> + > cp $FIPDIR/gxl/bl2.bin fip/
> + > cp $FIPDIR/gxl/acs.bin fip/
> + > cp $FIPDIR/gxl/bl21.bin fip/
> + > cp $FIPDIR/gxl/bl30.bin fip/
> + > cp $FIPDIR/gxl/bl301.bin fip/
> + > cp $FIPDIR/gxl/bl31.img fip/
> + > cp u-boot.bin fip/bl33.bin
> +
> + > $FIPDIR/blx_fix.sh \
> +	fip/bl30.bin \
> +	fip/zero_tmp \
> +	fip/bl30_zero.bin \
> +	fip/bl301.bin \
> +	fip/bl301_zero.bin \
> +	fip/bl30_new.bin \
> +	bl30
> +
> + > python $FIPDIR/acs_tool.pyc fip/bl2.bin fip/bl2_acs.bin fip/acs.bin 0
> +
> + > $FIPDIR/blx_fix.sh \
> +	fip/bl2_acs.bin \
> +	fip/zero_tmp \
> +	fip/bl2_zero.bin \
> +	fip/bl21.bin \
> +	fip/bl21_zero.bin \
> +	fip/bl2_new.bin \
> +	bl2
> +
> + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl30_new.bin
> + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl31.img
> + > $FIPDIR/gxl/aml_encrypt_gxl --bl3enc --input fip/bl33.bin
> + > $FIPDIR/gxl/aml_encrypt_gxl --bl2sig --input fip/bl2_new.bin --output fip/bl2.n.bin.sig
> + > $FIPDIR/gxl/aml_encrypt_gxl --bootmk \
> +		--output fip/u-boot.bin \
> +		--bl2 fip/bl2.n.bin.sig \
> +		--bl30 fip/bl30_new.bin.enc \
> +		--bl31 fip/bl31.img.enc \
> +		--bl33 fip/bl33.bin.enc
> +
> +and then write the image to SD with:
> +
> + > DEV=/dev/your_sd_device
> + > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=512 skip=1 seek=1
> + > dd if=fip/u-boot.bin.sd.bin of=$DEV conv=fsync,notrunc bs=1 count=444
> diff --git a/board/amlogic/khadas-vim2/khadas-vim2.c b/board/amlogic/khadas-vim2/khadas-vim2.c
> new file mode 100644
> index 0000000000..ff56569f17
> --- /dev/null
> +++ b/board/amlogic/khadas-vim2/khadas-vim2.c
> @@ -0,0 +1,62 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (C) 2016 BayLibre, SAS
> + * Author: Neil Armstrong <narmstrong@baylibre.com>
> + */
> +
> +#include <common.h>
> +#include <dm.h>
> +#include <environment.h>
> +#include <asm/io.h>
> +#include <asm/arch/gx.h>
> +#include <asm/arch/mem.h>
> +#include <asm/arch/sm.h>
> +#include <asm/arch/eth.h>
> +
> +#define EFUSE_SN_OFFSET		20
> +#define EFUSE_SN_SIZE		16
> +#define EFUSE_MAC_OFFSET	52
> +#define EFUSE_MAC_SIZE		6
> +
> +int board_init(void)
> +{
> +	return 0;
> +}
> +
> +int misc_init_r(void)
> +{
> +	u8 mac_addr[EFUSE_MAC_SIZE];
> +	char serial[EFUSE_SN_SIZE];
> +	ssize_t len;
> +
> +	meson_gx_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
> +
> +	/* Reset PHY on GPIOZ_14 */
> +	clrbits_le32(GX_GPIO_EN(3), BIT(14));
> +	clrbits_le32(GX_GPIO_OUT(3), BIT(14));
> +	mdelay(10);
> +	setbits_le32(GX_GPIO_OUT(3), BIT(14));
> +
> +	if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
> +		len = meson_sm_read_efuse(EFUSE_MAC_OFFSET,
> +					  mac_addr, EFUSE_MAC_SIZE);
> +		if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr))
> +			eth_env_set_enetaddr("ethaddr", mac_addr);
> +	}
> +
> +	if (!env_get("serial#")) {
> +		len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial,
> +					  EFUSE_SN_SIZE);
> +		if (len == EFUSE_SN_SIZE)
> +			env_set("serial#", serial);
> +	}
> +
> +	return 0;
> +}
> +
> +int ft_board_setup(void *blob, bd_t *bd)
> +{
> +	meson_gx_init_reserved_memory(blob);
> +
> +	return 0;
> +}
> diff --git a/configs/khadas-vim2_defconfig b/configs/khadas-vim2_defconfig
> new file mode 100644
> index 0000000000..f21e3a8ddf
> --- /dev/null
> +++ b/configs/khadas-vim2_defconfig
> @@ -0,0 +1,51 @@
> +CONFIG_ARM=y
> +CONFIG_ARCH_MESON=y
> +CONFIG_SYS_TEXT_BASE=0x01000000
> +CONFIG_MESON_GXM=y
> +CONFIG_TARGET_KHADAS_VIM2=y
> +CONFIG_DEBUG_UART_BASE=0xc81004c0
> +CONFIG_DEBUG_UART_CLOCK=24000000
> +CONFIG_IDENT_STRING=" khadas-vim2"
> +CONFIG_DEFAULT_DEVICE_TREE="meson-gxm-khadas-vim2"
> +CONFIG_DEBUG_UART=y
> +CONFIG_OF_BOARD_SETUP=y
> +# CONFIG_DISPLAY_CPUINFO is not set
> +# CONFIG_DISPLAY_BOARDINFO is not set
> +# CONFIG_CMD_BDI is not set
> +# CONFIG_CMD_IMI is not set
> +CONFIG_CMD_ADC=y
> +CONFIG_CMD_GPIO=y
> +# CONFIG_CMD_LOADS is not set
> +CONFIG_CMD_MMC=y
> +CONFIG_CMD_USB=y
> +# CONFIG_CMD_SETEXPR is not set
> +CONFIG_CMD_REGULATOR=y
> +CONFIG_ADC=y
> +CONFIG_SARADC_MESON=y
> +CONFIG_OF_CONTROL=y
> +CONFIG_NET_RANDOM_ETHADDR=y
> +CONFIG_DM_GPIO=y
> +CONFIG_DM_REGULATOR=y
> +CONFIG_DM_REGULATOR_FIXED=y
> +CONFIG_DM_RESET=y
> +CONFIG_DM_MMC=y
> +CONFIG_MMC_MESON_GX=y
> +CONFIG_DM_ETH=y
> +CONFIG_ETH_DESIGNWARE=y
> +CONFIG_PINCTRL=y
> +CONFIG_PINCTRL_MESON_GXL=y
> +CONFIG_DEBUG_UART_MESON=y
> +CONFIG_DEBUG_UART_ANNOUNCE=y
> +CONFIG_DEBUG_UART_SKIP_INIT=y
> +CONFIG_MESON_SERIAL=y
> +CONFIG_OF_LIBFDT_OVERLAY=y
> +CONFIG_USB=y
> +CONFIG_DM_USB=y
> +CONFIG_USB_XHCI_HCD=y
> +CONFIG_USB_XHCI_DWC3=y
> +CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y
> +CONFIG_USB_DWC3=y
> +CONFIG_USB_STORAGE=y
> +CONFIG_PHY=y
> +CONFIG_MESON_GXL_USB_PHY=y
> +CONFIG_MTD=y
> diff --git a/include/configs/khadas-vim2.h b/include/configs/khadas-vim2.h
> new file mode 100644
> index 0000000000..7ef8f42bd2
> --- /dev/null
> +++ b/include/configs/khadas-vim2.h
> @@ -0,0 +1,18 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/*
> + * Configuration for Khadas VIM2
> + *
> + * Copyright (C) 2017 Baylibre, SAS
> + * Author: Neil Armstrong <narmstrong@baylibre.com>
> + */
> +
> +#ifndef __CONFIG_H
> +#define __CONFIG_H
> +
> +#define CONFIG_MISC_INIT_R
> +
> +#define MESON_FDTFILE_SETTING "fdtfile=amlogic/meson-gxm-khadas-vim2.dtb\0"
> +
> +#include <configs/meson-gx-common.h>
> +
> +#endif /* __CONFIG_H */
> 

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

* [U-Boot] [PATCH 1/2] ARM: meson: Add Khadas VIM2 board DT
  2018-10-03 10:02 ` [U-Boot] [PATCH 1/2] ARM: meson: Add Khadas VIM2 board DT Loic Devulder
@ 2018-10-03 10:56   ` Neil Armstrong
  2018-10-11 14:11   ` [U-Boot] [U-Boot,1/2] " Tom Rini
  1 sibling, 0 replies; 9+ messages in thread
From: Neil Armstrong @ 2018-10-03 10:56 UTC (permalink / raw)
  To: u-boot

Hi Loic,

Thanks for pushing this !

On 03/10/2018 12:02, Loic Devulder wrote:
> This adds Device Tree for the Khadas VIM2 board.
> 
> The meson-gxm-khadas-vim2.dts is synchronized from Linux 4.18.10.
> 
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> Signed-off-by: Loic Devulder <ldevulder@suse.de>

Acked-by: Neil Armstrong <narmstrong@baylibre.com>

Neil

> ---
>  arch/arm/dts/Makefile                  |   3 +-
>  arch/arm/dts/meson-gxm-khadas-vim2.dts | 412 +++++++++++++++++++++++++++++++++
>  arch/arm/dts/meson-gxm.dtsi            | 119 ++++++++++
>  3 files changed, 533 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/dts/meson-gxm-khadas-vim2.dts
>  create mode 100644 arch/arm/dts/meson-gxm.dtsi
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 44ebc50bfa..dfe9335a04 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -58,7 +58,8 @@ dtb-$(CONFIG_ARCH_MESON) += \
>  	meson-gxbb-nanopi-k2.dtb \
>  	meson-gxl-s905x-p212.dtb \
>  	meson-gxl-s905x-libretech-cc.dtb \
> -	meson-gxl-s905x-khadas-vim.dtb
> +	meson-gxl-s905x-khadas-vim.dtb \
> +	meson-gxm-khadas-vim2.dtb
>  dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
>  	tegra20-medcom-wide.dtb \
>  	tegra20-paz00.dtb \
> diff --git a/arch/arm/dts/meson-gxm-khadas-vim2.dts b/arch/arm/dts/meson-gxm-khadas-vim2.dts
> new file mode 100644
> index 0000000000..0868da476e
> --- /dev/null
> +++ b/arch/arm/dts/meson-gxm-khadas-vim2.dts
> @@ -0,0 +1,412 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +/*
> + * Copyright (c) 2017 Martin Blumenstingl <martin.blumenstingl@googlemail.com>.
> + * Copyright (c) 2017 BayLibre, SAS
> + * Author: Neil Armstrong <narmstrong@baylibre.com>
> + */
> +
> +/dts-v1/;
> +
> +#include <dt-bindings/input/input.h>
> +#include <dt-bindings/thermal/thermal.h>
> +
> +#include "meson-gxm.dtsi"
> +
> +/ {
> +	compatible = "khadas,vim2", "amlogic,s912", "amlogic,meson-gxm";
> +	model = "Khadas VIM2";
> +
> +	aliases {
> +		serial0 = &uart_AO;
> +		serial1 = &uart_A;
> +		serial2 = &uart_AO_B;
> +	};
> +
> +	chosen {
> +		stdout-path = "serial0:115200n8";
> +	};
> +
> +	memory at 0 {
> +		device_type = "memory";
> +		reg = <0x0 0x0 0x0 0x80000000>;
> +	};
> +
> +	adc-keys {
> +		compatible = "adc-keys";
> +		io-channels = <&saradc 0>;
> +		io-channel-names = "buttons";
> +		keyup-threshold-microvolt = <1710000>;
> +
> +		button-function {
> +			label = "Function";
> +			linux,code = <KEY_FN>;
> +			press-threshold-microvolt = <10000>;
> +		};
> +	};
> +
> +	emmc_pwrseq: emmc-pwrseq {
> +		compatible = "mmc-pwrseq-emmc";
> +		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
> +	};
> +
> +	gpio_fan: gpio-fan {
> +		compatible = "gpio-fan";
> +		gpios = <&gpio GPIODV_14 GPIO_ACTIVE_HIGH
> +			 &gpio GPIODV_15 GPIO_ACTIVE_HIGH>;
> +		/* Dummy RPM values since fan is optional */
> +		gpio-fan,speed-map = <0 0
> +				      1 1
> +				      2 2
> +				      3 3>;
> +		#cooling-cells = <2>;
> +	};
> +
> +	gpio-keys-polled {
> +		compatible = "gpio-keys-polled";
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		poll-interval = <100>;
> +
> +		button at 0 {
> +			label = "power";
> +			linux,code = <KEY_POWER>;
> +			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
> +		};
> +	};
> +
> +	hdmi-connector {
> +		compatible = "hdmi-connector";
> +		type = "a";
> +
> +		port {
> +			hdmi_connector_in: endpoint {
> +				remote-endpoint = <&hdmi_tx_tmds_out>;
> +			};
> +		};
> +	};
> +
> +	pwmleds {
> +		compatible = "pwm-leds";
> +
> +		power {
> +			label = "vim:red:power";
> +			pwms = <&pwm_AO_ab 1 7812500 0>;
> +			max-brightness = <255>;
> +			linux,default-trigger = "default-on";
> +		};
> +	};
> +
> +	sdio_pwrseq: sdio-pwrseq {
> +		compatible = "mmc-pwrseq-simple";
> +		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
> +		clocks = <&wifi32k>;
> +		clock-names = "ext_clock";
> +	};
> +
> +	thermal-zones {
> +		cpu-thermal {
> +			polling-delay-passive = <250>; /* milliseconds */
> +			polling-delay = <1000>; /* milliseconds */
> +
> +			thermal-sensors = <&scpi_sensors 0>;
> +
> +			trips {
> +				cpu_alert0: cpu-alert0 {
> +					temperature = <70000>; /* millicelsius */
> +					hysteresis = <2000>; /* millicelsius */
> +					type = "active";
> +				};
> +
> +				cpu_alert1: cpu-alert1 {
> +					temperature = <80000>; /* millicelsius */
> +					hysteresis = <2000>; /* millicelsius */
> +					type = "passive";
> +				};
> +			};
> +
> +			cooling-maps {
> +				map0 {
> +					trip = <&cpu_alert0>;
> +					cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
> +				};
> +
> +				map1 {
> +					trip = <&cpu_alert1>;
> +					cooling-device = <&gpio_fan 2 THERMAL_NO_LIMIT>;
> +				};
> +
> +				map2 {
> +					trip = <&cpu_alert1>;
> +					cooling-device =
> +						<&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> +				};
> +
> +				map3 {
> +					trip = <&cpu_alert1>;
> +					cooling-device =
> +						<&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> +				};
> +			};
> +		};
> +	};
> +
> +	hdmi_5v: regulator-hdmi-5v {
> +		compatible = "regulator-fixed";
> +
> +		regulator-name = "HDMI_5V";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +
> +		gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +		regulator-always-on;
> +	};
> +
> +	vcc_3v3: regulator-vcc_3v3 {
> +		compatible = "regulator-fixed";
> +		regulator-name = "VCC_3V3";
> +		regulator-min-microvolt = <3300000>;
> +		regulator-max-microvolt = <3300000>;
> +	};
> +
> +	vddio_ao18: regulator-vddio_ao18 {
> +		compatible = "regulator-fixed";
> +		regulator-name = "VDDIO_AO18";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +	};
> +
> +	vddio_boot: regulator-vddio_boot {
> +		compatible = "regulator-fixed";
> +		regulator-name = "VDDIO_BOOT";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +	};
> +
> +	vddao_3v3: regulator-vddao_3v3 {
> +		compatible = "regulator-fixed";
> +		regulator-name = "VDDAO_3V3";
> +		regulator-min-microvolt = <3300000>;
> +		regulator-max-microvolt = <3300000>;
> +	};
> +
> +	wifi32k: wifi32k {
> +		compatible = "pwm-clock";
> +		#clock-cells = <0>;
> +		clock-frequency = <32768>;
> +		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
> +	};
> +};
> +
> +&cec_AO {
> +	status = "okay";
> +	pinctrl-0 = <&ao_cec_pins>;
> +	pinctrl-names = "default";
> +	hdmi-phandle = <&hdmi_tx>;
> +};
> +
> +&cpu0 {
> +	#cooling-cells = <2>;
> +};
> +
> +&cpu4 {
> +	#cooling-cells = <2>;
> +};
> +
> +&ethmac {
> +	pinctrl-0 = <&eth_pins>;
> +	pinctrl-names = "default";
> +
> +	/* Select external PHY by default */
> +	phy-handle = <&external_phy>;
> +
> +	amlogic,tx-delay-ns = <2>;
> +
> +	/* External PHY reset is shared with internal PHY Led signals */
> +	snps,reset-gpio = <&gpio GPIOZ_14 0>;
> +	snps,reset-delays-us = <0 10000 1000000>;
> +	snps,reset-active-low;
> +
> +	/* External PHY is in RGMII */
> +	phy-mode = "rgmii";
> +
> +	status = "okay";
> +};
> +
> +&external_mdio {
> +	external_phy: ethernet-phy at 0 {
> +		/* Realtek RTL8211F (0x001cc916) */
> +		reg = <0>;
> +		interrupt-parent = <&gpio_intc>;
> +		/* MAC_INTR on GPIOZ_15 */
> +		interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
> +	};
> +};
> +
> +&hdmi_tx {
> +	status = "okay";
> +	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
> +	pinctrl-names = "default";
> +};
> +
> +&hdmi_tx_tmds_port {
> +	hdmi_tx_tmds_out: endpoint {
> +		remote-endpoint = <&hdmi_connector_in>;
> +	};
> +};
> +
> +&i2c_A {
> +	status = "okay";
> +	pinctrl-0 = <&i2c_a_pins>;
> +	pinctrl-names = "default";
> +};
> +
> +&i2c_B {
> +	status = "okay";
> +	pinctrl-0 = <&i2c_b_pins>;
> +	pinctrl-names = "default";
> +
> +	rtc: rtc at 51 {
> +		/* has to be enabled manually when a battery is connected: */
> +		status = "disabled";
> +		compatible = "haoyu,hym8563";
> +		reg = <0x51>;
> +		#clock-cells = <0>;
> +		clock-frequency = <32768>;
> +		clock-output-names = "xin32k";
> +	};
> +};
> +
> +&ir {
> +	status = "okay";
> +	pinctrl-0 = <&remote_input_ao_pins>;
> +	pinctrl-names = "default";
> +	linux,rc-map-name = "rc-geekbox";
> +};
> +
> +&pwm_AO_ab {
> +	status = "okay";
> +	pinctrl-0 = <&pwm_ao_a_3_pins>, <&pwm_ao_b_pins>;
> +	pinctrl-names = "default";
> +	clocks = <&clkc CLKID_FCLK_DIV4>;
> +	clock-names = "clkin0";
> +};
> +
> +&pwm_ef {
> +	status = "okay";
> +	pinctrl-0 = <&pwm_e_pins>, <&pwm_f_clk_pins>;
> +	pinctrl-names = "default";
> +	clocks = <&clkc CLKID_FCLK_DIV4>;
> +	clock-names = "clkin0";
> +};
> +
> +&sd_emmc_a {
> +	status = "okay";
> +	pinctrl-0 = <&sdio_pins>;
> +	pinctrl-names = "default";
> +	#address-cells = <1>;
> +	#size-cells = <0>;
> +
> +	bus-width = <4>;
> +	max-frequency = <100000000>;
> +
> +	non-removable;
> +	disable-wp;
> +
> +	mmc-pwrseq = <&sdio_pwrseq>;
> +
> +	vmmc-supply = <&vddao_3v3>;
> +	vqmmc-supply = <&vddio_boot>;
> +
> +	brcmf: wifi at 1 {
> +		reg = <1>;
> +		compatible = "brcm,bcm4329-fmac";
> +	};
> +};
> +
> +/* SD card */
> +&sd_emmc_b {
> +	status = "okay";
> +	pinctrl-0 = <&sdcard_pins>;
> +	pinctrl-names = "default";
> +
> +	bus-width = <4>;
> +	cap-sd-highspeed;
> +	max-frequency = <100000000>;
> +	disable-wp;
> +
> +	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
> +	cd-inverted;
> +
> +	vmmc-supply = <&vddao_3v3>;
> +	vqmmc-supply = <&vddio_boot>;
> +};
> +
> +/* eMMC */
> +&sd_emmc_c {
> +	status = "okay";
> +	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
> +	pinctrl-names = "default";
> +
> +	bus-width = <8>;
> +	cap-sd-highspeed;
> +	cap-mmc-highspeed;
> +	max-frequency = <200000000>;
> +	non-removable;
> +	disable-wp;
> +	mmc-ddr-1_8v;
> +	mmc-hs200-1_8v;
> +	mmc-hs400-1_8v;
> +
> +	mmc-pwrseq = <&emmc_pwrseq>;
> +	vmmc-supply = <&vcc_3v3>;
> +	vqmmc-supply = <&vddio_boot>;
> +};
> +
> +/*
> + * EMMC_DS pin is shared between SPI NOR CS and eMMC Data Strobe
> + * Remove emmc_ds_pins from sd_emmc_c pinctrl-0 then spifc can be enabled
> + */
> +&spifc {
> +	status = "disabled";
> +	pinctrl-0 = <&nor_pins>;
> +	pinctrl-names = "default";
> +
> +	w25q32: spi-flash at 0 {
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		compatible = "winbond,w25q16", "jedec,spi-nor";
> +		reg = <0>;
> +		spi-max-frequency = <3000000>;
> +	};
> +};
> +
> +/* This one is connected to the Bluetooth module */
> +&uart_A {
> +	status = "okay";
> +	pinctrl-0 = <&uart_a_pins>;
> +	pinctrl-names = "default";
> +};
> +
> +/* This is brought out on the Linux_RX (18) and Linux_TX (19) pins: */
> +&uart_AO {
> +	status = "okay";
> +	pinctrl-0 = <&uart_ao_a_pins>;
> +	pinctrl-names = "default";
> +};
> +
> +/* This is brought out on the UART_RX_AO_B (15) and UART_TX_AO_B (16) pins: */
> +&uart_AO_B {
> +	status = "okay";
> +	pinctrl-0 = <&uart_ao_b_pins>;
> +	pinctrl-names = "default";
> +};
> +
> +&saradc {
> +	status = "okay";
> +	vref-supply = <&vddio_ao18>;
> +};
> +
> +&usb0 {
> +	status = "okay";
> +};
> diff --git a/arch/arm/dts/meson-gxm.dtsi b/arch/arm/dts/meson-gxm.dtsi
> new file mode 100644
> index 0000000000..247888d68a
> --- /dev/null
> +++ b/arch/arm/dts/meson-gxm.dtsi
> @@ -0,0 +1,119 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +/*
> + * Copyright (c) 2016 Endless Computers, Inc.
> + * Author: Carlo Caione <carlo@endlessm.com>
> + */
> +
> +#include "meson-gxl.dtsi"
> +
> +/ {
> +	compatible = "amlogic,meson-gxm";
> +
> +	cpus {
> +		cpu-map {
> +			cluster0 {
> +				core0 {
> +					cpu = <&cpu0>;
> +				};
> +				core1 {
> +					cpu = <&cpu1>;
> +				};
> +				core2 {
> +					cpu = <&cpu2>;
> +				};
> +				core3 {
> +					cpu = <&cpu3>;
> +				};
> +			};
> +
> +			cluster1 {
> +				core0 {
> +					cpu = <&cpu4>;
> +				};
> +				core1 {
> +					cpu = <&cpu5>;
> +				};
> +				core2 {
> +					cpu = <&cpu6>;
> +				};
> +				core3 {
> +					cpu = <&cpu7>;
> +				};
> +			};
> +		};
> +
> +		cpu4: cpu at 100 {
> +			device_type = "cpu";
> +			compatible = "arm,cortex-a53", "arm,armv8";
> +			reg = <0x0 0x100>;
> +			enable-method = "psci";
> +			next-level-cache = <&l2>;
> +			clocks = <&scpi_dvfs 1>;
> +		};
> +
> +		cpu5: cpu at 101 {
> +			device_type = "cpu";
> +			compatible = "arm,cortex-a53", "arm,armv8";
> +			reg = <0x0 0x101>;
> +			enable-method = "psci";
> +			next-level-cache = <&l2>;
> +			clocks = <&scpi_dvfs 1>;
> +		};
> +
> +		cpu6: cpu at 102 {
> +			device_type = "cpu";
> +			compatible = "arm,cortex-a53", "arm,armv8";
> +			reg = <0x0 0x102>;
> +			enable-method = "psci";
> +			next-level-cache = <&l2>;
> +			clocks = <&scpi_dvfs 1>;
> +		};
> +
> +		cpu7: cpu at 103 {
> +			device_type = "cpu";
> +			compatible = "arm,cortex-a53", "arm,armv8";
> +			reg = <0x0 0x103>;
> +			enable-method = "psci";
> +			next-level-cache = <&l2>;
> +			clocks = <&scpi_dvfs 1>;
> +		};
> +	};
> +};
> +
> +&apb {
> +	usb2_phy2: phy at 78040 {
> +		compatible = "amlogic,meson-gxl-usb2-phy";
> +		#phy-cells = <0>;
> +		reg = <0x0 0x78040 0x0 0x20>;
> +		clocks = <&clkc CLKID_USB>;
> +		clock-names = "phy";
> +		resets = <&reset RESET_USB_OTG>;
> +		reset-names = "phy";
> +		status = "okay";
> +	};
> +};
> +
> +&clkc_AO {
> +	compatible = "amlogic,meson-gxm-aoclkc", "amlogic,meson-gx-aoclkc";
> +};
> +
> +&saradc {
> +	compatible = "amlogic,meson-gxm-saradc", "amlogic,meson-saradc";
> +};
> +
> +&scpi_dvfs {
> +	clock-indices = <0 1>;
> +	clock-output-names = "vbig", "vlittle";
> +};
> +
> +&vpu {
> +	compatible = "amlogic,meson-gxm-vpu", "amlogic,meson-gx-vpu";
> +};
> +
> +&hdmi_tx {
> +	compatible = "amlogic,meson-gxm-dw-hdmi", "amlogic,meson-gx-dw-hdmi";
> +};
> +
> +&dwc3 {
> +	phys = <&usb3_phy>, <&usb2_phy0>, <&usb2_phy1>, <&usb2_phy2>;
> +};
> 

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

* [U-Boot] [PATCH 0/2] Add Khadas VIM2 board support
  2018-10-03 10:02 [U-Boot] [PATCH 0/2] Add Khadas VIM2 board support Loic Devulder
  2018-10-03 10:02 ` [U-Boot] [PATCH 1/2] ARM: meson: Add Khadas VIM2 board DT Loic Devulder
  2018-10-03 10:02 ` [U-Boot] [PATCH 2/2] ARM: meson: Add Khadas VIM2 board support Loic Devulder
@ 2018-10-03 10:58 ` Neil Armstrong
  2018-10-03 11:01   ` Loic Devulder
  2 siblings, 1 reply; 9+ messages in thread
From: Neil Armstrong @ 2018-10-03 10:58 UTC (permalink / raw)
  To: u-boot

Hi Loic,

On 03/10/2018 12:02, Loic Devulder wrote:
> This adds platform code for the Khadas VIM2 board based on a
> Meson GXM (S912) SoC with the Meson GXM configuration.

With the "ARM: meson: Extend mem_map to support 3GiB of RAM" patch, I'm glad
this SoC will also be handled upstream, with the onboard SPI NOR flash to
store U-boot, it's a very good candidate for a full EBBR experience !

Neil

> 
> This initial submission supports UART, MMC/SDCard and Ethernet.
> USB is partially supported.
> 
> All the code is from Neil Armstrong! I just rebased the code, do
> some cleanup and tested on my board.
> 
> Loic Devulder (2):
>   ARM: meson: Add Khadas VIM2 board DT
>   ARM: meson: Add Khadas VIM2 board support
> 
>  arch/arm/dts/Makefile                   |   3 +-
>  arch/arm/dts/meson-gxm-khadas-vim2.dts  | 412 ++++++++++++++++++++++++++++++++
>  arch/arm/dts/meson-gxm.dtsi             | 119 +++++++++
>  arch/arm/mach-meson/Kconfig             |  23 ++
>  board/amlogic/khadas-vim2/Kconfig       |  12 +
>  board/amlogic/khadas-vim2/MAINTAINERS   |   6 +
>  board/amlogic/khadas-vim2/Makefile      |   6 +
>  board/amlogic/khadas-vim2/README        | 103 ++++++++
>  board/amlogic/khadas-vim2/khadas-vim2.c |  62 +++++
>  configs/khadas-vim2_defconfig           |  51 ++++
>  include/configs/khadas-vim2.h           |  18 ++
>  11 files changed, 814 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/dts/meson-gxm-khadas-vim2.dts
>  create mode 100644 arch/arm/dts/meson-gxm.dtsi
>  create mode 100644 board/amlogic/khadas-vim2/Kconfig
>  create mode 100644 board/amlogic/khadas-vim2/MAINTAINERS
>  create mode 100644 board/amlogic/khadas-vim2/Makefile
>  create mode 100644 board/amlogic/khadas-vim2/README
>  create mode 100644 board/amlogic/khadas-vim2/khadas-vim2.c
>  create mode 100644 configs/khadas-vim2_defconfig
>  create mode 100644 include/configs/khadas-vim2.h
> 

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

* [U-Boot] [PATCH 0/2] Add Khadas VIM2 board support
  2018-10-03 10:58 ` [U-Boot] [PATCH 0/2] " Neil Armstrong
@ 2018-10-03 11:01   ` Loic Devulder
  0 siblings, 0 replies; 9+ messages in thread
From: Loic Devulder @ 2018-10-03 11:01 UTC (permalink / raw)
  To: u-boot

Hi Neil,

On 10/3/18 12:58 PM, Neil Armstrong wrote:
> Hi Loic,
> 
> On 03/10/2018 12:02, Loic Devulder wrote:
>> This adds platform code for the Khadas VIM2 board based on a
>> Meson GXM (S912) SoC with the Meson GXM configuration.
> 
> With the "ARM: meson: Extend mem_map to support 3GiB of RAM" patch, I'm glad
> this SoC will also be handled upstream, with the onboard SPI NOR flash to
> store U-boot, it's a very good candidate for a full EBBR experience !

Yes! I hope to be able to try to test this shortly :)

> 
> Neil
> 
>>
>> This initial submission supports UART, MMC/SDCard and Ethernet.
>> USB is partially supported.
>>
>> All the code is from Neil Armstrong! I just rebased the code, do
>> some cleanup and tested on my board.
>>
>> Loic Devulder (2):
>>   ARM: meson: Add Khadas VIM2 board DT
>>   ARM: meson: Add Khadas VIM2 board support
>>
>>  arch/arm/dts/Makefile                   |   3 +-
>>  arch/arm/dts/meson-gxm-khadas-vim2.dts  | 412 ++++++++++++++++++++++++++++++++
>>  arch/arm/dts/meson-gxm.dtsi             | 119 +++++++++
>>  arch/arm/mach-meson/Kconfig             |  23 ++
>>  board/amlogic/khadas-vim2/Kconfig       |  12 +
>>  board/amlogic/khadas-vim2/MAINTAINERS   |   6 +
>>  board/amlogic/khadas-vim2/Makefile      |   6 +
>>  board/amlogic/khadas-vim2/README        | 103 ++++++++
>>  board/amlogic/khadas-vim2/khadas-vim2.c |  62 +++++
>>  configs/khadas-vim2_defconfig           |  51 ++++
>>  include/configs/khadas-vim2.h           |  18 ++
>>  11 files changed, 814 insertions(+), 1 deletion(-)
>>  create mode 100644 arch/arm/dts/meson-gxm-khadas-vim2.dts
>>  create mode 100644 arch/arm/dts/meson-gxm.dtsi
>>  create mode 100644 board/amlogic/khadas-vim2/Kconfig
>>  create mode 100644 board/amlogic/khadas-vim2/MAINTAINERS
>>  create mode 100644 board/amlogic/khadas-vim2/Makefile
>>  create mode 100644 board/amlogic/khadas-vim2/README
>>  create mode 100644 board/amlogic/khadas-vim2/khadas-vim2.c
>>  create mode 100644 configs/khadas-vim2_defconfig
>>  create mode 100644 include/configs/khadas-vim2.h
>>
> 

-- 
Loic Devulder <ldevulder@suse.com> | ldevulder at irc
0x175A963893C85F55 | D220 DEF5 56A3 DE00 9DAA 78BA 175A 9638 93C8 5F55
Senior QA Engineer | Container & Storage Solutions Quality Assurance
team (qa-css)
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB,
21284 (AG Nuernberg)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181003/53d5e636/attachment.sig>

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

* [U-Boot] [U-Boot,1/2] ARM: meson: Add Khadas VIM2 board DT
  2018-10-03 10:02 ` [U-Boot] [PATCH 1/2] ARM: meson: Add Khadas VIM2 board DT Loic Devulder
  2018-10-03 10:56   ` Neil Armstrong
@ 2018-10-11 14:11   ` Tom Rini
  1 sibling, 0 replies; 9+ messages in thread
From: Tom Rini @ 2018-10-11 14:11 UTC (permalink / raw)
  To: u-boot

On Wed, Oct 03, 2018 at 12:02:06PM +0200, Loic Devulder wrote:

> This adds Device Tree for the Khadas VIM2 board.
> 
> The meson-gxm-khadas-vim2.dts is synchronized from Linux 4.18.10.
> 
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> Signed-off-by: Loic Devulder <ldevulder@suse.de>
> Acked-by: Neil Armstrong <narmstrong@baylibre.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181011/737542d8/attachment.sig>

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

* [U-Boot] [U-Boot, 2/2] ARM: meson: Add Khadas VIM2 board support
  2018-10-03 10:02 ` [U-Boot] [PATCH 2/2] ARM: meson: Add Khadas VIM2 board support Loic Devulder
  2018-10-03 10:56   ` Neil Armstrong
@ 2018-10-11 14:11   ` Tom Rini
  1 sibling, 0 replies; 9+ messages in thread
From: Tom Rini @ 2018-10-11 14:11 UTC (permalink / raw)
  To: u-boot

On Wed, Oct 03, 2018 at 12:02:07PM +0200, Loic Devulder wrote:

> This adds platform code for the Khadas VIM2 board based on a
> Meson GXM (S912) SoC with the Meson GXM configuration.
> 
> This initial submission supports UART, MMC/SDCard and Ethernet.
> USB is partially supported.
> 
> All the code is from Neil Armstrong! I just rebased the code, do
> some cleanup and tested on my board.
> 
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> Signed-off-by: Loic Devulder <ldevulder@suse.de>
> Acked-by: Neil Armstrong <narmstrong@baylibre.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181011/7000f1e9/attachment.sig>

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

end of thread, other threads:[~2018-10-11 14:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03 10:02 [U-Boot] [PATCH 0/2] Add Khadas VIM2 board support Loic Devulder
2018-10-03 10:02 ` [U-Boot] [PATCH 1/2] ARM: meson: Add Khadas VIM2 board DT Loic Devulder
2018-10-03 10:56   ` Neil Armstrong
2018-10-11 14:11   ` [U-Boot] [U-Boot,1/2] " Tom Rini
2018-10-03 10:02 ` [U-Boot] [PATCH 2/2] ARM: meson: Add Khadas VIM2 board support Loic Devulder
2018-10-03 10:56   ` Neil Armstrong
2018-10-11 14:11   ` [U-Boot] [U-Boot, " Tom Rini
2018-10-03 10:58 ` [U-Boot] [PATCH 0/2] " Neil Armstrong
2018-10-03 11:01   ` Loic Devulder

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.