From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web11.19845.1574163988481028901 for ; Tue, 19 Nov 2019 03:46:28 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WPfvAnM6; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574163987; 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=Yl7RSxyZw/N0Bw/sDSgqyAUvbw4Tr7hR+7cwzFaHpqM=; b=WPfvAnM6cMCuka0OMEugt2/YDsapsSrcghsoC1Jz9NLdd6MiLaG1QHqWJS9xFNLdgybFZ4 2G4vvfSvlUicBF4nkVcojw0Y2lRKwKrZwSD/oVOshjMNlK60VPigC/EGBUGvs1x7XhVuq8 3jhLdxHcwCvSNcizqqxTlte+5QNkFXY= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-327-Qc4ylfPFPu-42g5QTMqLSA-1; Tue, 19 Nov 2019 06:46:25 -0500 Received: by mail-wm1-f69.google.com with SMTP id z3so2134116wmk.1 for ; Tue, 19 Nov 2019 03:46:25 -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=4vugy6COoZI9bdvkLowSYZAr9oW5DYd/NeaKzrs/9aE=; b=hyQfhJ9c5rE4uuY0s42aqCxMKh4QckBbv0d7yzOtWYsNNJgbuNoC3ge9jqFoClidCA LrDe0GWOvkXOdCQuG+QxJFplNhv1ubDcav38dcOnTE66Z6eHka6TGSZfp7p4eizYH0+b wDr7ehrF4LEve7SvbZeKwOfv6jxZb86rLNqPwMLMJy36+ShcRkvAYebqJkbNmksdFMdb UspOzHWZLOxxcJa5aM+3vYUaBXzSrepU1kKIHrjI6nkCXAAxhD0zO9P/P39TiLxfhXTF L/rCdgFhVteEynrA7E+ne9LqiqketCEpgyy/UFMFaLlNY26Hjs5+d3HaVvIIcZzK9Eap jrPA== X-Gm-Message-State: APjAAAUQzhZ2R8+jNbwcZciICQzfwkwKwgHF6i4F10y+5V6dJMyzPkcC YtO39LU+vjOAwkZOdZpbuEQ8jGH2k/zi3OZWjVgJo/nTtx2FHA0rG8DbDyZUHASr+o+rg9ha8zZ uoN3Z9uVHruNLWg== X-Received: by 2002:adf:f290:: with SMTP id k16mr19260835wro.224.1574163984216; Tue, 19 Nov 2019 03:46:24 -0800 (PST) X-Google-Smtp-Source: APXvYqwPp+kW+1JACjtuPpoJQWquDTm/WK3eXnhJ6l34Tz+WSysxtBjLgX5CJu8lE6YcCZ4YgvjD1Q== X-Received: by 2002:adf:f290:: with SMTP id k16mr19260800wro.224.1574163983905; Tue, 19 Nov 2019 03:46:23 -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 x11sm27285722wro.84.2019.11.19.03.46.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Nov 2019 03:46:23 -0800 (PST) Subject: Re: [edk2-platforms][PATCH v2 4/7] Platform/RPi: Use offsets for Bcm238x SoC register addresses 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-5-pete@akeo.ie> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: <3ba2d7f5-d29a-a9cb-eab7-b736eca3c222@redhat.com> Date: Tue, 19 Nov 2019 12:46:22 +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-5-pete@akeo.ie> X-MC-Unique: Qc4ylfPFPu-42g5QTMqLSA-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 > Remove hardcoded base addresses for Mailbox, Watchdog, SDIO and > DW2 USB and use an offset indexed on PcdBcm283xRegistersAddress > instead. This is needed in preparation for adding Raspberry Pi 4 > support. >=20 Similarly to the previous patch, I'd expect Samer's S-o-b. > Signed-off-by: Pete Batard > --- > Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwcHw.h | 4 +++= - > Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h | 8 +++= +++-- > Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Sdio.h | 4 +++= - > 3 files changed, 12 insertions(+), 4 deletions(-) >=20 > diff --git a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwcHw.h b/Platform= /RaspberryPi/Drivers/DwUsbHostDxe/DwcHw.h > index 88fd93934fd3..ddbf69a1d608 100644 > --- a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwcHw.h > +++ b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwcHw.h > @@ -10,7 +10,9 @@ > #ifndef __DWCHW_H__ > #define __DWCHW_H__ > =20 > -#define DW2_USB_BASE_ADDRESS 0x3f980000 > +#define DW2_USB_OFFSET 0x00980000 > +#define DW2_USB_BASE_ADDRESS (FixedPcdGet64 (PcdBcm283xRegist= ersAddress) \ > + + DW2_USB_OFFSET) > =20 > #define HSOTG_REG(x) (x) > =20 > diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h = b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > index 8bd68c234bfd..72c8e9dc4b14 100644 > --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > @@ -23,7 +23,9 @@ > #define BCM2836_DMA_DEVICE_OFFSET 0xc0000000 > =20 > /* watchdog constants */ > -#define BCM2836_WDOG_BASE_ADDRESS 0x3f100000 > +#define BCM2836_WDOG_OFFSET 0x00100000 > +#define BCM2836_WDOG_BASE_ADDRESS (FixedPcdGet= 64 (PcdBcm283xRegistersAddress) \ > + + BCM2836_WD= OG_OFFSET) > #define BCM2836_WDOG_PASSWORD 0x5a000000 > #define BCM2836_WDOG_RSTC_OFFSET 0x0000001c > #define BCM2836_WDOG_WDOG_OFFSET 0x00000024 > @@ -31,7 +33,9 @@ > #define BCM2836_WDOG_RSTC_WRCFG_FULL_RESET 0x00000020 > =20 > /* mailbox interface constants */ > -#define BCM2836_MBOX_BASE_ADDRESS 0x3f00b880 > +#define BCM2836_MBOX_OFFSET 0x0000b880 > +#define BCM2836_MBOX_BASE_ADDRESS (FixedPcdGet= 64 (PcdBcm283xRegistersAddress) \ > + + BCM2836_MB= OX_OFFSET) I'm glad you considered v1 comment, now v2 is way simpler to review. Reviewed-by: Philippe Mathieu-Daude > #define BCM2836_MBOX_READ_OFFSET 0x00000000 > #define BCM2836_MBOX_STATUS_OFFSET 0x00000018 > #define BCM2836_MBOX_CONFIG_OFFSET 0x0000001c > diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Sdi= o.h b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Sdio.h > index fb0d02904156..708a1d7a4f47 100644 > --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Sdio.h > +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836Sdio.h > @@ -10,7 +10,9 @@ > #define __BCM2836_SDIO_H__ > =20 > //MMC/SD/SDIO1 register definitions. > -#define MMCHS1BASE 0x3F300000 > +#define MMCHS1_OFFSET 0x00300000 > +#define MMCHS1BASE (FixedPcdGet64 (PcdBcm283xRegistersAddress) \ > + + MMCHS1_OFFSET) > =20 > #define MMCHS_BLK (MMCHS1BASE + 0x4) > #define BLEN_512BYTES (0x200UL << 0) >=20