From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::443; helo=mail-wr1-x443.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (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 63CC9211B7F6F for ; Tue, 22 Jan 2019 09:38:15 -0800 (PST) Received: by mail-wr1-x443.google.com with SMTP id t27so28363891wra.6 for ; Tue, 22 Jan 2019 09:38:15 -0800 (PST) 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=qUl/dWLbSKyc+P+7eI2UY+gsSDBkmRnFVBkNCe/yf6Y=; b=OXznBCqO2sD2tPUQ2ICbA4wY/Q5xAvi4EiTvfN+g3shY1Ml9WAw5DgAJY4y4GJFjOA Cg1ZDMgJEk7RG3Afw1WroUdUyzrjthgDHLA0++744sNEfFElyU//sc6Wjol6/sEVyNXH ByE43Qlu8LvNQKFWK1QpBOoXQJM1pL/MBYOD4= 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=qUl/dWLbSKyc+P+7eI2UY+gsSDBkmRnFVBkNCe/yf6Y=; b=ITsEIaqStdF1sgazM5DidFdbUI1wD/r5/2NcuqNigzSlYRs9D2b4W+rbiqV84ZxjDK YqnTOOK1+fneKqMChDNN32xu4CJew7H5yc7VS9jhnrlCOz0n2Bjoh6CC8Sv3XL4WhQs5 gTuYwkTA/fPruukjsSLGx/LwLjh1kIYyZTCc2FAg3B/X78B5nnblmqo3UbGNOdcWiKN7 oyom8vSARzQGlgGTid7GnmHsxdpQm/mNCK+gKQCG75W1pBMrTX8QG+HB6flLE7xpG74Y lucbGfoz2oNGuhr8KpasPR4ZMI+6kfIa4hbacyBkD8iO1WBKgTXx60pn43gLZK/IUIUL xzFg== X-Gm-Message-State: AJcUukdryuIfZomc3LPlFL3baNZWWDhTB8x0fbFa2W7IT4Iwgath49gr 4vufcpD7vmdtEH5+eCx9C2pccQ== X-Google-Smtp-Source: ALg8bN4zQSMLM1kMYSXir5slBeiYLztq92koIUZEC41fs0GA1kQUHzVobP+ROT3VAeoWntkup4J22A== X-Received: by 2002:adf:9361:: with SMTP id 88mr32976372wro.204.1548178693723; Tue, 22 Jan 2019 09:38:13 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id s66sm47383594wmf.34.2019.01.22.09.38.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Jan 2019 09:38:12 -0800 (PST) Date: Tue, 22 Jan 2019 17:38:10 +0000 From: Leif Lindholm To: Marcin Wojtas Cc: edk2-devel@lists.01.org, ard.biesheuvel@linaro.org, nadavh@marvell.com, jsd@semihalf.com, jaz@semihalf.com, kostap@marvell.com Message-ID: <20190122173810.y73zln4x4akqkrve@bivouac.eciton.net> References: <1548120742-11928-1-git-send-email-mw@semihalf.com> <1548120742-11928-4-git-send-email-mw@semihalf.com> MIME-Version: 1.0 In-Reply-To: <1548120742-11928-4-git-send-email-mw@semihalf.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [platforms: PATCH v2 3/4] Marvell/Library: ArmadaSoCDescLib: Add North Bridge description X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 17:38:15 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jan 22, 2019 at 02:32:21AM +0100, Marcin Wojtas wrote: > From: Grzegorz Jaszczyk > > For upcomming patch there is need to get AP806 base, provide required > getter function for it. > > 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 | 28 ++++++++++++++++ > Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.c | 34 ++++++++++++++++++++ > 3 files changed, 68 insertions(+) > > diff --git a/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.h b/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.h > index bfc8639..c2d7933 100644 > --- a/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.h > +++ b/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.h > @@ -22,9 +22,15 @@ > // Common macros > // > #define MV_SOC_CP_BASE(Cp) (0xF2000000 + ((Cp) * 0x2000000)) > +#define MV_SOC_AP806_BASE 0xF0000000 > #define MV_SOC_AP806_COUNT 1 > > // > +// Armada7k8k default North Bridge index > +// > +#define ARMADA7K8K_AP806_INDEX 0 > + > +// > // Platform description of AHCI controllers > // > #define MV_SOC_AHCI_BASE(Cp) (MV_SOC_CP_BASE (Cp) + 0x540000) > diff --git a/Silicon/Marvell/Include/Library/ArmadaSoCDescLib.h b/Silicon/Marvell/Include/Library/ArmadaSoCDescLib.h > index 26b075a..fc17c3a 100644 > --- a/Silicon/Marvell/Include/Library/ArmadaSoCDescLib.h > +++ b/Silicon/Marvell/Include/Library/ArmadaSoCDescLib.h > @@ -20,6 +20,34 @@ > #include > > // > +// North Bridge description > +// > + > +/** > + > +Routine Description: > + > + Get base address of the SoC North Bridge. > + > +Arguments: > + > + ApBase - Base address of the North Bridge. > + ApIndex - Index of the North Bridge. > + > +Returns: > + > + EFI_SUCCESS - Proper base address is returned. > + EFI_INVALID_PARAMETER - The index is out of range. > + > +**/ > +EFI_STATUS > +EFIAPI > +ArmadaSoCAp8xxBaseGet ( > + IN OUT EFI_PHYSICAL_ADDRESS *ApBase, > + IN UINTN ApIndex > + ); > + > +// > // ComPhy SoC description > // > typedef struct { > diff --git a/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.c b/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.c > index 5b72c20..584f445 100644 > --- a/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.c > +++ b/Silicon/Marvell/Armada7k8k/Library/Armada7k8kSoCDescLib/Armada7k8kSoCDescLib.c > @@ -28,6 +28,40 @@ > > #include "Armada7k8kSoCDescLib.h" > > +/** > + > +Routine Description: > + > + Get base address of the SoC North Bridge. > + > +Arguments: > + > + ApBase - Base address of the North Bridge. > + ApIndex - Index of the North Bridge. > + > +Returns: > + > + EFI_SUCCESS - Proper base address is returned. > + EFI_INVALID_PARAMETER - The index is out of range. > + > +**/ > +EFI_STATUS > +EFIAPI > +ArmadaSoCAp8xxBaseGet ( > + IN OUT EFI_PHYSICAL_ADDRESS *ApBase, > + IN UINTN ApIndex > + ) > +{ > + if (ApIndex != ARMADA7K8K_AP806_INDEX) { > + DEBUG ((DEBUG_ERROR, "%a: Only one AP806 in A7K/A8K SoC\n", __FUNCTION__)); > + return EFI_INVALID_PARAMETER; > + } > + > + *ApBase = MV_SOC_AP806_BASE; > + > + return EFI_SUCCESS; > +} > + > EFI_STATUS > EFIAPI > ArmadaSoCDescComPhyGet ( > -- > 2.7.4 >