18c2ecf20Sopenharmony_ciNVIDIA Tegra20 pinmux controller
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciRequired properties:
48c2ecf20Sopenharmony_ci- compatible: "nvidia,tegra20-pinmux"
58c2ecf20Sopenharmony_ci- reg: Should contain the register physical address and length for each of
68c2ecf20Sopenharmony_ci  the tri-state, mux, pull-up/down, and pad control register sets.
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ciPlease refer to pinctrl-bindings.txt in this directory for details of the
98c2ecf20Sopenharmony_cicommon pinctrl bindings used by client devices, including the meaning of the
108c2ecf20Sopenharmony_ciphrase "pin configuration node".
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ciTegra's pin configuration nodes act as a container for an arbitrary number of
138c2ecf20Sopenharmony_cisubnodes. Each of these subnodes represents some desired configuration for a
148c2ecf20Sopenharmony_cipin, a group, or a list of pins or groups. This configuration can include the
158c2ecf20Sopenharmony_cimux function to select on those pin(s)/group(s), and various pin configuration
168c2ecf20Sopenharmony_ciparameters, such as pull-up, tristate, drive strength, etc.
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ciThe name of each subnode is not important; all subnodes should be enumerated
198c2ecf20Sopenharmony_ciand processed purely based on their content.
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ciEach subnode only affects those parameters that are explicitly listed. In
228c2ecf20Sopenharmony_ciother words, a subnode that lists a mux function but no pin configuration
238c2ecf20Sopenharmony_ciparameters implies no information about any pin configuration parameters.
248c2ecf20Sopenharmony_ciSimilarly, a pin subnode that describes a pullup parameter implies no
258c2ecf20Sopenharmony_ciinformation about e.g. the mux function or tristate parameter. For this
268c2ecf20Sopenharmony_cireason, even seemingly boolean values are actually tristates in this binding:
278c2ecf20Sopenharmony_ciunspecified, off, or on. Unspecified is represented as an absent property,
288c2ecf20Sopenharmony_ciand off/on are represented as integer values 0 and 1.
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ciRequired subnode-properties:
318c2ecf20Sopenharmony_ci- nvidia,pins : An array of strings. Each string contains the name of a pin or
328c2ecf20Sopenharmony_ci    group. Valid values for these names are listed below.
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ciOptional subnode-properties:
358c2ecf20Sopenharmony_ci- nvidia,function: A string containing the name of the function to mux to the
368c2ecf20Sopenharmony_ci  pin or group. Valid values for function names are listed below. See the Tegra
378c2ecf20Sopenharmony_ci  TRM to determine which are valid for each pin or group.
388c2ecf20Sopenharmony_ci- nvidia,pull: Integer, representing the pull-down/up to apply to the pin.
398c2ecf20Sopenharmony_ci    0: none, 1: down, 2: up.
408c2ecf20Sopenharmony_ci- nvidia,tristate: Integer.
418c2ecf20Sopenharmony_ci    0: drive, 1: tristate.
428c2ecf20Sopenharmony_ci- nvidia,high-speed-mode: Integer. Enable high speed mode the pins.
438c2ecf20Sopenharmony_ci    0: no, 1: yes.
448c2ecf20Sopenharmony_ci- nvidia,schmitt: Integer. Enables Schmitt Trigger on the input.
458c2ecf20Sopenharmony_ci    0: no, 1: yes.
468c2ecf20Sopenharmony_ci- nvidia,low-power-mode: Integer. Valid values 0-3. 0 is least power, 3 is
478c2ecf20Sopenharmony_ci    most power. Controls the drive power or current. See "Low Power Mode"
488c2ecf20Sopenharmony_ci    or "LPMD1" and "LPMD0" in the Tegra TRM.
498c2ecf20Sopenharmony_ci- nvidia,pull-down-strength: Integer. Controls drive strength. 0 is weakest.
508c2ecf20Sopenharmony_ci    The range of valid values depends on the pingroup. See "CAL_DRVDN" in the
518c2ecf20Sopenharmony_ci    Tegra TRM.
528c2ecf20Sopenharmony_ci- nvidia,pull-up-strength: Integer. Controls drive strength. 0 is weakest.
538c2ecf20Sopenharmony_ci    The range of valid values depends on the pingroup. See "CAL_DRVUP" in the
548c2ecf20Sopenharmony_ci    Tegra TRM.
558c2ecf20Sopenharmony_ci- nvidia,slew-rate-rising: Integer. Controls rising signal slew rate. 0 is
568c2ecf20Sopenharmony_ci    fastest. The range of valid values depends on the pingroup. See
578c2ecf20Sopenharmony_ci    "DRVDN_SLWR" in the Tegra TRM.
588c2ecf20Sopenharmony_ci- nvidia,slew-rate-falling: Integer. Controls falling signal slew rate. 0 is
598c2ecf20Sopenharmony_ci    fastest. The range of valid values depends on the pingroup. See
608c2ecf20Sopenharmony_ci    "DRVUP_SLWF" in the Tegra TRM.
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ciNote that many of these properties are only valid for certain specific pins
638c2ecf20Sopenharmony_cior groups. See the Tegra TRM and various pinmux spreadsheets for complete
648c2ecf20Sopenharmony_cidetails regarding which groups support which functionality. The Linux pinctrl
658c2ecf20Sopenharmony_cidriver may also be a useful reference, since it consolidates, disambiguates,
668c2ecf20Sopenharmony_ciand corrects data from all those sources.
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ciValid values for pin and group names are:
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci  mux groups:
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci    These all support nvidia,function, nvidia,tristate, and many support
738c2ecf20Sopenharmony_ci    nvidia,pull.
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci    ata, atb, atc, atd, ate, cdev1, cdev2, crtp, csus, dap1, dap2, dap3, dap4,
768c2ecf20Sopenharmony_ci    ddc, dta, dtb, dtc, dtd, dte, dtf, gma, gmb, gmc, gmd, gme, gpu, gpu7,
778c2ecf20Sopenharmony_ci    gpv, hdint, i2cp, irrx, irtx, kbca, kbcb, kbcc, kbcd, kbce, kbcf, lcsn,
788c2ecf20Sopenharmony_ci    ld0, ld1, ld2, ld3, ld4, ld5, ld6, ld7, ld8, ld9, ld10, ld11, ld12, ld13,
798c2ecf20Sopenharmony_ci    ld14, ld15, ld16, ld17, ldc, ldi, lhp0, lhp1, lhp2, lhs, lm0, lm1, lpp,
808c2ecf20Sopenharmony_ci    lpw0, lpw1, lpw2, lsc0, lsc1, lsck, lsda, lsdi, lspi, lvp0, lvp1, lvs,
818c2ecf20Sopenharmony_ci    owc, pmc, pta, rm, sdb, sdc, sdd, sdio1, slxa, slxc, slxd, slxk, spdi,
828c2ecf20Sopenharmony_ci    spdo, spia, spib, spic, spid, spie, spif, spig, spih, uaa, uab, uac, uad,
838c2ecf20Sopenharmony_ci    uca, ucb, uda.
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci  tristate groups:
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci    These only support nvidia,pull.
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci    ck32, ddrc, pmca, pmcb, pmcc, pmcd, pmce, xm2c, xm2d, ls, lc, ld17_0,
908c2ecf20Sopenharmony_ci    ld19_18, ld21_20, ld23_22.
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci  drive groups:
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci    With some exceptions, these support nvidia,high-speed-mode,
958c2ecf20Sopenharmony_ci    nvidia,schmitt, nvidia,low-power-mode, nvidia,pull-down-strength,
968c2ecf20Sopenharmony_ci    nvidia,pull-up-strength, nvidia,slew-rate-rising, nvidia,slew-rate-falling.
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci    drive_ao1, drive_ao2, drive_at1, drive_at2, drive_cdev1, drive_cdev2,
998c2ecf20Sopenharmony_ci    drive_csus, drive_dap1, drive_dap2, drive_dap3, drive_dap4, drive_dbg,
1008c2ecf20Sopenharmony_ci    drive_lcd1, drive_lcd2, drive_sdmmc2, drive_sdmmc3, drive_spi, drive_uaa,
1018c2ecf20Sopenharmony_ci    drive_uab, drive_uart2, drive_uart3, drive_vi1, drive_vi2, drive_xm2a,
1028c2ecf20Sopenharmony_ci    drive_xm2c, drive_xm2d, drive_xm2clk, drive_sdio1, drive_crt, drive_ddc,
1038c2ecf20Sopenharmony_ci    drive_gma, drive_gmb, drive_gmc, drive_gmd, drive_gme, drive_owr,
1048c2ecf20Sopenharmony_ci    drive_uda.
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ciValid values for nvidia,functions are:
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci  ahb_clk, apb_clk, audio_sync, crt, dap1, dap2, dap3, dap4, dap5,
1098c2ecf20Sopenharmony_ci  displaya, displayb, emc_test0_dll, emc_test1_dll, gmi, gmi_int,
1108c2ecf20Sopenharmony_ci  hdmi, i2cp, i2c1, i2c2, i2c3, ide, irda, kbc, mio, mipi_hs, nand,
1118c2ecf20Sopenharmony_ci  osc, owr, pcie, plla_out, pllc_out1, pllm_out1, pllp_out2, pllp_out3,
1128c2ecf20Sopenharmony_ci  pllp_out4, pwm, pwr_intr, pwr_on, rsvd1, rsvd2, rsvd3, rsvd4, rtck,
1138c2ecf20Sopenharmony_ci  sdio1, sdio2, sdio3, sdio4, sflash, spdif, spi1, spi2, spi2_alt,
1148c2ecf20Sopenharmony_ci  spi3, spi4, trace, twc, uarta, uartb, uartc, uartd, uarte, ulpi,
1158c2ecf20Sopenharmony_ci  vi, vi_sensor_clk, xio
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ciExample:
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci	pinctrl@70000000 {
1208c2ecf20Sopenharmony_ci		compatible = "nvidia,tegra20-pinmux";
1218c2ecf20Sopenharmony_ci		reg = < 0x70000014 0x10    /* Tri-state registers */
1228c2ecf20Sopenharmony_ci			0x70000080 0x20    /* Mux registers */
1238c2ecf20Sopenharmony_ci			0x700000a0 0x14    /* Pull-up/down registers */
1248c2ecf20Sopenharmony_ci			0x70000868 0xa8 >; /* Pad control registers */
1258c2ecf20Sopenharmony_ci	};
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ciExample board file extract:
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci	pinctrl@70000000 {
1308c2ecf20Sopenharmony_ci		sdio4_default: sdio4_default {
1318c2ecf20Sopenharmony_ci			atb {
1328c2ecf20Sopenharmony_ci				nvidia,pins = "atb", "gma", "gme";
1338c2ecf20Sopenharmony_ci				nvidia,function = "sdio4";
1348c2ecf20Sopenharmony_ci				nvidia,pull = <0>;
1358c2ecf20Sopenharmony_ci				nvidia,tristate = <0>;
1368c2ecf20Sopenharmony_ci			};
1378c2ecf20Sopenharmony_ci		};
1388c2ecf20Sopenharmony_ci	};
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ci	sdhci@c8000600 {
1418c2ecf20Sopenharmony_ci		pinctrl-names = "default";
1428c2ecf20Sopenharmony_ci		pinctrl-0 = <&sdio4_default>;
1438c2ecf20Sopenharmony_ci	};
144