From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.groups.io with SMTP id smtpd.web11.12286.1582886364520658036 for ; Fri, 28 Feb 2020 02:39:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=aYgoqmx4; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.221.65, mailfrom: pete@akeo.ie) Received: by mail-wr1-f65.google.com with SMTP id p18so2347631wre.9 for ; Fri, 28 Feb 2020 02:39:24 -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=ehceZM5vfZxF3nglnd+j1dj0fGtm9om3e1x504Exte0=; b=aYgoqmx4XEX86YCd345FWsjg+sJQjNv2U1S7Zd+jzGAvcsajOHgTJWB/T3cw80IiZU YgY8gGbJdCwFWf4nkPxrV+Qjfz5mWh9ZkpEwUcWWE7MLVpYpKeUYN7xz++rHOWkWvxeP w2yNhhJ25GyfBPPcnxf4RYi7uHYoPkNIu6MFm6AlXaxFRj/93kbUE9pQvGDacWnilrLk bVBj8YJ+LRHeOgl6OCo79g9+gML7vSeB4Wdjb+ARam0oIp5YVyIjpfYYXsKGvc41+hF/ M66QAkvKIMvVSGAfwu6TSSpBDnoW2jrWNph3nHw06FzLw28ykLi6P2jWus76dLj6UtnH Z+dQ== 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=ehceZM5vfZxF3nglnd+j1dj0fGtm9om3e1x504Exte0=; b=b2pimBSwzsOkaBcfBaTjqZERN9cLi+EGj0TmRu4oE7k1btvJMyt0fPqYo4HHOdYobe Yp2BHInSnef8OQGpslfibyZSplofOavc067n9peZF8sMBsHXORWBguyTWaWQC2jhG/d1 w/l0d3bXJ1ker/I1Qtg0PhcNsErjFKN6Dun7Q0sfMvprQbme7n5P7sFPAl6GIAzmBxf6 uoSUufK83kTYMeirhdtx/CTL9lQYuo19a4SwOrQe6E7XOnPt9+5B8T1ezJLbBnTRg9hi bO3mAP94I0Zo1DmdSWYdHyN6bipm6QB1Hgym9aPi7hjcZihQEQTw7Ot1DyduVqqes1Mz Ra9w== X-Gm-Message-State: APjAAAVLHnP7FJQVodVqji4qGCt4IfevCy7N7Oe3fkOFYJPJbEBinq71 NPekktWb12HefZVe08XARmprgALplrQ= X-Google-Smtp-Source: APXvYqzbkGZxOoiclpOZtFP6ZCOK/Z8xXftt+cwlIXEb178InhWquQouEzx1QSa/37agHEdJ3vS7+w== X-Received: by 2002:a5d:6408:: with SMTP id z8mr4284278wru.122.1582886362753; Fri, 28 Feb 2020 02:39:22 -0800 (PST) Return-Path: Received: from localhost.localdomain ([84.203.56.244]) by smtp.gmail.com with ESMTPSA id s8sm12341061wrt.57.2020.02.28.02.39.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:22 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif@nuviainc.com, philmd@redhat.com Subject: [edk2-platforms][PATCH 10/15] Platform/RPi4: Add RPI_MODEL constant and replace PL011_ENABLE Date: Fri, 28 Feb 2020 10:38:50 +0000 Message-Id: <20200228103855.11352-11-pete@akeo.ie> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20200228103855.11352-1-pete@akeo.ie> References: <20200228103855.11352-1-pete@akeo.ie> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Since there are multiple Raspberry Pi Models and a lot of the code we use can be factorized, it is useful to have an RPI_MODEL build time constant, set to the platform model number, that can be referenced in the source. Make use this new constant to replace the PL011_ENABLE feature check. Signed-off-by: Pete Batard --- Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf | 7 ------- Platform/RaspberryPi/RPi4/AcpiTables/Dbg2.aslc | 2 +- Platform/RaspberryPi/RPi4/AcpiTables/Spcr.aslc | 3 ++- Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl | 2 +- Platform/RaspberryPi/RPi4/RPi4.dsc | 4 ++++ 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf b/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf index 358c315b6da1..c95d75ed01bb 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf +++ b/Platform/RaspberryPi/RPi4/AcpiTables/AcpiTables.inf @@ -56,10 +56,3 @@ [FixedPcd] gBcmNetTokenSpaceGuid.PcdBcmGenetRegistersAddress gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress - -# The following is a stopgap solution to default to PL011 -# usage in ACPI (most common case), until we can switch -# to using DynamicTablesPkg/ConfigurationManagerDxe. -[BuildOptions] - GCC:*_*_*_ASLPP_FLAGS = -DPL011_ENABLE - GCC:*_*_*_ASLCC_FLAGS = -DPL011_ENABLE diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Dbg2.aslc b/Platform/RaspberryPi/RPi4/AcpiTables/Dbg2.aslc index dcad8e205596..c3d5994f8e97 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Dbg2.aslc +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Dbg2.aslc @@ -23,7 +23,7 @@ #define RPI_DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS 1 #define RPI_DBG2_NAMESPACESTRING_FIELD_SIZE 10 -#ifdef PL011_ENABLE +#if (RPI_MODEL == 4) #define RPI_UART_INTERFACE_TYPE EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART #define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART_BASE_ADDRESS #define RPI_UART_LENGTH BCM2836_PL011_UART_LENGTH diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Spcr.aslc b/Platform/RaspberryPi/RPi4/AcpiTables/Spcr.aslc index cb17fbe0ff2f..bec4ad660ec9 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Spcr.aslc +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Spcr.aslc @@ -18,7 +18,8 @@ #define RPI_UART_FLOW_CONTROL_NONE 0 -#ifdef PL011_ENABLE +// Prefer PL011 serial output on the Raspberry Pi 4 +#if (RPI_MODEL == 4) #define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART #define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART_BASE_ADDRESS #define RPI_UART_INTERRUPT BCM2836_PL011_UART_INTERRUPT diff --git a/Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl b/Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl index ad9d21e6272d..1be285220ad7 100644 --- a/Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl +++ b/Platform/RaspberryPi/RPi4/AcpiTables/Uart.asl @@ -140,7 +140,7 @@ Device(BTH0) // no flow control. 16, // ReceiveBufferSize 16, // TransmitBufferSize -#ifdef PL011_ENABLE +#if (RPI_MODEL == 4) "\\_SB.URTM", // ResourceSource: #else "\\_SB.URT0", // ResourceSource: diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4/RPi4.dsc index 7c1937672597..09bd19e3b724 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -229,6 +229,10 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] ################################################################################################### [BuildOptions] + GCC:*_*_*_CC_FLAGS = -DRPI_MODEL=4 + GCC:*_*_*_ASLPP_FLAGS = -DRPI_MODEL=4 + GCC:*_*_*_ASLCC_FLAGS = -DRPI_MODEL=4 + GCC:*_*_*_VFRPP_FLAGS = -DRPI_MODEL=4 GCC:*_*_AARCH64_DLINK_FLAGS = -Wl,--fix-cortex-a53-843419 GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG -DNDEBUG -- 2.21.0.windows.1