ASR_BASE

Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/marvell/linux/arch/arm/boot/dts/asr18xx-pinfunc.h b/marvell/linux/arch/arm/boot/dts/asr18xx-pinfunc.h
new file mode 100644
index 0000000..9d32811
--- /dev/null
+++ b/marvell/linux/arch/arm/boot/dts/asr18xx-pinfunc.h
@@ -0,0 +1,287 @@
+/*
+ *  Copyright 2021 ASR Microelectronics (Shanghai) Co., Ltd.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#ifndef __DTS_ASR18XX_PINFUNC_H
+#define __DTS_ASR18XX_PINFUNC_H
+
+/* drive-strength: value, mask */
+#define DS_SLOW0		pinctrl-single,drive-strength = <0x0000 0x1C08>
+#define DS_SLOW1		pinctrl-single,drive-strength = <0x0800 0x1C08>
+#define DS_MEDIUM		pinctrl-single,drive-strength = <0x1000 0x1C08>
+#define DS_FAST			pinctrl-single,drive-strength = <0x1800 0x1C08>
+#define DS_FAST0		pinctrl-single,drive-strength = <0x0400 0x1C08>
+#define DS_FAST1		pinctrl-single,drive-strength = <0x0C00 0x1C08>
+#define DS_FAST2		pinctrl-single,drive-strength = <0x1400 0x1C08>
+#define DS_FAST3		pinctrl-single,drive-strength = <0x1C00 0x1C08>
+#define DS_STRONG0		pinctrl-single,drive-strength = <0x1008 0x1C08>
+
+/* slow-rate: value, mask */
+#define SL_NORMAL		pinctrl-single,slew-rate = <0x0000 0x0080>
+#define SL_LOW			pinctrl-single,slew-rate = <0x0080 0x0080>
+
+/* input-schmitt: value, mask ; input-schmitt-enable: value, enable, disable, mask */
+#define EDGE_NONE		pinctrl-single,input-schmitt = <0 0x330>;	\
+				pinctrl-single,input-schmitt-enable = <0x40 0 0x40 0x40>
+#define EDGE_RISE		pinctrl-single,input-schmitt = <0x10 0x330>;	\
+				pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
+#define EDGE_FALL		pinctrl-single,input-schmitt = <0x20 0x330>;	\
+				pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
+#define EDGE_BOTH		pinctrl-single,input-schmitt = <0x30 0x330>;	\
+				pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
+
+#define EDGE_RISE_HYST1		pinctrl-single,input-schmitt = <0x110 0x330>;	\
+				pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
+#define EDGE_FALL_HYST1		pinctrl-single,input-schmitt = <0x120 0x330>;	\
+				pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
+#define EDGE_BOTH_HYST1		pinctrl-single,input-schmitt = <0x130 0x330>;	\
+				pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
+
+#define EDGE_RISE_HYST2		pinctrl-single,input-schmitt = <0x210 0x330>;	\
+				pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
+#define EDGE_FALL_HYST2		pinctrl-single,input-schmitt = <0x220 0x330>;	\
+				pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
+#define EDGE_BOTH_HYST2		pinctrl-single,input-schmitt = <0x230 0x330>;	\
+				pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
+
+#define EDGE_RISE_HYST3		pinctrl-single,input-schmitt = <0x310 0x330>;	\
+				pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
+#define EDGE_FALL_HYST3		pinctrl-single,input-schmitt = <0x320 0x330>;	\
+				pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
+#define EDGE_BOTH_HYST3		pinctrl-single,input-schmitt = <0x330 0x330>;	\
+				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>
+
+
+#define MFP_DEFAULT		DS_MEDIUM;PULL_NONE;EDGE_NONE;SL_NORMAL
+
+#define MFP_PULL_UP		DS_MEDIUM;PULL_UP;EDGE_NONE;SL_NORMAL
+#define MFP_PULL_DOWN		DS_MEDIUM;PULL_DOWN;EDGE_NONE;SL_NORMAL
+#define MFP_PULL_FLOAT		DS_MEDIUM;PULL_FLOAT;EDGE_NONE;SL_NORMAL
+
+/*
+ * 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 DF_IO0			0x0040
+#define DF_IO1			0x003c
+#define DF_IO2			0x0038
+#define DF_IO3			0x0034
+#define DF_IO4			0x0030
+#define DF_IO5			0x002c
+#define DF_IO6			0x0028
+#define DF_IO7			0x0024
+#define DF_IO8			0x0020
+#define DF_IO9			0x001c
+#define DF_IO10			0x0018
+#define DF_IO11			0x0014
+#define DF_IO12			0x0010
+#define DF_IO13			0x000c
+#define DF_IO14			0x0008
+#define DF_IO15			0x0004
+#define DF_nCS0			0x0044
+#define DF_nCS1			0x0048
+#define SM_nCS0			0x004c
+#define SM_nCS1			0x0050
+#define DF_WEn			0x0054
+#define DF_REn			0x0058
+#define DF_CLE_SM_OEn		0x005c
+#define DF_ALE_SM_WEn		0x0060
+#define DF_RDY0			0x0068
+#define DF_RDY1			0x0078
+
+#define SM_SCLK			0x0064
+#define SM_BE0			0x006c
+#define SM_BE1			0x0070
+#define SM_ADV			0x0074
+#define SM_ADVMUX		0x007c
+#define SM_RDY			0x0080
+
+#define MMC1_DAT7		0x0084
+#define MMC1_DAT6		0x0088
+#define MMC1_DAT5		0x008c
+#define MMC1_DAT4		0x0090
+#define MMC1_DAT3		0x0094
+#define MMC1_DAT2		0x0098
+#define MMC1_DAT1		0x009c
+#define MMC1_DAT0		0x00a0
+#define MMC1_CMD		0x00a4
+#define MMC1_CLK		0x00a8
+#define MMC1_CD			0x00ac
+#define MMC1_WP			0x00b0
+
+#define PRI_TDI			0xB4
+#define PRI_TMS			0xB8
+#define PRI_TCK			0xBC
+#define PRI_TDO			0xC0
+
+#define RF_CONF_4		0x0274
+#define VCXO_REQ		0xD4
+#define VCXO_OUT        	0xD8
+#define VBUS_DRV        	0xC8
+#define CLK_REQ			0x00cc
+
+#define ANT_SW4			0x26C
+#define PA_MODE			0x270
+
+#define TDS_DIO0		0x2B4
+#define TDS_DIO1		0x2B8
+#define TDS_DIO2		0x2BC
+#define TDS_DIO3		0x2C0
+#define TDS_DIO4		0x2C4
+#define TDS_DIO5		0x2C8
+#define TDS_DIO6		0x2CC
+#define TDS_DIO7		0x2D0
+#define TDS_CLK			0x2D4
+#define TDS_DIO8		0x2D8
+#define TDS_DIO9		0x2DC
+#define TDS_DIO10		0x2E0
+#define TDS_DIO11		0x2E4
+#define TDS_DIO12		0x2E8
+#define TDS_DIO13		0x2EC
+#define TDS_DIO14		0x2F0
+#define TDS_DIO15		0x2F4
+#define TDS_DIO16		0x2F8
+#define TDS_DIO17		0x2FC
+#define TDS_DIO18		0x300
+#define TDS_PAON		0x2E0
+#define TDS_PACTRL		0x2E4
+#define TDS_RXON		0x2E8
+#define TDS_TXON		0x2EC
+#define TDS_LNACTRL		0x2F0
+#define TDS_MIXCTRL		0x2F4
+#define TDS_TRXSW		0x2F8
+#define TDS_RXREV		0x2FC
+#define TDS_TXREV		0x300
+
+#define GPIO00			0x0DC
+#define GPIO01			0x0E0
+#define GPIO02			0x0E4
+#define GPIO03			0x0E8
+#define GPIO04			0x0EC
+#define GPIO05			0x0F0
+#define GPIO06			0x0F4
+#define GPIO07			0x0F8
+#define GPIO08			0x0FC
+#define GPIO09			0x100
+#define GPIO10			0x104
+#define GPIO11			0x108
+#define GPIO12			0x10C
+#define GPIO13			0x110
+#define GPIO14			0x114
+#define GPIO15			0x118
+#define GPIO16			0x11C
+#define GPIO17			0x120
+#define GPIO18			0x124
+#define GPIO19			0x128
+#define GPIO20			0x12C
+#define GPIO21			0x130
+#define GPIO22			0x134
+#define GPIO23			0x138
+#define GPIO24			0x13C
+
+#define GPIO25			0x140
+#define GPIO26			0x144
+#define GPIO27			0x148
+#define GPIO28			0x14c
+#define GPIO29			0x150
+#define GPIO30			0x154
+#define GPIO31			0x158
+#define GPIO32			0x15c
+#define GPIO33			0x160
+#define GPIO34			0x164
+#define GPIO35			0x168
+#define GPIO36			0x16c
+#define GPIO37			0x170
+#define GPIO38			0x174
+#define GPIO39			0x178
+#define GPIO40			0x17c
+#define GPIO41			0x180
+#define GPIO42			0x184
+#define GPIO43			0x188
+#define GPIO44			0x18c
+#define GPIO45			0x190
+#define GPIO46			0x194
+#define GPIO47			0x198
+#define GPIO48			0x19c
+#define GPIO49			0x1a0
+#define GPIO50			0x1a4
+#define GPIO51			0x1a8
+#define GPIO52			0x1ac
+#define GPIO53			0x1b0
+#define GPIO54			0x1b4
+#define GPIO55			0x1f4
+
+
+#define GPIO60			0x304
+#define GPIO61			0x308
+#define GPIO62			0x30C
+#define GPIO63			0x310
+#define GPIO64			0x314
+#define GPIO65			0x318
+#define GPIO66			0x31C
+#define GPIO69			0x2BC
+#define GPIO70			0x2C0
+#define GPIO71			0x1B8
+#define GPIO72			0x1BC
+#define GPIO79			0x2E4
+#define GPIO80			0x2E8
+#define GPIO81			0x280
+#define GPIO82			0x284
+#define GPIO83			0x288
+#define GPIO86			0x204
+#define GPIO123			0xCC
+#define GPIO124			0xD0
+#define GPIO126			0xD8
+#define USB_ID			0xb0
+
+#define ND_IO8			DF_IO8
+#define ND_IO9			DF_IO9
+#define ND_IO10			DF_IO10
+#define ND_IO11			DF_IO11
+#define ND_IO12			DF_IO12
+#define ND_IO13			DF_IO13
+#define ND_IO14			DF_IO14
+#define ND_IO15			DF_IO15
+#define ND_IO7			DF_IO7
+#define ND_IO6			DF_IO6
+#define ND_IO5			DF_IO5
+#define ND_IO4			DF_IO4
+#define ND_IO3			DF_IO3
+#define ND_IO2			DF_IO2
+#define ND_IO1			DF_IO1
+#define ND_IO0			DF_IO0
+
+#define ND_CLE_SM_OEN	DF_CLE_SM_OEn
+
+#define SM_BEN0			SM_BE0
+
+#endif /* __DTS_ASR18XX_PINFUNC_H */