Module Name:    src
Committed By:   dyoung
Date:           Sat May  4 02:21:49 UTC 2024

Modified Files:
        src/distrib/sets/lists/dtb: ad.earmv7 ad.earmv7hf ad.earmv7hfeb
        src/sys/external/gpl2/dts/dist/arch/arm/boot/dts: Makefile
Added Files:
        src/sys/arch/arm/dts: zynq-red-pitaya-122-16.dts

Log Message:
Add a device tree for the Red Pitaya SDRlab 122-16.

To boot NetBSD on the 122-16, copy the .dtb built from
zynq-red-pitays-122-16.dts, the first-stage bootloader (called
boot.bin) and U-Boot that came with the 122-16 and a kernel image,
netbsd.ub, built for earmv7hf to an MS-DOS partition on an
MBR-partitioned SD card.  At the U-Boot prompt, "Zynq> ", type these
commands:

i2c dev 0
eeprom read 0 0x50 0 0x1804 0x400
env import -b 0 0x400 hw_rev serial ethaddr
setenv bootargs "root=ld0a"
fatload mmc 0 0x01f00000 device~1.dtb
fatload mmc 0 0x02000000 netbsd.ub
fdt addr 0x01f00000
fdt set /axi/ethernet@e000b000 local-mac-address $ethaddr
bootm 0x02000000 - 0x01f00000

Note that the ethernet PHY will not attach unless you have applied
the patches from Lloyd Parkes in kern/58083.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/distrib/sets/lists/dtb/ad.earmv7 \
    src/distrib/sets/lists/dtb/ad.earmv7hf \
    src/distrib/sets/lists/dtb/ad.earmv7hfeb
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/dts/zynq-red-pitaya-122-16.dts
cvs rdiff -u -r1.1.1.10 -r1.2 \
    src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/dtb/ad.earmv7
diff -u src/distrib/sets/lists/dtb/ad.earmv7:1.10 src/distrib/sets/lists/dtb/ad.earmv7:1.11
--- src/distrib/sets/lists/dtb/ad.earmv7:1.10	Wed Nov  1 12:51:13 2023
+++ src/distrib/sets/lists/dtb/ad.earmv7	Sat May  4 02:21:48 2024
@@ -1,4 +1,4 @@
-# $NetBSD: ad.earmv7,v 1.10 2023/11/01 12:51:13 simonb Exp $
+# $NetBSD: ad.earmv7,v 1.11 2024/05/04 02:21:48 dyoung Exp $
 #
 # DO NOT EDIT THIS FILE MANUALLY
 # Generated by "make update-sets" in sys/dtb
@@ -580,6 +580,7 @@
 ./boot/dtb/zynq-ebaz4205.dtb                         dtb-base-boot  dtb
 ./boot/dtb/zynq-microzed.dtb                         dtb-base-boot  dtb
 ./boot/dtb/zynq-parallella.dtb                       dtb-base-boot  dtb
+./boot/dtb/zynq-red-pitaya-122-16.dtb                dtb-base-boot  dtb
 ./boot/dtb/zynq-zc702.dtb                            dtb-base-boot  dtb
 ./boot/dtb/zynq-zc706.dtb                            dtb-base-boot  dtb
 ./boot/dtb/zynq-zc770-xm010.dtb                      dtb-base-boot  dtb
Index: src/distrib/sets/lists/dtb/ad.earmv7hf
diff -u src/distrib/sets/lists/dtb/ad.earmv7hf:1.10 src/distrib/sets/lists/dtb/ad.earmv7hf:1.11
--- src/distrib/sets/lists/dtb/ad.earmv7hf:1.10	Thu May  4 13:41:46 2023
+++ src/distrib/sets/lists/dtb/ad.earmv7hf	Sat May  4 02:21:48 2024
@@ -1,4 +1,4 @@
-# $NetBSD: ad.earmv7hf,v 1.10 2023/05/04 13:41:46 bouyer Exp $
+# $NetBSD: ad.earmv7hf,v 1.11 2024/05/04 02:21:48 dyoung Exp $
 #
 # DO NOT EDIT THIS FILE MANUALLY
 # Generated by "make update-sets" in sys/dtb
@@ -580,6 +580,7 @@
 ./boot/dtb/zynq-ebaz4205.dtb                         dtb-base-boot  dtb
 ./boot/dtb/zynq-microzed.dtb                         dtb-base-boot  dtb
 ./boot/dtb/zynq-parallella.dtb                       dtb-base-boot  dtb
+./boot/dtb/zynq-red-pitaya-122-16.dtb                dtb-base-boot  dtb
 ./boot/dtb/zynq-zc702.dtb                            dtb-base-boot  dtb
 ./boot/dtb/zynq-zc706.dtb                            dtb-base-boot  dtb
 ./boot/dtb/zynq-zc770-xm010.dtb                      dtb-base-boot  dtb
