From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) by mx.groups.io with SMTP id smtpd.web10.3388.1588236481045832531 for ; Thu, 30 Apr 2020 01:48:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LzhLxGp5; spf=pass (domain: gmail.com, ip: 209.85.222.194, mailfrom: andrey.warkentin@gmail.com) Received: by mail-qk1-f194.google.com with SMTP id l78so4901243qke.7 for ; Thu, 30 Apr 2020 01:48:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=b+qgauj768K+DthDNTi6CBxmJMgLRjuLBv1Hcrzrsfw=; b=LzhLxGp5fd9kEGHk2LtJXfAfOgtbOsAc0WjcpYdMyHSN73jkwIGkZfDWKg2q9Ibb/b I2I712fxzTZbUBygcLa5Evqh64JNPPGR0kjEyyLzL4pJSeLQnC9/RY/CJiUe07IaNY8+ QjvtX4nMrkfxf0nci3ijdae6BaxQ99U9TMp6WMs9D6hRYv33N5kzjzSIyc90xvOAb5xL yDT/oPGYxRHLvWj2rMkCm9Y2MTvMB2G4udCoh4fzShI/GpIqnsntimyDEpr6eqA8la89 9EqfLzbraVj6hE383EUD7ZgG/i1Dzw3KzBSszk1lI5xTxqOmEx10jK5jXXRR/SW7noPu HoNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=b+qgauj768K+DthDNTi6CBxmJMgLRjuLBv1Hcrzrsfw=; b=kZv4D13wO8gvuWIAdWH0sdUYVelSewH+53U/TWeILGuUqMXbedZt22aqqtDSLbPlkp NLSeA6j7N1+dxINkr1v9HXIDZumJ9C7cYQ5lEj9tIZQkyUBgBeHdG4m2n2xCqJS47TD6 zNlEXcLD/rPgd6AwP6p0yXmMACPPN9LY2W7oGXl0uBGavpzHpTQKU6tMXpLxSMLdeSNV fQbgkD2niHqkssplS20A5kLCojOjA0fR2f9CY7aXAb8MSQm1Z+WENYIgZwUtT4WA9AuM xGT3b31jcLtcmkAoS82HG5xKnqDT13nXjICTO24klcXbGY9jBTwKoMPEQP93Uz5NJ35Q aAng== X-Gm-Message-State: AGi0Puab/3TWS/fSmyk04+3W6a8ThdAejNfeQwRNt6zy/KqeK3Df6OoR sh00Jmm8NMUXMOgIQCWCAp2Gk+z8Www= X-Google-Smtp-Source: APiQypK2vy32OFJV79iCOKJfq3wVj+TYueketFbfUxIfKUHXtlIm3/94TBnYUqWpxFUdVBO402++hg== X-Received: by 2002:a37:bc81:: with SMTP id m123mr2427626qkf.287.1588236479956; Thu, 30 Apr 2020 01:47:59 -0700 (PDT) Return-Path: Received: from localhost.localdomain (c-98-214-99-181.hsd1.il.comcast.net. [98.214.99.181]) by smtp.gmail.com with ESMTPSA id f130sm1419553qke.22.2020.04.30.01.47.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 01:47:59 -0700 (PDT) From: "Andrei Warkentin" To: devel@edk2.groups.io Cc: ard.biesheuvel@arm.com, leif@nuviainc.com, pete@akeo.ie, philmd@redhat.com Subject: [edk2-platforms][PATCH 3/4] RPi3: add support for Compute Module 3. Date: Thu, 30 Apr 2020 01:47:45 -0700 Message-Id: <20200430084746.51455-4-andrey.warkentin@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200430084746.51455-1-andrey.warkentin@gmail.com> References: <20200430084746.51455-1-andrey.warkentin@gmail.com> 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 --- 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. -- 2.17.1