From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a01:111:f400:fe49::725; helo=nam03-dm3-obe.outbound.protection.outlook.com; envelope-from=christopher.co@microsoft.com; receiver=edk2-devel@lists.01.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0725.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe49::725]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 81D142098EAA8 for ; Thu, 19 Jul 2018 23:33:49 -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=GMBc1ORbcUHDAzivhJcNJkpqixKDMLz8URRhf6jnS2w=; b=dQFD1Hh54lksGHAmoWz3eSYs8ecVfLd67MqsdcLEV5+i/IsxSuJ76c2N/vy8SrzoY22pJ7tHJRUF9Ou/dKUvU+q7AccDOB9WfPkWMCcUB+FE6MzN4T3JQGqE8pHvbjZbaYsLCfIdr6oIde8i+k7Dujf9vvmxI9k4/OKBCKeVjgM= Received: from SN6PR2101MB1136.namprd21.prod.outlook.com (52.132.114.25) by SN6PR2101MB1117.namprd21.prod.outlook.com (52.132.115.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.1; Fri, 20 Jul 2018 06:33:47 +0000 Received: from SN6PR2101MB1136.namprd21.prod.outlook.com ([fe80::78f8:214:33a:3c4]) by SN6PR2101MB1136.namprd21.prod.outlook.com ([fe80::78f8:214:33a:3c4%5]) with mapi id 15.20.0995.008; Fri, 20 Jul 2018 06:33:47 +0000 From: Chris Co To: "edk2-devel@lists.01.org" CC: Ard Biesheuvel , Leif Lindholm , Michael D Kinney Thread-Topic: [PATCH edk2-platforms 02/13] Silicon/NXP: Add i.MX6 GPT and EPIT timer headers Thread-Index: AQHUH/Oc38Wi0O6g8UqcyTYxU0zMZg== Date: Fri, 20 Jul 2018 06:33:45 +0000 Message-ID: <20180720063328.26856-3-christopher.co@microsoft.com> References: <20180720063328.26856-1-christopher.co@microsoft.com> In-Reply-To: <20180720063328.26856-1-christopher.co@microsoft.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: CY4PR18CA0029.namprd18.prod.outlook.com (2603:10b6:903:9a::15) To SN6PR2101MB1136.namprd21.prod.outlook.com (2603:10b6:805:4::25) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2001:4898:80e8:a:75ac:13c7:7dde:5215] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR2101MB1117; 6:wiAcCRf8UgrPdw+oyPDVDzQDZ7CgXxqPzD6MxTjPVUtbrv0YUKiSkoO/28a8q7vkC5ZArJNY8Fcq5ROrtFfPM4wVJaLYf56xsIP11GblOY2JQvoZhIUI5DuGpvibPe66KFvl3VbbqML0dt0qvbxy0PnctYV+Uf5KZCf25LO/ZTWWremDFAqulQYdw50YpYZ54Fnd8BUG197tGvBEqHXFwIhdSNRSOYVWIyP3kXmfQhQPLpQUyjPWEyz48338bz6GUd20v5BayXJnpgjI25p4JCRS07CjaqyA9tE7RYesfQZgNNTYVbpFo5dKq60CLvg1ZS61WEoCeEQdjjaiDOZSNoD3i2zAmtn2A/ndqSopicIPr7aVW9o38OFWpmmFp/G2/qUCz/KaM614NTUZuhNF8XcbtDYQ6RQ7mYfje+UKnF3PW8c2uKLfeSCb1VWRgzm2gY3TUtYdRxZLseZVp+NnLg==; 5:kEt8Yi9aL8W6ii4N0/p+ijW/f+bD4M2sOR8hm3/QRUPhZErP4g9Gnkck3fu4ldZQC46cJrSOD2+nrqMfHV5SreMjMnAp2YhOvaPBiDmXDSUMfJJsn/bEw7uY8k9uP4z44lUkVMMEjnul+0rMrMzIIQtccepUcNDwbKQ3ypmYpiQ=; 7:z/E0VIz2lS19nkzp3apf+vOPiFQlMlUz+8n0CPFugbfSPLpUKjk/dHyw9Xe4qgeHOFe7uylecD9F1pqdPNEoVXB3hombQJhxoeXVAHzpJDsXu17uslXERLxsiM/z/F+9edsyC4PLdsvuEzOrLYP13O4sDb5m6jtLAPjD5dLIhpiLO2k7/pZyd5/HyOerg5kktnpAVx7M4thjyaMiHMyog3RgvWElzgQHIewY+Oy+tMtrZEAeXPkeZ8MLDzvI4+ph x-ms-office365-filtering-correlation-id: b9c4eabe-c816-4d13-43cc-08d5ee0abe57 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:SN6PR2101MB1117; x-ms-traffictypediagnostic: SN6PR2101MB1117: 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)(3002001)(10201501046)(3231311)(944501410)(52105095)(2018427008)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:SN6PR2101MB1117; BCL:0; PCL:0; RULEID:; SRVR:SN6PR2101MB1117; x-forefront-prvs: 073966E86B x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(39860400002)(366004)(346002)(376002)(136003)(199004)(189003)(52116002)(8676002)(81156014)(105586002)(2616005)(446003)(53376002)(256004)(99286004)(46003)(11346002)(22452003)(106356001)(97736004)(6306002)(14444005)(6436002)(6506007)(386003)(72206003)(86612001)(6116002)(5660300001)(76176011)(25786009)(966005)(102836004)(1076002)(53936002)(81166006)(2900100001)(6512007)(478600001)(476003)(10290500003)(6916009)(16799955002)(186003)(2351001)(14454004)(5250100002)(36756003)(19627235002)(6486002)(54906003)(2501003)(10090500001)(86362001)(4326008)(575784001)(8936002)(5640700003)(68736007)(2906002)(53946003)(305945005)(15188155005)(486006)(7736002)(316002); DIR:OUT; SFP:1102; SCL:1; SRVR:SN6PR2101MB1117; H:SN6PR2101MB1136.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) x-microsoft-antispam-message-info: Mx2VJPRllIMQs9Q5UO8pcWYo2AvyusTTRz6mePsrcOo0gU+5SkI6rLG0GSl7FNYEVioWqHaD1hoYEJnTdIKjKw4nhLNB9FIH4wBLMQNuZOh3/7kDkTnrw70Kyri9B/HmJjDhpoh9N6BYlhqAXF6O1+GWMinLBDeb2j3HYX/nDU/hOkcii4ugkN6VDZ91XizkCWnLnsxoJd2nj1awiMyP37tod4oDW1eyJchVR+FIpgXI0zTHrPVk1JhvFySABW3G9dv+Dl9qdg8Amnm/MNM+d78mySLq56/zUJnWmLurJHz47sITJkpd+xUn/zzlEGs/rVldhNNlqHrbygUQ6CbrvyyAlOBnkArKGauYXZ72/JQ= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9c4eabe-c816-4d13-43cc-08d5ee0abe57 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2018 06:33:46.0141 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR2101MB1117 Subject: [PATCH edk2-platforms 02/13] Silicon/NXP: Add i.MX6 GPT and EPIT timer headers 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, 20 Jul 2018 06:33:49 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable This adds the definitions for the NXP i.MX6 General Purpose Timer and the Enhanced Periodic Interrupt Timer modules. 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/Include/common_epit.h | 158 ++++++++++ Silicon/NXP/iMX6Pkg/Include/common_gpt.h | 314 ++++++++++++++++++++ 2 files changed, 472 insertions(+) diff --git a/Silicon/NXP/iMX6Pkg/Include/common_epit.h b/Silicon/NXP/iMX6Pk= g/Include/common_epit.h new file mode 100644 index 000000000000..a0be49f59da0 --- /dev/null +++ b/Silicon/NXP/iMX6Pkg/Include/common_epit.h @@ -0,0 +1,158 @@ +/** @file +* +* Provides definitions for the EPIT (Enhanced Periodic Interrupt Timer) +* module that are common to Freescale SoCs. +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Copyright (c) 2004-2010, Freescale Semiconductor, Inc. All Rights Reser= ved. +* 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 __COMMON_EPIT_H +#define __COMMON_EPIT_H + +#if __cplusplus +extern "C" { +#endif + + +//------------------------------------------------------------------------= ------ +// GENERAL MODULE CONSTANTS +//------------------------------------------------------------------------= ------ + + +//------------------------------------------------------------------------= ------ +// REGISTER LAYOUT +//------------------------------------------------------------------------= ------ +typedef struct +{ + UINT32 CR; + UINT32 SR; + UINT32 LR; + UINT32 CMPR; + UINT32 CNT; +} CSP_EPIT_REG, *PCSP_EPIT_REG; + + +//------------------------------------------------------------------------= ------ +// REGISTER OFFSETS +//------------------------------------------------------------------------= ------ +#define EPIT_CR_OFFSET 0x0000 +#define EPIT_SR_OFFSET 0x0004 +#define EPIT_LR_OFFSET 0x0008 +#define EPIT_CMPR_OFFSET 0x000C +#define EPIT_CNR_OFFSET 0x0010 + + +//------------------------------------------------------------------------= ------ +// REGISTER BIT FIELD POSITIONS (LEFT SHIFT) +//------------------------------------------------------------------------= ------ +#define EPIT_CR_EN_LSH 0 +#define EPIT_CR_ENMOD_LSH 1 +#define EPIT_CR_OCIEN_LSH 2 +#define EPIT_CR_RLD_LSH 3 +#define EPIT_CR_PRESCALAR_LSH 4 +#define EPIT_CR_SWR_LSH 16 +#define EPIT_CR_IOVW_LSH 17 +#define EPIT_CR_DBGEN_LSH 18 +#define EPIT_CR_WAITEN_LSH 19 +#define EPIT_CR_DOZEN_LSH 20 +#define EPIT_CR_STOPEN_LSH 21 +#define EPIT_CR_OM_LSH 22 +#define EPIT_CR_CLKSRC_LSH 24 + +#define EPIT_SR_OCIF_LSH 0 + +#define EPIT_LR_LOAD_LSH 0 + +#define EPIT_CMPR_COMPARE_LSH 0 + +#define EPIT_CNT_COUNT_LSH 0 + + +//------------------------------------------------------------------------= ------ +// REGISTER BIT FIELD WIDTHS +//------------------------------------------------------------------------= ------ +#define EPIT_CR_EN_WID 1 +#define EPIT_CR_ENMOD_WID 1 +#define EPIT_CR_OCIEN_WID 2 +#define EPIT_CR_RLD_WID 1 +#define EPIT_CR_PRESCALAR_WID 12 +#define EPIT_CR_SWR_WID 1 +#define EPIT_CR_IOVW_WID 1 +#define EPIT_CR_DBGEN_WID 1 +#define EPIT_CR_WAITEN_WID 1 +#define EPIT_CR_DOZEN_WID 1 +#define EPIT_CR_STOPEN_WID 1 +#define EPIT_CR_OM_WID 2 +#define EPIT_CR_CLKSRC_WID 2 + +#define EPIT_SR_OCIF_WID 1 + +#define EPIT_LR_LOAD_WID 32 + +#define EPIT_CMPR_COMPARE_WID 32 + +#define EPIT_CNT_COUNT_WID 32 + + +//------------------------------------------------------------------------= ------ +// REGISTER BIT WRITE VALUES +//------------------------------------------------------------------------= ------ + +// CR +#define EPIT_CR_EN_DISABLE 0 +#define EPIT_CR_EN_ENABLE 1 + +#define EPIT_CR_ENMOD_RESUME 0 +#define EPIT_CR_ENMOD_LOAD 1 + +#define EPIT_CR_OCIEN_DISABLE 0 +#define EPIT_CR_OCIEN_ENABLE 1 + +#define EPIT_CR_RLD_ROLLOVER 0 +#define EPIT_CR_RLD_RELOAD 1 + +#define EPIT_CR_SWR_NORESET 0 +#define EPIT_CR_SWR_RESET 1 + +#define EPIT_CR_IOVW_NOOVR 0 +#define EPIT_CR_IOVW_OVR 1 + +#define EPIT_CR_DBGEN_INACTIVE 0 +#define EPIT_CR_DBGEN_ACTIVE 1 + +#define EPIT_CR_WAITEN_DISABLE 0 +#define EPIT_CR_WAITEN_ENABLE 1 + +#define EPIT_CR_DOZEN_DISABLE 0 +#define EPIT_CR_DOZEN_ENABLE 1 + +#define EPIT_CR_STOPEN_DISABLE 0 +#define EPIT_CR_STOPEN_ENABLE 1 + +#define EPIT_CR_OM_DICONNECT 0 +#define EPIT_CR_OM_TOGGLE 1 +#define EPIT_CR_OM_CLEAR 2 +#define EPIT_CR_OM_SET 3 + +#define EPIT_CR_CLKSRC_OFF 0 +#define EPIT_CR_CLKSRC_IPGCLK 1 +#define EPIT_CR_CLKSRC_HIGHFREQ 2 // High freq is sourcing from PERC= LK +#define EPIT_CR_CLKSRC_CKIL 3 + +// CNT +#define EPIT_CNT_COUNT_MAX 0xFFFFFFFF + +#ifdef __cplusplus +} +#endif + +#endif // __COMMON_EPIT_H diff --git a/Silicon/NXP/iMX6Pkg/Include/common_gpt.h b/Silicon/NXP/iMX6Pkg= /Include/common_gpt.h new file mode 100644 index 000000000000..3c92023a60fe --- /dev/null +++ b/Silicon/NXP/iMX6Pkg/Include/common_gpt.h @@ -0,0 +1,314 @@ +/** @file +* +* Provides definitions for the GPT (General Purpose Timer) module +* that are common to Freescale SoCs. +* +* Copyright (c) Microsoft Corporation. All rights reserved. +* Copyright (c) 2004-2010, Freescale Semiconductor, Inc. All Rights Reser= ved. +* 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 __COMMON_GPT_H +#define __COMMON_GPT_H + +#ifdef __cplusplus +extern "C" { +#endif + + +//------------------------------------------------------------------------= ------ +// GENERAL MODULE CONSTANTS +//------------------------------------------------------------------------= ------ + + +//------------------------------------------------------------------------= ------ +// REGISTER LAYOUT +//------------------------------------------------------------------------= ------ +typedef struct +{ + UINT32 CR; + UINT32 PR; + UINT32 SR; + UINT32 IR; + UINT32 OCR1; + UINT32 OCR2; + UINT32 OCR3; + UINT32 ICR1; + UINT32 ICR2; + UINT32 CNT; +} CSP_GPT_REGS, *PCSP_GPT_REGS; + + +//------------------------------------------------------------------------= ------ +// REGISTER OFFSETS +//------------------------------------------------------------------------= ------ +#define GPT_CR_OFFSET 0x0000 +#define GPT_PR_OFFSET 0x0004 +#define GPT_SR_OFFSET 0x0008 +#define GPT_IR_OFFSET 0x000C +#define GPT_OCR1_OFFSET 0x0010 +#define GPT_OCR2_OFFSET 0x0014 +#define GPT_OCR3_OFFSET 0x0018 +#define GPT_ICR1_OFFSET 0x001C +#define GPT_ICR2_OFFSET 0x0020 +#define GPT_CNT_OFFSET 0x0024 + + +//------------------------------------------------------------------------= ------ +// REGISTER BIT FIELD POSITIONS (LEFT SHIFT) +//------------------------------------------------------------------------= ------ +#define GPT_CR_EN_LSH 0 +#define GPT_CR_ENMOD_LSH 1 +#define GPT_CR_DBGEN_LSH 2 +#define GPT_CR_WAITEN_LSH 3 +#define GPT_CR_STOPEN_LSH 5 +#define GPT_CR_CLKSRC_LSH 6 +#define GPT_CR_FRR_LSH 9 +#ifdef CPU_IMX6SX +#define GPT_CR_EN_24M_LSH 10 +#elif defined(CPU_IMX6SDL) +#define GPT_CR_EN_24M_LSH 10 +#endif +#define GPT_CR_SWR_LSH 15 +#define GPT_CR_IM1_LSH 16 +#define GPT_CR_IM2_LSH 18 +#define GPT_CR_OM1_LSH 20 +#define GPT_CR_OM2_LSH 23 +#define GPT_CR_OM3_LSH 26 +#define GPT_CR_FO1_LSH 29 +#define GPT_CR_FO2_LSH 30 +#define GPT_CR_FO3_LSH 31 + +#define GPT_PR_PRESCALER_LSH 0 + +#define GPT_SR_OF1_LSH 0 +#define GPT_SR_OF2_LSH 1 +#define GPT_SR_OF3_LSH 2 +#define GPT_SR_IF1_LSH 3 +#define GPT_SR_IF2_LSH 4 +#define GPT_SR_ROV_LSH 5 + +#define GPT_IR_OF1IE_LSH 0 +#define GPT_IR_OF2IE_LSH 1 +#define GPT_IR_OF3IE_LSH 2 +#define GPT_IR_IF1IE_LSH 3 +#define GPT_IR_IF2IE_LSH 4 +#define GPT_IR_ROVIE_LSH 5 + +#define GPT_OCR1_COMP_LSH 0 + +#define GPT_OCR2_COMP_LSH 0 + +#define GPT_OCR3_COMP_LSH 0 + +#define GPT_ICR1_CAPT_LSH 0 + +#define GPT_ICR2_CAPT_LSH 0 + +#define GPT_CNT_COUNT_LSH 0 + + +//------------------------------------------------------------------------= ------ +// REGISTER BIT FIELD WIDTHS +//------------------------------------------------------------------------= ------ +#define GPT_CR_EN_WID 1 +#define GPT_CR_ENMOD_WID 1 +#define GPT_CR_DBGEN_WID 1 +#define GPT_CR_WAITEN_WID 1 +#define GPT_CR_STOPEN_WID 1 +#define GPT_CR_CLKSRC_WID 3 +#define GPT_CR_FRR_WID 1 +#ifdef CPU_IMX6SX +#define GPT_CR_EN_24M_WID 1 +#elif defined(CPU_IMX6SDL) +#define GPT_CR_EN_24M_WID 1 +#endif +#define GPT_CR_SWR_WID 1 +#define GPT_CR_IM1_WID 2 +#define GPT_CR_IM2_WID 2 +#define GPT_CR_OM1_WID 3 +#define GPT_CR_OM2_WID 3 +#define GPT_CR_OM3_WID 3 +#define GPT_CR_FO1_WID 1 +#define GPT_CR_FO2_WID 1 +#define GPT_CR_FO3_WID 1 + +#define GPT_PR_PRESCALER_WID 12 + +#define GPT_SR_OF1_WID 1 +#define GPT_SR_OF2_WID 1 +#define GPT_SR_OF3_WID 1 +#define GPT_SR_IF1_WID 1 +#define GPT_SR_IF2_WID 1 +#define GPT_SR_ROV_WID 1 + +#define GPT_IR_OF1IE_WID 1 +#define GPT_IR_OF2IE_WID 1 +#define GPT_IR_OF3IE_WID 1 +#define GPT_IR_IF1IE_WID 1 +#define GPT_IR_IF2IE_WID 1 +#define GPT_IR_ROVIE_WID 1 + +#define GPT_OCR1_COMP_WID 32 + +#define GPT_OCR2_COMP_WID 32 + +#define GPT_OCR3_COMP_WID 32 + +#define GPT_ICR1_CAPT_WID 32 + +#define GPT_ICR2_CAPT_WID 32 + +#define GPT_CNT_COUNT_WID 32 + + +//------------------------------------------------------------------------= ------ +// REGISTER BIT WRITE VALUES +//------------------------------------------------------------------------= ------ + +// GPTCR +#define GPT_CR_EN_ENABLE 1 // GPT enabled +#define GPT_CR_EN_DISABLE 0 // GPT disabled + +#define GPT_CR_ENMOD_RESET 1 // GPT counter reset to + // 0 when disabled +#define GPT_CR_ENMOD_RETAIN 0 // GPT counter retains + // value when disabled + +#define GPT_CR_DBGEN_ENABLE 1 // GPT enabled in debug mode +#define GPT_CR_DBGEN_DISABLE 0 // GPT disabled in debug mode + +#define GPT_CR_WAITEN_ENABLE 1 // GPT enabled in wait mode +#define GPT_CR_WAITEN_DISABLE 0 // GPT disabled in wait mode + +#define GPT_CR_STOPEN_ENABLE 1 // GPT enabled in stopdoze mode +#define GPT_CR_STOPEN_DISABLE 0 // GPT disabled in stopoze mode + +#if defined(CPU_IMX6DQ) +#define GPT_CR_CLKSRC_NOCLK 0 // No clock to GPT +#define GPT_CR_CLKSRC_IPGCLK 1 // ipg_clk is the clock source +#define GPT_CR_CLKSRC_HIGHFREQ 2 // ipg_clk_highfreq +#define GPT_CR_CLKSRC_EXTCLK 3 // ipp_gpt_clkin (external clock + // from pad) is the clock source +#define GPT_CR_CLKSRC_CLK32K 4 // ipg_clk_32k is clock source +#define GPT_CR_CLKSRC_CLK8M 5 // crystal oscillator divided by= 8 is clock source +#define GPT_CR_CLKSRC_CLK24M 7 // crystal oscillator (24 Mhz) i= s clock source +#elif defined(CPU_IMX6SDL) +#define GPT_CR_CLKSRC_NOCLK 0 // No clock to GPT +#define GPT_CR_CLKSRC_IPGCLK 1 // Peripheral Clock +#define GPT_CR_CLKSRC_HIGHFREQ 2 // High Frequency Reference Cloc= k +#define GPT_CR_CLKSRC_EXTCLK 3 // External Clock (CLKIN) +#define GPT_CR_CLKSRC_LOWFREQ 4 // Low Frequency Reference Clock +#define GPT_CR_CLKSRC_CLK24M 5 // Crystal oscillator as Referen= ce Clock +#elif defined(CPU_IMX6SX) +#define GPT_CR_CLKSRC_NOCLK 0 // No clock to GPT +#define GPT_CR_CLKSRC_PERIPHCLK 1 // Peripheral Clock +#define GPT_CR_CLKSRC_HIGHFREQ 2 // High Frequency Reference Cloc= k +#define GPT_CR_CLKSRC_EXTCLK 3 // External Clock (CLKIN) +#define GPT_CR_CLKSRC_LOWFREQ 4 // Low Frequency Reference Clock +#define GPT_CR_CLKSRC_CLK24M 5 // Crystal oscillator as Referen= ce Clock +#else +#error CPU Preprocessor Flag Not Defined +#endif + +#define GPT_CR_FRR_FREERUN 1 // Freerun mode (counter + // continues after compare) +#define GPT_CR_FRR_RESTART 0 // Restart mode (counter set + // to zero after compare) +#if defined(CPU_IMX6SX) || defined(CPU_IMX6SDL) +#define GPT_CR_EN_24M_DISABLE 0 // 24M clock disabled +#define GPT_CR_EN_24M_ENABLE 1 // 24M clock enabled +#endif + +#define GPT_CR_SWR_RESET 1 // Self-clearing software reset +#define GPT_CR_SWR_NORESET 0 // Do not activate software rese= t + +#define GPT_CR_IM1_DISABLE 0 // Capture Disabled +#define GPT_CR_IM1_EDGE_RISE 1 // Capture on rising edge +#define GPT_CR_IM1_EDGE_FALL 2 // Capture on falling edge +#define GPT_CR_IM1_EDGE_BOTH 3 // Capture on both edges + +#define GPT_CR_IM2_DISABLE 0 // Capture Disabled +#define GPT_CR_IM2_EDGE_RISE 1 // Capture on rising edge +#define GPT_CR_IM2_EDGE_FALL 2 // Capture on falling edge +#define GPT_CR_IM2_EDGE_BOTH 3 // Capture on both edges + +#define GPT_CR_OM1_DISABLE 0 // Compare generates no response +#define GPT_CR_OM1_TOGGLE 1 // Compare toggles output pin +#define GPT_CR_OM1_CLEAR 2 // Compare clears output pin +#define GPT_CR_OM1_SET 3 // Compare sets output pin +#define GPT_CR_OM1_PULSE 4 // Compare event generates a + // single count duration pulse + // on output pin + +#define GPT_CR_OM2_DISABLE 0 // Compare generates no response +#define GPT_CR_OM2_TOGGLE 1 // Compare toggles output pin +#define GPT_CR_OM2_CLEAR 2 // Compare clears output pin +#define GPT_CR_OM2_SET 3 // Compare sets output pin +#define GPT_CR_OM2_PULSE 4 // Compare event generates a + // single count duration pulse + // on output pin + +#define GPT_CR_OM3_DISABLE 0 // Compare generates no response +#define GPT_CR_OM3_TOGGLE 1 // Compare toggles output pin +#define GPT_CR_OM3_CLEAR 2 // Compare clears output pin +#define GPT_CR_OM3_SET 3 // Compare sets output pin +#define GPT_CR_OM3_PULSE 4 // Compare event generates a + // single count duration pulse + // on output pin + +#define GPT_CR_FO1_FORCE 1 // Force pin action programmed + // for output compare 1 pin. + // Pin is self-negating. +#define GPT_CR_FO1_NOFORCE 0 // Do not force pin + +#define GPT_CR_FO2_FORCE 1 // Force pin action programmed + // for output compare 1 pin + // Pin is self-negating. +#define GPT_CR_FO2_NOFORCE 0 // Do not force pin + +#define GPT_CR_FO3_FORCE 1 // Force pin action programmed + // for output compare 1 pin + // Pin is self-negating. +#define GPT_CR_FO3_NOFORCE 0 // Do not force pin + +// GPTSR +#define GPT_SR_OF1_STATUS_CLEAR 1 // Output compare 1 status clear +#define GPT_SR_OF2_STATUS_CLEAR 1 // Output compare 2 status clear +#define GPT_SR_OF3_STATUS_CLEAR 1 // Output compare 3 status clear +#define GPT_SR_IF1_STATUS_CLEAR 1 // Input capture 1 status clear +#define GPT_SR_IF2_STATUS_CLEAR 1 // Input capture 2 status clear +#define GPT_SR_ROV_STATUS_CLEAR 1 // Rollover status clear + +// GPTIR +#define GPT_IR_OF1IE_INT_ENABLE 1 // Output compare 1 int enabled +#define GPT_IR_OF1IE_INT_DISABLE 0 // Output compare 1 int disabled + +#define GPT_IR_OF2IE_INT_ENABLE 1 // Output compare 2 int enabled +#define GPT_IR_OF2IE_INT_DISABLE 0 // Output compare 2 int disabled + +#define GPT_IR_OF3IE_INT_ENABLE 1 // Output compare 3 int enabled +#define GPT_IR_OF3IE_INT_DISABLE 0 // Output compare 3 int disabled + +#define GPT_IR_IF1IE_INT_ENABLE 1 // Input capture 1 int enabled +#define GPT_IR_IF1IE_INT_DISABLE 0 // Input capture 1 int disabled + +#define GPT_IR_IF2IE_INT_ENABLE 1 // Input capture 2 int enabled +#define GPT_IR_IF2IE_INT_DISABLE 0 // Input capture 2 int disabled + +#define GPT_IR_ROVIE_INT_ENABLE 1 // Rollover int enabled +#define GPT_IR_ROVIE_INT_DISABLE 0 // Rollover int disabled + + +#ifdef __cplusplus +} +#endif + +#endif // __COMMON_GPT_H --=20 2.16.2.gvfs.1.33.gf5370f1