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.3412.1588236620765511913 for ; Thu, 30 Apr 2020 01:50:21 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@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 2B19C1063; Thu, 30 Apr 2020 01:50:20 -0700 (PDT) Received: from [192.168.1.81] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 54B043F68F; Thu, 30 Apr 2020 01:50:19 -0700 (PDT) Subject: Re: [edk2-platforms][PATCH 3/4] RPi3: add support for Compute Module 3. To: Andrei Warkentin , devel@edk2.groups.io Cc: leif@nuviainc.com, pete@akeo.ie, philmd@redhat.com References: <20200430084746.51455-1-andrey.warkentin@gmail.com> <20200430084746.51455-4-andrey.warkentin@gmail.com> From: "Ard Biesheuvel" Message-ID: Date: Thu, 30 Apr 2020 10:50:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200430084746.51455-4-andrey.warkentin@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 4/30/20 10:47 AM, Andrei Warkentin wrote: > Mostly strings and documentation, but also fixes a dumb bug > I introduced when I added SD block write validation back > in RaspberryPiPkg (which broke eMMC support, even though > I could have tested it with a discrete eMMC media on regular > Pies) > > Signed-off-by: Andrei Warkentin Hi Andrei, Can we please not put bug fixes and documentation updates in the same patch? > --- > Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni | 8 ++++---- > Platform/RaspberryPi/Drivers/MmcDxe/MmcBlockIo.c | 1 + > Platform/RaspberryPi/RPi3/Readme.md | 19 ++++++++++++------- > 3 files changed, 17 insertions(+), 11 deletions(-) > > diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni > index 26d803f7..07660072 100644 > --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni > +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni > @@ -53,8 +53,8 @@ > #string STR_MMC_FORM_TITLE #language en-US "SD/MMC Configuration" > #string STR_MMC_FORM_SUBTITLE #language en-US "Note: UEFI only, OS may override settings." > > -#string STR_MMC_SD_PROMPT #language en-US "uSD Routing" > -#string STR_MMC_SD_HELP #language en-US "Choose host controller to drive uSD slot" > +#string STR_MMC_SD_PROMPT #language en-US "uSD/eMMC Routing" > +#string STR_MMC_SD_HELP #language en-US "Choose host controller to drive local flash storage" > #string STR_MMC_SD_EMMC2 #language en-US "eMMC2 SDHCI" > #string STR_MMC_SD_SDHOST #language en-US "Broadcom SDHOST" > #string STR_MMC_SD_ARASAN #language en-US "Arasan SDHCI" > @@ -65,12 +65,12 @@ > #string STR_MMC_DISMULTI_Y #language en-US "Single-block transfers" > > #string STR_MMC_FORCE1BIT_PROMPT #language en-US "uSD Max Bus Width" > -#string STR_MMC_FORCE1BIT_HELP #language en-US "Tweak for bad media" > +#string STR_MMC_FORCE1BIT_HELP #language en-US "Tweak for bad media (N/A for eMMC)" > #string STR_MMC_FORCE1BIT_Y #language en-US "1 Bit Mode" > #string STR_MMC_FORCE1BIT_N #language en-US "4 Bit Mode" > > #string STR_MMC_FORCEDS_PROMPT #language en-US "uSD Force Default Speed" > -#string STR_MMC_FORCEDS_HELP #language en-US "Tweak for bad media" > +#string STR_MMC_FORCEDS_HELP #language en-US "Tweak for bad media (N/A for eMMC)" > #string STR_MMC_FORCEDS_Y #language en-US "Force Default Speed" > #string STR_MMC_FORCEDS_N #language en-US "Allow High Speed" > > diff --git a/Platform/RaspberryPi/Drivers/MmcDxe/MmcBlockIo.c b/Platform/RaspberryPi/Drivers/MmcDxe/MmcBlockIo.c > index 29a9fd7d..8a2f7f42 100644 > --- a/Platform/RaspberryPi/Drivers/MmcDxe/MmcBlockIo.c > +++ b/Platform/RaspberryPi/Drivers/MmcDxe/MmcBlockIo.c > @@ -47,6 +47,7 @@ ValidateWrittenBlockCount ( > /* > * Not on MMC. > */ > + *TransferredBlocks = Count; > return EFI_SUCCESS; > } > > diff --git a/Platform/RaspberryPi/RPi3/Readme.md b/Platform/RaspberryPi/RPi3/Readme.md > index 3484c92c..b756013b 100644 > --- a/Platform/RaspberryPi/RPi3/Readme.md > +++ b/Platform/RaspberryPi/RPi3/Readme.md > @@ -21,6 +21,10 @@ The RPi3 target supports Pi revisions based on the BCM2837 SoC: > - Raspberry Pi 3A+ > - Raspberry Pi 3B > - Raspberry Pi 3B+ > +- Raspberry Pi CM3 > + > +Note: a CM3L, lacking eMMC and thus similar to the 3B, will probably work as well, but just > +has not been tested. > > Please see the RPi4 target for BCM2711-based variants, such as the Raspberry Pi 4B. > > @@ -148,20 +152,21 @@ This should allow you to set whatever date/time you want using the Shell date an > time commands. While in UEFI or HLOS, the time will tick forward. > `RtcEpochSeconds` is not updated on reboots. > > -## uSD > +## uSD (and eMMC for CM3) > > -UEFI supports both the Arasan SDHCI and the Broadcom SDHost controllers to access the uSD slot. > -You can use either. The other controller gets routed to the SDIO card. The choice made will > +UEFI supports both the Arasan SDHCI and the Broadcom SDHost controllers to access the flash > +media (eMMC on CM3, and uSD slot on everything else). You can use either. The other controller > +gets routed to the SDIO WiFi card (N/A to models without WiFi). The choice made will > impact ACPI OSes booted (e.g. Windows 10). Arasan, being an SDIO controller, is usually used > -with the WiFi adapter where available. SDHost cannot be used with SDIO. In UEFI setup screen: > +with the WiFi adapter (where available). SDHost cannot be used with SDIO. In UEFI setup screen: > - go to `Device Manager` > - go to `Raspberry Pi Configuration` > -- go to `Chipset` > -- configure `Boot uSD Routing` > +- go to `SD/MMC Configuration` > +- configure `uSD/eMMC Routing` > > Known issues: > - Arasan HS/4bit support is missing. > -- No 8 bit mode support for (e)MMC (irrelevant for the Pi 3). > +- No 8 bit mode support for (e)MMC (slow UEFI file I/O on CM3). > - Hacky (e)MMC support (no HS). > - No card removal/replacement detection, tons of timeouts and slow down during boot without an uSD card present. > >