summaryrefslogtreecommitdiff
path: root/board/orangepi
diff options
context:
space:
mode:
Diffstat (limited to 'board/orangepi')
-rw-r--r--board/orangepi/common/extlinux.conf4
-rw-r--r--board/orangepi/common/genimage.cfg20
-rwxr-xr-xboard/orangepi/common/post-build.sh36
-rw-r--r--board/orangepi/orangepi-zero/linux-extras.fragment20
-rw-r--r--board/orangepi/orangepi-zero/patches/linux/0001-ARM-dts-orange-pi-zero-interrupt-triggering-xr819.patch35
-rw-r--r--board/orangepi/orangepi-zero/patches/linux/0002-ARM-dts-orange-pi-zero-enable-spi-nor.patch42
-rw-r--r--board/orangepi/orangepi-zero/patches/linux/0003-ARM-dts-orange-pi-zero-enable-spidev.patch42
-rw-r--r--board/orangepi/orangepi-zero/patches/linux/0004-ARM-dts-orange-pi-zero-enable-uart.patch35
-rw-r--r--board/orangepi/orangepi-zero/readme.txt29
9 files changed, 263 insertions, 0 deletions
diff --git a/board/orangepi/common/extlinux.conf b/board/orangepi/common/extlinux.conf
new file mode 100644
index 0000000..12f496b
--- /dev/null
+++ b/board/orangepi/common/extlinux.conf
@@ -0,0 +1,4 @@
+LABEL default
+ kernel /boot/%LINUXIMAGE%
+ devicetreedir /boot
+ append root=PARTUUID=%PARTUUID% rootwait console=${console} rootfstype=ext4 quiet panic=10
diff --git a/board/orangepi/common/genimage.cfg b/board/orangepi/common/genimage.cfg
new file mode 100644
index 0000000..c748108
--- /dev/null
+++ b/board/orangepi/common/genimage.cfg
@@ -0,0 +1,20 @@
+image sdcard.img {
+ partition u-boot {
+ in-partition-table = false
+ image = "u-boot-sunxi-with-spl.bin"
+ offset = 8K
+ size = 1000K # 1MB - 8KB(offset) - 16KB(GPT)
+ }
+
+ hdimage {
+ partition-table-type = "gpt"
+ gpt-location = 1008K # 1MB - 16KB(GPT)
+ gpt-no-backup = true
+ }
+
+ partition rootfs {
+ offset = 1M
+ image = "rootfs.ext4"
+ partition-uuid = %PARTUUID%
+ }
+}
diff --git a/board/orangepi/common/post-build.sh b/board/orangepi/common/post-build.sh
new file mode 100755
index 0000000..bc5d630
--- /dev/null
+++ b/board/orangepi/common/post-build.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+. ${BR2_EXTERNAL_BASTION_PATH}/board/common/post-build.sh
+
+linux_image()
+{
+ if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then
+ echo "uImage"
+ elif grep -Eq "^BR2_LINUX_KERNEL_IMAGE=y$" ${BR2_CONFIG}; then
+ echo "Image"
+ elif grep -Eq "^BR2_LINUX_KERNEL_IMAGEGZ=y$" ${BR2_CONFIG}; then
+ echo "Image.gz"
+ else
+ echo "zImage"
+ fi
+}
+
+generic_getty()
+{
+ if grep -Eq "^BR2_TARGET_GENERIC_GETTY=y$" ${BR2_CONFIG}; then
+ echo ""
+ else
+ echo "s/\s*console=\S*//"
+ fi
+}
+
+PARTUUID="$($HOST_DIR/bin/uuidgen)"
+
+install -d "$TARGET_DIR/boot/extlinux/"
+
+sed -e "$(generic_getty)" \
+ -e "s/%LINUXIMAGE%/$(linux_image)/g" \
+ -e "s/%PARTUUID%/$PARTUUID/g" \
+ "board/orangepi/common/extlinux.conf" > "$TARGET_DIR/boot/extlinux/extlinux.conf"
+
+sed "s/%PARTUUID%/$PARTUUID/g" "board/orangepi/common/genimage.cfg" > "$BINARIES_DIR/genimage.cfg"
diff --git a/board/orangepi/orangepi-zero/linux-extras.fragment b/board/orangepi/orangepi-zero/linux-extras.fragment
new file mode 100644
index 0000000..2db241d
--- /dev/null
+++ b/board/orangepi/orangepi-zero/linux-extras.fragment
@@ -0,0 +1,20 @@
+# 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
+
+# ondemand cpufreq governor
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
diff --git a/board/orangepi/orangepi-zero/patches/linux/0001-ARM-dts-orange-pi-zero-interrupt-triggering-xr819.patch b/board/orangepi/orangepi-zero/patches/linux/0001-ARM-dts-orange-pi-zero-interrupt-triggering-xr819.patch
new file mode 100644
index 0000000..16207af
--- /dev/null
+++ b/board/orangepi/orangepi-zero/patches/linux/0001-ARM-dts-orange-pi-zero-interrupt-triggering-xr819.patch
@@ -0,0 +1,35 @@
+From 321faaf4b78d46a0c77782c1798856746f0619e9 Mon Sep 17 00:00:00 2001
+From: Sergey Matyukevich <geomatsi@gmail.com>
+Date: Fri, 19 May 2017 23:39:48 +0300
+Subject: [PATCH] ARM: dts: orange-pi-zero: specify XR819 WiFi chip
+ interrupts
+
+The orange-pi-zero board has Allwinner XR819 SDIO wifi chip. The board
+dts file provides a node enabling mmc1 controller. Together with an
+out-of-tree driver https://github.com/fifteenhex/xradio this node
+enables using the wifi chip.
+
+This commit specifies XR819 interrupt configuration for the driver.
+
+Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
+---
+ arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 3 +++
+ 1 file changed, 3 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..4e1a9050c6b4 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,9 @@
+ */
+ xr819: sdio_wifi@1 {
+ reg = <1>;
++ compatible = "xradio,xr819";
++ interrupt-parent = <&pio>;
++ interrupts = <6 10 IRQ_TYPE_EDGE_RISING>;
+ };
+ };
+
+--
+2.11.0
+
diff --git a/board/orangepi/orangepi-zero/patches/linux/0002-ARM-dts-orange-pi-zero-enable-spi-nor.patch b/board/orangepi/orangepi-zero/patches/linux/0002-ARM-dts-orange-pi-zero-enable-spi-nor.patch
new file mode 100644
index 0000000..e4c52ab
--- /dev/null
+++ b/board/orangepi/orangepi-zero/patches/linux/0002-ARM-dts-orange-pi-zero-enable-spi-nor.patch
@@ -0,0 +1,42 @@
+From 068c3baff3048a3db4ef2518ff917ce749cd8169 Mon Sep 17 00:00:00 2001
+From: Sergey Matyukevich <geomatsi@gmail.com>
+Date: Sat, 20 May 2017 11:24:26 +0300
+Subject: [PATCH] ARM: dts: orange-pi-zero: enable SPI NOR
+
+Enable SPI NOR on orange-pi-zero board.
+
+For more information see:
+- http://linux-sunxi.org/Orange_Pi_Zero#SPI_NOR_flash
+
+Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
+---
+ arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 16 ++++++++++++++++
+ 1 file changed, 16 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 4e1a9050c6b4..cdf19821b1f3 100644
+--- a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
++++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
+@@ -161,3 +161,19 @@
+ /* USB VBUS is always on */
+ status = "okay";
+ };
++
++&spi0 {
++ status = "okay";
++
++ flash@0 {
++ #address-cells = <1>;
++ #size-cells = <1>;
++ compatible = "mxicy,mx25l1606e", "winbond,w25q128";
++ reg = <0>;
++ spi-max-frequency = <40000000>;
++
++ partition@00000000 {
++ reg = <0x00000000 0x200000>; /* 2Mb */
++ };
++ };
++};
+--
+2.11.0
+
diff --git a/board/orangepi/orangepi-zero/patches/linux/0003-ARM-dts-orange-pi-zero-enable-spidev.patch b/board/orangepi/orangepi-zero/patches/linux/0003-ARM-dts-orange-pi-zero-enable-spidev.patch
new file mode 100644
index 0000000..ae0ed9b
--- /dev/null
+++ b/board/orangepi/orangepi-zero/patches/linux/0003-ARM-dts-orange-pi-zero-enable-spidev.patch
@@ -0,0 +1,42 @@
+From 8dd1b2a696bb7e9914abd11cc6f5c0f54c33d626 Mon Sep 17 00:00:00 2001
+From: Sergey Matyukevich <geomatsi@gmail.com>
+Date: Sat, 20 May 2017 15:36:51 +0300
+Subject: [PATCH] ARM: dts: orange-pi-zero: enable spidev
+
+On orange-pi-zero board SPI1 pins are accessible via GPIO expansion port.
+This patch enables spidev driver for SPI1.
+
+Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
+---
+ arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 11 +++++++++++
+ 1 file changed, 11 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 cdf19821b1f3..7242aaecb14f 100644
+--- a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
++++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
+@@ -59,6 +59,7 @@
+ serial0 = &uart0;
+ /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
+ ethernet1 = &xr819;
++ spi1 = &spi1;
+ };
+
+ chosen {
+@@ -177,3 +178,13 @@
+ };
+ };
+ };
++
++&spi1 {
++ status = "okay";
++
++ spidev@0 {
++ compatible = "rohm,dh2228fv";
++ reg = <0>;
++ spi-max-frequency = <10000000>;
++ };
++};
+--
+2.11.0
+
diff --git a/board/orangepi/orangepi-zero/patches/linux/0004-ARM-dts-orange-pi-zero-enable-uart.patch b/board/orangepi/orangepi-zero/patches/linux/0004-ARM-dts-orange-pi-zero-enable-uart.patch
new file mode 100644
index 0000000..839bc16
--- /dev/null
+++ b/board/orangepi/orangepi-zero/patches/linux/0004-ARM-dts-orange-pi-zero-enable-uart.patch
@@ -0,0 +1,35 @@
+From e8768cc1f0f1231cbd4864417de629330e21222d Mon Sep 17 00:00:00 2001
+From: Sergey Kuzminov <kuzminov.sergey81@gmail.com>
+Date: Sun, 21 Nov 2021 00:58:32 +0300
+Subject: [PATCH] ARM: dts: orange-pi-zero: enable uart
+
+Enable uart1 and uart2 on orange-pi-zero board.
+
+Signed-off-by: Sergey Kuzminov <kuzminov.sergey81@gmail.com>
+---
+ arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+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 f19ed981da9d..03acf166ab70 100644
+--- a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
++++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
+@@ -184,13 +184,13 @@ &uart0 {
+ &uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins>;
+- status = "disabled";
++ status = "okay";
+ };
+
+ &uart2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart2_pins>;
+- status = "disabled";
++ status = "okay";
+ };
+
+ &usb_otg {
+--
+2.32.0
+
diff --git a/board/orangepi/orangepi-zero/readme.txt b/board/orangepi/orangepi-zero/readme.txt
new file mode 100644
index 0000000..1afdbb7
--- /dev/null
+++ b/board/orangepi/orangepi-zero/readme.txt
@@ -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