Lines Matching +full:tegra210 +full:- +full:qspi
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
78 {"nvidia,tegra210-pinmux", 1},
109 {"nvidia,enable-input", PROP_ID_ENABLE_INPUT},
110 {"nvidia,open-drain", PROP_ID_OPEN_DRAIN},
112 {"nvidia,io-reset", PROP_ID_IORESET},
113 {"nvidia,rcv-sel", PROP_ID_RCV_SEL},
114 {"nvidia,io-hv", PROP_ID_RCV_SEL},
115 {"nvidia,high-speed-mode", PROP_ID_HIGH_SPEED_MODE},
117 {"nvidia,low-power-mode", PROP_ID_LOW_POWER_MODE},
118 {"nvidia,pull-down-strength", PROP_ID_DRIVE_DOWN_STRENGTH},
119 {"nvidia,pull-up-strength", PROP_ID_DRIVE_UP_STRENGTH},
120 {"nvidia,slew-rate-falling", PROP_ID_SLEW_RATE_FALLING},
121 {"nvidia,slew-rate-rising", PROP_ID_SLEW_RATE_RISING},
122 {"nvidia,drive-type", PROP_ID_DRIVE_TYPE},
177 .reg = r - 0x8D4, \
179 .drvdn_mask = (1 << dn_w) - 1, \
181 .drvup_mask = (1 << up_w) - 1, \
229 .grp.reg = gr - 0x8D4, \
231 .grp.drvdn_mask = (1 << dn_w) - 1, \
233 .grp.drvup_mask = (1 << up_w) - 1, \
240 .gpio_num = -1, \
243 .grp.reg = gr - 0x8D4, \
245 .grp.drvdn_mask = (1 << dn_w) - 1, \
247 .grp.drvup_mask = (1 << up_w) - 1, \
251 GMUX(0x000, M, 0, sdmmc1_clk_pm0, sdmmc1, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
252 GMUX(0x004, M, 1, sdmmc1_cmd_pm1, sdmmc1, spi3, rsvd2, rsvd3, -1, 0, 0, 0, 0),
253 GMUX(0x008, M, 2, sdmmc1_dat3_pm2, sdmmc1, spi3, rsvd2, rsvd3, -1, 0, 0, 0, 0),
254 GMUX(0x00c, M, 3, sdmmc1_dat2_pm3, sdmmc1, spi3, rsvd2, rsvd3, -1, 0, 0, 0, 0),
255 GMUX(0x010, M, 4, sdmmc1_dat1_pm4, sdmmc1, spi3, rsvd2, rsvd3, -1, 0, 0, 0, 0),
256 GMUX(0x014, M, 5, sdmmc1_dat0_pm5, sdmmc1, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
257 GMUX(0x01c, P, 0, sdmmc3_clk_pp0, sdmmc3, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
258 GMUX(0x020, P, 1, sdmmc3_cmd_pp1, sdmmc3, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
259 GMUX(0x024, P, 5, sdmmc3_dat0_pp5, sdmmc3, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
260 GMUX(0x028, P, 4, sdmmc3_dat1_pp4, sdmmc3, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
261 GMUX(0x02c, P, 3, sdmmc3_dat2_pp3, sdmmc3, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
262 GMUX(0x030, P, 2, sdmmc3_dat3_pp2, sdmmc3, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
283 GMUX(0x088, EE, 0, qspi_sck_pee0, qspi, rsvd1, rsvd2, rsvd3, 0xa90, 0, 0, 0, 0),
284 GMUX(0x08c, EE, 1, qspi_cs_n_pee1, qspi, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
285 GMUX(0x090, EE, 2, qspi_io0_pee2, qspi, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
286 GMUX(0x094, EE, 3, qspi_io1_pee3, qspi, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
287 GMUX(0x098, EE, 4, qspi_io2_pee4, qspi, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
288 GMUX(0x09c, EE, 5, qspi_io3_pee5, qspi, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
349 GMUX(0x194, CC, 7, pcc7, rsvd0, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
393 GMUX(0x244, A, 6, pa6, sata, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
394 GMUX(0x248, E, 6, pe6, rsvd0, i2s5a, pwm2, rsvd3, -1, 0, 0, 0, 0),
395 GMUX(0x24c, E, 7, pe7, rsvd0, i2s5a, pwm3, rsvd3, -1, 0, 0, 0, 0),
396 GMUX(0x250, H, 6, ph6, rsvd0, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
397 GMUX(0x254, K, 0, pk0, iqc0, i2s5b, rsvd2, rsvd3, -1, 0, 0, 0, 0),
398 GMUX(0x258, K, 1, pk1, iqc0, i2s5b, rsvd2, rsvd3, -1, 0, 0, 0, 0),
399 GMUX(0x25c, K, 2, pk2, iqc0, i2s5b, rsvd2, rsvd3, -1, 0, 0, 0, 0),
400 GMUX(0x260, K, 3, pk3, iqc0, i2s5b, rsvd2, rsvd3, -1, 0, 0, 0, 0),
401 GMUX(0x264, K, 4, pk4, iqc1, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
402 GMUX(0x268, K, 5, pk5, iqc1, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
403 GMUX(0x26c, K, 6, pk6, iqc1, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
404 GMUX(0x270, K, 7, pk7, iqc1, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
405 GMUX(0x274, L, 0, pl0, rsvd0, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
406 GMUX(0x278, L, 1, pl1, soc, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
407 GMUX(0x27c, Z, 0, pz0, vimclk2, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
408 GMUX(0x280, Z, 1, pz1, vimclk2, sdmmc1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
409 GMUX(0x284, Z, 2, pz2, sdmmc3, ccla, rsvd2, rsvd3, -1, 0, 0, 0, 0),
410 GMUX(0x288, Z, 3, pz3, sdmmc3, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
411 GMUX(0x28c, Z, 4, pz4, sdmmc1, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
412 GMUX(0x290, Z, 5, pz5, soc, rsvd1, rsvd2, rsvd3, -1, 0, 0, 0, 0),
446 if (strcmp(fnc_name, mux->functions[i]) == 0) in pinmux_mux_function()
449 return (-1); in pinmux_mux_function()
459 reg = bus_read_4(sc->mux_mem_res, mux->reg); in pinmux_config_mux()
461 if (cfg->function != NULL) { in pinmux_config_mux()
462 tmp = pinmux_mux_function(mux, cfg->function); in pinmux_config_mux()
463 if (tmp == -1) { in pinmux_config_mux()
464 device_printf(sc->dev, in pinmux_config_mux()
465 "Unknown function %s for pin %s\n", cfg->function, in pinmux_config_mux()
473 if (cfg->params[PROP_ID_PULL] != -1) { in pinmux_config_mux()
475 reg |= (cfg->params[PROP_ID_PULL] & TEGRA_MUX_PUPD_MASK) << in pinmux_config_mux()
478 if (cfg->params[PROP_ID_TRISTATE] != -1) { in pinmux_config_mux()
480 reg |= (cfg->params[PROP_ID_TRISTATE] & 1) << in pinmux_config_mux()
483 if (cfg->params[TEGRA_MUX_ENABLE_INPUT_SHIFT] != -1) { in pinmux_config_mux()
485 reg |= (cfg->params[TEGRA_MUX_ENABLE_INPUT_SHIFT] & 1) << in pinmux_config_mux()
488 if (cfg->params[PROP_ID_ENABLE_INPUT] != -1) { in pinmux_config_mux()
490 reg |= (cfg->params[PROP_ID_ENABLE_INPUT] & 1) << in pinmux_config_mux()
493 if (cfg->params[PROP_ID_ENABLE_INPUT] != -1) { in pinmux_config_mux()
495 reg |= (cfg->params[PROP_ID_OPEN_DRAIN] & 1) << in pinmux_config_mux()
498 if (cfg->params[PROP_ID_LOCK] != -1) { in pinmux_config_mux()
500 reg |= (cfg->params[PROP_ID_LOCK] & 1) << in pinmux_config_mux()
503 if (cfg->params[PROP_ID_IORESET] != -1) { in pinmux_config_mux()
505 reg |= (cfg->params[PROP_ID_IORESET] & 1) << in pinmux_config_mux()
508 if (cfg->params[PROP_ID_RCV_SEL] != -1) { in pinmux_config_mux()
510 reg |= (cfg->params[PROP_ID_RCV_SEL] & 1) << in pinmux_config_mux()
513 bus_write_4(sc->mux_mem_res, mux->reg, reg); in pinmux_config_mux()
523 reg = bus_read_4(sc->pad_mem_res, grp->reg); in pinmux_config_grp()
525 if (cfg->params[PROP_ID_HIGH_SPEED_MODE] != -1) { in pinmux_config_grp()
527 reg |= (cfg->params[PROP_ID_HIGH_SPEED_MODE] & 1) << in pinmux_config_grp()
530 if (cfg->params[PROP_ID_SCHMITT] != -1) { in pinmux_config_grp()
532 reg |= (cfg->params[PROP_ID_SCHMITT] & 1) << in pinmux_config_grp()
535 if (cfg->params[PROP_ID_DRIVE_TYPE] != -1) { in pinmux_config_grp()
537 reg |= (cfg->params[PROP_ID_DRIVE_TYPE] & in pinmux_config_grp()
540 if (cfg->params[PROP_ID_SLEW_RATE_RISING] != -1) { in pinmux_config_grp()
543 reg |= (cfg->params[PROP_ID_SLEW_RATE_RISING] & in pinmux_config_grp()
547 if (cfg->params[PROP_ID_SLEW_RATE_FALLING] != -1) { in pinmux_config_grp()
550 reg |= (cfg->params[PROP_ID_SLEW_RATE_FALLING] & in pinmux_config_grp()
554 if ((cfg->params[PROP_ID_DRIVE_DOWN_STRENGTH] != -1) && in pinmux_config_grp()
555 (grp->drvdn_mask != 0)) { in pinmux_config_grp()
556 reg &= ~(grp->drvdn_shift << grp->drvdn_mask); in pinmux_config_grp()
557 reg |= (cfg->params[PROP_ID_DRIVE_DOWN_STRENGTH] & in pinmux_config_grp()
558 grp->drvdn_mask) << grp->drvdn_shift; in pinmux_config_grp()
560 if ((cfg->params[PROP_ID_DRIVE_UP_STRENGTH] != -1) && in pinmux_config_grp()
561 (grp->drvup_mask != 0)) { in pinmux_config_grp()
562 reg &= ~(grp->drvup_shift << grp->drvup_mask); in pinmux_config_grp()
563 reg |= (cfg->params[PROP_ID_DRIVE_UP_STRENGTH] & in pinmux_config_grp()
564 grp->drvup_mask) << grp->drvup_shift; in pinmux_config_grp()
566 bus_write_4(sc->pad_mem_res, grp->reg, reg); in pinmux_config_grp()
582 if (mux->gpio_num != -1) { in pinmux_config_node()
588 if (mux->grp.reg <= 0) { in pinmux_config_node()
589 rv = pinmux_config_grp(sc, pin_name, &mux->grp, cfg); in pinmux_config_node()
605 device_printf(sc->dev, "Unknown pin: %s\n", pin_name); in pinmux_config_node()
622 rv = OF_getprop_alloc(node, "nvidia,function", (void **)&cfg->function); in pinmux_read_node()
624 cfg->function = NULL; in pinmux_read_node()
628 rv = OF_getencprop(node, prop_names[i].name, &cfg->params[i], in pinmux_read_node()
629 sizeof(cfg->params[i])); in pinmux_read_node()
631 cfg->params[i] = -1; in pinmux_read_node()
653 device_printf(sc->dev, "Cannot configure pin: %s: %d\n", in pinmux_process_node()
690 if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) in pinmux_probe()
712 sc->dev = dev; in pinmux_attach()
715 sc->pad_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, in pinmux_attach()
717 if (sc->pad_mem_res == NULL) { in pinmux_attach()
723 sc->mux_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, in pinmux_attach()
725 if (sc->mux_mem_res == NULL) { in pinmux_attach()