18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2019 Linaro Ltd.
48c2ecf20Sopenharmony_ci * Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
58c2ecf20Sopenharmony_ci */
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci/dts-v1/;
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include "bm1880.dtsi"
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci/*
128c2ecf20Sopenharmony_ci * GPIO name legend: proper name = the GPIO line is used as GPIO
138c2ecf20Sopenharmony_ci *         NC = not connected (pin out but not routed from the chip to
148c2ecf20Sopenharmony_ci *              anything the board)
158c2ecf20Sopenharmony_ci *         "[PER]" = pin is muxed for [peripheral] (not GPIO)
168c2ecf20Sopenharmony_ci *         LSEC = Low Speed External Connector
178c2ecf20Sopenharmony_ci *         HSEC = High Speed External Connector
188c2ecf20Sopenharmony_ci *
198c2ecf20Sopenharmony_ci * Line names are taken from the schematic "sophon-edge-schematics"
208c2ecf20Sopenharmony_ci * version, 1.0210.
218c2ecf20Sopenharmony_ci *
228c2ecf20Sopenharmony_ci * For the lines routed to the external connectors the
238c2ecf20Sopenharmony_ci * lines are named after the 96Boards CE Specification 1.0,
248c2ecf20Sopenharmony_ci * Appendix "Expansion Connector Signal Description".
258c2ecf20Sopenharmony_ci *
268c2ecf20Sopenharmony_ci * When the 96Board naming of a line and the schematic name of
278c2ecf20Sopenharmony_ci * the same line are in conflict, the 96Board specification
288c2ecf20Sopenharmony_ci * takes precedence. This is only for the informational
298c2ecf20Sopenharmony_ci * lines i.e. "[FOO]", the GPIO named lines "GPIO-A" thru "GPIO-L"
308c2ecf20Sopenharmony_ci * are the only ones actually used for GPIO.
318c2ecf20Sopenharmony_ci */
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci/ {
348c2ecf20Sopenharmony_ci	compatible = "bitmain,sophon-edge", "bitmain,bm1880";
358c2ecf20Sopenharmony_ci	model = "Sophon Edge";
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci	aliases {
388c2ecf20Sopenharmony_ci		serial0 = &uart0;
398c2ecf20Sopenharmony_ci		serial1 = &uart2;
408c2ecf20Sopenharmony_ci		serial2 = &uart1;
418c2ecf20Sopenharmony_ci	};
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci	chosen {
448c2ecf20Sopenharmony_ci		stdout-path = "serial0:115200n8";
458c2ecf20Sopenharmony_ci	};
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci	memory@0 {
488c2ecf20Sopenharmony_ci		device_type = "memory";
498c2ecf20Sopenharmony_ci		reg = <0x1 0x00000000 0x0 0x40000000>; // 1GB
508c2ecf20Sopenharmony_ci	};
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci	soc {
538c2ecf20Sopenharmony_ci		gpio0: gpio@50027000 {
548c2ecf20Sopenharmony_ci			porta: gpio-controller@0 {
558c2ecf20Sopenharmony_ci				gpio-line-names =
568c2ecf20Sopenharmony_ci					"GPIO-A", /* GPIO0, LSEC pin 23 */
578c2ecf20Sopenharmony_ci					"GPIO-C", /* GPIO1, LSEC pin 25 */
588c2ecf20Sopenharmony_ci					"[GPIO2_PHY0_RST]", /* GPIO2 */
598c2ecf20Sopenharmony_ci					"GPIO-E", /* GPIO3, LSEC pin 27 */
608c2ecf20Sopenharmony_ci					"[USB_DET]", /* GPIO4 */
618c2ecf20Sopenharmony_ci					"[EN_P5V]", /* GPIO5 */
628c2ecf20Sopenharmony_ci					"[VDDIO_MS1_SEL]", /* GPIO6 */
638c2ecf20Sopenharmony_ci					"GPIO-G", /* GPIO7, LSEC pin 29 */
648c2ecf20Sopenharmony_ci					"[BM_TUSB_RST_L]", /* GPIO8 */
658c2ecf20Sopenharmony_ci					"[EN_P5V_USBHUB]", /* GPIO9 */
668c2ecf20Sopenharmony_ci					"NC",
678c2ecf20Sopenharmony_ci					"LED_WIFI", /* GPIO11 */
688c2ecf20Sopenharmony_ci					"LED_BT", /* GPIO12 */
698c2ecf20Sopenharmony_ci					"[BM_BLM8221_EN_L]", /* GPIO13 */
708c2ecf20Sopenharmony_ci					"NC", /* GPIO14 */
718c2ecf20Sopenharmony_ci					"NC", /* GPIO15 */
728c2ecf20Sopenharmony_ci					"NC", /* GPIO16 */
738c2ecf20Sopenharmony_ci					"NC", /* GPIO17 */
748c2ecf20Sopenharmony_ci					"NC", /* GPIO18 */
758c2ecf20Sopenharmony_ci					"NC", /* GPIO19 */
768c2ecf20Sopenharmony_ci					"NC", /* GPIO20 */
778c2ecf20Sopenharmony_ci					"NC", /* GPIO21 */
788c2ecf20Sopenharmony_ci					"NC", /* GPIO22 */
798c2ecf20Sopenharmony_ci					"NC", /* GPIO23 */
808c2ecf20Sopenharmony_ci					"NC", /* GPIO24 */
818c2ecf20Sopenharmony_ci					"NC", /* GPIO25 */
828c2ecf20Sopenharmony_ci					"NC", /* GPIO26 */
838c2ecf20Sopenharmony_ci					"NC", /* GPIO27 */
848c2ecf20Sopenharmony_ci					"NC", /* GPIO28 */
858c2ecf20Sopenharmony_ci					"NC", /* GPIO29 */
868c2ecf20Sopenharmony_ci					"NC", /* GPIO30 */
878c2ecf20Sopenharmony_ci					"NC"; /* GPIO31 */
888c2ecf20Sopenharmony_ci			};
898c2ecf20Sopenharmony_ci		};
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci		gpio1: gpio@50027400 {
928c2ecf20Sopenharmony_ci			portb: gpio-controller@0 {
938c2ecf20Sopenharmony_ci				gpio-line-names =
948c2ecf20Sopenharmony_ci					"NC", /* GPIO32 */
958c2ecf20Sopenharmony_ci					"NC", /* GPIO33 */
968c2ecf20Sopenharmony_ci					"[I2C0_SDA]", /* GPIO34, LSEC pin 17 */
978c2ecf20Sopenharmony_ci					"[I2C0_SCL]", /* GPIO35, LSEC pin 15 */
988c2ecf20Sopenharmony_ci					"[JTAG0_TDO]", /* GPIO36 */
998c2ecf20Sopenharmony_ci					"[JTAG0_TCK]", /* GPIO37 */
1008c2ecf20Sopenharmony_ci					"[JTAG0_TDI]", /* GPIO38 */
1018c2ecf20Sopenharmony_ci					"[JTAG0_TMS]", /* GPIO39 */
1028c2ecf20Sopenharmony_ci					"[JTAG0_TRST_X]", /* GPIO40 */
1038c2ecf20Sopenharmony_ci					"[JTAG1_TDO]", /* GPIO41 */
1048c2ecf20Sopenharmony_ci					"[JTAG1_TCK]", /* GPIO42 */
1058c2ecf20Sopenharmony_ci					"[JTAG1_TDI]", /* GPIO43 */
1068c2ecf20Sopenharmony_ci					"[CPU_TX]", /* GPIO44 */
1078c2ecf20Sopenharmony_ci					"[CPU_RX]", /* GPIO45 */
1088c2ecf20Sopenharmony_ci					"[UART1_TXD]", /* GPIO46 */
1098c2ecf20Sopenharmony_ci					"[UART1_RXD]", /* GPIO47 */
1108c2ecf20Sopenharmony_ci					"[UART0_TXD]", /* GPIO48 */
1118c2ecf20Sopenharmony_ci					"[UART0_RXD]", /* GPIO49 */
1128c2ecf20Sopenharmony_ci					"GPIO-I", /* GPIO50, LSEC pin 31 */
1138c2ecf20Sopenharmony_ci					"GPIO-K", /* GPIO51, LSEC pin 33 */
1148c2ecf20Sopenharmony_ci					"USER_LED2", /* GPIO52 */
1158c2ecf20Sopenharmony_ci					"USER_LED1", /* GPIO53 */
1168c2ecf20Sopenharmony_ci					"[UART0_RTS]", /* GPIO54 */
1178c2ecf20Sopenharmony_ci					"[UART0_CTS]", /* GPIO55 */
1188c2ecf20Sopenharmony_ci					"USER_LED4", /* GPIO56, JTAG1_TRST_X */
1198c2ecf20Sopenharmony_ci					"USER_LED3", /* GPIO57, JTAG1_TMS */
1208c2ecf20Sopenharmony_ci					"[I2S0_SCLK]", /* GPIO58 */
1218c2ecf20Sopenharmony_ci					"[I2S0_FS]", /* GPIO59 */
1228c2ecf20Sopenharmony_ci					"[I2S0_SDI]", /* GPIO60 */
1238c2ecf20Sopenharmony_ci					"[I2S0_SDO]", /* GPIO61 */
1248c2ecf20Sopenharmony_ci					"GPIO-B", /* GPIO62, LSEC pin 24 */
1258c2ecf20Sopenharmony_ci					"GPIO-F"; /* GPIO63, I2S1_SCLK, LSEC pin 28 */
1268c2ecf20Sopenharmony_ci			};
1278c2ecf20Sopenharmony_ci		};
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci		gpio2: gpio@50027800 {
1308c2ecf20Sopenharmony_ci			portc: gpio-controller@0 {
1318c2ecf20Sopenharmony_ci				gpio-line-names =
1328c2ecf20Sopenharmony_ci					"GPIO-D", /* GPIO64, I2S1_FS, LSEC pin 26 */
1338c2ecf20Sopenharmony_ci					"GPIO-J", /* GPIO65, I2S1_SDI, LSEC pin 32 */
1348c2ecf20Sopenharmony_ci					"GPIO-H", /* GPIO66, I2S1_SDO, LSEC pin 30 */
1358c2ecf20Sopenharmony_ci					"GPIO-L", /* GPIO67, LSEC pin 34 */
1368c2ecf20Sopenharmony_ci					"[SPI0_CS]", /* GPIO68, SPI1_CS, LSEC pin 12 */
1378c2ecf20Sopenharmony_ci					"[SPI0_DIN]", /* GPIO69, SPI1_SDI, LSEC pin 10 */
1388c2ecf20Sopenharmony_ci					"[SPI0_DOUT]", /* GPIO70, SPI1_SDO, LSEC pin 14 */
1398c2ecf20Sopenharmony_ci					"[SPI0_SCLK]"; /* GPIO71, SPI1_SCK, LSEC pin 8 */
1408c2ecf20Sopenharmony_ci			};
1418c2ecf20Sopenharmony_ci		};
1428c2ecf20Sopenharmony_ci	};
1438c2ecf20Sopenharmony_ci};
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_ci&pinctrl {
1468c2ecf20Sopenharmony_ci	pinctrl_uart0_default: pinctrl-uart0-default {
1478c2ecf20Sopenharmony_ci		pinmux {
1488c2ecf20Sopenharmony_ci			groups = "uart0_grp";
1498c2ecf20Sopenharmony_ci			function = "uart0";
1508c2ecf20Sopenharmony_ci		};
1518c2ecf20Sopenharmony_ci	};
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci	pinctrl_uart1_default: pinctrl-uart1-default {
1548c2ecf20Sopenharmony_ci		pinmux {
1558c2ecf20Sopenharmony_ci			groups = "uart1_grp";
1568c2ecf20Sopenharmony_ci			function = "uart1";
1578c2ecf20Sopenharmony_ci		};
1588c2ecf20Sopenharmony_ci	};
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci	pinctrl_uart2_default: pinctrl-uart2-default {
1618c2ecf20Sopenharmony_ci		pinmux {
1628c2ecf20Sopenharmony_ci			groups = "uart2_grp";
1638c2ecf20Sopenharmony_ci			function = "uart2";
1648c2ecf20Sopenharmony_ci		};
1658c2ecf20Sopenharmony_ci	};
1668c2ecf20Sopenharmony_ci};
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci&uart0 {
1698c2ecf20Sopenharmony_ci	status = "okay";
1708c2ecf20Sopenharmony_ci	pinctrl-names = "default";
1718c2ecf20Sopenharmony_ci	pinctrl-0 = <&pinctrl_uart0_default>;
1728c2ecf20Sopenharmony_ci};
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci&uart1 {
1758c2ecf20Sopenharmony_ci	status = "okay";
1768c2ecf20Sopenharmony_ci	pinctrl-names = "default";
1778c2ecf20Sopenharmony_ci	pinctrl-0 = <&pinctrl_uart1_default>;
1788c2ecf20Sopenharmony_ci};
1798c2ecf20Sopenharmony_ci
1808c2ecf20Sopenharmony_ci&uart2 {
1818c2ecf20Sopenharmony_ci	status = "okay";
1828c2ecf20Sopenharmony_ci	pinctrl-names = "default";
1838c2ecf20Sopenharmony_ci	pinctrl-0 = <&pinctrl_uart2_default>;
1848c2ecf20Sopenharmony_ci};
185