blob: 19733d489480bf7349d1eddf3c72996170c74b4e [file] [log] [blame]
/*
*
* Copyright 2021 ASR Microelectronics (Shanghai) Co., Ltd.
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file "COPYING" in the main directory of this
* archive for more details.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __DTS_ASR1901_PINFUNC_H
#define __DTS_ASR1901_PINFUNC_H
/* drive-strength: value, mask */
/* keep below 3 definitions unchanged */
#define DS_SLOW0 pinctrl-single,drive-strength = <0x0000 0x1E00>
#define DS_SLOW1 pinctrl-single,drive-strength = <0x0800 0x1E00>
#define DS_FAST pinctrl-single,drive-strength = <0x1800 0x1E00>
#define DS_MEDIUM pinctrl-single,drive-strength = <0x1400 0x1E00>
#define DS_SL0 pinctrl-single,drive-strength = <0x0000 0x1E00>
#define DS_SL1 pinctrl-single,drive-strength = <0x0200 0x1E00>
#define DS_SL2 pinctrl-single,drive-strength = <0x0400 0x1E00>
#define DS_SL3 pinctrl-single,drive-strength = <0x0600 0x1E00>
#define DS_SL4 pinctrl-single,drive-strength = <0x0800 0x1E00>
#define DS_SL5 pinctrl-single,drive-strength = <0x0A00 0x1E00>
#define DS_SL6 pinctrl-single,drive-strength = <0x0C00 0x1E00>
#define DS_SL7 pinctrl-single,drive-strength = <0x0E00 0x1E00>
#define DS_SL8 pinctrl-single,drive-strength = <0x1000 0x1E00>
#define DS_SL9 pinctrl-single,drive-strength = <0x1200 0x1E00>
#define DS_SLA pinctrl-single,drive-strength = <0x1400 0x1E00>
#define DS_SLB pinctrl-single,drive-strength = <0x1600 0x1E00>
#define DS_SLC pinctrl-single,drive-strength = <0x1800 0x1E00>
#define DS_SLD pinctrl-single,drive-strength = <0x1A00 0x1E00>
#define DS_SLE pinctrl-single,drive-strength = <0x1C00 0x1E00>
#define DS_SLF pinctrl-single,drive-strength = <0x1E00 0x1E00>
/* input-schmitt: value, mask ; input-schmitt-enable: value, enable, disable, mask */
#define EDGE_NONE pinctrl-single,input-schmitt = <0 0x130>; \
pinctrl-single,input-schmitt-enable = <0x40 0 0x40 0x40>
#define EDGE_RISE pinctrl-single,input-schmitt = <0x10 0x130>; \
pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
#define EDGE_FALL pinctrl-single,input-schmitt = <0x20 0x130>; \
pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
#define EDGE_BOTH pinctrl-single,input-schmitt = <0x30 0x130>; \
pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
#define EDGE_RISE_HYST1 pinctrl-single,input-schmitt = <0x110 0x130>; \
pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
#define EDGE_FALL_HYST1 pinctrl-single,input-schmitt = <0x120 0x130>; \
pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
#define EDGE_BOTH_HYST1 pinctrl-single,input-schmitt = <0x130 0x130>; \
pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
/* bias-pullup/down: value, enable, disable, mask */
#define PULL_NONE pinctrl-single,bias-pullup = <0x0000 0xc000 0 0xc000>; \
pinctrl-single,bias-pulldown = <0x0000 0xa000 0 0xa000>
#define PULL_UP pinctrl-single,bias-pullup = <0xc000 0xc000 0 0xc000>; \
pinctrl-single,bias-pulldown = <0x8000 0xa000 0x8000 0xa000>
#define PULL_DOWN pinctrl-single,bias-pullup = <0x8000 0xc000 0x8000 0xc000>; \
pinctrl-single,bias-pulldown = <0xa000 0xa000 0 0xa000>
#define PULL_BOTH pinctrl-single,bias-pullup = <0xc000 0xc000 0x8000 0xc000>; \
pinctrl-single,bias-pulldown = <0xa000 0xa000 0x8000 0xa000>
#define PULL_FLOAT pinctrl-single,bias-pullup = <0x8000 0x8000 0 0xc000>; \
pinctrl-single,bias-pulldown = <0x8000 0x8000 0 0xa000>
/*
* keep the definition to make compilation pass,
* set LPM definition as default value as these feature is not supported
*/
#define LPM_NONE pinctrl-single,lpm-output = <0x0 0x8>
#define LPM_DRIVE_LOW pinctrl-single,lpm-output = <0x0 0x8>
#define LPM_DRIVE_HIGH pinctrl-single,lpm-output = <0x0 0x8>
#define LPM_FLOAT pinctrl-single,lpm-output = <0x0 0x8>
#define MFP_DEFAULT DS_MEDIUM;PULL_NONE;EDGE_NONE;LPM_NONE
#define MFP_PULL_UP DS_MEDIUM;PULL_UP;EDGE_NONE;LPM_NONE
#define MFP_PULL_DOWN DS_MEDIUM;PULL_DOWN;EDGE_NONE;LPM_NONE
#define MFP_PULL_FLOAT DS_MEDIUM;PULL_FLOAT;EDGE_NONE;LPM_NONE
/* LPM output */
#define MFP_LPM_DRIVE_HIGH DS_MEDIUM;PULL_NONE;EDGE_NONE;LPM_DRIVE_HIGH
#define MFP_LPM_DRIVE_LOW DS_MEDIUM;PULL_NONE;EDGE_NONE;LPM_DRIVE_LOW
/* LPM input */
#define MFP_LPM_FLOAT DS_MEDIUM;PULL_NONE;EDGE_NONE;LPM_FLOAT
#define MFP_LPM_PULL_UP DS_MEDIUM;PULL_UP;EDGE_NONE;LPM_FLOAT
#define MFP_LPM_PULL_DW DS_MEDIUM;PULL_DOWN;EDGE_NONE;LPM_FLOAT
/*
* MFP alternative functions 0-7
*/
#define AF0 0x0
#define AF1 0x1
#define AF2 0x2
#define AF3 0x3
#define AF4 0x4
#define AF5 0x5
#define AF6 0x6
#define AF7 0x7
/*
* Pin names and MFPR addresses
*/
#define MMC1_DAT3 0x01B8
#define MMC1_DAT2 0x01BC
#define MMC1_DAT1 0x01C0
#define MMC1_DAT0 0x01C4
#define MMC1_CMD 0x01C8
#define MMC1_CLK 0x01CC
#define PWR_SCL 0x01D8
#define PWR_SDA 0x01DC
#define VCXO_EN 0x01E0
#define USB_ID 0x01E4
#define PMIC_INT_N 0x01E8
#define VBUS_DRV 0x01FC
#define VCXO_REQ1 0x0200
#define VCXO_REQ 0x0204
#define VCXO_OUT 0x0208
#define GPIO00 0x004
#define GPIO01 0x008
#define GPIO02 0x00C
#define GPIO03 0x010
#define GPIO04 0x014
#define GPIO05 0x018
#define GPIO06 0x01C
#define GPIO07 0x020
#define GPIO08 0x024
#define GPIO09 0x028
#define GPIO10 0x02C
#define GPIO11 0x030
#define GPIO12 0x034
#define GPIO13 0x038
#define GPIO14 0x03C
#define GPIO15 0x040
#define GPIO16 0x044
#define GPIO17 0x048
#define GPIO18 0x04C
#define GPIO19 0x050
#define GPIO20 0x054
#define GPIO21 0x058
#define GPIO22 0x05C
#define GPIO23 0x060
#define GPIO24 0x064
#define GPIO25 0x068
#define CP_GPO_2 0x140
#define CP_GPO_4 0x148
#define CP_GPO_5 0x14C
#define CP_GPO_7 0x154
#define CP_GPO_10 0x160
#define CP_GPO_11 0x164
#define CP_GPO_14 0x170
#define CP_GPO_15 0x174
#define CP_GPO_19 0x184
#define GPIO26 0x20C
#define GPIO27 0x210
#define GPIO28 0x214
#define GPIO29 0x218
#define GPIO30 0x21C
#define GPIO31 0x220
#define GPIO32 0x224
#define GPIO33 0x228
#define GPIO34 0x22C
#define GPIO35 0x230
#define GPIO36 0x234
#define GPIO37 0x238
#define GPIO38 0x23C
#define GPIO39 0x240
#define GPIO40 0x244
#define GPIO41 0x248
#define GPIO42 0x24C
#define GPIO43 0x250
#define GPIO44 0x254
#define GPIO45 0x258
#define GPIO46 0x25C
#define GPIO47 0x260
#define GPIO48 0x264
#define GPIO49 0x268
#define GPIO50 0x26C
#define GPIO51 0x270
#define GPIO52 0x274
#define GPIO53 0x278
#define GPIO54 0x27C
#define GPIO55 0x280
#define GPIO56 0x284
#define GPIO57 0x288
#define GPIO58 0x28C
#define GPIO59 0x290
#define GPIO60 0x294
#define GPIO61 0x298
#define GPIO62 0x29C
#define GPIO63 0x2A0
#define GPIO64 0x2A4
#define GPIO65 0x2A8
#define GPIO66 0x2AC
#define GPIO67 0x2B0
#define GPIO68 0x2B4
#define GPIO69 0x2B8
#define GPIO70 0x2BC
#define GPIO71 0x2C0
#define GPIO72 0x2C4
#define GPIO73 0x2C8
#define GPIO74 0x2CC
#define GPIO75 0x2D0
#define GPIO76 0x2D4
#define GPIO77 0x2D8
#define GPIO78 0x2DC
#define GPIO79 0x2E0
#define GPIO80 0x2E4
#define GPIO81 0x2E8
#define GPIO82 0x2EC
#define GPIO83 0x2F0
#define GPIO84 0x2F4
#define GPIO85 0x2F8
#define GPIO86 0x2FC
#define GPIO87 0x300
#define GPIO88 0x304
#define GPIO89 0x308
#define GPIO90 0x30C
#define GPIO91 0x310
#endif /* __DTS_ASR1901_PINFUNC_H */