/*-1* Copyright (c) 2012 Damjan Marion <[email protected]>2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer.9* 2. Redistributions in binary form must reproduce the above copyright10* notice, this list of conditions and the following disclaimer in the11* documentation and/or other materials provided with the distribution.12*13* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND14* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE15* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE16* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE17* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL18* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS19* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)20* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT21* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY22* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF23* SUCH DAMAGE.24*/2526#ifndef AM335X_DMTREG_H27#define AM335X_DMTREG_H2829#define AM335X_NUM_TIMERS 83031#define DMT_TIDR 0x00 /* Identification Register */32#define DMT_TIOCP_CFG 0x10 /* OCP Configuration Reg */33#define DMT_TIOCP_RESET (1 << 0) /* TIOCP perform soft reset */34#define DMT_IQR_EOI 0x20 /* IRQ End-Of-Interrupt Reg */35#define DMT_IRQSTATUS_RAW 0x24 /* IRQSTATUS Raw Reg */36#define DMT_IRQSTATUS 0x28 /* IRQSTATUS Reg */37#define DMT_IRQENABLE_SET 0x2c /* IRQSTATUS Set Reg */38#define DMT_IRQENABLE_CLR 0x30 /* IRQSTATUS Clear Reg */39#define DMT_IRQWAKEEN 0x34 /* IRQ Wakeup Enable Reg */40#define DMT_IRQ_MAT (1 << 0) /* IRQ: Match */41#define DMT_IRQ_OVF (1 << 1) /* IRQ: Overflow */42#define DMT_IRQ_TCAR (1 << 2) /* IRQ: Capture */43#define DMT_IRQ_MASK (DMT_IRQ_TCAR | DMT_IRQ_OVF | DMT_IRQ_MAT)44#define DMT_TCLR 0x38 /* Control Register */45#define DMT_TCLR_START (1 << 0) /* Start timer */46#define DMT_TCLR_AUTOLOAD (1 << 1) /* Auto-reload on overflow */47#define DMT_TCLR_PRES_MASK (7 << 2) /* Prescaler mask */48#define DMT_TCLR_PRES_ENABLE (1 << 5) /* Prescaler enable */49#define DMT_TCLR_COMP_ENABLE (1 << 6) /* Compare enable */50#define DMT_TCLR_PWM_HIGH (1 << 7) /* PWM default output high */51#define DMT_TCLR_CAPTRAN_MASK (3 << 8) /* Capture transition mask */52#define DMT_TCLR_CAPTRAN_NONE (0 << 8) /* Capture: none */53#define DMT_TCLR_CAPTRAN_LOHI (1 << 8) /* Capture lo->hi transition */54#define DMT_TCLR_CAPTRAN_HILO (2 << 8) /* Capture hi->lo transition */55#define DMT_TCLR_CAPTRAN_BOTH (3 << 8) /* Capture both transitions */56#define DMT_TCLR_TRGMODE_MASK (3 << 10) /* Trigger output mode mask */57#define DMT_TCLR_TRGMODE_NONE (0 << 10) /* Trigger off */58#define DMT_TCLR_TRGMODE_OVFL (1 << 10) /* Trigger on overflow */59#define DMT_TCLR_TRGMODE_BOTH (2 << 10) /* Trigger on match + ovflow */60#define DMT_TCLR_PWM_PTOGGLE (1 << 12) /* PWM toggles */61#define DMT_TCLR_CAP_MODE_2ND (1 << 13) /* Capture second event mode */62#define DMT_TCLR_GPO_CFG (1 << 14) /* Tmr pin conf, 0=out, 1=in */63#define DMT_TCRR 0x3C /* Counter Register */64#define DMT_TLDR 0x40 /* Load Reg */65#define DMT_TTGR 0x44 /* Trigger Reg */66#define DMT_TWPS 0x48 /* Write Posted Status Reg */67#define DMT_TMAR 0x4C /* Match Reg */68#define DMT_TCAR1 0x50 /* Capture Reg */69#define DMT_TSICR 0x54 /* Synchr. Interface Ctrl Reg */70#define DMT_TSICR_RESET (1 << 1) /* TSICR perform soft reset */71#define DMT_TCAR2 0x48 /* Capture Reg */7273/* Location of revision register from TRM Memory map chapter 2 */74/* L4_WKUP */75#define DMTIMER0_REV 0x0500076#define DMTIMER1_1MS_REV 0x3100077/* L4_PER */78#define DMTIMER2_REV 0x4000079#define DMTIMER3_REV 0x4200080#define DMTIMER4_REV 0x4400081#define DMTIMER5_REV 0x4600082#define DMTIMER6_REV 0x4800083#define DMTIMER7_REV 0x4A0008485#endif /* AM335X_DMTREG_H */868788