1 /*` 2 * drivers/pwm/pwm-sunxi.h 3 * 4 * Allwinnertech pulse-width-modulation controller driver 5 * 6 * Copyright (C) 2018 AllWinner 7 * 8 * 9 * This file is licensed under the terms of the GNU General Public 10 * License version 2. This program is licensed "as is" without any 11 * warranty of any kind, whether express or implied. 12 */ 13 #ifndef PWM_SUNXI_H 14 #define PWM_SUNXI_H 15 16 #define PWM_PIER (0x0000) 17 #define PWM_PISR (0x0004) 18 #define PWM_CIER (0x0010) 19 #define PWM_CISR (0x0014) 20 #define PWM_PCCR01 (0x0020) 21 #define PWM_PCCR23 (0x0024) 22 #define PWM_PCCR45 (0x0028) 23 #define PWM_PCCR67 (0x002c) 24 #define PWM_PCCR89 (0x0030) 25 #define PWM_PCCRAB (0x0034) 26 #define PWM_PCCRCD (0x0038) 27 #define PWM_PCCREF (0x003c) 28 29 #define PCGR (0x0040) 30 31 #define PWM_PDZCR67 (0x006c) 32 #define PWM_PDZCR89 (0x0070) 33 #define PWM_PDZCRAB (0x0074) 34 #define PWM_PDZCRCD (0x0078) 35 #define PWM_PDZCREF (0x007c) 36 37 #define PGR0 (0x0090) 38 #define PGR1 (0x0094) 39 40 #define PPCNTP_BASE (0x0100 + 0x000c) 41 /*#define PWM_PCCR8 (0x0300)*/ 42 43 #define PWMG_CS_SHIFT 0 44 #define PWMG_CS_WIDTH 16 45 #define PWMG_EN_SHIFT 16 46 #define PWMG_START_SHIFT 17 47 #define PWM_COUNTER_START_SHIFT 16 48 #define PWM_COUNTER_START_WIDTH 16 49 #define PWM_PUL_START_SHIFT 10 50 #define PWM_PUL_START_WIDTH 1 51 #define PWM_PUL_NUM_SHIFT 16 52 #define PWM_PUL_NUM_WIDTH 16 53 #define PWM_MODE_ACTS_SHIFT 8 54 #define PWM_MODE_ACTS_WIDTH 2 55 #define PWM_ACT_STA_SHIFT 0x8 56 #define PWM_ACT_STA_WIDTH 0x1 57 #define PWM_CLK_SRC_SHIFT 0x7 58 #define PWM_CLK_SRC_WIDTH 0x2 59 #define PWM_DIV_M_SHIFT 0x0 60 #define PWM_DIV_M_WIDTH 0x4 61 #define PWM_PRESCAL_SHIFT 0x0 62 #define PWM_PRESCAL_WIDTH 0x8 63 #define PWM_ACT_CYCLES_SHIFT 0x0 64 #define PWM_ACT_CYCLES_WIDTH 0x10 65 #define PWM_PERIOD_CYCLES_SHIFT 0x10 66 #define PWM_PERIOD_CYCLES_WIDTH 0x10 67 #define PWM_DZ_EN_SHIFT 0x0 68 #define PWM_DZ_EN_WIDTH 0x1 69 #define PWM_PDZINTV_SHIFT 0x8 70 #define PWM_PDZINTV_WIDTH 0x8 71 #define PWM_BYPASS_SHIFT 0x5 72 #define PWM_BYPASS_WIDTH 0x1 73 #define PWM_CLK_GATING_SHIFT 0x4 74 #define PWM_CLK_GATING_WIDTH 0x1 75 #define PWM_REG_UNIFORM_OFFSET 0x20 /* multiple registers use uniform offset */ 76 77 #endif 78