From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 91976D8024B for ; Thu, 11 Jan 2024 00:04:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=HswMJyLo0UOdnRvWtvvFqp6e890pG5Klal4rfrd9GOc=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID: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=idD42ExVBj8jXDFtg+myYv/ruwXqhc4lvJVKVj8j+YC72SRBARA7MAq20E3b6+hxWBNH11mF FWFsvmZJFSx915NfagJ2a1tJ6vsUaNFUiBlwfzxQqKVU2hJNYvacowo9dRz26bgHHo13SCsnBTc pxxK3geZJl0MBBKutV/JXrMo= X-Received: by 127.0.0.2 with SMTP id lM9qYY7687511xS55SuLDtLA; 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.web10.9465.1704931468614646673 for ; Wed, 10 Jan 2024 16:04:28 -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 477362F4; 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 321333F5A1; 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 0/6] RasberryPi: RTC HAT support Date: Wed, 10 Jan 2024 18:04:20 -0600 Message-ID: <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: eRutxhChmQz8PnxgBAxIJqkKx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=idD42ExV; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none) There are a number of Dallas 1307 based RTC HATs available for the RPi that don't follow the HAT ID protocol but are simple, inexpensive and widely available. Lets add an I2C driver and then allow the user to enable them in the advanced menu. Once enabled and detected we then dynamically swap them in to provide UEFI runtime RTC. Its this latter bit of logic which seems to be unique to this platform and probably should be closely reviewed. Jeremy Linton (6): Silicon/Bcm283x: Document the I2C registers Silicon/Bcm283x: Add core I2C drivers Platform/RasberryPi: Create I2C driver bound to RTC Silicon/Maxim: Fix runtime issues Platform/RasberryPi: Add I2C1 to uefi runtime memory map Platform/RaspberryPi: Add menu and build options for HW RTC .../Drivers/BcmI2CPlatform/BcmI2CPlatform.c | 127 +++++++ .../Drivers/BcmI2CPlatform/BcmI2CPlatform.inf | 54 +++ .../RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 30 ++ .../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 + .../Include/IndustryStandard/Bcm2836.h | 34 ++ .../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 ++++ .../Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.c | 36 +- .../Library/Ds1307RtcLib/Ds1307RtcLib.inf | 7 +- 19 files changed, 1208 insertions(+), 3 deletions(-) create mode 100644 Platform/RaspberryPi/Drivers/BcmI2CPlatform/BcmI2CPla= tform.c create mode 100644 Platform/RaspberryPi/Drivers/BcmI2CPlatform/BcmI2CPla= tform.inf 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 --=20 2.43.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113557): https://edk2.groups.io/g/devel/message/113557 Mute This Topic: https://groups.io/mt/103653096/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-