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.web12.19933.1574163828124703611 for ; Tue, 19 Nov 2019 03:43:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DgW5qQHZ; 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=1574163827; 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=kE0QbOMEQ+kkIABtoV43r+ZAm5mdAS/jX81QDIl75uk=; b=DgW5qQHZfIIyRYjF2wIcYVoaSM9MhWiuVLdTZxkFytQlo1vZJ8y4hgobB5R/I8ouVc/1Jt TnhUgWs68N9fSdeyp45T4aQonyjhNYUpPbO14l4tALeMlHZ25ZQvp7lBF2Cz6tzzt2lrQo NDbGHf52pH8DojDvnIL0Jhp1QHGHMZ4= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-310-ibZrf1qJOyugEoBq0xbgGA-1; Tue, 19 Nov 2019 06:43:45 -0500 Received: by mail-wm1-f72.google.com with SMTP id y14so2100873wmj.9 for ; Tue, 19 Nov 2019 03:43:45 -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=tUAGPIlzuvpB4pDL8B0kTM4t12JsAkltbtJ1DpAuIZM=; b=tjCrfYvzyqnLukE151TokMlZd3WlahkCbs83G3pSTlsGXOAEBQImQ0KIZ+EHvZxreC 2TuP8GTpTn77ST/gfgQyQqNaHXAsavfLI0ChhG/NH/doLZDhDPJEI7ilGC9pVWrowkDn fI2s+TPpALUw0b4l6okCDscDHi0+EiBvvVx5b6LxTZB6zmCWxfao0696ZENprBC+KHjx VqkDgi3M9q4MTYXV8W+LCQZ7tAg3ZWkUsFwCRYBDP6GnYYXo0RSwrO7PgLp+QxGXiJss SKe1kf5GzWMXQV9PLQje2tP5NYD0WkcpqSoLbC7SSwdAV3Ht4BX7gV1RawqRKGbqzX1u eUrQ== X-Gm-Message-State: APjAAAU7urR1xtitDiK3B9+uP6lpdr7KQQdSRCxo+bVzP4vV5AFY9iXD qPXkYIpP4yPuVjnVddXT/U0thrfIiCcxqJsWo98Elh4QkXPSieBMXGJsJwAqdcsj136qUeLBK/n vaDHzhvrioKYhEw== X-Received: by 2002:a1c:5603:: with SMTP id k3mr5451282wmb.150.1574163824416; Tue, 19 Nov 2019 03:43:44 -0800 (PST) X-Google-Smtp-Source: APXvYqzTGjOBJ0btp/02QWKLcDPMPsidGfM4vm8q4x+3NT25ynNhFLwq1czK4XAZBDGi4K1dx0wz0A== X-Received: by 2002:a1c:5603:: with SMTP id k3mr5451221wmb.150.1574163823909; Tue, 19 Nov 2019 03:43: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 y19sm2884327wmd.29.2019.11.19.03.43.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Nov 2019 03:43:43 -0800 (PST) Subject: Re: [edk2-platforms][PATCH v2 3/7] Platform/RPi: Replace Bcm283x SoC base register address with a PCD To: Pete Batard , devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, samer.el-haj-mahmoud@arm.com References: <20191119113809.2472-1-pete@akeo.ie> <20191119113809.2472-4-pete@akeo.ie> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: <092d22cc-cd21-61ad-0317-3b2a3fc6c2cf@redhat.com> Date: Tue, 19 Nov 2019 12:43: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: <20191119113809.2472-4-pete@akeo.ie> X-MC-Unique: ibZrf1qJOyugEoBq0xbgGA-1 X-Mimecast-Spam-Score: 0 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 11/19/19 12:38 PM, Pete Batard wrote: > From: Samer El-Haj-Mahmoud >=20 > Define BCM2836_SOC_REGISTERS from PcdBcm283xRegistersAddress. This is > needed in preparation for adding Raspberry Pi 4 support, since the two > Pi's have a different base addresses for the Bcm283x specific registers. >=20 Shouldn't this patch also include Samer's S-o-b tag? Except this question, for the technical part: Reviewed-by: Philippe Mathieu-Daude > Signed-off-by: Pete Batard > --- > Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.inf | 2 = ++ > Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf | 2 = ++ > Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.inf | 4 = ++++ > Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.inf | 5 = ++++- > Platform/RaspberryPi/Drivers/SdHostDxe/SdHostDxe.inf | 2 = ++ > Platform/RaspberryPi/Library/PlatformLib/PlatformLib.inf | 3 = ++- > Platform/RaspberryPi/RPi3/RPi3.dsc | 7 = ++++++- > Silicon/Broadcom/Bcm283x/Bcm283x.dec | 7 = +++++++ > Silicon/Broadcom/Bcm283x/Drivers/InterruptDxe/InterruptDxe.inf | 4 = +++- > Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.inf | 5 = +++++ > Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h | 3 = ++- > Silicon/Broadcom/Bcm283x/Library/GpioLib/GpioLib.inf | 4 = ++++ > 12 files changed, 43 insertions(+), 5 deletions(-) >=20 > diff --git a/Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostD= xe.inf b/Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.inf > index 3f0d7b6b9e9d..6db8a1c5e400 100644 > --- a/Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.inf > +++ b/Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.inf > @@ -1,5 +1,6 @@ > #/** @file > # > +# Copyright (c) 2019, ARM Limited. All rights reserved. > # Copyright (c) 2017, Andrei Warkentin > # Copyright (c) Microsoft Corporation. All rights reserved. > # > @@ -41,6 +42,7 @@ [Protocols] > gRaspberryPiFirmwareProtocolGuid ## CONSUMES > =20 > [Pcd] > + gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress > gRaspberryPiTokenSpaceGuid.PcdSdIsArasan > =20 > [Depex] > diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf b/Platf= orm/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf > index 28fc2682b585..817cb98c1933 100644 > --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf > +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf > @@ -1,5 +1,6 @@ > #/** @file > # > +# Copyright (c) 2019, ARM Limited. All rights reserved. > # Copyright (c) 2018, Andrei Warkentin > # > # SPDX-License-Identifier: BSD-2-Clause-Patent > @@ -54,6 +55,7 @@ [Protocols] > gRaspberryPiConfigAppliedProtocolGuid ## PRODUCES > =20 > [Pcd] > + gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress > gRaspberryPiTokenSpaceGuid.PcdCpuClock > gRaspberryPiTokenSpaceGuid.PcdCustomCpuClock > gRaspberryPiTokenSpaceGuid.PcdSdIsArasan > diff --git a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.inf b= /Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.inf > index e880c2fb0261..8817f20622d6 100644 > --- a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.inf > +++ b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.inf > @@ -1,5 +1,6 @@ > #/** @file > # > +# Copyright (c) 2019, ARM Limited. All rights reserved. > # Copyright (c) 2017-2018, Andrei Warkentin > # Copyright (c) 2015-2016, Linaro Limited. All rights reserved. > # > @@ -51,5 +52,8 @@ [Protocols] > gEfiUsb2HcProtocolGuid > gRaspberryPiFirmwareProtocolGuid > =20 > +[FixedPcd] > + gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress > + > [Depex] > gRaspberryPiFirmwareProtocolGuid > diff --git a/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.i= nf b/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.inf > index 87bca98fec28..a3fc0fa49a3c 100644 > --- a/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.inf > +++ b/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.inf > @@ -1,5 +1,5 @@ > #/** @file > -# > +# Copyright (c) 2019, ARM Limited. All rights reserved. > # Copyright (c) 2017-2018, Andrei Warkentin > # Copyright (c) 2016, Linaro, Ltd. All rights reserved. > # > @@ -40,5 +40,8 @@ [LibraryClasses] > [Protocols] > gRaspberryPiFirmwareProtocolGuid ## PRODUCES > =20 > +[FixedPcd] > + gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress > + > [Depex] > TRUE > diff --git a/Platform/RaspberryPi/Drivers/SdHostDxe/SdHostDxe.inf b/Platf= orm/RaspberryPi/Drivers/SdHostDxe/SdHostDxe.inf > index 7386ff251864..ca8b30700328 100644 > --- a/Platform/RaspberryPi/Drivers/SdHostDxe/SdHostDxe.inf > +++ b/Platform/RaspberryPi/Drivers/SdHostDxe/SdHostDxe.inf > @@ -1,5 +1,6 @@ > #/** @file > # > +# Copyright (c) 2019, ARM Limited. All rights reserved. > # Copyright (c) 2017, Andrei Warkentin > # Copyright (c) Microsoft Corporation. All rights reserved. > # > @@ -43,6 +44,7 @@ [Protocols] > gRaspberryPiFirmwareProtocolGuid ## CONSUMES > =20 > [Pcd] > + gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress > gRaspberryPiTokenSpaceGuid.PcdSdIsArasan > =20 > [Depex] > diff --git a/Platform/RaspberryPi/Library/PlatformLib/PlatformLib.inf b/P= latform/RaspberryPi/Library/PlatformLib/PlatformLib.inf > index ed986034b957..bcc6f8b6ec13 100644 > --- a/Platform/RaspberryPi/Library/PlatformLib/PlatformLib.inf > +++ b/Platform/RaspberryPi/Library/PlatformLib/PlatformLib.inf > @@ -2,7 +2,7 @@ > # > # Copyright (c) 2017-2018, Andrei Warkentin > # Copyright (c) 2014-2016, Linaro Limited. All rights reserved. > -# Copyright (c) 2011-2014, ARM Limited. All rights reserved. > +# Copyright (c) 2011-2019, ARM Limited. All rights reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > @@ -47,6 +47,7 @@ [FixedPcd] > gArmTokenSpaceGuid.PcdArmPrimaryCoreMask > gArmTokenSpaceGuid.PcdArmPrimaryCore > gArmTokenSpaceGuid.PcdFdSize > + gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress > gEmbeddedTokenSpaceGuid.PcdDmaDeviceOffset > gArmTokenSpaceGuid.PcdSystemMemoryBase > gArmTokenSpaceGuid.PcdSystemMemorySize > diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RP= i3/RPi3.dsc > index a0365c5cf606..98c75e373fa7 100644 > --- a/Platform/RaspberryPi/RPi3/RPi3.dsc > +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc > @@ -1,6 +1,6 @@ > # @file > # > -# Copyright (c) 2011-2015, ARM Limited. All rights reserved. > +# Copyright (c) 2011 - 2019, ARM Limited. All rights reserved. > # Copyright (c) 2014, Linaro Limited. All rights reserved. > # Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved. > # Copyright (c) 2017 - 2018, Andrei Warkentin > @@ -372,6 +372,11 @@ [PcdsFixedAtBuild.common] > gArmTokenSpaceGuid.PcdSystemMemoryBase|0x00400000 > gArmTokenSpaceGuid.PcdSystemMemorySize|0x3FC00000 > =20 > + # > + # Device specific addresses > + # > + gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress|0x3f000000 > + > ## 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 ec62ff27fbb3..5b839b00d286 100644 > --- a/Silicon/Broadcom/Bcm283x/Bcm283x.dec > +++ b/Silicon/Broadcom/Bcm283x/Bcm283x.dec > @@ -1,5 +1,6 @@ > ## @file > # > +# Copyright (c) 2019, ARM Limited. All rights reserved. > # Copyright (c) 2019, Pete Batard > # > # SPDX-License-Identifier: BSD-2-Clause-Patent > @@ -14,3 +15,9 @@ [Defines] > =20 > [Includes] > Include > + > +[Guids] > + gBcm283xTokenSpaceGuid =3D {0x82f36a92, 0xfb7e, 0x43a1, {0xb9, 0x9e, 0= x49, 0x13, 0x3f, 0xc7, 0xa4, 0x2e}} > + > +[PcdsFixedAtBuild.common] > + gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress|0x0|UINT32|0x0000000= 1 > diff --git a/Silicon/Broadcom/Bcm283x/Drivers/InterruptDxe/InterruptDxe.i= nf b/Silicon/Broadcom/Bcm283x/Drivers/InterruptDxe/InterruptDxe.inf > index cdce11a51e14..f984c4b52623 100644 > --- a/Silicon/Broadcom/Bcm283x/Drivers/InterruptDxe/InterruptDxe.inf > +++ b/Silicon/Broadcom/Bcm283x/Drivers/InterruptDxe/InterruptDxe.inf > @@ -1,5 +1,5 @@ > #/** @file > -# > +# Copyright (c) 2019, ARM Limited. All rights reserved. > # Copyright (c) 2017, Andrei Warkentin > # Copyright (c) 2016 Linaro, Ltd. All rights reserved. > # > @@ -27,6 +27,7 @@ [LibraryClasses] > BaseLib > DebugLib > IoLib > + PcdLib > UefiBootServicesTableLib > UefiLib > UefiDriverEntryPoint > @@ -36,6 +37,7 @@ [Protocols] > gEfiCpuArchProtocolGuid ## CONSUMES ## NOTIFY > =20 > [FixedPcd] > + gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress > gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress > =20 > [Depex] > diff --git a/Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.inf b/Silicon= /Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.inf > index cb1695bd2dfc..8eb90de85cfd 100644 > --- a/Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.inf > +++ b/Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.inf > @@ -1,5 +1,6 @@ > #/** @file > # > +# Copyright (c) 2019, ARM Limited. All rights reserved. > # Copyright (c) 2019 Linaro, Ltd. All rights reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent > @@ -26,6 +27,7 @@ [LibraryClasses] > BaseMemoryLib > DebugLib > IoLib > + PcdLib > UefiBootServicesTableLib > UefiDriverEntryPoint > =20 > @@ -35,5 +37,8 @@ [Protocols] > [Guids] > gEfiRngAlgorithmRaw > =20 > +[FixedPcd] > + gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress > + > [Depex] > TRUE > diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h = b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > index 4007301228be..8bd68c234bfd 100644 > --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > @@ -1,5 +1,6 @@ > /** @file > * > + * Copyright (c) 2019, ARM Limited. All rights reserved. > * Copyright (c) 2017, Andrei Warkentin > * Copyright (c) 2016, Linaro Limited. All rights reserved. > * > @@ -13,7 +14,7 @@ > /* > * Both "core" and SoC perpherals (1M each). > */ > -#define BCM2836_SOC_REGISTERS 0x3f000000 > +#define BCM2836_SOC_REGISTERS (FixedPcdGet= 64 (PcdBcm283xRegistersAddress)) > #define BCM2836_SOC_REGISTER_LENGTH 0x02000000 > =20 > /* > diff --git a/Silicon/Broadcom/Bcm283x/Library/GpioLib/GpioLib.inf b/Silic= on/Broadcom/Bcm283x/Library/GpioLib/GpioLib.inf > index 50da4eb771f3..ff1b5af6db6e 100644 > --- a/Silicon/Broadcom/Bcm283x/Library/GpioLib/GpioLib.inf > +++ b/Silicon/Broadcom/Bcm283x/Library/GpioLib/GpioLib.inf > @@ -2,6 +2,7 @@ > # > # Manipulate GPIOs. > # > +# Copyright (c) 2019, ARM Limited. All rights reserved. > # Copyright (c) 2018, Andrei Warkentin > # > # SPDX-License-Identifier: BSD-2-Clause-Patent > @@ -30,4 +31,7 @@ [LibraryClasses] > DebugLib > IoLib > =20 > +[FixedPcd] > + gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress > + > [Guids] >=20