18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * arch/arm/plat-pxa/include/plat/mfp.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *   Common Multi-Function Pin Definitions
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (C) 2007 Marvell International Ltd.
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * 2007-8-21: eric miao <eric.miao@marvell.com>
108c2ecf20Sopenharmony_ci *            initial version
118c2ecf20Sopenharmony_ci */
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#ifndef __ASM_PLAT_MFP_H
148c2ecf20Sopenharmony_ci#define __ASM_PLAT_MFP_H
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#define mfp_to_gpio(m)	((m) % 256)
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci/* list of all the configurable MFP pins */
198c2ecf20Sopenharmony_cienum {
208c2ecf20Sopenharmony_ci	MFP_PIN_INVALID = -1,
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci	MFP_PIN_GPIO0 = 0,
238c2ecf20Sopenharmony_ci	MFP_PIN_GPIO1,
248c2ecf20Sopenharmony_ci	MFP_PIN_GPIO2,
258c2ecf20Sopenharmony_ci	MFP_PIN_GPIO3,
268c2ecf20Sopenharmony_ci	MFP_PIN_GPIO4,
278c2ecf20Sopenharmony_ci	MFP_PIN_GPIO5,
288c2ecf20Sopenharmony_ci	MFP_PIN_GPIO6,
298c2ecf20Sopenharmony_ci	MFP_PIN_GPIO7,
308c2ecf20Sopenharmony_ci	MFP_PIN_GPIO8,
318c2ecf20Sopenharmony_ci	MFP_PIN_GPIO9,
328c2ecf20Sopenharmony_ci	MFP_PIN_GPIO10,
338c2ecf20Sopenharmony_ci	MFP_PIN_GPIO11,
348c2ecf20Sopenharmony_ci	MFP_PIN_GPIO12,
358c2ecf20Sopenharmony_ci	MFP_PIN_GPIO13,
368c2ecf20Sopenharmony_ci	MFP_PIN_GPIO14,
378c2ecf20Sopenharmony_ci	MFP_PIN_GPIO15,
388c2ecf20Sopenharmony_ci	MFP_PIN_GPIO16,
398c2ecf20Sopenharmony_ci	MFP_PIN_GPIO17,
408c2ecf20Sopenharmony_ci	MFP_PIN_GPIO18,
418c2ecf20Sopenharmony_ci	MFP_PIN_GPIO19,
428c2ecf20Sopenharmony_ci	MFP_PIN_GPIO20,
438c2ecf20Sopenharmony_ci	MFP_PIN_GPIO21,
448c2ecf20Sopenharmony_ci	MFP_PIN_GPIO22,
458c2ecf20Sopenharmony_ci	MFP_PIN_GPIO23,
468c2ecf20Sopenharmony_ci	MFP_PIN_GPIO24,
478c2ecf20Sopenharmony_ci	MFP_PIN_GPIO25,
488c2ecf20Sopenharmony_ci	MFP_PIN_GPIO26,
498c2ecf20Sopenharmony_ci	MFP_PIN_GPIO27,
508c2ecf20Sopenharmony_ci	MFP_PIN_GPIO28,
518c2ecf20Sopenharmony_ci	MFP_PIN_GPIO29,
528c2ecf20Sopenharmony_ci	MFP_PIN_GPIO30,
538c2ecf20Sopenharmony_ci	MFP_PIN_GPIO31,
548c2ecf20Sopenharmony_ci	MFP_PIN_GPIO32,
558c2ecf20Sopenharmony_ci	MFP_PIN_GPIO33,
568c2ecf20Sopenharmony_ci	MFP_PIN_GPIO34,
578c2ecf20Sopenharmony_ci	MFP_PIN_GPIO35,
588c2ecf20Sopenharmony_ci	MFP_PIN_GPIO36,
598c2ecf20Sopenharmony_ci	MFP_PIN_GPIO37,
608c2ecf20Sopenharmony_ci	MFP_PIN_GPIO38,
618c2ecf20Sopenharmony_ci	MFP_PIN_GPIO39,
628c2ecf20Sopenharmony_ci	MFP_PIN_GPIO40,
638c2ecf20Sopenharmony_ci	MFP_PIN_GPIO41,
648c2ecf20Sopenharmony_ci	MFP_PIN_GPIO42,
658c2ecf20Sopenharmony_ci	MFP_PIN_GPIO43,
668c2ecf20Sopenharmony_ci	MFP_PIN_GPIO44,
678c2ecf20Sopenharmony_ci	MFP_PIN_GPIO45,
688c2ecf20Sopenharmony_ci	MFP_PIN_GPIO46,
698c2ecf20Sopenharmony_ci	MFP_PIN_GPIO47,
708c2ecf20Sopenharmony_ci	MFP_PIN_GPIO48,
718c2ecf20Sopenharmony_ci	MFP_PIN_GPIO49,
728c2ecf20Sopenharmony_ci	MFP_PIN_GPIO50,
738c2ecf20Sopenharmony_ci	MFP_PIN_GPIO51,
748c2ecf20Sopenharmony_ci	MFP_PIN_GPIO52,
758c2ecf20Sopenharmony_ci	MFP_PIN_GPIO53,
768c2ecf20Sopenharmony_ci	MFP_PIN_GPIO54,
778c2ecf20Sopenharmony_ci	MFP_PIN_GPIO55,
788c2ecf20Sopenharmony_ci	MFP_PIN_GPIO56,
798c2ecf20Sopenharmony_ci	MFP_PIN_GPIO57,
808c2ecf20Sopenharmony_ci	MFP_PIN_GPIO58,
818c2ecf20Sopenharmony_ci	MFP_PIN_GPIO59,
828c2ecf20Sopenharmony_ci	MFP_PIN_GPIO60,
838c2ecf20Sopenharmony_ci	MFP_PIN_GPIO61,
848c2ecf20Sopenharmony_ci	MFP_PIN_GPIO62,
858c2ecf20Sopenharmony_ci	MFP_PIN_GPIO63,
868c2ecf20Sopenharmony_ci	MFP_PIN_GPIO64,
878c2ecf20Sopenharmony_ci	MFP_PIN_GPIO65,
888c2ecf20Sopenharmony_ci	MFP_PIN_GPIO66,
898c2ecf20Sopenharmony_ci	MFP_PIN_GPIO67,
908c2ecf20Sopenharmony_ci	MFP_PIN_GPIO68,
918c2ecf20Sopenharmony_ci	MFP_PIN_GPIO69,
928c2ecf20Sopenharmony_ci	MFP_PIN_GPIO70,
938c2ecf20Sopenharmony_ci	MFP_PIN_GPIO71,
948c2ecf20Sopenharmony_ci	MFP_PIN_GPIO72,
958c2ecf20Sopenharmony_ci	MFP_PIN_GPIO73,
968c2ecf20Sopenharmony_ci	MFP_PIN_GPIO74,
978c2ecf20Sopenharmony_ci	MFP_PIN_GPIO75,
988c2ecf20Sopenharmony_ci	MFP_PIN_GPIO76,
998c2ecf20Sopenharmony_ci	MFP_PIN_GPIO77,
1008c2ecf20Sopenharmony_ci	MFP_PIN_GPIO78,
1018c2ecf20Sopenharmony_ci	MFP_PIN_GPIO79,
1028c2ecf20Sopenharmony_ci	MFP_PIN_GPIO80,
1038c2ecf20Sopenharmony_ci	MFP_PIN_GPIO81,
1048c2ecf20Sopenharmony_ci	MFP_PIN_GPIO82,
1058c2ecf20Sopenharmony_ci	MFP_PIN_GPIO83,
1068c2ecf20Sopenharmony_ci	MFP_PIN_GPIO84,
1078c2ecf20Sopenharmony_ci	MFP_PIN_GPIO85,
1088c2ecf20Sopenharmony_ci	MFP_PIN_GPIO86,
1098c2ecf20Sopenharmony_ci	MFP_PIN_GPIO87,
1108c2ecf20Sopenharmony_ci	MFP_PIN_GPIO88,
1118c2ecf20Sopenharmony_ci	MFP_PIN_GPIO89,
1128c2ecf20Sopenharmony_ci	MFP_PIN_GPIO90,
1138c2ecf20Sopenharmony_ci	MFP_PIN_GPIO91,
1148c2ecf20Sopenharmony_ci	MFP_PIN_GPIO92,
1158c2ecf20Sopenharmony_ci	MFP_PIN_GPIO93,
1168c2ecf20Sopenharmony_ci	MFP_PIN_GPIO94,
1178c2ecf20Sopenharmony_ci	MFP_PIN_GPIO95,
1188c2ecf20Sopenharmony_ci	MFP_PIN_GPIO96,
1198c2ecf20Sopenharmony_ci	MFP_PIN_GPIO97,
1208c2ecf20Sopenharmony_ci	MFP_PIN_GPIO98,
1218c2ecf20Sopenharmony_ci	MFP_PIN_GPIO99,
1228c2ecf20Sopenharmony_ci	MFP_PIN_GPIO100,
1238c2ecf20Sopenharmony_ci	MFP_PIN_GPIO101,
1248c2ecf20Sopenharmony_ci	MFP_PIN_GPIO102,
1258c2ecf20Sopenharmony_ci	MFP_PIN_GPIO103,
1268c2ecf20Sopenharmony_ci	MFP_PIN_GPIO104,
1278c2ecf20Sopenharmony_ci	MFP_PIN_GPIO105,
1288c2ecf20Sopenharmony_ci	MFP_PIN_GPIO106,
1298c2ecf20Sopenharmony_ci	MFP_PIN_GPIO107,
1308c2ecf20Sopenharmony_ci	MFP_PIN_GPIO108,
1318c2ecf20Sopenharmony_ci	MFP_PIN_GPIO109,
1328c2ecf20Sopenharmony_ci	MFP_PIN_GPIO110,
1338c2ecf20Sopenharmony_ci	MFP_PIN_GPIO111,
1348c2ecf20Sopenharmony_ci	MFP_PIN_GPIO112,
1358c2ecf20Sopenharmony_ci	MFP_PIN_GPIO113,
1368c2ecf20Sopenharmony_ci	MFP_PIN_GPIO114,
1378c2ecf20Sopenharmony_ci	MFP_PIN_GPIO115,
1388c2ecf20Sopenharmony_ci	MFP_PIN_GPIO116,
1398c2ecf20Sopenharmony_ci	MFP_PIN_GPIO117,
1408c2ecf20Sopenharmony_ci	MFP_PIN_GPIO118,
1418c2ecf20Sopenharmony_ci	MFP_PIN_GPIO119,
1428c2ecf20Sopenharmony_ci	MFP_PIN_GPIO120,
1438c2ecf20Sopenharmony_ci	MFP_PIN_GPIO121,
1448c2ecf20Sopenharmony_ci	MFP_PIN_GPIO122,
1458c2ecf20Sopenharmony_ci	MFP_PIN_GPIO123,
1468c2ecf20Sopenharmony_ci	MFP_PIN_GPIO124,
1478c2ecf20Sopenharmony_ci	MFP_PIN_GPIO125,
1488c2ecf20Sopenharmony_ci	MFP_PIN_GPIO126,
1498c2ecf20Sopenharmony_ci	MFP_PIN_GPIO127,
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci	MFP_PIN_GPIO128,
1528c2ecf20Sopenharmony_ci	MFP_PIN_GPIO129,
1538c2ecf20Sopenharmony_ci	MFP_PIN_GPIO130,
1548c2ecf20Sopenharmony_ci	MFP_PIN_GPIO131,
1558c2ecf20Sopenharmony_ci	MFP_PIN_GPIO132,
1568c2ecf20Sopenharmony_ci	MFP_PIN_GPIO133,
1578c2ecf20Sopenharmony_ci	MFP_PIN_GPIO134,
1588c2ecf20Sopenharmony_ci	MFP_PIN_GPIO135,
1598c2ecf20Sopenharmony_ci	MFP_PIN_GPIO136,
1608c2ecf20Sopenharmony_ci	MFP_PIN_GPIO137,
1618c2ecf20Sopenharmony_ci	MFP_PIN_GPIO138,
1628c2ecf20Sopenharmony_ci	MFP_PIN_GPIO139,
1638c2ecf20Sopenharmony_ci	MFP_PIN_GPIO140,
1648c2ecf20Sopenharmony_ci	MFP_PIN_GPIO141,
1658c2ecf20Sopenharmony_ci	MFP_PIN_GPIO142,
1668c2ecf20Sopenharmony_ci	MFP_PIN_GPIO143,
1678c2ecf20Sopenharmony_ci	MFP_PIN_GPIO144,
1688c2ecf20Sopenharmony_ci	MFP_PIN_GPIO145,
1698c2ecf20Sopenharmony_ci	MFP_PIN_GPIO146,
1708c2ecf20Sopenharmony_ci	MFP_PIN_GPIO147,
1718c2ecf20Sopenharmony_ci	MFP_PIN_GPIO148,
1728c2ecf20Sopenharmony_ci	MFP_PIN_GPIO149,
1738c2ecf20Sopenharmony_ci	MFP_PIN_GPIO150,
1748c2ecf20Sopenharmony_ci	MFP_PIN_GPIO151,
1758c2ecf20Sopenharmony_ci	MFP_PIN_GPIO152,
1768c2ecf20Sopenharmony_ci	MFP_PIN_GPIO153,
1778c2ecf20Sopenharmony_ci	MFP_PIN_GPIO154,
1788c2ecf20Sopenharmony_ci	MFP_PIN_GPIO155,
1798c2ecf20Sopenharmony_ci	MFP_PIN_GPIO156,
1808c2ecf20Sopenharmony_ci	MFP_PIN_GPIO157,
1818c2ecf20Sopenharmony_ci	MFP_PIN_GPIO158,
1828c2ecf20Sopenharmony_ci	MFP_PIN_GPIO159,
1838c2ecf20Sopenharmony_ci	MFP_PIN_GPIO160,
1848c2ecf20Sopenharmony_ci	MFP_PIN_GPIO161,
1858c2ecf20Sopenharmony_ci	MFP_PIN_GPIO162,
1868c2ecf20Sopenharmony_ci	MFP_PIN_GPIO163,
1878c2ecf20Sopenharmony_ci	MFP_PIN_GPIO164,
1888c2ecf20Sopenharmony_ci	MFP_PIN_GPIO165,
1898c2ecf20Sopenharmony_ci	MFP_PIN_GPIO166,
1908c2ecf20Sopenharmony_ci	MFP_PIN_GPIO167,
1918c2ecf20Sopenharmony_ci	MFP_PIN_GPIO168,
1928c2ecf20Sopenharmony_ci	MFP_PIN_GPIO169,
1938c2ecf20Sopenharmony_ci	MFP_PIN_GPIO170,
1948c2ecf20Sopenharmony_ci	MFP_PIN_GPIO171,
1958c2ecf20Sopenharmony_ci	MFP_PIN_GPIO172,
1968c2ecf20Sopenharmony_ci	MFP_PIN_GPIO173,
1978c2ecf20Sopenharmony_ci	MFP_PIN_GPIO174,
1988c2ecf20Sopenharmony_ci	MFP_PIN_GPIO175,
1998c2ecf20Sopenharmony_ci	MFP_PIN_GPIO176,
2008c2ecf20Sopenharmony_ci	MFP_PIN_GPIO177,
2018c2ecf20Sopenharmony_ci	MFP_PIN_GPIO178,
2028c2ecf20Sopenharmony_ci	MFP_PIN_GPIO179,
2038c2ecf20Sopenharmony_ci	MFP_PIN_GPIO180,
2048c2ecf20Sopenharmony_ci	MFP_PIN_GPIO181,
2058c2ecf20Sopenharmony_ci	MFP_PIN_GPIO182,
2068c2ecf20Sopenharmony_ci	MFP_PIN_GPIO183,
2078c2ecf20Sopenharmony_ci	MFP_PIN_GPIO184,
2088c2ecf20Sopenharmony_ci	MFP_PIN_GPIO185,
2098c2ecf20Sopenharmony_ci	MFP_PIN_GPIO186,
2108c2ecf20Sopenharmony_ci	MFP_PIN_GPIO187,
2118c2ecf20Sopenharmony_ci	MFP_PIN_GPIO188,
2128c2ecf20Sopenharmony_ci	MFP_PIN_GPIO189,
2138c2ecf20Sopenharmony_ci	MFP_PIN_GPIO190,
2148c2ecf20Sopenharmony_ci	MFP_PIN_GPIO191,
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci	MFP_PIN_GPIO255 = 255,
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci	MFP_PIN_GPIO0_2,
2198c2ecf20Sopenharmony_ci	MFP_PIN_GPIO1_2,
2208c2ecf20Sopenharmony_ci	MFP_PIN_GPIO2_2,
2218c2ecf20Sopenharmony_ci	MFP_PIN_GPIO3_2,
2228c2ecf20Sopenharmony_ci	MFP_PIN_GPIO4_2,
2238c2ecf20Sopenharmony_ci	MFP_PIN_GPIO5_2,
2248c2ecf20Sopenharmony_ci	MFP_PIN_GPIO6_2,
2258c2ecf20Sopenharmony_ci	MFP_PIN_GPIO7_2,
2268c2ecf20Sopenharmony_ci	MFP_PIN_GPIO8_2,
2278c2ecf20Sopenharmony_ci	MFP_PIN_GPIO9_2,
2288c2ecf20Sopenharmony_ci	MFP_PIN_GPIO10_2,
2298c2ecf20Sopenharmony_ci	MFP_PIN_GPIO11_2,
2308c2ecf20Sopenharmony_ci	MFP_PIN_GPIO12_2,
2318c2ecf20Sopenharmony_ci	MFP_PIN_GPIO13_2,
2328c2ecf20Sopenharmony_ci	MFP_PIN_GPIO14_2,
2338c2ecf20Sopenharmony_ci	MFP_PIN_GPIO15_2,
2348c2ecf20Sopenharmony_ci	MFP_PIN_GPIO16_2,
2358c2ecf20Sopenharmony_ci	MFP_PIN_GPIO17_2,
2368c2ecf20Sopenharmony_ci
2378c2ecf20Sopenharmony_ci	MFP_PIN_ULPI_STP,
2388c2ecf20Sopenharmony_ci	MFP_PIN_ULPI_NXT,
2398c2ecf20Sopenharmony_ci	MFP_PIN_ULPI_DIR,
2408c2ecf20Sopenharmony_ci
2418c2ecf20Sopenharmony_ci	MFP_PIN_nXCVREN,
2428c2ecf20Sopenharmony_ci	MFP_PIN_DF_CLE_nOE,
2438c2ecf20Sopenharmony_ci	MFP_PIN_DF_nADV1_ALE,
2448c2ecf20Sopenharmony_ci	MFP_PIN_DF_SCLK_E,
2458c2ecf20Sopenharmony_ci	MFP_PIN_DF_SCLK_S,
2468c2ecf20Sopenharmony_ci	MFP_PIN_nBE0,
2478c2ecf20Sopenharmony_ci	MFP_PIN_nBE1,
2488c2ecf20Sopenharmony_ci	MFP_PIN_DF_nADV2_ALE,
2498c2ecf20Sopenharmony_ci	MFP_PIN_DF_INT_RnB,
2508c2ecf20Sopenharmony_ci	MFP_PIN_DF_nCS0,
2518c2ecf20Sopenharmony_ci	MFP_PIN_DF_nCS1,
2528c2ecf20Sopenharmony_ci	MFP_PIN_nLUA,
2538c2ecf20Sopenharmony_ci	MFP_PIN_nLLA,
2548c2ecf20Sopenharmony_ci	MFP_PIN_DF_nWE,
2558c2ecf20Sopenharmony_ci	MFP_PIN_DF_ALE_nWE,
2568c2ecf20Sopenharmony_ci	MFP_PIN_DF_nRE_nOE,
2578c2ecf20Sopenharmony_ci	MFP_PIN_DF_ADDR0,
2588c2ecf20Sopenharmony_ci	MFP_PIN_DF_ADDR1,
2598c2ecf20Sopenharmony_ci	MFP_PIN_DF_ADDR2,
2608c2ecf20Sopenharmony_ci	MFP_PIN_DF_ADDR3,
2618c2ecf20Sopenharmony_ci	MFP_PIN_DF_IO0,
2628c2ecf20Sopenharmony_ci	MFP_PIN_DF_IO1,
2638c2ecf20Sopenharmony_ci	MFP_PIN_DF_IO2,
2648c2ecf20Sopenharmony_ci	MFP_PIN_DF_IO3,
2658c2ecf20Sopenharmony_ci	MFP_PIN_DF_IO4,
2668c2ecf20Sopenharmony_ci	MFP_PIN_DF_IO5,
2678c2ecf20Sopenharmony_ci	MFP_PIN_DF_IO6,
2688c2ecf20Sopenharmony_ci	MFP_PIN_DF_IO7,
2698c2ecf20Sopenharmony_ci	MFP_PIN_DF_IO8,
2708c2ecf20Sopenharmony_ci	MFP_PIN_DF_IO9,
2718c2ecf20Sopenharmony_ci	MFP_PIN_DF_IO10,
2728c2ecf20Sopenharmony_ci	MFP_PIN_DF_IO11,
2738c2ecf20Sopenharmony_ci	MFP_PIN_DF_IO12,
2748c2ecf20Sopenharmony_ci	MFP_PIN_DF_IO13,
2758c2ecf20Sopenharmony_ci	MFP_PIN_DF_IO14,
2768c2ecf20Sopenharmony_ci	MFP_PIN_DF_IO15,
2778c2ecf20Sopenharmony_ci	MFP_PIN_DF_nCS0_SM_nCS2,
2788c2ecf20Sopenharmony_ci	MFP_PIN_DF_nCS1_SM_nCS3,
2798c2ecf20Sopenharmony_ci	MFP_PIN_SM_nCS0,
2808c2ecf20Sopenharmony_ci	MFP_PIN_SM_nCS1,
2818c2ecf20Sopenharmony_ci	MFP_PIN_DF_WEn,
2828c2ecf20Sopenharmony_ci	MFP_PIN_DF_REn,
2838c2ecf20Sopenharmony_ci	MFP_PIN_DF_CLE_SM_OEn,
2848c2ecf20Sopenharmony_ci	MFP_PIN_DF_ALE_SM_WEn,
2858c2ecf20Sopenharmony_ci	MFP_PIN_DF_RDY0,
2868c2ecf20Sopenharmony_ci	MFP_PIN_DF_RDY1,
2878c2ecf20Sopenharmony_ci
2888c2ecf20Sopenharmony_ci	MFP_PIN_SM_SCLK,
2898c2ecf20Sopenharmony_ci	MFP_PIN_SM_BE0,
2908c2ecf20Sopenharmony_ci	MFP_PIN_SM_BE1,
2918c2ecf20Sopenharmony_ci	MFP_PIN_SM_ADV,
2928c2ecf20Sopenharmony_ci	MFP_PIN_SM_ADVMUX,
2938c2ecf20Sopenharmony_ci	MFP_PIN_SM_RDY,
2948c2ecf20Sopenharmony_ci
2958c2ecf20Sopenharmony_ci	MFP_PIN_MMC1_DAT7,
2968c2ecf20Sopenharmony_ci	MFP_PIN_MMC1_DAT6,
2978c2ecf20Sopenharmony_ci	MFP_PIN_MMC1_DAT5,
2988c2ecf20Sopenharmony_ci	MFP_PIN_MMC1_DAT4,
2998c2ecf20Sopenharmony_ci	MFP_PIN_MMC1_DAT3,
3008c2ecf20Sopenharmony_ci	MFP_PIN_MMC1_DAT2,
3018c2ecf20Sopenharmony_ci	MFP_PIN_MMC1_DAT1,
3028c2ecf20Sopenharmony_ci	MFP_PIN_MMC1_DAT0,
3038c2ecf20Sopenharmony_ci	MFP_PIN_MMC1_CMD,
3048c2ecf20Sopenharmony_ci	MFP_PIN_MMC1_CLK,
3058c2ecf20Sopenharmony_ci	MFP_PIN_MMC1_CD,
3068c2ecf20Sopenharmony_ci	MFP_PIN_MMC1_WP,
3078c2ecf20Sopenharmony_ci
3088c2ecf20Sopenharmony_ci	/* additional pins on PXA930 */
3098c2ecf20Sopenharmony_ci	MFP_PIN_GSIM_UIO,
3108c2ecf20Sopenharmony_ci	MFP_PIN_GSIM_UCLK,
3118c2ecf20Sopenharmony_ci	MFP_PIN_GSIM_UDET,
3128c2ecf20Sopenharmony_ci	MFP_PIN_GSIM_nURST,
3138c2ecf20Sopenharmony_ci	MFP_PIN_PMIC_INT,
3148c2ecf20Sopenharmony_ci	MFP_PIN_RDY,
3158c2ecf20Sopenharmony_ci
3168c2ecf20Sopenharmony_ci	/* additional pins on MMP2 */
3178c2ecf20Sopenharmony_ci	MFP_PIN_TWSI1_SCL,
3188c2ecf20Sopenharmony_ci	MFP_PIN_TWSI1_SDA,
3198c2ecf20Sopenharmony_ci	MFP_PIN_TWSI4_SCL,
3208c2ecf20Sopenharmony_ci	MFP_PIN_TWSI4_SDA,
3218c2ecf20Sopenharmony_ci	MFP_PIN_CLK_REQ,
3228c2ecf20Sopenharmony_ci
3238c2ecf20Sopenharmony_ci	MFP_PIN_MAX,
3248c2ecf20Sopenharmony_ci};
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_ci/*
3278c2ecf20Sopenharmony_ci * a possible MFP configuration is represented by a 32-bit integer
3288c2ecf20Sopenharmony_ci *
3298c2ecf20Sopenharmony_ci * bit  0.. 9 - MFP Pin Number (1024 Pins Maximum)
3308c2ecf20Sopenharmony_ci * bit 10..12 - Alternate Function Selection
3318c2ecf20Sopenharmony_ci * bit 13..15 - Drive Strength
3328c2ecf20Sopenharmony_ci * bit 16..18 - Low Power Mode State
3338c2ecf20Sopenharmony_ci * bit 19..20 - Low Power Mode Edge Detection
3348c2ecf20Sopenharmony_ci * bit 21..22 - Run Mode Pull State
3358c2ecf20Sopenharmony_ci *
3368c2ecf20Sopenharmony_ci * to facilitate the definition, the following macros are provided
3378c2ecf20Sopenharmony_ci *
3388c2ecf20Sopenharmony_ci * MFP_CFG_DEFAULT - default MFP configuration value, with
3398c2ecf20Sopenharmony_ci * 		  alternate function = 0,
3408c2ecf20Sopenharmony_ci * 		  drive strength = fast 3mA (MFP_DS03X)
3418c2ecf20Sopenharmony_ci * 		  low power mode = default
3428c2ecf20Sopenharmony_ci * 		  edge detection = none
3438c2ecf20Sopenharmony_ci *
3448c2ecf20Sopenharmony_ci * MFP_CFG	- default MFPR value with alternate function
3458c2ecf20Sopenharmony_ci * MFP_CFG_DRV	- default MFPR value with alternate function and
3468c2ecf20Sopenharmony_ci * 		  pin drive strength
3478c2ecf20Sopenharmony_ci * MFP_CFG_LPM	- default MFPR value with alternate function and
3488c2ecf20Sopenharmony_ci * 		  low power mode
3498c2ecf20Sopenharmony_ci * MFP_CFG_X	- default MFPR value with alternate function,
3508c2ecf20Sopenharmony_ci * 		  pin drive strength and low power mode
3518c2ecf20Sopenharmony_ci */
3528c2ecf20Sopenharmony_ci
3538c2ecf20Sopenharmony_citypedef unsigned long mfp_cfg_t;
3548c2ecf20Sopenharmony_ci
3558c2ecf20Sopenharmony_ci#define MFP_PIN(x)		((x) & 0x3ff)
3568c2ecf20Sopenharmony_ci
3578c2ecf20Sopenharmony_ci#define MFP_AF0			(0x0 << 10)
3588c2ecf20Sopenharmony_ci#define MFP_AF1			(0x1 << 10)
3598c2ecf20Sopenharmony_ci#define MFP_AF2			(0x2 << 10)
3608c2ecf20Sopenharmony_ci#define MFP_AF3			(0x3 << 10)
3618c2ecf20Sopenharmony_ci#define MFP_AF4			(0x4 << 10)
3628c2ecf20Sopenharmony_ci#define MFP_AF5			(0x5 << 10)
3638c2ecf20Sopenharmony_ci#define MFP_AF6			(0x6 << 10)
3648c2ecf20Sopenharmony_ci#define MFP_AF7			(0x7 << 10)
3658c2ecf20Sopenharmony_ci#define MFP_AF_MASK		(0x7 << 10)
3668c2ecf20Sopenharmony_ci#define MFP_AF(x)		(((x) >> 10) & 0x7)
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_ci#define MFP_DS01X		(0x0 << 13)
3698c2ecf20Sopenharmony_ci#define MFP_DS02X		(0x1 << 13)
3708c2ecf20Sopenharmony_ci#define MFP_DS03X		(0x2 << 13)
3718c2ecf20Sopenharmony_ci#define MFP_DS04X		(0x3 << 13)
3728c2ecf20Sopenharmony_ci#define MFP_DS06X		(0x4 << 13)
3738c2ecf20Sopenharmony_ci#define MFP_DS08X		(0x5 << 13)
3748c2ecf20Sopenharmony_ci#define MFP_DS10X		(0x6 << 13)
3758c2ecf20Sopenharmony_ci#define MFP_DS13X		(0x7 << 13)
3768c2ecf20Sopenharmony_ci#define MFP_DS_MASK		(0x7 << 13)
3778c2ecf20Sopenharmony_ci#define MFP_DS(x)		(((x) >> 13) & 0x7)
3788c2ecf20Sopenharmony_ci
3798c2ecf20Sopenharmony_ci#define MFP_LPM_DEFAULT		(0x0 << 16)
3808c2ecf20Sopenharmony_ci#define MFP_LPM_DRIVE_LOW	(0x1 << 16)
3818c2ecf20Sopenharmony_ci#define MFP_LPM_DRIVE_HIGH	(0x2 << 16)
3828c2ecf20Sopenharmony_ci#define MFP_LPM_PULL_LOW	(0x3 << 16)
3838c2ecf20Sopenharmony_ci#define MFP_LPM_PULL_HIGH	(0x4 << 16)
3848c2ecf20Sopenharmony_ci#define MFP_LPM_FLOAT		(0x5 << 16)
3858c2ecf20Sopenharmony_ci#define MFP_LPM_INPUT		(0x6 << 16)
3868c2ecf20Sopenharmony_ci#define MFP_LPM_STATE_MASK	(0x7 << 16)
3878c2ecf20Sopenharmony_ci#define MFP_LPM_STATE(x)	(((x) >> 16) & 0x7)
3888c2ecf20Sopenharmony_ci
3898c2ecf20Sopenharmony_ci#define MFP_LPM_EDGE_NONE	(0x0 << 19)
3908c2ecf20Sopenharmony_ci#define MFP_LPM_EDGE_RISE	(0x1 << 19)
3918c2ecf20Sopenharmony_ci#define MFP_LPM_EDGE_FALL	(0x2 << 19)
3928c2ecf20Sopenharmony_ci#define MFP_LPM_EDGE_BOTH	(0x3 << 19)
3938c2ecf20Sopenharmony_ci#define MFP_LPM_EDGE_MASK	(0x3 << 19)
3948c2ecf20Sopenharmony_ci#define MFP_LPM_EDGE(x)		(((x) >> 19) & 0x3)
3958c2ecf20Sopenharmony_ci
3968c2ecf20Sopenharmony_ci#define MFP_PULL_NONE		(0x0 << 21)
3978c2ecf20Sopenharmony_ci#define MFP_PULL_LOW		(0x1 << 21)
3988c2ecf20Sopenharmony_ci#define MFP_PULL_HIGH		(0x2 << 21)
3998c2ecf20Sopenharmony_ci#define MFP_PULL_BOTH		(0x3 << 21)
4008c2ecf20Sopenharmony_ci#define MFP_PULL_FLOAT		(0x4 << 21)
4018c2ecf20Sopenharmony_ci#define MFP_PULL_MASK		(0x7 << 21)
4028c2ecf20Sopenharmony_ci#define MFP_PULL(x)		(((x) >> 21) & 0x7)
4038c2ecf20Sopenharmony_ci
4048c2ecf20Sopenharmony_ci#define MFP_CFG_DEFAULT		(MFP_AF0 | MFP_DS03X | MFP_LPM_DEFAULT |\
4058c2ecf20Sopenharmony_ci				 MFP_LPM_EDGE_NONE | MFP_PULL_NONE)
4068c2ecf20Sopenharmony_ci
4078c2ecf20Sopenharmony_ci#define MFP_CFG(pin, af)		\
4088c2ecf20Sopenharmony_ci	((MFP_CFG_DEFAULT & ~MFP_AF_MASK) |\
4098c2ecf20Sopenharmony_ci	 (MFP_PIN(MFP_PIN_##pin) | MFP_##af))
4108c2ecf20Sopenharmony_ci
4118c2ecf20Sopenharmony_ci#define MFP_CFG_DRV(pin, af, drv)	\
4128c2ecf20Sopenharmony_ci	((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DS_MASK)) |\
4138c2ecf20Sopenharmony_ci	 (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_##drv))
4148c2ecf20Sopenharmony_ci
4158c2ecf20Sopenharmony_ci#define MFP_CFG_LPM(pin, af, lpm)	\
4168c2ecf20Sopenharmony_ci	((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_LPM_STATE_MASK)) |\
4178c2ecf20Sopenharmony_ci	 (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_LPM_##lpm))
4188c2ecf20Sopenharmony_ci
4198c2ecf20Sopenharmony_ci#define MFP_CFG_X(pin, af, drv, lpm)	\
4208c2ecf20Sopenharmony_ci	((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DS_MASK | MFP_LPM_STATE_MASK)) |\
4218c2ecf20Sopenharmony_ci	 (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_##drv | MFP_LPM_##lpm))
4228c2ecf20Sopenharmony_ci
4238c2ecf20Sopenharmony_ci#if defined(CONFIG_PXA3xx) || defined(CONFIG_ARCH_MMP)
4248c2ecf20Sopenharmony_ci/*
4258c2ecf20Sopenharmony_ci * each MFP pin will have a MFPR register, since the offset of the
4268c2ecf20Sopenharmony_ci * register varies between processors, the processor specific code
4278c2ecf20Sopenharmony_ci * should initialize the pin offsets by mfp_init()
4288c2ecf20Sopenharmony_ci *
4298c2ecf20Sopenharmony_ci * mfp_init_base() - accepts a virtual base for all MFPR registers and
4308c2ecf20Sopenharmony_ci * initialize the MFP table to a default state
4318c2ecf20Sopenharmony_ci *
4328c2ecf20Sopenharmony_ci * mfp_init_addr() - accepts a table of "mfp_addr_map" structure, which
4338c2ecf20Sopenharmony_ci * represents a range of MFP pins from "start" to "end", with the offset
4348c2ecf20Sopenharmony_ci * beginning at "offset", to define a single pin, let "end" = -1.
4358c2ecf20Sopenharmony_ci *
4368c2ecf20Sopenharmony_ci * use
4378c2ecf20Sopenharmony_ci *
4388c2ecf20Sopenharmony_ci * MFP_ADDR_X() to define a range of pins
4398c2ecf20Sopenharmony_ci * MFP_ADDR()   to define a single pin
4408c2ecf20Sopenharmony_ci * MFP_ADDR_END to signal the end of pin offset definitions
4418c2ecf20Sopenharmony_ci */
4428c2ecf20Sopenharmony_cistruct mfp_addr_map {
4438c2ecf20Sopenharmony_ci	unsigned int	start;
4448c2ecf20Sopenharmony_ci	unsigned int	end;
4458c2ecf20Sopenharmony_ci	unsigned long	offset;
4468c2ecf20Sopenharmony_ci};
4478c2ecf20Sopenharmony_ci
4488c2ecf20Sopenharmony_ci#define MFP_ADDR_X(start, end, offset) \
4498c2ecf20Sopenharmony_ci	{ MFP_PIN_##start, MFP_PIN_##end, offset }
4508c2ecf20Sopenharmony_ci
4518c2ecf20Sopenharmony_ci#define MFP_ADDR(pin, offset) \
4528c2ecf20Sopenharmony_ci	{ MFP_PIN_##pin, -1, offset }
4538c2ecf20Sopenharmony_ci
4548c2ecf20Sopenharmony_ci#define MFP_ADDR_END	{ MFP_PIN_INVALID, 0 }
4558c2ecf20Sopenharmony_ci
4568c2ecf20Sopenharmony_civoid __init mfp_init_base(void __iomem *mfpr_base);
4578c2ecf20Sopenharmony_civoid __init mfp_init_addr(struct mfp_addr_map *map);
4588c2ecf20Sopenharmony_ci
4598c2ecf20Sopenharmony_ci/*
4608c2ecf20Sopenharmony_ci * mfp_{read, write}()	- for direct read/write access to the MFPR register
4618c2ecf20Sopenharmony_ci * mfp_config()		- for configuring a group of MFPR registers
4628c2ecf20Sopenharmony_ci * mfp_config_lpm()	- configuring all low power MFPR registers for suspend
4638c2ecf20Sopenharmony_ci * mfp_config_run()	- configuring all run time  MFPR registers after resume
4648c2ecf20Sopenharmony_ci */
4658c2ecf20Sopenharmony_ciunsigned long mfp_read(int mfp);
4668c2ecf20Sopenharmony_civoid mfp_write(int mfp, unsigned long mfpr_val);
4678c2ecf20Sopenharmony_civoid mfp_config(unsigned long *mfp_cfgs, int num);
4688c2ecf20Sopenharmony_civoid mfp_config_run(void);
4698c2ecf20Sopenharmony_civoid mfp_config_lpm(void);
4708c2ecf20Sopenharmony_ci#endif /* CONFIG_PXA3xx || CONFIG_ARCH_MMP */
4718c2ecf20Sopenharmony_ci
4728c2ecf20Sopenharmony_ci#endif /* __ASM_PLAT_MFP_H */
473