18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Pinctrl dts file for HiSilicon Poplar board
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (c) 2016-2018 HiSilicon Technologies Co., Ltd.
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#include <dt-bindings/pinctrl/hisi.h>
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci/* value, enable bits, disable bits, mask */
118c2ecf20Sopenharmony_ci#define PINCTRL_PULLDOWN(value, enable, disable, mask) \
128c2ecf20Sopenharmony_ci	(value << 13) (enable << 13) (disable << 13) (mask << 13)
138c2ecf20Sopenharmony_ci#define PINCTRL_PULLUP(value, enable, disable, mask) \
148c2ecf20Sopenharmony_ci	(value << 12) (enable << 12) (disable << 12) (mask << 12)
158c2ecf20Sopenharmony_ci#define PINCTRL_SLEW_RATE(value, mask)	  (value << 8) (mask << 8)
168c2ecf20Sopenharmony_ci#define PINCTRL_DRV_STRENGTH(value, mask) (value << 4) (mask << 4)
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci&pmx0 {
198c2ecf20Sopenharmony_ci	emmc_pins_1: emmc-pins-1 {
208c2ecf20Sopenharmony_ci		pinctrl-single,pins = <
218c2ecf20Sopenharmony_ci			0x000 MUX_M2
228c2ecf20Sopenharmony_ci			0x004 MUX_M2
238c2ecf20Sopenharmony_ci			0x008 MUX_M2
248c2ecf20Sopenharmony_ci			0x00c MUX_M2
258c2ecf20Sopenharmony_ci			0x010 MUX_M2
268c2ecf20Sopenharmony_ci			0x014 MUX_M2
278c2ecf20Sopenharmony_ci			0x018 MUX_M2
288c2ecf20Sopenharmony_ci			0x01c MUX_M2
298c2ecf20Sopenharmony_ci			0x024 MUX_M2
308c2ecf20Sopenharmony_ci		>;
318c2ecf20Sopenharmony_ci		pinctrl-single,bias-pulldown = <
328c2ecf20Sopenharmony_ci			PINCTRL_PULLDOWN(0, 1, 0, 1)
338c2ecf20Sopenharmony_ci		>;
348c2ecf20Sopenharmony_ci		pinctrl-single,bias-pullup = <
358c2ecf20Sopenharmony_ci			PINCTRL_PULLUP(0, 1, 0, 1)
368c2ecf20Sopenharmony_ci		>;
378c2ecf20Sopenharmony_ci		pinctrl-single,slew-rate = <
388c2ecf20Sopenharmony_ci			PINCTRL_SLEW_RATE(1, 1)
398c2ecf20Sopenharmony_ci		>;
408c2ecf20Sopenharmony_ci		pinctrl-single,drive-strength = <
418c2ecf20Sopenharmony_ci			PINCTRL_DRV_STRENGTH(0xb, 0xf)
428c2ecf20Sopenharmony_ci		>;
438c2ecf20Sopenharmony_ci	};
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci	emmc_pins_2: emmc-pins-2 {
468c2ecf20Sopenharmony_ci		pinctrl-single,pins = <
478c2ecf20Sopenharmony_ci			0x028 MUX_M2
488c2ecf20Sopenharmony_ci		>;
498c2ecf20Sopenharmony_ci		pinctrl-single,bias-pulldown = <
508c2ecf20Sopenharmony_ci			PINCTRL_PULLDOWN(0, 1, 0, 1)
518c2ecf20Sopenharmony_ci		>;
528c2ecf20Sopenharmony_ci		pinctrl-single,bias-pullup = <
538c2ecf20Sopenharmony_ci			PINCTRL_PULLUP(0, 1, 0, 1)
548c2ecf20Sopenharmony_ci		>;
558c2ecf20Sopenharmony_ci		pinctrl-single,slew-rate = <
568c2ecf20Sopenharmony_ci			PINCTRL_SLEW_RATE(1, 1)
578c2ecf20Sopenharmony_ci		>;
588c2ecf20Sopenharmony_ci		pinctrl-single,drive-strength = <
598c2ecf20Sopenharmony_ci			PINCTRL_DRV_STRENGTH(0x9, 0xf)
608c2ecf20Sopenharmony_ci		>;
618c2ecf20Sopenharmony_ci	};
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci	emmc_pins_3: emmc-pins-3 {
648c2ecf20Sopenharmony_ci		pinctrl-single,pins = <
658c2ecf20Sopenharmony_ci			0x02c MUX_M2
668c2ecf20Sopenharmony_ci		>;
678c2ecf20Sopenharmony_ci		pinctrl-single,bias-pulldown = <
688c2ecf20Sopenharmony_ci			PINCTRL_PULLDOWN(0, 1, 0, 1)
698c2ecf20Sopenharmony_ci		>;
708c2ecf20Sopenharmony_ci		pinctrl-single,bias-pullup = <
718c2ecf20Sopenharmony_ci			PINCTRL_PULLUP(0, 1, 0, 1)
728c2ecf20Sopenharmony_ci		>;
738c2ecf20Sopenharmony_ci		pinctrl-single,slew-rate = <
748c2ecf20Sopenharmony_ci			PINCTRL_SLEW_RATE(1, 1)
758c2ecf20Sopenharmony_ci		>;
768c2ecf20Sopenharmony_ci		pinctrl-single,drive-strength = <
778c2ecf20Sopenharmony_ci			PINCTRL_DRV_STRENGTH(3, 3)
788c2ecf20Sopenharmony_ci		>;
798c2ecf20Sopenharmony_ci	};
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci	emmc_pins_4: emmc-pins-4 {
828c2ecf20Sopenharmony_ci		pinctrl-single,pins = <
838c2ecf20Sopenharmony_ci			0x030 MUX_M2
848c2ecf20Sopenharmony_ci		>;
858c2ecf20Sopenharmony_ci		pinctrl-single,bias-pulldown = <
868c2ecf20Sopenharmony_ci			PINCTRL_PULLDOWN(1, 1, 0, 1)
878c2ecf20Sopenharmony_ci		>;
888c2ecf20Sopenharmony_ci		pinctrl-single,bias-pullup = <
898c2ecf20Sopenharmony_ci			PINCTRL_PULLUP(0, 1, 0, 1)
908c2ecf20Sopenharmony_ci		>;
918c2ecf20Sopenharmony_ci		pinctrl-single,slew-rate = <
928c2ecf20Sopenharmony_ci			PINCTRL_SLEW_RATE(1, 1)
938c2ecf20Sopenharmony_ci		>;
948c2ecf20Sopenharmony_ci		pinctrl-single,drive-strength = <
958c2ecf20Sopenharmony_ci			PINCTRL_DRV_STRENGTH(3, 3)
968c2ecf20Sopenharmony_ci		>;
978c2ecf20Sopenharmony_ci	};
988c2ecf20Sopenharmony_ci};
99