Path: blob/main/sys/arm/freescale/imx/imx_gptreg.h
39536 views
/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2012, 2013 The FreeBSD Foundation4*5* This software was developed by Oleksandr Rybalko under sponsorship6* from the FreeBSD Foundation.7*8* Redistribution and use in source and binary forms, with or without9* modification, are permitted provided that the following conditions10* are met:11* 1. Redistributions of source code must retain the above copyright12* notice, this list of conditions and the following disclaimer.13* 2. Redistributions in binary form must reproduce the above copyright14* notice, this list of conditions and the following disclaimer in the15* documentation and/or other materials provided with the distribution.16*17* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND18* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE19* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE20* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE21* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL22* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS23* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)24* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT25* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY26* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF27* SUCH DAMAGE.28*/2930/* Registers definition for Freescale i.MX515 Generic Periodic Timer */3132#define IMX_GPT_CR 0x0000 /* Control Register R/W */33#define GPT_CR_FO3 (1U << 31)34#define GPT_CR_FO2 (1 << 30)35#define GPT_CR_FO1 (1 << 29)36#define GPT_CR_OM3_SHIFT 2637#define GPT_CR_OM3_MASK 0x1c00000038#define GPT_CR_OM2_SHIFT 2339#define GPT_CR_OM2_MASK 0x0380000040#define GPT_CR_OM1_SHIFT 2041#define GPT_CR_OM1_MASK 0x0070000042#define GPT_CR_OMX_NONE 043#define GPT_CR_OMX_TOGGLE 144#define GPT_CR_OMX_CLEAR 245#define GPT_CR_OMX_SET 346#define GPT_CR_OMX_PULSE 4 /* Run CLKSRC on output pin */47#define GPT_CR_IM2_SHIFT 1848#define GPT_CR_IM2_MASK 0x000c000049#define GPT_CR_IM1_SHIFT 1650#define GPT_CR_IM1_MASK 0x0003000051#define GPT_CR_IMX_NONE 052#define GPT_CR_IMX_REDGE 153#define GPT_CR_IMX_FEDGE 254#define GPT_CR_IMX_BOTH 355#define GPT_CR_SWR (1 << 15)56#define GPT_CR_24MEN (1 << 10)57#define GPT_CR_FRR (1 << 9)58#define GPT_CR_CLKSRC_NONE (0 << 6)59#define GPT_CR_CLKSRC_IPG (1 << 6)60#define GPT_CR_CLKSRC_IPG_HIGH (2 << 6)61#define GPT_CR_CLKSRC_EXT (3 << 6)62#define GPT_CR_CLKSRC_32K (4 << 6)63#define GPT_CR_CLKSRC_24M (5 << 6)64#define GPT_CR_STOPEN (1 << 5)65#define GPT_CR_DOZEEN (1 << 4)66#define GPT_CR_WAITEN (1 << 3)67#define GPT_CR_DBGEN (1 << 2)68#define GPT_CR_ENMOD (1 << 1)69#define GPT_CR_EN (1 << 0)7071#define IMX_GPT_PR 0x0004 /* Prescaler Register R/W */72#define GPT_PR_VALUE_SHIFT 073#define GPT_PR_VALUE_MASK 0x00000fff74#define GPT_PR_VALUE_SHIFT_24M 1275#define GPT_PR_VALUE_MASK_24M 0x0000f0007677/* Same map for SR and IR */78#define IMX_GPT_SR 0x0008 /* Status Register R/W */79#define IMX_GPT_IR 0x000c /* Interrupt Register R/W */80#define GPT_IR_ROV (1 << 5)81#define GPT_IR_IF2 (1 << 4)82#define GPT_IR_IF1 (1 << 3)83#define GPT_IR_OF3 (1 << 2)84#define GPT_IR_OF2 (1 << 1)85#define GPT_IR_OF1 (1 << 0)86#define GPT_IR_ALL \87(GPT_IR_ROV | \88GPT_IR_IF2 | \89GPT_IR_IF1 | \90GPT_IR_OF3 | \91GPT_IR_OF2 | \92GPT_IR_OF1)9394#define IMX_GPT_OCR1 0x0010 /* Output Compare Register 1 R/W */95#define IMX_GPT_OCR2 0x0014 /* Output Compare Register 2 R/W */96#define IMX_GPT_OCR3 0x0018 /* Output Compare Register 3 R/W */97#define IMX_GPT_ICR1 0x001c /* Input capture Register 1 RO */98#define IMX_GPT_ICR2 0x0020 /* Input capture Register 2 RO */99#define IMX_GPT_CNT 0x0024 /* Counter Register RO */100101102