162306a36Sopenharmony_ciNuvoton NPCM7XX Pin Controllers
262306a36Sopenharmony_ci
362306a36Sopenharmony_ciThe Nuvoton BMC NPCM7XX Pin Controller multi-function routed through
462306a36Sopenharmony_cithe multiplexing block, Each pin supports GPIO functionality (GPIOx)
562306a36Sopenharmony_ciand multiple functions that directly connect the pin to different
662306a36Sopenharmony_cihardware blocks.
762306a36Sopenharmony_ci
862306a36Sopenharmony_ciRequired properties:
962306a36Sopenharmony_ci- #address-cells : should be 1.
1062306a36Sopenharmony_ci- #size-cells	 : should be 1.
1162306a36Sopenharmony_ci- compatible	 : "nuvoton,npcm750-pinctrl" for Poleg NPCM7XX.
1262306a36Sopenharmony_ci- ranges	 : defines mapping ranges between pin controller node (parent)
1362306a36Sopenharmony_ci			to GPIO bank node (children).
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci=== GPIO Bank Subnode ===
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ciThe NPCM7XX has 8 GPIO Banks each GPIO bank supports 32 GPIO.
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ciRequired GPIO Bank subnode-properties:
2062306a36Sopenharmony_ci- reg 			: specifies physical base address and size of the GPIO
2162306a36Sopenharmony_ci				bank registers.
2262306a36Sopenharmony_ci- gpio-controller	: Marks the device node as a GPIO controller.
2362306a36Sopenharmony_ci- #gpio-cells		: Must be <2>. The first cell is the gpio pin number
2462306a36Sopenharmony_ci				and the second cell is used for optional parameters.
2562306a36Sopenharmony_ci- interrupts		: contain the GPIO bank interrupt with flags for falling edge.
2662306a36Sopenharmony_ci- gpio-ranges		: defines the range of pins managed by the GPIO bank controller.
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ciFor example, GPIO bank subnodes like the following:
2962306a36Sopenharmony_ci	gpio0: gpio@f0010000 {
3062306a36Sopenharmony_ci		gpio-controller;
3162306a36Sopenharmony_ci		#gpio-cells = <2>;
3262306a36Sopenharmony_ci		reg = <0x0 0x80>;
3362306a36Sopenharmony_ci		interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
3462306a36Sopenharmony_ci		gpio-ranges = <&pinctrl 0 0 32>;
3562306a36Sopenharmony_ci	};
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci=== Pin Mux Subnode ===
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci- pin: A string containing the name of the pin
4062306a36Sopenharmony_ci	An array of strings, each string containing the name of a pin.
4162306a36Sopenharmony_ci	These pin are used for selecting pin configuration.
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ciThe following are the list of pins available:
4462306a36Sopenharmony_ci	"GPIO0/IOX1DI", "GPIO1/IOX1LD",	"GPIO2/IOX1CK", "GPIO3/IOX1D0",
4562306a36Sopenharmony_ci	"GPIO4/IOX2DI/SMB1DSDA", "GPIO5/IOX2LD/SMB1DSCL", "GPIO6/IOX2CK/SMB2DSDA",
4662306a36Sopenharmony_ci	"GPIO7/IOX2D0/SMB2DSCL", "GPIO8/LKGPO1", "GPIO9/LKGPO2", "GPIO10/IOXHLD",
4762306a36Sopenharmony_ci	"GPIO11/IOXHCK", "GPIO12/GSPICK/SMB5BSCL", "GPIO13/GSPIDO/SMB5BSDA",
4862306a36Sopenharmony_ci	"GPIO14/GSPIDI/SMB5CSCL", "GPIO15/GSPICS/SMB5CSDA", "GPIO16/LKGPO0",
4962306a36Sopenharmony_ci	"GPIO17/PSPI2DI/SMB4DEN","GPIO18/PSPI2D0/SMB4BSDA", "GPIO19/PSPI2CK/SMB4BSCL",
5062306a36Sopenharmony_ci	"GPIO20/SMB4CSDA/SMB15SDA", "GPIO21/SMB4CSCL/SMB15SCL", "GPIO22/SMB4DSDA/SMB14SDA",
5162306a36Sopenharmony_ci	"GPIO23/SMB4DSCL/SMB14SCL", "GPIO24/IOXHDO", "GPIO25/IOXHDI", "GPIO26/SMB5SDA",
5262306a36Sopenharmony_ci	"GPIO27/SMB5SCL", "GPIO28/SMB4SDA", "GPIO29/SMB4SCL", "GPIO30/SMB3SDA",
5362306a36Sopenharmony_ci	"GPIO31/SMB3SCL", "GPIO32/nSPI0CS1","SPI0D2", "SPI0D3", "GPIO37/SMB3CSDA",
5462306a36Sopenharmony_ci	"GPIO38/SMB3CSCL", "GPIO39/SMB3BSDA", "GPIO40/SMB3BSCL", "GPIO41/BSPRXD",
5562306a36Sopenharmony_ci	"GPO42/BSPTXD/STRAP11", "GPIO43/RXD1/JTMS2/BU1RXD", "GPIO44/nCTS1/JTDI2/BU1CTS",
5662306a36Sopenharmony_ci	"GPIO45/nDCD1/JTDO2", "GPIO46/nDSR1/JTCK2", "GPIO47/nRI1/JCP_RDY2",
5762306a36Sopenharmony_ci	"GPIO48/TXD2/BSPTXD", "GPIO49/RXD2/BSPRXD", "GPIO50/nCTS2", "GPO51/nRTS2/STRAP2",
5862306a36Sopenharmony_ci	"GPIO52/nDCD2", "GPO53/nDTR2_BOUT2/STRAP1", "GPIO54/nDSR2", "GPIO55/nRI2",
5962306a36Sopenharmony_ci	"GPIO56/R1RXERR", "GPIO57/R1MDC", "GPIO58/R1MDIO", "GPIO59/SMB3DSDA",
6062306a36Sopenharmony_ci	"GPIO60/SMB3DSCL", "GPO61/nDTR1_BOUT1/STRAP6", "GPO62/nRTST1/STRAP5",
6162306a36Sopenharmony_ci	"GPO63/TXD1/STRAP4", "GPIO64/FANIN0", "GPIO65/FANIN1", "GPIO66/FANIN2",
6262306a36Sopenharmony_ci	"GPIO67/FANIN3", "GPIO68/FANIN4", "GPIO69/FANIN5", "GPIO70/FANIN6", "GPIO71/FANIN7",
6362306a36Sopenharmony_ci	"GPIO72/FANIN8", "GPIO73/FANIN9", "GPIO74/FANIN10", "GPIO75/FANIN11",
6462306a36Sopenharmony_ci	"GPIO76/FANIN12", "GPIO77/FANIN13","GPIO78/FANIN14", "GPIO79/FANIN15",
6562306a36Sopenharmony_ci	"GPIO80/PWM0", "GPIO81/PWM1", "GPIO82/PWM2", "GPIO83/PWM3", "GPIO84/R2TXD0",
6662306a36Sopenharmony_ci	"GPIO85/R2TXD1", "GPIO86/R2TXEN", "GPIO87/R2RXD0", "GPIO88/R2RXD1", "GPIO89/R2CRSDV",
6762306a36Sopenharmony_ci	"GPIO90/R2RXERR", "GPIO91/R2MDC", "GPIO92/R2MDIO", "GPIO93/GA20/SMB5DSCL",
6862306a36Sopenharmony_ci	"GPIO94/nKBRST/SMB5DSDA", "GPIO95/nLRESET/nESPIRST", "GPIO96/RG1TXD0",
6962306a36Sopenharmony_ci	"GPIO97/RG1TXD1", "GPIO98/RG1TXD2", "GPIO99/RG1TXD3","GPIO100/RG1TXC",
7062306a36Sopenharmony_ci	"GPIO101/RG1TXCTL", "GPIO102/RG1RXD0", "GPIO103/RG1RXD1", "GPIO104/RG1RXD2",
7162306a36Sopenharmony_ci	"GPIO105/RG1RXD3", "GPIO106/RG1RXC", "GPIO107/RG1RXCTL", "GPIO108/RG1MDC",
7262306a36Sopenharmony_ci	"GPIO109/RG1MDIO", "GPIO110/RG2TXD0/DDRV0", "GPIO111/RG2TXD1/DDRV1",
7362306a36Sopenharmony_ci	"GPIO112/RG2TXD2/DDRV2", "GPIO113/RG2TXD3/DDRV3", "GPIO114/SMB0SCL",
7462306a36Sopenharmony_ci	"GPIO115/SMB0SDA", "GPIO116/SMB1SCL", "GPIO117/SMB1SDA", "GPIO118/SMB2SCL",
7562306a36Sopenharmony_ci	"GPIO119/SMB2SDA", "GPIO120/SMB2CSDA", "GPIO121/SMB2CSCL", "GPIO122/SMB2BSDA",
7662306a36Sopenharmony_ci	"GPIO123/SMB2BSCL", "GPIO124/SMB1CSDA", "GPIO125/SMB1CSCL","GPIO126/SMB1BSDA",
7762306a36Sopenharmony_ci	"GPIO127/SMB1BSCL", "GPIO128/SMB8SCL", "GPIO129/SMB8SDA", "GPIO130/SMB9SCL",
7862306a36Sopenharmony_ci	"GPIO131/SMB9SDA", "GPIO132/SMB10SCL", "GPIO133/SMB10SDA","GPIO134/SMB11SCL",
7962306a36Sopenharmony_ci	"GPIO135/SMB11SDA", "GPIO136/SD1DT0", "GPIO137/SD1DT1", "GPIO138/SD1DT2",
8062306a36Sopenharmony_ci	"GPIO139/SD1DT3", "GPIO140/SD1CLK", "GPIO141/SD1WP", "GPIO142/SD1CMD",
8162306a36Sopenharmony_ci	"GPIO143/SD1CD/SD1PWR", "GPIO144/PWM4",	"GPIO145/PWM5",	"GPIO146/PWM6",
8262306a36Sopenharmony_ci	"GPIO147/PWM7",	"GPIO148/MMCDT4", "GPIO149/MMCDT5", "GPIO150/MMCDT6",
8362306a36Sopenharmony_ci	"GPIO151/MMCDT7", "GPIO152/MMCCLK", "GPIO153/MMCWP", "GPIO154/MMCCMD",
8462306a36Sopenharmony_ci	"GPIO155/nMMCCD/nMMCRST", "GPIO156/MMCDT0", "GPIO157/MMCDT1", "GPIO158/MMCDT2",
8562306a36Sopenharmony_ci	"GPIO159/MMCDT3", "GPIO160/CLKOUT/RNGOSCOUT", "GPIO161/nLFRAME/nESPICS",
8662306a36Sopenharmony_ci	"GPIO162/SERIRQ", "GPIO163/LCLK/ESPICLK", "GPIO164/LAD0/ESPI_IO0",
8762306a36Sopenharmony_ci	"GPIO165/LAD1/ESPI_IO1", "GPIO166/LAD2/ESPI_IO2", "GPIO167/LAD3/ESPI_IO3",
8862306a36Sopenharmony_ci	"GPIO168/nCLKRUN/nESPIALERT", "GPIO169/nSCIPME", "GPIO170/nSMI", "GPIO171/SMB6SCL",
8962306a36Sopenharmony_ci	"GPIO172/SMB6SDA", "GPIO173/SMB7SCL", "GPIO174/SMB7SDA", "GPIO175/PSPI1CK/FANIN19",
9062306a36Sopenharmony_ci	"GPIO176/PSPI1DO/FANIN18", "GPIO177/PSPI1DI/FANIN17", "GPIO178/R1TXD0",
9162306a36Sopenharmony_ci	"GPIO179/R1TXD1", "GPIO180/R1TXEN", "GPIO181/R1RXD0", "GPIO182/R1RXD1",
9262306a36Sopenharmony_ci	"GPIO183/SPI3CK", "GPO184/SPI3D0/STRAP9", "GPO185/SPI3D1/STRAP10",
9362306a36Sopenharmony_ci	"GPIO186/nSPI3CS0", "GPIO187/nSPI3CS1",	"GPIO188/SPI3D2/nSPI3CS2",
9462306a36Sopenharmony_ci	"GPIO189/SPI3D3/nSPI3CS3", "GPIO190/nPRD_SMI", "GPIO191", "GPIO192", "GPIO193/R1CRSDV",
9562306a36Sopenharmony_ci	"GPIO194/SMB0BSCL", "GPIO195/SMB0BSDA", "GPIO196/SMB0CSCL", "GPIO197/SMB0DEN",
9662306a36Sopenharmony_ci	"GPIO198/SMB0DSDA", "GPIO199/SMB0DSCL", "GPIO200/R2CK", "GPIO201/R1CK",
9762306a36Sopenharmony_ci	"GPIO202/SMB0CSDA", "GPIO203/FANIN16", "GPIO204/DDC2SCL", "GPIO205/DDC2SDA",
9862306a36Sopenharmony_ci	"GPIO206/HSYNC2", "GPIO207/VSYNC2", "GPIO208/RG2TXC/DVCK", "GPIO209/RG2TXCTL/DDRV4",
9962306a36Sopenharmony_ci	"GPIO210/RG2RXD0/DDRV5", "GPIO211/RG2RXD1/DDRV6", "GPIO212/RG2RXD2/DDRV7",
10062306a36Sopenharmony_ci	"GPIO213/RG2RXD3/DDRV8", "GPIO214/RG2RXC/DDRV9", "GPIO215/RG2RXCTL/DDRV10",
10162306a36Sopenharmony_ci	"GPIO216/RG2MDC/DDRV11", "GPIO217/RG2MDIO/DVHSYNC", "GPIO218/nWDO1",
10262306a36Sopenharmony_ci	"GPIO219/nWDO2", "GPIO220/SMB12SCL", "GPIO221/SMB12SDA", "GPIO222/SMB13SCL",
10362306a36Sopenharmony_ci	"GPIO223/SMB13SDA", "GPIO224/SPIXCK", "GPO225/SPIXD0/STRAP12", "GPO226/SPIXD1/STRAP13",
10462306a36Sopenharmony_ci	"GPIO227/nSPIXCS0", "GPIO228/nSPIXCS1",	"GPO229/SPIXD2/STRAP3", "GPIO230/SPIXD3",
10562306a36Sopenharmony_ci	"GPIO231/nCLKREQ", "GPI255/DACOSEL"
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ciOptional Properties:
10862306a36Sopenharmony_ci bias-disable, bias-pull-down, bias-pull-up, input-enable,
10962306a36Sopenharmony_ci input-disable, output-high, output-low, drive-push-pull,
11062306a36Sopenharmony_ci drive-open-drain, input-debounce, slew-rate, drive-strength
11162306a36Sopenharmony_ci
11262306a36Sopenharmony_ci slew-rate valid arguments are:
11362306a36Sopenharmony_ci				<0> - slow
11462306a36Sopenharmony_ci				<1> - fast
11562306a36Sopenharmony_ci drive-strength valid arguments are:
11662306a36Sopenharmony_ci				<2> - 2mA
11762306a36Sopenharmony_ci				<4> - 4mA
11862306a36Sopenharmony_ci				<8> - 8mA
11962306a36Sopenharmony_ci				<12> - 12mA
12062306a36Sopenharmony_ci				<16> - 16mA
12162306a36Sopenharmony_ci				<24> - 24mA
12262306a36Sopenharmony_ci
12362306a36Sopenharmony_ciFor example, pinctrl might have pinmux subnodes like the following:
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_ci	gpio0_iox1d1_pin: gpio0-iox1d1-pin {
12662306a36Sopenharmony_ci		pins = "GPIO0/IOX1DI";
12762306a36Sopenharmony_ci		output-high;
12862306a36Sopenharmony_ci	};
12962306a36Sopenharmony_ci	gpio0_iox1ck_pin: gpio0-iox1ck-pin {
13062306a36Sopenharmony_ci		pins = "GPIO2/IOX1CK";
13162306a36Sopenharmony_ci		output_high;
13262306a36Sopenharmony_ci	};
13362306a36Sopenharmony_ci
13462306a36Sopenharmony_ci=== Pin Group Subnode ===
13562306a36Sopenharmony_ci
13662306a36Sopenharmony_ciRequired pin group subnode-properties:
13762306a36Sopenharmony_ci- groups : A string containing the name of the group to mux.
13862306a36Sopenharmony_ci- function: A string containing the name of the function to mux to the
13962306a36Sopenharmony_ci  group.
14062306a36Sopenharmony_ci
14162306a36Sopenharmony_ciThe following are the list of the available groups and functions :
14262306a36Sopenharmony_ci	smb0, smb0b, smb0c, smb0d, smb0den, smb1, smb1b, smb1c, smb1d,
14362306a36Sopenharmony_ci	smb2, smb2b, smb2c, smb2d, smb3, smb3b, smb3c, smb3d, smb4, smb4b,
14462306a36Sopenharmony_ci	smb4c, smb4d, smb4den, smb5, smb5b, smb5c, smb5d, ga20kbc, smb6,
14562306a36Sopenharmony_ci	smb7, smb8, smb9, smb10, smb11, smb12, smb13, smb14, smb15, fanin0,
14662306a36Sopenharmony_ci	fanin1, fanin2, fanin3, fanin4, fanin5, fanin6, fanin7, fanin8,
14762306a36Sopenharmony_ci	fanin9, fanin10, fanin11 fanin12 fanin13, fanin14, fanin15, faninx,
14862306a36Sopenharmony_ci	pwm0, pwm1, pwm2, pwm3, pwm4, pwm5, pwm6, pwm7, rg1, rg1mdio, rg2,
14962306a36Sopenharmony_ci	rg2mdio, ddr, uart1, uart2, bmcuart0a, bmcuart0b, bmcuart1, iox1,
15062306a36Sopenharmony_ci	iox2, ioxh, gspi, mmc, mmcwp, mmccd, mmcrst, mmc8, r1, r1err, r1md,
15162306a36Sopenharmony_ci	r2, r2err, r2md, sd1, sd1pwr, wdog1, wdog2, scipme, sci, serirq,
15262306a36Sopenharmony_ci	jtag2, spix, spixcs1, pspi1, pspi2, ddc, clkreq, clkout, spi3, spi3cs1,
15362306a36Sopenharmony_ci	spi3quad, spi3cs2, spi3cs3, spi0cs1, lpc, lpcclk, espi, lkgpo0, lkgpo1,
15462306a36Sopenharmony_ci	lkgpo2, nprd_smi
15562306a36Sopenharmony_ci
15662306a36Sopenharmony_ciFor example, pinctrl might have group subnodes like the following:
15762306a36Sopenharmony_ci	r1err_pins: r1err-pins {
15862306a36Sopenharmony_ci		groups = "r1err";
15962306a36Sopenharmony_ci		function = "r1err";
16062306a36Sopenharmony_ci	};
16162306a36Sopenharmony_ci	r1md_pins: r1md-pins {
16262306a36Sopenharmony_ci		groups = "r1md";
16362306a36Sopenharmony_ci		function = "r1md";
16462306a36Sopenharmony_ci	};
16562306a36Sopenharmony_ci	r1_pins: r1-pins {
16662306a36Sopenharmony_ci		groups = "r1";
16762306a36Sopenharmony_ci		function = "r1";
16862306a36Sopenharmony_ci	};
16962306a36Sopenharmony_ci
17062306a36Sopenharmony_ciExamples
17162306a36Sopenharmony_ci========
17262306a36Sopenharmony_cipinctrl: pinctrl@f0800000 {
17362306a36Sopenharmony_ci	#address-cells = <1>;
17462306a36Sopenharmony_ci	#size-cells = <1>;
17562306a36Sopenharmony_ci	compatible = "nuvoton,npcm750-pinctrl";
17662306a36Sopenharmony_ci	ranges = <0 0xf0010000 0x8000>;
17762306a36Sopenharmony_ci
17862306a36Sopenharmony_ci	gpio0: gpio@f0010000 {
17962306a36Sopenharmony_ci		gpio-controller;
18062306a36Sopenharmony_ci		#gpio-cells = <2>;
18162306a36Sopenharmony_ci		reg = <0x0 0x80>;
18262306a36Sopenharmony_ci		interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
18362306a36Sopenharmony_ci		gpio-ranges = <&pinctrl 0 0 32>;
18462306a36Sopenharmony_ci	};
18562306a36Sopenharmony_ci
18662306a36Sopenharmony_ci	....
18762306a36Sopenharmony_ci
18862306a36Sopenharmony_ci	gpio7: gpio@f0017000 {
18962306a36Sopenharmony_ci		gpio-controller;
19062306a36Sopenharmony_ci		#gpio-cells = <2>;
19162306a36Sopenharmony_ci		reg = <0x7000 0x80>;
19262306a36Sopenharmony_ci		interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
19362306a36Sopenharmony_ci		gpio-ranges = <&pinctrl 0 224 32>;
19462306a36Sopenharmony_ci	};
19562306a36Sopenharmony_ci
19662306a36Sopenharmony_ci	gpio0_iox1d1_pin: gpio0-iox1d1-pin {
19762306a36Sopenharmony_ci		pins = "GPIO0/IOX1DI";
19862306a36Sopenharmony_ci		output-high;
19962306a36Sopenharmony_ci	};
20062306a36Sopenharmony_ci
20162306a36Sopenharmony_ci	iox1_pins: iox1-pins {
20262306a36Sopenharmony_ci		groups = "iox1";
20362306a36Sopenharmony_ci		function = "iox1";
20462306a36Sopenharmony_ci	};
20562306a36Sopenharmony_ci	iox2_pins: iox2-pins {
20662306a36Sopenharmony_ci		groups = "iox2";
20762306a36Sopenharmony_ci		function = "iox2";
20862306a36Sopenharmony_ci	};
20962306a36Sopenharmony_ci
21062306a36Sopenharmony_ci	....
21162306a36Sopenharmony_ci
21262306a36Sopenharmony_ci	clkreq_pins: clkreq-pins {
21362306a36Sopenharmony_ci		groups = "clkreq";
21462306a36Sopenharmony_ci		function = "clkreq";
21562306a36Sopenharmony_ci	};
21662306a36Sopenharmony_ci};
217