Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'tegra-for-7.1-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers

soc/tegra: Changes for v7.1-rc1

A number of fixes went into this for the PMC and CBB drivers. The PMC
driver also gains support for Tegra264 and a Kconfig symbol for the
upcoming Tegra238 is added. The various per-generation Kconfig symbols
are now also enabled by default for ARCH_TEGRA in order to reduce the
number of configuration options that need to be explicitly enabled.

* tag 'tegra-for-7.1-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
MAINTAINERS: Change email address for Thierry Reding
soc/tegra: pmc: Add IO pads for Tegra264
soc/tegra: pmc: Rename has_impl_33v_pwr flag
soc/tegra: pmc: Refactor IO pad voltage control
soc/tegra: pmc: Add Tegra264 wake events
soc/tegra: pmc: Add AOWAKE regs for Tegra264
soc/tegra: pmc: Add support for SoC specific AOWAKE offsets
soc/tegra: pmc: Remove unused AOWAKE definitions
soc/tegra: pmc: Add kerneldoc for wake-up variables
soc/tegra: pmc: Correct function names in kerneldoc
soc/tegra: pmc: Add kerneldoc for reboot notifier
soc/tegra: common: Add Tegra114 support to devm_tegra_core_dev_init_opp_table
soc/tegra: pmc: Enable core domain support for Tegra114
soc/tegra: cbb: Fix cross-fabric target timeout lookup
soc/tegra: cbb: Fix incorrect ARRAY_SIZE in fabric lookup tables
soc/tegra: cbb: Set ERD on resume for err interrupt
soc/tegra: cbb: Add support for CBB fabrics in Tegra238
soc/tegra: Add Tegra238 Kconfig symbol
soc/tegra: Make ARCH_TEGRA_SOC_FOO defaults for NVIDIA Tegra

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+614 -262
+7 -7
MAINTAINERS
··· 8649 8649 F: drivers/phy/mediatek/phy-mtk-mipi* 8650 8650 8651 8651 DRM DRIVERS FOR NVIDIA TEGRA 8652 - M: Thierry Reding <thierry.reding@gmail.com> 8652 + M: Thierry Reding <thierry.reding@kernel.org> 8653 8653 M: Mikko Perttunen <mperttunen@nvidia.com> 8654 8654 L: dri-devel@lists.freedesktop.org 8655 8655 L: linux-tegra@vger.kernel.org ··· 20247 20247 F: drivers/pci/controller/*mvebu* 20248 20248 20249 20249 PCI DRIVER FOR NVIDIA TEGRA 20250 - M: Thierry Reding <thierry.reding@gmail.com> 20250 + M: Thierry Reding <thierry.reding@kernel.org> 20251 20251 L: linux-tegra@vger.kernel.org 20252 20252 L: linux-pci@vger.kernel.org 20253 20253 S: Supported ··· 25951 25951 F: include/uapi/linux/tee.h 25952 25952 25953 25953 TEGRA ARCHITECTURE SUPPORT 25954 - M: Thierry Reding <thierry.reding@gmail.com> 25954 + M: Thierry Reding <thierry.reding@kernel.org> 25955 25955 M: Jonathan Hunter <jonathanh@nvidia.com> 25956 25956 L: linux-tegra@vger.kernel.org 25957 25957 S: Supported ··· 25983 25983 F: drivers/i2c/busses/i2c-tegra.c 25984 25984 25985 25985 TEGRA IOMMU DRIVERS 25986 - M: Thierry Reding <thierry.reding@gmail.com> 25986 + M: Thierry Reding <thierry.reding@kernel.org> 25987 25987 R: Krishna Reddy <vdumpa@nvidia.com> 25988 25988 L: linux-tegra@vger.kernel.org 25989 25989 S: Supported ··· 26004 26004 F: drivers/mtd/nand/raw/tegra_nand.c 26005 26005 26006 26006 TEGRA PWM DRIVER 26007 - M: Thierry Reding <thierry.reding@gmail.com> 26007 + M: Thierry Reding <thierry.reding@kernel.org> 26008 26008 S: Supported 26009 26009 F: drivers/pwm/pwm-tegra.c 26010 26010 26011 26011 TEGRA QUAD SPI DRIVER 26012 - M: Thierry Reding <thierry.reding@gmail.com> 26012 + M: Thierry Reding <thierry.reding@kernel.org> 26013 26013 M: Jonathan Hunter <jonathanh@nvidia.com> 26014 26014 M: Sowjanya Komatineni <skomatineni@nvidia.com> 26015 26015 L: linux-tegra@vger.kernel.org ··· 26027 26027 F: drivers/spi/spi-tegra* 26028 26028 26029 26029 TEGRA VIDEO DRIVER 26030 - M: Thierry Reding <thierry.reding@gmail.com> 26030 + M: Thierry Reding <thierry.reding@kernel.org> 26031 26031 M: Jonathan Hunter <jonathanh@nvidia.com> 26032 26032 M: Sowjanya Komatineni <skomatineni@nvidia.com> 26033 26033 M: Luca Ceresoli <luca.ceresoli@bootlin.com>
+20
drivers/soc/tegra/Kconfig
··· 6 6 7 7 config ARCH_TEGRA_2x_SOC 8 8 bool "Enable support for Tegra20 family" 9 + default ARCH_TEGRA 9 10 select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP 10 11 select ARM_ERRATA_720789 11 12 select ARM_ERRATA_754327 if SMP ··· 24 23 25 24 config ARCH_TEGRA_3x_SOC 26 25 bool "Enable support for Tegra30 family" 26 + default ARCH_TEGRA 27 27 select ARM_ERRATA_754322 28 28 select ARM_ERRATA_764369 if SMP 29 29 select PINCTRL_TEGRA30 ··· 39 37 40 38 config ARCH_TEGRA_114_SOC 41 39 bool "Enable support for Tegra114 family" 40 + default ARCH_TEGRA 42 41 select ARM_ERRATA_798181 if SMP 43 42 select HAVE_ARM_ARCH_TIMER 44 43 select PINCTRL_TEGRA114 ··· 52 49 53 50 config ARCH_TEGRA_124_SOC 54 51 bool "Enable support for Tegra124 family" 52 + default ARCH_TEGRA 55 53 select HAVE_ARM_ARCH_TIMER 56 54 select PINCTRL_TEGRA124 57 55 select SOC_TEGRA_FLOWCTRL ··· 69 65 70 66 config ARCH_TEGRA_132_SOC 71 67 bool "NVIDIA Tegra132 SoC" 68 + default ARCH_TEGRA 72 69 select PINCTRL_TEGRA124 73 70 select SOC_TEGRA_FLOWCTRL 74 71 select SOC_TEGRA_PMC ··· 81 76 82 77 config ARCH_TEGRA_210_SOC 83 78 bool "NVIDIA Tegra210 SoC" 79 + default ARCH_TEGRA 84 80 select PINCTRL_TEGRA210 85 81 select SOC_TEGRA_FLOWCTRL 86 82 select SOC_TEGRA_PMC ··· 101 95 102 96 config ARCH_TEGRA_186_SOC 103 97 bool "NVIDIA Tegra186 SoC" 98 + default ARCH_TEGRA 104 99 depends on !CPU_BIG_ENDIAN 105 100 select PINCTRL_TEGRA186 106 101 select MAILBOX ··· 116 109 117 110 config ARCH_TEGRA_194_SOC 118 111 bool "NVIDIA Tegra194 SoC" 112 + default ARCH_TEGRA 119 113 depends on !CPU_BIG_ENDIAN 120 114 select MAILBOX 121 115 select PINCTRL_TEGRA194 ··· 126 118 127 119 config ARCH_TEGRA_234_SOC 128 120 bool "NVIDIA Tegra234 SoC" 121 + default ARCH_TEGRA 129 122 depends on !CPU_BIG_ENDIAN 130 123 select MAILBOX 131 124 select PINCTRL_TEGRA234 ··· 134 125 help 135 126 Enable support for the NVIDIA Tegra234 SoC. 136 127 128 + config ARCH_TEGRA_238_SOC 129 + bool "NVIDIA Tegra238 SoC" 130 + default ARCH_TEGRA 131 + depends on !CPU_BIG_ENDIAN 132 + select MAILBOX 133 + select SOC_TEGRA_PMC 134 + help 135 + Enable support for the NVIDIA Tegra238 SoC. 136 + 137 137 config ARCH_TEGRA_241_SOC 138 138 bool "NVIDIA Tegra241 SoC" 139 + default ARCH_TEGRA 139 140 help 140 141 Enable support for the NVIDIA Tegra241 SoC. 141 142 142 143 config ARCH_TEGRA_264_SOC 143 144 bool "NVIDIA Tegra264 SoC" 145 + default ARCH_TEGRA 144 146 depends on !CPU_BIG_ENDIAN 145 147 select MAILBOX 146 148 select SOC_TEGRA_PMC
+166 -3
drivers/soc/tegra/cbb/tegra234-cbb.c
··· 89 89 T234_MAX_FABRIC_ID, 90 90 }; 91 91 92 + enum tegra238_cbb_fabric_ids { 93 + T238_CBB_FABRIC_ID = 0, 94 + T238_AON_FABRIC_ID = 4, 95 + T238_PSC_FABRIC_ID = 5, 96 + T238_BPMP_FABRIC_ID = 6, 97 + T238_APE_FABRIC_ID = 7, 98 + T238_MAX_FABRIC_ID, 99 + }; 100 + 92 101 enum tegra264_cbb_fabric_ids { 93 102 T264_SYSTEM_CBB_FABRIC_ID, 94 103 T264_TOP_0_CBB_FABRIC_ID, ··· 322 313 } 323 314 } 324 315 316 + static struct tegra234_cbb *tegra234_cbb_get_fabric(u8 fab_id) 317 + { 318 + struct tegra_cbb *entry; 319 + 320 + list_for_each_entry(entry, &cbb_list, node) { 321 + struct tegra234_cbb *priv = to_tegra234_cbb(entry); 322 + 323 + if (priv->fabric->fab_id == fab_id) 324 + return priv; 325 + } 326 + 327 + return NULL; 328 + } 329 + 325 330 static void tegra234_sw_lookup_target_timeout(struct seq_file *file, struct tegra234_cbb *cbb, 326 331 u8 target_id, u8 fab_id) 327 332 { 328 333 const struct tegra234_target_lookup *map = cbb->fabric->fab_list[fab_id].target_map; 334 + struct tegra234_cbb *target_cbb = NULL; 329 335 void __iomem *addr; 336 + 337 + if (fab_id == cbb->fabric->fab_id) 338 + target_cbb = cbb; 339 + else 340 + target_cbb = tegra234_cbb_get_fabric(fab_id); 341 + 342 + if (!target_cbb) { 343 + dev_err(cbb->base.dev, "could not find fabric for fab_id:%d\n", fab_id); 344 + return; 345 + } 330 346 331 347 if (target_id >= cbb->fabric->fab_list[fab_id].max_targets) { 332 348 tegra_cbb_print_err(file, "\t Invalid target_id:%d\n", target_id); ··· 375 341 * e) Goto step-a till all bits are set. 376 342 */ 377 343 378 - addr = cbb->regs + map[target_id].offset; 344 + addr = target_cbb->regs + map[target_id].offset; 379 345 380 346 if (strstr(map[target_id].name, "AXI2APB")) { 381 347 addr += APB_BLOCK_TMO_STATUS_0; ··· 915 881 ARRAY_SIZE(tegra234_common_target_map) }, 916 882 [T234_AON_FABRIC_ID] = { "aon-fabric", true, 917 883 tegra234_aon_target_map, 918 - ARRAY_SIZE(tegra234_bpmp_target_map) }, 884 + ARRAY_SIZE(tegra234_aon_target_map) }, 919 885 [T234_PSC_FABRIC_ID] = { "psc-fabric" }, 920 886 [T234_BPMP_FABRIC_ID] = { "bpmp-fabric", true, 921 887 tegra234_bpmp_target_map, ··· 1006 972 .firewall_base = 0x30000, 1007 973 .firewall_ctl = 0x290, 1008 974 .firewall_wr_ctl = 0x288, 975 + }; 976 + 977 + static const struct tegra234_target_lookup tegra238_ape_target_map[] = { 978 + { "AXI2APB", 0x00000 }, 979 + { "AGIC", 0x15000 }, 980 + { "AMC", 0x16000 }, 981 + { "AST0", 0x17000 }, 982 + { "AST1", 0x18000 }, 983 + { "AST2", 0x19000 }, 984 + { "CBB", 0x1A000 }, 985 + }; 986 + 987 + static const struct tegra234_target_lookup tegra238_cbb_target_map[] = { 988 + { "AON", 0x40000 }, 989 + { "APE", 0x50000 }, 990 + { "BPMP", 0x41000 }, 991 + { "HOST1X", 0x43000 }, 992 + { "STM", 0x44000 }, 993 + { "CBB_CENTRAL", 0x00000 }, 994 + { "PCIE_C0", 0x51000 }, 995 + { "PCIE_C1", 0x47000 }, 996 + { "PCIE_C2", 0x48000 }, 997 + { "PCIE_C3", 0x49000 }, 998 + { "GPU", 0x4C000 }, 999 + { "SMMU0", 0x4D000 }, 1000 + { "SMMU1", 0x4E000 }, 1001 + { "SMMU2", 0x4F000 }, 1002 + { "PSC", 0x52000 }, 1003 + { "AXI2APB_1", 0x70000 }, 1004 + { "AXI2APB_12", 0x73000 }, 1005 + { "AXI2APB_13", 0x74000 }, 1006 + { "AXI2APB_15", 0x76000 }, 1007 + { "AXI2APB_16", 0x77000 }, 1008 + { "AXI2APB_18", 0x79000 }, 1009 + { "AXI2APB_19", 0x7A000 }, 1010 + { "AXI2APB_2", 0x7B000 }, 1011 + { "AXI2APB_23", 0x7F000 }, 1012 + { "AXI2APB_25", 0x80000 }, 1013 + { "AXI2APB_26", 0x81000 }, 1014 + { "AXI2APB_27", 0x82000 }, 1015 + { "AXI2APB_28", 0x83000 }, 1016 + { "AXI2APB_32", 0x87000 }, 1017 + { "AXI2APB_33", 0x88000 }, 1018 + { "AXI2APB_4", 0x8B000 }, 1019 + { "AXI2APB_5", 0x8C000 }, 1020 + { "AXI2APB_6", 0x93000 }, 1021 + { "AXI2APB_9", 0x90000 }, 1022 + { "AXI2APB_3", 0x91000 }, 1023 + }; 1024 + 1025 + static const struct tegra234_fabric_lookup tegra238_cbb_fab_list[] = { 1026 + [T238_CBB_FABRIC_ID] = { "cbb-fabric", true, 1027 + tegra238_cbb_target_map, 1028 + ARRAY_SIZE(tegra238_cbb_target_map) }, 1029 + [T238_AON_FABRIC_ID] = { "aon-fabric", true, 1030 + tegra234_aon_target_map, 1031 + ARRAY_SIZE(tegra234_aon_target_map) }, 1032 + [T238_PSC_FABRIC_ID] = { "psc-fabric" }, 1033 + [T238_BPMP_FABRIC_ID] = { "bpmp-fabric", true, 1034 + tegra234_bpmp_target_map, 1035 + ARRAY_SIZE(tegra234_bpmp_target_map) }, 1036 + [T238_APE_FABRIC_ID] = { "ape-fabric", true, 1037 + tegra238_ape_target_map, 1038 + ARRAY_SIZE(tegra238_ape_target_map) }, 1039 + }; 1040 + 1041 + static const struct tegra234_cbb_fabric tegra238_aon_fabric = { 1042 + .fab_id = T238_AON_FABRIC_ID, 1043 + .fab_list = tegra238_cbb_fab_list, 1044 + .initiator_id = tegra234_initiator_id, 1045 + .errors = tegra234_cbb_errors, 1046 + .max_errors = ARRAY_SIZE(tegra234_cbb_errors), 1047 + .err_intr_enbl = 0x7, 1048 + .err_status_clr = 0x3f, 1049 + .notifier_offset = 0x17000, 1050 + .firewall_base = 0x30000, 1051 + .firewall_ctl = 0x8f0, 1052 + .firewall_wr_ctl = 0x8e8, 1053 + }; 1054 + 1055 + static const struct tegra234_cbb_fabric tegra238_ape_fabric = { 1056 + .fab_id = T238_APE_FABRIC_ID, 1057 + .fab_list = tegra238_cbb_fab_list, 1058 + .initiator_id = tegra234_initiator_id, 1059 + .errors = tegra234_cbb_errors, 1060 + .max_errors = ARRAY_SIZE(tegra234_cbb_errors), 1061 + .err_intr_enbl = 0xf, 1062 + .err_status_clr = 0x3f, 1063 + .notifier_offset = 0x1E000, 1064 + .firewall_base = 0x30000, 1065 + .firewall_ctl = 0xad0, 1066 + .firewall_wr_ctl = 0xac8, 1067 + }; 1068 + 1069 + static const struct tegra234_cbb_fabric tegra238_bpmp_fabric = { 1070 + .fab_id = T238_BPMP_FABRIC_ID, 1071 + .fab_list = tegra238_cbb_fab_list, 1072 + .initiator_id = tegra234_initiator_id, 1073 + .errors = tegra234_cbb_errors, 1074 + .max_errors = ARRAY_SIZE(tegra234_cbb_errors), 1075 + .err_intr_enbl = 0xf, 1076 + .err_status_clr = 0x3f, 1077 + .notifier_offset = 0x19000, 1078 + .firewall_base = 0x30000, 1079 + .firewall_ctl = 0x8f0, 1080 + .firewall_wr_ctl = 0x8e8, 1081 + }; 1082 + 1083 + static const struct tegra234_cbb_fabric tegra238_cbb_fabric = { 1084 + .fab_id = T238_CBB_FABRIC_ID, 1085 + .fab_list = tegra238_cbb_fab_list, 1086 + .initiator_id = tegra234_initiator_id, 1087 + .errors = tegra234_cbb_errors, 1088 + .max_errors = ARRAY_SIZE(tegra234_cbb_errors), 1089 + .err_intr_enbl = 0x3f, 1090 + .err_status_clr = 0x3f, 1091 + .notifier_offset = 0x60000, 1092 + .off_mask_erd = 0x3d004, 1093 + .firewall_base = 0x10000, 1094 + .firewall_ctl = 0x2230, 1095 + .firewall_wr_ctl = 0x2228, 1009 1096 }; 1010 1097 1011 1098 static const char * const tegra241_initiator_id[] = { ··· 1315 1160 [T234_CBB_FABRIC_ID] = { "cbb-fabric", true, 1316 1161 tegra241_cbb_target_map, ARRAY_SIZE(tegra241_cbb_target_map) }, 1317 1162 [T234_BPMP_FABRIC_ID] = { "bpmp-fabric", true, 1318 - tegra241_bpmp_target_map, ARRAY_SIZE(tegra241_cbb_target_map) }, 1163 + tegra241_bpmp_target_map, ARRAY_SIZE(tegra241_bpmp_target_map) }, 1319 1164 }; 1320 1165 static const struct tegra234_cbb_fabric tegra241_cbb_fabric = { 1321 1166 .fab_id = T234_CBB_FABRIC_ID, ··· 1635 1480 { .compatible = "nvidia,tegra234-dce-fabric", .data = &tegra234_dce_fabric }, 1636 1481 { .compatible = "nvidia,tegra234-rce-fabric", .data = &tegra234_rce_fabric }, 1637 1482 { .compatible = "nvidia,tegra234-sce-fabric", .data = &tegra234_sce_fabric }, 1483 + { .compatible = "nvidia,tegra238-aon-fabric", .data = &tegra238_aon_fabric }, 1484 + { .compatible = "nvidia,tegra238-ape-fabric", .data = &tegra238_ape_fabric }, 1485 + { .compatible = "nvidia,tegra238-bpmp-fabric", .data = &tegra238_bpmp_fabric }, 1486 + { .compatible = "nvidia,tegra238-cbb-fabric", .data = &tegra238_cbb_fabric }, 1638 1487 { .compatible = "nvidia,tegra264-sys-cbb-fabric", .data = &tegra264_sys_cbb_fabric }, 1639 1488 { .compatible = "nvidia,tegra264-top0-cbb-fabric", .data = &tegra264_top0_cbb_fabric }, 1640 1489 { .compatible = "nvidia,tegra264-uphy0-cbb-fabric", .data = &tegra264_uphy0_cbb_fabric }, ··· 1744 1585 static int __maybe_unused tegra234_cbb_resume_noirq(struct device *dev) 1745 1586 { 1746 1587 struct tegra234_cbb *cbb = dev_get_drvdata(dev); 1588 + 1589 + /* set ERD bit to mask SError and generate interrupt to report error */ 1590 + if (cbb->fabric->off_mask_erd) 1591 + tegra234_cbb_mask_serror(cbb); 1747 1592 1748 1593 tegra234_cbb_error_enable(&cbb->base); 1749 1594
+3 -2
drivers/soc/tegra/common.c
··· 118 118 hw_version = BIT(tegra_sku_info.soc_process_id); 119 119 config.supported_hw = &hw_version; 120 120 config.supported_hw_count = 1; 121 - } else if (of_machine_is_compatible("nvidia,tegra30")) { 121 + } else if (of_machine_is_compatible("nvidia,tegra30") || 122 + of_machine_is_compatible("nvidia,tegra114")) { 122 123 hw_version = BIT(tegra_sku_info.soc_speedo_id); 123 124 config.supported_hw = &hw_version; 124 125 config.supported_hw_count = 1; ··· 132 131 } 133 132 134 133 /* 135 - * Tegra114+ doesn't support OPP yet, return early for non tegra20/30 134 + * Tegra124+ doesn't support OPP yet, return early for pre-Tegra124 136 135 * case. 137 136 */ 138 137 if (!config.supported_hw)
+418 -250
drivers/soc/tegra/pmc.c
··· 60 60 #include <dt-bindings/gpio/tegra186-gpio.h> 61 61 #include <dt-bindings/gpio/tegra194-gpio.h> 62 62 #include <dt-bindings/gpio/tegra234-gpio.h> 63 + #include <dt-bindings/gpio/nvidia,tegra264-gpio.h> 63 64 #include <dt-bindings/soc/tegra-pmc.h> 64 65 65 66 #define PMC_CNTRL 0x0 ··· 181 180 #define WAKE_AOWAKE_CNTRL(x) (0x000 + ((x) << 2)) 182 181 #define WAKE_AOWAKE_CNTRL_LEVEL (1 << 3) 183 182 #define WAKE_AOWAKE_CNTRL_SR_CAPTURE_EN (1 << 1) 184 - #define WAKE_AOWAKE_MASK_W(x) (0x180 + ((x) << 2)) 185 - #define WAKE_AOWAKE_MASK_R(x) (0x300 + ((x) << 2)) 186 - #define WAKE_AOWAKE_STATUS_W(x) (0x30c + ((x) << 2)) 187 - #define WAKE_AOWAKE_STATUS_R(x) (0x48c + ((x) << 2)) 188 - #define WAKE_AOWAKE_TIER0_ROUTING(x) (0x4b4 + ((x) << 2)) 189 - #define WAKE_AOWAKE_TIER1_ROUTING(x) (0x4c0 + ((x) << 2)) 190 - #define WAKE_AOWAKE_TIER2_ROUTING(x) (0x4cc + ((x) << 2)) 191 - #define WAKE_AOWAKE_SW_STATUS_W_0 0x49c 192 - #define WAKE_AOWAKE_SW_STATUS(x) (0x4a0 + ((x) << 2)) 193 - #define WAKE_LATCH_SW 0x498 183 + #define WAKE_AOWAKE_MASK_W(_pmc, x) \ 184 + ((_pmc)->soc->regs->aowake_mask_w + ((x) << 2)) 185 + #define WAKE_AOWAKE_STATUS_W(_pmc, x) \ 186 + ((_pmc)->soc->regs->aowake_status_w + ((x) << 2)) 187 + #define WAKE_AOWAKE_STATUS_R(_pmc, x) \ 188 + ((_pmc)->soc->regs->aowake_status_r + ((x) << 2)) 189 + #define WAKE_AOWAKE_TIER2_ROUTING(_pmc, x) \ 190 + ((_pmc)->soc->regs->aowake_tier2_routing + ((x) << 2)) 191 + #define WAKE_AOWAKE_SW_STATUS(_pmc, x) \ 192 + ((_pmc)->soc->regs->aowake_sw_status + ((x) << 2)) 194 193 195 - #define WAKE_AOWAKE_CTRL 0x4f4 196 - #define WAKE_AOWAKE_CTRL_INTR_POLARITY BIT(0) 194 + #define WAKE_AOWAKE_CTRL_INTR_POLARITY BIT(0) 197 195 198 196 #define SW_WAKE_ID 83 /* wake83 */ 199 197 ··· 200 200 #define TEGRA_SMC_PMC 0xc2fffe00 201 201 #define TEGRA_SMC_PMC_READ 0xaa 202 202 #define TEGRA_SMC_PMC_WRITE 0xbb 203 + 204 + /* Tegra264 and later */ 205 + #define PMC_IMPL_SDMMC1_HV_PADCTL_0 0x41004 203 206 204 207 struct pmc_clk { 205 208 struct clk_hw hw; ··· 297 294 unsigned int dpd; 298 295 unsigned int request; 299 296 unsigned int status; 300 - unsigned int voltage; 301 297 const char *name; 298 + }; 299 + 300 + struct tegra_io_pad_vctrl { 301 + enum tegra_io_pad id; 302 + unsigned int offset; 303 + unsigned int ena_3v3; 304 + unsigned int ena_1v8; 302 305 }; 303 306 304 307 struct tegra_pmc_regs { ··· 314 305 unsigned int rst_source_mask; 315 306 unsigned int rst_level_shift; 316 307 unsigned int rst_level_mask; 308 + unsigned int aowake_mask_w; 309 + unsigned int aowake_status_w; 310 + unsigned int aowake_status_r; 311 + unsigned int aowake_tier2_routing; 312 + unsigned int aowake_sw_status_w; 313 + unsigned int aowake_sw_status; 314 + unsigned int aowake_latch_sw; 315 + unsigned int aowake_ctrl; 317 316 }; 318 317 319 318 struct tegra_wake_event { ··· 376 359 bool has_tsense_reset; 377 360 bool has_gpu_clamps; 378 361 bool needs_mbist_war; 379 - bool has_impl_33v_pwr; 362 + bool has_io_pad_wren; 380 363 bool maybe_tz_only; 381 364 382 365 const struct tegra_io_pad_soc *io_pads; 383 366 unsigned int num_io_pads; 367 + const struct tegra_io_pad_vctrl *io_pad_vctrls; 368 + unsigned int num_io_pad_vctrls; 384 369 385 370 const struct pinctrl_pin_desc *pin_descs; 386 371 unsigned int num_pin_descs; ··· 456 437 * @wake_sw_status_map: Bitmap to hold raw status of wakes without mask 457 438 * @wake_cntrl_level_map: Bitmap to hold wake levels to be programmed in 458 439 * cntrl register associated with each wake during system suspend. 440 + * @reboot_notifier: PMC reboot notifier handler 459 441 * @syscore: syscore suspend/resume callbacks 442 + * @wake_work: IRQ work handler for processing wake-up events. 443 + * @wake_status: Status of wake-up events. 460 444 */ 461 445 struct tegra_pmc { 462 446 struct device *dev; ··· 1026 1004 } 1027 1005 1028 1006 /** 1029 - * tegra_pmc_get() - find the PMC for a given device 1007 + * devm_tegra_pmc_get() - find the PMC for a given device 1030 1008 * @dev: device for which to find the PMC 1031 1009 * 1032 1010 * Returns a pointer to the PMC on success or an ERR_PTR()-encoded error code ··· 1710 1688 return NULL; 1711 1689 } 1712 1690 1691 + static const struct tegra_io_pad_vctrl * 1692 + tegra_io_pad_vctrl_find(struct tegra_pmc *pmc, enum tegra_io_pad id) 1693 + { 1694 + unsigned int i; 1695 + 1696 + for (i = 0; i < pmc->soc->num_io_pad_vctrls; i++) 1697 + if (pmc->soc->io_pad_vctrls[i].id == id) 1698 + return &pmc->soc->io_pad_vctrls[i]; 1699 + 1700 + return NULL; 1701 + } 1702 + 1713 1703 static int tegra_io_pad_prepare(struct tegra_pmc *pmc, 1714 1704 const struct tegra_io_pad_soc *pad, 1715 1705 unsigned long *request, ··· 1780 1746 } 1781 1747 1782 1748 /** 1783 - * tegra_io_pad_power_enable() - enable power to I/O pad 1749 + * tegra_pmc_io_pad_power_enable() - enable power to I/O pad 1784 1750 * @pmc: power management controller 1785 1751 * @id: Tegra I/O pad ID for which to enable power 1786 1752 * ··· 1917 1883 static int tegra_io_pad_set_voltage(struct tegra_pmc *pmc, enum tegra_io_pad id, 1918 1884 int voltage) 1919 1885 { 1920 - const struct tegra_io_pad_soc *pad; 1886 + const struct tegra_io_pad_vctrl *pad; 1921 1887 u32 value; 1922 1888 1923 - pad = tegra_io_pad_find(pmc, id); 1889 + pad = tegra_io_pad_vctrl_find(pmc, id); 1924 1890 if (!pad) 1925 1891 return -ENOENT; 1926 1892 1927 - if (pad->voltage == UINT_MAX) 1928 - return -ENOTSUPP; 1929 - 1930 1893 mutex_lock(&pmc->powergates_lock); 1931 1894 1932 - if (pmc->soc->has_impl_33v_pwr) { 1933 - value = tegra_pmc_readl(pmc, PMC_IMPL_E_33V_PWR); 1934 - 1935 - if (voltage == TEGRA_IO_PAD_VOLTAGE_1V8) 1936 - value &= ~BIT(pad->voltage); 1937 - else 1938 - value |= BIT(pad->voltage); 1939 - 1940 - tegra_pmc_writel(pmc, value, PMC_IMPL_E_33V_PWR); 1941 - } else { 1942 - /* write-enable PMC_PWR_DET_VALUE[pad->voltage] */ 1895 + if (pmc->soc->has_io_pad_wren) { 1896 + /* write-enable PMC_PWR_DET_VALUE[pad->ena_3v3] */ 1943 1897 value = tegra_pmc_readl(pmc, PMC_PWR_DET); 1944 - value |= BIT(pad->voltage); 1898 + value |= BIT(pad->ena_3v3); 1945 1899 tegra_pmc_writel(pmc, value, PMC_PWR_DET); 1946 - 1947 - /* update I/O voltage */ 1948 - value = tegra_pmc_readl(pmc, PMC_PWR_DET_VALUE); 1949 - 1950 - if (voltage == TEGRA_IO_PAD_VOLTAGE_1V8) 1951 - value &= ~BIT(pad->voltage); 1952 - else 1953 - value |= BIT(pad->voltage); 1954 - 1955 - tegra_pmc_writel(pmc, value, PMC_PWR_DET_VALUE); 1956 1900 } 1901 + 1902 + value = tegra_pmc_readl(pmc, pad->offset); 1903 + 1904 + if (voltage == TEGRA_IO_PAD_VOLTAGE_1V8) { 1905 + value &= ~BIT(pad->ena_3v3); 1906 + 1907 + if (pad->ena_1v8) 1908 + value |= pad->ena_1v8; 1909 + } else { 1910 + value |= BIT(pad->ena_3v3); 1911 + 1912 + if (pad->ena_1v8) 1913 + value &= ~pad->ena_1v8; 1914 + } 1915 + 1916 + tegra_pmc_writel(pmc, value, pad->offset); 1957 1917 1958 1918 mutex_unlock(&pmc->powergates_lock); 1959 1919 ··· 1958 1930 1959 1931 static int tegra_io_pad_get_voltage(struct tegra_pmc *pmc, enum tegra_io_pad id) 1960 1932 { 1961 - const struct tegra_io_pad_soc *pad; 1933 + const struct tegra_io_pad_vctrl *pad; 1962 1934 u32 value; 1963 1935 1964 - pad = tegra_io_pad_find(pmc, id); 1936 + pad = tegra_io_pad_vctrl_find(pmc, id); 1965 1937 if (!pad) 1966 1938 return -ENOENT; 1967 1939 1968 - if (pad->voltage == UINT_MAX) 1969 - return -ENOTSUPP; 1940 + value = tegra_pmc_readl(pmc, pad->offset); 1970 1941 1971 - if (pmc->soc->has_impl_33v_pwr) 1972 - value = tegra_pmc_readl(pmc, PMC_IMPL_E_33V_PWR); 1973 - else 1974 - value = tegra_pmc_readl(pmc, PMC_PWR_DET_VALUE); 1975 - 1976 - if ((value & BIT(pad->voltage)) == 0) 1942 + if ((value & BIT(pad->ena_3v3)) == 0) 1977 1943 return TEGRA_IO_PAD_VOLTAGE_1V8; 1978 1944 1979 1945 return TEGRA_IO_PAD_VOLTAGE_3V3; ··· 2651 2629 bit = data->hwirq % 32; 2652 2630 2653 2631 /* clear wake status */ 2654 - writel(0x1, pmc->wake + WAKE_AOWAKE_STATUS_W(data->hwirq)); 2632 + writel(0x1, pmc->wake + WAKE_AOWAKE_STATUS_W(pmc, data->hwirq)); 2655 2633 2656 2634 /* route wake to tier 2 */ 2657 - value = readl(pmc->wake + WAKE_AOWAKE_TIER2_ROUTING(offset)); 2635 + value = readl(pmc->wake + WAKE_AOWAKE_TIER2_ROUTING(pmc, offset)); 2658 2636 2659 2637 if (!on) 2660 2638 value &= ~(1 << bit); 2661 2639 else 2662 2640 value |= 1 << bit; 2663 2641 2664 - writel(value, pmc->wake + WAKE_AOWAKE_TIER2_ROUTING(offset)); 2642 + writel(value, pmc->wake + WAKE_AOWAKE_TIER2_ROUTING(pmc, offset)); 2665 2643 2666 2644 /* enable wakeup event */ 2667 - writel(!!on, pmc->wake + WAKE_AOWAKE_MASK_W(data->hwirq)); 2645 + writel(!!on, pmc->wake + WAKE_AOWAKE_MASK_W(pmc, data->hwirq)); 2668 2646 2669 2647 return 0; 2670 2648 } ··· 3331 3309 3332 3310 static void wke_clear_sw_wake_status(struct tegra_pmc *pmc) 3333 3311 { 3334 - wke_32kwritel(pmc, 1, WAKE_AOWAKE_SW_STATUS_W_0); 3312 + wke_32kwritel(pmc, 1, pmc->soc->regs->aowake_sw_status_w); 3335 3313 } 3336 3314 3337 3315 static void wke_read_sw_wake_status(struct tegra_pmc *pmc) ··· 3344 3322 3345 3323 wke_clear_sw_wake_status(pmc); 3346 3324 3347 - wke_32kwritel(pmc, 1, WAKE_LATCH_SW); 3325 + wke_32kwritel(pmc, 1, pmc->soc->regs->aowake_latch_sw); 3348 3326 3349 3327 /* 3350 3328 * WAKE_AOWAKE_SW_STATUS is edge triggered, so in order to ··· 3362 3340 */ 3363 3341 udelay(300); 3364 3342 3365 - wke_32kwritel(pmc, 0, WAKE_LATCH_SW); 3343 + wke_32kwritel(pmc, 0, pmc->soc->regs->aowake_latch_sw); 3366 3344 3367 3345 bitmap_zero(pmc->wake_sw_status_map, pmc->soc->max_wake_events); 3368 3346 3369 3347 for (i = 0; i < pmc->soc->max_wake_vectors; i++) { 3370 - status = readl(pmc->wake + WAKE_AOWAKE_SW_STATUS(i)); 3348 + status = readl(pmc->wake + WAKE_AOWAKE_SW_STATUS(pmc, i)); 3371 3349 3372 3350 for_each_set_bit(wake, &status, 32) 3373 3351 set_bit(wake + (i * 32), pmc->wake_sw_status_map); ··· 3381 3359 u32 mask; 3382 3360 3383 3361 for (i = 0; i < pmc->soc->max_wake_vectors; i++) { 3384 - mask = readl(pmc->wake + WAKE_AOWAKE_TIER2_ROUTING(i)); 3385 - status = readl(pmc->wake + WAKE_AOWAKE_STATUS_R(i)) & mask; 3362 + mask = readl(pmc->wake + WAKE_AOWAKE_TIER2_ROUTING(pmc, i)); 3363 + status = readl(pmc->wake + WAKE_AOWAKE_STATUS_R(pmc, i)) & mask; 3386 3364 3387 3365 for_each_set_bit(wake, &status, 32) 3388 - wke_32kwritel(pmc, 0x1, WAKE_AOWAKE_STATUS_W((i * 32) + wake)); 3366 + wke_32kwritel(pmc, 0x1, WAKE_AOWAKE_STATUS_W(pmc, 3367 + (i * 32) + wake)); 3389 3368 } 3390 3369 } 3391 3370 ··· 3397 3374 u32 mask; 3398 3375 3399 3376 for (i = 0; i < pmc->soc->max_wake_vectors; i++) { 3400 - mask = readl(pmc->wake + WAKE_AOWAKE_TIER2_ROUTING(i)); 3401 - pmc->wake_status[i] = readl(pmc->wake + WAKE_AOWAKE_STATUS_R(i)) & mask; 3377 + mask = readl(pmc->wake + WAKE_AOWAKE_TIER2_ROUTING(pmc, i)); 3378 + pmc->wake_status[i] = readl(pmc->wake + 3379 + WAKE_AOWAKE_STATUS_R(pmc, i)) & mask; 3402 3380 } 3403 3381 3404 3382 /* Schedule IRQ work to process wake IRQs (if any) */ ··· 3547 3523 .has_tsense_reset = false, 3548 3524 .has_gpu_clamps = false, 3549 3525 .needs_mbist_war = false, 3550 - .has_impl_33v_pwr = false, 3526 + .has_io_pad_wren = true, 3551 3527 .maybe_tz_only = false, 3552 3528 .num_io_pads = 0, 3553 3529 .io_pads = NULL, ··· 3609 3585 .has_tsense_reset = true, 3610 3586 .has_gpu_clamps = false, 3611 3587 .needs_mbist_war = false, 3612 - .has_impl_33v_pwr = false, 3588 + .has_io_pad_wren = true, 3613 3589 .maybe_tz_only = false, 3614 3590 .num_io_pads = 0, 3615 3591 .io_pads = NULL, ··· 3659 3635 }; 3660 3636 3661 3637 static const struct tegra_pmc_soc tegra114_pmc_soc = { 3662 - .supports_core_domain = false, 3638 + .supports_core_domain = true, 3663 3639 .num_powergates = ARRAY_SIZE(tegra114_powergates), 3664 3640 .powergates = tegra114_powergates, 3665 3641 .num_cpu_powergates = ARRAY_SIZE(tegra114_cpu_powergates), ··· 3667 3643 .has_tsense_reset = true, 3668 3644 .has_gpu_clamps = false, 3669 3645 .needs_mbist_war = false, 3670 - .has_impl_33v_pwr = false, 3646 + .has_io_pad_wren = true, 3671 3647 .maybe_tz_only = false, 3672 3648 .num_io_pads = 0, 3673 3649 .io_pads = NULL, ··· 3721 3697 TEGRA_POWERGATE_CPU3, 3722 3698 }; 3723 3699 3724 - #define TEGRA_IO_PAD(_id, _dpd, _request, _status, _voltage, _name) \ 3700 + #define TEGRA_IO_PAD(_id, _dpd, _request, _status, _name) \ 3725 3701 ((struct tegra_io_pad_soc) { \ 3726 3702 .id = (_id), \ 3727 3703 .dpd = (_dpd), \ 3728 3704 .request = (_request), \ 3729 3705 .status = (_status), \ 3730 - .voltage = (_voltage), \ 3731 3706 .name = (_name), \ 3707 + }) 3708 + 3709 + #define TEGRA_IO_PAD_VCTRL(_id, _offset, _ena_3v3) \ 3710 + ((struct tegra_io_pad_vctrl) { \ 3711 + .id = (_id), \ 3712 + .offset = (_offset), \ 3713 + .ena_3v3 = (_ena_3v3), \ 3714 + .ena_1v8 = 0, \ 3732 3715 }) 3733 3716 3734 3717 #define TEGRA_IO_PIN_DESC(_id, _name) \ ··· 3745 3714 }) 3746 3715 3747 3716 static const struct tegra_io_pad_soc tegra124_io_pads[] = { 3748 - TEGRA_IO_PAD(TEGRA_IO_PAD_AUDIO, 17, 0x1b8, 0x1bc, UINT_MAX, "audio"), 3749 - TEGRA_IO_PAD(TEGRA_IO_PAD_BB, 15, 0x1b8, 0x1bc, UINT_MAX, "bb"), 3750 - TEGRA_IO_PAD(TEGRA_IO_PAD_CAM, 4, 0x1c0, 0x1c4, UINT_MAX, "cam"), 3751 - TEGRA_IO_PAD(TEGRA_IO_PAD_COMP, 22, 0x1b8, 0x1bc, UINT_MAX, "comp"), 3752 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIA, 0, 0x1b8, 0x1bc, UINT_MAX, "csia"), 3753 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIB, 1, 0x1b8, 0x1bc, UINT_MAX, "csib"), 3754 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIE, 12, 0x1c0, 0x1c4, UINT_MAX, "csie"), 3755 - TEGRA_IO_PAD(TEGRA_IO_PAD_DSI, 2, 0x1b8, 0x1bc, UINT_MAX, "dsi"), 3756 - TEGRA_IO_PAD(TEGRA_IO_PAD_DSIB, 7, 0x1c0, 0x1c4, UINT_MAX, "dsib"), 3757 - TEGRA_IO_PAD(TEGRA_IO_PAD_DSIC, 8, 0x1c0, 0x1c4, UINT_MAX, "dsic"), 3758 - TEGRA_IO_PAD(TEGRA_IO_PAD_DSID, 9, 0x1c0, 0x1c4, UINT_MAX, "dsid"), 3759 - TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI, 28, 0x1b8, 0x1bc, UINT_MAX, "hdmi"), 3760 - TEGRA_IO_PAD(TEGRA_IO_PAD_HSIC, 19, 0x1b8, 0x1bc, UINT_MAX, "hsic"), 3761 - TEGRA_IO_PAD(TEGRA_IO_PAD_HV, 6, 0x1c0, 0x1c4, UINT_MAX, "hv"), 3762 - TEGRA_IO_PAD(TEGRA_IO_PAD_LVDS, 25, 0x1c0, 0x1c4, UINT_MAX, "lvds"), 3763 - TEGRA_IO_PAD(TEGRA_IO_PAD_MIPI_BIAS, 3, 0x1b8, 0x1bc, UINT_MAX, "mipi-bias"), 3764 - TEGRA_IO_PAD(TEGRA_IO_PAD_NAND, 13, 0x1b8, 0x1bc, UINT_MAX, "nand"), 3765 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_BIAS, 4, 0x1b8, 0x1bc, UINT_MAX, "pex-bias"), 3766 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK1, 5, 0x1b8, 0x1bc, UINT_MAX, "pex-clk1"), 3767 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK2, 6, 0x1b8, 0x1bc, UINT_MAX, "pex-clk2"), 3768 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CNTRL, 0, 0x1c0, 0x1c4, UINT_MAX, "pex-cntrl"), 3769 - TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC1, 1, 0x1c0, 0x1c4, UINT_MAX, "sdmmc1"), 3770 - TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC3, 2, 0x1c0, 0x1c4, UINT_MAX, "sdmmc3"), 3771 - TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC4, 3, 0x1c0, 0x1c4, UINT_MAX, "sdmmc4"), 3772 - TEGRA_IO_PAD(TEGRA_IO_PAD_SYS_DDC, 26, 0x1c0, 0x1c4, UINT_MAX, "sys_ddc"), 3773 - TEGRA_IO_PAD(TEGRA_IO_PAD_UART, 14, 0x1b8, 0x1bc, UINT_MAX, "uart"), 3774 - TEGRA_IO_PAD(TEGRA_IO_PAD_USB0, 9, 0x1b8, 0x1bc, UINT_MAX, "usb0"), 3775 - TEGRA_IO_PAD(TEGRA_IO_PAD_USB1, 10, 0x1b8, 0x1bc, UINT_MAX, "usb1"), 3776 - TEGRA_IO_PAD(TEGRA_IO_PAD_USB2, 11, 0x1b8, 0x1bc, UINT_MAX, "usb2"), 3777 - TEGRA_IO_PAD(TEGRA_IO_PAD_USB_BIAS, 12, 0x1b8, 0x1bc, UINT_MAX, "usb_bias"), 3717 + TEGRA_IO_PAD(TEGRA_IO_PAD_AUDIO, 17, 0x1b8, 0x1bc, "audio"), 3718 + TEGRA_IO_PAD(TEGRA_IO_PAD_BB, 15, 0x1b8, 0x1bc, "bb"), 3719 + TEGRA_IO_PAD(TEGRA_IO_PAD_CAM, 4, 0x1c0, 0x1c4, "cam"), 3720 + TEGRA_IO_PAD(TEGRA_IO_PAD_COMP, 22, 0x1b8, 0x1bc, "comp"), 3721 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIA, 0, 0x1b8, 0x1bc, "csia"), 3722 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIB, 1, 0x1b8, 0x1bc, "csib"), 3723 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIE, 12, 0x1c0, 0x1c4, "csie"), 3724 + TEGRA_IO_PAD(TEGRA_IO_PAD_DSI, 2, 0x1b8, 0x1bc, "dsi"), 3725 + TEGRA_IO_PAD(TEGRA_IO_PAD_DSIB, 7, 0x1c0, 0x1c4, "dsib"), 3726 + TEGRA_IO_PAD(TEGRA_IO_PAD_DSIC, 8, 0x1c0, 0x1c4, "dsic"), 3727 + TEGRA_IO_PAD(TEGRA_IO_PAD_DSID, 9, 0x1c0, 0x1c4, "dsid"), 3728 + TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI, 28, 0x1b8, 0x1bc, "hdmi"), 3729 + TEGRA_IO_PAD(TEGRA_IO_PAD_HSIC, 19, 0x1b8, 0x1bc, "hsic"), 3730 + TEGRA_IO_PAD(TEGRA_IO_PAD_HV, 6, 0x1c0, 0x1c4, "hv"), 3731 + TEGRA_IO_PAD(TEGRA_IO_PAD_LVDS, 25, 0x1c0, 0x1c4, "lvds"), 3732 + TEGRA_IO_PAD(TEGRA_IO_PAD_MIPI_BIAS, 3, 0x1b8, 0x1bc, "mipi-bias"), 3733 + TEGRA_IO_PAD(TEGRA_IO_PAD_NAND, 13, 0x1b8, 0x1bc, "nand"), 3734 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_BIAS, 4, 0x1b8, 0x1bc, "pex-bias"), 3735 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK1, 5, 0x1b8, 0x1bc, "pex-clk1"), 3736 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK2, 6, 0x1b8, 0x1bc, "pex-clk2"), 3737 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CNTRL, 0, 0x1c0, 0x1c4, "pex-cntrl"), 3738 + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC1, 1, 0x1c0, 0x1c4, "sdmmc1"), 3739 + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC3, 2, 0x1c0, 0x1c4, "sdmmc3"), 3740 + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC4, 3, 0x1c0, 0x1c4, "sdmmc4"), 3741 + TEGRA_IO_PAD(TEGRA_IO_PAD_SYS_DDC, 26, 0x1c0, 0x1c4, "sys_ddc"), 3742 + TEGRA_IO_PAD(TEGRA_IO_PAD_UART, 14, 0x1b8, 0x1bc, "uart"), 3743 + TEGRA_IO_PAD(TEGRA_IO_PAD_USB0, 9, 0x1b8, 0x1bc, "usb0"), 3744 + TEGRA_IO_PAD(TEGRA_IO_PAD_USB1, 10, 0x1b8, 0x1bc, "usb1"), 3745 + TEGRA_IO_PAD(TEGRA_IO_PAD_USB2, 11, 0x1b8, 0x1bc, "usb2"), 3746 + TEGRA_IO_PAD(TEGRA_IO_PAD_USB_BIAS, 12, 0x1b8, 0x1bc, "usb_bias"), 3778 3747 }; 3779 3748 3780 3749 static const struct pinctrl_pin_desc tegra124_pin_descs[] = { ··· 3819 3788 .has_tsense_reset = true, 3820 3789 .has_gpu_clamps = true, 3821 3790 .needs_mbist_war = false, 3822 - .has_impl_33v_pwr = false, 3791 + .has_io_pad_wren = true, 3823 3792 .maybe_tz_only = false, 3824 3793 .num_io_pads = ARRAY_SIZE(tegra124_io_pads), 3825 3794 .io_pads = tegra124_io_pads, ··· 3875 3844 }; 3876 3845 3877 3846 static const struct tegra_io_pad_soc tegra210_io_pads[] = { 3878 - TEGRA_IO_PAD(TEGRA_IO_PAD_AUDIO, 17, 0x1b8, 0x1bc, 5, "audio"), 3879 - TEGRA_IO_PAD(TEGRA_IO_PAD_AUDIO_HV, 29, 0x1c0, 0x1c4, 18, "audio-hv"), 3880 - TEGRA_IO_PAD(TEGRA_IO_PAD_CAM, 4, 0x1c0, 0x1c4, 10, "cam"), 3881 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIA, 0, 0x1b8, 0x1bc, UINT_MAX, "csia"), 3882 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIB, 1, 0x1b8, 0x1bc, UINT_MAX, "csib"), 3883 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIC, 10, 0x1c0, 0x1c4, UINT_MAX, "csic"), 3884 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSID, 11, 0x1c0, 0x1c4, UINT_MAX, "csid"), 3885 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIE, 12, 0x1c0, 0x1c4, UINT_MAX, "csie"), 3886 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIF, 13, 0x1c0, 0x1c4, UINT_MAX, "csif"), 3887 - TEGRA_IO_PAD(TEGRA_IO_PAD_DBG, 25, 0x1b8, 0x1bc, 19, "dbg"), 3888 - TEGRA_IO_PAD(TEGRA_IO_PAD_DEBUG_NONAO, 26, 0x1b8, 0x1bc, UINT_MAX, "debug-nonao"), 3889 - TEGRA_IO_PAD(TEGRA_IO_PAD_DMIC, 18, 0x1c0, 0x1c4, 20, "dmic"), 3890 - TEGRA_IO_PAD(TEGRA_IO_PAD_DP, 19, 0x1c0, 0x1c4, UINT_MAX, "dp"), 3891 - TEGRA_IO_PAD(TEGRA_IO_PAD_DSI, 2, 0x1b8, 0x1bc, UINT_MAX, "dsi"), 3892 - TEGRA_IO_PAD(TEGRA_IO_PAD_DSIB, 7, 0x1c0, 0x1c4, UINT_MAX, "dsib"), 3893 - TEGRA_IO_PAD(TEGRA_IO_PAD_DSIC, 8, 0x1c0, 0x1c4, UINT_MAX, "dsic"), 3894 - TEGRA_IO_PAD(TEGRA_IO_PAD_DSID, 9, 0x1c0, 0x1c4, UINT_MAX, "dsid"), 3895 - TEGRA_IO_PAD(TEGRA_IO_PAD_EMMC, 3, 0x1c0, 0x1c4, UINT_MAX, "emmc"), 3896 - TEGRA_IO_PAD(TEGRA_IO_PAD_EMMC2, 5, 0x1c0, 0x1c4, UINT_MAX, "emmc2"), 3897 - TEGRA_IO_PAD(TEGRA_IO_PAD_GPIO, 27, 0x1b8, 0x1bc, 21, "gpio"), 3898 - TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI, 28, 0x1b8, 0x1bc, UINT_MAX, "hdmi"), 3899 - TEGRA_IO_PAD(TEGRA_IO_PAD_HSIC, 19, 0x1b8, 0x1bc, UINT_MAX, "hsic"), 3900 - TEGRA_IO_PAD(TEGRA_IO_PAD_LVDS, 25, 0x1c0, 0x1c4, UINT_MAX, "lvds"), 3901 - TEGRA_IO_PAD(TEGRA_IO_PAD_MIPI_BIAS, 3, 0x1b8, 0x1bc, UINT_MAX, "mipi-bias"), 3902 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_BIAS, 4, 0x1b8, 0x1bc, UINT_MAX, "pex-bias"), 3903 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK1, 5, 0x1b8, 0x1bc, UINT_MAX, "pex-clk1"), 3904 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK2, 6, 0x1b8, 0x1bc, UINT_MAX, "pex-clk2"), 3905 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CNTRL, UINT_MAX, UINT_MAX, UINT_MAX, 11, "pex-cntrl"), 3906 - TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC1, 1, 0x1c0, 0x1c4, 12, "sdmmc1"), 3907 - TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC3, 2, 0x1c0, 0x1c4, 13, "sdmmc3"), 3908 - TEGRA_IO_PAD(TEGRA_IO_PAD_SPI, 14, 0x1c0, 0x1c4, 22, "spi"), 3909 - TEGRA_IO_PAD(TEGRA_IO_PAD_SPI_HV, 15, 0x1c0, 0x1c4, 23, "spi-hv"), 3910 - TEGRA_IO_PAD(TEGRA_IO_PAD_UART, 14, 0x1b8, 0x1bc, 2, "uart"), 3911 - TEGRA_IO_PAD(TEGRA_IO_PAD_USB0, 9, 0x1b8, 0x1bc, UINT_MAX, "usb0"), 3912 - TEGRA_IO_PAD(TEGRA_IO_PAD_USB1, 10, 0x1b8, 0x1bc, UINT_MAX, "usb1"), 3913 - TEGRA_IO_PAD(TEGRA_IO_PAD_USB2, 11, 0x1b8, 0x1bc, UINT_MAX, "usb2"), 3914 - TEGRA_IO_PAD(TEGRA_IO_PAD_USB3, 18, 0x1b8, 0x1bc, UINT_MAX, "usb3"), 3915 - TEGRA_IO_PAD(TEGRA_IO_PAD_USB_BIAS, 12, 0x1b8, 0x1bc, UINT_MAX, "usb-bias"), 3847 + TEGRA_IO_PAD(TEGRA_IO_PAD_AUDIO, 17, 0x1b8, 0x1bc, "audio"), 3848 + TEGRA_IO_PAD(TEGRA_IO_PAD_AUDIO_HV, 29, 0x1c0, 0x1c4, "audio-hv"), 3849 + TEGRA_IO_PAD(TEGRA_IO_PAD_CAM, 4, 0x1c0, 0x1c4, "cam"), 3850 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIA, 0, 0x1b8, 0x1bc, "csia"), 3851 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIB, 1, 0x1b8, 0x1bc, "csib"), 3852 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIC, 10, 0x1c0, 0x1c4, "csic"), 3853 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSID, 11, 0x1c0, 0x1c4, "csid"), 3854 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIE, 12, 0x1c0, 0x1c4, "csie"), 3855 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIF, 13, 0x1c0, 0x1c4, "csif"), 3856 + TEGRA_IO_PAD(TEGRA_IO_PAD_DBG, 25, 0x1b8, 0x1bc, "dbg"), 3857 + TEGRA_IO_PAD(TEGRA_IO_PAD_DEBUG_NONAO, 26, 0x1b8, 0x1bc, "debug-nonao"), 3858 + TEGRA_IO_PAD(TEGRA_IO_PAD_DMIC, 18, 0x1c0, 0x1c4, "dmic"), 3859 + TEGRA_IO_PAD(TEGRA_IO_PAD_DP, 19, 0x1c0, 0x1c4, "dp"), 3860 + TEGRA_IO_PAD(TEGRA_IO_PAD_DSI, 2, 0x1b8, 0x1bc, "dsi"), 3861 + TEGRA_IO_PAD(TEGRA_IO_PAD_DSIB, 7, 0x1c0, 0x1c4, "dsib"), 3862 + TEGRA_IO_PAD(TEGRA_IO_PAD_DSIC, 8, 0x1c0, 0x1c4, "dsic"), 3863 + TEGRA_IO_PAD(TEGRA_IO_PAD_DSID, 9, 0x1c0, 0x1c4, "dsid"), 3864 + TEGRA_IO_PAD(TEGRA_IO_PAD_EMMC, 3, 0x1c0, 0x1c4, "emmc"), 3865 + TEGRA_IO_PAD(TEGRA_IO_PAD_EMMC2, 5, 0x1c0, 0x1c4, "emmc2"), 3866 + TEGRA_IO_PAD(TEGRA_IO_PAD_GPIO, 27, 0x1b8, 0x1bc, "gpio"), 3867 + TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI, 28, 0x1b8, 0x1bc, "hdmi"), 3868 + TEGRA_IO_PAD(TEGRA_IO_PAD_HSIC, 19, 0x1b8, 0x1bc, "hsic"), 3869 + TEGRA_IO_PAD(TEGRA_IO_PAD_LVDS, 25, 0x1c0, 0x1c4, "lvds"), 3870 + TEGRA_IO_PAD(TEGRA_IO_PAD_MIPI_BIAS, 3, 0x1b8, 0x1bc, "mipi-bias"), 3871 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_BIAS, 4, 0x1b8, 0x1bc, "pex-bias"), 3872 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK1, 5, 0x1b8, 0x1bc, "pex-clk1"), 3873 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK2, 6, 0x1b8, 0x1bc, "pex-clk2"), 3874 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CNTRL, UINT_MAX, UINT_MAX, UINT_MAX, "pex-cntrl"), 3875 + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC1, 1, 0x1c0, 0x1c4, "sdmmc1"), 3876 + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC3, 2, 0x1c0, 0x1c4, "sdmmc3"), 3877 + TEGRA_IO_PAD(TEGRA_IO_PAD_SPI, 14, 0x1c0, 0x1c4, "spi"), 3878 + TEGRA_IO_PAD(TEGRA_IO_PAD_SPI_HV, 15, 0x1c0, 0x1c4, "spi-hv"), 3879 + TEGRA_IO_PAD(TEGRA_IO_PAD_UART, 14, 0x1b8, 0x1bc, "uart"), 3880 + TEGRA_IO_PAD(TEGRA_IO_PAD_USB0, 9, 0x1b8, 0x1bc, "usb0"), 3881 + TEGRA_IO_PAD(TEGRA_IO_PAD_USB1, 10, 0x1b8, 0x1bc, "usb1"), 3882 + TEGRA_IO_PAD(TEGRA_IO_PAD_USB2, 11, 0x1b8, 0x1bc, "usb2"), 3883 + TEGRA_IO_PAD(TEGRA_IO_PAD_USB3, 18, 0x1b8, 0x1bc, "usb3"), 3884 + TEGRA_IO_PAD(TEGRA_IO_PAD_USB_BIAS, 12, 0x1b8, 0x1bc, "usb-bias"), 3916 3885 }; 3917 3886 3887 + static const struct tegra_io_pad_vctrl tegra210_io_pad_vctrls[] = { 3888 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_AUDIO, PMC_PWR_DET_VALUE, 5), 3889 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_AUDIO_HV, PMC_PWR_DET_VALUE, 18), 3890 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_CAM, PMC_PWR_DET_VALUE, 10), 3891 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_DBG, PMC_PWR_DET_VALUE, 19), 3892 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_DMIC, PMC_PWR_DET_VALUE, 20), 3893 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_GPIO, PMC_PWR_DET_VALUE, 21), 3894 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_PEX_CNTRL, PMC_PWR_DET_VALUE, 11), 3895 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_SDMMC1, PMC_PWR_DET_VALUE, 12), 3896 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_SDMMC3, PMC_PWR_DET_VALUE, 13), 3897 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_SPI, PMC_PWR_DET_VALUE, 22), 3898 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_SPI_HV, PMC_PWR_DET_VALUE, 23), 3899 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_UART, PMC_PWR_DET_VALUE, 2), 3900 + }; 3918 3901 static const struct pinctrl_pin_desc tegra210_pin_descs[] = { 3919 3902 TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_AUDIO, "audio"), 3920 3903 TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_AUDIO_HV, "audio-hv"), ··· 3993 3948 .has_tsense_reset = true, 3994 3949 .has_gpu_clamps = true, 3995 3950 .needs_mbist_war = true, 3996 - .has_impl_33v_pwr = false, 3951 + .has_io_pad_wren = true, 3997 3952 .maybe_tz_only = true, 3998 3953 .num_io_pads = ARRAY_SIZE(tegra210_io_pads), 3999 3954 .io_pads = tegra210_io_pads, 3955 + .num_io_pad_vctrls = ARRAY_SIZE(tegra210_io_pad_vctrls), 3956 + .io_pad_vctrls = tegra210_io_pad_vctrls, 4000 3957 .num_pin_descs = ARRAY_SIZE(tegra210_pin_descs), 4001 3958 .pin_descs = tegra210_pin_descs, 4002 3959 .regs = &tegra20_pmc_regs, ··· 4021 3974 }; 4022 3975 4023 3976 static const struct tegra_io_pad_soc tegra186_io_pads[] = { 4024 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIA, 0, 0x74, 0x78, UINT_MAX, "csia"), 4025 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIB, 1, 0x74, 0x78, UINT_MAX, "csib"), 4026 - TEGRA_IO_PAD(TEGRA_IO_PAD_DSI, 2, 0x74, 0x78, UINT_MAX, "dsi"), 4027 - TEGRA_IO_PAD(TEGRA_IO_PAD_MIPI_BIAS, 3, 0x74, 0x78, UINT_MAX, "mipi-bias"), 4028 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK_BIAS, 4, 0x74, 0x78, UINT_MAX, "pex-clk-bias"), 4029 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK3, 5, 0x74, 0x78, UINT_MAX, "pex-clk3"), 4030 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK2, 6, 0x74, 0x78, UINT_MAX, "pex-clk2"), 4031 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK1, 7, 0x74, 0x78, UINT_MAX, "pex-clk1"), 4032 - TEGRA_IO_PAD(TEGRA_IO_PAD_USB0, 9, 0x74, 0x78, UINT_MAX, "usb0"), 4033 - TEGRA_IO_PAD(TEGRA_IO_PAD_USB1, 10, 0x74, 0x78, UINT_MAX, "usb1"), 4034 - TEGRA_IO_PAD(TEGRA_IO_PAD_USB2, 11, 0x74, 0x78, UINT_MAX, "usb2"), 4035 - TEGRA_IO_PAD(TEGRA_IO_PAD_USB_BIAS, 12, 0x74, 0x78, UINT_MAX, "usb-bias"), 4036 - TEGRA_IO_PAD(TEGRA_IO_PAD_UART, 14, 0x74, 0x78, UINT_MAX, "uart"), 4037 - TEGRA_IO_PAD(TEGRA_IO_PAD_AUDIO, 17, 0x74, 0x78, UINT_MAX, "audio"), 4038 - TEGRA_IO_PAD(TEGRA_IO_PAD_HSIC, 19, 0x74, 0x78, UINT_MAX, "hsic"), 4039 - TEGRA_IO_PAD(TEGRA_IO_PAD_DBG, 25, 0x74, 0x78, UINT_MAX, "dbg"), 4040 - TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI_DP0, 28, 0x74, 0x78, UINT_MAX, "hdmi-dp0"), 4041 - TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI_DP1, 29, 0x74, 0x78, UINT_MAX, "hdmi-dp1"), 4042 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CNTRL, 0, 0x7c, 0x80, UINT_MAX, "pex-cntrl"), 4043 - TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC2_HV, 2, 0x7c, 0x80, 5, "sdmmc2-hv"), 4044 - TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC4, 4, 0x7c, 0x80, UINT_MAX, "sdmmc4"), 4045 - TEGRA_IO_PAD(TEGRA_IO_PAD_CAM, 6, 0x7c, 0x80, UINT_MAX, "cam"), 4046 - TEGRA_IO_PAD(TEGRA_IO_PAD_DSIB, 8, 0x7c, 0x80, UINT_MAX, "dsib"), 4047 - TEGRA_IO_PAD(TEGRA_IO_PAD_DSIC, 9, 0x7c, 0x80, UINT_MAX, "dsic"), 4048 - TEGRA_IO_PAD(TEGRA_IO_PAD_DSID, 10, 0x7c, 0x80, UINT_MAX, "dsid"), 4049 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIC, 11, 0x7c, 0x80, UINT_MAX, "csic"), 4050 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSID, 12, 0x7c, 0x80, UINT_MAX, "csid"), 4051 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIE, 13, 0x7c, 0x80, UINT_MAX, "csie"), 4052 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIF, 14, 0x7c, 0x80, UINT_MAX, "csif"), 4053 - TEGRA_IO_PAD(TEGRA_IO_PAD_SPI, 15, 0x7c, 0x80, UINT_MAX, "spi"), 4054 - TEGRA_IO_PAD(TEGRA_IO_PAD_UFS, 17, 0x7c, 0x80, UINT_MAX, "ufs"), 4055 - TEGRA_IO_PAD(TEGRA_IO_PAD_DMIC_HV, 20, 0x7c, 0x80, 2, "dmic-hv"), 4056 - TEGRA_IO_PAD(TEGRA_IO_PAD_EDP, 21, 0x7c, 0x80, UINT_MAX, "edp"), 4057 - TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC1_HV, 23, 0x7c, 0x80, 4, "sdmmc1-hv"), 4058 - TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC3_HV, 24, 0x7c, 0x80, 6, "sdmmc3-hv"), 4059 - TEGRA_IO_PAD(TEGRA_IO_PAD_CONN, 28, 0x7c, 0x80, UINT_MAX, "conn"), 4060 - TEGRA_IO_PAD(TEGRA_IO_PAD_AUDIO_HV, 29, 0x7c, 0x80, 1, "audio-hv"), 4061 - TEGRA_IO_PAD(TEGRA_IO_PAD_AO_HV, UINT_MAX, UINT_MAX, UINT_MAX, 0, "ao-hv"), 3977 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIA, 0, 0x74, 0x78, "csia"), 3978 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIB, 1, 0x74, 0x78, "csib"), 3979 + TEGRA_IO_PAD(TEGRA_IO_PAD_DSI, 2, 0x74, 0x78, "dsi"), 3980 + TEGRA_IO_PAD(TEGRA_IO_PAD_MIPI_BIAS, 3, 0x74, 0x78, "mipi-bias"), 3981 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK_BIAS, 4, 0x74, 0x78, "pex-clk-bias"), 3982 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK3, 5, 0x74, 0x78, "pex-clk3"), 3983 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK2, 6, 0x74, 0x78, "pex-clk2"), 3984 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK1, 7, 0x74, 0x78, "pex-clk1"), 3985 + TEGRA_IO_PAD(TEGRA_IO_PAD_USB0, 9, 0x74, 0x78, "usb0"), 3986 + TEGRA_IO_PAD(TEGRA_IO_PAD_USB1, 10, 0x74, 0x78, "usb1"), 3987 + TEGRA_IO_PAD(TEGRA_IO_PAD_USB2, 11, 0x74, 0x78, "usb2"), 3988 + TEGRA_IO_PAD(TEGRA_IO_PAD_USB_BIAS, 12, 0x74, 0x78, "usb-bias"), 3989 + TEGRA_IO_PAD(TEGRA_IO_PAD_UART, 14, 0x74, 0x78, "uart"), 3990 + TEGRA_IO_PAD(TEGRA_IO_PAD_AUDIO, 17, 0x74, 0x78, "audio"), 3991 + TEGRA_IO_PAD(TEGRA_IO_PAD_HSIC, 19, 0x74, 0x78, "hsic"), 3992 + TEGRA_IO_PAD(TEGRA_IO_PAD_DBG, 25, 0x74, 0x78, "dbg"), 3993 + TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI_DP0, 28, 0x74, 0x78, "hdmi-dp0"), 3994 + TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI_DP1, 29, 0x74, 0x78, "hdmi-dp1"), 3995 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CNTRL, 0, 0x7c, 0x80, "pex-cntrl"), 3996 + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC2_HV, 2, 0x7c, 0x80, "sdmmc2-hv"), 3997 + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC4, 4, 0x7c, 0x80, "sdmmc4"), 3998 + TEGRA_IO_PAD(TEGRA_IO_PAD_CAM, 6, 0x7c, 0x80, "cam"), 3999 + TEGRA_IO_PAD(TEGRA_IO_PAD_DSIB, 8, 0x7c, 0x80, "dsib"), 4000 + TEGRA_IO_PAD(TEGRA_IO_PAD_DSIC, 9, 0x7c, 0x80, "dsic"), 4001 + TEGRA_IO_PAD(TEGRA_IO_PAD_DSID, 10, 0x7c, 0x80, "dsid"), 4002 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIC, 11, 0x7c, 0x80, "csic"), 4003 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSID, 12, 0x7c, 0x80, "csid"), 4004 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIE, 13, 0x7c, 0x80, "csie"), 4005 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIF, 14, 0x7c, 0x80, "csif"), 4006 + TEGRA_IO_PAD(TEGRA_IO_PAD_SPI, 15, 0x7c, 0x80, "spi"), 4007 + TEGRA_IO_PAD(TEGRA_IO_PAD_UFS, 17, 0x7c, 0x80, "ufs"), 4008 + TEGRA_IO_PAD(TEGRA_IO_PAD_DMIC_HV, 20, 0x7c, 0x80, "dmic-hv"), 4009 + TEGRA_IO_PAD(TEGRA_IO_PAD_EDP, 21, 0x7c, 0x80, "edp"), 4010 + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC1_HV, 23, 0x7c, 0x80, "sdmmc1-hv"), 4011 + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC3_HV, 24, 0x7c, 0x80, "sdmmc3-hv"), 4012 + TEGRA_IO_PAD(TEGRA_IO_PAD_CONN, 28, 0x7c, 0x80, "conn"), 4013 + TEGRA_IO_PAD(TEGRA_IO_PAD_AUDIO_HV, 29, 0x7c, 0x80, "audio-hv"), 4014 + TEGRA_IO_PAD(TEGRA_IO_PAD_AO_HV, UINT_MAX, UINT_MAX, UINT_MAX, "ao-hv"), 4015 + }; 4016 + 4017 + static const struct tegra_io_pad_vctrl tegra186_io_pad_vctrls[] = { 4018 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_SDMMC2_HV, PMC_IMPL_E_33V_PWR, 5), 4019 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_DMIC_HV, PMC_IMPL_E_33V_PWR, 2), 4020 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_SDMMC1_HV, PMC_IMPL_E_33V_PWR, 4), 4021 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_SDMMC3_HV, PMC_IMPL_E_33V_PWR, 6), 4022 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_AUDIO_HV, PMC_IMPL_E_33V_PWR, 1), 4023 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_AO_HV, PMC_IMPL_E_33V_PWR, 0), 4062 4024 }; 4063 4025 4064 4026 static const struct pinctrl_pin_desc tegra186_pin_descs[] = { ··· 4118 4062 .rst_source_mask = 0x3c, 4119 4063 .rst_level_shift = 0x0, 4120 4064 .rst_level_mask = 0x3, 4065 + .aowake_mask_w = 0x180, 4066 + .aowake_status_w = 0x30c, 4067 + .aowake_status_r = 0x48c, 4068 + .aowake_tier2_routing = 0x4cc, 4069 + .aowake_sw_status_w = 0x49c, 4070 + .aowake_sw_status = 0x4a0, 4071 + .aowake_latch_sw = 0x498, 4072 + .aowake_ctrl = 0x4f4, 4121 4073 }; 4122 4074 4123 4075 static void tegra186_pmc_init(struct tegra_pmc *pmc) ··· 4158 4094 return; 4159 4095 } 4160 4096 4161 - value = readl(wake + WAKE_AOWAKE_CTRL); 4097 + value = readl(wake + pmc->soc->regs->aowake_ctrl); 4162 4098 4163 4099 if (invert) 4164 4100 value |= WAKE_AOWAKE_CTRL_INTR_POLARITY; 4165 4101 else 4166 4102 value &= ~WAKE_AOWAKE_CTRL_INTR_POLARITY; 4167 4103 4168 - writel(value, wake + WAKE_AOWAKE_CTRL); 4104 + writel(value, wake + pmc->soc->regs->aowake_ctrl); 4169 4105 4170 4106 iounmap(wake); 4171 4107 } ··· 4207 4143 .has_tsense_reset = false, 4208 4144 .has_gpu_clamps = false, 4209 4145 .needs_mbist_war = false, 4210 - .has_impl_33v_pwr = true, 4146 + .has_io_pad_wren = false, 4211 4147 .maybe_tz_only = false, 4212 4148 .num_io_pads = ARRAY_SIZE(tegra186_io_pads), 4213 4149 .io_pads = tegra186_io_pads, 4150 + .num_io_pad_vctrls = ARRAY_SIZE(tegra186_io_pad_vctrls), 4151 + .io_pad_vctrls = tegra186_io_pad_vctrls, 4214 4152 .num_pin_descs = ARRAY_SIZE(tegra186_pin_descs), 4215 4153 .pin_descs = tegra186_pin_descs, 4216 4154 .regs = &tegra186_pmc_regs, ··· 4237 4171 }; 4238 4172 4239 4173 static const struct tegra_io_pad_soc tegra194_io_pads[] = { 4240 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIA, 0, 0x74, 0x78, UINT_MAX, "csia"), 4241 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIB, 1, 0x74, 0x78, UINT_MAX, "csib"), 4242 - TEGRA_IO_PAD(TEGRA_IO_PAD_MIPI_BIAS, 3, 0x74, 0x78, UINT_MAX, "mipi-bias"), 4243 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK_BIAS, 4, 0x74, 0x78, UINT_MAX, "pex-clk-bias"), 4244 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK3, 5, 0x74, 0x78, UINT_MAX, "pex-clk3"), 4245 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK2, 6, 0x74, 0x78, UINT_MAX, "pex-clk2"), 4246 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK1, 7, 0x74, 0x78, UINT_MAX, "pex-clk1"), 4247 - TEGRA_IO_PAD(TEGRA_IO_PAD_EQOS, 8, 0x74, 0x78, UINT_MAX, "eqos"), 4248 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK_2_BIAS, 9, 0x74, 0x78, UINT_MAX, "pex-clk-2-bias"), 4249 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK_2, 10, 0x74, 0x78, UINT_MAX, "pex-clk-2"), 4250 - TEGRA_IO_PAD(TEGRA_IO_PAD_DAP3, 11, 0x74, 0x78, UINT_MAX, "dap3"), 4251 - TEGRA_IO_PAD(TEGRA_IO_PAD_DAP5, 12, 0x74, 0x78, UINT_MAX, "dap5"), 4252 - TEGRA_IO_PAD(TEGRA_IO_PAD_UART, 14, 0x74, 0x78, UINT_MAX, "uart"), 4253 - TEGRA_IO_PAD(TEGRA_IO_PAD_PWR_CTL, 15, 0x74, 0x78, UINT_MAX, "pwr-ctl"), 4254 - TEGRA_IO_PAD(TEGRA_IO_PAD_SOC_GPIO53, 16, 0x74, 0x78, UINT_MAX, "soc-gpio53"), 4255 - TEGRA_IO_PAD(TEGRA_IO_PAD_AUDIO, 17, 0x74, 0x78, UINT_MAX, "audio"), 4256 - TEGRA_IO_PAD(TEGRA_IO_PAD_GP_PWM2, 18, 0x74, 0x78, UINT_MAX, "gp-pwm2"), 4257 - TEGRA_IO_PAD(TEGRA_IO_PAD_GP_PWM3, 19, 0x74, 0x78, UINT_MAX, "gp-pwm3"), 4258 - TEGRA_IO_PAD(TEGRA_IO_PAD_SOC_GPIO12, 20, 0x74, 0x78, UINT_MAX, "soc-gpio12"), 4259 - TEGRA_IO_PAD(TEGRA_IO_PAD_SOC_GPIO13, 21, 0x74, 0x78, UINT_MAX, "soc-gpio13"), 4260 - TEGRA_IO_PAD(TEGRA_IO_PAD_SOC_GPIO10, 22, 0x74, 0x78, UINT_MAX, "soc-gpio10"), 4261 - TEGRA_IO_PAD(TEGRA_IO_PAD_UART4, 23, 0x74, 0x78, UINT_MAX, "uart4"), 4262 - TEGRA_IO_PAD(TEGRA_IO_PAD_UART5, 24, 0x74, 0x78, UINT_MAX, "uart5"), 4263 - TEGRA_IO_PAD(TEGRA_IO_PAD_DBG, 25, 0x74, 0x78, UINT_MAX, "dbg"), 4264 - TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI_DP3, 26, 0x74, 0x78, UINT_MAX, "hdmi-dp3"), 4265 - TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI_DP2, 27, 0x74, 0x78, UINT_MAX, "hdmi-dp2"), 4266 - TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI_DP0, 28, 0x74, 0x78, UINT_MAX, "hdmi-dp0"), 4267 - TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI_DP1, 29, 0x74, 0x78, UINT_MAX, "hdmi-dp1"), 4268 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CNTRL, 0, 0x7c, 0x80, UINT_MAX, "pex-cntrl"), 4269 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CTL2, 1, 0x7c, 0x80, UINT_MAX, "pex-ctl2"), 4270 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_L0_RST, 2, 0x7c, 0x80, UINT_MAX, "pex-l0-rst"), 4271 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_L1_RST, 3, 0x7c, 0x80, UINT_MAX, "pex-l1-rst"), 4272 - TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC4, 4, 0x7c, 0x80, UINT_MAX, "sdmmc4"), 4273 - TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_L5_RST, 5, 0x7c, 0x80, UINT_MAX, "pex-l5-rst"), 4274 - TEGRA_IO_PAD(TEGRA_IO_PAD_CAM, 6, 0x7c, 0x80, UINT_MAX, "cam"), 4275 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIC, 11, 0x7c, 0x80, UINT_MAX, "csic"), 4276 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSID, 12, 0x7c, 0x80, UINT_MAX, "csid"), 4277 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIE, 13, 0x7c, 0x80, UINT_MAX, "csie"), 4278 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIF, 14, 0x7c, 0x80, UINT_MAX, "csif"), 4279 - TEGRA_IO_PAD(TEGRA_IO_PAD_SPI, 15, 0x7c, 0x80, UINT_MAX, "spi"), 4280 - TEGRA_IO_PAD(TEGRA_IO_PAD_UFS, 17, 0x7c, 0x80, UINT_MAX, "ufs"), 4281 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIG, 18, 0x7c, 0x80, UINT_MAX, "csig"), 4282 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIH, 19, 0x7c, 0x80, UINT_MAX, "csih"), 4283 - TEGRA_IO_PAD(TEGRA_IO_PAD_EDP, 21, 0x7c, 0x80, UINT_MAX, "edp"), 4284 - TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC1_HV, 23, 0x7c, 0x80, 4, "sdmmc1-hv"), 4285 - TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC3_HV, 24, 0x7c, 0x80, 6, "sdmmc3-hv"), 4286 - TEGRA_IO_PAD(TEGRA_IO_PAD_CONN, 28, 0x7c, 0x80, UINT_MAX, "conn"), 4287 - TEGRA_IO_PAD(TEGRA_IO_PAD_AUDIO_HV, 29, 0x7c, 0x80, 1, "audio-hv"), 4288 - TEGRA_IO_PAD(TEGRA_IO_PAD_AO_HV, UINT_MAX, UINT_MAX, UINT_MAX, 0, "ao-hv"), 4174 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIA, 0, 0x74, 0x78, "csia"), 4175 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIB, 1, 0x74, 0x78, "csib"), 4176 + TEGRA_IO_PAD(TEGRA_IO_PAD_MIPI_BIAS, 3, 0x74, 0x78, "mipi-bias"), 4177 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK_BIAS, 4, 0x74, 0x78, "pex-clk-bias"), 4178 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK3, 5, 0x74, 0x78, "pex-clk3"), 4179 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK2, 6, 0x74, 0x78, "pex-clk2"), 4180 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK1, 7, 0x74, 0x78, "pex-clk1"), 4181 + TEGRA_IO_PAD(TEGRA_IO_PAD_EQOS, 8, 0x74, 0x78, "eqos"), 4182 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK_2_BIAS, 9, 0x74, 0x78, "pex-clk-2-bias"), 4183 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CLK_2, 10, 0x74, 0x78, "pex-clk-2"), 4184 + TEGRA_IO_PAD(TEGRA_IO_PAD_DAP3, 11, 0x74, 0x78, "dap3"), 4185 + TEGRA_IO_PAD(TEGRA_IO_PAD_DAP5, 12, 0x74, 0x78, "dap5"), 4186 + TEGRA_IO_PAD(TEGRA_IO_PAD_UART, 14, 0x74, 0x78, "uart"), 4187 + TEGRA_IO_PAD(TEGRA_IO_PAD_PWR_CTL, 15, 0x74, 0x78, "pwr-ctl"), 4188 + TEGRA_IO_PAD(TEGRA_IO_PAD_SOC_GPIO53, 16, 0x74, 0x78, "soc-gpio53"), 4189 + TEGRA_IO_PAD(TEGRA_IO_PAD_AUDIO, 17, 0x74, 0x78, "audio"), 4190 + TEGRA_IO_PAD(TEGRA_IO_PAD_GP_PWM2, 18, 0x74, 0x78, "gp-pwm2"), 4191 + TEGRA_IO_PAD(TEGRA_IO_PAD_GP_PWM3, 19, 0x74, 0x78, "gp-pwm3"), 4192 + TEGRA_IO_PAD(TEGRA_IO_PAD_SOC_GPIO12, 20, 0x74, 0x78, "soc-gpio12"), 4193 + TEGRA_IO_PAD(TEGRA_IO_PAD_SOC_GPIO13, 21, 0x74, 0x78, "soc-gpio13"), 4194 + TEGRA_IO_PAD(TEGRA_IO_PAD_SOC_GPIO10, 22, 0x74, 0x78, "soc-gpio10"), 4195 + TEGRA_IO_PAD(TEGRA_IO_PAD_UART4, 23, 0x74, 0x78, "uart4"), 4196 + TEGRA_IO_PAD(TEGRA_IO_PAD_UART5, 24, 0x74, 0x78, "uart5"), 4197 + TEGRA_IO_PAD(TEGRA_IO_PAD_DBG, 25, 0x74, 0x78, "dbg"), 4198 + TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI_DP3, 26, 0x74, 0x78, "hdmi-dp3"), 4199 + TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI_DP2, 27, 0x74, 0x78, "hdmi-dp2"), 4200 + TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI_DP0, 28, 0x74, 0x78, "hdmi-dp0"), 4201 + TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI_DP1, 29, 0x74, 0x78, "hdmi-dp1"), 4202 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CNTRL, 0, 0x7c, 0x80, "pex-cntrl"), 4203 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_CTL2, 1, 0x7c, 0x80, "pex-ctl2"), 4204 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_L0_RST, 2, 0x7c, 0x80, "pex-l0-rst"), 4205 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_L1_RST, 3, 0x7c, 0x80, "pex-l1-rst"), 4206 + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC4, 4, 0x7c, 0x80, "sdmmc4"), 4207 + TEGRA_IO_PAD(TEGRA_IO_PAD_PEX_L5_RST, 5, 0x7c, 0x80, "pex-l5-rst"), 4208 + TEGRA_IO_PAD(TEGRA_IO_PAD_CAM, 6, 0x7c, 0x80, "cam"), 4209 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIC, 11, 0x7c, 0x80, "csic"), 4210 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSID, 12, 0x7c, 0x80, "csid"), 4211 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIE, 13, 0x7c, 0x80, "csie"), 4212 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIF, 14, 0x7c, 0x80, "csif"), 4213 + TEGRA_IO_PAD(TEGRA_IO_PAD_SPI, 15, 0x7c, 0x80, "spi"), 4214 + TEGRA_IO_PAD(TEGRA_IO_PAD_UFS, 17, 0x7c, 0x80, "ufs"), 4215 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIG, 18, 0x7c, 0x80, "csig"), 4216 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIH, 19, 0x7c, 0x80, "csih"), 4217 + TEGRA_IO_PAD(TEGRA_IO_PAD_EDP, 21, 0x7c, 0x80, "edp"), 4218 + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC1_HV, 23, 0x7c, 0x80, "sdmmc1-hv"), 4219 + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC3_HV, 24, 0x7c, 0x80, "sdmmc3-hv"), 4220 + TEGRA_IO_PAD(TEGRA_IO_PAD_CONN, 28, 0x7c, 0x80, "conn"), 4221 + TEGRA_IO_PAD(TEGRA_IO_PAD_AUDIO_HV, 29, 0x7c, 0x80, "audio-hv"), 4222 + TEGRA_IO_PAD(TEGRA_IO_PAD_AO_HV, UINT_MAX, UINT_MAX, UINT_MAX, "ao-hv"), 4223 + }; 4224 + 4225 + static const struct tegra_io_pad_vctrl tegra194_io_pad_vctrls[] = { 4226 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_SDMMC1_HV, PMC_IMPL_E_33V_PWR, 4), 4227 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_SDMMC3_HV, PMC_IMPL_E_33V_PWR, 6), 4228 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_AUDIO_HV, PMC_IMPL_E_33V_PWR, 1), 4229 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_AO_HV, PMC_IMPL_E_33V_PWR, 0), 4289 4230 }; 4290 4231 4291 4232 static const struct pinctrl_pin_desc tegra194_pin_descs[] = { ··· 4354 4281 .rst_source_mask = 0x7c, 4355 4282 .rst_level_shift = 0x0, 4356 4283 .rst_level_mask = 0x3, 4284 + .aowake_mask_w = 0x180, 4285 + .aowake_status_w = 0x30c, 4286 + .aowake_status_r = 0x48c, 4287 + .aowake_tier2_routing = 0x4cc, 4288 + .aowake_sw_status_w = 0x49c, 4289 + .aowake_sw_status = 0x4a0, 4290 + .aowake_latch_sw = 0x498, 4291 + .aowake_ctrl = 0x4f4, 4357 4292 }; 4358 4293 4359 4294 static const char * const tegra194_reset_sources[] = { ··· 4411 4330 .has_tsense_reset = false, 4412 4331 .has_gpu_clamps = false, 4413 4332 .needs_mbist_war = false, 4414 - .has_impl_33v_pwr = true, 4333 + .has_io_pad_wren = false, 4415 4334 .maybe_tz_only = false, 4416 4335 .num_io_pads = ARRAY_SIZE(tegra194_io_pads), 4417 4336 .io_pads = tegra194_io_pads, 4337 + .num_io_pad_vctrls = ARRAY_SIZE(tegra194_io_pad_vctrls), 4338 + .io_pad_vctrls = tegra194_io_pad_vctrls, 4418 4339 .num_pin_descs = ARRAY_SIZE(tegra194_pin_descs), 4419 4340 .pin_descs = tegra194_pin_descs, 4420 4341 .regs = &tegra194_pmc_regs, ··· 4441 4358 }; 4442 4359 4443 4360 static const struct tegra_io_pad_soc tegra234_io_pads[] = { 4444 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIA, 0, 0xe0c0, 0xe0c4, UINT_MAX, "csia"), 4445 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIB, 1, 0xe0c0, 0xe0c4, UINT_MAX, "csib"), 4446 - TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI_DP0, 0, 0xe0d0, 0xe0d4, UINT_MAX, "hdmi-dp0"), 4447 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIC, 2, 0xe0c0, 0xe0c4, UINT_MAX, "csic"), 4448 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSID, 3, 0xe0c0, 0xe0c4, UINT_MAX, "csid"), 4449 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIE, 4, 0xe0c0, 0xe0c4, UINT_MAX, "csie"), 4450 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIF, 5, 0xe0c0, 0xe0c4, UINT_MAX, "csif"), 4451 - TEGRA_IO_PAD(TEGRA_IO_PAD_UFS, 0, 0xe064, 0xe068, UINT_MAX, "ufs"), 4452 - TEGRA_IO_PAD(TEGRA_IO_PAD_EDP, 1, 0xe05c, 0xe060, UINT_MAX, "edp"), 4453 - TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC1_HV, 0, 0xe054, 0xe058, 4, "sdmmc1-hv"), 4454 - TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC3_HV, UINT_MAX, UINT_MAX, UINT_MAX, 6, "sdmmc3-hv"), 4455 - TEGRA_IO_PAD(TEGRA_IO_PAD_AUDIO_HV, UINT_MAX, UINT_MAX, UINT_MAX, 1, "audio-hv"), 4456 - TEGRA_IO_PAD(TEGRA_IO_PAD_AO_HV, UINT_MAX, UINT_MAX, UINT_MAX, 0, "ao-hv"), 4457 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIG, 6, 0xe0c0, 0xe0c4, UINT_MAX, "csig"), 4458 - TEGRA_IO_PAD(TEGRA_IO_PAD_CSIH, 7, 0xe0c0, 0xe0c4, UINT_MAX, "csih"), 4361 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIA, 0, 0xe0c0, 0xe0c4, "csia"), 4362 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIB, 1, 0xe0c0, 0xe0c4, "csib"), 4363 + TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI_DP0, 0, 0xe0d0, 0xe0d4, "hdmi-dp0"), 4364 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIC, 2, 0xe0c0, 0xe0c4, "csic"), 4365 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSID, 3, 0xe0c0, 0xe0c4, "csid"), 4366 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIE, 4, 0xe0c0, 0xe0c4, "csie"), 4367 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIF, 5, 0xe0c0, 0xe0c4, "csif"), 4368 + TEGRA_IO_PAD(TEGRA_IO_PAD_UFS, 0, 0xe064, 0xe068, "ufs"), 4369 + TEGRA_IO_PAD(TEGRA_IO_PAD_EDP, 1, 0xe05c, 0xe060, "edp"), 4370 + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC1_HV, 0, 0xe054, 0xe058, "sdmmc1-hv"), 4371 + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC3_HV, UINT_MAX, UINT_MAX, UINT_MAX, "sdmmc3-hv"), 4372 + TEGRA_IO_PAD(TEGRA_IO_PAD_AUDIO_HV, UINT_MAX, UINT_MAX, UINT_MAX, "audio-hv"), 4373 + TEGRA_IO_PAD(TEGRA_IO_PAD_AO_HV, UINT_MAX, UINT_MAX, UINT_MAX, "ao-hv"), 4374 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIG, 6, 0xe0c0, 0xe0c4, "csig"), 4375 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIH, 7, 0xe0c0, 0xe0c4, "csih"), 4376 + }; 4377 + 4378 + static const struct tegra_io_pad_vctrl tegra234_io_pad_vctrls[] = { 4379 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_SDMMC1_HV, PMC_IMPL_E_33V_PWR, 4), 4380 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_SDMMC3_HV, PMC_IMPL_E_33V_PWR, 6), 4381 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_AUDIO_HV, PMC_IMPL_E_33V_PWR, 1), 4382 + TEGRA_IO_PAD_VCTRL(TEGRA_IO_PAD_AO_HV, PMC_IMPL_E_33V_PWR, 0), 4459 4383 }; 4460 4384 4461 4385 static const struct pinctrl_pin_desc tegra234_pin_descs[] = { ··· 4490 4400 .rst_source_mask = 0xfc, 4491 4401 .rst_level_shift = 0x0, 4492 4402 .rst_level_mask = 0x3, 4403 + .aowake_mask_w = 0x180, 4404 + .aowake_status_w = 0x30c, 4405 + .aowake_status_r = 0x48c, 4406 + .aowake_tier2_routing = 0x4cc, 4407 + .aowake_sw_status_w = 0x49c, 4408 + .aowake_sw_status = 0x4a0, 4409 + .aowake_latch_sw = 0x498, 4410 + .aowake_ctrl = 0x4f4, 4493 4411 }; 4494 4412 4495 4413 static const char * const tegra234_reset_sources[] = { ··· 4567 4469 .has_tsense_reset = false, 4568 4470 .has_gpu_clamps = false, 4569 4471 .needs_mbist_war = false, 4570 - .has_impl_33v_pwr = true, 4472 + .has_io_pad_wren = false, 4571 4473 .maybe_tz_only = false, 4572 4474 .num_io_pads = ARRAY_SIZE(tegra234_io_pads), 4573 4475 .io_pads = tegra234_io_pads, 4476 + .num_io_pad_vctrls = ARRAY_SIZE(tegra234_io_pad_vctrls), 4477 + .io_pad_vctrls = tegra234_io_pad_vctrls, 4574 4478 .num_pin_descs = ARRAY_SIZE(tegra234_pin_descs), 4575 4479 .pin_descs = tegra234_pin_descs, 4576 4480 .regs = &tegra234_pmc_regs, ··· 4595 4495 .has_single_mmio_aperture = false, 4596 4496 }; 4597 4497 4498 + #define TEGRA264_IO_PAD_VCTRL(_id, _offset, _ena_3v3, _ena_1v8) \ 4499 + ((struct tegra_io_pad_vctrl) { \ 4500 + .id = (_id), \ 4501 + .offset = (_offset), \ 4502 + .ena_3v3 = (_ena_3v3), \ 4503 + .ena_1v8 = (_ena_1v8), \ 4504 + }) 4505 + 4506 + static const struct tegra_io_pad_soc tegra264_io_pads[] = { 4507 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIA, 0, 0x41020, 0x41024, "csia"), 4508 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIB, 1, 0x41020, 0x41024, "csib"), 4509 + TEGRA_IO_PAD(TEGRA_IO_PAD_HDMI_DP0, 0, 0x41050, 0x41054, "hdmi-dp0"), 4510 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIC, 2, 0x41020, 0x41024, "csic"), 4511 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSID, 3, 0x41020, 0x41024, "csid"), 4512 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIE, 4, 0x41020, 0x41024, "csie"), 4513 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIF, 5, 0x41020, 0x41024, "csif"), 4514 + TEGRA_IO_PAD(TEGRA_IO_PAD_UFS, 4, 0x41040, 0x41044, "ufs0"), 4515 + TEGRA_IO_PAD(TEGRA_IO_PAD_EDP, 0, 0x41028, 0x4102c, "edp"), 4516 + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC1, 0, 0x41090, 0x41094, "sdmmc1"), 4517 + TEGRA_IO_PAD(TEGRA_IO_PAD_SDMMC1_HV, UINT_MAX, UINT_MAX, UINT_MAX, "sdmmc1-hv"), 4518 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIG, 6, 0x41020, 0x41024, "csig"), 4519 + TEGRA_IO_PAD(TEGRA_IO_PAD_CSIH, 7, 0x41020, 0x41024, "csih"), 4520 + }; 4521 + 4522 + static const struct tegra_io_pad_vctrl tegra264_io_pad_vctrls[] = { 4523 + TEGRA264_IO_PAD_VCTRL(TEGRA_IO_PAD_SDMMC1_HV, PMC_IMPL_SDMMC1_HV_PADCTL_0, 0, 0x6), 4524 + }; 4525 + 4526 + static const struct pinctrl_pin_desc tegra264_pin_descs[] = { 4527 + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_CSIA, "csia"), 4528 + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_CSIB, "csib"), 4529 + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_HDMI_DP0, "hdmi-dp0"), 4530 + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_CSIC, "csic"), 4531 + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_CSID, "csid"), 4532 + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_CSIE, "csie"), 4533 + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_CSIF, "csif"), 4534 + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_UFS, "ufs0"), 4535 + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_EDP, "edp"), 4536 + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_SDMMC1, "sdmmc1"), 4537 + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_SDMMC1_HV, "sdmmc1-hv"), 4538 + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_CSIG, "csig"), 4539 + TEGRA_IO_PIN_DESC(TEGRA_IO_PAD_CSIH, "csih"), 4540 + }; 4541 + 4598 4542 static const struct tegra_pmc_regs tegra264_pmc_regs = { 4599 4543 .scratch0 = 0x684, 4600 4544 .rst_status = 0x4, ··· 4646 4502 .rst_source_mask = 0x1fc, 4647 4503 .rst_level_shift = 0x0, 4648 4504 .rst_level_mask = 0x3, 4505 + .aowake_mask_w = 0x200, 4506 + .aowake_status_w = 0x410, 4507 + .aowake_status_r = 0x610, 4508 + .aowake_tier2_routing = 0x660, 4509 + .aowake_sw_status_w = 0x624, 4510 + .aowake_sw_status = 0x628, 4511 + .aowake_latch_sw = 0x620, 4512 + .aowake_ctrl = 0x68c, 4649 4513 }; 4650 4514 4651 4515 static const char * const tegra264_reset_sources[] = { ··· 4747 4595 }; 4748 4596 4749 4597 static const struct tegra_wake_event tegra264_wake_events[] = { 4598 + TEGRA_WAKE_IRQ("pmu", 0, 727), 4599 + TEGRA_WAKE_GPIO("power", 5, 1, TEGRA264_AON_GPIO(AA, 5)), 4600 + TEGRA_WAKE_IRQ("rtc", 65, 548), 4601 + TEGRA_WAKE_IRQ("usb3-port-0", 79, 965), 4602 + TEGRA_WAKE_IRQ("usb3-port-1", 80, 965), 4603 + TEGRA_WAKE_IRQ("usb3-port-3", 82, 965), 4604 + TEGRA_WAKE_IRQ("usb2-port-0", 83, 965), 4605 + TEGRA_WAKE_IRQ("usb2-port-1", 84, 965), 4606 + TEGRA_WAKE_IRQ("usb2-port-2", 85, 965), 4607 + TEGRA_WAKE_IRQ("usb2-port-3", 86, 965), 4750 4608 }; 4751 4609 4752 4610 static const struct tegra_pmc_soc tegra264_pmc_soc = { 4753 - .has_impl_33v_pwr = true, 4611 + .has_io_pad_wren = false, 4612 + .num_io_pads = ARRAY_SIZE(tegra264_io_pads), 4613 + .io_pads = tegra264_io_pads, 4614 + .num_io_pad_vctrls = ARRAY_SIZE(tegra264_io_pad_vctrls), 4615 + .io_pad_vctrls = tegra264_io_pad_vctrls, 4616 + .num_pin_descs = ARRAY_SIZE(tegra264_pin_descs), 4617 + .pin_descs = tegra264_pin_descs, 4754 4618 .regs = &tegra264_pmc_regs, 4755 4619 .init = tegra186_pmc_init, 4756 4620 .setup_irq_polarity = tegra186_pmc_setup_irq_polarity,