From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4864:20::143; helo=mail-lf1-x143.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) (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 AEF652194D387 for ; Mon, 28 Jan 2019 01:45:43 -0800 (PST) Received: by mail-lf1-x143.google.com with SMTP id u18so11310604lff.10 for ; Mon, 28 Jan 2019 01:45:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0WxjCBrTptE7lDwckRmBozkPVu63JpSLTUp1Z+yYv2o=; b=BwUbqkC2lUJMFx+WCfYf/Ao6tL8+O9aPJ2wGtxBMH9+/xxl046v+NQVN2Z+YMvaq5v DIvei4xfshUFi+K3uGKoYY57H8QBG5c5kypzPVKNFrqm2bcgO2/orIgajBPlw7vwsSqf sdrd3Eshf6PptoJITiYs7ndd7gh9Xi8ugGE8LB3ZVEXAKEodO49DeA2bEYbYNzey9QRz w78IOLTjtjWNoXcVi7GNZavZgE4OpE+vIW648gJma7PfePK+kZzYYfORyCwWeOhLYr5m ULPAi1zpBtQmm5Z1KpfBBi/8FluYuGe+M8Z2k4x2tqY999NE9DcUzpEJ3q2rYGvzl0d2 nZfw== 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; bh=0WxjCBrTptE7lDwckRmBozkPVu63JpSLTUp1Z+yYv2o=; b=P/9KzCNuvmZzcaGDTdNbbAEgG/7upMJwyewkueclSrhlc4rkDJyALU8P21dPNqsFV/ fAkWh6UElDab8sRw4skvdfdRQatRbLQYvkocyVW7zgkMkprrVkZZYE7sDc054ulot9mL tzeaT84MENWWqXmsTDRc9P26xZ2XqVS/Hju9nhBSMdLk4HvdvAMsyLCLIOjx3Jo6nTAr IXsCno/4VDcfoN7zRKsvk/cJUQC969NsjS9bolYRlB92UuX/AHQY6rV0KXasoH3hnAPo zUx9cVf8MlsUDqRhxaEk4bUF733hY2NNLsjSJCpDR13TPgOz7X90P26dZflcKIV9zpaQ rY7A== X-Gm-Message-State: AJcUukcCskSkXkFtSxQ7UGQ/FH6YluTUhVBhkdU8AkY+Jdcewrc6l91k K9HrITMj7TroirjmUIptqIgXRyXdJBQ= X-Google-Smtp-Source: ALg8bN60FEZYPtIahKfJ8plChlQIw4sXd1VCyfjBcp7zYoHbwlWKBNSt/0u922pHehcrLJuNtPcUMA== X-Received: by 2002:a19:59c2:: with SMTP id n185mr15494591lfb.118.1548668741701; Mon, 28 Jan 2019 01:45:41 -0800 (PST) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id 10sm2895213ljr.4.2019.01.28.01.45.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Jan 2019 01:45:41 -0800 (PST) From: Marcin Wojtas To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, nadavh@marvell.com, mw@semihalf.com, jsd@semihalf.com, jaz@semihalf.com, kostap@marvell.com Date: Mon, 28 Jan 2019 10:45:14 +0100 Message-Id: <1548668715-15042-5-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548668715-15042-1-git-send-email-mw@semihalf.com> References: <1548668715-15042-1-git-send-email-mw@semihalf.com> Subject: [platforms: PATCH v3 4/5] 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: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 X-List-Received-Date: Mon, 28 Jan 2019 09:45:44 -0000 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