From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web11.3331.1574075627552331340 for ; Mon, 18 Nov 2019 03:13:47 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=D1F/N/0Q; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574075626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9MhRxKyu2DrgW+eC1ahDKREUlNO9YgyMPORpEorOZtM=; b=D1F/N/0QJeWcAp7sRAtpmhYn7cNff03t8FLnD6i6buH3Rr2hQRo5C8mGRG6cFy/wxCl81H KDicGtxS7fT+rZJDEHhMxFzXBIsn36BJ/Z9duXvFshLLq3XbCrYv83rV+f+KO1X7xOVzbC 7/zzKcj55GZe/OqppeU55MhUYSxRDRU= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-428-PHP0ZXsCMaui_pKqJnSNOw-1; Mon, 18 Nov 2019 06:13:44 -0500 Received: by mail-wr1-f72.google.com with SMTP id e10so15057168wrt.16 for ; Mon, 18 Nov 2019 03:13:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=IRc8nabF7VAjCl84+RhKKCSA+zVXztrm3KQ1Mwjxn6M=; b=SgHl9nrzPmv/LIJC/gCEZYYUmI5B9sO/ZLCMhObNaHuKE2x8uhYkHmdk+UiaWn+GQg 3reOUeUYsctiO3l/h4b79cL/fx/cROMm7yZ7ZUxwGbKRYJm8NNXKXwwlMFZaRtJ1p/JB lDFcfcjsRDbwcd89P1nzoaej6CTj8OjEFCT+A8Jj7lE1rNc93VITxgd2oeOx7ACBlwhq n//4fzE0LaS2IehyaQFhnOe+YJMZKsdBtAR5cbrv8hS20bAB+Q55qc3QOfDW9CK1pMrD ulVqaP+CU1fuZeIv8s9qC/tiJOHot51a9I46NaXx681Oa2bW7it/4HuHsdLgkM+mCOv3 rzEQ== X-Gm-Message-State: APjAAAUsN2h4QB34KXinKio9lBRdFFnz6gPQPAvXGU9yr1NN4kbzitob hs+JiZo/f4DnWZZoFTG7JaUKsCPi/CrcaUmx8xjjwpASJ12I6d3bIgu4dhKaO4oF/01Vb5Lx+cT JQXPcrsVSBxY3RQ== X-Received: by 2002:a1c:3843:: with SMTP id f64mr26919962wma.129.1574075623655; Mon, 18 Nov 2019 03:13:43 -0800 (PST) X-Google-Smtp-Source: APXvYqzI3ULOH545irYevTDqKTwblYd/AWVl5jrhExFmiJnwiYdn4Oc6NplERKWc5gkcxLwZ5eG65A== X-Received: by 2002:a1c:3843:: with SMTP id f64mr26919929wma.129.1574075623343; Mon, 18 Nov 2019 03:13:43 -0800 (PST) Return-Path: Received: from [192.168.1.35] (131.red-88-21-102.staticip.rima-tde.net. [88.21.102.131]) by smtp.gmail.com with ESMTPSA id 62sm25519293wre.38.2019.11.18.03.13.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Nov 2019 03:13:42 -0800 (PST) Subject: Re: [edk2-platforms][PATCH 6/8] Platform/RPi: Replace Mailbox and Watchdog addresses with PCDs To: Pete Batard , devel@edk2.groups.io, Samer El-Haj-Mahmoud Cc: ard.biesheuvel@linaro.org, leif.lindholm@linaro.org References: <20191114160740.10072-1-pete@akeo.ie> <20191114160740.10072-7-pete@akeo.ie> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: <6f581579-2444-d9e8-4474-cab6b28e93a9@redhat.com> Date: Mon, 18 Nov 2019 12:13:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191114160740.10072-7-pete@akeo.ie> X-MC-Unique: PHP0ZXsCMaui_pKqJnSNOw-1 X-Mimecast-Spam-Score: 0 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi Pete, Samer, On 11/14/19 5:07 PM, Pete Batard wrote: > From: Samer El-Haj-Mahmoud >=20 > Set BCM2836_WDOG_BASE_ADDRESS and BCM2836_MBOX_BASE_ADDRESS to > using PCDs instead of hard-coded addresses. This is needed in > preparation for adding Raspberry Pi 4 support. >=20 > Signed-off-by: Pete Batard > --- > Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.inf | 1 + > Platform/RaspberryPi/Library/PlatformLib/PlatformLib.inf | 1 + > Platform/RaspberryPi/RPi3/RPi3.dsc | 3 +++ > Silicon/Broadcom/Bcm283x/Bcm283x.dec | 2 ++ > Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h | 4 ++-- > 5 files changed, 9 insertions(+), 2 deletions(-) >=20 > diff --git a/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.i= nf b/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.inf > index a3fc0fa49a3c..527cee8bacc1 100644 > --- a/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.inf > +++ b/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.inf > @@ -42,6 +42,7 @@ [Protocols] > =20 > [FixedPcd] > gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress > + gBcm283xTokenSpaceGuid.PcdMboxBaseAddress > =20 > [Depex] > TRUE > diff --git a/Platform/RaspberryPi/Library/PlatformLib/PlatformLib.inf b/P= latform/RaspberryPi/Library/PlatformLib/PlatformLib.inf > index c0e2a75451c3..f627fca2e406 100644 > --- a/Platform/RaspberryPi/Library/PlatformLib/PlatformLib.inf > +++ b/Platform/RaspberryPi/Library/PlatformLib/PlatformLib.inf > @@ -58,6 +58,7 @@ [FixedPcd] > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize > gBcm27xxTokenSpaceGuid.PcdBcm27xxRegistersAddress > gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress > + gBcm283xTokenSpaceGuid.PcdMboxBaseAddress > =20 > [Ppis] > gArmMpCoreInfoPpiGuid > diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RP= i3/RPi3.dsc > index 4e5a9f0b05e6..88af37e6edaa 100644 > --- a/Platform/RaspberryPi/RPi3/RPi3.dsc > +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc > @@ -376,6 +376,9 @@ [PcdsFixedAtBuild.common] > # Device specific addresses > # > gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress|0x3f000000 The RegistersAddress 'base' changes in the 2711, > + gBcm283xTokenSpaceGuid.PcdMboxBaseAddress|0x3f00b880 > + gBcm283xTokenSpaceGuid.PcdWdogBaseAddress|0x3f100000 but the BaseAddress 'offset' stay constant. Why not use this approach instead? #define BCM2836_WDOG_OFFSET 0x00100000 #define BCM2836_WDOG_BASE_ADDRESS \ (FixedPcdGet64 (PcdBcm283xRegistersAddress) \ + BCM2836_WDOG_OFFSET) (and similarly with other devices). > ## NS16550 compatible UART > gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x3f215040 > gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|TRUE > diff --git a/Silicon/Broadcom/Bcm283x/Bcm283x.dec b/Silicon/Broadcom/Bcm2= 83x/Bcm283x.dec > index 5b839b00d286..fe1907cb8cf1 100644 > --- a/Silicon/Broadcom/Bcm283x/Bcm283x.dec > +++ b/Silicon/Broadcom/Bcm283x/Bcm283x.dec > @@ -21,3 +21,5 @@ [Guids] > =20 > [PcdsFixedAtBuild.common] > gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress|0x0|UINT32|0x000000= 01 > + gBcm283xTokenSpaceGuid.PcdMboxBaseAddress|0x0|UINT32|0x00000002 > + gBcm283xTokenSpaceGuid.PcdWdogBaseAddress|0x0|UINT32|0x00000003 > diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h = b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > index 8bd68c234bfd..6bc21f0ddcf8 100644 > --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > @@ -23,7 +23,7 @@ > #define BCM2836_DMA_DEVICE_OFFSET 0xc0000000 > =20 > /* watchdog constants */ > -#define BCM2836_WDOG_BASE_ADDRESS 0x3f100000 > +#define BCM2836_WDOG_BASE_ADDRESS (FixedPcdGet= 64 (PcdWdogBaseAddress)) > #define BCM2836_WDOG_PASSWORD 0x5a000000 > #define BCM2836_WDOG_RSTC_OFFSET 0x0000001c > #define BCM2836_WDOG_WDOG_OFFSET 0x00000024 > @@ -31,7 +31,7 @@ > #define BCM2836_WDOG_RSTC_WRCFG_FULL_RESET 0x00000020 > =20 > /* mailbox interface constants */ > -#define BCM2836_MBOX_BASE_ADDRESS 0x3f00b880 > +#define BCM2836_MBOX_BASE_ADDRESS (FixedPcdGet= 64 (PcdMboxBaseAddress)) > #define BCM2836_MBOX_READ_OFFSET 0x00000000 > #define BCM2836_MBOX_STATUS_OFFSET 0x00000018 > #define BCM2836_MBOX_CONFIG_OFFSET 0x0000001c >=20