From: Jim Lin <jilin@nvidia.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] ARM: Tegra: FDT: Add USB support for T20/T30/T114
Date: Mon, 29 Apr 2013 17:21:13 +0800 [thread overview]
Message-ID: <1367227275-7713-2-git-send-email-jilin@nvidia.com> (raw)
In-Reply-To: <1367227275-7713-1-git-send-email-jilin@nvidia.com>
Add DT node for USB function.
Signed-off-by: Jim Lin <jilin@nvidia.com>
---
arch/arm/dts/tegra114.dtsi | 105 ++++++++++++++++++++++++++++++++
arch/arm/dts/tegra20.dtsi | 81 ++++++++++++++++++++++++
arch/arm/dts/tegra30.dtsi | 108 +++++++++++++++++++++++++++++++++
board/nvidia/dts/tegra114-dalmore.dts | 7 ++
board/nvidia/dts/tegra30-cardhu.dts | 6 ++
include/fdtdec.h | 2 +
lib/fdtdec.c | 2 +
7 files changed, 311 insertions(+), 0 deletions(-)
diff --git a/arch/arm/dts/tegra114.dtsi b/arch/arm/dts/tegra114.dtsi
index f86d18d..0f8387b 100644
--- a/arch/arm/dts/tegra114.dtsi
+++ b/arch/arm/dts/tegra114.dtsi
@@ -216,4 +216,109 @@
clocks = <&tegra_car 15>;
status = "disable";
};
+
+/* This table has USB timing parameters for each Oscillator frequency we
+ * support. There are four sets of values:
+ *
+ * 1. PLLU configuration information (reference clock is osc/clk_m and
+ * PLLU-FOs are fixed at 12MHz/60MHz/480MHz).
+ * Reference frequency MHZ 12.0 13.0 19.2 26.0
+ * ----------------------------------------------------
+ * DIVN 960 960 200 960
+ * DIVM 12 13 4 26
+ * CPCON 12 12 3 12
+ * LFCON 2 2 2 2
+ *
+ * 2. PLL CONFIGURATION & PARAMETERS for different clock generators:
+ * Reference frequency MHZ 12.0 13.0 19.2 26.0
+ * ----------------------------------------------------
+ * PLLU_ENABLE_DLY_COUNT 02 2 3 4
+ * PLLU_STABLE_COUNT 47 51 75 102
+ * PLL_ACTIVE_DLY_COUNT 08 9 12 9
+ * XTAL_FREQ_COUNT 118 127 188 254
+ *
+ * 3. Debounce values IdDig, Avalid, Bvalid, VbusValid, VbusWakeUp, and
+ * SessEnd. Each of these signals have their own debouncer and for each of
+ * those one out of two debouncing times can be chosen (BIAS_DEBOUNCE_A or
+ * BIAS_DEBOUNCE_B).
+ *
+ * The values of DEBOUNCE_A and DEBOUNCE_B are calculated as follows:
+ * 0xffff -> No debouncing at all
+ * <n> ms = <n> * 1000 / (1/19.2MHz) / 4
+ *
+ * So to program a 10 ms debounce for BIAS_DEBOUNCE_A, we have:
+ * BIAS_DEBOUNCE_A[15:0] = 10 * 1000 * 19.2 / 4 = 48000 = 0xBB80
+ *
+ * We need to use only DebounceA for BOOTROM. We don't need the DebounceB
+ * values, so we can keep those to default.
+ *
+ * 4. The 20 microsecond delay after bias cell operation.
+ * UTMIP_BIAS_PAD_TRK_COUNT
+ *
+ * enum {
+ * PARAM_DIVN, // PLL FEEDBACK DIVIDER
+ * PARAM_DIVM, // PLL INPUT DIVIDER
+ * PARAM_DIVP, // POST DIVIDER (2^N)
+ * PARAM_CPCON, // BASE PLLC CHARGE Pump setup ctrl
+ * PARAM_LFCON, // BASE PLLC LOOP FILter setup ctrl
+ * PARAM_ENABLE_DELAY_COUNT, // PLL-U Enable Delay Count
+ * PARAM_STABLE_COUNT, // PLL-U STABLE count
+ * PARAM_ACTIVE_DELAY_COUNT, // PLL-U Active delay count
+ * PARAM_XTAL_FREQ_COUNT, // PLL-U XTAL frequency count
+ * PARAM_DEBOUNCE_A_TIME, // 10MS DELAY for BIAS_DEBOUNCE_A
+ * PARAM_BIAS_TIME, // 20US DELAY AFter bias cell op
+ * // UTMIP_BIAS_PAD_TRK_COUNT
+ *};
+ */
+ usbparams at 0 {
+ compatible = "nvidia,usbparams";
+ osc-frequency = <13000000>;
+ /* DivN, DivM, DivP, CPCON, LFCON, Delays Debounce, Bias */
+ params = <0x3c0 0x0d 0x00 0xc 2 0x02 0x33 0x09 0x7f 0x7ef4 6>;
+ };
+
+ usbparams at 1 {
+ compatible = "nvidia,usbparams";
+ osc-frequency = <19200000>;
+ params = <0x0c8 0x04 0x00 0x3 2 0x03 0x4b 0x0c 0xbc 0xbb80 8>;
+ };
+
+ usbparams at 2 {
+ compatible = "nvidia,usbparams";
+ osc-frequency = <12000000>;
+ params = <0x3c0 0x0c 0x00 0xc 2 0x02 0x2f 0x08 0x76 0x7530 5>;
+ };
+
+ usbparams at 3 {
+ compatible = "nvidia,usbparams";
+ osc-frequency = <26000000>;
+ params = <0x3c0 0x1a 0x00 0xc 2 0x04 0x66 0x09 0xfe 0xfde8 0xb>;
+ };
+
+ usb at 7d000000 {
+ compatible = "nvidia,tegra30-ehci", "nvidia,tegra114-ehci";
+ reg = <0x7d000000 0x4000>;
+ interrupts = < 52 >;
+ phy_type = "utmi";
+ clocks = <&tegra_car 22>; /* PERIPH_ID_USBD */
+ status = "disabled";
+ };
+
+ usb at 7d004000 {
+ compatible = "nvidia,tegra30-ehci", "nvidia,tegra114-ehci";
+ reg = <0x7d004000 0x4000>;
+ interrupts = < 53 >;
+ phy_type = "utmi";
+ clocks = <&tegra_car 58>; /* PERIPH_ID_USB2 */
+ status = "disabled";
+ };
+
+ usb at 7d008000 {
+ compatible = "nvidia,tegra30-ehci", "nvidia,tegra114-ehci";
+ reg = <0x7d008000 0x4000>;
+ interrupts = < 129 >;
+ phy_type = "utmi";
+ clocks = <&tegra_car 59>; /* PERIPH_ID_USB3 */
+ status = "disabled";
+ };
};
diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi
index 3805750..d0e39b4 100644
--- a/arch/arm/dts/tegra20.dtsi
+++ b/arch/arm/dts/tegra20.dtsi
@@ -290,6 +290,87 @@
reg = <0x7000f400 0x200>;
};
+/* This table has USB timing parameters for each Oscillator frequency we
+ * support. There are four sets of values:
+ *
+ * 1. PLLU configuration information (reference clock is osc/clk_m and
+ * PLLU-FOs are fixed at 12MHz/60MHz/480MHz).
+ *
+ * Reference frequency 13.0MHz 19.2MHz 12.0MHz 26.0MHz
+ * ----------------------------------------------------------------------
+ * DIVN 960 (0x3c0) 200 (0c8) 960 (3c0h) 960 (3c0)
+ * DIVM 13 (0d) 4 (04) 12 (0c) 26 (1a)
+ * Filter frequency (MHz) 1 4.8 6 2
+ * CPCON 1100b 0011b 1100b 1100b
+ * LFCON0 0 0 0 0
+ *
+ * 2. PLL CONFIGURATION & PARAMETERS for different clock generators:
+ *
+ * Reference frequency 13.0MHz 19.2MHz 12.0MHz 26.0MHz
+ * ---------------------------------------------------------------------------
+ * PLLU_ENABLE_DLY_COUNT 02 (0x02) 03 (03) 02 (02) 04 (04)
+ * PLLU_STABLE_COUNT 51 (33) 75 (4B) 47 (2F) 102 (66)
+ * PLL_ACTIVE_DLY_COUNT 05 (05) 06 (06) 04 (04) 09 (09)
+ * XTAL_FREQ_COUNT 127 (7F) 187 (BB) 118 (76) 254 (FE)
+ *
+ * 3. Debounce values IdDig, Avalid, Bvalid, VbusValid, VbusWakeUp, and
+ * SessEnd. Each of these signals have their own debouncer and for each of
+ * those one out of two debouncing times can be chosen (BIAS_DEBOUNCE_A or
+ * BIAS_DEBOUNCE_B).
+ *
+ * The values of DEBOUNCE_A and DEBOUNCE_B are calculated as follows:
+ * 0xffff -> No debouncing at all
+ * <n> ms = <n> * 1000 / (1/19.2MHz) / 4
+ *
+ * So to program a 10 ms debounce for BIAS_DEBOUNCE_A, we have:
+ * BIAS_DEBOUNCE_A[15:0] = 10 * 1000 * 19.2 / 4 = 48000 = 0xBB80
+ *
+ * We need to use only DebounceA for BOOTROM. We don't need the DebounceB
+ * values, so we can keep those to default.
+ *
+ * 4. The 20 microsecond delay after bias cell operation.
+ * UTMIP_BIAS_PAD_TRK_COUNT
+ *
+ * enum {
+ * PARAM_DIVN, // PLL FEEDBACK DIVIDER
+ * PARAM_DIVM, // PLL INPUT DIVIDER
+ * PARAM_DIVP, // POST DIVIDER (2^N)
+ * PARAM_CPCON, // BASE PLLC CHARGE Pump setup ctrl
+ * PARAM_LFCON, // BASE PLLC LOOP FILter setup ctrl
+ * PARAM_ENABLE_DELAY_COUNT, // PLL-U Enable Delay Count
+ * PARAM_STABLE_COUNT, // PLL-U STABLE count
+ * PARAM_ACTIVE_DELAY_COUNT, // PLL-U Active delay count
+ * PARAM_XTAL_FREQ_COUNT, // PLL-U XTAL frequency count
+ * PARAM_DEBOUNCE_A_TIME, // 10MS DELAY for BIAS_DEBOUNCE_A
+ * PARAM_BIAS_TIME, // 20US DELAY AFter bias cell op
+ * // UTMIP_BIAS_PAD_TRK_COUNT
+ *};
+ */
+ usbparams at 0 {
+ compatible = "nvidia,usbparams";
+ osc-frequency = <13000000>;
+ /* DivN, DivM, DivP, CPCON, LFCON, Delays Debounce, Bias */
+ params = <0x3c0 0x0d 0x00 0xc 0 0x02 0x33 0x05 0x7f 0x7ef4 5>;
+ };
+
+ usbparams at 1 {
+ compatible = "nvidia,usbparams";
+ osc-frequency = <19200000>;
+ params = <0x0c8 0x04 0x00 0x3 0 0x03 0x4b 0x06 0xbb 0xbb80 7>;
+ };
+
+ usbparams at 2 {
+ compatible = "nvidia,usbparams";
+ osc-frequency = <12000000>;
+ params = <0x3c0 0x0c 0x00 0xc 0 0x02 0x2f 0x04 0x76 0x7530 5>;
+ };
+
+ usbparams at 3 {
+ compatible = "nvidia,usbparams";
+ osc-frequency = <26000000>;
+ params = <0x3c0 0x1a 0x00 0xc 0 0x04 0x66 0x09 0xfe 0xfde8 9>;
+ };
+
usb at c5000000 {
compatible = "nvidia,tegra20-ehci", "usb-ehci";
reg = <0xc5000000 0x4000>;
diff --git a/arch/arm/dts/tegra30.dtsi b/arch/arm/dts/tegra30.dtsi
index ccf154f..3e6fbc4 100644
--- a/arch/arm/dts/tegra30.dtsi
+++ b/arch/arm/dts/tegra30.dtsi
@@ -216,4 +216,112 @@
clocks = <&tegra_car 15>;
status = "disabled";
};
+
+/* This table has USB timing parameters for each Oscillator frequency we
+ * support. There are four sets of values:
+ *
+ * 1. PLLU configuration information (reference clock is osc/clk_m and
+ * PLLU-FOs are fixed at 12MHz/60MHz/480MHz).
+ * (T3x)
+ * Reference frequency MHZ 12.0 13.0 19.2 26.0
+ * ----------------------------------------------------
+ * DIVN 960 960 200 960
+ * DIVM 12 13 4 26
+ * CPCON 12 12 3 12
+ * LFCON 1 1 0 1
+ *
+ * 2. PLL CONFIGURATION & PARAMETERS for different clock generators:
+ * (T3x)
+ * Reference frequency MHZ 12.0 13.0 19.2 26.0
+ * ----------------------------------------------------
+ * Index 8 0 4 12
+ * PLLU_ENABLE_DLY_COUNT 02 2 3 4
+ * PLLU_STABLE_COUNT 47 51 75 102
+ * PLL_ACTIVE_DLY_COUNT 08 9 12 9
+ * XTAL_FREQ_COUNT 118 127 188 254
+ *
+ * 3. Debounce values IdDig, Avalid, Bvalid, VbusValid, VbusWakeUp, and
+ * SessEnd. Each of these signals have their own debouncer and for each of
+ * those one out of two debouncing times can be chosen (BIAS_DEBOUNCE_A or
+ * BIAS_DEBOUNCE_B).
+ *
+ * The values of DEBOUNCE_A and DEBOUNCE_B are calculated as follows:
+ * 0xffff -> No debouncing at all
+ * <n> ms = <n> * 1000 / (1/19.2MHz) / 4
+ *
+ * So to program a 10 ms debounce for BIAS_DEBOUNCE_A, we have:
+ * BIAS_DEBOUNCE_A[15:0] = 10 * 1000 * 19.2 / 4 = 48000 = 0xBB80
+ *
+ * We need to use only DebounceA for BOOTROM. We don't need the DebounceB
+ * values, so we can keep those to default.
+ *
+ * 4. The 20 microsecond delay after bias cell operation.
+ * UTMIP_BIAS_PAD_TRK_COUNT
+ *
+ * enum {
+ * PARAM_DIVN, // PLL FEEDBACK DIVIDER
+ * PARAM_DIVM, // PLL INPUT DIVIDER
+ * PARAM_DIVP, // POST DIVIDER (2^N)
+ * PARAM_CPCON, // BASE PLLC CHARGE Pump setup ctrl
+ * PARAM_LFCON, // BASE PLLC LOOP FILter setup ctrl
+ * PARAM_ENABLE_DELAY_COUNT, // PLL-U Enable Delay Count
+ * PARAM_STABLE_COUNT, // PLL-U STABLE count
+ * PARAM_ACTIVE_DELAY_COUNT, // PLL-U Active delay count
+ * PARAM_XTAL_FREQ_COUNT, // PLL-U XTAL frequency count
+ * PARAM_DEBOUNCE_A_TIME, // 10MS DELAY for BIAS_DEBOUNCE_A
+ * PARAM_BIAS_TIME, // 20US DELAY After bias cell op
+ * // UTMIP_BIAS_PAD_TRK_COUNT
+ *};
+ */
+ usbparams at 0 {
+ compatible = "nvidia,usbparams";
+ osc-frequency = <13000000>;
+ /* DivN, DivM, DivP, CPCON, LFCON, Delays Debounce, Bias */
+ params = <0x3c0 0x0d 0x00 0xc 1 0x02 0x33 0x09 0x7f 0x7ef4 5>;
+ };
+
+ usbparams at 1 {
+ compatible = "nvidia,usbparams";
+ osc-frequency = <19200000>;
+ params = <0x0c8 0x04 0x00 0x3 0 0x03 0x4b 0x0c 0xbc 0xbb80 7>;
+ };
+
+ usbparams at 2 {
+ compatible = "nvidia,usbparams";
+ osc-frequency = <12000000>;
+ params = <0x3c0 0x0c 0x00 0xc 1 0x02 0x2f 0x08 0x76 0x7530 5>;
+ };
+
+ usbparams at 3 {
+ compatible = "nvidia,usbparams";
+ osc-frequency = <26000000>;
+ params = <0x3c0 0x1a 0x00 0xc 1 0x04 0x66 0x09 0xfe 0xfde8 9>;
+ };
+
+ usb at 7d000000 {
+ compatible = "nvidia,tegra30-ehci";
+ reg = <0x7d000000 0x4000>;
+ interrupts = < 52 >;
+ phy_type = "utmi";
+ clocks = <&tegra_car 22>; /* PERIPH_ID_USBD */
+ status = "disabled";
+ };
+
+ usb at 7d004000 {
+ compatible = "nvidia,tegra30-ehci";
+ reg = <0x7d004000 0x4000>;
+ interrupts = < 53 >;
+ phy_type = "utmi";
+ clocks = <&tegra_car 58>; /* PERIPH_ID_USB2 */
+ status = "disabled";
+ };
+
+ usb at 7d008000 {
+ compatible = "nvidia,tegra30-ehci";
+ reg = <0x7d008000 0x4000>;
+ interrupts = < 129 >;
+ phy_type = "utmi";
+ clocks = <&tegra_car 59>; /* PERIPH_ID_USB3 */
+ status = "disabled";
+ };
};
diff --git a/board/nvidia/dts/tegra114-dalmore.dts b/board/nvidia/dts/tegra114-dalmore.dts
index 86e9459..435c01e 100644
--- a/board/nvidia/dts/tegra114-dalmore.dts
+++ b/board/nvidia/dts/tegra114-dalmore.dts
@@ -14,6 +14,7 @@
i2c4 = "/i2c at 7000c700";
sdhci0 = "/sdhci at 78000600";
sdhci1 = "/sdhci at 78000400";
+ usb0 = "/usb at 7d008000";
};
memory {
@@ -61,4 +62,10 @@
bus-width = <8>;
status = "okay";
};
+
+ usb at 7d008000 {
+ /* SPDIF_IN: USB_VBUS_EN1 */
+ nvidia,vbus-gpio = <&gpio 86 0>;
+ status = "okay";
+ };
};
diff --git a/board/nvidia/dts/tegra30-cardhu.dts b/board/nvidia/dts/tegra30-cardhu.dts
index 4d22b48..071a464 100644
--- a/board/nvidia/dts/tegra30-cardhu.dts
+++ b/board/nvidia/dts/tegra30-cardhu.dts
@@ -14,6 +14,7 @@
i2c4 = "/i2c at 7000c700";
sdhci0 = "/sdhci at 78000600";
sdhci1 = "/sdhci at 78000000";
+ usb0 = "/usb at 7d008000";
};
memory {
@@ -63,4 +64,9 @@
status = "okay";
bus-width = <8>;
};
+
+ usb at 7d008000 {
+ nvidia,vbus-gpio = <&gpio 233 3>; /* PDD1, EN_3V3_PU */
+ status = "okay";
+ };
};
diff --git a/include/fdtdec.h b/include/fdtdec.h
index 844991e..454c971 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -64,6 +64,8 @@ struct fdt_memory {
enum fdt_compat_id {
COMPAT_UNKNOWN,
COMPAT_NVIDIA_TEGRA20_USB, /* Tegra20 USB port */
+ COMPAT_NVIDIA_TEGRA30_USB, /* Tegra30 USB port */
+ COMPAT_NVIDIA_TEGRA114_USB, /* Tegra114 USB port */
COMPAT_NVIDIA_TEGRA114_I2C, /* Tegra114 I2C w/single clock source */
COMPAT_NVIDIA_TEGRA20_I2C, /* Tegra20 i2c */
COMPAT_NVIDIA_TEGRA20_DVC, /* Tegra20 dvc (really just i2c) */
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 403babd..fc18c4f 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -37,6 +37,8 @@ DECLARE_GLOBAL_DATA_PTR;
static const char * const compat_names[COMPAT_COUNT] = {
COMPAT(UNKNOWN, "<none>"),
COMPAT(NVIDIA_TEGRA20_USB, "nvidia,tegra20-ehci"),
+ COMPAT(NVIDIA_TEGRA30_USB, "nvidia,tegra30-ehci"),
+ COMPAT(NVIDIA_TEGRA114_USB, "nvidia,tegra114-ehci"),
COMPAT(NVIDIA_TEGRA114_I2C, "nvidia,tegra114-i2c"),
COMPAT(NVIDIA_TEGRA20_I2C, "nvidia,tegra20-i2c"),
COMPAT(NVIDIA_TEGRA20_DVC, "nvidia,tegra20-i2c-dvc"),
--
1.7.7
next prev parent reply other threads:[~2013-04-29 9:21 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-29 9:21 [U-Boot] [PATCH 0/3] Tegra: USB: EHCI: add Tegra30 compatible support Jim Lin
2013-04-29 9:21 ` Jim Lin [this message]
2013-05-02 19:10 ` [U-Boot] [PATCH 1/3] ARM: Tegra: FDT: Add USB support for T20/T30/T114 Stephen Warren
2013-05-03 11:07 ` Jim Lin
2013-05-03 14:43 ` Stephen Warren
2013-05-03 11:48 ` Venu Byravarasu
2013-04-29 9:21 ` [U-Boot] [PATCH 2/3] ARM: Tegra: USB: Add driver support for Tegra30/Tegra114 Jim Lin
2013-04-29 23:46 ` Marek Vasut
2013-04-30 16:21 ` Tom Warren
2013-04-30 17:09 ` Marek Vasut
2013-04-30 17:20 ` Tom Rini
2013-05-01 16:16 ` Tom Warren
2013-05-01 16:45 ` Tom Rini
2013-05-01 19:33 ` Marek Vasut
2013-05-01 23:20 ` Tom Warren
2013-05-01 23:23 ` Tom Warren
2013-05-02 9:50 ` Jim Lin
2013-05-02 11:38 ` Marek Vasut
2013-05-02 15:38 ` Tom Warren
2013-05-02 19:29 ` Stephen Warren
2013-05-03 10:53 ` Jim Lin
2013-05-03 14:46 ` Stephen Warren
2013-04-29 9:21 ` [U-Boot] [PATCH 3/3] Tegra: Config: Enable Tegra30/Tegra114 USB function Jim Lin
2013-05-02 19:30 ` Stephen Warren
2013-05-03 15:02 ` [U-Boot] [PATCH 0/3] Tegra: USB: EHCI: add Tegra30 compatible support Stephen Warren
2013-05-08 16:11 ` 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=1367227275-7713-2-git-send-email-jilin@nvidia.com \
--to=jilin@nvidia.com \
--cc=u-boot@lists.denx.de \
/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