From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by mx.groups.io with SMTP id smtpd.web11.6525.1573747684925150847 for ; Thu, 14 Nov 2019 08:08:05 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=iKJySuiX; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.128.68, mailfrom: pete@akeo.ie) Received: by mail-wm1-f68.google.com with SMTP id z19so6532088wmk.3 for ; Thu, 14 Nov 2019 08:08:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NXbOmm0i0E5vY77QVblSJph5eZQlgQqlgQMoxklkqOM=; b=iKJySuiXtmp0InGrNt4lOKBa+/b2scT3TMYjzt+kbQvrtbzp/wNxVDHWL0OU2HoaxC DSvZ14zcebqYCE4uLULuJuohqjJAKNgn4BLHPYOaTq5tcYcpcCEOjiptLCw+TfAEG19E VwuiG/L234bN+D4PR3xlT7bGtzp0XMPfkfbXdILK1HICG93tVFxY5cFJctG0Ew130nbc bPaVvKYcitvIQMOvYDp6bN+UVgECWHWxSS8XI0cTu16WLHOfftbjEv5mf87B3erpXOSa HlZwUvrltZCxZdLY2lZxHbd69zK4lfZxKVvujghGbm0tRp81zGbfcz4kdEC/+m7mzUdV ETEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NXbOmm0i0E5vY77QVblSJph5eZQlgQqlgQMoxklkqOM=; b=RNsQQFZvUt6nqdU/RSBJQfWcpKr7JF1wScuIwI+vmV6VJBBfXKyDAWG5EK2SEVhwqb O4uqFkc1lBGsxJncxFukowgudEKZvaoMIopr0I3ti2pX3hAjQSwMn3q0LhI+S/wcFFQF cUx1iFNpnSM4OCCph9Kz2HQhLQ31u7IrKpMljhDaHCMNMTqRWPRYHAIEwKUeoUbSSxXU o4w+4YI0S58oKj4GMB7nhb1Ushl5drymAoM2gsQ0uOhHKVLIZ1ZzCH96+msSj2NmBvTW tyBc11SmP4WQzImSKwAj3r/quE1u6eF4Y9xa8bm58tZeo+LAGxYX2GlV0ocaDwTUJdyj 6O5A== X-Gm-Message-State: APjAAAWDJoIxP1aogb4iz09n1NZ1SpJNHjhhC1FP6GEEu+Bq0eyjWX5I YcMaBsru020msT4NqD5UmhEC0sDmv4E= X-Google-Smtp-Source: APXvYqyapV+L8o4o1NGb3HLpSpk5QAudc0Szbp3xIduIitqwgvwDBvg89rqCNOCF1sGFW0Fq1A0/rg== X-Received: by 2002:a1c:2d4b:: with SMTP id t72mr9291591wmt.112.1573747683104; Thu, 14 Nov 2019 08:08:03 -0800 (PST) Return-Path: Received: from localhost.localdomain ([84.203.67.47]) by smtp.gmail.com with ESMTPSA id a16sm6793088wmd.11.2019.11.14.08.08.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Nov 2019 08:08:02 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, philmd@redhat.com Subject: [edk2-platforms][PATCH 6/8] Platform/RPi: Replace Mailbox and Watchdog addresses with PCDs Date: Thu, 14 Nov 2019 16:07:38 +0000 Message-Id: <20191114160740.10072-7-pete@akeo.ie> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20191114160740.10072-1-pete@akeo.ie> References: <20191114160740.10072-1-pete@akeo.ie> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Samer El-Haj-Mahmoud 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. 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(-) diff --git a/Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.inf 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] [FixedPcd] gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress + gBcm283xTokenSpaceGuid.PcdMboxBaseAddress [Depex] TRUE diff --git a/Platform/RaspberryPi/Library/PlatformLib/PlatformLib.inf b/Platform/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 [Ppis] gArmMpCoreInfoPpiGuid diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3/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 + gBcm283xTokenSpaceGuid.PcdMboxBaseAddress|0x3f00b880 + gBcm283xTokenSpaceGuid.PcdWdogBaseAddress|0x3f100000 + ## NS16550 compatible UART gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x3f215040 gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|TRUE diff --git a/Silicon/Broadcom/Bcm283x/Bcm283x.dec b/Silicon/Broadcom/Bcm283x/Bcm283x.dec index 5b839b00d286..fe1907cb8cf1 100644 --- a/Silicon/Broadcom/Bcm283x/Bcm283x.dec +++ b/Silicon/Broadcom/Bcm283x/Bcm283x.dec @@ -21,3 +21,5 @@ [Guids] [PcdsFixedAtBuild.common] gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress|0x0|UINT32|0x00000001 + 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 /* watchdog constants */ -#define BCM2836_WDOG_BASE_ADDRESS 0x3f100000 +#define BCM2836_WDOG_BASE_ADDRESS (FixedPcdGet64 (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 /* mailbox interface constants */ -#define BCM2836_MBOX_BASE_ADDRESS 0x3f00b880 +#define BCM2836_MBOX_BASE_ADDRESS (FixedPcdGet64 (PcdMboxBaseAddress)) #define BCM2836_MBOX_READ_OFFSET 0x00000000 #define BCM2836_MBOX_STATUS_OFFSET 0x00000018 #define BCM2836_MBOX_CONFIG_OFFSET 0x0000001c -- 2.21.0.windows.1