Skip to contentSkip to conversation

orangepi: add basic support for orangepi-zero board

PATCH New Sergey Matyukevich 1 participant 2 messages May 20, 2017 – May 24, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 orangepi: add basic support for orangepi-zero board

Board support package includes the following components:

- mainline kernel v4.11
- mainline u-boot v2017.03
- extra kernel config options and dts patches to enable SPI NOR and spidev

More details about this board are available here:
- http://linux-sunxi.org/Orange_Pi_Zero

Note that at the moment networking is not supported right out of the box. Ethernet submission to mainline kernel is a work in progress, see the latest dwmac-sun8i branches at https://github.com/montjoie/linux

On-board SDIO WiFi chip XR819 is supported by off-the-tree wireless driver available at https://github.com/fifteenhex/xradio

---
 board/orangepi/orangepi-zero/boot.cmd              |  8 +++++
 board/orangepi/orangepi-zero/genimage.cfg          | 36 +++++++++++++++++++
 board/orangepi/orangepi-zero/linux-extras.config   | 17 +++++++++
 ...orange-pi-zero-interrupt-triggering-xr819.patch | 32 +++++++++++++++++
 ...002-ARM-dts-orange-pi-zero-enable-spi-nor.patch | 42 ++++++++++++++++++++++
 ...0003-ARM-dts-orange-pi-zero-enable-spidev.patch | 42 ++++++++++++++++++++++
 board/orangepi/orangepi-zero/post-build.sh         |  1 +
 board/orangepi/orangepi-zero/post-image.sh         |  1 +
 board/orangepi/orangepi-zero/readme.txt            | 29 +++++++++++++++
 configs/orangepi_zero_defconfig                    | 42 ++++++++++++++++++++++
 10 files changed, 250 insertions(+)
 create mode 100644 board/orangepi/orangepi-zero/boot.cmd
 create mode 100644 board/orangepi/orangepi-zero/genimage.cfg
 create mode 100644 board/orangepi/orangepi-zero/linux-extras.config
 create mode 100644 board/orangepi/orangepi-zero/patches/linux/0001-ARM-dts-orange-pi-zero-interrupt-triggering-xr819.patch
 create mode 100644 board/orangepi/orangepi-zero/patches/linux/0002-ARM-dts-orange-pi-zero-enable-spi-nor.patch
 create mode 100644 board/orangepi/orangepi-zero/patches/linux/0003-ARM-dts-orange-pi-zero-enable-spidev.patch
 create mode 120000 board/orangepi/orangepi-zero/post-build.sh
 create mode 120000 board/orangepi/orangepi-zero/post-image.sh
 create mode 100644 board/orangepi/orangepi-zero/readme.txt
 create mode 100644 configs/orangepi_zero_defconfig
