From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.33.97; helo=nam01-bn3-obe.outbound.protection.outlook.com; envelope-from=christopher.co@microsoft.com; receiver=edk2-devel@lists.01.org Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0097.outbound.protection.outlook.com [104.47.33.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CA64F2098C8C9 for ; Wed, 18 Jul 2018 21:11:30 -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=VtIHaAPrRITfmuIfZiOYnu+dn2xvrxmnS+R/5txm7HY=; b=j2XT30i5iShMIhZAw3o19pVrlYmX7yxfHi519hoJDjx4FdqQjMAZwbn27Xb1jf7fFZhsOFkQAvp1f1ataZAkTUtql6hja4Ye4moHyTeVraDUmL1C2BjfYkkakrDEGJofdfd+9um0c7bKijELl3feoW++vX0xFA9tNaigUYFMDMY= Received: from DM5PR2101MB1128.namprd21.prod.outlook.com (52.132.133.20) by DM5PR2101MB0885.namprd21.prod.outlook.com (52.132.132.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.0; Thu, 19 Jul 2018 04:11:28 +0000 Received: from DM5PR2101MB1128.namprd21.prod.outlook.com ([fe80::b4d3:dabb:9372:9740]) by DM5PR2101MB1128.namprd21.prod.outlook.com ([fe80::b4d3:dabb:9372:9740%2]) with mapi id 15.20.0995.008; Thu, 19 Jul 2018 04:11:28 +0000 From: Chris Co To: "edk2-devel@lists.01.org" CC: Ard Biesheuvel , Leif Lindholm , Michael D Kinney Thread-Topic: [PATCH edk2-platforms 7/7] Silicon/NXP: Add headers for other iMX packages to use Thread-Index: AQHUHxaQmFbaSxUNcE6gCP1///4VSg== Date: Thu, 19 Jul 2018 04:11:27 +0000 Message-ID: <20180719041103.9072-8-christopher.co@microsoft.com> References: <20180719041103.9072-1-christopher.co@microsoft.com> In-Reply-To: <20180719041103.9072-1-christopher.co@microsoft.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BN6PR11CA0037.namprd11.prod.outlook.com (2603:10b6:404:4b::23) To DM5PR2101MB1128.namprd21.prod.outlook.com (2603:10b6:4:a8::20) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2001:4898:80e8:1:d144:e4c:c05:68bd] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB0885; 6:p8bgs0B736Smb0qTtti6Mkkh5J5bm2d56DcTxaIKjyUpNXv+AIKHKXnrhTchFI86K6IkqWmHOnn1sbKBT96IVHmGB82rbXoP2OOzzhPemO+1khA68F800KpKv7HaOlhpfhHWglnGJuAOoP3NPN6dP1IraFrwSMn87cY8Wjlsw1n4vncZXxgkt4Nu76MARUPySbsTPFfiesHATQIFbqHw+SoeOnPNg7ZEgx1TxpWPSE89hZUs8p0jbedjMZ0JYVM0ywM21JJDVpq5Aysxvn512+a7iSe98NF+3U8fKLo+8rq8VhAYzU+6mnCPAYmQvqSFaiwsSd4BKBZRaxJ1ep83L1BgbFSwk0ex5vszkOFipSAoGyl0rAHAZyKhAmYvnJdOwMaSYsXswFvv7vGDhJm7u3VmmpPshl7LRq3EDadlkKSlgo+x8QEcbybPOQDoGgsPNaarqn13WkTMAeSo0/yGdw==; 5:Psu4uh/BCyy41H/CRfouXAsb+rNs7ZCUmgs7JMTGGl2/MbYSTPZ89wlgXCgNZsDbFvn0wNlGTgA7OWxcH2cvyiYy7MRoG1HQ00oxuHoiNAMin9ZEV6IQGeU5HM7yCq27AnrT3W7MhPB7NwBSZLeBLRKOr4iUm9Lr2Aiuk9IjKgs=; 7:oj0sL5zctSkp3+Mci56v0aFfvCeziBkzrQmiwd+M7E8Y7HkLKA/0YShOASii7ibMc3yHCGzf456UR16GP1OJpIlAhKgBBRx8HK5QVUvZ4unh/O0vqNRDRl3bFqc2xPXM7KG6uBuj3UOOFno9nmS4TaMji6CgcD9QyfG935AA6luj5MQYs6SNPpg5HgEp8Xcj5LaJLaUWFPLvxKx/LftE0qyXGCQatg6V6MpR+QI+KTO/WLymT/2XWVfW/u8soYDz x-ms-office365-filtering-correlation-id: 8ae6bd6b-46e1-4b48-7466-08d5ed2db2fb x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600067)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7193020); SRVR:DM5PR2101MB0885; x-ms-traffictypediagnostic: DM5PR2101MB0885: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Christopher.Co@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231311)(944501410)(52105095)(2018427008)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:DM5PR2101MB0885; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0885; x-forefront-prvs: 0738AF4208 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(396003)(39860400002)(376002)(136003)(366004)(189003)(199004)(6486002)(476003)(6512007)(6306002)(8676002)(10290500003)(97736004)(54906003)(305945005)(6436002)(4326008)(68736007)(53946003)(16200700003)(446003)(81166006)(186003)(256004)(5640700003)(14444005)(81156014)(25786009)(16799955002)(2900100001)(22452003)(102836004)(15188155005)(966005)(99286004)(86362001)(2501003)(5250100002)(5660300001)(1076002)(478600001)(52116002)(14454004)(6506007)(6116002)(76176011)(486006)(106356001)(105586002)(36756003)(2616005)(11346002)(8936002)(46003)(53376002)(86612001)(2351001)(386003)(6916009)(72206003)(316002)(7736002)(2906002)(53936002)(10090500001)(569006); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0885; H:DM5PR2101MB1128.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: xb0k7BJvX7dHRYlNgqms/Bi+5kPK5bDoSrE4mrSln5MibaAGcNGaPC8R9Aov2jf82OTjKFx6FHQhZb2+DvwtoSmF4u3D2/Q8cu/TDybTbkb+/xa8esw2IfblhQf6Rei3o4VRxGlzHAtwctVmc3cNkSdmIKK+7qogOlZonlBfbdNqNz1+aT66LOVa5CQzG/Gr7/NTTeaPZiPvx8/6+fFc3co6JzcXNOfnVJGKLglYumAlFOUEX8MqMqTGxT9kNp3AQB+uCRCBzxsRlTD58q7i0tIw4mwH3+EI/JthNrP0GCojLsJb7PXdNoChy4C9tJK9bHdPn7q5d2DrGM9ugp0xPzNaCk3fl0JsAEgEMfA1/y0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ae6bd6b-46e1-4b48-7466-08d5ed2db2fb X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2018 04:11:28.0397 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0885 Subject: [PATCH edk2-platforms 7/7] Silicon/NXP: Add headers for other iMX packages to use 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: Thu, 19 Jul 2018 04:11:31 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable This adds common headers for NXP i.MX platforms. More specifically, common i.MX platform definitions and macros. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Christopher Co Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Michael D Kinney --- Silicon/NXP/iMXPlatformPkg/Include/Platform.h | 86 +++ Silicon/NXP/iMXPlatformPkg/Include/common_macros.h | 561 +++++++++++++++++= +++ Silicon/NXP/iMXPlatformPkg/Include/iMXIoMux.h | 24 + 3 files changed, 671 insertions(+) diff --git a/Silicon/NXP/iMXPlatformPkg/Include/Platform.h b/Silicon/NXP/iM= XPlatformPkg/Include/Platform.h new file mode 100644 index 000000000000..7fb3bdfacf7c --- /dev/null +++ b/Silicon/NXP/iMXPlatformPkg/Include/Platform.h @@ -0,0 +1,86 @@ +/** @file +* +* Copyright (c) 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. +* +**/ +// +// Freescale i.MX Platform specific defines for constructing ACPI tables +// + +#ifndef _PLATFORM_IMX_H_ +#define _PLATFORM_IMX_H_ + +#include + +#define EFI_ACPI_OEM_ID {'M','C','R','S','F','T'} = // OEMID 6 bytes long + +#define EFI_ACPI_VENDOR_ID SIGNATURE_32('M','S','F','= T') +#define EFI_ACPI_CSRT_REVISION 0x00000005 + +#define EFI_ACPI_5_0_CSRT_REVISION 0x00000000 + +// +// Resource Descriptor Types +// + +#define EFI_ACPI_CSRT_RD_TYPE_INTERRUPT 1 +#define EFI_ACPI_CSRT_RD_TYPE_TIMER 2 +#define EFI_ACPI_CSRT_RD_TYPE_DMA 3 +#define EFI_ACPI_CSRT_RD_TYPE_CACHE 4 + +// +// Resource Descriptor Subtypes +// + +#define EFI_ACPI_CSRT_RD_SUBTYPE_INTERRUPT_LINES 0 +#define EFI_ACPI_CSRT_RD_SUBTYPE_INTERRUPT_CONTROLLER 1 +#define EFI_ACPI_CSRT_RD_SUBTYPE_TIMER 0 +#define EFI_ACPI_CSRT_RD_SUBTYPE_DMA_CHANNEL 0 +#define EFI_ACPI_CSRT_RD_SUBTYPE_DMA_CONTROLLER 1 +#define EFI_ACPI_CSRT_RD_SUBTYPE_CACHE 0 + +// +// Fixed device IDs +// + +#define EFI_ACPI_CSRT_DEVICE_ID_DMA 0x00000009 + +#pragma pack(push, 1) + +//------------------------------------------------------------------------ +// CSRT Resource Group header 24 bytes long +//------------------------------------------------------------------------ +typedef struct +{ + UINT32 Length; // Length + UINT32 VendorID; // 4 bytes + UINT32 SubVendorId; // 4 bytes + UINT16 DeviceId; // 2 bytes + UINT16 SubdeviceId; // 2 bytes + UINT16 Revision; // 2 bytes + UINT16 Reserved; // 2 bytes + UINT32 SharedInfoLength; // 4 bytes +} EFI_ACPI_5_0_CSRT_RESOURCE_GROUP_HEADER; + +//------------------------------------------------------------------------ +// CSRT Resource Descriptor 12 bytes total +//------------------------------------------------------------------------ +typedef struct +{ + UINT32 Length; // 4 bytes + UINT16 ResourceType; // 2 bytes + UINT16 ResourceSubType; // 2 bytes + UINT32 UID; // 4 bytes +} EFI_ACPI_5_0_CSRT_RESOURCE_DESCRIPTOR_HEADER; + +#pragma pack (pop) + +#endif // !_PLATFORM_IMX_H_ diff --git a/Silicon/NXP/iMXPlatformPkg/Include/common_macros.h b/Silicon/N= XP/iMXPlatformPkg/Include/common_macros.h new file mode 100644 index 000000000000..5f28f31050c6 --- /dev/null +++ b/Silicon/NXP/iMXPlatformPkg/Include/common_macros.h @@ -0,0 +1,561 @@ +/** @file +* +* Copyright (c) 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. +* +**/ +//------------------------------------------------------------------------= ----- +// +// Header: common_macros.h +// +// Provides common macro definitions SOC/BSP code development. +// +//------------------------------------------------------------------------= ------ +// +// Copyright (C) 2007-2010, Freescale Semiconductor, Inc. All Rights Reser= ved. +// THIS SOURCE CODE, AND ITS USE AND DISTRIBUTION, IS SUBJECT TO THE TERMS +// AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT +// +//------------------------------------------------------------------------= ------ + +#ifndef __SOCARM_MACROS_H__ +#define __SOCARM_MACROS_H__ + +// Bitfield macros that use rely on bitfield width/shift information +// defined in SOC header files +#define CSP_BITFMASK(bit) (((1U << (bit ## _WID)) - 1) << (bit ## _LSH)) +#define CSP_BITFVAL(bit, val) ((val) << (bit ## _LSH)) + +// Undefine previous implementations of peripheral access macros since +// we want to "own" the definitions and avoid redefinition warnings +// resulting from source code that includes oal_io.h +#undef INREG8 +#undef OUTREG8 +#undef SETREG8 +#undef CLRREG8 +#undef INREG16 +#undef OUTREG16 +#undef SETREG16 +#undef CLRREG16 +#undef INREG32 +#undef OUTREG32 +#undef SETREG32 +#undef CLRREG32 + +#define READ_REGISTER_ULONG(reg) \ + (*(volatile unsigned long * const)(reg)) + +#define WRITE_REGISTER_ULONG(reg, val) \ + (*(volatile unsigned long * const)(reg)) =3D (val) + +#define READ_REGISTER_USHORT(reg) \ + (*(volatile unsigned short * const)(reg)) + +#define WRITE_REGISTER_USHORT(reg, val) \ + (*(volatile unsigned short * const)(reg)) =3D (val) + +#define READ_REGISTER_UCHAR(reg) \ + (*(volatile unsigned char * const)(reg)) + +#define WRITE_REGISTER_UCHAR(reg, val) \ + (*(volatile unsigned char * const)(reg)) =3D (val) + + +// Macros for accessing peripheral registers using DDK macros/functions +#define INREG8(x) READ_REGISTER_UCHAR((UCHAR*)(x)) +#define OUTREG8(x, y) WRITE_REGISTER_UCHAR((UCHAR*)(x), (UCHAR)(y)) +#define SETREG8(x, y) OUTREG8(x, INREG8(x)|(y)) +#define CLRREG8(x, y) OUTREG8(x, INREG8(x)&~(y)) +#define INSREG8(addr, mask, val) OUTREG8(addr, ((INREG8(addr)&(~(mask))) |= val)) +#define EXTREG8(addr, mask, lsh) ((INREG8(addr) & mask) >> lsh) +#define EXTREG8BF(addr, bit) (EXTREG8(addr, CSP_BITFMASK(bit), (bit ## _LS= H))) +#define INSREG8BF(addr, bit, val) (INSREG8(addr, CSP_BITFMASK(bit), CSP_BI= TFVAL(bit, val))) + +#define INREG16(x) READ_REGISTER_USHORT((USHORT*)(x)) +#define OUTREG16(x, y) WRITE_REGISTER_USHORT((USHORT*)(x),(USHORT)(y)= ) +#define SETREG16(x, y) OUTREG16(x, INREG16(x)|(y)) +#define CLRREG16(x, y) OUTREG16(x, INREG16(x)&~(y)) +#define INSREG16(addr, mask, val) OUTREG16(addr, ((INREG16(addr)&(~(mask))= ) | val)) +#define EXTREG16(addr, mask, lsh) ((INREG16(addr) & mask) >> lsh) +#define EXTREG16BF(addr, bit) (EXTREG16(addr, CSP_BITFMASK(bit), (bit ## _= LSH))) +#define INSREG16BF(addr, bit, val) (INSREG16(addr, CSP_BITFMASK(bit), CSP_= BITFVAL(bit, val))) + +#define INREG32(x) READ_REGISTER_ULONG((long*)(x)) +#define OUTREG32(x, y) WRITE_REGISTER_ULONG((long*)(x), (long)(y)) +#define SETREG32(x, y) OUTREG32(x, INREG32(x)|(y)) +#define CLRREG32(x, y) OUTREG32(x, INREG32(x)&~(y)) +#define INSREG32(addr, mask, val) OUTREG32(addr, ((INREG32(addr)&(~(mask))= ) | val)) +#define EXTREG32(addr, mask, lsh) ((INREG32(addr) & mask) >> lsh) +#define EXTREG32BF(addr, bit) (EXTREG32(addr, CSP_BITFMASK(bit), (bit ## _= LSH))) +#define INSREG32BF(addr, bit, val) (INSREG32(addr, CSP_BITFMASK(bit), CSP_= BITFVAL(bit, val))) + +// macros for pin mux +#define OAL_IOMUX_SET_MUX(pIOMUX, pin, muxmode, sion) \ + OUTREG32(&pIOMUX->SW_MUX_CTL[pin], (muxmode | sion)) + +#define OAL_IOMUX_SET_PAD(pIOMUX, pad, slew, drive, openDrain, pull, hyste= resis, inputMode, outputVolt) \ + OUTREG32(&pIOMUX->SW_PAD_CTL[pad], (slew | drive | openDrain | pull | = hysteresis | inputMode | outputVolt)) + + +// Macros for bitfield operations on data variables. DO NOT use for perip= heral +// register accesses. Use the INREG/OUTREG based macros above for periphe= ral +// accesses. +#define CSP_BITFEXT(var, bit) ((var & CSP_BITFMASK(bit)) >> (bit ## _LSH)) + +#define CSP_BITFCLR(var, bit) (var &=3D (~CSP_BITFMASK(bit))) + +#define CSP_BITFINS(var, bit, val) \ + (CSP_BITFCLR(var, bit)); (var |=3D CSP_BITFVAL(bit, val)) + +// Macros for generating 64-bit IRQ masks +#define CSP_IRQMASK(irq) (((ULONGLONG) 1) << irq) + +// Macros to create Unicode function name +#define WIDEN2(x) L ## x +#define WIDEN(x) WIDEN2(x) +#define __WFUNCTION__ WIDEN(__FUNCTION__) + +// Macros for function tracing (better to use debug zones as these +// macros will be phases out) +#define CSP_FUNC_TRACE_ENTRY() \ + DEBUGMSG(1, (TEXT("+%s\r\n"), __WFUNCTION__)) + +#define CSP_FUNC_TRACE_EXIT() \ + DEBUGMSG(1, (TEXT("-%s\r\n"), __WFUNCTION__)) + +// Macros for importing/exporting DLL interface +#define DllExport __declspec( dllexport ) + + +//STMP macros for single instance registers +#define BF_SET(reg, field) HW_ ## reg ## _SET(BM_ ## reg ## _ ## fie= ld) +#define BF_CLR(reg, field) HW_ ## reg ## _CLR(BM_ ## reg ## _ ## fie= ld) +#define BF_TOG(reg, field) HW_ ## reg ## _TOG(BM_ ## reg ## _ ## fie= ld) + +#define BF_SETV(reg, field, v) HW_ ## reg ## _SET(BF_ ## reg ## _ ## fie= ld(v)) +#define BF_CLRV(reg, field, v) HW_ ## reg ## _CLR(BF_ ## reg ## _ ## fie= ld(v)) +#define BF_TOGV(reg, field, v) HW_ ## reg ## _TOG(BF_ ## reg ## _ ## fie= ld(v)) + +#define BV_FLD(reg, field, sym) BF_ ## reg ## _ ## field(BV_ ## reg ## _ = ## field ## __ ## sym) +#define BV_VAL(reg, field, sym) BV_ ## reg ## _ ## field ## __ ## sym + +#define BF_RD(reg, field) HW_ ## reg.B.field +#define BF_WR(reg, field, v) BW_ ## reg ## _ ## field(v) + +#define BF_CS1(reg, f1, v1) \ + (HW_ ## reg ## _CLR(BM_ ## reg ## _ ## f1), \ + HW_ ## reg ## _SET(BF_ ## reg ## _ ## f1(v1))) + +#define BF_CS2(reg, f1, v1, f2, v2) \ + (HW_ ## reg ## _CLR(BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2), \ + HW_ ## reg ## _SET(BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2))) + +#define BF_CS3(reg, f1, v1, f2, v2, f3, v3) \ + (HW_ ## reg ## _CLR(BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3), \ + HW_ ## reg ## _SET(BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3))) + +#define BF_CS4(reg, f1, v1, f2, v2, f3, v3, f4, v4) \ + (HW_ ## reg ## _CLR(BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4), \ + HW_ ## reg ## _SET(BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4))) + +#define BF_CS5(reg, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5) \ + (HW_ ## reg ## _CLR(BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4 | \ + BM_ ## reg ## _ ## f5), \ + HW_ ## reg ## _SET(BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4) | \ + BF_ ## reg ## _ ## f5(v5))) + +#define BF_CS6(reg, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5, f6, v6) \ + (HW_ ## reg ## _CLR(BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4 | \ + BM_ ## reg ## _ ## f5 | \ + BM_ ## reg ## _ ## f6), \ + HW_ ## reg ## _SET(BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4) | \ + BF_ ## reg ## _ ## f5(v5) | \ + BF_ ## reg ## _ ## f6(v6))) + +#define BF_CS7(reg, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5, f6, v6, f7, v7= ) \ + (HW_ ## reg ## _CLR(BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4 | \ + BM_ ## reg ## _ ## f5 | \ + BM_ ## reg ## _ ## f6 | \ + BM_ ## reg ## _ ## f7), \ + HW_ ## reg ## _SET(BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4) | \ + BF_ ## reg ## _ ## f5(v5) | \ + BF_ ## reg ## _ ## f6(v6) | \ + BF_ ## reg ## _ ## f7(v7))) + +#define BF_CS8(reg, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5, f6, v6, f7, v7= , f8, v8) \ + (HW_ ## reg ## _CLR(BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4 | \ + BM_ ## reg ## _ ## f5 | \ + BM_ ## reg ## _ ## f6 | \ + BM_ ## reg ## _ ## f7 | \ + BM_ ## reg ## _ ## f8), \ + HW_ ## reg ## _SET(BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4) | \ + BF_ ## reg ## _ ## f5(v5) | \ + BF_ ## reg ## _ ## f6(v6) | \ + BF_ ## reg ## _ ## f7(v7) | \ + BF_ ## reg ## _ ## f8(v8))) + + +// +// macros for multiple instance registers +// + +#define BF_SETn(reg, n, field) HW_ ## reg ## _SET(n, BM_ ## reg ## _= ## field) +#define BF_CLRn(reg, n, field) HW_ ## reg ## _CLR(n, BM_ ## reg ## _= ## field) +#define BF_TOGn(reg, n, field) HW_ ## reg ## _TOG(n, BM_ ## reg ## _= ## field) + +#define BF_SETVn(reg, n, field, v) HW_ ## reg ## _SET(n, BF_ ## reg ## _= ## field(v)) +#define BF_CLRVn(reg, n, field, v) HW_ ## reg ## _CLR(n, BF_ ## reg ## _= ## field(v)) +#define BF_TOGVn(reg, n, field, v) HW_ ## reg ## _TOG(n, BF_ ## reg ## _= ## field(v)) + +#define BV_FLDn(reg, n, field, sym) BF_ ## reg ## _ ## field(BV_ ## reg #= # _ ## field ## __ ## sym) +#define BV_VALn(reg, n, field, sym) BV_ ## reg ## _ ## field ## __ ## sym + +#define BF_RDn(reg, n, field) HW_ ## reg(n).B.field +#define BF_WRn(reg, n, field, v) BW_ ## reg ## _ ## field(n, v) + +#define BF_CS1n(reg, n, f1, v1) \ + (HW_ ## reg ## _CLR(n, (BM_ ## reg ## _ ## f1)), \ + HW_ ## reg ## _SET(n, (BF_ ## reg ## _ ## f1(v1)))) + +#define BF_CS2n(reg, n, f1, v1, f2, v2) \ + (HW_ ## reg ## _CLR(n, (BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2)), \ + HW_ ## reg ## _SET(n, (BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2)))) + +#define BF_CS3n(reg, n, f1, v1, f2, v2, f3, v3) \ + (HW_ ## reg ## _CLR(n, (BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3)), \ + HW_ ## reg ## _SET(n, (BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3)))) + +#define BF_CS4n(reg, n, f1, v1, f2, v2, f3, v3, f4, v4) \ + (HW_ ## reg ## _CLR(n, (BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4)), \ + HW_ ## reg ## _SET(n, (BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4)))) + +#define BF_CS5n(reg, n, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5) \ + (HW_ ## reg ## _CLR(n, (BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4 | \ + BM_ ## reg ## _ ## f5)), \ + HW_ ## reg ## _SET(n, (BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4) | \ + BF_ ## reg ## _ ## f5(v5)))) + +#define BF_CS6n(reg, n, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5, f6, v6) \ + (HW_ ## reg ## _CLR(n, (BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4 | \ + BM_ ## reg ## _ ## f5 | \ + BM_ ## reg ## _ ## f6)), \ + HW_ ## reg ## _SET(n, (BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4) | \ + BF_ ## reg ## _ ## f5(v5) | \ + BF_ ## reg ## _ ## f6(v6)))) + +#define BF_CS7n(reg, n, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5, f6, v6, f7= , v7) \ + (HW_ ## reg ## _CLR(n, (BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4 | \ + BM_ ## reg ## _ ## f5 | \ + BM_ ## reg ## _ ## f6 | \ + BM_ ## reg ## _ ## f7)), \ + HW_ ## reg ## _SET(n, (BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4) | \ + BF_ ## reg ## _ ## f5(v5) | \ + BF_ ## reg ## _ ## f6(v6) | \ + BF_ ## reg ## _ ## f7(v7)))) + +#define BF_CS8n(reg, n, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5, f6, v6, f7= , v7, f8, v8) \ + (HW_ ## reg ## _CLR(n, (BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4 | \ + BM_ ## reg ## _ ## f5 | \ + BM_ ## reg ## _ ## f6 | \ + BM_ ## reg ## _ ## f7 | \ + BM_ ## reg ## _ ## f8)), \ + HW_ ## reg ## _SET(n, (BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4) | \ + BF_ ## reg ## _ ## f5(v5) | \ + BF_ ## reg ## _ ## f6(v6) | \ + BF_ ## reg ## _ ## f7(v7) | \ + BF_ ## reg ## _ ## f8(v8)))) + +/////// + +// +// macros for single instance registers +// + +#define BFi_SET(i, reg, field) HWi_ ## reg ## _SET(i, BM_ ## reg ## = _ ## field) +#define BFi_CLR(i, reg, field) HWi_ ## reg ## _CLR(i, BM_ ## reg ## = _ ## field) +#define BFi_TOG(i, reg, field) HWi_ ## reg ## _TOG(i, BM_ ## reg ## = _ ## field) + +#define BFi_SETV(i, reg, field, v) HWi_ ## reg ## _SET(i, BF_ ## reg ## = _ ## field(v)) +#define BFi_CLRV(i, reg, field, v) HWi_ ## reg ## _CLR(i, BF_ ## reg ## = _ ## field(v)) +#define BFi_TOGV(i, reg, field, v) HWi_ ## reg ## _TOG(i, BF_ ## reg ## = _ ## field(v)) + +#define BFi_RD(i, reg, field) HWi_ ## reg(i).B.field +#define BFi_WR(i, reg, field, v) BWi_ ## reg ## _ ## field(i, v) + +#define BFi_CS1(i, reg, f1, v1) \ + (HWi_ ## reg ## _CLR(i, BM_ ## reg ## _ ## f1), \ + HWi_ ## reg ## _SET(i, BF_ ## reg ## _ ## f1(v1))) + +#define BFi_CS2(i, reg, f1, v1, f2, v2) \ + (HWi_ ## reg ## _CLR(i, BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2), \ + HWi_ ## reg ## _SET(i, BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2))) + +#define BFi_CS3(i, reg, f1, v1, f2, v2, f3, v3) \ + (HWi_ ## reg ## _CLR(i, BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3), \ + HWi_ ## reg ## _SET(i, BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3))) + +#define BFi_CS4(i, reg, f1, v1, f2, v2, f3, v3, f4, v4) \ + (HWi_ ## reg ## _CLR(i, BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4), \ + HWi_ ## reg ## _SET(i, BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4))) + +#define BFi_CS5(i, reg, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5) \ + (HWi_ ## reg ## _CLR(i, BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4 | \ + BM_ ## reg ## _ ## f5), \ + HWi_ ## reg ## _SET(i, BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4) | \ + BF_ ## reg ## _ ## f5(v5))) + +#define BFi_CS6(i, reg, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5, f6, v6) \ + (HWi_ ## reg ## _CLR(i, BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4 | \ + BM_ ## reg ## _ ## f5 | \ + BM_ ## reg ## _ ## f6), \ + HWi_ ## reg ## _SET(i, BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4) | \ + BF_ ## reg ## _ ## f5(v5) | \ + BF_ ## reg ## _ ## f6(v6))) + +#define BFi_CS7(i, reg, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5, f6, v6, f7= , v7) \ + (HWi_ ## reg ## _CLR(i, BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4 | \ + BM_ ## reg ## _ ## f5 | \ + BM_ ## reg ## _ ## f6 | \ + BM_ ## reg ## _ ## f7), \ + HWi_ ## reg ## _SET(i, BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4) | \ + BF_ ## reg ## _ ## f5(v5) | \ + BF_ ## reg ## _ ## f6(v6) | \ + BF_ ## reg ## _ ## f7(v7))) + +#define BFi_CS8(i, reg, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5, f6, v6, f7= , v7, f8, v8) \ + (HWi_ ## reg ## _CLR(i, BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4 | \ + BM_ ## reg ## _ ## f5 | \ + BM_ ## reg ## _ ## f6 | \ + BM_ ## reg ## _ ## f7 | \ + BM_ ## reg ## _ ## f8), \ + HWi_ ## reg ## _SET(i, BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4) | \ + BF_ ## reg ## _ ## f5(v5) | \ + BF_ ## reg ## _ ## f6(v6) | \ + BF_ ## reg ## _ ## f7(v7) | \ + BF_ ## reg ## _ ## f8(v8))) + + +// +// macros for multiple instance registers +// + +#define BFi_SETn(i, reg, n, field) HWi_ ## reg ## _SET(i, n, BM_ ## = reg ## _ ## field) +#define BFi_CLRn(i, reg, n, field) HWi_ ## reg ## _CLR(i, n, BM_ ## = reg ## _ ## field) +#define BFi_TOGn(i, reg, n, field) HWi_ ## reg ## _TOG(i, n, BM_ ## = reg ## _ ## field) + +#define BFi_SETVn(i, reg, n, field, v) HWi_ ## reg ## _SET(i, n, BF_ ## = reg ## _ ## field(v)) +#define BFi_CLRVn(i, reg, n, field, v) HWi_ ## reg ## _CLR(i, n, BF_ ## = reg ## _ ## field(v)) +#define BFi_TOGVn(i, reg, n, field, v) HWi_ ## reg ## _TOG(i, n, BF_ ## = reg ## _ ## field(v)) + +#define BFi_RDn(i, reg, n, field) HWi_ ## reg(i, n).B.field +#define BFi_WRn(i, reg, n, field, v) BWi_ ## reg ## _ ## field(i, n, v= ) + +#define BFi_CS1n(i, reg, n, f1, v1) \ + (HWi_ ## reg ## _CLR(i, n, (BM_ ## reg ## _ ## f1)), \ + HWi_ ## reg ## _SET(i, n, (BF_ ## reg ## _ ## f1(v1)))) + +#define BFi_CS2n(i, reg, n, f1, v1, f2, v2) \ + (HWi_ ## reg ## _CLR(i, n, (BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2)), \ + HWi_ ## reg ## _SET(i, n, (BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2)))) + +#define BFi_CS3n(i, reg, n, f1, v1, f2, v2, f3, v3) \ + (HWi_ ## reg ## _CLR(i, n, (BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3)), \ + HWi_ ## reg ## _SET(i, n, (BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3)))) + +#define BFi_CS4n(i, reg, n, f1, v1, f2, v2, f3, v3, f4, v4) \ + (HWi_ ## reg ## _CLR(i, n, (BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4)), \ + HWi_ ## reg ## _SET(i, n, (BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4)))) + +#define BFi_CS5n(i, reg, n, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5) \ + (HWi_ ## reg ## _CLR(i, n, (BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4 | \ + BM_ ## reg ## _ ## f5)), \ + HWi_ ## reg ## _SET(i, n, (BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4) | \ + BF_ ## reg ## _ ## f5(v5)))) + +#define BFi_CS6n(i, reg, n, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5, f6, v6= ) \ + (HWi_ ## reg ## _CLR(i, n, (BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4 | \ + BM_ ## reg ## _ ## f5 | \ + BM_ ## reg ## _ ## f6)), \ + HWi_ ## reg ## _SET(i, n, (BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4) | \ + BF_ ## reg ## _ ## f5(v5) | \ + BF_ ## reg ## _ ## f6(v6)))) + +#define BFi_CS7n(i, reg, n, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5, f6, v6= , f7, v7) \ + (HWi_ ## reg ## _CLR(i, n, (BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4 | \ + BM_ ## reg ## _ ## f5 | \ + BM_ ## reg ## _ ## f6 | \ + BM_ ## reg ## _ ## f7)), \ + HWi_ ## reg ## _SET(i, n, (BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4) | \ + BF_ ## reg ## _ ## f5(v5) | \ + BF_ ## reg ## _ ## f6(v6) | \ + BF_ ## reg ## _ ## f7(v7)))) + +#define BFi_CS8n(i, reg, n, f1, v1, f2, v2, f3, v3, f4, v4, f5, v5, f6, v6= , f7, v7, f8, v8) \ + (HWi_ ## reg ## _CLR(i, n, (BM_ ## reg ## _ ## f1 | \ + BM_ ## reg ## _ ## f2 | \ + BM_ ## reg ## _ ## f3 | \ + BM_ ## reg ## _ ## f4 | \ + BM_ ## reg ## _ ## f5 | \ + BM_ ## reg ## _ ## f6 | \ + BM_ ## reg ## _ ## f7 | \ + BM_ ## reg ## _ ## f8)), \ + HWi_ ## reg ## _SET(i, n, (BF_ ## reg ## _ ## f1(v1) | \ + BF_ ## reg ## _ ## f2(v2) | \ + BF_ ## reg ## _ ## f3(v3) | \ + BF_ ## reg ## _ ## f4(v4) | \ + BF_ ## reg ## _ ## f5(v5) | \ + BF_ ## reg ## _ ## f6(v6) | \ + BF_ ## reg ## _ ## f7(v7) | \ + BF_ ## reg ## _ ## f8(v8)))) +// Macros to create Unicode function name +#define WIDEN2(x) L ## x +#define WIDEN(x) WIDEN2(x) +#define __WFUNCTION__ WIDEN(__FUNCTION__) + + +#endif // __SOCARM_MACROS_H__ diff --git a/Silicon/NXP/iMXPlatformPkg/Include/iMXIoMux.h b/Silicon/NXP/iM= XPlatformPkg/Include/iMXIoMux.h new file mode 100644 index 000000000000..b7ff96926639 --- /dev/null +++ b/Silicon/NXP/iMXPlatformPkg/Include/iMXIoMux.h @@ -0,0 +1,24 @@ +/** @file +* +* Copyright (c) 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. +* +**/ + +#ifndef _IMX_IO_MUX_H_ +#define _IMX_IO_MUX_H_ + +#define _IMX_PAD(CtlRegOffset, MuxRegOffset) \ + ((((CtlRegOffset) & 0xffff) << 16) | ((MuxRegOffset) & 0xffff)) + +#define _IMX_PAD_CTL_OFFSET(ImxPadVal) ((ImxPadVal) >> 16) +#define _IMX_PAD_MUX_OFFSET(ImxPadVal) ((ImxPadVal) & 0xffff) + +#endif // _IMX_IO_MUX_H_ --=20 2.16.2.gvfs.1.33.gf5370f1