From patchwork Sat Apr 13 22:14:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea della Porta X-Patchwork-Id: 13628829 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 39513C4345F for ; Sat, 13 Apr 2024 22:15:02 +0000 (UTC) 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:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6JVn/eTRP/ZHUTVt+V2aWxp4v4zvJnl46ig1eEzsUgk=; b=aqXXkmx2OCTJ3j a4FKcp82pB/eoNjlzKpqcroBvmIzul1IU7Pl1Z8TvjPv9UrMYTF8PLjgCSU6QjBGdsIafQp7uHZP0 FCMFjFD0iZm/zFaakxcCTrzwh/zgAHNQzz9aQz92Q2vHpeACACdSAbFTPvFwyb5EXEnSTKVLTYkRJ QNT5skRB17nSQROhP1kUdq5ios/gICBdS4ef/OFUIoNO/pSOYaCV16OAkI74e/JCnWqBf/HsilFJ+ tnDqNr1qkVWUmoXjo/u4y/Kzgm0ZnFoS6a6SQKeyPjL0sFWEFwuBKgAdIhfq7j4m+/EM9RsHGKjBH foUzXF8/KYJRLg4IXvfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvle3-000000044Va-29RG; Sat, 13 Apr 2024 22:14:47 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvle0-000000044U3-0F3H for linux-arm-kernel@lists.infradead.org; Sat, 13 Apr 2024 22:14:46 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-57020ad438fso17592a12.0 for ; Sat, 13 Apr 2024 15:14:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1713046481; x=1713651281; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=bxFqmOp3HshWN+SgF1tbY2QlrStlEk1IWrM1mFhMRAI=; b=c/Mwag1Zcn4K8UJAsoKv1W4lS+i7J8a0++bPuZN0o9qXrYr3gjJ/zSJJX4rKwNzx1d cktz/YGDhMupcIvQw4rntgB2QRVq/yUOczv7HQHUzn/DOMhnnl8DDFTvtyPUP6mY++Iu mvFKPKo0rozpsk4R+1ngyj0tK2fvvm4/bJgvlU6JdcKDp3wdLFZ1i6kxfWe1GnbqAp7c ZO2WYUKzqcb3NOKsru/ps/e8VAa78g2z6wVvV/R3o7VwA4gAtPAxeD3rl3vKrufgPcwS GVWTmZjhfy4BzbTXFSXrcON/RsOYKcxTPzLUb511hiYHRgHOSCD2cxPfzAaYAC7ITw2G bYXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713046481; x=1713651281; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bxFqmOp3HshWN+SgF1tbY2QlrStlEk1IWrM1mFhMRAI=; b=s/DrVu1D37TVBEu6w6FDD3+UtowmagLsmcfZR8QfkwKEOjHJiN9/siGezJA+vkoK1x xJtK/sX76V3bU4PiZonFSsL9cpWQgo1S7gqN0cAAWbG93m2MDq9yoj7KxFTzbQAWfbW9 ruGOLQyi9JlpHZEZt+f4/LVnium5eXEaCmS2cKisoK2R2s4F7CEbGH4ijexbDE7s/gtN WVEqzUBua1FcBZcIxsMjDvVG4YyvntW1n7n4THToLLPWrro4r0eFCwrkADQo0QAO2tny awDWFayDMcnxhqAozf2UNiZXd9L64t0pDMN0hlVO8HMwTl4h2u++DVIvFFUV1G8Wa0Bn 2QaA== X-Forwarded-Encrypted: i=1; AJvYcCWzwjbHO0FpvTeLULY3XURqzahdP+DxGtwSxsblQkaxNgVz7OM9fYFiitqDHmkASnNQ3UDV0mkUjPc3dzG4Dey60cmwON7y6uS9po0vd49mAEaMufQ= X-Gm-Message-State: AOJu0Yzqi3LmUN6TWH5j6w2ynPIBEsQQD/eaKikEfPXvD9hRaxwT1kz0 SPGdOR5xP7r2Hv7LXk4miLA5J9GD1BUEp2opEMxb78T2Tt4eHlg5SogbeIDDA4a8G638tleAzY/ + X-Google-Smtp-Source: AGHT+IFcFugdj9bcTWs2YQtc+IVEziRNNY4/ZWW62w81MoufOnOsTtn3loVBBMBQBvaAMW24sH/sXw== X-Received: by 2002:a05:6402:3895:b0:56f:db50:f2ca with SMTP id fd21-20020a056402389500b0056fdb50f2camr8490302edb.4.1713046481310; Sat, 13 Apr 2024 15:14:41 -0700 (PDT) Received: from localhost (host-87-4-160-102.retail.telecomitalia.it. [87.4.160.102]) by smtp.gmail.com with ESMTPSA id b11-20020aa7c6cb000000b0056e7ba0497dsm2976956eds.28.2024.04.13.15.14.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Apr 2024 15:14:41 -0700 (PDT) From: Andrea della Porta To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Broadcom internal kernel review list , Linus Walleij , Adrian Hunter , Kamal Dasu , Al Cooper , della Porta , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Jonathan Bell , Phil Elwell Subject: [PATCH 0/6] Add support for BCM2712 SD card controller Date: Sun, 14 Apr 2024 00:14:22 +0200 Message-ID: X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240413_151444_135437_3889FEAD X-CRM114-Status: GOOD ( 16.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, This patchset adds support for the SDHCI controller on Broadcom BCM2712 SoC in order to make it possible to boot (particularly) Raspberry Pi 5 from SD card. This work is heavily based on downstream contributions. Patch #1 and 2: introduce the dt binding definitions for, respectively, the new pin cfg/mux controller and the SD host controller as a preparatory step for the upcoming dts. Patch #3: add a somewhat reasonable (*almost* bare-minimum) dts to be used to boot Rpi5 boards. Since till now there was no support at all for any 2712 based chipset, both the SoC and board dts plus definitions for the new Pin and SD host controller have been added. Patch #4: the driver supporting the pin controller. Based on [1] and successive fix commits. Patch #5: add SDHCI support. Based on [2] and the next 2 fix commits. Drop the SD Express implementation for now, that will be added by patch #6. Patch #6: this patch offers SD Express support and can be considered totally optional. The callback plumbing is slightly different w.r.t. the downstream approach (see [3]), as explained in the patch comment. Not sure what is the best, any comment is highly appreciated. Tested succesfully on Raspberry Pi 5 using an SDxC card as the boot device. Still untested: - SD Express due to the lack of an Express capable card. Also, it will need PCIe support first. - card detection pin, since the sd was the booting and root fs device. Many thanks, Andrea Links: [1] - https://github.com/raspberrypi/linux/commit/d9b655314a826724538867bf9b6c229d04c25d84 [2] - https://github.com/raspberrypi/linux/commit/e3aa070496e840e72a4dc384718690ea4125fa6a [3] - https://github.com/raspberrypi/linux/commit/eb1df34db2a9a5b752eba40ee298c4ae87e26e87 Andrea della Porta (6): dt-bindings: pinctrl: Add support for BCM2712 pin controller dt-bindings: mmc: Add support for BCM2712 SD host controller arm64: dts: broadcom: Add support for BCM2712 pinctrl: bcm: Add pinconf/pinmux controller driver for BCM2712 mmc: sdhci-brcmstb: Add BCM2712 support mmc: sdhci-brcmstb: Add BCM2712 SD Express support .../bindings/mmc/brcm,sdhci-brcmstb.yaml | 51 +- .../pinctrl/brcm,bcm2712-pinctrl.yaml | 99 ++ arch/arm64/boot/dts/broadcom/Makefile | 1 + .../boot/dts/broadcom/bcm2712-rpi-5-b.dts | 313 +++++ arch/arm64/boot/dts/broadcom/bcm2712-rpi.dtsi | 81 ++ arch/arm64/boot/dts/broadcom/bcm2712.dtsi | 841 +++++++++++ drivers/mmc/host/Kconfig | 1 + drivers/mmc/host/sdhci-brcmstb.c | 275 ++++ drivers/pinctrl/bcm/Kconfig | 9 + drivers/pinctrl/bcm/Makefile | 1 + drivers/pinctrl/bcm/pinctrl-bcm2712.c | 1247 +++++++++++++++++ 11 files changed, 2918 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm2712-pinctrl.yaml create mode 100644 arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b.dts create mode 100644 arch/arm64/boot/dts/broadcom/bcm2712-rpi.dtsi create mode 100644 arch/arm64/boot/dts/broadcom/bcm2712.dtsi create mode 100644 drivers/pinctrl/bcm/pinctrl-bcm2712.c