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::22f; helo=mail-lj1-x22f.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) (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 08B9321962301 for ; Mon, 21 Jan 2019 17:32:51 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id n18-v6so19121398lji.7 for ; Mon, 21 Jan 2019 17:32:50 -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=547apiAtd+qmrbNg7l3P+YqhKmLF6dOIWW68ofIuRvs=; b=sy+pS8RZ9ypqWrpVNg8ee7Tgb64BZVHj4xJcdx7rjCFJVXKOckq9PvP9HOIrwEocRR trJvWWbDj6sl8MQOkEr35KFov3GKSgmmZDUXeOmR9K9VO5p60ToxhC0PIdvUfqj4sAI2 2p1Q0Ft+02Bh+ceq633t8qZTJrK1DDZ8ZUr8BMZNRcvsMbADm2tiytkuybr6tK0yYs08 QaP78G0qX1Oa46AJxA5C2P/WTPqosSWEcNfAfIKoZgZ0Vm/OdcgEmZmI+eTsWD3aWHPa DmF+A0rWABmiWmOSAICRBKfY8VA4VEHOH63Oef+gyNrjMjPaRzhQm9LOZkwLmAQOfXzf +xug== 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=547apiAtd+qmrbNg7l3P+YqhKmLF6dOIWW68ofIuRvs=; b=qf84zhQ8zWY3nCZHygnTC1RQ+dIIld6ozSmUIHSJmgIo6eOSZD+C5bkkuEyhCVJrVW LByf2nQmN3EOelUj7lIIXg7Tr211SRSJ5P87H/cI7/8QtllGw10FLzbnxyTKj0UGPNKe IDV/VfHM4kF8p86n/WPv/WHfgbYYUFAkvbTpapip1bLwd3TTx7TYCt9HfTpjObxF0/H3 InVJNRPCT9LDt2ZdRq9TtpauMLyeMM9+AU3THFCVca6WNKHIbCZm9HzJdhVyi5Ea0y59 nFrdAk/XshbnBlgPRGkIHNHJpfndJ/fz0n4yAuyG5Y2BKaT6AhPFtFMVe+r6qMaiKXC6 DjhQ== X-Gm-Message-State: AJcUukeSDSPy5bwckeWqCtqHg8CPb7ja31rAfRTtF8VYSQuTDPK8JtjW O7hjRhs3augB7/gOM4zvNAJ4TtyeZ+w= X-Google-Smtp-Source: ALg8bN5Y/EHrkEpQwaI0QXa/Rn50lC/EnUUniQVT44qKiyxAF52mILzUYcDCwXA7koseizVV/GuHQg== X-Received: by 2002:a2e:484:: with SMTP id a4-v6mr19163226ljf.27.1548120769083; Mon, 21 Jan 2019 17:32:49 -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 b21sm2524463lfi.7.2019.01.21.17.32.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Jan 2019 17:32:48 -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: Tue, 22 Jan 2019 02:32:21 +0100 Message-Id: <1548120742-11928-4-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548120742-11928-1-git-send-email-mw@semihalf.com> References: <1548120742-11928-1-git-send-email-mw@semihalf.com> Subject: [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 01:32:51 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:51 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:51 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:51 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:51 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:51 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:51 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:51 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:51 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:51 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:51 -0000 X-List-Received-Date: Tue, 22 Jan 2019 01:32:51 -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 --- 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