From patchwork Sat May 8 20:16:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Vincent_Stehl=C3=A9?= X-Patchwork-Id: 1475913 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=laposte.net header.i=@laposte.net header.a=rsa-sha256 header.s=lpn-wlmd header.b=W2pu/Uet; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fcz9b4WnGz9vDV for ; Sun, 9 May 2021 06:16:35 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id B67E6606F2; Sat, 8 May 2021 20:16:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MjIo2-bhPmhU; Sat, 8 May 2021 20:16:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id EC19C606E0; Sat, 8 May 2021 20:16:31 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 34E5D1BF42C for ; Sat, 8 May 2021 20:16:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 23AF5606E0 for ; Sat, 8 May 2021 20:16:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IE7W1YlNBRJE for ; Sat, 8 May 2021 20:16:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from smtp-outgoing-2003.laposte.net (smtp-outgoing-2003.laposte.net [160.92.124.110]) by smtp3.osuosl.org (Postfix) with ESMTPS id 3A5826064D for ; Sat, 8 May 2021 20:16:27 +0000 (UTC) X-mail-filterd: {"version":"1.2.2", "queueID":"4Fcz9K6V16z10MQQ", "contextId":"f4e4b9fa-3553-40db-bc73-4474c9403e5a"} Received: from outgoing-mail.laposte.net (localhost.localdomain [127.0.0.1]) by mlpnf0103.laposte.net (SMTP Server) with ESMTP id 4Fcz9K6V16z10MQQ; Sat, 8 May 2021 22:16:21 +0200 (CEST) X-mail-filterd: {"version":"1.2.2", "queueID":"4Fcz9K5Vjbz10MQM", "contextId":"8934e92f-b77e-4be8-88bf-0558bf0736b8"} X-lpn-mailing: LEGIT X-lpn-spamrating: 40 X-lpn-spamlevel: not-spam X-lpn-spamcause: OK, (0)(0000)gggruggvucftvghtrhhoucdtuddrgeduledrvdeggedgudehudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfntefrqffuvffgpdfqfgfvpdggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffogggtgfesthekredtredtjeenucfhrhhomhepgghinhgtvghnthcuufhtvghhlhoruceovhhinhgtvghnthdrshhtvghhlhgvsehlrghpohhsthgvrdhnvghtqeenucggtffrrghtthgvrhhnpeetveduueegleehhfejveegfeekjeffvddujeeujeegffdujefgffehjeeliefhhfenucffohhmrghinhepsghuihhlughrohhothdrohhrghenucfkphepkeekrdduvddurddugeelrdegleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopehrohhmuhgrlhgurdgsvghrghgvrhhivgdpihhnvghtpeekkedruddvuddrudegledrgeelpdhmrghilhhfrhhomhepvhhinhgtvghnthdrshhtvghhlhgvsehlrghpohhsthgvrdhnvghtpdhrtghpthhtohepsghuihhlughrohhothessghuihhlughrohhothdrohhrghdprhgtphhtthhopehvihhntggvnhhtrdhsthgvhhhlvgeslhgrphhoshhtvgdrnhgvth Received: from romuald.bergerie (unknown [88.121.149.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mlpnf0103.laposte.net (SMTP Server) with ESMTPSA id 4Fcz9K5Vjbz10MQM; Sat, 8 May 2021 22:16:21 +0200 (CEST) Received: from radicelle.bergerie (radicelle.bergerie [192.168.124.12]) by romuald.bergerie (Postfix) with ESMTP id 6C6D441100AD; Sat, 8 May 2021 22:16:21 +0200 (CEST) Received: from vincent by radicelle.bergerie with local (Exim 4.94) (envelope-from ) id 1lfTN6-0004G3-44; Sat, 08 May 2021 22:16:20 +0200 To: buildroot@buildroot.org Date: Sat, 8 May 2021 22:16:14 +0200 Message-Id: <20210508201614.16041-1-vincent.stehle@laposte.net> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=laposte.net; s=lpn-wlmd; t=1620504985; bh=UAAimmqFlYl9wGv27Uyw+4yWJQsyfCRQQ8WxAhVTJAs=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type:Content-Transfer-Encoding; b=W2pu/UetNNkIPhMITzngbN/6k8jy3aLlBkwmNu1wYfUIjB0OrIXGNx87AKpjLCrZ3RB4DjO9BGpol4y+stWk6b/C3XpL35Jj0tW46j/3sidJ05Nfm6yct2vcdELb6kVEH+YgG3hG69kWIFrFjqFCew4BR+QSvI111L2X+b3Bh4MdVgXfXasnj7kJhWPY0NJfOHZpjZcGt4GvPq1WuGGiF6eAOIN1bP1xhSLEky+9fSE+fTyZSIuIVgVPmBh6+KOmxJxMN3D3El39YJI3pWxUQq505xbtzHShVl3lCDFfAGdN4n4+/mz/5/GVg5aY94o64yWHhZ9yheHbBxxCy4MWnA==; Subject: [Buildroot] [PATCH] configs/bananapi_m2_zero: bump versions and add WiFi support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: =?utf-8?q?Vincent_Stehl=C3=A9_via_buildroot?= Reply-To: =?utf-8?q?Vincent_Stehl=C3=A9?= Cc: =?utf-8?q?Vincent_Stehl=C3=A9?= Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" - Bump kernel to version 5.12.2. - Bump U-Boot to version 2021.04. Also, adapt the SD card name in the boot script to follow Linux naming. While at it, add comments to make the defconfig more readable. The Banana Pi M2 Zero comprises an AMPAK AP6212 module with a Broadcom bcm43438/a1 WiFi chip. Add the necessary firmware and tools to support it and update documentation. We switch to mdev for /dev management, so that the WiFi driver get auto-loaded. Signed-off-by: Vincent Stehlé --- board/bananapi/bananapi-m2-zero/boot.cmd | 2 +- .../bananapi-m2-zero/firmware-links.sh | 9 ++++++ .../bananapi-m2-zero/linux-extras.config | 9 ++++++ board/bananapi/bananapi-m2-zero/readme.txt | 14 +++++++++ configs/bananapi_m2_zero_defconfig | 30 +++++++++++++++++-- 5 files changed, 60 insertions(+), 4 deletions(-) create mode 100755 board/bananapi/bananapi-m2-zero/firmware-links.sh create mode 100644 board/bananapi/bananapi-m2-zero/linux-extras.config diff --git a/board/bananapi/bananapi-m2-zero/boot.cmd b/board/bananapi/bananapi-m2-zero/boot.cmd index 081450935b..70ccdf7045 100644 --- a/board/bananapi/bananapi-m2-zero/boot.cmd +++ b/board/bananapi/bananapi-m2-zero/boot.cmd @@ -1,4 +1,4 @@ -setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait +setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk1p2 rootwait mmc dev 0 fatload mmc 0 $kernel_addr_r zImage diff --git a/board/bananapi/bananapi-m2-zero/firmware-links.sh b/board/bananapi/bananapi-m2-zero/firmware-links.sh new file mode 100755 index 0000000000..7f320fb1a5 --- /dev/null +++ b/board/bananapi/bananapi-m2-zero/firmware-links.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# Create the necessary WiFi firmware symbolic links for the brcmfmac driver +set -eu + +cd "$1/lib/firmware" +[ -d brcm ] || mkdir -v brcm +cd brcm +ln -svf ../ap6212/nvram.txt brcmfmac43430-sdio.sinovoip,bpi-m2-zero.txt +ln -svf ../ap6212/fw_bcm43438a1_apsta.bin brcmfmac43430-sdio.bin diff --git a/board/bananapi/bananapi-m2-zero/linux-extras.config b/board/bananapi/bananapi-m2-zero/linux-extras.config new file mode 100644 index 0000000000..b9d3b143c8 --- /dev/null +++ b/board/bananapi/bananapi-m2-zero/linux-extras.config @@ -0,0 +1,9 @@ +# wireless core +CONFIG_WIRELESS=y +CONFIG_CFG80211=m +CONFIG_CFG80211_WEXT=y + +# wireless drivers +CONFIG_WLAN=y +CONFIG_WLAN_VENDOR_BROADCOM=y +CONFIG_BRCMFMAC=m diff --git a/board/bananapi/bananapi-m2-zero/readme.txt b/board/bananapi/bananapi-m2-zero/readme.txt index 9edd477f11..a48c514c14 100644 --- a/board/bananapi/bananapi-m2-zero/readme.txt +++ b/board/bananapi/bananapi-m2-zero/readme.txt @@ -32,3 +32,17 @@ Copy the bootable "sdcard.img" onto an SD card with "dd": Insert the micro SDcard in your Bananapi M2 Zero and power it up. The console is on the Debug UART on the CON3 header, with serial settings 115200 8N1. + +Using Wifi +========== + + # iwconfig wlan0 essid ACCESSPOINTNAME + # wpa_passphrase ACCESSPOINTNAME > /etc/wpa.conf + +(enter the wifi password and press enter) + + # wpa_supplicant -i wlan0 -c /etc/wpa.conf & + # udhcpc -i wlan0 + # ping buildroot.org + +Enjoy! diff --git a/configs/bananapi_m2_zero_defconfig b/configs/bananapi_m2_zero_defconfig index e5c89fce40..9e6760d196 100644 --- a/configs/bananapi_m2_zero_defconfig +++ b/configs/bananapi_m2_zero_defconfig @@ -1,23 +1,45 @@ +# Architecture BR2_arm=y BR2_cortex_a7=y BR2_ARM_FPU_NEON_VFPV4=y -BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_9=y + +# Linux headers same as kernel, a 5.12 series +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_12=y + +# System BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the Bananapi M2 Zero" +BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y +BR2_ROOTFS_POST_BUILD_SCRIPT="board/bananapi/bananapi-m2-zero/firmware-links.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/bananapi/bananapi-m2-zero/genimage.cfg" + +# Kernel BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y -BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.9.11" +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.12.2" BR2_LINUX_KERNEL_DEFCONFIG="sunxi" +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/bananapi/bananapi-m2-zero/linux-extras.config" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-h2-plus-bananapi-m2-zero" +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y + +# WiFi +BR2_PACKAGE_ARMBIAN_FIRMWARE=y +BR2_PACKAGE_ARMBIAN_FIRMWARE_AP6212=y +BR2_PACKAGE_WIRELESS_TOOLS=y +BR2_PACKAGE_WPA_SUPPLICANT=y +BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y + +# Filesystem BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y # BR2_TARGET_ROOTFS_TAR is not set + +# Bootloader BR2_TARGET_UBOOT=y BR2_TARGET_UBOOT_BOARDNAME="bananapi_m2_zero" BR2_TARGET_UBOOT_CUSTOM_VERSION=y -BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.10" +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2021.04" BR2_TARGET_UBOOT_NEEDS_DTC=y BR2_TARGET_UBOOT_NEEDS_PYTHON3=y BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y @@ -26,6 +48,8 @@ BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin" BR2_PACKAGE_HOST_UBOOT_TOOLS=y BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="board/bananapi/bananapi-m2-zero/boot.cmd" + +# Required tools to create the SD image BR2_PACKAGE_HOST_DOSFSTOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y