From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web10.13883.1576257286186167957 for ; Fri, 13 Dec 2019 09:14:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SN2VWMv5; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576257285; 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=qngSuURgaHvUBUVJ4G6GKEfEY2avJStM1Mblp6nTKkM=; b=SN2VWMv5lnJP4/3fKsJhMpBVkg2VWuRDJL+HPu7HYH93zjjt50F9FdSk50meK9fVN8z0f2 pbEwY9QsYkXNBErpR0AUXXsWy7lmQVQdyKsuCpelB0aN8uHpLhQEPLxQlyhpLzoB8lI4oK uNpvwUlfX42oddBYsXAszLuOgqFaM5s= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-122-OXpGde5eNiqzYnFwMKTjQw-1; Fri, 13 Dec 2019 12:14:41 -0500 Received: by mail-wr1-f71.google.com with SMTP id z10so2795798wrt.21 for ; Fri, 13 Dec 2019 09:14:41 -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=qngSuURgaHvUBUVJ4G6GKEfEY2avJStM1Mblp6nTKkM=; b=BNpW3c/HmIXq6qzi+h0NKYT96cu4Zv7zeX92Mxzmytz9V3IQh0uisEU/gGXMtzqB4x +13B1Sm6rHrBey7ZXwC3o7CI3vN0k7kKjmIlgDEuBqS9QDGsqXIMIEQ1KKQYrydV5Jhn g8jDoQ9wu5SKfapTpu/ulBjfaZvyczIcjmIdbGIZ/idz4XauWLGIVxKHanOpMQfbe3dI xQ/tMpiBQHhDrRROZDwu0GOO25lb63mKejED1cO1bg9Bo+mkbwJWCNbQJb8HI2rFwCSx 5LCq7QMKr3Sgm/oLUoHZ/Hgt4/rbffId4UWgcijIe/oPPSVBBdAxwOLYHcZ05eCTc5NI NmeA== X-Gm-Message-State: APjAAAW9dvdRuTMYGrDx7LcpH4QQBYzk4KJ5HtExqH921uVE8vp1VWpY t69MUHtWLM5Dem9GTTR+4oAuvkGIJykpRoBy0urpCiwRNINDsIoxn3vPi3JGWxSiZlqpFmLSzjH sxtdnFnGUJ18MTQ== X-Received: by 2002:adf:fe07:: with SMTP id n7mr14183315wrr.286.1576257280360; Fri, 13 Dec 2019 09:14:40 -0800 (PST) X-Google-Smtp-Source: APXvYqzm96IO6RX7eH9YdB6gqPKEgiuDr6tILUgOT2gqzeAzSka21RGKims9+q/ZPPseZ7M0bWkXlw== X-Received: by 2002:adf:fe07:: with SMTP id n7mr14183290wrr.286.1576257280098; Fri, 13 Dec 2019 09:14:40 -0800 (PST) Return-Path: Received: from [192.168.1.35] (34.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.34]) by smtp.gmail.com with ESMTPSA id m7sm10838871wma.39.2019.12.13.09.14.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Dec 2019 09:14:39 -0800 (PST) Subject: Re: [edk2-platforms][PATCH v2 4/4] Platform/RPi4: Build the PCIe and xHCI drivers into the firmware To: Pete Batard , devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, lintonrjeremy@gmail.com References: <20191213170704.8120-1-pete@akeo.ie> <20191213170704.8120-5-pete@akeo.ie> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: Date: Fri, 13 Dec 2019 18:14:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191213170704.8120-5-pete@akeo.ie> X-MC-Unique: OXpGde5eNiqzYnFwMKTjQw-1 X-Mimecast-Spam-Score: 0 Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 12/13/19 6:07 PM, Pete Batard wrote: > From: Jeremy Linton > > This uses the recently introduced NonCoherentIoMmuDxe for PCIe access > and should enable USB device usage in the UEFI environment. > > As mentioned in https://lkml.org/lkml/2019/9/9/170, imposing a 3 GB > DMA limit might be necessary for the 4 GB models so we follow suit by > setting PcdDmaDeviceLimit to 3 GB - 1 in NonCoherentIoMmuDxe. > > Note that this patch does not provide xHCI ACPI support because the > required Xhci.asl table will be provided in a later commit. > > Signed-off-by: Pete Batard > --- > Platform/RaspberryPi/RPi4/RPi4.dsc | 29 +++++++++++++++++++- > Platform/RaspberryPi/RPi4/RPi4.fdf | 10 ++++++- > Platform/RaspberryPi/RPi4/Readme.md | 23 +++++----------- > 3 files changed, 44 insertions(+), 18 deletions(-) > > diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4/RPi4.dsc > index 03139e57a8db..00b75741702a 100644 > --- a/Platform/RaspberryPi/RPi4/RPi4.dsc > +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc > @@ -161,6 +161,14 @@ [LibraryClasses.common] > VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf > GpioLib|Silicon/Broadcom/Bcm283x/Library/GpioLib/GpioLib.inf > > + # > + # PCI dependencies > + # > + # PCI root port configuation and description > + PciHostBridgeLib|Silicon/Broadcom/Bcm27xx/Library/Bcm2711PciHostBridgeLib/Bcm2711PciHostBridgeLib.inf > + # The "segment lib" provides the CAM accessors/etc when they aren't ECAM standard > + PciSegmentLib|Silicon/Broadcom/Bcm27xx/Library/Bcm2711PciSegmentLib/PciSegmentLib.inf > + > [LibraryClasses.common.SEC] > PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf > @@ -318,6 +326,7 @@ [PcdsFixedAtBuild.common] > gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData|0 > > gEmbeddedTokenSpaceGuid.PcdDmaDeviceOffset|0xc0000000 > + gEmbeddedTokenSpaceGuid.PcdDmaDeviceLimit|0xffffffff > > gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"EDK2-DEV" > > @@ -378,6 +387,12 @@ [PcdsFixedAtBuild.common] > gBcm27xxTokenSpaceGuid.PcdBcm27xxRegistersAddress|0xfc000000 > gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress|0xfe000000 > > + # PCIe specific addresses > + gBcm27xxTokenSpaceGuid.PcdBcm27xxPciRegBase|0xfd500000 > + gBcm27xxTokenSpaceGuid.PcdBcm27xxPciBusMmioAdr|0xf8000000 > + gBcm27xxTokenSpaceGuid.PcdBcm27xxPciBusMmioLen|0x3ffffff > + gBcm27xxTokenSpaceGuid.PcdBcm27xxPciCpuMmioAdr|0x600000000 > + > ## NS16550 compatible UART > gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0xfe215040 > gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|TRUE > @@ -525,7 +540,6 @@ [Components.common] > > MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf > > - UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf > ArmPkg/Drivers/ArmGic/ArmGicDxe.inf > Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.inf > Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf > @@ -587,6 +601,7 @@ [Components.common] > # > # USB Support > # > + MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf > Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.inf > MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf > MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf > @@ -610,6 +625,18 @@ [Components.common] > # > Silicon/Broadcom/Bcm283x/Drivers/Bcm2838RngDxe/Bcm2838RngDxe.inf > > + # > + # PCI Support > + # > + ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf > + MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf > + MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf > + EmbeddedPkg/Drivers/NonCoherentIoMmuDxe/NonCoherentIoMmuDxe.inf { > + > + gEmbeddedTokenSpaceGuid.PcdDmaDeviceOffset|0x00000000 > + gEmbeddedTokenSpaceGuid.PcdDmaDeviceLimit|0xbfffffff > + } > + > # > # UEFI application (Shell Embedded Boot Loader) > # > diff --git a/Platform/RaspberryPi/RPi4/RPi4.fdf b/Platform/RaspberryPi/RPi4/RPi4.fdf > index f0ab47c6c0a9..7a506bd2813b 100644 > --- a/Platform/RaspberryPi/RPi4/RPi4.fdf > +++ b/Platform/RaspberryPi/RPi4/RPi4.fdf > @@ -205,7 +205,6 @@ [FV.FvMain] > INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf > INF Platform/RaspberryPi/Drivers/DisplayDxe/DisplayDxe.inf > > - INF UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf > INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf > INF Platform/RaspberryPi/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.inf > INF Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf > @@ -269,6 +268,14 @@ [FV.FvMain] > # > INF Silicon/Broadcom/Bcm283x/Drivers/Bcm2838RngDxe/Bcm2838RngDxe.inf > > + # > + # PCI Support > + # > + INF ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf > + INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf > + INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf > + INF EmbeddedPkg/Drivers/NonCoherentIoMmuDxe/NonCoherentIoMmuDxe.inf > + > # > # SCSI Bus and Disk Driver > # > @@ -278,6 +285,7 @@ [FV.FvMain] > # > # USB Support > # > + INF MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf > INF Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.inf > INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf > INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf > diff --git a/Platform/RaspberryPi/RPi4/Readme.md b/Platform/RaspberryPi/RPi4/Readme.md > index 917f8436a382..2e37646e043d 100644 > --- a/Platform/RaspberryPi/RPi4/Readme.md > +++ b/Platform/RaspberryPi/RPi4/Readme.md > @@ -7,28 +7,19 @@ This is a port of 64-bit Tiano Core UEFI firmware for the Raspberry Pi 4 platfor > > This is intended to be useful 64-bit [TF-A](https://www.trustedfirmware.org/) + > UEFI implementation for the Raspberry Pi 4 which should be good enough for most > -kind of UEFI development, as well as for running consummer Operating Systems > -such as Linux or Windows. > +kind of UEFI development, as well as for running consummer Operating Systems. > > Raspberry Pi is a trademark of the [Raspberry Pi Foundation](https://www.raspberrypi.org). > > # Status > > -This firmware is still in early stage of development, meaning that it comes with > -the following __major__ limitations: > +This firmware is still in development stage, meaning that it comes with the > +following __major__ limitations: > > -- USB is not supported yet (will be added soon) > -- Booting of vanilla Operating Systems (Windows, Linux) is not supported yet, > - let alone expected to work at all. > - > -The only features that are expected to work with this first iteration of the > -firmware are HDMI and serial I/O. > - > -## Known issues > - > -- The serial output from TF-A is garbled when using a `start4.elf` that was > - released after 2019.11.18. This is a TF-A issue that will be fixed in a > - later version. > +- USB is likely to work only in pre-OS phase at this stage (nonstandard ECAM, > + missing ACPI tables). > +- Serial I/O from the OS may not work at all due to CPU throttling affecting > + the miniUART baudrate. > > # Building > > Acked-by: Philippe Mathieu-Daude