From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.2493.1607988236907842981 for ; Mon, 14 Dec 2020 15:23:57 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: jeremy.linton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6BDC91FB; Mon, 14 Dec 2020 15:23:55 -0800 (PST) Received: from mammon-tx2.austin.arm.com (mammon-tx2.austin.arm.com [10.118.28.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 63BCC3F66E; Mon, 14 Dec 2020 15:23:55 -0800 (PST) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: ard.biesheuvel@arm.com, leif@nuviainc.com, pete@akeo.ie, andrey.warkentin@gmail.com, samer.el-haj-mahmoud@arm.com, Jeremy Linton Subject: [PATCH 0/7] Enable emmc2 controller rpi4 Date: Mon, 14 Dec 2020 17:23:43 -0600 Message-Id: <20201214232350.1192387-1-jeremy.linton@arm.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The rpi4 has a secondary sd controller at offset 0xfe340000. This controller appears to be a mostly compliant SDHCI controller (a newer more bugfree arasan?). So we should be able to bind the existing arasan driver to it. This allows the rpi4 to boot with its normal emmc2->sd card, arasan->wifi=20 configuration that is described in the linux DT. To do this, it appears we should also be tweaking some of the expansion gpios, and probably telling the firmware to power everything up. To do that we sync the vpu mailbox headers, with a more recent list of the mailbox commands, then extend the rpi firmware dxe to support some futher gpio/power commands. Once that is complete we tweak the arasan driver to use an alternate register base, add a workaround for a known clock crossing bug, and set the card voltage. As well as a number of other tweaks. Of note, this set does _NOT_ change the HID/CID's and add the additional emmc2 controller to the DSDT table. That remains an open item waiting for a proper set of device ids. Jeremy Linton (7): Platform/RaspberryPi: Update VPU mailbox constants Platform/RaspberryPi: Add further mailbox helpers Platform/RaspberryPi: Split MMC register defintions Platform/RaspberryPi/Arasan: Add write delay and voltage/clock config Platform/RaspberryPi/Arasan: Select the correct base frequency Platform/RaspberryPi: Power up sd, and tweak GPIOs Platform/RaspberryPi: Correct device path removal. .../Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c | 131 ++++++++--- .../Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.h | 1 + Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 9 + .../Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c | 240 +++++++++++++++= +++++- .../RaspberryPi/Include/IndustryStandard/RpiMbox.h | 94 +++++++- .../RaspberryPi/Include/Protocol/RpiFirmware.h | 25 +++ .../Library/PlatformBootManagerLib/PlatformBm.c | 2 +- .../Bcm283x/Include/IndustryStandard/Bcm2836Sdio.h | 42 ++-- 8 files changed, 486 insertions(+), 58 deletions(-) --=20 2.13.7