Index: src/distrib/sets/lists/dtb/ad.earmv7hfeb
diff -u src/distrib/sets/lists/dtb/ad.earmv7hfeb:1.10 src/distrib/sets/lists/dtb/ad.earmv7hfeb:1.11
--- src/distrib/sets/lists/dtb/ad.earmv7hfeb:1.10	Sat May  6 08:43:20 2023
+++ src/distrib/sets/lists/dtb/ad.earmv7hfeb	Sat May  4 02:21:48 2024
@@ -1,4 +1,4 @@
-# $NetBSD: ad.earmv7hfeb,v 1.10 2023/05/06 08:43:20 skrll Exp $
+# $NetBSD: ad.earmv7hfeb,v 1.11 2024/05/04 02:21:48 dyoung Exp $
 #
 # DO NOT EDIT THIS FILE MANUALLY
 # Generated by "make update-sets" in sys/dtb
@@ -580,6 +580,7 @@
 ./boot/dtb/zynq-ebaz4205.dtb                         dtb-base-boot  dtb
 ./boot/dtb/zynq-microzed.dtb                         dtb-base-boot  dtb
 ./boot/dtb/zynq-parallella.dtb                       dtb-base-boot  dtb
+./boot/dtb/zynq-red-pitaya-122-16.dtb                dtb-base-boot  dtb
 ./boot/dtb/zynq-zc702.dtb                            dtb-base-boot  dtb
 ./boot/dtb/zynq-zc706.dtb                            dtb-base-boot  dtb
 ./boot/dtb/zynq-zc770-xm010.dtb                      dtb-base-boot  dtb

Index: src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/Makefile
diff -u src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/Makefile:1.1.1.10 src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/Makefile:1.2
--- src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/Makefile:1.1.1.10	Sun Nov  7 16:50:04 2021
+++ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/Makefile	Sat May  4 02:21:49 2024
@@ -1367,6 +1367,7 @@ dtb-$(CONFIG_ARCH_ZYNQ) += \
 	zynq-zc770-xm011.dtb \
 	zynq-zc770-xm012.dtb \
 	zynq-zc770-xm013.dtb \
+	zynq-red-pitaya-122-16.dtb \
 	zynq-zed.dtb \
 	zynq-zturn.dtb \
 	zynq-zturn-v5.dtb \

Added files:

Index: src/sys/arch/arm/dts/zynq-red-pitaya-122-16.dts
diff -u /dev/null src/sys/arch/arm/dts/zynq-red-pitaya-122-16.dts:1.1
--- /dev/null	Sat May  4 02:21:49 2024
+++ src/sys/arch/arm/dts/zynq-red-pitaya-122-16.dts	Sat May  4 02:21:48 2024
@@ -0,0 +1,91 @@
+// SPDX-License-Identifier: GPL-2.0+
+/dts-v1/;
+#include "../../../external/gpl2/dts/dist/arch/arm/boot/dts/zynq-7000.dtsi"
+
+/ {
+	model = "Red Pitaya SDRlab 122-16";
+	compatible = "xlnx,zynq-7000";
+
+	aliases {
+		ethernet0 = &gem0;
+		serial0 = &uart0;
+	};
+
+	memory@0 {
+		device_type = "memory";
+		reg = <0x0 0x20000000>;
+	};
+
+	/* The SDRlab 122-16 comes out of the box with a bootloader that
+	 * (I think) loads a bitstream to the FPGA.  I reserve the same
+	 * memory regions as the device tree that comes with the 122-16
+	 * does, just in case the FPGA alters them.  If we can come up
+	 * with a new bootloader, then I think NetBSD can use all of
+	 * these regions safely.
+	 */
+	reserved-memory {
+		#address-cells = <0x1>;
+		#size-cells = <0x1>;
+		ranges;
+
+		linux,cma {
+			compatible = "shared-dma-pool";
+			reusable;
+			size = <0x1000000>;
+			alignment = <0x2000>;
+			linux,cma-default;
+		};
+
+		labuf@a000000 {
+			reg = <0xa000000 0x2000000>;
+			linux,phandle = <0x2f>;
+			phandle = <0x2f>;
+		};
+
+		buffer@1000000 {
+			reg = <0x1000000 0x180000>;
+			linux,phandle = <0x30>;
+			phandle = <0x30>;
+		};
+	};
+
+	chosen {
+		bootargs = "";
+		stdout-path = "serial0:115200n8";
+	};
+
+	usb_phy0: phy0 {
+		#phy-cells = <0>;
+		compatible = "usb-nop-xceiv";
+		reset-gpios = <&gpio0 46 1>;
+	};
+};
+
+&clkc {
+	ps-clk-frequency = <33333333>;
+};
+
+&gem0 {
+	status = "okay";
+	phy-mode = "rgmii-id";
+	phy-handle = <&ethernet_phy>;
+
+	ethernet_phy: ethernet-phy@0 {
+		reg = <1>;
+		device_type = "ethernet-phy";
+	};
+};
+
+&sdhci0 {
+	status = "okay";
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&usb0 {
+	status = "okay";
+	dr_mode = "host";
+	usb-phy = <&usb_phy0>;
+};

Reply via email to