|
201 | 201 | #define TEGRA_SMC_PMC_READ 0xaa |
202 | 202 | #define TEGRA_SMC_PMC_WRITE 0xbb |
203 | 203 |
|
| 204 | +/* Tegra264 and later */ |
| 205 | +#define PMC_IMPL_SDMMC1_HV_PADCTL_0 0x41004 |
| 206 | + |
204 | 207 | struct pmc_clk { |
205 | 208 | struct clk_hw hw; |
206 | 209 | struct tegra_pmc *pmc; |
@@ -301,6 +304,7 @@ struct tegra_io_pad_vctrl { |
301 | 304 | enum tegra_io_pad id; |
302 | 305 | unsigned int offset; |
303 | 306 | unsigned int ena_3v3; |
| 307 | + unsigned int ena_1v8; |
304 | 308 | }; |
305 | 309 |
|
306 | 310 | struct tegra_pmc_regs { |
@@ -1931,11 +1935,18 @@ static int tegra_io_pad_set_voltage(struct tegra_pmc *pmc, enum tegra_io_pad id, |
1931 | 1935 |
|
1932 | 1936 | value = tegra_pmc_readl(pmc, pad->offset); |
1933 | 1937 |
|
1934 | | - if (voltage == TEGRA_IO_PAD_VOLTAGE_1V8) |
| 1938 | + if (voltage == TEGRA_IO_PAD_VOLTAGE_1V8) { |
1935 | 1939 | value &= ~BIT(pad->ena_3v3); |
1936 | | - else |
| 1940 | + |
| 1941 | + if (pad->ena_1v8) |
| 1942 | + value |= pad->ena_1v8; |
| 1943 | + } else { |
1937 | 1944 | value |= BIT(pad->ena_3v3); |
1938 | 1945 |
|
| 1946 | + if (pad->ena_1v8) |
| 1947 | + value &= ~pad->ena_1v8; |
| 1948 | + } |
| 1949 | + |
1939 | 1950 | tegra_pmc_writel(pmc, value, pad->offset); |
1940 | 1951 |
|
1941 | 1952 | mutex_unlock(&pmc->powergates_lock); |
@@ -3724,6 +3735,7 @@ static const u8 tegra124_cpu_powergates[] = { |
3724 | 3735 | .id = (_id), \ |
3725 | 3736 | .offset = (_offset), \ |
3726 | 3737 | .ena_3v3 = (_ena_3v3), \ |
| 3738 | + .ena_1v8 = 0, \ |
3727 | 3739 | }) |
3728 | 3740 |
|
3729 | 3741 | #define TEGRA_IO_PIN_DESC(_id, _name) \ |
@@ -4583,6 +4595,50 @@ static const struct tegra_pmc_soc tegra234_pmc_soc = { |
4583 | 4595 | .has_single_mmio_aperture = false, |
4584 | 4596 | }; |
4585 | 4597 |
|
| 4598 | +#define TEGRA264_IO_PAD_VCTRL(_id, _offset, _ena_3v3, _ena_1v8) \ |
| 4599 | + ((struct tegra_io_pad_vctrl) { \ |
| 4600 | + .id = (_id), \ |
| 4601 | + .offset = (_offset), \ |
| 4602 | + .ena_3v3 = (_ena_3v3), \ |
| 4603 | + .ena_1v8 = (_ena_1v8), \ |
| 4604 | + }) |
| 4605 | + |
| 4606 | +static const struct tegra_io_pad_soc tegra264_io_pads[] = { |
| 4607 | + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIA, 0, 0x41020, 0x41024, "csia"), |
| 4608 | + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIB, 1, 0x41020, 0x41024, "csib"), |
| 4609 | + TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI_DP0, 0, 0x41050, 0x41054, "hdmi-dp0"), |
| 4610 | + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIC, 2, 0x41020, 0x41024, "csic"), |
| 4611 | + TEGRA_IO_PAD(TEGRA_IO_PAD_CSID, 3, 0x41020, 0x41024, "csid"), |
| 4612 | + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIE, 4, 0x41020, 0x41024, "csie"), |
| 4613 | + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIF, 5, 0x41020, 0x41024, "csif"), |
| 4614 | + TEGRA_IO_PAD(TEGRA_IO_PAD_UFS, 4, 0x41040, 0x41044, "ufs0"), |
| 4615 | + TEGRA_IO_PAD(TEGRA_IO_PAD_EDP, 0, 0x41028, 0x4102c, "edp"), |
| 4616 | + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC1, 0, 0x41090, 0x41094, "sdmmc1"), |
| 4617 | + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC1_HV, UINT_MAX, UINT_MAX, UINT_MAX, "sdmmc1-hv"), |
| 4618 | + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIG, 6, 0x41020, 0x41024, "csig"), |
| 4619 | + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIH, 7, 0x41020, 0x41024, "csih"), |
| 4620 | +}; |
| 4621 | + |
| 4622 | +static const struct tegra_io_pad_vctrl tegra264_io_pad_vctrls[] = { |
| 4623 | + TEGRA264_IO_PAD_VCTRL(TEGRA_IO_PAD_SDMMC1_HV, PMC_IMPL_SDMMC1_HV_PADCTL_0, 0, 0x6), |
| 4624 | +}; |
| 4625 | + |
| 4626 | +static const struct pinctrl_pin_desc tegra264_pin_descs[] = { |
| 4627 | + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_CSIA, "csia"), |
| 4628 | + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_CSIB, "csib"), |
| 4629 | + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_HDMI_DP0, "hdmi-dp0"), |
| 4630 | + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_CSIC, "csic"), |
| 4631 | + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_CSID, "csid"), |
| 4632 | + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_CSIE, "csie"), |
| 4633 | + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_CSIF, "csif"), |
| 4634 | + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_UFS, "ufs0"), |
| 4635 | + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_EDP, "edp"), |
| 4636 | + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_SDMMC1, "sdmmc1"), |
| 4637 | + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_SDMMC1_HV, "sdmmc1-hv"), |
| 4638 | + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_CSIG, "csig"), |
| 4639 | + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_CSIH, "csih"), |
| 4640 | +}; |
| 4641 | + |
4586 | 4642 | static const struct tegra_pmc_regs tegra264_pmc_regs = { |
4587 | 4643 | .scratch0 = 0x684, |
4588 | 4644 | .rst_status = 0x4, |
@@ -4705,6 +4761,12 @@ static const struct tegra_wake_event tegra264_wake_events[] = { |
4705 | 4761 |
|
4706 | 4762 | static const struct tegra_pmc_soc tegra264_pmc_soc = { |
4707 | 4763 | .has_io_pad_wren = false, |
| 4764 | + .num_io_pads = ARRAY_SIZE(tegra264_io_pads), |
| 4765 | + .io_pads = tegra264_io_pads, |
| 4766 | + .num_io_pad_vctrls = ARRAY_SIZE(tegra264_io_pad_vctrls), |
| 4767 | + .io_pad_vctrls = tegra264_io_pad_vctrls, |
| 4768 | + .num_pin_descs = ARRAY_SIZE(tegra264_pin_descs), |
| 4769 | + .pin_descs = tegra264_pin_descs, |
4708 | 4770 | .regs = &tegra264_pmc_regs, |
4709 | 4771 | .init = tegra186_pmc_init, |
4710 | 4772 | .setup_irq_polarity = tegra186_pmc_setup_irq_polarity, |
|
0 commit comments