]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: tegra: add lane tables to Tegra210 XUSB padctl
authorStephen Warren <swarren@nvidia.com>
Fri, 23 Oct 2015 16:50:52 +0000 (10:50 -0600)
committerTom Warren <twarren@nvidia.com>
Thu, 12 Nov 2015 16:21:07 +0000 (09:21 -0700)
Add the tables defining which pads and mux options exist in the Tegra210
XUSB padctl hardware.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
arch/arm/mach-tegra/tegra210/xusb-padctl.c
arch/arm/mach-tegra/xusb-padctl-common.h

index 5033543440673edbb2a23f9a5bb994c681e3e60a..6022f1614bdaf29d563d2f8e71309d6305cbe0b4 100644 (file)
 
 #include <dt-bindings/pinctrl/pinctrl-tegra-xusb.h>
 
+enum tegra210_function {
+       TEGRA210_FUNC_SNPS,
+       TEGRA210_FUNC_XUSB,
+       TEGRA210_FUNC_UART,
+       TEGRA210_FUNC_PCIE_X1,
+       TEGRA210_FUNC_PCIE_X4,
+       TEGRA210_FUNC_USB3,
+       TEGRA210_FUNC_SATA,
+       TEGRA210_FUNC_RSVD,
+};
+
+static const char *const tegra210_functions[] = {
+       "snps",
+       "xusb",
+       "uart",
+       "pcie-x1",
+       "pcie-x4",
+       "usb3",
+       "sata",
+       "rsvd",
+};
+
+static const unsigned int tegra210_otg_functions[] = {
+       TEGRA210_FUNC_SNPS,
+       TEGRA210_FUNC_XUSB,
+       TEGRA210_FUNC_UART,
+       TEGRA210_FUNC_RSVD,
+};
+
+static const unsigned int tegra210_usb_functions[] = {
+       TEGRA210_FUNC_SNPS,
+       TEGRA210_FUNC_XUSB,
+};
+
+static const unsigned int tegra210_pci_functions[] = {
+       TEGRA210_FUNC_PCIE_X1,
+       TEGRA210_FUNC_USB3,
+       TEGRA210_FUNC_SATA,
+       TEGRA210_FUNC_PCIE_X4,
+};
+
+#define TEGRA210_LANE(_name, _offset, _shift, _mask, _iddq, _funcs)    \
+       {                                                               \
+               .name = _name,                                          \
+               .offset = _offset,                                      \
+               .shift = _shift,                                        \
+               .mask = _mask,                                          \
+               .iddq = _iddq,                                          \
+               .num_funcs = ARRAY_SIZE(tegra210_##_funcs##_functions), \
+               .funcs = tegra210_##_funcs##_functions,                 \
+       }
+
+static const struct tegra_xusb_padctl_lane tegra210_lanes[] = {
+       TEGRA210_LANE("otg-0",     0x004,  0, 0x3, 0, otg),
+       TEGRA210_LANE("otg-1",     0x004,  2, 0x3, 0, otg),
+       TEGRA210_LANE("otg-2",     0x004,  4, 0x3, 0, otg),
+       TEGRA210_LANE("otg-3",     0x004,  6, 0x3, 0, otg),
+       TEGRA210_LANE("usb2-bias", 0x004, 18, 0x3, 0, otg),
+       TEGRA210_LANE("hsic-0",    0x004, 14, 0x1, 0, usb),
+       TEGRA210_LANE("hsic-1",    0x004, 15, 0x1, 0, usb),
+       TEGRA210_LANE("pcie-0",    0x028, 12, 0x3, 1, pci),
+       TEGRA210_LANE("pcie-1",    0x028, 14, 0x3, 2, pci),
+       TEGRA210_LANE("pcie-2",    0x028, 16, 0x3, 3, pci),
+       TEGRA210_LANE("pcie-3",    0x028, 18, 0x3, 4, pci),
+       TEGRA210_LANE("pcie-4",    0x028, 20, 0x3, 5, pci),
+       TEGRA210_LANE("pcie-5",    0x028, 22, 0x3, 6, pci),
+       TEGRA210_LANE("pcie-6",    0x028, 24, 0x3, 7, pci),
+       TEGRA210_LANE("sata-0",    0x028, 30, 0x3, 8, pci),
+};
+
 #define XUSB_PADCTL_ELPG_PROGRAM 0x024
 #define  XUSB_PADCTL_ELPG_PROGRAM_AUX_MUX_LP0_VCORE_DOWN (1 << 31)
 #define  XUSB_PADCTL_ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN_EARLY (1 << 30)
@@ -328,10 +398,10 @@ static struct tegra_xusb_phy tegra210_phys[] = {
 };
 
 static const struct tegra_xusb_padctl_soc tegra210_socdata = {
-       .lanes = NULL,
-       .num_lanes = 0,
-       .functions = NULL,
-       .num_functions = 0,
+       .lanes = tegra210_lanes,
+       .num_lanes = ARRAY_SIZE(tegra210_lanes),
+       .functions = tegra210_functions,
+       .num_functions = ARRAY_SIZE(tegra210_functions),
        .phys = tegra210_phys,
        .num_phys = ARRAY_SIZE(tegra210_phys),
 };
index 11ecb99b749d11892d78aa093d92761ad64fb2f7..f44790a65004e8a5192dbc8fc094a236c3d2adc3 100644 (file)
@@ -45,8 +45,8 @@ struct tegra_xusb_padctl_pin {
        int iddq;
 };
 
-#define MAX_GROUPS 3
-#define MAX_PINS 6
+#define MAX_GROUPS 5
+#define MAX_PINS 7
 
 struct tegra_xusb_padctl_group {
        const char *name;