configs/bananapi_m1_plus_defconfig: new defconfig
authorFilip Skoneczny <fskoneczny@gmail.com>
Mon, 25 Jan 2021 17:44:03 +0000 (18:44 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Mon, 25 Jan 2021 21:02:36 +0000 (22:02 +0100)
This commit adds support for Sinovoip's Banana Pi
M1+. It is mostly based on bananapro_defconfig
but with appropriate device tree and minor tweaks:

- apply bananapi-m1-plus device tree in linux
- apply bananapi_m1_plus defconfig for uboot
- apply patch for OOB IRQs on new device tree
- update device tree name in boot.cmd, genimage.cfg
- update symlink for BRCM driver in rootfs_overlay
- overall clean-up of the config

Tested on BPI-M1+ V1_1.

Signed-off-by: Filip Skoneczny <fskoneczny@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
DEVELOPERS
board/sinovoip/m1-plus/boot.cmd [new file with mode: 0644]
board/sinovoip/m1-plus/genimage.cfg [new file with mode: 0644]
board/sinovoip/m1-plus/linux-wifi.fragment [new file with mode: 0644]
board/sinovoip/m1-plus/patches/linux/0001-ARM-dts-sun7i-bananapi-m1-plus-Disable-OOB-IRQ-for-b.patch [new file with mode: 0644]
board/sinovoip/m1-plus/post-build.sh [new file with mode: 0755]
board/sinovoip/m1-plus/readme.txt [new file with mode: 0644]
board/sinovoip/m1-plus/rootfs_overlay/lib/firmware/brcm/brcmfmac43362-sdio.sinovoip,bpi-m1-plus.txt [new symlink]
board/sinovoip/m1-plus/rootfs_overlay/lib/firmware/brcm/brcmfmac43362-sdio.txt [new file with mode: 0644]
configs/bananapi_m1_plus_defconfig [new file with mode: 0644]

index 7af3081760e172dfb98b2210cf419e580cb09b55..279c37c130e6781cc966b0a59522fe68de073422 100644 (file)
@@ -895,6 +895,10 @@ F: configs/freescale_imx6ullevk_defconfig
 N:     Falco Hyfing <hyfinglists@gmail.com>
 F:     package/python-pymodbus/
 
+N:     Filip Skoneczny <fskoneczny@gmail.com>
+F:     board/sinovoip/m1-plus
+F:     configs/bananapi_m1_plus_defconfig
+
 N:     Floris Bos <bos@je-eigen-domein.nl>
 F:     package/ipmitool/
 F:     package/odhcploc/
diff --git a/board/sinovoip/m1-plus/boot.cmd b/board/sinovoip/m1-plus/boot.cmd
new file mode 100644 (file)
index 0000000..4829996
--- /dev/null
@@ -0,0 +1,5 @@
+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 sun7i-a20-bananapi-m1-plus.dtb
+bootz $kernel_addr_r - $fdt_addr_r
diff --git a/board/sinovoip/m1-plus/genimage.cfg b/board/sinovoip/m1-plus/genimage.cfg
new file mode 100644 (file)
index 0000000..3cba774
--- /dev/null
@@ -0,0 +1,37 @@
+# Minimal SD card image for the Banana Pi M1+
+# Based on the Banana Pro genimage.cfg
+
+image boot.vfat {
+       vfat {
+               files = {
+                       "zImage",
+                       "sun7i-a20-bananapi-m1-plus.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
+       }
+}
diff --git a/board/sinovoip/m1-plus/linux-wifi.fragment b/board/sinovoip/m1-plus/linux-wifi.fragment
new file mode 100644 (file)
index 0000000..5576d73
--- /dev/null
@@ -0,0 +1,10 @@
+# Networking support
+CONFIG_WIRELESS=y
+CONFIG_CFG80211=y
+CONFIG_CFG80211_WEXT=y
+CONFIG_RFKILL=y
+
+# Network device support
+CONFIG_WLAN=y
+CONFIG_WLAN_VENDOR_BROADCOM=y
+CONFIG_BRCMFMAC=m
diff --git a/board/sinovoip/m1-plus/patches/linux/0001-ARM-dts-sun7i-bananapi-m1-plus-Disable-OOB-IRQ-for-b.patch b/board/sinovoip/m1-plus/patches/linux/0001-ARM-dts-sun7i-bananapi-m1-plus-Disable-OOB-IRQ-for-b.patch
new file mode 100644 (file)
index 0000000..b01b6b2
--- /dev/null
@@ -0,0 +1,39 @@
+From 58bae4096a7bf8d5d3bfbddb82cb37dd0561c938 Mon Sep 17 00:00:00 2001
+From: Filip Skoneczny <fskoneczny@gmail.com>
+Date: Sun, 10 Jan 2021 19:07:14 +0100
+Subject: [PATCH] ARM: dts: sun7i: bananapi-m1-plus: Disable OOB IRQ for brcm
+ wifi module
+
+    Based on 23bc805.
+    BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908438
+
+Signed-off-by: Filip Skoneczny <fskoneczny@gmail.com>
+---
+ arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts b/arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts
+index 32d5d45a35c0..97f9987f51d7 100644
+--- a/arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts
++++ b/arch/arm/boot/dts/sun7i-a20-bananapi-m1-plus.dts
+@@ -193,9 +193,14 @@ &mmc3 {
+       brcmf: wifi@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+-              interrupt-parent = <&pio>;
+-              interrupts = <7 15 IRQ_TYPE_LEVEL_LOW>;
+-              interrupt-names = "host-wake";
++              /*
++               * OOB interrupt support is broken ATM, drv probe failing with:
++               * ieee80211 phy0: brcmf_attach: dongle is not responding: err=-110
++               *
++               * interrupt-parent = <&pio>;
++               * interrupts = <7 15 IRQ_TYPE_LEVEL_LOW>;
++               * interrupt-names = "host-wake";
++               */
+       };
+ };
+-- 
+2.25.1
+
diff --git a/board/sinovoip/m1-plus/post-build.sh b/board/sinovoip/m1-plus/post-build.sh
new file mode 100755 (executable)
index 0000000..4ee6fa3
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Remove all but the brcmfmac43362 firmware files
+find $TARGET_DIR/lib/firmware/brcm -type f -not -name "brcmfmac43362*" -delete
diff --git a/board/sinovoip/m1-plus/readme.txt b/board/sinovoip/m1-plus/readme.txt
new file mode 100644 (file)
index 0000000..ae647c2
--- /dev/null
@@ -0,0 +1,64 @@
+Banana Pi M1+
+
+Intro
+=====
+
+This default configuration will allow you to start experimenting with the
+Buildroot environment for the Banana Pi M1+. With the current configuration
+it will bring-up the board, and allow access through the serial console.
+
+How to build it
+===============
+
+Configure Buildroot:
+
+  $ make bananapi_m1_plus_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":
+
+  $ dd if=output/images/sdcard.img of=/dev/sdX
+
+Notes:
+  - replace 'sdX' with the actual device with your micro SD card
+  - you may need to be root to do that (use 'sudo')
+
+Insert the micro SD card in your Banana Pi M1+ and power it up. The console
+is on the debug TTL UART, 115200 8N1.
+
+Ethernet
+==========
+
+  # udhcpc -i eth0
+
+Wifi
+==========
+
+  # wpa_passphrase YOUR_SSID >> /etc/wpa_supplicant.conf
+  (enter the wifi password and press enter)
+  # wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B
+  # udhcpc -i wlan0
+
+Note:
+  - replace 'YOUR_SSID' with the actual SSID from your access point
+
+Audio
+==========
+
+For this example you need package alsa-utils.
+
+Connect a headphone to the 3.5mm jack (TRRS). Note, that the Banana Pi M1+
+has an on-board microphone, too.
+
+  # amixer cset name='Power Amplifier DAC Playback Switch' on
+  # amixer cset name='Power Amplifier Mute Switch' on
+  # amixer cset name='Power Amplifier Volume' 42
diff --git a/board/sinovoip/m1-plus/rootfs_overlay/lib/firmware/brcm/brcmfmac43362-sdio.sinovoip,bpi-m1-plus.txt b/board/sinovoip/m1-plus/rootfs_overlay/lib/firmware/brcm/brcmfmac43362-sdio.sinovoip,bpi-m1-plus.txt
new file mode 120000 (symlink)
index 0000000..9394797
--- /dev/null
@@ -0,0 +1 @@
+brcmfmac43362-sdio.txt
\ No newline at end of file
diff --git a/board/sinovoip/m1-plus/rootfs_overlay/lib/firmware/brcm/brcmfmac43362-sdio.txt b/board/sinovoip/m1-plus/rootfs_overlay/lib/firmware/brcm/brcmfmac43362-sdio.txt
new file mode 100644 (file)
index 0000000..14a554f
--- /dev/null
@@ -0,0 +1,56 @@
+#AP6210_NVRAM_V1.2_03192013
+manfid=0x2d0
+prodid=0x492
+vendid=0x14e4
+devid=0x4343
+boardtype=0x0598
+
+# Board Revision is P307, same nvram file can be used for P304, P305, P306 and P307 as the tssi pa params used are same
+#Please force the automatic RX PER data to the respective board directory if not using P307 board, for e.g. for P305 boards force the data into the following directory /projects/BCM43362/a1_labdata/boardtests/results/sdg_rev0305
+boardrev=0x1307
+boardnum=777
+xtalfreq=26000
+boardflags=0x80201
+boardflags2=0x80
+sromrev=3
+wl0id=0x431b
+macaddr=00:90:4c:07:71:12
+aa2g=1
+ag0=2
+maxp2ga0=74
+cck2gpo=0x2222
+ofdm2gpo=0x44444444
+mcs2gpo0=0x6666
+mcs2gpo1=0x6666
+pa0maxpwr=56
+
+#P207 PA params
+#pa0b0=5447
+#pa0b1=-658
+#pa0b2=-175
+
+#Same PA params for P304,P305, P306, P307
+
+pa0b0=5447
+pa0b1=-607
+pa0b2=-160
+pa0itssit=62
+pa1itssit=62
+
+
+cckPwrOffset=5
+ccode=0
+rssismf2g=0xa
+rssismc2g=0x3
+rssisav2g=0x7
+triso2g=0
+noise_cal_enable_2g=0
+noise_cal_po_2g=0
+swctrlmap_2g=0x04040404,0x02020202,0x02020202,0x010101,0x1ff
+temp_add=29767
+temp_mult=425
+
+btc_flags=0x6
+btc_params0=5000
+btc_params1=1000
+btc_params6=63
diff --git a/configs/bananapi_m1_plus_defconfig b/configs/bananapi_m1_plus_defconfig
new file mode 100644 (file)
index 0000000..8f278f9
--- /dev/null
@@ -0,0 +1,44 @@
+BR2_arm=y
+BR2_cortex_a7=y
+BR2_ARM_FPU_NEON_VFPV4=y
+BR2_GLOBAL_PATCH_DIR="board/sinovoip/m1-plus/patches"
+BR2_TARGET_GENERIC_HOSTNAME="bananapi"
+BR2_TARGET_GENERIC_ISSUE="Welcome to Banana Pi!"
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
+BR2_ROOTFS_OVERLAY="board/sinovoip/m1-plus/rootfs_overlay"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/sinovoip/m1-plus/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/sinovoip/m1-plus/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.3"
+BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/sinovoip/m1-plus/linux-wifi.fragment"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun7i-a20-bananapi-m1-plus"
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_PACKAGE_LINUX_FIRMWARE=y
+BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM43XXX=y
+BR2_PACKAGE_IW=y
+BR2_PACKAGE_WPA_SUPPLICANT=y
+BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
+BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2019.10"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="bananapi_m1_plus"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="board/sinovoip/m1-plus/boot.cmd"