From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=XgN1Xn8v; spf=pass (domain: linaro.org, ip: 209.85.166.196, mailfrom: ard.biesheuvel@linaro.org) Received: from mail-it1-f196.google.com (mail-it1-f196.google.com [209.85.166.196]) by groups.io with SMTP; Thu, 16 May 2019 06:57:48 -0700 Received: by mail-it1-f196.google.com with SMTP id m141so6265656ita.3 for ; Thu, 16 May 2019 06:57:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5YkB0/mm1kQMGv9ST2QcyF9duvWnFevuxM2flgr5XzI=; b=XgN1Xn8vxBIUmq4axaBPvpMycmjuDIF0hVby7VMWyTFnyaUi9gc4A/Odjb+mnytXx4 +fgCapecRAVp1L3IAqCXkkmTa42sNhRqdBzq5r1MjfWdrEQvCBnZ08aOyjsCjUfbxDhj 2qrCTFLsKR0lfIGSrwp75VE1cSejQEetCsALxor2V/7ZKUkUEabd6rVaz+jutoKTRiLC uJnRTtxH6emZuELgCKtRI9/EalYO26k8zYjOblOiAyhvM+Q/8FHZtbQr3WOoK4hJF+uR KQzLABZfB1jPybMA+IqUYiIGLBEh1sPSQf4OZ66k9gZjuDZVvEAaFEVWQNIsFizxQWKh eVHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5YkB0/mm1kQMGv9ST2QcyF9duvWnFevuxM2flgr5XzI=; b=FxY4hVKgWtsIhPuw3WE6EW5qLPui+e7lo74er1R2SXrY4AJXXOifDQyGKSSZkmQCTy PfdBvmDVCZDdYE6ld6w9lV95ZCz+YWfWyT9a0wc7GwNuSMaLdcWyBq1SfDergKvj+5N1 M1a7438BrVvZfdDFC8T8m8COnnET8SkZSJPdiiWuzhisyYl5J4jMugwEXfgKwSXwN+ji vnp94ny9rlmJu3YZFBdeYhkhQVoQdrw9yz8GMUUKee7GVtHX2DN6MNDxUTHOiji9vvcg qfrMBtTSgvbSIzAsSm2RJVY7yS4z/g4VerZ0cQk5slQBOaHloPft0cZRghzk6gwv1ZTy dVmw== X-Gm-Message-State: APjAAAUX6MuzSbCk7IpAzn/CPZ/qcmy7EBo3Gbn+tLMCVN6kz2E9dXfZ h5MCMb9BYhCVC7DtiZ42lvna4b8dNcRdNuLvd26F4A== X-Google-Smtp-Source: APXvYqzySugo0kyj1NYinecvunjuhS33+gSD1gT2+9uA0nHnKaIgxwX0/LHQJMzrsu2HcIdKCVd25Jxozo10gLxK8nk= X-Received: by 2002:a05:660c:4c2:: with SMTP id v2mr13462234itk.71.1558015068014; Thu, 16 May 2019 06:57:48 -0700 (PDT) MIME-Version: 1.0 References: <1557395622-32425-1-git-send-email-mw@semihalf.com> <1557395622-32425-4-git-send-email-mw@semihalf.com> In-Reply-To: <1557395622-32425-4-git-send-email-mw@semihalf.com> From: "Ard Biesheuvel" Date: Thu, 16 May 2019 15:57:36 +0200 Message-ID: Subject: Re: [edk2-platforms: PATCH 03/14] Marvell/Library: ArmadaBoardDescLib: Add PCIE information To: Marcin Wojtas Cc: edk2-devel-groups-io , Leif Lindholm , =?UTF-8?B?SmFuIETEhWJyb8Wb?= , Grzegorz Jaszczyk , Kostya Porotchkin , Jici Gao , Rebecca Cran , kettenis@jive.eu Content-Type: text/plain; charset="UTF-8" On Thu, 9 May 2019 at 11:53, Marcin Wojtas wrote: > > Introduce new callback that can provide information > about PCIE controller per-board description. > A new structure is defined containing base addresses, > windows/bus configuration and reset GPIO usage indication. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Marcin Wojtas > --- > Silicon/Marvell/Include/Library/ArmadaBoardDescLib.h | 46 ++++++++++++++++++++ > 1 file changed, 46 insertions(+) > > diff --git a/Silicon/Marvell/Include/Library/ArmadaBoardDescLib.h b/Silicon/Marvell/Include/Library/ArmadaBoardDescLib.h > index 6ec5ace..530a2ba 100644 > --- a/Silicon/Marvell/Include/Library/ArmadaBoardDescLib.h > +++ b/Silicon/Marvell/Include/Library/ArmadaBoardDescLib.h > @@ -15,6 +15,7 @@ > #define __ARMADA_BOARD_DESC_LIB_H__ > > #include > +#include > > // > // COMPHY controllers per-board description > @@ -111,6 +112,51 @@ typedef struct { > } MV_BOARD_XHCI_DESC; > > // > +// PCIE controllers description > +// > +typedef struct { > + EFI_PHYSICAL_ADDRESS PcieBaseAddress; > + EFI_PHYSICAL_ADDRESS ConfigSpaceAddress; In EDK2, the PCIe base address is usually the ECAM base address, not the address of the DBI interface (which is not standardized by PCIe). So you can either avoid 'base' entirely, and use Dbi and Ecam/Config, or you can use 'base' for the latter, but not for the former. > + BOOLEAN HaveResetGpio; > + MV_GPIO_PIN PcieResetGpio; > + UINT64 PcieBusMin; > + UINT64 PcieBusMax; > + UINT64 PcieIoTranslation; > + UINT64 PcieIoWinBase; > + UINT64 PcieIoWinSize; > + UINT64 PcieMmio32Translation; > + UINT64 PcieMmio32WinBase; > + UINT64 PcieMmio32WinSize; > + UINT64 PcieMmio64Translation; > + UINT64 PcieMmio64WinBase; > + UINT64 PcieMmio64WinSize; > +} MV_PCIE_CONTROLLER; > + > +typedef struct { > + MV_PCIE_CONTROLLER *PcieControllers; > + UINTN PcieControllerCount; > +} MV_BOARD_PCIE_DESCRIPTION; > + > +/** > + Return the number and description of PCIE controllers used on the platform. > + > + @param[in out] **PcieControllers Array containing PCIE controllers' > + description. > + @param[in out] *PcieControllerCount Amount of used PCIE controllers. > + > + @retval EFI_SUCCESS The data were obtained successfully. > + @retval EFI_NOT_FOUND None of the controllers is used. > + @retval other Return error status. > + > +**/ > +EFI_STATUS > +EFIAPI > +ArmadaBoardPcieControllerGet ( > + IN OUT MV_PCIE_CONTROLLER **PcieControllers, Make this MV_PCIE_CONTROLLER CONST** if you can. > + IN OUT UINTN *PcieControllerCount > + ); > + > +// > // PP2 NIC devices per-board description > // > typedef struct { > -- > 2.7.4 >