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::244; helo=mail-lj1-x244.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) (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 C4AE7209831FA for ; Fri, 13 Jul 2018 01:12:28 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id f8-v6so6221502ljk.1 for ; Fri, 13 Jul 2018 01:12:28 -0700 (PDT) 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=t4HsFEoxxzIsbRkrGaBXawZ/eDBomOIGKJxqqTcrfBY=; b=reGDqGIwYaJLuSFajn6SQDeDKGdnH3b33Z/k5suu7P6+zR8SNeYhn8uZBkgbYfmkEd r5q3Ui7j6yqJaB+lDLFYmDrzHQeg1XcQieEtO1NjS1Mz1vzAOWJMgHn6jOAqsdeh9lUk vv/+tSqDQalJsk9FOuzsIvJamK7D7YfDIZgzRt+ctTZDBjEyi1XPfR+hVg+GzVltU2cZ J2fdLjTlHd0EclJ6hzHrIwVn4kaJOxok8yFUptxEStBstWbO/0BNFtauiS2kduJX5Enf 5/NZ4og6pyF45gbwSS7HaFAOxu9ba11XTC5dgjfo1hrGAWOf/94dQS7k+tNecSd5guiO n/5A== 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=t4HsFEoxxzIsbRkrGaBXawZ/eDBomOIGKJxqqTcrfBY=; b=Qg9rhUzyLvLCZOVw5gpYdYO6SgK3MbSxCOm4ScPmQomvBy1bwwjxm47tP07RU5VMpS BqivwF5TyeZCbl1ioVSEiWTjkRfEWkOo7QS022Q/zcNCxKWNHOQjH8PhsADvz4G58F2h FNF7s6Wlt3sQPhOsTiLZIlrCcif6oXRfSQ7CxARrr1QRfTQl6HTxV0Gf71kZgisKRjH5 0m4kiBX5yhVbPDCI7X+R2C2TBThHIiXywObFQofl/MhDll9o3ztPZ/3i++pN65Ats9k9 me/+rxEbbb+6DtObpoThqKoro7txgOXUN2Hzbrce6ctTXN0V/Oa2hFCnqyrOGcUI0Ugj zb5g== X-Gm-Message-State: AOUpUlFcwb2r+uvmOAjSWcUsATBYUO3dms+GMiekuKu9hmgitwCEICsX qbUQbLXjwyqYXgh6sWtM54PlL2Cli7c= X-Google-Smtp-Source: AAOMgpeivKPjKUnpFN6O4YeCo1xjAg+ocS0dbT1ateYaV9AZVOOpsrUHYd0WBKvRs83H9v0sghkieA== X-Received: by 2002:a2e:4951:: with SMTP id b17-v6mr2518732ljd.67.1531469546672; Fri, 13 Jul 2018 01:12:26 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id m29-v6sm6485484lfj.45.2018.07.13.01.12.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Jul 2018 01:12:25 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, nadavh@marvell.com, hannah@marvell.com, mw@semihalf.com, jsd@semihalf.com, jaz@semihalf.com Date: Fri, 13 Jul 2018 10:12:09 +0200 Message-Id: <1531469533-31787-3-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531469533-31787-1-git-send-email-mw@semihalf.com> References: <1531469533-31787-1-git-send-email-mw@semihalf.com> Subject: [platforms: PATCH v2 2/6] Marvell/Library: Introduce ArmadaIcuLib class X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2018 08:12:29 -0000 ICU (Interrupt Consolidation Unit) is a mechanism, that allows to send a message-based interrupts from the CP110 unit (South Bridge) to the Application Processor hardware block. After dispatching the interrupts in the GIC are generated. This patch adds a basic version of the library, that allows to configure a static mapping between CP110 interfaces and GIC. It is required for the cases, where the OS does not support the ICU controller on its own (e.g. ACPI boot). Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas --- Silicon/Marvell/Marvell.dec | 1 + Silicon/Marvell/Include/Library/ArmadaIcuLib.h | 45 ++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 Silicon/Marvell/Include/Library/ArmadaIcuLib.h diff --git a/Silicon/Marvell/Marvell.dec b/Silicon/Marvell/Marvell.dec index 4def897..616624e 100644 --- a/Silicon/Marvell/Marvell.dec +++ b/Silicon/Marvell/Marvell.dec @@ -61,6 +61,7 @@ [LibraryClasses] ArmadaBoardDescLib|Include/Library/ArmadaBoardDescLib.h + ArmadaIcuLib|Include/Library/ArmadaIcuLib.h ArmadaSoCDescLib|Include/Library/ArmadaSoCDescLib.h SampleAtResetLib|Include/Library/SampleAtResetLib.h diff --git a/Silicon/Marvell/Include/Library/ArmadaIcuLib.h b/Silicon/Marvell/Include/Library/ArmadaIcuLib.h new file mode 100644 index 0000000..426734e --- /dev/null +++ b/Silicon/Marvell/Include/Library/ArmadaIcuLib.h @@ -0,0 +1,45 @@ +/** +* +* Copyright (C) 2018, Marvell International Ltd. and its affiliates +* +* This program and the accompanying materials are licensed and made available +* under the terms and conditions of the BSD License which accompanies this +* distribution. The full text of the license may be found at +* http://opensource.org/licenses/bsd-license.php +* +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +* +**/ +#ifndef __ARMADA_ICU_LIB_H__ +#define __ARMADA_ICU_LIB_H__ + +typedef enum { + IcuIrqTypeLevel = 0, + IcuIrqTypeEdge = 1 +} ICU_IRQ_TYPE; + +typedef struct { + UINTN IcuId; + UINTN SpiId; + ICU_IRQ_TYPE IrqType; +} ICU_IRQ; + +typedef struct { + const ICU_IRQ *Map; + UINTN Size; +} ICU_CONFIG_ENTRY; + +typedef struct { + ICU_CONFIG_ENTRY NonSecure; + ICU_CONFIG_ENTRY Sei; + ICU_CONFIG_ENTRY Rei; +} ICU_CONFIG; + +EFI_STATUS +EFIAPI +ArmadaIcuInitialize ( + VOID + ); + +#endif /* __ARMADA_ICU_LIB_H__ */ -- 2.7.4