162306a36Sopenharmony_ci// SPDX-License-Identifier: ISC
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Device Tree file for Linksys NSLU2
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci/dts-v1/;
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#include "intel-ixp42x.dtsi"
962306a36Sopenharmony_ci#include <dt-bindings/input/input.h>
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci/ {
1262306a36Sopenharmony_ci	model = "Linksys NSLU2 (Network Storage Link for USB 2.0 Disk Drives)";
1362306a36Sopenharmony_ci	compatible = "linksys,nslu2", "intel,ixp42x";
1462306a36Sopenharmony_ci	#address-cells = <1>;
1562306a36Sopenharmony_ci	#size-cells = <1>;
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci	memory@0 {
1862306a36Sopenharmony_ci		/* 32 MB SDRAM */
1962306a36Sopenharmony_ci		device_type = "memory";
2062306a36Sopenharmony_ci		reg = <0x00000000 0x2000000>;
2162306a36Sopenharmony_ci	};
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci	chosen {
2462306a36Sopenharmony_ci		bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rw rootfstype=squashfs,jffs2 rootwait";
2562306a36Sopenharmony_ci		stdout-path = "uart0:115200n8";
2662306a36Sopenharmony_ci	};
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci	aliases {
2962306a36Sopenharmony_ci		serial0 = &uart0;
3062306a36Sopenharmony_ci	};
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci	leds {
3362306a36Sopenharmony_ci		compatible = "gpio-leds";
3462306a36Sopenharmony_ci		led-status {
3562306a36Sopenharmony_ci			label = "nslu2:red:status";
3662306a36Sopenharmony_ci			gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
3762306a36Sopenharmony_ci			default-state = "on";
3862306a36Sopenharmony_ci			linux,default-trigger = "heartbeat";
3962306a36Sopenharmony_ci		};
4062306a36Sopenharmony_ci		led-ready {
4162306a36Sopenharmony_ci			label = "nslu2:green:ready";
4262306a36Sopenharmony_ci			gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
4362306a36Sopenharmony_ci			default-state = "on";
4462306a36Sopenharmony_ci		};
4562306a36Sopenharmony_ci		led-disk-1 {
4662306a36Sopenharmony_ci			label = "nslu2:green:disk-1";
4762306a36Sopenharmony_ci			gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
4862306a36Sopenharmony_ci			default-state = "off";
4962306a36Sopenharmony_ci		};
5062306a36Sopenharmony_ci		led-disk-2 {
5162306a36Sopenharmony_ci			label = "nslu2:green:disk-2";
5262306a36Sopenharmony_ci			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
5362306a36Sopenharmony_ci			default-state = "off";
5462306a36Sopenharmony_ci		};
5562306a36Sopenharmony_ci	};
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci	gpio_keys {
5862306a36Sopenharmony_ci		compatible = "gpio-keys";
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci		button-power {
6162306a36Sopenharmony_ci			wakeup-source;
6262306a36Sopenharmony_ci			linux,code = <KEY_POWER>;
6362306a36Sopenharmony_ci			label = "power";
6462306a36Sopenharmony_ci			gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
6562306a36Sopenharmony_ci		};
6662306a36Sopenharmony_ci		button-reset {
6762306a36Sopenharmony_ci			wakeup-source;
6862306a36Sopenharmony_ci			linux,code = <KEY_ESC>;
6962306a36Sopenharmony_ci			label = "reset";
7062306a36Sopenharmony_ci			gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
7162306a36Sopenharmony_ci		};
7262306a36Sopenharmony_ci	};
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci	i2c {
7562306a36Sopenharmony_ci		compatible = "i2c-gpio";
7662306a36Sopenharmony_ci		sda-gpios = <&gpio0 7 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
7762306a36Sopenharmony_ci		scl-gpios = <&gpio0 6 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
7862306a36Sopenharmony_ci		#address-cells = <1>;
7962306a36Sopenharmony_ci		#size-cells = <0>;
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci		rtc@6f {
8262306a36Sopenharmony_ci			compatible = "xicor,x1205";
8362306a36Sopenharmony_ci			reg = <0x6f>;
8462306a36Sopenharmony_ci		};
8562306a36Sopenharmony_ci	};
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ci	gpio-poweroff {
8862306a36Sopenharmony_ci		compatible = "gpio-poweroff";
8962306a36Sopenharmony_ci		gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
9062306a36Sopenharmony_ci		timeout-ms = <5000>;
9162306a36Sopenharmony_ci	};
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci	gpio-beeper {
9462306a36Sopenharmony_ci		compatible = "gpio-beeper";
9562306a36Sopenharmony_ci		gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
9662306a36Sopenharmony_ci	};
9762306a36Sopenharmony_ci
9862306a36Sopenharmony_ci	soc {
9962306a36Sopenharmony_ci		bus@c4000000 {
10062306a36Sopenharmony_ci			/* The first 16MB region at CS0 on the expansion bus */
10162306a36Sopenharmony_ci			flash@0,0 {
10262306a36Sopenharmony_ci				compatible = "intel,ixp4xx-flash", "cfi-flash";
10362306a36Sopenharmony_ci				bank-width = <2>;
10462306a36Sopenharmony_ci				/*
10562306a36Sopenharmony_ci				 * 8 MB of Flash in 0x20000 byte blocks
10662306a36Sopenharmony_ci				 * mapped in at CS0.
10762306a36Sopenharmony_ci				 */
10862306a36Sopenharmony_ci				reg = <0 0x00000000 0x800000>;
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci				partitions {
11162306a36Sopenharmony_ci					compatible = "redboot-fis";
11262306a36Sopenharmony_ci					/* Eraseblock at 0x7e0000 */
11362306a36Sopenharmony_ci					fis-index-block = <0x3f>;
11462306a36Sopenharmony_ci				};
11562306a36Sopenharmony_ci			};
11662306a36Sopenharmony_ci		};
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_ci		pci@c0000000 {
11962306a36Sopenharmony_ci			status = "okay";
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci			/*
12262306a36Sopenharmony_ci			 * Taken from NSLU2 PCI boardfile, INT A, B, C swizzled D constant
12362306a36Sopenharmony_ci			 * We have slots (IDSEL) 1, 2 and 3.
12462306a36Sopenharmony_ci			 */
12562306a36Sopenharmony_ci			#interrupt-cells = <1>;
12662306a36Sopenharmony_ci			interrupt-map-mask = <0xf800 0 0 7>;
12762306a36Sopenharmony_ci			interrupt-map =
12862306a36Sopenharmony_ci			/* IDSEL 1 */
12962306a36Sopenharmony_ci			<0x0800 0 0 1 &gpio0 11 IRQ_TYPE_LEVEL_LOW>, /* INT A on slot 1 is irq 11 */
13062306a36Sopenharmony_ci			<0x0800 0 0 2 &gpio0 10 IRQ_TYPE_LEVEL_LOW>, /* INT B on slot 1 is irq 10 */
13162306a36Sopenharmony_ci			<0x0800 0 0 3 &gpio0 9  IRQ_TYPE_LEVEL_LOW>, /* INT C on slot 1 is irq 9 */
13262306a36Sopenharmony_ci			<0x0800 0 0 4 &gpio0 8  IRQ_TYPE_LEVEL_LOW>, /* INT D on slot 1 is irq 8 */
13362306a36Sopenharmony_ci			/* IDSEL 2 */
13462306a36Sopenharmony_ci			<0x1000 0 0 1 &gpio0 10 IRQ_TYPE_LEVEL_LOW>, /* INT A on slot 2 is irq 10 */
13562306a36Sopenharmony_ci			<0x1000 0 0 2 &gpio0 9  IRQ_TYPE_LEVEL_LOW>, /* INT B on slot 2 is irq 9 */
13662306a36Sopenharmony_ci			<0x1000 0 0 3 &gpio0 11 IRQ_TYPE_LEVEL_LOW>, /* INT C on slot 2 is irq 11 */
13762306a36Sopenharmony_ci			<0x1000 0 0 4 &gpio0 8  IRQ_TYPE_LEVEL_LOW>, /* INT D on slot 2 is irq 8 */
13862306a36Sopenharmony_ci			/* IDSEL 3 */
13962306a36Sopenharmony_ci			<0x1800 0 0 1 &gpio0 9  IRQ_TYPE_LEVEL_LOW>, /* INT A on slot 3 is irq 9 */
14062306a36Sopenharmony_ci			<0x1800 0 0 2 &gpio0 11 IRQ_TYPE_LEVEL_LOW>, /* INT B on slot 3 is irq 11 */
14162306a36Sopenharmony_ci			<0x1800 0 0 3 &gpio0 10 IRQ_TYPE_LEVEL_LOW>, /* INT C on slot 3 is irq 10 */
14262306a36Sopenharmony_ci			<0x1800 0 0 4 &gpio0 8  IRQ_TYPE_LEVEL_LOW>; /* INT D on slot 3 is irq 8 */
14362306a36Sopenharmony_ci		};
14462306a36Sopenharmony_ci
14562306a36Sopenharmony_ci		ethernet@c8009000 {
14662306a36Sopenharmony_ci			status = "okay";
14762306a36Sopenharmony_ci			queue-rx = <&qmgr 3>;
14862306a36Sopenharmony_ci			queue-txready = <&qmgr 20>;
14962306a36Sopenharmony_ci			phy-mode = "rgmii";
15062306a36Sopenharmony_ci			phy-handle = <&phy1>;
15162306a36Sopenharmony_ci
15262306a36Sopenharmony_ci			mdio {
15362306a36Sopenharmony_ci				#address-cells = <1>;
15462306a36Sopenharmony_ci				#size-cells = <0>;
15562306a36Sopenharmony_ci
15662306a36Sopenharmony_ci				phy1: ethernet-phy@1 {
15762306a36Sopenharmony_ci					reg = <1>;
15862306a36Sopenharmony_ci				};
15962306a36Sopenharmony_ci			};
16062306a36Sopenharmony_ci		};
16162306a36Sopenharmony_ci	};
16262306a36Sopenharmony_ci};
163