Commit 21b49910 authored by Laxman Dewangan's avatar Laxman Dewangan Committed by Thierry Reding

soc/tegra: pmc: Add I/O pad voltage support

I/O pins on Tegra SoCs are grouped into so-called I/O pads. Each such
pad can be used to control the common voltage signal level and power
state of the pins in the given pad.

I/O pads can be powered down even if the system is active, which can
save power from that I/O interface. For SoC generations prior to
Tegra124 the I/O pad voltage is automatically detected and hence the
system software doesn't need to configure it. However, starting with
Tegra210 the detection logic has been removed, so explicit control of
the I/O pad voltage by system software is required.
Signed-off-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 95b780b3
This diff is collapsed.
...@@ -76,37 +76,73 @@ int tegra_pmc_cpu_remove_clamping(unsigned int cpuid); ...@@ -76,37 +76,73 @@ int tegra_pmc_cpu_remove_clamping(unsigned int cpuid);
#define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D
#define TEGRA_IO_RAIL_CSIA 0 /**
#define TEGRA_IO_RAIL_CSIB 1 * enum tegra_io_pad - I/O pad group identifier
#define TEGRA_IO_RAIL_DSI 2 *
#define TEGRA_IO_RAIL_MIPI_BIAS 3 * I/O pins on Tegra SoCs are grouped into so-called I/O pads. Each such pad
#define TEGRA_IO_RAIL_PEX_BIAS 4 * can be used to control the common voltage signal level and power state of
#define TEGRA_IO_RAIL_PEX_CLK1 5 * the pins of the given pad.
#define TEGRA_IO_RAIL_PEX_CLK2 6 */
#define TEGRA_IO_RAIL_USB0 9 enum tegra_io_pad {
#define TEGRA_IO_RAIL_USB1 10 TEGRA_IO_PAD_AUDIO,
#define TEGRA_IO_RAIL_USB2 11 TEGRA_IO_PAD_AUDIO_HV,
#define TEGRA_IO_RAIL_USB_BIAS 12 TEGRA_IO_PAD_BB,
#define TEGRA_IO_RAIL_NAND 13 TEGRA_IO_PAD_CAM,
#define TEGRA_IO_RAIL_UART 14 TEGRA_IO_PAD_COMP,
#define TEGRA_IO_RAIL_BB 15 TEGRA_IO_PAD_CSIA,
#define TEGRA_IO_RAIL_AUDIO 17 TEGRA_IO_PAD_CSIB,
#define TEGRA_IO_RAIL_HSIC 19 TEGRA_IO_PAD_CSIC,
#define TEGRA_IO_RAIL_COMP 22 TEGRA_IO_PAD_CSID,
#define TEGRA_IO_RAIL_HDMI 28 TEGRA_IO_PAD_CSIE,
#define TEGRA_IO_RAIL_PEX_CNTRL 32 TEGRA_IO_PAD_CSIF,
#define TEGRA_IO_RAIL_SDMMC1 33 TEGRA_IO_PAD_DBG,
#define TEGRA_IO_RAIL_SDMMC3 34 TEGRA_IO_PAD_DEBUG_NONAO,
#define TEGRA_IO_RAIL_SDMMC4 35 TEGRA_IO_PAD_DMIC,
#define TEGRA_IO_RAIL_CAM 36 TEGRA_IO_PAD_DP,
#define TEGRA_IO_RAIL_RES 37 TEGRA_IO_PAD_DSI,
#define TEGRA_IO_RAIL_HV 38 TEGRA_IO_PAD_DSIB,
#define TEGRA_IO_RAIL_DSIB 39 TEGRA_IO_PAD_DSIC,
#define TEGRA_IO_RAIL_DSIC 40 TEGRA_IO_PAD_DSID,
#define TEGRA_IO_RAIL_DSID 41 TEGRA_IO_PAD_EMMC,
#define TEGRA_IO_RAIL_CSIE 44 TEGRA_IO_PAD_EMMC2,
#define TEGRA_IO_RAIL_LVDS 57 TEGRA_IO_PAD_GPIO,
#define TEGRA_IO_RAIL_SYS_DDC 58 TEGRA_IO_PAD_HDMI,
TEGRA_IO_PAD_HSIC,
TEGRA_IO_PAD_HV,
TEGRA_IO_PAD_LVDS,
TEGRA_IO_PAD_MIPI_BIAS,
TEGRA_IO_PAD_NAND,
TEGRA_IO_PAD_PEX_BIAS,
TEGRA_IO_PAD_PEX_CLK1,
TEGRA_IO_PAD_PEX_CLK2,
TEGRA_IO_PAD_PEX_CNTRL,
TEGRA_IO_PAD_SDMMC1,
TEGRA_IO_PAD_SDMMC3,
TEGRA_IO_PAD_SDMMC4,
TEGRA_IO_PAD_SPI,
TEGRA_IO_PAD_SPI_HV,
TEGRA_IO_PAD_SYS_DDC,
TEGRA_IO_PAD_UART,
TEGRA_IO_PAD_USB0,
TEGRA_IO_PAD_USB1,
TEGRA_IO_PAD_USB2,
TEGRA_IO_PAD_USB3,
TEGRA_IO_PAD_USB_BIAS,
};
/* deprecated, use TEGRA_IO_PAD_{HDMI,LVDS} instead */
#define TEGRA_IO_RAIL_HDMI TEGRA_IO_PAD_HDMI
#define TEGRA_IO_RAIL_LVDS TEGRA_IO_PAD_LVDS
/**
* enum tegra_io_pad_voltage - voltage level of the I/O pad's source rail
* @TEGRA_IO_PAD_1800000UV: 1.8 V
* @TEGRA_IO_PAD_3300000UV: 3.3 V
*/
enum tegra_io_pad_voltage {
TEGRA_IO_PAD_1800000UV,
TEGRA_IO_PAD_3300000UV,
};
#ifdef CONFIG_ARCH_TEGRA #ifdef CONFIG_ARCH_TEGRA
int tegra_powergate_is_powered(unsigned int id); int tegra_powergate_is_powered(unsigned int id);
...@@ -118,6 +154,13 @@ int tegra_powergate_remove_clamping(unsigned int id); ...@@ -118,6 +154,13 @@ int tegra_powergate_remove_clamping(unsigned int id);
int tegra_powergate_sequence_power_up(unsigned int id, struct clk *clk, int tegra_powergate_sequence_power_up(unsigned int id, struct clk *clk,
struct reset_control *rst); struct reset_control *rst);
int tegra_io_pad_power_enable(enum tegra_io_pad id);
int tegra_io_pad_power_disable(enum tegra_io_pad id);
int tegra_io_pad_set_voltage(enum tegra_io_pad id,
enum tegra_io_pad_voltage voltage);
int tegra_io_pad_get_voltage(enum tegra_io_pad id);
/* deprecated, use tegra_io_pad_power_{enable,disable}() instead */
int tegra_io_rail_power_on(unsigned int id); int tegra_io_rail_power_on(unsigned int id);
int tegra_io_rail_power_off(unsigned int id); int tegra_io_rail_power_off(unsigned int id);
#else #else
...@@ -148,6 +191,27 @@ static inline int tegra_powergate_sequence_power_up(unsigned int id, ...@@ -148,6 +191,27 @@ static inline int tegra_powergate_sequence_power_up(unsigned int id,
return -ENOSYS; return -ENOSYS;
} }
static inline int tegra_io_pad_power_enable(enum tegra_io_pad id)
{
return -ENOSYS;
}
static inline int tegra_io_pad_power_disable(enum tegra_io_pad id)
{
return -ENOSYS;
}
static inline int tegra_io_pad_set_voltage(enum tegra_io_pad id,
enum tegra_io_pad_voltage voltage)
{
return -ENOSYS;
}
static inline int tegra_io_pad_get_voltage(enum tegra_io_pad id)
{
return -ENOSYS;
}
static inline int tegra_io_rail_power_on(unsigned int id) static inline int tegra_io_rail_power_on(unsigned int id)
{ {
return -ENOSYS; return -ENOSYS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment