From: hdoyu@nvidia.com (Hiroshi Doyu)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] ARM: tegra: Restore USB/PCIE info in new DT board file
Date: Fri, 8 Feb 2013 09:29:34 +0200 [thread overview]
Message-ID: <1360308574-19658-5-git-send-email-hdoyu@nvidia.com> (raw)
In-Reply-To: <1360308574-19658-1-git-send-email-hdoyu@nvidia.com>
Mainly for the compatibility for the existing driver.
This would be removed once new USB/PCIE DT supports come.
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
arch/arm/mach-tegra/tegra.c | 92 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 90 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
index 62ae39a..82fea64 100644
--- a/arch/arm/mach-tegra/tegra.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -23,6 +23,8 @@
#include <linux/of_fdt.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
+#include <linux/platform_data/tegra_usb.h>
+#include <linux/usb/tegra_usb_phy.h>
#include <asm/mach/arch.h>
@@ -30,9 +32,63 @@
#include "common.h"
#include "iomap.h"
+#ifdef USB_EHCI_TEGRA
+static struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = {
+ .reset_gpio = -1,
+ .clk = "cdev2",
+};
+
+static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
+ {
+ .operating_mode = TEGRA_USB_OTG,
+ .power_down_on_bus_suspend = 1,
+ .vbus_gpio = -1,
+ },
+ {
+ .operating_mode = TEGRA_USB_HOST,
+ .power_down_on_bus_suspend = 1,
+ .vbus_gpio = -1,
+ .phy_config = &tegra_ehci2_ulpi_phy_config,
+ },
+ {
+ .operating_mode = TEGRA_USB_HOST,
+ .power_down_on_bus_suspend = 1,
+ .vbus_gpio = -1,
+ },
+};
+
static struct of_dev_auxdata tegra_auxdata_lookup[] __initdata = {
- {},
+ OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xc5000000, "tegra-ehci.0", &tegra_ehci_pdata[0]),
+ OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xc5004000, "tegra-ehci.1", &tegra_ehci_pdata[1]),
+ OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xC5008000, "tegra-ehci.2", &tegra_ehci_pdata[2]),
+ {}
};
+#else
+#define tegra_auxdata_lookup NULL
+#endif
+
+#if defined(CONFIG_TEGRA_PCI) && defined(CONFIG_ARCH_TEGRA_2x_SOC)
+static void __init trimslice_init(void)
+{
+ int err;
+
+ err = tegra_pcie_init(true, true);
+ if (err)
+ pr_err("%s failed: %d\n", __func__, err);
+}
+static void __init harmony_init(void)
+{
+ harmony_pcie_init();
+}
+static void __init paz00_init(void)
+{
+ tegra_paz00_wifikill_init();
+}
+#else
+#define trimslice_init NULL
+#define harmony_init NULL
+#define paz00_init NULL
+#endif
static void __init tegra_dt_init(void)
{
@@ -40,6 +96,38 @@ static void __init tegra_dt_init(void)
tegra_auxdata_lookup, NULL);
}
+static void __init tegra_dt_init_late(void)
+{
+ int i;
+ struct {
+ const char *name;
+ void (*init)(void);
+ } board[] = {
+ {
+ .name = "compulab,trimslice",
+ .init = trimslice_init,
+ },
+ {
+ .name = "nvidia,harmony",
+ .init = harmony_init,
+ },
+ {
+ .name = "compal,paz00",
+ .init = paz00_init
+ },
+ };
+
+ tegra_init_late();
+
+ for (i = 0; i < ARRAY_SIZE(board); i++) {
+ if (of_machine_is_compatible(board[i].name)) {
+ if (board[i].init)
+ board[i].init();
+ break;
+ }
+ }
+}
+
static const char * const tegra_dt_board_compat[] = {
"nvidia,tegra20",
"nvidia,tegra30",
@@ -54,7 +142,7 @@ DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)")
.init_irq = tegra_dt_init_irq,
.init_time = clocksource_of_init,
.init_machine = tegra_dt_init,
- .init_late = tegra_init_late,
+ .init_late = tegra_dt_init_late,
.restart = tegra_assert_system_reset,
.dt_compat = tegra_dt_board_compat,
MACHINE_END
--
1.7.9.5
next prev parent reply other threads:[~2013-02-08 7:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1360308574-19658-1-git-send-email-hdoyu@nvidia.com>
2013-02-08 7:29 ` [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early() Hiroshi Doyu
2013-02-08 7:47 ` Felipe Balbi
2013-02-08 8:09 ` Hiroshi Doyu
2013-02-09 12:18 ` Arnd Bergmann
2013-02-08 12:29 ` Marc Dietrich
2013-02-08 17:09 ` Stephen Warren
2013-02-10 17:28 ` Marc Dietrich
2013-02-10 20:20 ` Stephen Warren
2013-02-10 21:16 ` Marc Dietrich
2013-02-11 4:18 ` Hiroshi Doyu
2013-02-08 7:29 ` [PATCH 2/4] ARM: tegra: Unify board-dt-tegra{30,114}.c Hiroshi Doyu
2013-02-08 7:29 ` [PATCH 3/4] ARM: tegra: Unify board-dt-tegra{20,30}.c to tegra.c Hiroshi Doyu
2013-02-08 7:29 ` Hiroshi Doyu [this message]
2013-02-08 17:58 ` [PATCH 4/4] ARM: tegra: Restore USB/PCIE info in new DT board file Stephen Warren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1360308574-19658-5-git-send-email-hdoyu@nvidia.com \
--to=hdoyu@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).