From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.107.0.44; helo=eur02-am5-obe.outbound.protection.outlook.com; envelope-from=meenakshi.aggarwal@nxp.com; receiver=edk2-devel@lists.01.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00044.outbound.protection.outlook.com [40.107.0.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 47168223230E1 for ; Fri, 16 Feb 2018 00:48:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4apI+9J8flLg8/SUMX6HmrMZF7yA1Q2Shv4Xi94JVEg=; b=VNejQ1ei+BUjAkunaOh0P5Xd4G0qW9jbx0Ng8mRRzbleFbTbxZNj4qYkepKUdm8Fx/HwOHw/kxFSIsPuQu+hiBoavqu/stMLta5PZ/0s07qURRoQlvR1FQg+VqOpf1GRydVuQLZ4iYzBeZutWTsRw5gTxUCFF7yc+JYgsxCZNQQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=meenakshi.aggarwal@nxp.com; Received: from idcbfarm.ap.freescale.net (192.88.169.1) by VI1PR04MB1008.eurprd04.prod.outlook.com (2a01:111:e400:5090::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Fri, 16 Feb 2018 08:54:39 +0000 From: Meenakshi To: ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, michael.d.kinney@intel.com, edk2-devel@lists.01.org Date: Fri, 16 Feb 2018 14:20:25 +0530 Message-Id: <1518771035-6733-30-git-send-email-meenakshi.aggarwal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1518771035-6733-1-git-send-email-meenakshi.aggarwal@nxp.com> References: <1518771035-6733-1-git-send-email-meenakshi.aggarwal@nxp.com> MIME-Version: 1.0 X-Originating-IP: [192.88.169.1] X-ClientProxiedBy: HK2PR02CA0172.apcprd02.prod.outlook.com (2603:1096:201:1f::32) To VI1PR04MB1008.eurprd04.prod.outlook.com (2a01:111:e400:5090::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 975a2f50-b362-4bf8-ffb1-08d5751aebd0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:VI1PR04MB1008; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB1008; 3:2wU3pfOf5k3hqkelJEdLxh18EKUvDbxKFjAgA2KoV3qZIf/jDVL70DhultM1EOUfj+zz3U3FUZornpF+2rY4yeHK6zW3vkjgss1FnP/CU9f/YGrfgUND+T+dDJBAgNN/N6FKMjxDKN833BwI2WuTu4p5z/90RREO+pCplfz5/PQlGQPnJEwCWS0HUruODpiak8tuDJoYUAgHx4M0c32HzgcCYNugFMn2pg5zposePv4EXpvpeXUy+VdKpQKiXQLz; 25:icaSvzNBcd2f8PcvZXBrM5S51FCxyCmKAkR1uYQI8JCiAal07H9JHbOuyjt9gmUFFqPxStQAdzC2sPlX8cpoA6flndxYCnDB9u9xOnu0dx6SK/45e82PDzAnjPPYLW4U1BW6WeSK3Ze/ZuFAH14ynQG1M7XzuSpRmd8V8aX+AcK/Zyve5ZgVrMCE7t3IGPZPhH/V6o3O7jPoG4h6LGHgM2q7RhWo+NhRCm6q24TbBuq6aSeQMn3FCF9wWdMoRGgpq8ILqNpBcfKv3VK8B1jXRVqv6E2NMAmzm2uUUTSFjE8tDmd8i771rq0ntSjOeKmeUnKD+1VZ6TcN1N+BXM8P3Q==; 31:oDLn1rnvc7PGWPdBj0rHuXzWDMnNsYCe9oFWP1XAdp8ivg2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gHvrfK5e/Xmwif+e7d+DylrX0+ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231101)(944501161)(6055026)(6041288)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:VI1PR04MB1008; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB1008; X-Forefront-PRVS: 0585417D7B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(39380400002)(396003)(39860400002)(366004)(199004)(189003)(86362001)(575784001)(6486002)(8676002)(76176011)(36756003)(53376002)(966005)(4326008)(6116002)(15188155005)(16799955002)(7736002)(386003)(68736007)(186003)(26005)(53936002)(305945005)(16526019)(81156014)(3846002)(6506007)(478600001)(50226002)(16586007)(8936002)(2950100002)(316002)(2906002)(25786009)(97736004)(50466002)(48376002)(105586002)(52116002)(47776003)(81166006)(51416003)(5660300001)(6666003)(106356001)(66066001)(6306002)(6512007)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB1008; H:idcbfarm.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR04MB1008; 23:0pYF2MKCMeE1ODhoW0UR3nDywKSEoyy+sIlVQS206?= =?us-ascii?Q?yUc4PAZLrks30zttmGQMiBu0Ku5gC/rkcD1L7nNFVg1WgW7z7wgF7EZ9USqa?= =?us-ascii?Q?VAP19t+g2WflWfwbs4AGZdA6EUV/vjaFgp1mVxHfkfsJGarZitBiK9AizFB5?= =?us-ascii?Q?0EBuq9OA+UAsKhXxj7TqKN9R0z8Mdf6vaBCDNO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BnUmf80k+Qrl4wOXf+dqXJ9LfNkSZtuI6IUULXYC/t3i+Eu+yTYr98fxF82Xk7wGCc2hL0QK1OafKAxL7YXamy6kpBdQiFHjmpigIUIPe1f2 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2018 08:54:39.9047 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 975a2f50-b362-4bf8-ffb1-08d5751aebd0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB1008 Subject: [PATCH edk2-platforms 29/39] Platform/NXP: LS2088 RDB Board FPGA library X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 08:48:53 -0000 Content-Type: text/plain From: Wasim Khan Library to provide functions for accessing FPGA on LS2088ARDB board. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wasim Khan --- .../NXP/LS2088aRdbPkg/Include/Library/FpgaLib.h | 166 +++++++++++++++++++++ .../NXP/LS2088aRdbPkg/Library/FpgaLib/FpgaLib.c | 115 ++++++++++++++ .../NXP/LS2088aRdbPkg/Library/FpgaLib/FpgaLib.inf | 31 ++++ 3 files changed, 312 insertions(+) create mode 100644 Platform/NXP/LS2088aRdbPkg/Include/Library/FpgaLib.h create mode 100644 Platform/NXP/LS2088aRdbPkg/Library/FpgaLib/FpgaLib.c create mode 100644 Platform/NXP/LS2088aRdbPkg/Library/FpgaLib/FpgaLib.inf diff --git a/Platform/NXP/LS2088aRdbPkg/Include/Library/FpgaLib.h b/Platform/NXP/LS2088aRdbPkg/Include/Library/FpgaLib.h new file mode 100644 index 0000000..84d1f02 --- /dev/null +++ b/Platform/NXP/LS2088aRdbPkg/Include/Library/FpgaLib.h @@ -0,0 +1,166 @@ +/** FpgaLib.h +* Header defining the LS2088a Fpga specific constants (Base addresses, sizes, flags) +* +* Copyright 2017-2018 NXP +* +* 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 __LS2088A_FPGA_H__ +#define __LS2088A_FPGA_H__ + +typedef enum { + CLK_66, + CLK_83, + CLK_100, + CLK_125, + CLK_133 +} SYSTEM_CLOCK; + +/* + * FPGA register set of LS2088ARDB board-specific. + */ +typedef struct { + UINT8 Id; // ID value uniquely identifying each QorIQ board type + UINT8 Arch; // Board Version + UINT8 Ver; // FPGA Version + UINT8 Model; // Programming Model + UINT8 Minor; // Minor Revision Number + UINT8 CtlSys; + UINT8 Aux; + UINT8 ClkSpd; + UINT8 StatDut; + UINT8 StatSys; + UINT8 StatAlrm; + UINT8 Present; + UINT8 Present2; + UINT8 RcwCtl; + UINT8 CtlLed; + UINT8 I2cBlk; + UINT8 RcfgCtl; + UINT8 RcfgSt; + UINT8 DcmAd; + UINT8 DcmDa; + UINT8 Dcmd; + UINT8 Dmsg; + UINT8 Gdc; + UINT8 Gdd; + UINT8 Dmack; + UINT8 Res1[6]; + UINT8 Watch; + UINT8 PwrCtl[2]; + UINT8 Res2[2]; + UINT8 PwrStat[4]; + UINT8 Res3[8]; + UINT8 ClkSpd2[2]; + UINT8 Res4[2]; + UINT8 Sclk[3]; + UINT8 Res5; + UINT8 Dclk[3]; + UINT8 Res6; + UINT8 ClkDspd[3]; + UINT8 Res7; + UINT8 RstCtl; + UINT8 RstStat; + UINT8 RstRsn; + UINT8 RstFrc[2]; + UINT8 Res8[11]; + UINT8 BrdCfg[16]; + UINT8 DutCfg[16]; + UINT8 RcwAd[2]; + UINT8 RcwData; + UINT8 Res9[5]; + UINT8 PostCtl; + UINT8 PostStat; + UINT8 PostDat[2]; + UINT8 Pid[4]; + UINT8 GpioIo[4]; + UINT8 GpioDir[4]; + UINT8 Res10[20]; + UINT8 RjtagCtl; + UINT8 RjtagDat; + UINT8 Res11[2]; + UINT8 TrigSrc[4]; + UINT8 TrigDst[4]; + UINT8 TrigStat; + UINT8 Res12[3]; + UINT8 TrigCtr[4]; + UINT8 Res13[16]; + UINT8 ClkFreq[6]; + UINT8 ResC6[8]; + UINT8 ClkBase[2]; + UINT8 ResD0[8]; + UINT8 Cms[2]; + UINT8 ResC0[6]; + UINT8 Aux2[4]; + UINT8 Res14[10]; + UINT8 AuxAd; + UINT8 AuxDa; + UINT8 Res15[16]; +} FPGA_REG_SET; + +/** + Function to read FPGA register. +**/ +UINT8 +FpgaRead ( + UINTN Reg + ); + +/** + Function to write FPGA register. +**/ +VOID +FpgaWrite ( + UINTN Reg, + UINT8 Value + ); + +/** + Function to initialize FPGA timings. +**/ +VOID +FpgaInit ( + VOID + ); + +/** + Function to get system clock frequency. +**/ +UINTN +GetBoardSysClk ( + VOID + ); + +/** + Function to print board personality. +**/ +VOID +PrintBoardPersonality ( + VOID + ); + +#define FPGA_BASE_PHYS 0x520000000 + +//SYSCLK +#define FPGA_CLK_MASK 0x0F // FPGA Clock Mask +#define SYSCLK_66_MHZ 66000000 +#define SYSCLK_83_MHZ 83000000 +#define SYSCLK_100_MHZ 100000000 +#define SYSCLK_125_MHZ 125000000 +#define SYSCLK_133_MHZ 133000000 + +#define FPGA_VBANK_MASK 0x07 +#define FPGA_CS_MASK 0x08 + +#define FPGA_READ(Reg) FpgaRead (OFFSET_OF (FPGA_REG_SET, Reg)) +#define FPGA_WRITE(Reg, Value) FpgaWrite (OFFSET_OF (FPGA_REG_SET, Reg), Value) + +#endif // __LS2088A_FPGA_H__ diff --git a/Platform/NXP/LS2088aRdbPkg/Library/FpgaLib/FpgaLib.c b/Platform/NXP/LS2088aRdbPkg/Library/FpgaLib/FpgaLib.c new file mode 100644 index 0000000..8948c21 --- /dev/null +++ b/Platform/NXP/LS2088aRdbPkg/Library/FpgaLib/FpgaLib.c @@ -0,0 +1,115 @@ +/** @FpgaLib.c + Fpga Library for LS2088A-RDB board, containing functions to + program and read the Fpga registers. + + FPGA is connected to IFC Controller and so MMIO APIs are used + to read/write FPGA registers + + Copyright 2017-2018 NXP + + 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. + +**/ + +#include +#include +#include +#include +#include + +/** + Function to read FPGA register. + + @param Reg Register offset of FPGA to read. + +**/ +UINT8 +FpgaRead ( + IN UINTN Reg + ) +{ + VOID *Base; + + Base = (VOID *)FPGA_BASE_PHYS; + + return MmioRead8 ((UINTN)(Base + Reg)); +} + +/** + Function to write FPGA register. + + @param Reg Register offset of FPGA to write. + @param Value Value to be written. + +**/ +VOID +FpgaWrite ( + IN UINTN Reg, + IN UINT8 Value + ) +{ + VOID *Base; + + Base = (VOID *)FPGA_BASE_PHYS; + + MmioWrite8 ((UINTN)(Base + Reg), Value); +} + +/** + Function to get board system clock frequency. + +**/ +UINTN +GetBoardSysClk ( + VOID + ) +{ + UINT8 SysclkConf; + SysclkConf = FPGA_READ (BrdCfg[1]); + switch (SysclkConf & FPGA_CLK_MASK) { + case CLK_66: + return SYSCLK_66_MHZ; + case CLK_83: + return SYSCLK_83_MHZ; + case CLK_100: + return SYSCLK_100_MHZ; + case CLK_125: + return SYSCLK_125_MHZ; + case CLK_133: + return SYSCLK_133_MHZ; + } + return SYSCLK_100_MHZ; +} + +/** + Function to print board personality. + +**/ +VOID +PrintBoardPersonality ( + VOID + ) +{ + UINT8 SwitchConf; + SwitchConf = FPGA_READ (Arch); + + DEBUG ((DEBUG_INFO, "Board Arch: V%d, ", SwitchConf >> 4)); + DEBUG ((DEBUG_INFO, "Board version: %c, boot from ", + (SwitchConf & 0xf) + 'A')); + + SwitchConf = FPGA_READ (BrdCfg[0]); + + if (SwitchConf & FPGA_CS_MASK) + DEBUG ((DEBUG_INFO, "NAND\n")); + else + DEBUG ((DEBUG_INFO, "vBank: %d\n", (SwitchConf & FPGA_VBANK_MASK))); + + DEBUG ((DEBUG_INFO, "FPGA: v%d.%d\n", FPGA_READ (Ver), + FPGA_READ (Minor))); +} diff --git a/Platform/NXP/LS2088aRdbPkg/Library/FpgaLib/FpgaLib.inf b/Platform/NXP/LS2088aRdbPkg/Library/FpgaLib/FpgaLib.inf new file mode 100644 index 0000000..e70723a --- /dev/null +++ b/Platform/NXP/LS2088aRdbPkg/Library/FpgaLib/FpgaLib.inf @@ -0,0 +1,31 @@ +# @FpgaLib.inf +# +# Copyright 2017-2018 NXP +# 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. +# + +[Defines] + INF_VERSION = 0x0001000A + BASE_NAME = FpgaLib + FILE_GUID = dd2ce2f3-f219-4b57-82fd-f1ff8ae8bf5a + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = FpgaLib + +[Sources.common] + FpgaLib.c + +[Packages] + MdePkg/MdePkg.dec + Platform/NXP/LS2088aRdbPkg/LS2088aRdbPkg.dec + Silicon/NXP/NxpQoriqLs.dec + +[LibraryClasses] + BaseLib + IoLib -- 1.9.1