18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * File: m54xxgpt.h 48c2ecf20Sopenharmony_ci * Purpose: Register and bit definitions for the MCF54XX 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * Notes: 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci */ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#ifndef m54xxgpt_h 118c2ecf20Sopenharmony_ci#define m54xxgpt_h 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci/********************************************************************* 148c2ecf20Sopenharmony_ci* 158c2ecf20Sopenharmony_ci* General Purpose Timers (GPT) 168c2ecf20Sopenharmony_ci* 178c2ecf20Sopenharmony_ci*********************************************************************/ 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci/* Register read/write macros */ 208c2ecf20Sopenharmony_ci#define MCF_GPT_GMS0 (MCF_MBAR + 0x000800) 218c2ecf20Sopenharmony_ci#define MCF_GPT_GCIR0 (MCF_MBAR + 0x000804) 228c2ecf20Sopenharmony_ci#define MCF_GPT_GPWM0 (MCF_MBAR + 0x000808) 238c2ecf20Sopenharmony_ci#define MCF_GPT_GSR0 (MCF_MBAR + 0x00080C) 248c2ecf20Sopenharmony_ci#define MCF_GPT_GMS1 (MCF_MBAR + 0x000810) 258c2ecf20Sopenharmony_ci#define MCF_GPT_GCIR1 (MCF_MBAR + 0x000814) 268c2ecf20Sopenharmony_ci#define MCF_GPT_GPWM1 (MCF_MBAR + 0x000818) 278c2ecf20Sopenharmony_ci#define MCF_GPT_GSR1 (MCF_MBAR + 0x00081C) 288c2ecf20Sopenharmony_ci#define MCF_GPT_GMS2 (MCF_MBAR + 0x000820) 298c2ecf20Sopenharmony_ci#define MCF_GPT_GCIR2 (MCF_MBAR + 0x000824) 308c2ecf20Sopenharmony_ci#define MCF_GPT_GPWM2 (MCF_MBAR + 0x000828) 318c2ecf20Sopenharmony_ci#define MCF_GPT_GSR2 (MCF_MBAR + 0x00082C) 328c2ecf20Sopenharmony_ci#define MCF_GPT_GMS3 (MCF_MBAR + 0x000830) 338c2ecf20Sopenharmony_ci#define MCF_GPT_GCIR3 (MCF_MBAR + 0x000834) 348c2ecf20Sopenharmony_ci#define MCF_GPT_GPWM3 (MCF_MBAR + 0x000838) 358c2ecf20Sopenharmony_ci#define MCF_GPT_GSR3 (MCF_MBAR + 0x00083C) 368c2ecf20Sopenharmony_ci#define MCF_GPT_GMS(x) (MCF_MBAR + 0x000800 + ((x) * 0x010)) 378c2ecf20Sopenharmony_ci#define MCF_GPT_GCIR(x) (MCF_MBAR + 0x000804 + ((x) * 0x010)) 388c2ecf20Sopenharmony_ci#define MCF_GPT_GPWM(x) (MCF_MBAR + 0x000808 + ((x) * 0x010)) 398c2ecf20Sopenharmony_ci#define MCF_GPT_GSR(x) (MCF_MBAR + 0x00080C + ((x) * 0x010)) 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci/* Bit definitions and macros for MCF_GPT_GMS */ 428c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_TMS(x) (((x)&0x00000007)<<0) 438c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_GPIO(x) (((x)&0x00000003)<<4) 448c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_IEN (0x00000100) 458c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_OD (0x00000200) 468c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_SC (0x00000400) 478c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_CE (0x00001000) 488c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_WDEN (0x00008000) 498c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_ICT(x) (((x)&0x00000003)<<16) 508c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_OCT(x) (((x)&0x00000003)<<20) 518c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_OCPW(x) (((x)&0x000000FF)<<24) 528c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_OCT_FRCLOW (0x00000000) 538c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_OCT_PULSEHI (0x00100000) 548c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_OCT_PULSELO (0x00200000) 558c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_OCT_TOGGLE (0x00300000) 568c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_ICT_ANY (0x00000000) 578c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_ICT_RISE (0x00010000) 588c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_ICT_FALL (0x00020000) 598c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_ICT_PULSE (0x00030000) 608c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_GPIO_INPUT (0x00000000) 618c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_GPIO_OUTLO (0x00000020) 628c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_GPIO_OUTHI (0x00000030) 638c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_GPIO_MASK (0x00000030) 648c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_TMS_DISABLE (0x00000000) 658c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_TMS_INCAPT (0x00000001) 668c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_TMS_OUTCAPT (0x00000002) 678c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_TMS_PWM (0x00000003) 688c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_TMS_GPIO (0x00000004) 698c2ecf20Sopenharmony_ci#define MCF_GPT_GMS_TMS_MASK (0x00000007) 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_ci/* Bit definitions and macros for MCF_GPT_GCIR */ 728c2ecf20Sopenharmony_ci#define MCF_GPT_GCIR_CNT(x) (((x)&0x0000FFFF)<<0) 738c2ecf20Sopenharmony_ci#define MCF_GPT_GCIR_PRE(x) (((x)&0x0000FFFF)<<16) 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ci/* Bit definitions and macros for MCF_GPT_GPWM */ 768c2ecf20Sopenharmony_ci#define MCF_GPT_GPWM_LOAD (0x00000001) 778c2ecf20Sopenharmony_ci#define MCF_GPT_GPWM_PWMOP (0x00000100) 788c2ecf20Sopenharmony_ci#define MCF_GPT_GPWM_WIDTH(x) (((x)&0x0000FFFF)<<16) 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci/* Bit definitions and macros for MCF_GPT_GSR */ 818c2ecf20Sopenharmony_ci#define MCF_GPT_GSR_CAPT (0x00000001) 828c2ecf20Sopenharmony_ci#define MCF_GPT_GSR_COMP (0x00000002) 838c2ecf20Sopenharmony_ci#define MCF_GPT_GSR_PWMP (0x00000004) 848c2ecf20Sopenharmony_ci#define MCF_GPT_GSR_TEXP (0x00000008) 858c2ecf20Sopenharmony_ci#define MCF_GPT_GSR_PIN (0x00000100) 868c2ecf20Sopenharmony_ci#define MCF_GPT_GSR_OVF(x) (((x)&0x00000007)<<12) 878c2ecf20Sopenharmony_ci#define MCF_GPT_GSR_CAPTURE(x) (((x)&0x0000FFFF)<<16) 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_ci/********************************************************************/ 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_ci#endif /* m54xxgpt_h */ 92