From nobody Fri May 17 06:07:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+113558+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113558+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1704931469; cv=none; d=zohomail.com; s=zohoarc; b=MpD8Q4sh4f/7sjGPX5zo0sKaVB7iUTWnKHyV2wvCpZ1U6s9bkPvebeFBjt34TXS6bd0Y41t0SEwmIFkPCvxMJa0nhixpIAzo/t7d4HhTIXdcfrl8ZRm5aZA1GNmcND2RnD6XSlDdzaKK9ciFC6donxHQnyVTrPUAlCqbgw/AHWs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704931469; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=JqFvg8IRiT3uQMIgohjbPQS5vGGN78RF5/wttPGcvEc=; b=b0tHUApjNB6UuoIocwqT+Ty9LfBCtVEeebUjQVOzHn7jJe9X/MxAitNOGZ8yxNKlutx4KEwdn/aKfenRnqSIG4kzXSMoeJwdNVJr9keHGK/e4/7t1xFtPbf9FXm6G8C3Eavs0APwoXMc/bE76wX5zz9GpD4ixISTKSziBcGomvc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113558+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1704931469929109.77116088589912; Wed, 10 Jan 2024 16:04:29 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=+orJ3mOfn2xPh6/XB1O3LlZ17Rq52G649Cb9MZglE+4=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1704931469; v=1; b=vrhp048gEmW0/GDwMrNrFss66oY0KIQtveEUhz+L9ox2sZFE69RrymMPwh6e81YMURnuJGA0 Z8eeT28Tcwd0EijX+qIysydH1NCEB1M0OHCcrh8mmTeaQjEE7dychklUVyV+Iw+8kXqNQ0DW1uv YR6FgxWuVNeKVr+XD9DCPEuE= X-Received: by 127.0.0.2 with SMTP id mVljYY1788612xGYSVJG8Obh; Wed, 10 Jan 2024 16:04:29 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.9367.1704931468825253958 for ; Wed, 10 Jan 2024 16:04:29 -0800 X-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 7ADE0DA7; Wed, 10 Jan 2024 16:05:14 -0800 (PST) X-Received: from u200865.usa.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6487E3F5A1; Wed, 10 Jan 2024 16:04:28 -0800 (PST) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, quic_llindhol@quicinc.com, Jeremy Linton Subject: [edk2-devel] [RFC 1/6] Silicon/Bcm283x: Document the I2C registers Date: Wed, 10 Jan 2024 18:04:21 -0600 Message-ID: <20240111000426.2735007-2-jeremy.linton@arm.com> In-Reply-To: <20240111000426.2735007-1-jeremy.linton@arm.com> References: <20240111000426.2735007-1-jeremy.linton@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,jeremy.linton@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: LcL0AykusbU2mU9cnfKQQOdax1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704931471350100002 Content-Type: text/plain; charset="utf-8" Since we are now using I2C in edk2, its helpful if we document the register names. Signed-off-by: Jeremy Linton --- .../Include/IndustryStandard/Bcm2836.h | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h b/= Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h index 55a446a86c..6dc8921346 100644 --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h @@ -97,6 +97,40 @@ #define BCM2836_I2C2_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_I2C2_OFFSET) #define BCM2836_I2C2_LENGTH 0x00000020 =20 +#define BCM2836_I2C3_OFFSET 0x00205600 +#define BCM2836_I2C3_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_I2C3_OFFSET) +#define BCM2836_I2C3_LENGTH 0x00000020 + +#define BCM2836_I2C4_OFFSET 0x00205800 +#define BCM2836_I2C4_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_I2C4_OFFSET) +#define BCM2836_I2C4_LENGTH 0x00000020 + +#define BCM2836_I2C5_OFFSET 0x00205a00 //2= 711 doc says 205a80?! +#define BCM2836_I2C5_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_I2C5_OFFSET) +#define BCM2836_I2C5_LENGTH 0x00000020 + +#define BCM2836_I2C6_OFFSET 0x00205c00 +#define BCM2836_I2C6_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_I2C6_OFFSET) +#define BCM2836_I2C6_LENGTH 0x00000020 + +#define BCM2836_I2C20_OFFSET 0x00f04500 //2= 711 DCC0 +#define BCM2836_I2C20_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_I2C20_OFFSET) +#define BCM2836_I2C20_LENGTH 0x00000020 + +#define BCM2836_I2C21_OFFSET 0x00f09500 //2= 711 DCC1 +#define BCM2836_I2C21_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_I2C21_OFFSET) +#define BCM2836_I2C21_LENGTH 0x00000020 + +/* I2C register offsets */ +#define BCM2835_I2C_C 0x00 +#define BCM2835_I2C_S 0x04 +#define BCM2835_I2C_DLEN 0x08 +#define BCM2835_I2C_A 0x0c +#define BCM2835_I2C_FIFO 0x10 +#define BCM2835_I2C_DIV 0x14 +#define BCM2835_I2C_DEL 0x18 +#define BCM2835_I2C_CLKT 0x1c + #define BCM2836_SPI0_OFFSET 0x00204000 #define BCM2836_SPI0_BASE_ADDRESS (BCM2836_SOC_R= EGISTERS + BCM2836_SPI0_OFFSET) #define BCM2836_SPI0_LENGTH 0x00000020 --=20 2.43.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113558): https://edk2.groups.io/g/devel/message/113558 Mute This Topic: https://groups.io/mt/103653097/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 06:07:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+113559+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113559+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1704931470; cv=none; d=zohomail.com; s=zohoarc; b=J4l1IlUt8yJIURFD2Da+LmkVl7vF5rg77aME1fCCNLiXBv/tdyOHeTc9I2UXj613tJgpIFK4mWfLZEsdBzW0MPWjb+xIlZrj/RPqUjsdgskRxU4yXhkfAiWYZBs+/ddSpSsX+KfBWZ6i+DJMjZGayH5mlrRmMeLKz2v1004fYkQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704931470; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=3htXXh6soFKmxI+qkT9UanwRV4+0s2C0NjWdfimqZlY=; b=KnhKeR4Eb/MDn2UfjW3MCOr3wlZKG9AkzdUV32e8ZyXIkguVBFTfOy1je0+C7uBG6R6j41Rp6CASTjnlBY90RBoXgxDsJvvnaFyqk4a//WQAWhspoKRIE+qdF0JBkTCyx+VaDIzclNRvb1WEfUahUe/NPPSxRJeUVXA47q5EuYE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113559+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1704931470357683.1301644858203; Wed, 10 Jan 2024 16:04:30 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=phdw5rXBR9yj0ZZcRcKwv3ZYvV2guuNo9ACeV3l/3uQ=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1704931470; v=1; b=fOLHi8xeaVZyGL6H8Jkt8O5pCL/p/c0+d3qfGngt6WYrk/MBZ8/vtxj8B1yDPLZAZ6Og4a5Y f29T9qB5XZQzJs+Azw46Mf0vzgAp4Z1F41Huo4GjmiWeRXbZeD6fXUGCbweId3VWgu6QnjGsBlc OwISvOdfUDUZJ8N6tAT50kaw= X-Received: by 127.0.0.2 with SMTP id DicKYY1788612xSw3mFSO7ZD; Wed, 10 Jan 2024 16:04:30 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.9467.1704931469122767513 for ; Wed, 10 Jan 2024 16:04:29 -0800 X-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 C24C4106F; Wed, 10 Jan 2024 16:05:14 -0800 (PST) X-Received: from u200865.usa.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 99ACA3F5A1; Wed, 10 Jan 2024 16:04:28 -0800 (PST) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, quic_llindhol@quicinc.com, Jeremy Linton Subject: [edk2-devel] [RFC 2/6] Silicon/Bcm283x: Add core I2C drivers Date: Wed, 10 Jan 2024 18:04:22 -0600 Message-ID: <20240111000426.2735007-3-jeremy.linton@arm.com> In-Reply-To: <20240111000426.2735007-1-jeremy.linton@arm.com> References: <20240111000426.2735007-1-jeremy.linton@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,jeremy.linton@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 7CagmmQTafD2U13D4teqqSBix1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704931471411100009 Content-Type: text/plain; charset="utf-8" There are a number of I2C interfaces on the rpi, some of which are available on the GPIO connector and are utilized by various HATs. In particular we are interested in the RTCs (usually based on DS1037) which are attached to GPIO2/3 which can be pin muxed to I2C #1. This commit adds a basic runtime utilizable I2C Dxe in preparation for a platform driver which can bind it to the ds1307 RTC driver. Signed-off-by: Jeremy Linton --- .../Broadcom/Drivers/I2cDxe/ComponentName.c | 181 ++++++++++ .../Broadcom/Drivers/I2cDxe/DriverBinding.c | 237 ++++++++++++++ Silicon/Broadcom/Drivers/I2cDxe/I2cDxe.c | 309 ++++++++++++++++++ Silicon/Broadcom/Drivers/I2cDxe/I2cDxe.h | 55 ++++ Silicon/Broadcom/Drivers/I2cDxe/I2cDxe.inf | 56 ++++ 5 files changed, 838 insertions(+) create mode 100644 Silicon/Broadcom/Drivers/I2cDxe/ComponentName.c create mode 100644 Silicon/Broadcom/Drivers/I2cDxe/DriverBinding.c create mode 100644 Silicon/Broadcom/Drivers/I2cDxe/I2cDxe.c create mode 100644 Silicon/Broadcom/Drivers/I2cDxe/I2cDxe.h create mode 100644 Silicon/Broadcom/Drivers/I2cDxe/I2cDxe.inf diff --git a/Silicon/Broadcom/Drivers/I2cDxe/ComponentName.c b/Silicon/Broa= dcom/Drivers/I2cDxe/ComponentName.c new file mode 100644 index 0000000000..75b4fdb3fe --- /dev/null +++ b/Silicon/Broadcom/Drivers/I2cDxe/ComponentName.c @@ -0,0 +1,181 @@ +/** @file + + Copyright 2018-2019 NXP + Sourced and reworked from edk2/NXP I2C stack + Copyright 2022 Arm, Jeremy Linton + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "I2cDxe.h" + +STATIC EFI_UNICODE_STRING_TABLE mBcmI2cDriverNameTable[] =3D { + { + "en", + (CHAR16 *)L"Bcm I2C Driver" + }, + { } +}; + +STATIC EFI_UNICODE_STRING_TABLE mBcmI2cControllerNameTable[] =3D { + { + "en", + (CHAR16 *)L"Bcm I2C Controller" + }, + { } +}; + +/** + Retrieves a Unicode string that is the user readable name of the driver. + + This function retrieves the user readable name of a driver in the form o= f a + Unicode string. If the driver specified by This has a user readable name= in + the language specified by Language, then a pointer to the driver name is + returned in DriverName, and EFI_SUCCESS is returned. If the driver speci= fied + by This does not support the language specified by Language, + then EFI_UNSUPPORTED is returned. + + @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTO= COL or + EFI_COMPONENT_NAME_PROTOCOL instance. + + @param Language[in] A pointer to a Null-terminated ASCII string + array indicating the language. This is the + language of the driver name that the calle= r is + requesting, and it must match one of the + languages specified in SupportedLanguages.= The + number of languages supported by a driver = is up + to the driver writer. Language is specified + in RFC 4646 or ISO 639-2 language code for= mat. + + @param DriverName[out] A pointer to the Unicode string to return. + This Unicode string is the name of the + driver specified by This in the language + specified by Language. + + @retval EFI_SUCCESS The Unicode string for the Driver specifie= d by + This and the language specified by Languag= e was + returned in DriverName. + + @retval EFI_INVALID_PARAMETER Language is NULL. + + @retval EFI_INVALID_PARAMETER DriverName is NULL. + + @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort + the language specified by Language. + +**/ +STATIC +EFI_STATUS +EFIAPI +BcmI2cGetDriverName ( + IN EFI_COMPONENT_NAME2_PROTOCOL *This, + IN CHAR8 *Language, + OUT CHAR16 **DriverName + ) +{ + return LookupUnicodeString2 (Language, + This->SupportedLanguages, + mBcmI2cDriverNameTable, + DriverName, + FALSE); +} + +/** + Retrieves a Unicode string that is the user readable name of the control= ler + that is being managed by a driver. + + This function retrieves the user readable name of the controller specifi= ed by + ControllerHandle and ChildHandle in the form of a Unicode string. If the + driver specified by This has a user readable name in the language specif= ied by + Language, then a pointer to the controller name is returned in Controlle= rName, + and EFI_SUCCESS is returned. If the driver specified by This is not cur= rently + managing the controller specified by ControllerHandle and ChildHandle, + then EFI_UNSUPPORTED is returned. If the driver specified by This does = not + support the language specified by Language, then EFI_UNSUPPORTED is retu= rned. + + @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTO= COL or + EFI_COMPONENT_NAME_PROTOCOL instance. + + @param ControllerHandle[in] The handle of a controller that the driver + specified by This is managing. This handle + specifies the controller whose name is to = be + returned. + + @param ChildHandle[in] The handle of the child controller to retr= ieve + the name of. This is an optional paramete= r that + may be NULL. It will be NULL for device + drivers. It will also be NULL for a bus d= rivers + that wish to retrieve the name of the bus + controller. It will not be NULL for a bus + driver that wishes to retrieve the name of= a + child controller. + + @param Language[in] A pointer to a Null-terminated ASCII string + array indicating the language. This is the + language of the driver name that the calle= r is + requesting, and it must match one of the + languages specified in SupportedLanguages.= The + number of languages supported by a driver = is up + to the driver writer. Language is specifie= d in + RFC 4646 or ISO 639-2 language code format. + + @param ControllerName[out] A pointer to the Unicode string to return. + This Unicode string is the name of the + controller specified by ControllerHandle a= nd + ChildHandle in the language specified by + Language from the point of view of the dri= ver + specified by This. + + @retval EFI_SUCCESS The Unicode string for the user readable n= ame in + the language specified by Language for the + driver specified by This was returned in + DriverName. + + @retval EFI_INVALID_PARAMETER ControllerHandle is NULL. + + @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a va= lid + EFI_HANDLE. + + @retval EFI_INVALID_PARAMETER Language is NULL. + + @retval EFI_INVALID_PARAMETER ControllerName is NULL. + + @retval EFI_UNSUPPORTED The driver specified by This is not curren= tly + managing the controller specified by + ControllerHandle and ChildHandle. + + @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort + the language specified by Language. + +**/ +STATIC +EFI_STATUS +EFIAPI +BcmI2cGetControllerName ( + IN EFI_COMPONENT_NAME2_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_HANDLE ChildHandle O= PTIONAL, + IN CHAR8 *Language, + OUT CHAR16 **ControllerName + ) +{ + if (ChildHandle !=3D NULL) { + return EFI_UNSUPPORTED; + } + + return LookupUnicodeString2 (Language, + This->SupportedLanguages, + mBcmI2cControllerNameTable, + ControllerName, + FALSE); +} + +// +// EFI Component Name 2 Protocol +// +EFI_COMPONENT_NAME2_PROTOCOL gBcmI2cDriverComponentName2 =3D { + BcmI2cGetDriverName, + BcmI2cGetControllerName, + "en" +}; diff --git a/Silicon/Broadcom/Drivers/I2cDxe/DriverBinding.c b/Silicon/Broa= dcom/Drivers/I2cDxe/DriverBinding.c new file mode 100644 index 0000000000..a6cd7987eb --- /dev/null +++ b/Silicon/Broadcom/Drivers/I2cDxe/DriverBinding.c @@ -0,0 +1,237 @@ +/** @file + + Copyright 2018-2019 NXP + Sourced and reworked from edk2/NXP I2C stack + Copyright 2022 Arm, Jeremy Linton + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include + +#include + +#include "I2cDxe.h" + +/** + Tests to see if this driver supports a given controller. + + @param This[in] A pointer to the EFI_DRIVER_BINDING_PRO= TOCOL + instance. + @param ControllerHandle[in] The handle of the controller to test. + @param RemainingDevicePath[in] The remaining device path. + (Ignored - this is not a bus driver.) + + @retval EFI_SUCCESS The driver supports this controller. + @retval EFI_ALREADY_STARTED The device specified by ControllerHandl= e is + already being managed by the driver spe= cified + by This. + @retval EFI_UNSUPPORTED The device specified by ControllerHandl= e is + not supported by the driver specified b= y This. + +**/ +EFI_STATUS +EFIAPI +BcmI2cDriverBindingSupported ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath + ) +{ + NON_DISCOVERABLE_DEVICE *Dev; + EFI_STATUS Status; + + // + // Connect to the non-discoverable device + // + Status =3D gBS->OpenProtocol (ControllerHandle, + &gEdkiiNonDiscoverableDeviceProtocolGuid, + (VOID **) &Dev, + This->DriverBindingHandle, + ControllerHandle, + EFI_OPEN_PROTOCOL_BY_DRIVER); + if (EFI_ERROR (Status)) { + return Status; + } + + if (CompareGuid (Dev->Type, &gBcmNonDiscoverableI2cMasterGuid)) { + Status =3D EFI_SUCCESS; + } else { + Status =3D EFI_UNSUPPORTED; + } + + // + // Clean up. + // + gBS->CloseProtocol (ControllerHandle, + &gEdkiiNonDiscoverableDeviceProtocolGuid, + This->DriverBindingHandle, + ControllerHandle); + + return Status; +} + + +/** + Starts a device controller or a bus controller. + + @param[in] This A pointer to the EFI_DRIVER_BINDING_PRO= TOCOL + instance. + @param[in] ControllerHandle The handle of the device to start. This + handle must support a protocol interfac= e that + supplies an I/O abstraction to the driv= er. + @param[in] RemainingDevicePath The remaining portion of the device pat= h. + (Ignored - this is not a bus driver.) + + @retval EFI_SUCCESS The device was started. + @retval EFI_DEVICE_ERROR The device could not be started due to a + device error. + @retval EFI_OUT_OF_RESOURCES The request could not be completed due = to a + lack of resources. + +**/ +EFI_STATUS +EFIAPI +BcmI2cDriverBindingStart ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL + ) +{ + return BcmI2cInit (This->DriverBindingHandle, ControllerHandle); +} + + +/** + Stops a device controller or a bus controller. + + @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOC= OL + instance. + @param[in] ControllerHandle A handle to the device being stopped. The = handle + must support a bus specific I/O protocol f= or the + driver to use to stop the device. + @param[in] NumberOfChildren The number of child device handles in + ChildHandleBuffer. + @param[in] ChildHandleBuffer An array of child handles to be freed. May= be + NULL if NumberOfChildren is 0. + + @retval EFI_SUCCESS The device was stopped. + @retval EFI_DEVICE_ERROR The device could not be stopped due to a d= evice + error. + +**/ +EFI_STATUS +EFIAPI +BcmI2cDriverBindingStop ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN UINTN NumberOfChildren, + IN EFI_HANDLE *ChildHandleBuffer OPTIONAL + ) +{ + return BcmI2cRelease (This->DriverBindingHandle, ControllerHandle); +} + + +STATIC EFI_DRIVER_BINDING_PROTOCOL gBcmI2cDriverBinding =3D { + BcmI2cDriverBindingSupported, + BcmI2cDriverBindingStart, + BcmI2cDriverBindingStop, + 0xa, + NULL, + NULL +}; + + +/** + The entry point of I2c UEFI Driver. + + @param ImageHandle The image handle of the UEFI Driver. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The Driver or UEFI Driver exited norm= ally. + @retval EFI_INCOMPATIBLE_VERSION _gUefiDriverRevision is greater than + SystemTable->Hdr.Revision. + +**/ +EFI_STATUS +EFIAPI +I2cDxeEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + + // + // Add the driver to the list of drivers + // + Status =3D EfiLibInstallDriverBindingComponentName2 ( + ImageHandle, SystemTable, &gBcmI2cDriverBinding, ImageHandle, + NULL, &gBcmI2cDriverComponentName2); + ASSERT_EFI_ERROR (Status); + + return EFI_SUCCESS; +} + + +/** + Unload function for the I2c UEFI Driver. + + @param ImageHandle[in] The allocated handle for the EFI image + + @retval EFI_SUCCESS The driver was unloaded successfully + @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle. + +**/ +EFI_STATUS +EFIAPI +I2cDxeUnload ( + IN EFI_HANDLE ImageHandle + ) +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN HandleCount; + UINTN Index; + + // + // Retrieve all USB I/O handles in the handle database + // + Status =3D gBS->LocateHandleBuffer (ByProtocol, + &gEdkiiNonDiscoverableDeviceProtocolGu= id, + NULL, + &HandleCount, + &HandleBuffer); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Disconnect the driver from the handles in the handle database + // + for (Index =3D 0; Index < HandleCount; Index++) { + Status =3D gBS->DisconnectController (HandleBuffer[Index], + gImageHandle, + NULL); + } + + // + // Free the handle array + // + gBS->FreePool (HandleBuffer); + + // + // Uninstall protocols installed by the driver in its entrypoint + // + Status =3D gBS->UninstallMultipleProtocolInterfaces (ImageHandle, + &gEfiDriverBindingProtocolGuid, + &gBcmI2cDriverBinding, + NULL + ); + + return EFI_SUCCESS; +} diff --git a/Silicon/Broadcom/Drivers/I2cDxe/I2cDxe.c b/Silicon/Broadcom/Dr= ivers/I2cDxe/I2cDxe.c new file mode 100644 index 0000000000..8aedaa1f58 --- /dev/null +++ b/Silicon/Broadcom/Drivers/I2cDxe/I2cDxe.c @@ -0,0 +1,309 @@ +/** I2cDxe.c + I2c driver APIs for read, write, initialize, set speed and reset + + Sourced and reworked from edk2/NXP I2C stack + Copyright 2022 Arm, Jeremy Linton + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "I2cDxe.h" + +STATIC CONST EFI_I2C_CONTROLLER_CAPABILITIES mI2cControllerCapabilities = =3D { + 0, + 0, + 0, + 0 +}; + +/** + Function to set i2c bus frequency + + @param This Pointer to I2c master protocol + @param BusClockHertz value to be set + + @retval EFI_SUCCESS Operation successfull +**/ +STATIC +EFI_STATUS +EFIAPI +SetBusFrequency ( + IN CONST EFI_I2C_MASTER_PROTOCOL *This, + IN OUT UINTN *BusClockHertz + ) +{ + UINTN I2cBase; + UINT64 I2cClock; + BCM_I2C_MASTER *I2c; + + I2c =3D BCM_I2C_FROM_THIS (This); + + I2cBase =3D I2c->ControllerBase; + + // depend on ConfigDxe? On the NXP this only sets the clock and resets t= he bus + // Here we are hardcoding the I2C clock until we have a need not to. + I2cClock =3D 50000; + + return EFI_SUCCESS; +} + +/** + Function to reset I2c Controller + + @param This Pointer to I2c master protocol + + @return EFI_SUCCESS Operation successfull +**/ +STATIC +EFI_STATUS +EFIAPI +Reset ( + IN CONST EFI_I2C_MASTER_PROTOCOL *This + ) +{ + return EFI_SUCCESS; +} + +STATIC +void +StatusPoll( + UINTN I2cBase, + UINTN Mask + ) +{ + UINTN Retry; + + Retry =3D 0; + while ((MmioRead32 (I2cBase + BCM2835_I2C_S) & Mask) !=3D Mask) { + Retry++; + } +} + + + +STATIC +EFI_STATUS +SingleTransfer( + UINTN I2cBase, + UINTN SlaveAddress, + EFI_I2C_OPERATION *Operation +) +{ + EFI_STATUS Status; + UINTN Index; + UINTN FifoState; + + // clear all the status + MmioWrite32 (I2cBase + BCM2835_I2C_C, 0x10 ); // fifo clear + MmioWrite32 (I2cBase + BCM2835_I2C_S, 0x302); + + // don't support 10 bit addr for now. (see 3.3 in 2711 manual) + // the problem with arm is that you never know if there are undocumented + // acces restrictions (aka 8 bit reg, but it needs to be read with a 32-= bit instr) + MmioWrite8 (I2cBase + BCM2835_I2C_A, (UINT8)SlaveAddress); + MmioWrite32 (I2cBase + BCM2835_I2C_DLEN, Operation->LengthInBytes ); + + if (Operation->Flags & I2C_FLAG_READ) { + FifoState =3D 0x20; // fifo has data + MmioWrite32 (I2cBase + BCM2835_I2C_C, 0x8081 ); // Enable, start, fifo= clear, read + } else { + FifoState =3D 0x10; // fifo can accept data + MmioWrite32 (I2cBase + BCM2835_I2C_C, 0x8080 ); // Enable, start, fifo= clear, write + } + + for (Index =3D 0; Index < Operation->LengthInBytes; Index++) { + + StatusPoll (I2cBase, FifoState); + + if (Operation->Flags & I2C_FLAG_READ) { + Operation->Buffer[Index] =3D MmioRead8 (I2cBase + BCM2835_I2C_FIFO); + } else { + MmioWrite8 (I2cBase + BCM2835_I2C_FIFO, Operation->Buffer[Index]); + } + } + + StatusPoll (I2cBase, 0x02); + + Status =3D 0; + return Status; +} + +volatile UINTN forcewrite; + +STATIC +EFI_STATUS +EFIAPI +StartRequest ( + IN CONST EFI_I2C_MASTER_PROTOCOL *This, + IN UINTN SlaveAddress, + IN EFI_I2C_REQUEST_PACKET *RequestPacket, + IN EFI_EVENT Event OPTIONAL, + OUT EFI_STATUS *I2cStatus OPTIONAL + ) +{ + BCM_I2C_MASTER *I2c; + UINTN I2cBase; + EFI_STATUS Status; + EFI_TPL Tpl; + BOOLEAN AtRuntime; + UINTN Index; + + AtRuntime =3D EfiAtRuntime (); + if (!AtRuntime) { + Tpl =3D gBS->RaiseTPL (TPL_HIGH_LEVEL); + } + + I2c =3D BCM_I2C_FROM_THIS (This); + + I2cBase =3D I2c->ControllerBase; + + for (Index =3D 0; Index < RequestPacket->OperationCount; Index++ ) { + + Status =3D SingleTransfer (I2cBase, SlaveAddress, &RequestPacket->Ope= ration[Index]); + + if (EFI_ERROR (Status)) { + break; + } + } + + if (!AtRuntime) { + gBS->RestoreTPL (Tpl); + } + + return Status; +} + +STATIC +VOID +EFIAPI +BcmI2cVirtualAddressChangeEvent ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + BCM_I2C_MASTER *I2c; + + I2c =3D (BCM_I2C_MASTER *)Context; + + EfiConvertPointer (0x0, (VOID**)&I2c->ControllerBase); + EfiConvertPointer (0x0, (VOID**)&I2c); +} + + +EFI_STATUS +BcmI2cInit ( + IN EFI_HANDLE DriverBindingHandle, + IN EFI_HANDLE ControllerHandle + ) +{ + EFI_STATUS RetVal; + NON_DISCOVERABLE_DEVICE *Dev; + BCM_I2C_MASTER *I2c; + EFI_EVENT VirtualAddressChangeEvent; + + RetVal =3D gBS->OpenProtocol (ControllerHandle, + &gEdkiiNonDiscoverableDeviceProtocolGuid, + (VOID **)&Dev, DriverBindingHandle, + ControllerHandle, EFI_OPEN_PROTOCOL_BY_DRIVE= R); + if (EFI_ERROR (RetVal)) { + return RetVal; + } + + I2c =3D AllocateRuntimeZeroPool (sizeof (BCM_I2C_MASTER)); + + I2c->Signature =3D BCM_I2C_SIGNATURE; + I2c->I2cMaster.SetBusFrequency =3D SetBusFrequency; + I2c->I2cMaster.Reset =3D Reset; + I2c->I2cMaster.StartRequest =3D StartRequest; + I2c->I2cMaster.I2cControllerCapabilities =3D &mI2cControllerCapabilitie= s; + I2c->Dev =3D Dev; + + CopyGuid (&I2c->DevicePath.Vendor.Guid, &gEfiCallerIdGuid); + I2c->DevicePath.MmioBase =3D I2c->Dev->Resources[0].AddrRangeMin; + I2c->ControllerBase =3D I2c->Dev->Resources[0].AddrRangeMin; + SetDevicePathNodeLength (&I2c->DevicePath.Vendor, + sizeof (I2c->DevicePath) - sizeof (I2c->DevicePath.End)); + SetDevicePathEndNode (&I2c->DevicePath.End); + + RetVal =3D gBS->InstallMultipleProtocolInterfaces (&ControllerHandle, + &gEfiI2cMasterProtocolGuid, (VOID**)&I2c->I2cMaster, + &gEfiDevicePathProtocolGuid, &I2c->DevicePath, + NULL); + + if (EFI_ERROR (RetVal)) { + FreePool (I2c); + gBS->CloseProtocol (ControllerHandle, + &gEdkiiNonDiscoverableDeviceProtocolGuid, + DriverBindingHandle, + ControllerHandle); + } else { + RetVal =3D gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_NOTIFY, + BcmI2cVirtualAddressChangeEvent, + (VOID *)I2c, + &gEfiEventVirtualAddressChangeGuid, + &VirtualAddressChangeEvent + ); + + ASSERT_EFI_ERROR (RetVal); + + } + + return RetVal; +} + +EFI_STATUS +BcmI2cRelease ( + IN EFI_HANDLE DriverBindingHandle, + IN EFI_HANDLE ControllerHandle + ) +{ + EFI_I2C_MASTER_PROTOCOL *I2cMaster; + EFI_STATUS RetVal; + BCM_I2C_MASTER *I2c; + + RetVal =3D gBS->HandleProtocol (ControllerHandle, + &gEfiI2cMasterProtocolGuid, + (VOID **)&I2cMaster); + ASSERT_EFI_ERROR (RetVal); + if (EFI_ERROR (RetVal)) { + return RetVal; + } + + I2c =3D BCM_I2C_FROM_THIS (I2cMaster); + + RetVal =3D gBS->UninstallMultipleProtocolInterfaces (ControllerHandle, + &gEfiI2cMasterProtocolGuid, I2cMaster, + &gEfiDevicePathProtocolGuid, &I2c->DevicePath, + NULL); + if (EFI_ERROR (RetVal)) { + return RetVal; + } + + RetVal =3D gBS->CloseProtocol (ControllerHandle, + &gEdkiiNonDiscoverableDeviceProtocolGuid, + DriverBindingHandle, + ControllerHandle); + ASSERT_EFI_ERROR (RetVal); + if (EFI_ERROR (RetVal)) { + return RetVal; + } + + gBS->FreePool (I2c); + + return EFI_SUCCESS; +} diff --git a/Silicon/Broadcom/Drivers/I2cDxe/I2cDxe.h b/Silicon/Broadcom/Dr= ivers/I2cDxe/I2cDxe.h new file mode 100644 index 0000000000..e9ddc0e7bd --- /dev/null +++ b/Silicon/Broadcom/Drivers/I2cDxe/I2cDxe.h @@ -0,0 +1,55 @@ +/** I2cDxe.h + Header defining the constant, base address amd function for I2C controll= er + + Copyright 2017-2020 NXP + Sourced and reworked from edk2/NXP I2C stack + Copyright 2022 Arm, Jeremy Linton + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef I2C_DXE_H_ +#define I2C_DXE_H_ + +#include +#include + +#include +#include + +#define BCM_I2C_SIGNATURE SIGNATURE_32 ('B', 'I', '2', 'C') +#define BCM_I2C_FROM_THIS(a) CR ((a), BCM_I2C_MASTER, \ + I2cMaster, BCM_I2C_SIGNATURE) + +extern EFI_COMPONENT_NAME2_PROTOCOL gBcmI2cDriverComponentName2; + +#pragma pack(1) +typedef struct { + VENDOR_DEVICE_PATH Vendor; + UINT64 MmioBase; + EFI_DEVICE_PATH_PROTOCOL End; +} BCM_I2C_DEVICE_PATH; +#pragma pack() + +typedef struct { + UINT32 Signature; + EFI_I2C_MASTER_PROTOCOL I2cMaster; + BCM_I2C_DEVICE_PATH DevicePath; + NON_DISCOVERABLE_DEVICE *Dev; + UINTN ControllerBase; +} BCM_I2C_MASTER; + +EFI_STATUS +BcmI2cInit ( + IN EFI_HANDLE DriverBindingHandle, + IN EFI_HANDLE ControllerHandle + ); + +EFI_STATUS +BcmI2cRelease ( + IN EFI_HANDLE DriverBindingHandle, + IN EFI_HANDLE ControllerHandle + ); + +#endif //I2C_DXE_H_ diff --git a/Silicon/Broadcom/Drivers/I2cDxe/I2cDxe.inf b/Silicon/Broadcom/= Drivers/I2cDxe/I2cDxe.inf new file mode 100644 index 0000000000..d8b6130616 --- /dev/null +++ b/Silicon/Broadcom/Drivers/I2cDxe/I2cDxe.inf @@ -0,0 +1,56 @@ +# @file +# +# Component description file for I2c driver +# +# Copyright (c) 2015, Freescale Semiconductor, Inc. All rights reserved. +# Copyright 2017-2020 NXP +# Sourced and reworked from edk2/NXP I2C stack +# Copyright 2022 Arm, Jeremy Linton +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D I2cDxe + FILE_GUID =3D 09e767d9-9c1e-405d-86c3-fb7ce355f948 + MODULE_TYPE =3D DXE_RUNTIME_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D I2cDxeEntryPoint + UNLOAD =3D I2cDxeUnload + +[Sources.common] + ComponentName.c + DriverBinding.c + I2cDxe.c + +[LibraryClasses] + ArmLib + BaseMemoryLib + DevicePathLib + IoLib + MemoryAllocationLib + PcdLib + TimerLib + UefiBootServicesTableLib + UefiDriverEntryPoint + UefiLib + UefiRuntimeLib + +[Guids] + gBcmNonDiscoverableI2cMasterGuid + gEfiEventVirtualAddressChangeGuid + +[Packages] + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Platform/RaspberryPi/RaspberryPi.dec + Silicon/Broadcom/Bcm283x/Bcm283x.dec + +[Protocols] + gEdkiiNonDiscoverableDeviceProtocolGuid ## TO_START + gEfiI2cMasterProtocolGuid ## BY_START + +[Depex] + TRUE --=20 2.43.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113559): https://edk2.groups.io/g/devel/message/113559 Mute This Topic: https://groups.io/mt/103653098/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 06:07:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+113560+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113560+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1704931470; cv=none; d=zohomail.com; s=zohoarc; b=LFSivt2QqxOAWKpRKXwiGe+fPalm39XZRiEXvHwi09b00EDRdsz3lxUNc0e0nXZ+gJ9Z826p8TsTueYqizgUUn1xJeH9ZyF8gwTwks4Qc85inEHEefs1u5hmcARBw4TA+W93CFobTqe6FjsP3ejbyO2ENEWNglksceFAWHnqEss= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704931470; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=JY8HfS1TQIdca/WSuAvjwq+2dnkFkt1gMabXrzRqyRg=; b=A8V+IZTDiC0U2xBK7DGCneVzQ/RsoGyoI7Cf7ieKkhHO5H/ZkbxqYtI6aidFzYmLSwmYtWsmHHVLE0o4Zces08RTnaBfClaO9mRuo731QjOyhRn73JO0B5T84kaNoSeNoIBFS6Z38P+bEkelKpKsYGfUdADaoxZMTvL3SeX9WaU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113560+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1704931470755657.9302620111338; Wed, 10 Jan 2024 16:04:30 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=BKtvf8YpzK5URM+MME5D1l/Vppn8oyn3LOht4rDWNl0=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1704931470; v=1; b=quEH3soEl3rulYp/RnnAorm27753E+HtEAgPuSZv3pE7zds4uZSr6f+jG+wzorw12G0jr9xw CfITHjvQQiaoLw+Ctu2R0MFGyhnecv6J/faPIxSb843rgewLgNeWyM9NPQy5ACP8xK+K6NJz6F+ wXgLOZpeRBrLvXQjgQgHDq8A= X-Received: by 127.0.0.2 with SMTP id t5eWYY1788612xLevcBBUAyc; Wed, 10 Jan 2024 16:04:30 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.9368.1704931469364233539 for ; Wed, 10 Jan 2024 16:04:29 -0800 X-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 0A4DD12FC; Wed, 10 Jan 2024 16:05:15 -0800 (PST) X-Received: from u200865.usa.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E0C063F5A1; Wed, 10 Jan 2024 16:04:28 -0800 (PST) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, quic_llindhol@quicinc.com, Jeremy Linton Subject: [edk2-devel] [RFC 3/6] Platform/RasberryPi: Create I2C driver bound to RTC Date: Wed, 10 Jan 2024 18:04:23 -0600 Message-ID: <20240111000426.2735007-4-jeremy.linton@arm.com> In-Reply-To: <20240111000426.2735007-1-jeremy.linton@arm.com> References: <20240111000426.2735007-1-jeremy.linton@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,jeremy.linton@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: K0InabrAKkNxMUcxaxwgSFTix1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704931471366100005 Content-Type: text/plain; charset="utf-8" Now that we have a generic Bcm I2C driver lets instantiate one against a possible RTC hat on the pi4. Signed-off-by: Jeremy Linton --- .../Drivers/BcmI2CPlatform/BcmI2CPlatform.c | 127 ++++++++++++++++++ .../Drivers/BcmI2CPlatform/BcmI2CPlatform.inf | 54 ++++++++ 2 files changed, 181 insertions(+) create mode 100644 Platform/RaspberryPi/Drivers/BcmI2CPlatform/BcmI2CPlatf= orm.c create mode 100644 Platform/RaspberryPi/Drivers/BcmI2CPlatform/BcmI2CPlatf= orm.inf diff --git a/Platform/RaspberryPi/Drivers/BcmI2CPlatform/BcmI2CPlatform.c b= /Platform/RaspberryPi/Drivers/BcmI2CPlatform/BcmI2CPlatform.c new file mode 100644 index 0000000000..11f927b848 --- /dev/null +++ b/Platform/RaspberryPi/Drivers/BcmI2CPlatform/BcmI2CPlatform.c @@ -0,0 +1,127 @@ +/** @file + Brcm/Rpi I2C DXE platform driver. + + Copyright 2018-2020 NXP + Sourced and reworked from edk2/NXP I2C stack + Copyright 2022 Arm, Jeremy Linton + + SPDX-License-Identifier: BSD-2-Clause-Patent + + This thing binds a I2C driver to a RTC.. + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +typedef struct { + EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR StartDesc; + UINT8 EndDesc; +} ADDRESS_SPACE_DESCRIPTOR; + +#define BCM_I2C_NUM_CONTROLLERS 1 //actually 6 on the bcm2711, hack for now + +STATIC ADDRESS_SPACE_DESCRIPTOR mI2cDesc[BCM_I2C_NUM_CONTROLLERS]; + +STATIC +EFI_STATUS +RegisterDevice ( + IN EFI_GUID *TypeGuid, + IN ADDRESS_SPACE_DESCRIPTOR *Desc, + OUT EFI_HANDLE *Handle + ) +{ + NON_DISCOVERABLE_DEVICE *Device; + EFI_STATUS Status; + + Device =3D (NON_DISCOVERABLE_DEVICE *)AllocateZeroPool (sizeof (*Device)= ); + if (Device =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; + } + + Device->Type =3D TypeGuid; + Device->DmaType =3D NonDiscoverableDeviceDmaTypeNonCoherent; + Device->Resources =3D (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)Desc; + + Status =3D gBS->InstallMultipleProtocolInterfaces (Handle, + &gEdkiiNonDiscoverableDeviceProtocolGuid, Device, + NULL); + if (EFI_ERROR (Status)) { + goto FreeDevice; + } + return EFI_SUCCESS; + +FreeDevice: + FreePool (Device); + + return Status; +} + +VOID +PopulateI2cInformation ( + IN VOID + ) +{ + UINT32 Index; + + for (Index =3D 0; Index < ARRAY_SIZE (mI2cDesc); Index++) { + mI2cDesc[Index].StartDesc.Desc =3D ACPI_ADDRESS_SPACE_DESCRIPTOR; + mI2cDesc[Index].StartDesc.Len =3D sizeof (EFI_ACPI_ADDRESS_SPACE_DESCR= IPTOR) - 3; + mI2cDesc[Index].StartDesc.ResType =3D ACPI_ADDRESS_SPACE_TYPE_MEM; + mI2cDesc[Index].StartDesc.GenFlag =3D 0; + mI2cDesc[Index].StartDesc.SpecificFlag =3D 0; + mI2cDesc[Index].StartDesc.AddrSpaceGranularity =3D 32; + mI2cDesc[Index].StartDesc.AddrRangeMin =3D BCM2836_I2C1_BASE_ADDRESS; + mI2cDesc[Index].StartDesc.AddrRangeMax =3D mI2cDesc[Index].StartDesc.A= ddrRangeMin + BCM2836_I2C1_LENGTH; + mI2cDesc[Index].StartDesc.AddrTranslationOffset =3D 0; + mI2cDesc[Index].StartDesc.AddrLen =3D BCM2836_I2C1_LENGTH; + + mI2cDesc[Index].EndDesc =3D ACPI_END_TAG_DESCRIPTOR; + } +} + +EFI_STATUS +EFIAPI +BcmI2CPlatformDxeEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + EFI_HANDLE Handle; + + Handle =3D NULL; + + PopulateI2cInformation (); + + if (PcdGet32 (PcdHwRtc)) + { + DEBUG ((DEBUG_ERROR, "RTC I2C enable\n")); + // If we don't register this, the second rtc won't get enabled + // leaving the emulator in place. + Status =3D RegisterDevice (&gBcmNonDiscoverableI2cMasterGuid, + &mI2cDesc[0], &Handle); + ASSERT_EFI_ERROR (Status); + + // + // Install the DS1307 I2C Master protocol on this handle so the RTC dr= iver + // can identify it as the I2C master it can invoke directly. + // + Status =3D gBS->InstallProtocolInterface (&Handle, + &gDs1307RealTimeClockLibI2cMasterProtocolGuid, + EFI_NATIVE_INTERFACE, NULL); + ASSERT_EFI_ERROR (Status); + } else { + DEBUG ((DEBUG_ERROR, "RTC I2C disabled\n")); + } + + return EFI_SUCCESS; +} diff --git a/Platform/RaspberryPi/Drivers/BcmI2CPlatform/BcmI2CPlatform.inf= b/Platform/RaspberryPi/Drivers/BcmI2CPlatform/BcmI2CPlatform.inf new file mode 100644 index 0000000000..aa5c1b51b2 --- /dev/null +++ b/Platform/RaspberryPi/Drivers/BcmI2CPlatform/BcmI2CPlatform.inf @@ -0,0 +1,54 @@ +## @file +# +# Component description file for Bcm/Rpi I2C driver. +# +# Copyright 2018-2020 NXP +# Sourced and reworked from edk2/NXP I2C stack +# Copyright 2022 Arm, Jeremy Linton +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D BcmI2CPlatformDxe + FILE_GUID =3D 1a23fe23-39bc-4bee-859d-ecb5bbb60484 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D BcmI2CPlatformDxeEntryPoint + +[Sources] + BcmI2CPlatform.c + +[Packages] + ArmPkg/ArmPkg.dec + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.dec + Silicon/Broadcom/Bcm283x/Bcm283x.dec + Platform/RaspberryPi/RaspberryPi.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + DebugLib + MemoryAllocationLib + PcdLib + UefiBootServicesTableLib + UefiDriverEntryPoint + UefiLib + +[Guids] + gBcmNonDiscoverableI2cMasterGuid + +[Protocols] + gEdkiiNonDiscoverableDeviceProtocolGuid ## PRODUCES + gDs1307RealTimeClockLibI2cMasterProtocolGuid ## PRODUCES + +[Pcd] + gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress + gRaspberryPiTokenSpaceGuid.PcdHwRtc + +[Depex] + gRaspberryPiConfigAppliedProtocolGuid --=20 2.43.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113560): https://edk2.groups.io/g/devel/message/113560 Mute This Topic: https://groups.io/mt/103653099/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 06:07:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+113561+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113561+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1704931471; cv=none; d=zohomail.com; s=zohoarc; b=LI7ZBNxMf9YPeoMCyaNKzYaRUSIjSIoZCRdekXLwXxSgi3ShFZPw3cyCjGblY4uCYDWTtEv6Zq/JjZ5V4P/jf1PZFED74WnPkpebokSlPnCCKIDmQ21xFuxjkHg74kXPWxX7/ZrSBlWRwxHJFnLFao/xkMOC9k8Nz2xDWTrs7tM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704931471; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=X7FHRpFLvJxZaTz2gqj6wPf/LQg1kDc/k5lXuabT08U=; b=DGwZpfUPCiqQ/8Gzerlza6+1k3UOp2P9O1h2IkSwZEz5wkRXxIAdxWoPy1WprzUu6T6DlKgbcXj1auxi6zmlr9wYCdu1B43Di5fbBZizfYRC2FY2qcCCWKcrX53y93axZ75JV6M00mnJfampRCrGAPGJiddzgnCeKy6X8wF8poA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113561+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1704931471157166.27230802412362; Wed, 10 Jan 2024 16:04:31 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=wH8OJD9S+/fLqW07ACIKua+5njKwRDXl3bbIR+Jbl0A=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1704931470; v=1; b=fCzX5UECzPJ2lIv/n63aIyHypstYsqKn/wPmiTOUI04GKo/jxtpTSiVqEz7Z/aXFSRScVu6T iD9b0wmhYNQeMazcOrEylxQiXN80Ge2TFgt3Q9py0CERD1V6/UvG0T6gBdxo7TgKzujAkCkE93v JRxW1iKOjswpTis2MR2Q4tf4= X-Received: by 127.0.0.2 with SMTP id fY9RYY1788612xAyMYVWpIFB; Wed, 10 Jan 2024 16:04:30 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.9467.1704931469122767513 for ; Wed, 10 Jan 2024 16:04:29 -0800 X-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 40AC21424; Wed, 10 Jan 2024 16:05:15 -0800 (PST) X-Received: from u200865.usa.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 290353F5A1; Wed, 10 Jan 2024 16:04:29 -0800 (PST) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, quic_llindhol@quicinc.com, Jeremy Linton Subject: [edk2-devel] [RFC 4/6] Silicon/Maxim: Fix runtime issues Date: Wed, 10 Jan 2024 18:04:24 -0600 Message-ID: <20240111000426.2735007-5-jeremy.linton@arm.com> In-Reply-To: <20240111000426.2735007-1-jeremy.linton@arm.com> References: <20240111000426.2735007-1-jeremy.linton@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,jeremy.linton@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: PzZ0TQAfnLrkzOvgdXGoCjeax1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704931471340100001 Content-Type: text/plain; charset="utf-8" The Ds1307 is ideally a runtime RTC but its use of the I2C protocol might make it better if it updated the I2C_MASTER_PROTOCOL callbacks it uses, although... hmmm maybe think about this a bit more. Signed-off-by: Jeremy Linton --- .../Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.c | 36 +++++++++++++++++-- .../Library/Ds1307RtcLib/Ds1307RtcLib.inf | 7 +++- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.c b/Silicon/Ma= xim/Library/Ds1307RtcLib/Ds1307RtcLib.c index 444e011248..ede890448f 100644 --- a/Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.c +++ b/Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.c @@ -18,14 +18,40 @@ #include #include #include +#include #include =20 #include "Ds1307Rtc.h" =20 STATIC VOID *mDriverEventRegistration; STATIC EFI_HANDLE mI2cMasterHandle; +STATIC EFI_EVENT mRtcVirtualAddrChangeEvent; STATIC EFI_I2C_MASTER_PROTOCOL *mI2cMaster; =20 + +/** + Fixup internal data so that EFI can be call in virtual mode. + Call the passed in Child Notify event and convert any pointers in + lib to virtual mode. + + @param[in] Event The Event that is being processed + @param[in] Context Event Context +**/ +VOID +EFIAPI +LibRtcVirtualNotifyEvent ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + EfiConvertPointer (0x0, (VOID **)&mI2cMaster->SetBusFrequency); + EfiConvertPointer (0x0, (VOID **)&mI2cMaster->Reset); + EfiConvertPointer (0x0, (VOID **)&mI2cMaster->StartRequest); + EfiConvertPointer (0x0, (VOID **)&mI2cMaster->I2cControllerCapabilities); + EfiConvertPointer (0x0, (VOID **)&mI2cMaster); +} + + /** Read RTC register. Data Read-Slave Transmitter Mode @@ -54,7 +80,7 @@ RtcRead ( =20 Req.OperationCount =3D 2; =20 - Req.SetAddressOp.Flags =3D 0; + Req.SetAddressOp.Flags =3D 0; //I2C_FLAG_WRITE Req.SetAddressOp.LengthInBytes =3D sizeof (RtcRegAddr); Req.SetAddressOp.Buffer =3D &RtcRegAddr; =20 @@ -98,7 +124,7 @@ RtcWrite ( Buffer[0] =3D RtcRegAddr; Buffer[1] =3D Val; =20 - Req.SetAddressOp.Flags =3D 0; + Req.SetAddressOp.Flags =3D 0; //I2C_FLAG_WRITE Req.SetAddressOp.LengthInBytes =3D sizeof (Buffer); Req.SetAddressOp.Buffer =3D Buffer; =20 @@ -375,5 +401,11 @@ LibRtcInitialize ( NULL, &mDriverEventRegistration); =20 + Status =3D gBS->CreateEventEx (EVT_NOTIFY_SIGNAL, TPL_NOTIFY, + LibRtcVirtualNotifyEvent, NULL, + &gEfiEventVirtualAddressChangeGuid, + &mRtcVirtualAddrChangeEvent); + ASSERT_EFI_ERROR (Status); + return EFI_SUCCESS; } diff --git a/Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.inf b/Silicon/= Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.inf index b92f658bfc..9d8cf16d28 100644 --- a/Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.inf +++ b/Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.inf @@ -28,6 +28,9 @@ UefiBootServicesTableLib UefiLib =20 +[Guids] + gEfiEventVirtualAddressChangeGuid + [Protocols] gEfiI2cMasterProtocolGuid ## CONSUMES gDs1307RealTimeClockLibI2cMasterProtocolGuid ## CONSUMES @@ -36,5 +39,7 @@ gDs1307RtcLibTokenSpaceGuid.PcdI2cSlaveAddress gDs1307RtcLibTokenSpaceGuid.PcdI2cBusFrequency =20 +# 2.15 EDK II INF, .. the generic (i.e depex).. are not permitted +# yet it ANDs this into the parent's depex [Depex] - gDs1307RealTimeClockLibI2cMasterProtocolGuid + gDs1307RealTimeClockLibI2cMasterProtocolGuid AND gEfiI2cMasterProtocolGu= id --=20 2.43.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113561): https://edk2.groups.io/g/devel/message/113561 Mute This Topic: https://groups.io/mt/103653100/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 06:07:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+113562+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113562+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1704931471; cv=none; d=zohomail.com; s=zohoarc; b=kdicD/CPfopA1i5bAJUPd1RI2CF0jHjHS/TeBXIibA0m2TYNtz+7Tb1EYabJ2sIgPfCfnGOW1uaYBTWh/UMjOplds1j/wHbF17AWi7w0Q9ulIFZ2JBtU0GADxBDrANgN37PbZOvx4gQWD6ifNmWNB3lAxxnBvQkq+ggLjhRZcBk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704931471; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=8nXxhPBqZmR0/lfMH8bybF2QMIDGtwxNoWwgHY9tH6k=; b=hb2Que0Af5q1PR63f77F57neWaR2wZkxxEVUSDBSIh801y+ITKSsiMgLe8GJgpY6f7+7EPGiumqCrMaFWllmFs3xaJIxk0PhVJmo24WLGTcQ4iNh6z6nTER2Ox/wnca3Fh88noCaWcewvuFAKiMei/zsVVSGt0LCXCPc+zJ+/1U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113562+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1704931471544978.6198351482758; Wed, 10 Jan 2024 16:04:31 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=G7tAYXgVg1skl8FNBW8ygLDwcqxgeY90NgDNv/JL2sc=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1704931471; v=1; b=ILtRIA8Ua7Ugm7YnRJuilfWzjJXUK1VfYdrF9+P0mMIz9nbcLXEkTlG1Uc4hylRtTrUTp2wJ U/eMGU7LahyTcUVcLa9w1flzVezrGCsP7xleU4WN1zF4FtH9jI0whNB50SazmkX2qMOhmCCE6rB n4rKQ/OGKYgiKit8rj2PVZAY= X-Received: by 127.0.0.2 with SMTP id Z6vSYY1788612x6BzjGjCkIB; Wed, 10 Jan 2024 16:04:31 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.9368.1704931469364233539 for ; Wed, 10 Jan 2024 16:04:29 -0800 X-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 759EE1570; Wed, 10 Jan 2024 16:05:15 -0800 (PST) X-Received: from u200865.usa.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 608EB3F5A1; Wed, 10 Jan 2024 16:04:29 -0800 (PST) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, quic_llindhol@quicinc.com, Jeremy Linton Subject: [edk2-devel] [RFC 5/6] Platform/RasberryPi: Add I2C1 to uefi runtime memory map Date: Wed, 10 Jan 2024 18:04:25 -0600 Message-ID: <20240111000426.2735007-6-jeremy.linton@arm.com> In-Reply-To: <20240111000426.2735007-1-jeremy.linton@arm.com> References: <20240111000426.2735007-1-jeremy.linton@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,jeremy.linton@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: Jxqk4w0ZwVpmcSELQIhfW3VLx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704931473334100021 Content-Type: text/plain; charset="utf-8" We intend to allow the OS to update the RTC after exit boot services. THis means we need to assure that the I2C IO map is marked correctly. Signed-off-by: Jeremy Linton --- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index 377ef438ff..fec8f63ea8 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -505,6 +505,7 @@ ApplyVariables ( } =20 if (mModelFamily =3D=3D 4) { + // add memoryspaces for the runtime flash/variable store Status =3D gDS->AddMemorySpace (EfiGcdMemoryTypeMemoryMappedIo, BCM283= 6_SPI0_BASE_ADDRESS, SIZE_4KB, EFI_MEMORY_UC | EFI_MEMORY_RUN= TIME); ASSERT_EFI_ERROR (Status); @@ -517,6 +518,13 @@ ApplyVariables ( Status =3D gDS->SetMemorySpaceAttributes (GPIO_BASE_ADDRESS, SIZE_4KB, EFI_MEMORY_UC|EFI_ME= MORY_RUNTIME); =20 + // add memoryspace for the runtime rtc/i2c + Status =3D gDS->AddMemorySpace (EfiGcdMemoryTypeMemoryMappedIo, BCM283= 6_I2C1_BASE_ADDRESS, + SIZE_4KB, EFI_MEMORY_UC | EFI_MEMORY_RUN= TIME); + ASSERT_EFI_ERROR (Status); + Status =3D gDS->SetMemorySpaceAttributes (BCM2836_I2C1_BASE_ADDRESS, + SIZE_4KB, EFI_MEMORY_UC|EFI_ME= MORY_RUNTIME); + ASSERT_EFI_ERROR (Status); } =20 --=20 2.43.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113562): https://edk2.groups.io/g/devel/message/113562 Mute This Topic: https://groups.io/mt/103653101/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 17 06:07:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+113563+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113563+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1704931471; cv=none; d=zohomail.com; s=zohoarc; b=Z6lkTNovOqO9RoFZL8m0xnYrpFwGoaUS2fXxKi7DB5rdg1OIBPA9egOX0k/XzmgWtmGpp2Xzr7UFRRExsRkoJiE568ad5rNnHawLKjswwPxfLccMgBujAY98ATrrn/RNujZsDpKNcYEYV+7oBFta5wdonuSNisSO+yGH2uHMGqY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704931471; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=B8x1pW+K038zRFYGAu2Vi/U0pDsO4LIHt2La1CFGaoE=; b=L/kGynLszX2djZBTL8jeSa0BfA0lGMeMpoNaGavUOyIi6W2bq3xOfk9Krs2tbmj0S5q/tJfkBLfpDsCMSDJbl1qj+2w3O2t+Oj2Ypo9noz/EHzJ2xGl/TX+1u5fYgXAhrNNQmLH30aVvm2oSD0Ip+colUGW5BJkSbCIQ8wTshlM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113563+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1704931471977984.999281121938; Wed, 10 Jan 2024 16:04:31 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=fDqfESuvC+LAfZcut9jfY+qHSQRCkEzzI/yC/38zr6g=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1704931471; v=1; b=rCqcwCWcOU3yg0notRAmy8VjrBClnL01I5yrvdFlp8Te1UKHUPtZTXhf3zcPX1g2X54qzj/r a1cDJnw/u2/W2tvPi21cQzi6TITW2j7LEMGyJ9S401uU5cuufGDCakrk2JtZEqV7Ewnvsweziti ESip+VDLa5GhIhKfDJTQOGVI= X-Received: by 127.0.0.2 with SMTP id nHBbYY1788612xVVWnYq1NuQ; Wed, 10 Jan 2024 16:04:31 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.9467.1704931469122767513 for ; Wed, 10 Jan 2024 16:04:30 -0800 X-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 AA29F1576; Wed, 10 Jan 2024 16:05:15 -0800 (PST) X-Received: from u200865.usa.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 943983F5A1; Wed, 10 Jan 2024 16:04:29 -0800 (PST) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, quic_llindhol@quicinc.com, Jeremy Linton Subject: [edk2-devel] [RFC 6/6] Platform/RaspberryPi: Add menu and build options for HW RTC Date: Wed, 10 Jan 2024 18:04:26 -0600 Message-ID: <20240111000426.2735007-7-jeremy.linton@arm.com> In-Reply-To: <20240111000426.2735007-1-jeremy.linton@arm.com> References: <20240111000426.2735007-1-jeremy.linton@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,jeremy.linton@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: sWXKCyUDaVntPYrmqvQxvFHhx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704931473389100022 Content-Type: text/plain; charset="utf-8" Now that the i2c drivers, config setup, and DS1307 driver are in place, lets add the drivers to the build. We also add a menu item to enable/disable it since the device I have: https://www.amazon.com/Makerfire%C2%AE-Raspberry-Module-DS1307-Battery/dp/B= 00ZOXWHK4 Doesn't utilize the HAT protocol so it cannot be detected. Signed-off-by: Jeremy Linton --- .../RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 22 ++++++++++++++ .../Drivers/ConfigDxe/ConfigDxe.inf | 1 + .../Drivers/ConfigDxe/ConfigDxeHii.uni | 6 ++++ .../Drivers/ConfigDxe/ConfigDxeHii.vfr | 16 ++++++++++ Platform/RaspberryPi/Include/ConfigVars.h | 4 +++ Platform/RaspberryPi/RPi3/RPi3.dsc | 7 +++++ Platform/RaspberryPi/RPi4/RPi4.dsc | 30 +++++++++++++++++++ Platform/RaspberryPi/RPi4/RPi4.fdf | 19 ++++++++++++ Platform/RaspberryPi/RaspberryPi.dec | 2 ++ 9 files changed, 107 insertions(+) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index fec8f63ea8..0397941a06 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -319,6 +319,16 @@ SetupVariables ( ASSERT_EFI_ERROR (Status); } =20 + Size =3D sizeof (UINT32); + Status =3D gRT->GetVariable (L"HwRtc", + &gConfigDxeFormSetGuid, + NULL, &Size, &Var32); + if (EFI_ERROR (Status)) { + Status =3D PcdSet32S (PcdHwRtc, PcdGet32 (PcdHwRtc)); + ASSERT_EFI_ERROR (Status); + } + + } else { /* * Disable PCIe and XHCI @@ -716,6 +726,18 @@ ApplyVariables ( GpioPinFuncSet (33, GPIO_FSEL_ALT3); } =20 + // Assure I2C1 is selected on header + if (PcdGet32 (PcdHwRtc)) { + UINT32 ClockRate; + DEBUG ((DEBUG_INFO, "Enable SDA1\n")); + GpioPinFuncSet (2, GPIO_FSEL_ALT0); + GpioPinFuncSet (3, GPIO_FSEL_ALT0); + + mFwProtocol->GetClockRate (RPI_MBOX_CLOCK_RATE_CORE, &ClockRate); + ClockRate/=3D50000; //50Khz slow it down a bit initially + + MmioWrite32 (BCM2836_I2C1_OFFSET + BCM2836_SOC_REGISTERS + BCM2835_I2C= _DIV, ClockRate ); //was 5dc which assumes a 150Mhz clock, when we are usua= lly at 500Mhz? + } } =20 =20 diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf b/Platfor= m/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf index e422e5ba5c..4c213174ce 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf @@ -98,6 +98,7 @@ gRaspberryPiTokenSpaceGuid.PcdMiniUartClockRate gRaspberryPiTokenSpaceGuid.PcdXhciReload gRaspberryPiTokenSpaceGuid.PcdEnableGpio + gRaspberryPiTokenSpaceGuid.PcdHwRtc =20 [Depex] gPcdProtocolGuid AND gRaspberryPiFirmwareProtocolGuid diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni index fb06d46a61..8da143d519 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni @@ -72,6 +72,12 @@ #string STR_ADVANCED_ENABLEGPIO_DISABLE #language en-US "Disabled" #string STR_ADVANCED_ENABLEGPIO_ENABLE #language en-US "Enable" =20 +#string STR_ADVANCED_ENABLEHWRTC_PROMPT #language en-US "Enable Hardware = RTC" +#string STR_ADVANCED_ENABLEHWRTC_HELP #language en-US "A DS1307 hardwar= e real time clock is attached on I2C1." +#string STR_ADVANCED_ENABLEHWRTC_DISABLE #language en-US "Disabled" +#string STR_ADVANCED_ENABLEHWRTC_ENABLE #language en-US "Enable" + + #string STR_ADVANCED_ASSET_TAG_PROMPT #language en-US "Asset Tag" #string STR_ADVANCED_ASSET_TAG_HELP #language en-US "Set the system Asse= t Tag" =20 diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr index 04eb0a15a2..b7146b7e8c 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr @@ -71,6 +71,11 @@ formset name =3D EnableGpio, guid =3D CONFIGDXE_FORM_SET_GUID; =20 + efivarstore ADVANCED_ENABLEHWRTC_VARSTORE_DATA, + attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, + name =3D HwRtc, + guid =3D CONFIGDXE_FORM_SET_GUID; + efivarstore SYSTEM_TABLE_MODE_VARSTORE_DATA, attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, name =3D SystemTableMode, @@ -259,6 +264,17 @@ formset option text =3D STRING_TOKEN(STR_ADVANCED_ENABLEGPIO_ENABLE), = value =3D 1, flags =3D 0; endoneof; endif; + + grayoutif ideqval SystemTableMode.Mode =3D=3D SYSTEM_TABLE_MODE_DT; + oneof varid =3D HwRtc.Value, + prompt =3D STRING_TOKEN(STR_ADVANCED_ENABLEHWRTC_PROMPT= ), + help =3D STRING_TOKEN(STR_ADVANCED_ENABLEHWRTC_HELP), + flags =3D NUMERIC_SIZE_4 | INTERACTIVE | RESET_REQUIRE= D, + option text =3D STRING_TOKEN(STR_ADVANCED_ENABLEHWRTC_DISABL= E), value =3D 0, flags =3D DEFAULT; + option text =3D STRING_TOKEN(STR_ADVANCED_ENABLEHWRTC_ENABLE= ), value =3D 1, flags =3D 0; + endoneof; + endif; + #endif string varid =3D AssetTag.AssetTag, prompt =3D STRING_TOKEN(STR_ADVANCED_ASSET_TAG_PROMPT), diff --git a/Platform/RaspberryPi/Include/ConfigVars.h b/Platform/Raspberry= Pi/Include/ConfigVars.h index 43a39891d4..69dda96051 100644 --- a/Platform/RaspberryPi/Include/ConfigVars.h +++ b/Platform/RaspberryPi/Include/ConfigVars.h @@ -84,6 +84,10 @@ typedef struct { UINT32 Value; } ADVANCED_ENABLEGPIO_VARSTORE_DATA; =20 +typedef struct { + UINT32 Value; +} ADVANCED_ENABLEHWRTC_VARSTORE_DATA; + typedef struct { #define SYSTEM_TABLE_MODE_ACPI 0 #define SYSTEM_TABLE_MODE_BOTH 1 diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3= /RPi3.dsc index 55da7d5870..10d57c5e03 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -541,6 +541,13 @@ # gRaspberryPiTokenSpaceGuid.PcdEnableGpio|L"EnableGpio"|gConfigDxeFormSet= Guid|0x0|1 =20 + # Utilize RTC on I2C1 + # + # 0 - No + # 1 - Yes + # + gRaspberryPiTokenSpaceGuid.PcdHwRtc|L"HwRtc"|gConfigDxeFormSetGuid|0x0|0 + # # Common UEFI ones. # diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4= /RPi4.dsc index a49b3433ac..170e45ae7e 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -368,6 +368,12 @@ # Default platform supported RFC 4646 languages: (American) English gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes|"en-US" =20 + # + # RTC Pcds + # + gDs1307RtcLibTokenSpaceGuid.PcdI2cSlaveAddress|0x68 + gDs1307RtcLibTokenSpaceGuid.PcdI2cBusFrequency|100000 + [LibraryClasses.common] ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf @@ -562,6 +568,14 @@ # gRaspberryPiTokenSpaceGuid.PcdEnableGpio|L"EnableGpio"|gConfigDxeFormSet= Guid|0x0|0 =20 + # Utilize RTC on I2C1 + # + # 0 - No + # 1 - Yes + # + gRaspberryPiTokenSpaceGuid.PcdHwRtc|L"HwRtc"|gConfigDxeFormSetGuid|0x0|0 + + # # Common UEFI ones. # @@ -659,6 +673,15 @@ RealTimeClockLib|EmbeddedPkg/Library/VirtualRealTimeClockLib/Virtual= RealTimeClockLib.inf } + # Oh, confusing, we now have two runtime variable support drivers... + # Do the virtual one by default, but if the hardware RTC is configured t= hen + # SOM the BcmI2CPlatform driver, which activates this one. + EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf { + + FILE_GUID =3D 9d539f19-5fb6-4088-a81d-aaeb90446751 + + RealTimeClockLib|Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.inf + } EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf =20 MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf @@ -782,6 +805,13 @@ MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf =20 # + # RTC support + # + Platform/RaspberryPi/Drivers/BcmI2CPlatform/BcmI2CPlatform.inf + Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.inf + Silicon/Broadcom/Drivers/I2cDxe/I2cDxe.inf + + # UEFI application (Shell Embedded Boot Loader) # ShellPkg/Application/Shell/Shell.inf { diff --git a/Platform/RaspberryPi/RPi4/RPi4.fdf b/Platform/RaspberryPi/RPi4= /RPi4.fdf index 8169277615..989d99a49f 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.fdf +++ b/Platform/RaspberryPi/RPi4/RPi4.fdf @@ -288,6 +288,17 @@ READ_LOCK_STATUS =3D TRUE # INF MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf =20 + # + # I2C/RTC + # + INF Platform/RaspberryPi/Drivers/BcmI2CPlatform/BcmI2CPlatform.inf + INF Silicon/Broadcom/Drivers/I2cDxe/I2cDxe.inf + INF RuleOverride =3D RTC_RUNTIME EmbeddedPkg/RealTimeClockRuntimeDxe/Rea= lTimeClockRuntimeDxe.inf +# FILE DRIVER =3D 9d539f19-5fb6-4088-a81d-aaeb90446751 { +# SECTION PE32 =3D EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRu= ntimeDxe.inf +# SECTION PE32 =3D $(INF_OUTPUT)Build/RPi4/DEBUG_GCC5/AARCH64/RealTim= eClock_9d539f19-5fb6-4088-a81d-aaeb90446751.efi +# } + # # SCSI Bus and Disk Driver # @@ -415,6 +426,14 @@ READ_LOCK_STATUS =3D TRUE UI STRING=3D"$(MODULE_NAME)" Optional } =20 +[Rule.Common.DXE_RUNTIME_DRIVER.RTC_RUNTIME] + FILE DRIVER =3D 9d539f19-5fb6-4088-a81d-aaeb90446751 { + DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/../../9d539= f19-5fb6-4088-a81d-aaeb90446751/OUTPUT/$(MODULE_NAME).depex + PE32 PE32 $(INF_OUTPUT)/../../9d539f19-5fb6-= 4088-a81d-aaeb90446751/OUTPUT/$(MODULE_NAME).efi + UI STRING=3D"$(MODULE_NAME)" Optional + } + + [Rule.Common.UEFI_APPLICATION] FILE APPLICATION =3D $(NAMED_GUID) { UI STRING =3D"$(MODULE_NAME)" Optional diff --git a/Platform/RaspberryPi/RaspberryPi.dec b/Platform/RaspberryPi/Ra= spberryPi.dec index cc56b436cf..9cf33c366b 100644 --- a/Platform/RaspberryPi/RaspberryPi.dec +++ b/Platform/RaspberryPi/RaspberryPi.dec @@ -26,6 +26,7 @@ gRaspberryPiTokenSpaceGuid =3D {0xCD7CC258, 0x31DB, 0x11E6, {0x9F, 0xD3,= 0x63, 0xB0, 0xB8, 0xEE, 0xD6, 0xB5}} gRaspberryPiEventResetGuid =3D {0xCD7CC258, 0x31DB, 0x11E6, {0x9F, 0xD3,= 0x63, 0xB4, 0xB4, 0xE4, 0xD4, 0xB4}} gConfigDxeFormSetGuid =3D {0xCD7CC258, 0x31DB, 0x22E6, {0x9F, 0x22, 0x63= , 0xB0, 0xB8, 0xEE, 0xD6, 0xB5}} + gBcmNonDiscoverableI2cMasterGuid =3D { 0x16066c21, 0x0ca6, 0x4f44, {0x82= , 0xd9, 0xbe, 0x06, 0x96, 0x12, 0x0e, 0xfb}} =20 [PcdsFixedAtBuild.common] # @@ -75,3 +76,4 @@ gRaspberryPiTokenSpaceGuid.PcdMiniUartClockRate|0|UINT32|0x00000023 gRaspberryPiTokenSpaceGuid.PcdXhciReload|0|UINT32|0x00000024 gRaspberryPiTokenSpaceGuid.PcdEnableGpio|0|UINT32|0x00000025 + gRaspberryPiTokenSpaceGuid.PcdHwRtc|0|UINT32|0x00000026 --=20 2.43.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113563): https://edk2.groups.io/g/devel/message/113563 Mute This Topic: https://groups.io/mt/103653102/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-