board/orangepi/orangepi-zero/boot.cmd new file +8 -0
new file mode 100644
index 000000000..44f0885ff
@@ -0,0 +1,8 @@
+setenv fdt_high ffffffff
+
+setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
+
+fatload mmc 0 $kernel_addr_r zImage
+fatload mmc 0 $fdt_addr_r sun8i-h2-plus-orangepi-zero.dtb
+
+bootz $kernel_addr_r - $fdt_addr_r
board/orangepi/orangepi-zero/genimage.cfg new file +36 -0
new file mode 100644
index 000000000..bc8601cbb
@@ -0,0 +1,36 @@
+# Minimal SD card image for the OrangePi PC
+#
+image boot.vfat {
+	vfat {
+		files = {
+			"zImage",
+			"sun8i-h2-plus-orangepi-zero.dtb",
+			"boot.scr"
+		}
+	}
+	size = 10M
+}
+
+image sdcard.img {
+	hdimage {
+	}
+
+	partition u-boot {
+		in-partition-table = "no"
+		image = "u-boot-sunxi-with-spl.bin"
+		offset = 8192
+		size = 1040384 # 1MB - 8192
+	}
+
+	partition boot {
+		partition-type = 0xC
+		bootable = "true"
+		image = "boot.vfat"
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+		size = 512M
+	}
+}
board/orangepi/orangepi-zero/linux-extras.config new file +17 -0
new file mode 100644
index 000000000..fe00af5ef
@@ -0,0 +1,17 @@
+# spidev
+CONFIG_SPI_SPIDEV=y
+
+# spi nor
+CONFIG_MTD=y
+CONFIG_MTD_OF_PARTS=y
+CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_M25P80=y
+
+# wireless core
+CONFIG_WIRELESS=y
+CONFIG_CFG80211=y
+CONFIG_MAC80211=y
+CONFIG_CFG80211_WEXT=y
+
+# wireless drivers
+CONFIG_WLAN=y
board/orangepi/orangepi-zero/patches/linux/0001-ARM-dts-orange-pi-zero-interrupt-triggering-xr819.patch new file +32 -0
new file mode 100644
index 000000000..0101e137e
@@ -0,0 +1,32 @@
+From d06068f474e029bbde7348108c509cc63d6aa196 Mon Sep 17 00:00:00 2001
+From: Sergey Matyukevich <[email protected]>
+Date: Fri, 19 May 2017 23:39:48 +0300
+Subject: [PATCH 1/2] ARM: dts: orange-pi-zero: interrupt triggering for XR819
+ WiFi chip
+
+Specify interrupt triggering for XR819 SDIO WiFi chip
+on orange-pi-zero board.
+
+For more details see: http://linux-sunxi.org/Wifi#Allwinner
+
+Signed-off-by: Sergey Matyukevich <[email protected]>
+---
+ arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
+index b7ca916d871d..6510d22deed3 100644
+--- a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
++++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
+@@ -125,6 +125,8 @@
+ 	 */
+ 	xr819: sdio_wifi at 1 {
+ 		reg = <1>;
++		interrupt-parent = <&pio>;
++		interrupts = <6 10 IRQ_TYPE_EDGE_RISING>;
+ 	};
+ };
+ 
+-- 
+2.11.0
+
board/orangepi/orangepi-zero/patches/linux/0002-ARM-dts-orange-pi-zero-enable-spi-nor.patch new file +42 -0

42 lines not on this page · raw message

board/orangepi/orangepi-zero/patches/linux/0003-ARM-dts-orange-pi-zero-enable-spidev.patch new file +42 -0

42 lines not on this page · raw message

board/orangepi/orangepi-zero/post-build.sh new file +1 -0
new file mode 120000
index 000000000..cd7f11645
@@ -0,0 +1 @@
+../post-build.sh
\ No newline at end of file
board/orangepi/orangepi-zero/post-image.sh new file +1 -0
new file mode 120000
index 000000000..ae6294fa3
@@ -0,0 +1 @@
+../post-image.sh
\ No newline at end of file
board/orangepi/orangepi-zero/readme.txt new file +29 -0
new file mode 100644
index 000000000..1afdbb784
@@ -0,0 +1,29 @@
+OrangePi Zero
+
+Intro
+=====
+
+This default configuration will allow you to start experimenting with the
+buildroot environment for the OrangePi Zero. With the current configuration
+it will bring-up the board, and allow access through the serial console.
+
+How to build it
+===============
+
+Configure Buildroot:
+
+    $ make orangepi_zero_defconfig
+
+Compile everything and build the SD card image:
+
+    $ make
+
+How to write the SD card
+========================
+
+Once the build process is finished you will have an image called "sdcard.img"
+in the output/images/ directory.
+
+Copy the bootable "sdcard.img" onto an SD card with "dd":
+
+  $ sudo dd if=output/images/sdcard.img of=/dev/sdX
configs/orangepi_zero_defconfig new file +42 -0

42 lines not on this page · raw message

Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 orangepi: add basic support for orangepi-zero board

Quoted 5 lines · Sergey Matyukevich

Board support package includes the following components:

- mainline kernel v4.11
- mainline u-boot v2017.03
- extra kernel config options and dts patches to enable SPI NOR and spidev

Please ignore this patch. It looks like I've messed up with subject tags. I will resend using proper buildroot mailing list conventions.

Regards,
Sergey