From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::243; helo=mail-wr0-x243.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A6574210E38C6 for ; Mon, 18 Jun 2018 08:51:50 -0700 (PDT) Received: by mail-wr0-x243.google.com with SMTP id l10-v6so17402562wrn.2 for ; Mon, 18 Jun 2018 08:51:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=SBGnzPqOdMDkS1uo6xRJCtmfU5oGDARcWVTRxE0f7HY=; b=TdcMaK8dJHqgbF4nC2ntCPvvFehAZDlMcc2g0njoSLxB8JRW/5mz9aWeL5BtsjBtrj vJIt0FYDiJtUvOu/Xi8B5OJCKm3nyJSbBrcJZwONQOi0APX4O3NbhCl9RPyX6610Zgur zL9CPfd53tNQ4QIz8NBM966evwMAi7DOgZA9k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=SBGnzPqOdMDkS1uo6xRJCtmfU5oGDARcWVTRxE0f7HY=; b=FVZG1kUAigFSB55U2+B8Oq4kNVzHMhnc3NfyGHKYVckdcLVOwNWeiXhkChXI+D+deb fzJWucvfh4ppaTAH4TFES22fXuZr4hXa++bNRYJA+PMeCUVbehnmZeFFBY+mF16vAWG+ FO3WzesJi75fSqrgagmsXoLNRN5lc2VKYvCtIE7fCCAOSVzaUHT4geaSHNrEsFm4BgDv MO8sCQnpzdzGYtRainFHZPb3oFt3eZHlo/XiAUuNK5aVA5L6En1YpgbSNF6wIXMJUaU8 nLKQgL9fXespUdVl6LoqdUTjkV98m3M4BL//dRJyXZAWLmr9jd4mDtNj9ntcujqxt54V y78w== X-Gm-Message-State: APt69E2D7XQNuVT0AfuUs3NmIVNO4+A5GPNynCsP3ks7Yis6FrS/9HKS +GY8oVKZwINXrbWkLg2uiZ5lUg== X-Google-Smtp-Source: ADUXVKK2IN7vu2MKwQzaPu40TjIPsT1uqV2bw+zhITGji455rgaEb0tr4Q9Z5Ac1yhEugO0pi05eQQ== X-Received: by 2002:adf:86ae:: with SMTP id 43-v6mr9945782wrx.281.1529337109223; Mon, 18 Jun 2018 08:51:49 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id t14-v6sm17975839wrm.79.2018.06.18.08.51.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Jun 2018 08:51:48 -0700 (PDT) Date: Mon, 18 Jun 2018 16:51:46 +0100 From: Leif Lindholm To: Marcin Wojtas Cc: edk2-devel@lists.01.org, ard.biesheuvel@linaro.org, nadavh@marvell.com, jinghua@marvell.com, jsd@semihalf.com, jaz@semihalf.com Message-ID: <20180618155146.smkaj65eumtfg37l@bivouac.eciton.net> References: <1529266325-18371-1-git-send-email-mw@semihalf.com> <1529266325-18371-9-git-send-email-mw@semihalf.com> MIME-Version: 1.0 In-Reply-To: <1529266325-18371-9-git-send-email-mw@semihalf.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [platforms: PATCH v2 08/25] Marvell/Armada7k8k: Extend ArmadaSoCDescLib with PP2 information X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2018 15:51:51 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Jun 17, 2018 at 10:11:48PM +0200, Marcin Wojtas wrote: > This patch introduces new library callback (ArmadaSoCDescPp2Get ()), > which dynamically allocates and fills MV_SOC_PP2_DESC structure with > the SoC description of PP2 NICs. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Marcin Wojtas Reviewed-by: Leif Lindholm > --- > Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.h | 6 ++++ > Silicon/Marvell/Include/Library/ArmadaSoCDescLib.h | 15 ++++++++++ > Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.c | 29 ++++++++++++++++++++ > 3 files changed, 50 insertions(+) > > diff --git a/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.h b/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.h > index c5711b0..d63c3b5 100644 > --- a/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.h > +++ b/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.h > @@ -24,6 +24,12 @@ > #define MV_SOC_CP_BASE(Cp) (0xF2000000 + ((Cp) * 0x2000000)) > > // > +// Platform description of PP2 NIC > +// > +#define MV_SOC_PP2_BASE(Cp) MV_SOC_CP_BASE ((Cp)) > +#define MV_SOC_PP2_CLK_FREQ 333333333 > + > +// > // Platform description of UTMI PHY's > // > #define MV_SOC_UTMI_PER_CP_COUNT 2 > diff --git a/Silicon/Marvell/Include/Library/ArmadaSoCDescLib.h b/Silicon/Marvell/Include/Library/ArmadaSoCDescLib.h > index 0d45684..cafcc0f 100644 > --- a/Silicon/Marvell/Include/Library/ArmadaSoCDescLib.h > +++ b/Silicon/Marvell/Include/Library/ArmadaSoCDescLib.h > @@ -15,6 +15,21 @@ > #define __ARMADA_SOC_DESC_LIB_H__ > > // > +// PP2 NIC devices SoC description > +// > +typedef struct { > + UINTN Pp2BaseAddress; > + UINTN Pp2ClockFrequency; > +} MV_SOC_PP2_DESC; > + > +EFI_STATUS > +EFIAPI > +ArmadaSoCDescPp2Get ( > + IN OUT MV_SOC_PP2_DESC **Pp2Desc, > + IN OUT UINTN *DescCount > + ); > + > +// > // UTMI PHY devices SoC description > // > typedef struct { > diff --git a/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.c b/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.c > index 63fb224..61b4e30 100644 > --- a/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.c > +++ b/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.c > @@ -30,6 +30,35 @@ > > EFI_STATUS > EFIAPI > +ArmadaSoCDescPp2Get ( > + IN OUT MV_SOC_PP2_DESC **Pp2Desc, > + IN OUT UINTN *DescCount > + ) > +{ > + MV_SOC_PP2_DESC *Desc; > + UINTN CpCount, CpIndex; > + > + CpCount = FixedPcdGet8 (PcdMaxCpCount); > + > + Desc = AllocateZeroPool (CpCount * sizeof (MV_SOC_PP2_DESC)); > + if (Desc == NULL) { > + DEBUG ((DEBUG_ERROR, "%a: Cannot allocate memory\n", __FUNCTION__)); > + return EFI_OUT_OF_RESOURCES; > + } > + > + for (CpIndex = 0; CpIndex < CpCount; CpIndex++) { > + Desc[CpIndex].Pp2BaseAddress = MV_SOC_PP2_BASE (CpIndex); > + Desc[CpIndex].Pp2ClockFrequency = MV_SOC_PP2_CLK_FREQ; > + } > + > + *Pp2Desc = Desc; > + *DescCount = CpCount; > + > + return EFI_SUCCESS; > +} > + > +EFI_STATUS > +EFIAPI > ArmadaSoCDescUtmiGet ( > IN OUT MV_SOC_UTMI_DESC **UtmiDesc, > IN OUT UINTN *DescCount > -- > 2.7.4 >