From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by mx.groups.io with SMTP id smtpd.web10.12439.1582886368422448547 for ; Fri, 28 Feb 2020 02:39:28 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=ulRChreJ; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.128.67, mailfrom: pete@akeo.ie) Received: by mail-wm1-f67.google.com with SMTP id a5so2687952wmb.0 for ; Fri, 28 Feb 2020 02:39:28 -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=iNaiva1OE7JjpeNKI0fqYekfHzYNfW2kFqjuP5S/aSk=; b=ulRChreJbQkCmMu9YEoieRoJRM0xKluvTYE4u0fqP4jenYtI9qqnk/IYbk6saYcb7U qVoySiXGfkZyxb6rx76MOVa2XKfy40h1ceALeiA97FhxBgUJk9x0PIKMGVs6fk1fpMVG XcIEIg00QGETgmrchekjPRqZqOVFo8+7YSgij0LIIyTNCUCq9nH/awcX4Uvq2A7+qqti qKM2Iza734aX5HH6Fy8oWZT68TfcrAiNzi15/VY/0lJgGbjPH1gnszyQbk0RtkvJwrPT NkMeBvRXhoNGR6HJy2M8tiIVcnv0li4rC4mB4Y94JY5Q+JcBJeerUSPxRXJM/yPNI6El +tCQ== 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=iNaiva1OE7JjpeNKI0fqYekfHzYNfW2kFqjuP5S/aSk=; b=N5ASnc7if8W0vCMphpsLAoUd0HuA4cADJx6i+8ouMeLNEziivnRmFHRoko0awmAHZh qSST/N4t38TjayuKy8myoW2cB93+jlAlMBfESiZlZLDHA/NrR9/taHcjpNoh3VzJtBNk 90YxCfRZ/5jMRDbL92QCvn+5KI5YOyv3cUaegVeU2M0DtR9mKRrHYyX8E7tSd2gqSgg7 ToKPW6B/Dh58F92LZNZeMhfc4nAEkPRKsdcsTxjVjI65gDxJcn3UY66QIZo7k4m+Sg+g xVtuS1PuiU91t48u56tOJHwDod9yB+ZPyJe2v80hB8OQez12+Gg52KRQ6L5oaMBrF78x mkFA== X-Gm-Message-State: APjAAAXLrOc001T5acA/sck30IvD8icgwAW57GqOiAVxWkaekUCC5EHr 8JTPSKQGKtnrZ1ygvLBoAIE/HAtGAsQ= X-Google-Smtp-Source: APXvYqxgK4aa305DMDvB8yemACsqkaRqiqRlfjPWdirxIGwmNyXGZ6iPVbjAe++1Kh25o9vysFlEyg== X-Received: by 2002:a1c:a5c2:: with SMTP id o185mr2233943wme.173.1582886366327; Fri, 28 Feb 2020 02:39:26 -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.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2020 02:39:25 -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 12/15] Platform/RPi3: Move ACPI interrupts definitions to AcpiTables.h Date: Fri, 28 Feb 2020 10:38:52 +0000 Message-Id: <20200228103855.11352-13-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 The ACPI interrupts are not the same across different Raspberry Pi platforms therefore moving them into AcpiTables.h will help with ACPI code factorization. Signed-off-by: Pete Batard --- Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h | 26 +++++++++++++++ Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl | 34 ++++++++++---------- Platform/RaspberryPi/RPi3/AcpiTables/Sdhc.asl | 4 +-- Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc | 4 +-- Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl | 4 +-- 5 files changed, 49 insertions(+), 23 deletions(-) diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h b/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h index c860b7881842..be97fc4c1eff 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h +++ b/Platform/RaspberryPi/RPi3/AcpiTables/AcpiTables.h @@ -97,4 +97,30 @@ typedef struct UINT32 UID; // 4 bytes } EFI_ACPI_5_1_CSRT_RESOURCE_DESCRIPTOR_HEADER; +//------------------------------------------------------------------------ +// Interrupts. These are specific to each platform +//------------------------------------------------------------------------ +#define BCM2836_USB_INTERRUPT 0x29 +#define BCM2836_V3D_BUS_INTERRUPT 0x2A +#define BCM2836_DMA_INTERRUPT 0x3B +#define BCM2836_SPI1_INTERRUPT 0x3D +#define BCM2836_SPI2_INTERRUPT 0x3D +#define BCM2836_HVS_INTERRUPT 0x41 +#define BCM2836_HDMI0_INTERRUPT 0x48 +#define BCM2836_HDMI1_INTERRUPT 0x49 +#define BCM2836_PV2_INTERRUPT 0x4A +#define BCM2836_PV0_INTERRUPT 0x4D +#define BCM2836_PV1_INTERRUPT 0x4E +#define BCM2836_MBOX_INTERRUPT 0x61 +#define BCM2836_VCHIQ_INTERRUPT 0x62 +#define BCM2386_GPIO_INTERRUPT0 0x51 +#define BCM2386_GPIO_INTERRUPT1 0x53 +#define BCM2836_I2C1_INTERRUPT 0x55 +#define BCM2836_I2C2_INTERRUPT 0x55 +#define BCM2836_SPI0_INTERRUPT 0x56 +#define BCM2836_SDHOST_INTERRUPT 0x58 +#define BCM2836_MMCHS1_INTERRUPT 0x5E +#define BCM2836_MINI_UART_INTERRUPT 0x3D +#define BCM2836_PL011_UART_INTERRUPT 0x59 + #endif // __ACPITABLES_H__ diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl b/Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl index 693e4b15e985..1e17ec901042 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Dsdt.asl @@ -85,7 +85,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_USB_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x29 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_USB_INTERRUPT } }) Method (_CRS, 0x0, Serialized) { @@ -109,32 +109,32 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) { // Memory and interrupt for the GPU MEMORY32FIXED (ReadWrite, 0, BCM2836_V3D_BUS_LENGTH, RM01) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x2A } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_V3D_BUS_INTERRUPT } // HVS - Hardware Video Scalar MEMORY32FIXED (ReadWrite, 0, BCM2836_HVS_LENGTH, RM02) // The HVS interrupt is reserved by the VPU - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x41 } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_HVS_INTERRUPT } // PixelValve0 - DSI0 or DPI // MEMORY32FIXED (ReadWrite, BCM2836_PV0_BASE_ADDRESS, BCM2836_PV0_LENGTH, RM03) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x4D } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_PV0_INTERRUPT } // PixelValve1 - DS1 or SMI // MEMORY32FIXED (ReadWrite, BCM2836_PV1_BASE_ADDRESS, BCM2836_PV1_LENGTH, RM04) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x4E } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_PV1_INTERRUPT } // PixelValve2 - HDMI output - connected to HVS display FIFO 1 MEMORY32FIXED (ReadWrite, 0, BCM2836_PV2_LENGTH, RM05) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x4A } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_PV2_INTERRUPT } // HDMI registers MEMORY32FIXED (ReadWrite, 0, BCM2836_HDMI0_LENGTH, RM06) MEMORY32FIXED (ReadWrite, 0, BCM2836_HDMI1_LENGTH, RM07) // hdmi_int[0] - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x48 } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_HDMI0_INTERRUPT } // hdmi_int[1] - // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x49 } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_HDMI1_INTERRUPT } // HDMI DDC connection I2CSerialBus (0x50,, 100000,, "\\_SB.I2C2",,,,) // EDID @@ -212,7 +212,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_MBOX_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x61 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_MBOX_INTERRUPT } }) Method (_CRS, 0x0, Serialized) @@ -237,7 +237,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_VCHIQ_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x62 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_VCHIQ_INTERRUPT } }) Method (_CRS, 0x0, Serialized) @@ -275,7 +275,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, GPIO_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x51, 0x53 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2386_GPIO_INTERRUPT0, BCM2386_GPIO_INTERRUPT1 } }) Method (_CRS, 0x0, Serialized) { @@ -298,7 +298,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_I2C1_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x55 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_I2C1_INTERRUPT } // // MsftFunctionConfig is encoded as the VendorLong. @@ -337,7 +337,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) Name (RBUF, ResourceTemplate() { MEMORY32FIXED (ReadWrite, 0, BCM2836_I2C2_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x55 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_I2C2_INTERRUPT } }) Method (_CRS, 0x0, Serialized) @@ -361,7 +361,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_SPI0_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { 0x56 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_SPI0_INTERRUPT } // // MsftFunctionConfig is encoded as the VendorLong. @@ -428,7 +428,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_SPI1_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { 0x3D } + Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { BCM2836_SPI1_INTERRUPT } // // MsftFunctionConfig is encoded as the VendorLong. @@ -484,7 +484,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) // Name (RBUF, ResourceTemplate () // { // MEMORY32FIXED (ReadWrite, BCM2836_SPI2_BASE_ADDRESS, BCM2836_SPI2_LENGTH, RMEM) - // Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { 0x3D } + // Interrupt (ResourceConsumer, Level, ActiveHigh, Shared,) { BCM2836_SPI2_INTERRUPT } // }) // Return (RBUF) // } @@ -514,7 +514,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "MSFT", "EDK2", 2) // PWM clock control MEMORY32FIXED (ReadWrite, 0, BCM2836_PWM_CLK_LENGTH, RM03) // Interrupt DMA channel 11 - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x3B } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_DMA_INTERRUPT } // DMA channel 11, DREQ 5 for PWM FixedDMA (5, 11, Width32Bit, ) }) diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Sdhc.asl b/Platform/RaspberryPi/RPi3/AcpiTables/Sdhc.asl index f7553280b60e..0ab1ba27f2cf 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Sdhc.asl +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Sdhc.asl @@ -37,7 +37,7 @@ Device (SDC1) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, MMCHS1_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x5E } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_MMCHS1_INTERRUPT } }) Method (_CRS, 0x0, Serialized) { @@ -81,7 +81,7 @@ Device (SDC2) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, SDHOST_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x58 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_SDHOST_INTERRUPT } }) Method (_CRS, 0x0, Serialized) { diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc b/Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc index cfa1734a3980..cb17fbe0ff2f 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Spcr.aslc @@ -21,11 +21,11 @@ #ifdef PL011_ENABLE #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 0x59 +#define RPI_UART_INTERRUPT BCM2836_PL011_UART_INTERRUPT #else #define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_BCM2835_UART #define RPI_UART_BASE_ADDRESS BCM2836_MINI_UART_BASE_ADDRESS -#define RPI_UART_INTERRUPT 0x3D +#define RPI_UART_INTERRUPT BCM2836_MINI_UART_INTERRUPT #endif STATIC EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr = { ACPI_HEADER ( diff --git a/Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl b/Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl index ddab63f15268..edd8bcc3b376 100644 --- a/Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl +++ b/Platform/RaspberryPi/RPi3/AcpiTables/Uart.asl @@ -28,7 +28,7 @@ Device (URT0) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_PL011_UART_LENGTH, RMEM) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x59 } + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_PL011_UART_INTERRUPT } }) Method (_CRS, 0x0, Serialized) { @@ -68,7 +68,7 @@ Device (URTM) Name (RBUF, ResourceTemplate () { MEMORY32FIXED (ReadWrite, 0, BCM2836_MINI_UART_LENGTH, RMEM) - Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) { 0x3D } + Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_MINI_UART_INTERRUPT } // NTRAID#MSFT-7141401-2016/04/7-jordanrh - disable UART muxing // until a proper solution can be created for the dmap conflict. -- 2.21.0.windows.1