From patchwork Sat Nov 20 03:41:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stijn Tintel X-Patchwork-Id: 1557511 X-Patchwork-Delegate: stijn@linux-ipv6.be Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Ubx83ZVA; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linux-ipv6.be header.i=@linux-ipv6.be header.a=rsa-sha256 header.s=502B7754-045F-11E5-BBC5-64595FD46BE8 header.b=jlQet0+b; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HwzwX6qlWz9sRR for ; Sat, 20 Nov 2021 14:46:20 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JQtXFVpY/pJbEy4xbzgMHQMX+erz/59MnaIBjgIsFXY=; b=Ubx83ZVA/4d14i i5D5ZilCOd9m0fO7h5nmVcuBJ7e8FySlxt72JQdqQ2OxtcNG9l5fC8n93uEtsSulaR0jG3PzAWRZp wB01/3tfsIr5NsvaMp1ThV90sKs6d0MFDRgERc347e9cS0ovFtC83Uq9N/yAsRbG154qhYCez+JbO DsAMmCxmWvoUhjAuDH/ZzOATY4wMZ19wZ/o10sQ6QG/ydBkizfxWP2SAOLHgREWj0EtsdE0WwniFs av6K01wJNb32KCrAqVnTGcaUBIv0ZBxVP1JtCBmsJTsOadAt6n0mwdvX79F5i96FC/200u6v4q/Rb YdHajIc1rYhW/VsExc7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1moHHg-00BxCd-PL; Sat, 20 Nov 2021 03:43:24 +0000 Received: from mail.tintel.eu ([51.83.127.189]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1moHGW-00Bx0h-0e for openwrt-devel@lists.openwrt.org; Sat, 20 Nov 2021 03:42:14 +0000 Received: from localhost (localhost [IPv6:::1]) by mail.tintel.eu (Postfix) with ESMTP id C1B89447C108; Sat, 20 Nov 2021 04:41:57 +0100 (CET) Received: from mail.tintel.eu ([IPv6:::1]) by localhost (mail.tintel.eu [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id iE0hz-e01W8I; Sat, 20 Nov 2021 04:41:57 +0100 (CET) Received: from localhost (localhost [IPv6:::1]) by mail.tintel.eu (Postfix) with ESMTP id 145E7447C10C; Sat, 20 Nov 2021 04:41:57 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.tintel.eu 145E7447C10C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-ipv6.be; s=502B7754-045F-11E5-BBC5-64595FD46BE8; t=1637379717; bh=xvSvZl7MVaeK8bjKlTSGlP/IM35xVBwjxa7ks+BBAjI=; h=From:To:Date:Message-Id:MIME-Version; b=jlQet0+bDKm4FxrIGutWUHpkz8UA/JbaMeAXVs+y90xhg4v+9F6XrByQL2U5UajOB patfB1LieSrdZgE8+krojezIBreXB6vo2LK7VGRmJ0DzCCCgkeTgx0jxPm4K63Ff4F wQxPkKQQkimoFnXoz72Ku5Kk6YD6hmY+usxGOETk= X-Virus-Scanned: amavisd-new at mail.tintel.eu Received: from mail.tintel.eu ([IPv6:::1]) by localhost (mail.tintel.eu [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id o-kKqRgYvM_j; Sat, 20 Nov 2021 04:41:57 +0100 (CET) Received: from taz.sof.bg.adlevio.net (unknown [IPv6:2001:67c:21bc:20::10]) by mail.tintel.eu (Postfix) with ESMTPS id C9A7A447C108; Sat, 20 Nov 2021 04:41:56 +0100 (CET) From: Stijn Tintel To: openwrt-devel@lists.openwrt.org Cc: noltari@gmail.com Subject: [PATCH 5/5] bcm27xx: add support for Raspberry Pi Zero 2 Date: Sat, 20 Nov 2021 05:41:52 +0200 Message-Id: <20211120034152.2612831-6-stijn@linux-ipv6.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211120034152.2612831-1-stijn@linux-ipv6.be> References: <20211120034152.2612831-1-stijn@linux-ipv6.be> MIME-Version: 1.0 X-Rspamd-Pre-Result: action=no action; module=multimap; Matched map: IP_WHITELIST X-Rspamd-Queue-Id: C9A7A447C108 X-Rspamd-Pre-Result: action=no action; module=multimap; Matched map: IP_WHITELIST X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:200533, ipnet:2001:67c:21bc::/48, country:BG]; IP_WHITELIST(0.00)[2001:67c:21bc:20::10] X-Rspamd-Server: skulls X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211119_194212_351716_F947E2D7 X-CRM114-Status: GOOD ( 14.43 ) X-Spam-Score: 0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Updating the entire patchset from Raspberry Pi upstream would also add the Raspberry Pi Zero 2 patch, but as that is a cumbersome process, just import the required patch. Prefix it with 950 so it is c [...] Content analysis details: (0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 DKIM_INVALID DKIM or DK signature exists, but is not valid X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Updating the entire patchset from Raspberry Pi upstream would also add the Raspberry Pi Zero 2 patch, but as that is a cumbersome process, just import the required patch. Prefix it with 950 so it is clear that this patch comes from the same source, but use a high number for the 2nd part of the prefix so that it's clear the patch is not in the upstream order. Signed-off-by: Stijn Tintel --- .../bcm27xx/base-files/etc/board.d/02_network | 1 + target/linux/bcm27xx/base-files/etc/diag.sh | 1 + target/linux/bcm27xx/image/Makefile | 18 +- ...0-9900-ARM-dts-Add-Pi-Zero-2-Support.patch | 229 ++++++++++++++++++ 4 files changed, 243 insertions(+), 6 deletions(-) create mode 100644 target/linux/bcm27xx/patches-5.10/950-9900-ARM-dts-Add-Pi-Zero-2-Support.patch diff --git a/target/linux/bcm27xx/base-files/etc/board.d/02_network b/target/linux/bcm27xx/base-files/etc/board.d/02_network index f279941e1e..b4d73bf967 100644 --- a/target/linux/bcm27xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm27xx/base-files/etc/board.d/02_network @@ -23,6 +23,7 @@ raspberrypi,4-model-b) ucidef_set_interface_lan "eth0" ;; +raspberrypi,model-zero-2 |\ raspberrypi,model-zero-w) ucidef_set_interface_lan "wlan0" ;; diff --git a/target/linux/bcm27xx/base-files/etc/diag.sh b/target/linux/bcm27xx/base-files/etc/diag.sh index f5e9ee0111..2a10aa9bdb 100644 --- a/target/linux/bcm27xx/base-files/etc/diag.sh +++ b/target/linux/bcm27xx/base-files/etc/diag.sh @@ -20,6 +20,7 @@ set_state() { raspberrypi,3-compute-module |\ raspberrypi,model-b |\ raspberrypi,model-zero |\ + raspberrypi,model-zero-2 |\ raspberrypi,model-zero-w) status_led="led0" ;; diff --git a/target/linux/bcm27xx/image/Makefile b/target/linux/bcm27xx/image/Makefile index f0c3ae1272..3165a2d1e5 100644 --- a/target/linux/bcm27xx/image/Makefile +++ b/target/linux/bcm27xx/image/Makefile @@ -96,14 +96,17 @@ define Device/rpi-2 bcm2709-rpi-2-b bcm2710-rpi-2-b \ bcm2710-rpi-3-b bcm2710-rpi-3-b-plus \ bcm2711-rpi-4-b bcm2711-rpi-400 \ - bcm2710-rpi-cm3 bcm2711-rpi-cm4 + bcm2710-rpi-cm3 bcm2711-rpi-cm4 \ + bcm2710-rpi-zero-2 SUPPORTED_DEVICES := \ - rpi-2-b rpi-3-b rpi-3-b-plus rpi-cm \ + rpi-2-b rpi-3-b rpi-3-b-plus rpi-cm rpi-zero-2 \ raspberrypi,2-model-b raspberrypi,2-model-b-rev2 \ raspberrypi,3-model-b raspberrypi,3-model-b-plus \ raspberrypi,3-compute-module raspberrypi,compute-module-3 \ - raspberrypi,400 raspberrypi,4-compute-module raspberrypi,4-model-b + raspberrypi,400 raspberrypi,4-compute-module raspberrypi,4-model-b \ + raspberrypi,model-zero-2 DEVICE_PACKAGES := \ + bcm43436-firmware \ cypress-firmware-43430-sdio \ cypress-nvram-43430-sdio-rpi-3b \ cypress-firmware-43455-sdio \ @@ -126,13 +129,16 @@ define Device/rpi-3 DEVICE_DTS := \ broadcom/bcm2710-rpi-2-b \ broadcom/bcm2710-rpi-3-b broadcom/bcm2710-rpi-3-b-plus \ - broadcom/bcm2710-rpi-cm3 + broadcom/bcm2710-rpi-cm3 \ + broadcom/bcm2710-rpi-zero-2 SUPPORTED_DEVICES := \ - rpi-3-b rpi-3-b-plus \ + rpi-3-b rpi-3-b-plus rpi-zero-2 \ raspberrypi,2-model-b-rev2 \ raspberrypi,3-model-b raspberrypi,3-model-b-plus \ - raspberrypi,3-compute-module raspberrypi,compute-module-3 + raspberrypi,3-compute-module raspberrypi,compute-module-3 \ + raspberrypi,model-zero-2 DEVICE_PACKAGES := \ + bcm43436-firmware \ cypress-firmware-43430-sdio \ cypress-nvram-43430-sdio-rpi-3b \ cypress-firmware-43455-sdio \ diff --git a/target/linux/bcm27xx/patches-5.10/950-9900-ARM-dts-Add-Pi-Zero-2-Support.patch b/target/linux/bcm27xx/patches-5.10/950-9900-ARM-dts-Add-Pi-Zero-2-Support.patch new file mode 100644 index 0000000000..6c37045c80 --- /dev/null +++ b/target/linux/bcm27xx/patches-5.10/950-9900-ARM-dts-Add-Pi-Zero-2-Support.patch @@ -0,0 +1,229 @@ +From 84dc624be6ae704fdb3c413b7d86315cf49fbb0b Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 9 Sep 2021 10:37:15 +0100 +Subject: [PATCH] ARM: dts: Add Pi Zero 2 support + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/bcm2710-rpi-zero-2.dts | 177 ++++++++++++++++++ + arch/arm64/boot/dts/broadcom/Makefile | 1 + + .../boot/dts/broadcom/bcm2710-rpi-zero-2.dts | 1 + + 4 files changed, 180 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm2710-rpi-zero-2.dts + create mode 100644 arch/arm64/boot/dts/broadcom/bcm2710-rpi-zero-2.dts + +diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +index 12cd8bf582e1b..66956d0f2c187 100644 +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -7,6 +7,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \ + bcm2708-rpi-cm.dtb \ + bcm2708-rpi-zero.dtb \ + bcm2708-rpi-zero-w.dtb \ ++ bcm2710-rpi-zero-2.dtb \ + bcm2709-rpi-2-b.dtb \ + bcm2710-rpi-2-b.dtb \ + bcm2710-rpi-3-b.dtb \ +diff --git a/arch/arm/boot/dts/bcm2710-rpi-zero-2.dts b/arch/arm/boot/dts/bcm2710-rpi-zero-2.dts +new file mode 100644 +index 0000000000000..42185a4506666 +--- /dev/null ++++ b/arch/arm/boot/dts/bcm2710-rpi-zero-2.dts +@@ -0,0 +1,177 @@ ++/dts-v1/; ++ ++#include "bcm2710.dtsi" ++#include "bcm2709-rpi.dtsi" ++#include "bcm283x-rpi-csi1-2lane.dtsi" ++#include "bcm283x-rpi-i2c0mux_0_44.dtsi" ++#include "bcm2708-rpi-bt.dtsi" ++#include "bcm283x-rpi-cam1-regulator.dtsi" ++ ++/ { ++ compatible = "raspberrypi,model-zero-2", "brcm,bcm2837"; ++ model = "Raspberry Pi Zero 2"; ++ ++ chosen { ++ bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1"; ++ }; ++ ++ aliases { ++ serial0 = &uart1; ++ serial1 = &uart0; ++ mmc1 = &mmcnr; ++ }; ++}; ++ ++&gpio { ++ spi0_pins: spi0_pins { ++ brcm,pins = <9 10 11>; ++ brcm,function = <4>; /* alt0 */ ++ }; ++ ++ spi0_cs_pins: spi0_cs_pins { ++ brcm,pins = <8 7>; ++ brcm,function = <1>; /* output */ ++ }; ++ ++ i2c0_pins: i2c0 { ++ brcm,pins = <0 1>; ++ brcm,function = <4>; ++ }; ++ ++ i2c1_pins: i2c1 { ++ brcm,pins = <2 3>; ++ brcm,function = <4>; ++ }; ++ ++ i2s_pins: i2s { ++ brcm,pins = <18 19 20 21>; ++ brcm,function = <4>; /* alt0 */ ++ }; ++ ++ sdio_pins: sdio_pins { ++ brcm,pins = <34 35 36 37 38 39>; ++ brcm,function = <7>; // alt3 = SD1 ++ brcm,pull = <0 2 2 2 2 2>; ++ }; ++ ++ bt_pins: bt_pins { ++ brcm,pins = <43>; ++ brcm,function = <4>; /* alt0:GPCLK2 */ ++ brcm,pull = <0>; ++ }; ++ ++ uart0_pins: uart0_pins { ++ brcm,pins = <30 31 32 33>; ++ brcm,function = <7>; /* alt3=UART0 */ ++ brcm,pull = <2 0 0 2>; /* up none none up */ ++ }; ++ ++ uart1_pins: uart1_pins { ++ brcm,pins; ++ brcm,function; ++ brcm,pull; ++ }; ++ ++ audio_pins: audio_pins { ++ brcm,pins = <>; ++ brcm,function = <>; ++ }; ++}; ++ ++&mmcnr { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdio_pins>; ++ bus-width = <4>; ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins &bt_pins>; ++ status = "okay"; ++}; ++ ++&uart1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_pins>; ++ status = "okay"; ++}; ++ ++&spi0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi0_pins &spi0_cs_pins>; ++ cs-gpios = <&gpio 8 1>, <&gpio 7 1>; ++ ++ spidev0: spidev@0{ ++ compatible = "spidev"; ++ reg = <0>; /* CE0 */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spi-max-frequency = <125000000>; ++ }; ++ ++ spidev1: spidev@1{ ++ compatible = "spidev"; ++ reg = <1>; /* CE1 */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spi-max-frequency = <125000000>; ++ }; ++}; ++ ++&i2c0if { ++ clock-frequency = <100000>; ++}; ++ ++&i2c1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins>; ++ clock-frequency = <100000>; ++}; ++ ++&i2c2 { ++ clock-frequency = <100000>; ++}; ++ ++&i2s { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2s_pins>; ++}; ++ ++&leds { ++ act_led: led-act { ++ label = "led0"; ++ linux,default-trigger = "actpwr"; ++ gpios = <&gpio 29 GPIO_ACTIVE_LOW>; ++ }; ++}; ++ ++&hdmi { ++ hpd-gpios = <&gpio 28 GPIO_ACTIVE_LOW>; ++}; ++ ++&audio { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&audio_pins>; ++ brcm,disable-headphones = <1>; ++}; ++ ++&bt { ++ shutdown-gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; ++}; ++ ++&minibt { ++ shutdown-gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; ++}; ++ ++&cam1_reg { ++ gpio = <&gpio 40 GPIO_ACTIVE_HIGH>; ++}; ++ ++/ { ++ __overrides__ { ++ act_led_gpio = <&act_led>,"gpios:4"; ++ act_led_activelow = <&act_led>,"gpios:8"; ++ act_led_trigger = <&act_led>,"linux,default-trigger"; ++ }; ++}; +diff --git a/arch/arm64/boot/dts/broadcom/Makefile b/arch/arm64/boot/dts/broadcom/Makefile +index 69809bf2f45df..e7c2c4fd59a87 100644 +--- a/arch/arm64/boot/dts/broadcom/Makefile ++++ b/arch/arm64/boot/dts/broadcom/Makefile +@@ -3,6 +3,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rpi-3-a-plus.dtb \ + bcm2837-rpi-3-b.dtb \ + bcm2837-rpi-3-b-plus.dtb \ + bcm2837-rpi-cm3-io3.dtb ++dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-zero-2.dtb + dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-2-b.dtb + dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-3-b.dtb + dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-3-b-plus.dtb +diff --git a/arch/arm64/boot/dts/broadcom/bcm2710-rpi-zero-2.dts b/arch/arm64/boot/dts/broadcom/bcm2710-rpi-zero-2.dts +new file mode 100644 +index 0000000000000..f76f553599ef2 +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcm2710-rpi-zero-2.dts +@@ -0,0 +1 @@ ++#include "../../../../arm/boot/dts/bcm2710-rpi-zero-2.dts"