From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.87]) by mx.groups.io with SMTP id smtpd.web11.6659.1609932223954910229 for ; Wed, 06 Jan 2021 03:23:44 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@vmware.com header.s=selector2 header.b=Y99D/A+M; spf=pass (domain: vmware.com, ip: 40.107.93.87, mailfrom: awarkentin@vmware.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jB7zSxaOai7wVT8L5/b8Qzc+up4gugccwuC0rHIToeuQbt9iNA3YvgIaaX2OKHsNe8apN9Jo91JywimYWhUm/j8UkE6xhIbUjz+BvlCviS9cGpfFcwLpBB5OVn1cjjlnUHq979/huwjpn8gR+QxeX9PesRYiGvFBy6F0wq/tREdXq5jZCgmTzAV/wi2jyNGCox62Yc/Es/MUhb9pgujwoyOweL0Zjec4mu+nRCRDbXV/gZvpSKwREnuERxC47Jw66s6z28voF/3xJzoRiJc9oYp11p9Yu/e1UllF4b3QfZ+reY4YS8o2uxfrUUkOkVmkifVE53PZAV/kgalW1p618A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7rB0eS63T4sv6tSQrxJnmXumk2ywalkBmfSBO/coUjU=; b=PJYQ18F328x1LTRAL3JqNLAUldQzuCIQbn0165Dkq2pLifiF431ZSQzVsvJVw2DYFqGS2YJX85qa0GDi2q0efWVyXqSVvKSnhVvNVANFzVZsYXmM8V1Y16fQN71Lr3qLbgmI+g4DGSoIovgva/DMQCjZywBCpQafW0XD+VkctAJL5EjbU5BnEgAHJDp8jMrZK9Y7OB/7ye2ovxb3ductzdOQxyHSADSfWGdCv4JbjjnVGcjymCmfDyuQr/KS+Vd2AWa8Lb38dfib9+giru7DA0EZr9yjL/dUiyCvimMdA9iLVCilDShT2bzkaK19S39oc47ZViA2dllBxWBvKP0zLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7rB0eS63T4sv6tSQrxJnmXumk2ywalkBmfSBO/coUjU=; b=Y99D/A+MsIrtxdGpykWyVmfGoKjC2ALN8Lk84uYFdNKw+AtH/mhzxYK+wKAUXfnFft+75Zlym0db1g4csKxPSiwmyWPtHwMC15yS9pPeoCWRdSqjy1QHc/uuLebh+cKkNj91RIIFhWBdXzJBzN3tQJpPITmR/+2cUkNQ+L+U83E= Received: from SN7PR05MB7582.namprd05.prod.outlook.com (2603:10b6:806:f7::16) by SN6PR05MB5006.namprd05.prod.outlook.com (2603:10b6:805:e4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.2; Wed, 6 Jan 2021 11:23:41 +0000 Received: from SN7PR05MB7582.namprd05.prod.outlook.com ([fe80::5840:b0dd:d2c8:866f]) by SN7PR05MB7582.namprd05.prod.outlook.com ([fe80::5840:b0dd:d2c8:866f%7]) with mapi id 15.20.3742.006; Wed, 6 Jan 2021 11:23:41 +0000 From: "Andrei Warkentin" To: Ard Biesheuvel , Jeremy Linton , "devel@edk2.groups.io" CC: "leif@nuviainc.com" , "pete@akeo.ie" , "samer.el-haj-mahmoud@arm.com" Subject: Re: [PATCH v4 0/7] rpi4: Enable eMMC2 controller Thread-Topic: [PATCH v4 0/7] rpi4: Enable eMMC2 controller Thread-Index: AQHW44CiP4/CP89EZkWHcGtGAJHUF6oaUOyAgAAkaBM= Date: Wed, 6 Jan 2021 11:23:41 +0000 Message-ID: References: <20210105163420.1711652-1-jeremy.linton@arm.com>, In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=vmware.com; x-originating-ip: [176.57.76.234] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7d7afeb2-1e4d-4cb7-cb13-08d8b23585b6 x-ms-traffictypediagnostic: SN6PR05MB5006: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vUjKS85ChTA2dSCqER51SF35RjFqnlf9Obd/B3kauM54zdV6atu+SnVYrdwiK5AJESBCFWnFy+wgiE7OTFpfRTKC6+hTVZdbfWCdSINiYnmN2oC4XsKa+GE6X/I908oXofjM7zT6I6irezYpngVncGcC1/V1qDpLdySdLcYYVy6u08w2qSMTp4FLoiZG4aEo/2VD4WhwkzFq5edKuVA0zEDVu/eB1gLnP20Ys5LALn3TD/PK0q/PjMfzN6TK1OU2zlLijGfH7mlLI7IpdjalCi9m9y59l1tl54kiWBjc4nkWYMb2dOfEg8lJQDox+hh+FKYL6Xz+YTKCBpZCFDdcJtXG81NR3s+dKsTvxDoqaewkge9N/sF38xsXQI28vD/yb3Z+fZeH4gI+c5Gl92XsHQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN7PR05MB7582.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(346002)(376002)(366004)(136003)(396003)(86362001)(316002)(110136005)(19627235002)(33656002)(2906002)(7696005)(5660300002)(478600001)(83380400001)(19627405001)(71200400001)(9686003)(55016002)(4326008)(6506007)(53546011)(8936002)(91956017)(66446008)(64756008)(66556008)(66476007)(76116006)(52536014)(66946007)(26005)(186003)(54906003)(8676002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-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QlwpDTIw58gZuT+av?= =?us-ascii?Q?XjsyM1KPDubt2laycCnjwiww2Cwh6Z+85K+eXReJlVTwWW1Eo8RzYN2IsUbw?= =?us-ascii?Q?+g8nyvZaA9fFXBHfWM6BQR4q55t1rRGBR/QhwDm2yV4=3D?= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN7PR05MB7582.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d7afeb2-1e4d-4cb7-cb13-08d8b23585b6 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jan 2021 11:23:41.8478 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: eO3gy5aciJac1XyTGBdDYpwUvBqFVMYAq+52RbqBxwG72L0cZ8LhYxvT/pfndpc5idhx2ugxU6RKqTy/ul115Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR05MB5006 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_SN7PR05MB7582815CFDF37E834BC13DD5B9D00SN7PR05MB7582namp_" --_000_SN7PR05MB7582815CFDF37E834BC13DD5B9D00SN7PR05MB7582namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Ard: IIRC eMMC2 is a better SDHCI-like controller. It supports more high-sp= eed modes (e.g. 1.8V ones), resulting in better I/O performance, A ________________________________ From: Ard Biesheuvel Sent: Wednesday, January 6, 2021 3:11 AM To: Jeremy Linton ; devel@edk2.groups.io Cc: leif@nuviainc.com ; pete@akeo.ie ; sam= er.el-haj-mahmoud@arm.com ; Andrei Warkentin = Subject: Re: [PATCH v4 0/7] rpi4: Enable eMMC2 controller On 1/5/21 5:34 PM, Jeremy Linton wrote: > 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 the existing Arasan driver should be > bound to it. This allows the rpi4 to boot > with its normal eMMC2->SD card, Arasan->wifi > configuration that is described in the Linux DT. > Could you please explain why this is an advantage? Is it related to ACPI OSes not needing to change pinmuxing etc? > To achieve this, it appears we should be tweaking > some of the expansion gpios, and probably telling > the firmware to power everything up. To do that > the vpu mailbox headers are synced with a more recent > list of the mailbox commands, then the rpi > firmware dxe is extended 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. > > 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. > > v3->v4: Commit message tweaks, variable rename. > v1->v3: Use some mailbox defines rather than opencoded constants > > Jeremy Linton (7): > Platform/RaspberryPi: Update VPU mailbox constants > Platform/RaspberryPi: Add further mailbox helpers > Platform/RaspberryPi: Split MMC register definitions > 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 | 7 + > .../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, 484 insertions(+), 58 deletions(-) > --_000_SN7PR05MB7582815CFDF37E834BC13DD5B9D00SN7PR05MB7582namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Ard: IIRC eMMC2 is a better SDHCI-like controller. It= supports more high-speed modes (e.g. 1.8V ones), resulting in better I/O p= erformance,

A

From: Ard Biesheuvel <ar= d.biesheuvel@arm.com>
Sent: Wednesday, January 6, 2021 3:11 AM
To: Jeremy Linton <jeremy.linton@arm.com>; devel@edk2.groups.i= o <devel@edk2.groups.io>
Cc: leif@nuviainc.com <leif@nuviainc.com>; pete@akeo.ie <pe= te@akeo.ie>; samer.el-haj-mahmoud@arm.com <samer.el-haj-mahmoud@arm.c= om>; Andrei Warkentin <awarkentin@vmware.com>
Subject: Re: [PATCH v4 0/7] rpi4: Enable eMMC2 controller
 
On 1/5/21 5:34 PM, Jeremy Linton wrote:
> 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 the existing Arasan driver should be
> bound to it. This allows the rpi4 to boot
> with its normal eMMC2->SD card, Arasan->wifi
> configuration that is described in the Linux DT.
>

Could you please explain why this is an advantage? Is it related to ACPI OSes not needing to change pinmuxing etc?


> To achieve this, it appears we should be tweaking
> some of the expansion gpios, and probably telling
> the firmware to power everything up. To do that
> the vpu mailbox headers are synced with a more recent
> list of the mailbox commands, then the rpi
> firmware dxe is extended 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.
>
> 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.
>
> v3->v4: Commit message tweaks, variable rename.
> v1->v3: Use some mailbox defines rather than opencoded constants >
> Jeremy Linton (7):
>   Platform/RaspberryPi: Update VPU mailbox constants
>   Platform/RaspberryPi: Add further mailbox helpers
>   Platform/RaspberryPi: Split MMC register definitions
>   Platform/RaspberryPi/Arasan: Add write delay and voltage/c= lock config
>   Platform/RaspberryPi/Arasan: Select the correct base frequ= ency
>   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 |  = 7 +
>  .../Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c   &nb= sp;    | 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, 484 insertions(+), 58 deletions(-)
>

--_000_SN7PR05MB7582815CFDF37E834BC13DD5B9D00SN7PR05MB7582namp_--