From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.38.127; helo=nam02-bl2-obe.outbound.protection.outlook.com; envelope-from=christopher.co@microsoft.com; receiver=edk2-devel@lists.01.org Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0127.outbound.protection.outlook.com [104.47.38.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6F9B82115411F for ; Fri, 21 Sep 2018 01:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zmF3GkODwBkHjHK8Qdu/WV5kpLtlWq3VpEtULc8odIM=; b=Ql20gqCsSFIVBad0ciomWSVUQ7Z3u04d8reufyfL5FaLbv4FVC7cJYGf8g4+DJtDMwYplzlsgwEMhocdvzVPAJFpninVaArpVFTlRWUQvPRUKvpeWNQ9QXAOZ952t42nAmzavgQu92VD7jZgRHVpixL2ISEBVnZ97OGfLRy+hSk= Received: from DM5PR2101MB1128.namprd21.prod.outlook.com (52.132.133.20) by DM5PR2101MB0727.namprd21.prod.outlook.com (10.167.110.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.6; Fri, 21 Sep 2018 08:26:13 +0000 Received: from DM5PR2101MB1128.namprd21.prod.outlook.com ([fe80::81f8:300e:d90:d49]) by DM5PR2101MB1128.namprd21.prod.outlook.com ([fe80::81f8:300e:d90:d49%3]) with mapi id 15.20.1164.008; Fri, 21 Sep 2018 08:26:13 +0000 From: Chris Co To: "edk2-devel@lists.01.org" CC: Ard Biesheuvel , Leif Lindholm , Michael D Kinney Thread-Topic: [PATCH edk2-platforms 20/27] Silicon/NXP: Add i.MX6 Board init library Thread-Index: AQHUUYTBcYyIWkfMhk+yNc2MP8mq2Q== Date: Fri, 21 Sep 2018 08:26:12 +0000 Message-ID: <20180921082542.35768-21-christopher.co@microsoft.com> References: <20180921082542.35768-1-christopher.co@microsoft.com> In-Reply-To: <20180921082542.35768-1-christopher.co@microsoft.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MWHPR17CA0054.namprd17.prod.outlook.com (2603:10b6:300:93::16) To DM5PR2101MB1128.namprd21.prod.outlook.com (2603:10b6:4:a8::20) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2001:4898:80e8:8:388a:edc9:7085:c18] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB0727; 6:mTNQNp5Nqv9w94cyshAvR57YQ1fP5S62xxpDmIEERUvKrxyGRlf25SIhfKG9SBtv8O56s59c0nuSdlpnq+8jPLFFWSnKeN6w+grTOAlbkyKeQ7YL4nhXqvXAAB4ajuDYEQEmhYe65QMjmIzIf2h+TIS5OxD2eJgLKzoaRL5g2JJ97l2TmgHf6d7rNKd1hVY0nsaJxRIN3QWWXXRPA3xeR/cJVChe+Qs+q6HuiUNGYckLrAw81cVFZuRFn5VjhsrY27fXb26DXTAN8DO5yLBjwYLSpb1QWRXDsgvchZtv5MWEI0LYUHgP4mH4KmsY2oOmJiE4cDY8rR2YGVKAP8DF6+PSkRHkSZoJhGZdd1xkq2IhQC1PtHm78J//XOGX2GxEN0ArgNZXO6G6nSQ7F8tWmk6CaQBUtHRSciqZMry3zFRVr8WQI56LO7Ty2bRG8XKAHrSGPMqOKKaBUxKrF+cg9g==; 5:c6lbZQF2mx/2nYyasamBNW7xe4XcMFs9v5tP5pzEsgRcPYWL0ezgRsP9PcbIH3n9jvZKX8TD2mNBoJHOpcsVUurHje6SloKdMuH2QI99XOOEiM2Yaj0jzzHzyZjUdlBxp/I0qqKnpM7U1snFkKkDct3GeqCCHArVrhZINzK+J7U=; 7:I6eDyiGcR+3iDjM3oot3tM8q+SiPBQEYGKAHcdVuE9z3sejzkZC4cbAWVuIscEWNtKpNSBvwt8KKz07Gr5PSUAFNonQoBULlY73VIvz6UgI8GCl4FPByafq0UiZZmVo5gYXcjqg+wD32SUHwtev0XC7fCuO+IushHZtX/LnkFYBpQV9YkxMVSGffbE4xVv6tadfptmRkhU8qWrql8npUxyn4rNiCXDPT4XjN4RY7r5wbO8NDmEvERnpZimj7LiCO x-ms-office365-filtering-correlation-id: 825a6db6-4e87-4737-f592-08d61f9be409 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7193020); SRVR:DM5PR2101MB0727; x-ms-traffictypediagnostic: DM5PR2101MB0727: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(12401385986421)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(2280164)(944501410)(52105095)(2018427008)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201708071742011)(7699051)(76991041); SRVR:DM5PR2101MB0727; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0727; x-forefront-prvs: 0802ADD973 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(1496009)(39860400002)(396003)(136003)(376002)(366004)(346002)(199004)(189003)(8676002)(81156014)(25786009)(446003)(2900100001)(102836004)(46003)(52116002)(6346003)(81166006)(11346002)(105586002)(2351001)(8936002)(386003)(4326008)(76176011)(6506007)(10090500001)(5250100002)(7736002)(2616005)(486006)(305945005)(53376002)(6116002)(186003)(16799955002)(1076002)(2501003)(476003)(6916009)(99286004)(22452003)(97736004)(71200400001)(71190400001)(72206003)(478600001)(966005)(6306002)(10290500003)(5640700003)(14454004)(36756003)(86362001)(575784001)(6436002)(15188155005)(2906002)(53946003)(86612001)(106356001)(54906003)(316002)(6486002)(256004)(6512007)(14444005)(68736007)(5660300001)(53936002)(60540400001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0727; H:DM5PR2101MB1128.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Christopher.Co@microsoft.com; x-microsoft-antispam-message-info: ubVZxF5Qkven7Br81zxpbabSv6202nWn/SuCb0cJqfeo00vyGsQNGdSfri4I67O4pmDIQjVgaHCCubLYQGS8jRE36ZtYXOjF6TXY9PIl7l/dv/ycSocP7fZu3bp6kj9A8c+bLIl6W1RJjk1n89ZeSKm6Xaq5hT8FpgPYyPFMzLD6wRcWeJRMpqeQyGNofRe/6g+GgpYqsNFkr35x+hZwEiyaYLWUym5YgkN/O272cn99FSPCR4FdYkaWLMDf7NeQAYS+5vLLU6m13DN9ZfkIygLHEmfapc8rK15opfFLG2CvPnwh1hKGgrHR3c6Bmahl1fxsjpQdO5dpyo1oofLAkD9tkXU+V4CQzGw9O1SCstLe0w4YJkKqwSrGjb5dL67vuIOyikD72sOyRDQ6Di8tyqcQyUiRW25XrIOHIPgH7vtY6Rl34MqpoJBabX1mVo4np2dQ4OUZG7oj8JlzMdRa+Vkima+2kGtBa3evO9AKXrMi/t6dzeQapAOU22ceqHO5V+6PWkQ1HRK+mRRCSgu4hO25WBhCblZpw0rgOJp7wZAt6bcV/z9YlD4uOh8UU5l6 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 825a6db6-4e87-4737-f592-08d61f9be409 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Sep 2018 08:26:12.9660 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0727 Subject: [PATCH edk2-platforms 20/27] Silicon/NXP: Add i.MX6 Board init library 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: Fri, 21 Sep 2018 08:26:14 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable This adds support for board initialization which is common to NXP i.MX6-based platforms. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Christopher Co Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Michael D Kinney --- Silicon/NXP/iMX6Pkg/Library/iMX6BoardLib/iMX6BoardHelper.S | 89 +++++++= +++++++++ Silicon/NXP/iMX6Pkg/Library/iMX6BoardLib/iMX6BoardMem.c | 110 +++++++= +++++++++++++ Silicon/NXP/iMX6Pkg/Library/iMX6BoardLib/iMX6Common.c | 88 +++++++= +++++++++ Silicon/NXP/iMX6Pkg/Library/iMX6BoardLib/iMX6QBoardCoreDef.c | 107 +++++++= ++++++++++++ 4 files changed, 394 insertions(+) diff --git a/Silicon/NXP/iMX6Pkg/Library/iMX6BoardLib/iMX6BoardHelper.S b/S= ilicon/NXP/iMX6Pkg/Library/iMX6BoardLib/iMX6BoardHelper.S new file mode 100644 index 000000000000..979e98888a6b --- /dev/null +++ b/Silicon/NXP/iMX6Pkg/Library/iMX6BoardLib/iMX6BoardHelper.S @@ -0,0 +1,89 @@ +## @file +# +# Copyright (c) 2018 Microsoft Corporation. All rights reserved. +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD 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 IM= PLIED. +# +## + +#include +#include +#include +#include +#include + +.text +.align 2 + +// GIC Cpu interface +#define ARM_GIC_ICCICR 0x00 // CPU Interface Control Register +#define ARM_GIC_ICCPMR 0x04 // Interrupt Priority Mask Register +#define ARM_GIC_ICCBPR 0x08 // Binary Point Register +#define ARM_GIC_ICCIAR 0x0C // Interrupt Acknowledge Register +#define ARM_GIC_ICCEIOR 0x10 // End Of Interrupt Register +#define ARM_GIC_ICCRPR 0x14 // Running Priority Register +#define ARM_GIC_ICCPIR 0x18 // Highest Pending Interrupt Register +#define ARM_GIC_ICCABPR 0x1C // Aliased Binary Point Register +#define ARM_GIC_ICCIDR 0xFC // Identification Register + +// SRC (System Reset Controller) register offsets & masks +#define IMX6_SRC_SCR 0x0 +#define IMX6_SRC_GPR1 0x20 +#define IMX6_SRC_GPR2 0x24 +#define IMX6_SRC_GPR3 0x28 +#define IMX6_SRC_GPR4 0x2C +#define IMX6_SRC_GPR5 0x30 +#define IMX6_SRC_GPR6 0x34 +#define IMX6_SRC_GPR7 0x38 +#define IMX6_SRC_GPR8 0x3C +#define IMX6_SRC_GPR9 0x40 +#define IMX6_SRC_GPR10 0x44 + +GCC_ASM_EXPORT(ArmPlatformPeiBootAction) +GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore) +GCC_ASM_EXPORT(ArmPlatformGetPrimaryCoreMpId) +GCC_ASM_EXPORT(ArmPlatformGetCorePosition) + +//UINTN +//ArmPlatformGetPrimaryCoreMpId ( +// VOID +// ); +ASM_PFX(ArmPlatformGetPrimaryCoreMpId): + MOV32 (r0, FixedPcdGet32 (PcdArmPrimaryCore)) + ldr r0, [r0] + bx lr + +//UINTN +//ArmPlatformIsPrimaryCore ( +// IN UINTN MpId +// ); +ASM_PFX(ArmPlatformIsPrimaryCore): + mrc p15,0,r0,c0,c0,5 + ands r0,r0,#3 + moveq r0,#1 + movne r0,#0 + bx lr + +//UINTN +//ArmPlatformGetCorePosition ( +// IN UINTN MpId +// ); +ASM_PFX(ArmPlatformGetCorePosition): + and r0, r0, #ARM_CORE_MASK + bx lr + +ASM_PFX(ArmPlatformPeiBootAction): + // enable unaligned access + mrc p15, 0, r1, c1, c0, 0 + bic r1, r1, #0x2 + mcr p15, 0, r1, c1, c0, 0 + isb + bx r14 + +ASM_FUNCTION_REMOVE_IF_UNREFERENCED diff --git a/Silicon/NXP/iMX6Pkg/Library/iMX6BoardLib/iMX6BoardMem.c b/Sili= con/NXP/iMX6Pkg/Library/iMX6BoardLib/iMX6BoardMem.c new file mode 100644 index 000000000000..a2b601ec9c52 --- /dev/null +++ b/Silicon/NXP/iMX6Pkg/Library/iMX6BoardLib/iMX6BoardMem.c @@ -0,0 +1,110 @@ +/** @file +* +* Copyright (c) 2018 Microsoft Corporation. All rights reserved. +* +* This program and the accompanying materials +* are licensed and made available under the terms and conditions of the B= SD 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 IM= PLIED. +* +**/ + +#include +#include +#include +#include +#include + +#include "iMX6.h" + +#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 8 + +/** + Return the Virtual Memory Map of your platform + + This Virtual Memory Map is used by MemoryInitPei Module to initialize th= e MMU + on your platform. + + @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR = describing + a Physical-to-Virtual Memory mapping. = This + array must be ended by a zero-filled e= ntry + +**/ +VOID +ArmPlatformGetVirtualMemoryMap ( + IN ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap + ) +{ + ARM_MEMORY_REGION_ATTRIBUTES CacheAttributes; + UINTN Index =3D 0; + ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable; + + ASSERT (VirtualMemoryMap !=3D NULL); + + DEBUG ((DEBUG_VERBOSE, "Enter: ArmPlatformGetVirtualMemoryMap\n")); + + VirtualMemoryTable =3D (ARM_MEMORY_REGION_DESCRIPTOR *)AllocatePages ( + EFI_SIZE_TO_PAGES (sizeof (ARM_MEMORY_REGION_DESC= RIPTOR) * + MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS)); + if (VirtualMemoryTable =3D=3D NULL) { + return; + } + + CacheAttributes =3D DDR_ATTRIBUTES_CACHED; + DEBUG ((DEBUG_VERBOSE, "CacheAttributes=3D0x%d\n", CacheAttributes)); + + // SOC registers region 1 (0x00100000 size 0x00C00000) + VirtualMemoryTable[Index].PhysicalBase =3D SOC_REGISTERS_PHYSICAL_BASE= 1; + VirtualMemoryTable[Index].VirtualBase =3D SOC_REGISTERS_PHYSICAL_BASE= 1; + VirtualMemoryTable[Index].Length =3D SOC_REGISTERS_PHYSICAL_LENG= TH1; + VirtualMemoryTable[Index].Attributes =3D SOC_REGISTERS_ATTRIBUTES; + + // PCIE Registers (0x01000000 size 0x01000000) + VirtualMemoryTable[++Index].PhysicalBase =3D PCIE_REGISTERS_PHYSICAL_BAS= E; + VirtualMemoryTable[Index].VirtualBase =3D PCIE_REGISTERS_PHYSICAL_BAS= E; + VirtualMemoryTable[Index].Length =3D PCIE_REGISTERS_PHYSICAL_LEN= GTH; + VirtualMemoryTable[Index].Attributes =3D SOC_REGISTERS_ATTRIBUTES; + + // SOC registers region 2 (excluding EIM) (0x02000000 size 0x00A00000) + VirtualMemoryTable[++Index].PhysicalBase =3D SOC_REGISTERS_PHYSICAL_BASE= 2; + VirtualMemoryTable[Index].VirtualBase =3D SOC_REGISTERS_PHYSICAL_BASE= 2; + VirtualMemoryTable[Index].Length =3D SOC_REGISTERS_PHYSICAL_LENG= TH2; + VirtualMemoryTable[Index].Attributes =3D SOC_REGISTERS_ATTRIBUTES; + + // Framebuffer + VirtualMemoryTable[++Index].PhysicalBase =3D FixedPcdGet32 (PcdFrameBuff= erBase); + VirtualMemoryTable[Index].VirtualBase =3D FixedPcdGet32 (PcdFrameBuff= erBase); + VirtualMemoryTable[Index].Length =3D FixedPcdGet32 (PcdFrameBuff= erSize); + VirtualMemoryTable[Index].Attributes =3D DDR_ATTRIBUTES_UNCACHED; + + // Boot (UEFI) DRAM region (kernel.img & boot working DRAM) (0x10800000 = size 0x001D0000) + VirtualMemoryTable[++Index].PhysicalBase =3D BOOT_IMAGE_PHYSICAL_BASE; + VirtualMemoryTable[Index].VirtualBase =3D BOOT_IMAGE_PHYSICAL_BASE; + VirtualMemoryTable[Index].Length =3D BOOT_IMAGE_PHYSICAL_LENGT= H; + VirtualMemoryTable[Index].Attributes =3D BOOT_IMAGE_ATTRIBUTES; + + // TrustZone Shared Memory + VirtualMemoryTable[++Index].PhysicalBase =3D FixedPcdGet64 (PcdTrustZone= SharedMemoryBase); + VirtualMemoryTable[Index].VirtualBase =3D FixedPcdGet64 (PcdTrustZone= SharedMemoryBase); + VirtualMemoryTable[Index].Length =3D FixedPcdGet64 (PcdTrustZone= SharedMemorySize); + VirtualMemoryTable[Index].Attributes =3D CacheAttributes; + + // Base SDRAM + VirtualMemoryTable[++Index].PhysicalBase =3D PcdGet64 (PcdSystemMemoryBa= se); + VirtualMemoryTable[Index].VirtualBase =3D PcdGet64 (PcdSystemMemoryBa= se); + VirtualMemoryTable[Index].Length =3D PcdGet64 (PcdSystemMemorySi= ze); + VirtualMemoryTable[Index].Attributes =3D CacheAttributes; + + // End of Table + VirtualMemoryTable[++Index].PhysicalBase =3D 0; + VirtualMemoryTable[Index].VirtualBase =3D 0; + VirtualMemoryTable[Index].Length =3D 0; + VirtualMemoryTable[Index].Attributes =3D (ARM_MEMORY_REGION_ATTRIBUT= ES)0; + + ASSERT ((Index + 1) <=3D MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS); + + *VirtualMemoryMap =3D VirtualMemoryTable; +} diff --git a/Silicon/NXP/iMX6Pkg/Library/iMX6BoardLib/iMX6Common.c b/Silico= n/NXP/iMX6Pkg/Library/iMX6BoardLib/iMX6Common.c new file mode 100644 index 000000000000..3f45527981a7 --- /dev/null +++ b/Silicon/NXP/iMX6Pkg/Library/iMX6BoardLib/iMX6Common.c @@ -0,0 +1,88 @@ +/** @file +* +* Copyright (c) 2018 Microsoft Corporation. All rights reserved. +* +* This program and the accompanying materials +* are licensed and made available under the terms and conditions of the B= SD 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 IM= PLIED. +* +**/ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +VOID __DoNothing() {} +VOID SdhcInit () __attribute__ ((weak, alias ("__DoNothing"))); +VOID EhciInit () __attribute__ ((weak, alias ("__DoNothing"))); +VOID EnetInit () __attribute__ ((weak, alias ("__DoNothing"))); +VOID I2cInit () __attribute__ ((weak, alias ("__DoNothing"))); +VOID SpiInit () __attribute__ ((weak, alias ("__DoNothing"))); +VOID PcieInit () __attribute__ ((weak, alias ("__DoNothing"))); +VOID SetupAudio () __attribute__ ((weak, alias ("__DoNothing"))); + +/** + Initialize controllers that must setup at the early stage +**/ +RETURN_STATUS +ArmPlatformInitialize ( + IN UINTN MpId + ) +{ + if (!ArmPlatformIsPrimaryCore (MpId)) { + return RETURN_SUCCESS; + } + + ImxClkPwrInit (); + + // Initialize default UEFI debug port early so we can use its debug outp= ut + SerialPortInitialize (); + SerialPortWrite ( + (UINT8 *)SERIAL_DEBUG_PORT_INIT_MSG, + (UINTN)sizeof (SERIAL_DEBUG_PORT_INIT_MSG)); + + // Initialize timer early on because the following init path will be cal= ling + // delay functions. PrePi.c calls ArmPlatformInitialize before it calls + // TimerConstructor to initialize the timer. + TimerConstructor (); + + SdhcInit (); + EhciInit (); + EnetInit (); + I2cInit (); + SpiInit (); + PcieInit (); + SetupAudio (); + + return RETURN_SUCCESS; +} + +/** + Return the current Boot Mode + + This function returns the boot reason on the platform + +**/ +EFI_BOOT_MODE +ArmPlatformGetBootMode ( + VOID + ) +{ + return BOOT_WITH_FULL_CONFIGURATION; +} diff --git a/Silicon/NXP/iMX6Pkg/Library/iMX6BoardLib/iMX6QBoardCoreDef.c b= /Silicon/NXP/iMX6Pkg/Library/iMX6BoardLib/iMX6QBoardCoreDef.c new file mode 100644 index 000000000000..b59f9fe6f01f --- /dev/null +++ b/Silicon/NXP/iMX6Pkg/Library/iMX6BoardLib/iMX6QBoardCoreDef.c @@ -0,0 +1,107 @@ +/** @file +* +* Copyright (c) 2018 Microsoft Corporation. All rights reserved. +* +* This program and the accompanying materials +* are licensed and made available under the terms and conditions of the B= SD 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 IM= PLIED. +* +**/ + +#include +#include +#include +#include + +#include + +ARM_CORE_INFO iMX6Ppi[] =3D { + { + // Cluster 0, Core 0 + 0x0, 0x0, + + // MP Core MailBox Set/Get/Clear Addresses and Clear Value. + // Not used with i.MX6, set to 0 + (EFI_PHYSICAL_ADDRESS)0x00000000, + (EFI_PHYSICAL_ADDRESS)0x00000000, + (EFI_PHYSICAL_ADDRESS)0x00000000, + (UINT64)0 + }, + +#if FixedPcdGet32(PcdCoreCount) > 1 + { + // Cluster 0, Core 1 + 0x0, 0x1, + + // MP Core MailBox Set/Get/Clear Addresses and Clear Value + // Not used with i.MX6, set to 0 + (EFI_PHYSICAL_ADDRESS)0x00000000, + (EFI_PHYSICAL_ADDRESS)0x00000000, + (EFI_PHYSICAL_ADDRESS)0x00000000, + (UINT64)0 + }, +#endif // FixedPcdGet32(PcdCoreCount) > 1 + +#if FixedPcdGet32(PcdCoreCount) > 2 + { + // Cluster 0, Core 2 + 0x0, 0x2, + + // MP Core MailBox Set/Get/Clear Addresses and Clear Value + // Not used with i.MX6, set to 0 + (EFI_PHYSICAL_ADDRESS)0x00000000, + (EFI_PHYSICAL_ADDRESS)0x00000000, + (EFI_PHYSICAL_ADDRESS)0x00000000, + (UINT64)0 + }, + + { + // Cluster 0, Core 3 + 0x0, 0x3, + + // MP Core MailBox Set/Get/Clear Addresses and Clear Value + // Not used with i.MX6, set to 0 + (EFI_PHYSICAL_ADDRESS)0x00000000, + (EFI_PHYSICAL_ADDRESS)0x00000000, + (EFI_PHYSICAL_ADDRESS)0x00000000, + (UINT64)0 + } +#endif // FixedPcdGet32(PcdCoreCount) > 2 +}; + +EFI_STATUS +PrePeiCoreGetMpCoreInfo ( + OUT UINTN *CoreCount, + OUT ARM_CORE_INFO **ArmCoreTable + ) +{ + // Only support one cluster + *CoreCount =3D sizeof (iMX6Ppi) / sizeof (ARM_CORE_INFO); + ASSERT (*CoreCount =3D=3D FixedPcdGet32 (PcdCoreCount)); + *ArmCoreTable =3D iMX6Ppi; + return EFI_SUCCESS; +} + +EFI_GUID mArmMpCoreInfoPpiGuid =3D ARM_MP_CORE_INFO_PPI_GUID; +ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi =3D { PrePeiCoreGetMpCoreInfo }; +EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] =3D { + { + EFI_PEI_PPI_DESCRIPTOR_PPI, + &mArmMpCoreInfoPpiGuid, + &mMpCoreInfoPpi + } +}; + +VOID +ArmPlatformGetPlatformPpiList ( + OUT UINTN *PpiListSize, + OUT EFI_PEI_PPI_DESCRIPTOR **PpiList + ) +{ + *PpiListSize =3D sizeof (gPlatformPpiTable); + *PpiList =3D gPlatformPpiTable; +} --=20 2.16.2.gvfs.1.33.gf5370f1