ARM: tegra: paz00: updates for "for-next"
Subsystems (3)
cover ARM: tegra: paz00: updates for "for-next"
Colin,
this is an update to the patches I send on July 15th. There are now five patches which add the second serial port (some solder points on the mainboard) and Wifi support (rfkill and LED) to PAZ00. Additionally, usb support is improved and the SDHCI init order is changed.
Please queue them up for "for-next" after positive review of course.
Thanks
Marc
Marc Dietrich (5):
ARM: tegra: paz00: add support serial port on JP1
ARM: tegra: paz00: enable rfkill for internal wifi card
ARM: tegra: paz00: enable wifi led
ARM: tegra: paz00: add clocks required for usb operation
ARM: tegra: paz00: reorder the SDHCI channel init
arch/arm/mach-tegra/board-paz00-pinmux.c | 3 ++ arch/arm/mach-tegra/board-paz00.c | 57 +++++++++++++++++++++++++++++- arch/arm/mach-tegra/board-paz00.h | 16 ++++++-- 3 files changed, 71 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.4.1
PATCH 1/5 ARM: tegra: paz00: add support serial port on JP1
UART-A is connected to JP1 and used by the bootloader for debugging output while UART-D is connected to the mini-pcie expansion slot.
--- arch/arm/mach-tegra/board-paz00.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
arch/arm/mach-tegra/board-paz00.c +11 -0
@@ -45,6 +45,16 @@static struct plat_serial8250_port debug_uart_platform_data[] = { { +/* serial port on JP1 */ + .membase =IO_ADDRESS (TEGRA_UARTA_BASE ), + .mapbase =TEGRA_UARTA_BASE , + .irq =INT_UARTA , + .flags =UPF_BOOT_AUTOCONF , + .iotype =UPIO_MEM , + .regshift =2 , + .uartclk =216000000 , + }, { +/* serial port on mini-pcie */ .membase =IO_ADDRESS (TEGRA_UARTD_BASE ), .mapbase =TEGRA_UARTD_BASE , .irq =INT_UARTD ,
@@ -94,6 +104,7 @@ static void __init tegra_paz00_fixup(struct machine_desc *desc,static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {/* name parent rate enabled */ + {"uarta" ,"pll_p" ,216000000 , true }, {"uartd" ,"pll_p" ,216000000 , true }, {NULL ,NULL ,0 ,0 }, };
Signature · 1 line
1.7.4.1
PATCH 2/5 ARM: tegra: paz00: enable rfkill for internal wifi card
In reply to Marc DietrichThis patch adds support for controlling the rfkill gpios for the internal WIFI card via the rfkill_gpio driver.
--- arch/arm/mach-tegra/board-paz00-pinmux.c | 2 ++ arch/arm/mach-tegra/board-paz00.c | 17 +++++++++++++++++ arch/arm/mach-tegra/board-paz00.h | 15 +++++++++++---- 3 files changed, 30 insertions(+), 4 deletions(-)
arch/arm/mach-tegra/board-paz00-pinmux.c +2 -0
@@ -145,6 +145,8 @@ static struct tegra_gpio_table gpio_table[] = { { .gpio = TEGRA_GPIO_SD1_WP, .enable = true }, { .gpio = TEGRA_GPIO_SD1_POWER, .enable = true }, { .gpio = TEGRA_ULPI_RST, .enable = true }, + { .gpio = TEGRA_WIFI_PWRN, .enable = true }, + { .gpio = TEGRA_WIFI_RST, .enable = true }, };void paz00_pinmux_init (void )
arch/arm/mach-tegra/board-paz00.c +17 -0
@@ -26,6 +26,7 @@#include <linux/pda_power.h> #include <linux/io.h> #include <linux/i2c.h> +#include <linux/rfkill-gpio.h> #include <asm/mach-types.h> #include <asm/mach/arch.h>
@@ -75,10 +76,26 @@ static struct platform_device debug_uart = { }, }; +static struct rfkill_gpio_platform_data wifi_rfkill_platform_data = { + .name ="wifi_rfkill" , + .reset_gpio =TEGRA_WIFI_RST , + .shutdown_gpio =TEGRA_WIFI_PWRN , + .type =RFKILL_TYPE_WLAN , +}; + +static struct platform_device wifi_rfkill_device = { + .name ="rfkill_gpio" , + .id =-1 , + .dev = { + .platform_data = &wifi_rfkill_platform_data, + }, +}; +static struct platform_device *paz00_devices[]__initdata = { &debug_uart, &tegra_sdhci_device1, &tegra_sdhci_device4, + &wifi_rfkill_device, };static void paz00_i2c_init (void )
arch/arm/mach-tegra/board-paz00.h +11 -4
@@ -17,10 +17,17 @@#ifndef _MACH_TEGRA_BOARD_PAZ00_H#define _MACH_TEGRA_BOARD_PAZ00_H -#define TEGRA_GPIO_SD1_CD TEGRA_GPIO_PV5 -#define TEGRA_GPIO_SD1_WP TEGRA_GPIO_PH1 -#define TEGRA_GPIO_SD1_POWER TEGRA_GPIO_PT3 -#define TEGRA_ULPI_RST TEGRA_GPIO_PV0 +/* SDCARD */ +#define TEGRA_GPIO_SD1_CD TEGRA_GPIO_PV5 +#define TEGRA_GPIO_SD1_WP TEGRA_GPIO_PH1 +#define TEGRA_GPIO_SD1_POWER TEGRA_GPIO_PT3 + +/* ULPI */ +#define TEGRA_ULPI_RST TEGRA_GPIO_PV0 + +/* WIFI */ +#define TEGRA_WIFI_PWRN TEGRA_GPIO_PK5 +#define TEGRA_WIFI_RST TEGRA_GPIO_PD1void paz00_pinmux_init (void );
Signature · 1 line
1.7.4.1
PATCH 3/5 ARM: tegra: paz00: enable wifi led
In reply to Marc DietrichThis adds support for the wifi led. It is automaticly triggered by the rfkill0 event.
--- arch/arm/mach-tegra/board-paz00-pinmux.c | 1 + arch/arm/mach-tegra/board-paz00.c | 22 ++++++++++++++++++++++ arch/arm/mach-tegra/board-paz00.h | 1 + 3 files changed, 24 insertions(+), 0 deletions(-)
arch/arm/mach-tegra/board-paz00-pinmux.c +1 -0
@@ -147,6 +147,7 @@ static struct tegra_gpio_table gpio_table[] = { { .gpio = TEGRA_ULPI_RST, .enable = true }, { .gpio = TEGRA_WIFI_PWRN, .enable = true }, { .gpio = TEGRA_WIFI_RST, .enable = true }, + { .gpio = TEGRA_WIFI_LED, .enable = true }, };void paz00_pinmux_init (void )
arch/arm/mach-tegra/board-paz00.c +22 -0
@@ -91,11 +91,33 @@ static struct platform_device wifi_rfkill_device = { }, }; +static struct gpio_led gpio_leds[] = { + { + .name ="wifi-led" , + .default_trigger ="rfkill0" , + .gpio =TEGRA_WIFI_LED , + }, +}; + +static struct gpio_led_platform_data gpio_led_info = { + .leds = gpio_leds, + .num_leds =ARRAY_SIZE (gpio_leds), +}; + +static struct platform_device leds_gpio = { + .name ="leds-gpio" , + .id =-1 , + .dev = { + .platform_data = &gpio_led_info, + }, +}; +static struct platform_device *paz00_devices[]__initdata = { &debug_uart, &tegra_sdhci_device1, &tegra_sdhci_device4, &wifi_rfkill_device, + &leds_gpio, };static void paz00_i2c_init (void )
arch/arm/mach-tegra/board-paz00.h +1 -0
@@ -28,6 +28,7 @@/* WIFI */ #define TEGRA_WIFI_PWRN TEGRA_GPIO_PK5#define TEGRA_WIFI_RST TEGRA_GPIO_PD1 +#define TEGRA_WIFI_LED TEGRA_GPIO_PD0void paz00_pinmux_init (void );
Signature · 1 line
1.7.4.1
PATCH 4/5 ARM: tegra: paz00: add clocks required for usb operation
In reply to Marc DietrichThese clocks are required for usb operation.
--- arch/arm/mach-tegra/board-paz00.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/mach-tegra/board-paz00.c +5 -0
@@ -145,6 +145,11 @@ static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {/* name parent rate enabled */ { "uarta", "pll_p", 216000000, true }, { "uartd", "pll_p", 216000000, true }, + + { "pll_a", "pll_p_out1", 56448000, true }, + { "pll_a_out0", "pll_a", 11289600, true }, + { "pll_p_out4", "pll_p", 24000000, true }, + { NULL, NULL, 0, 0}, };
Signature · 1 line
1.7.4.1
PATCH 5/5 ARM: tegra: paz00: reorder the SDHCI channel init
In reply to Marc DietrichThis reorders the SDHCI channel init order. With this patch, the internal emmc gets the mmcblk0 device while the external sdmmc port gets mmcblk1. This change is only for convenience.
--- arch/arm/mach-tegra/board-paz00.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-tegra/board-paz00.c +1 -1
@@ -114,8 +114,8 @@ static struct platform_device leds_gpio = {static struct platform_device *paz00_devices[]__initdata = { &debug_uart, - &tegra_sdhci_device1, &tegra_sdhci_device4, + &tegra_sdhci_device1, &wifi_rfkill_device, &leds_gpio, };
Signature · 1 line
1.7.4.1
PATCH 4/5 ARM: tegra: paz00: add clocks required for usb operation
In reply to Marc DietrichMarc Dietrich wrote at Sunday, August 07, 2011 1:01 PM:
Quoted 1 line
These clocks are required for usb operation.
...
Quoted 1 line
arch/arm/mach-tegra/board-paz00.c +0
-0
...
arch/arm/mach-tegra/board-paz00.c static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = { · line 150
Quoted 7 lines
arch/arm/mach-tegra/board-paz00.c +3
-0@@ -145,6 +145,11 @@ static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {/* name parent rate enabled */ { "uarta", "pll_p", 216000000, true }, { "uartd", "pll_p", 216000000, true }, + + { "pll_a", "pll_p_out1", 56448000, true }, + { "pll_a_out0", "pll_a", 11289600, true },
Are you sure those two are required for USB operation; they're typically used for audio. Of course, this might just be a bug in the commit description:-) Although, if you are attempting to enable audio, there's a bunch more stuff that'd need to be done, including some more clock setup.
Signature · 1 line
nvpublic
PATCH 4/5 ARM: tegra: paz00: add clocks required for usboperation
Hi Stephen,
Quoted 17 lines · On Monday 08 August 2011 18:57:52 Stephen Warren wrote:
Marc Dietrich wrote at Sunday, August 07, 2011 1:01 PM:
Quoted 1 line
These clocks are required for usb operation.
...
Quoted 2 lines
arch/arm/mach-tegra/board-paz00.c +0
-0...
Quoted 7 lines
arch/arm/mach-tegra/board-paz00.c +0
-0@@ -145,6 +145,11 @@ static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {/* name parent rate enabled */ { "uarta", "pll_p", 216000000, true }, { "uartd", "pll_p", 216000000, true },
Quoted 9 lines
arch/arm/mach-tegra/board-paz00.c static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = { · line 150
Quoted 3 lines
arch/arm/mach-tegra/board-paz00.c +3
-0+ + { "pll_a", "pll_p_out1", 56448000, true }, + { "pll_a_out0", "pll_a", 11289600, true },Are you sure those two are required for USB operation; they're typically used for audio. Of course, this might just be a bug in the commit description:-) Although, if you are attempting to enable audio, there's a bunch more stuff that'd need to be done, including some more clock setup.
Sorry, no audio yet :-(
But yes, you are right. I just found them by trial-and-error method, so somehow these creeped in. So I guess that the *_a* stands for audio?
Corrected patch coming soon.
Thanks
Marc
PATCH 4/5 ARM: tegra: paz00: add clocks required for usboperation
Marc Dietrich wrote at Monday, August 08, 2011 11:19 AM:
Quoted 30 lines
Hi Stephen,
Quoted 17 lines · On Monday 08 August 2011 18:57:52 Stephen Warren wrote:
Marc Dietrich wrote at Sunday, August 07, 2011 1:01 PM:
Quoted 1 line
These clocks are required for usb operation.
...
Quoted 2 lines
arch/arm/mach-tegra/board-paz00.c +0
-0...
Quoted 7 lines
arch/arm/mach-tegra/board-paz00.c +0
-0@@ -145,6 +145,11 @@ static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {/* name parent rate enabled */ { "uarta", "pll_p", 216000000, true }, { "uartd", "pll_p", 216000000, true },Quoted 9 lines
arch/arm/mach-tegra/board-paz00.c static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = { · line 150
Quoted 3 lines
arch/arm/mach-tegra/board-paz00.c +3
-0+ + { "pll_a", "pll_p_out1", 56448000, true }, + { "pll_a_out0", "pll_a", 11289600, true },Are you sure those two are required for USB operation; they're typically used for audio. Of course, this might just be a bug in the commit description:-) Although, if you are attempting to enable audio, there's a bunch more stuff that'd need to be done, including some more clock setup.
Quoted 4 lines
Sorry, no audio yet :-(
But yes, you are right. I just found them by trial-and-error method, so somehow these creeped in. So I guess that the *_a* stands for audio?
Yes, that's the typical use of pll_a.
Quoted 1 line
Corrected patch coming soon.
+ { "pll_p_out4", "pll_p", 24000000, true },
Oh, and looking at the patches I recently posted to add USB support to Harmony and Seaboard, which have been in the ChromeOS kernel for a while, the USB clocks entries are typically e.g.:
{ "usbd", "clk_m", 12000000, true},
{ "usb3", "clk_m", 12000000, true},Our internal Android kernel uses the same parent/rate setup for Harmony too.
(there's a "usb2" too if you need; one per controller, so it depends which are used on the AC100)
Signature · 1 line
nvpublic
PATCH 4/5 ARM: tegra: paz00: add clocks required forusboperation
Am Montag 08 August 2011, 19:38:25 schrieb Stephen Warren:
Quoted 9 lines
Marc Dietrich wrote at Monday, August 08, 2011 11:19 AM:
Quoted 1 line · On Monday 08 August 2011 18:57:52 Stephen Warren wrote:
arch/arm/mach-tegra/board-paz00.c +1
-0+ { "pll_p_out4", "pll_p", 24000000, true },Oh, and looking at the patches I recently posted to add USB support to Harmony and Seaboard, which have been in the ChromeOS kernel for a while, the USB clocks entries are typically e.g.:
Quoted 8 lines
{ "usbd", "clk_m", 12000000, true}, { "usb3", "clk_m", 12000000, true},Our internal Android kernel uses the same parent/rate setup for Harmony too.
(there's a "usb2" too if you need; one per controller, so it depends which are used on the AC100)
Seems we are using all three ports (including fsl_udc for debugging). I left them out because they seem to be switched on automaticly (either via the bootloader or via the tegra-ehci driver).
On the other hand, we want to move to u-boot sooner or later so I think it's better to enable them now.
Marc
PATCH v2 4/5 ARM: tegra: paz00: add clocks required for usb operation
In reply to Marc DietrichThese clocks are required for usb operation.
--- arch/arm/mach-tegra/board-paz00.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/mach-tegra/board-paz00.c +6 -0
@@ -145,6 +145,12 @@ static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {/* name parent rate enabled */ { "uarta", "pll_p", 216000000, true }, { "uartd", "pll_p", 216000000, true }, + + { "pll_p_out4", "pll_p", 24000000, true }, + { "usbd", "clk_m", 12000000, true }, + { "usb2", "clk_m", 12000000, true }, + { "usb3", "clk_m", 12000000, true }, + { NULL, NULL, 0, 0}, };
Signature · 1 line
1.7.4.1
PATCH v2 4/5 ARM: tegra: paz00: add clocks required for usb operation
Quoted 11 lines · Marc Dietrich
These clocks are required for usb operation.
---
?arch/arm/mach-tegra/board-paz00.c | ? ?6 ++++++
?1 files changed, 6 insertions(+), 0 deletions(-)arch/arm/mach-tegra/board-paz00.c +0
-0@@ -145,6 +145,12 @@ static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {
Quoted 8 lines
? ? ? ?/* name ? ? ? ? parent ? ? ? ? ?rate ? ? ? ? ? ?enabled */ ? ? ? ?{ "uarta", ? ? ?"pll_p", ? ? ? ?216000000, ? ? ?true }, ? ? ? ?{ "uartd", ? ? ?"pll_p", ? ? ? ?216000000, ? ? ?true }, +
+ ? ? ? { "pll_p_out4", "pll_p", ? ? ? ?24000000, ? ? ? true },
+ ? ? ? { "usbd", ? ? ? "clk_m", ? ? ? ?12000000, ? ? ? true },
+ ? ? ? { "usb2", ? ? ? "clk_m", ? ? ? ?12000000, ? ? ? true },
+ ? ? ? { "usb3", ? ? ? "clk_m", ? ? ? ?12000000, ? ? ? true },
Do they all have to be enabled here? Setting the parent and rate makes sense, but you shouldn't have to enable them.
-Olof
PATCH v2 4/5 ARM: tegra: paz00: add clocks required for usb operation
In reply to Marc DietrichMarc Dietrich wrote at Tuesday, August 09, 2011 12:29 PM:
Quoted 10 lines
These clocks are required for usb operation.
--- arch/arm/mach-tegra/board-paz00.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)arch/arm/mach-tegra/board-paz00.c +0
-0
arch/arm/mach-tegra/board-paz00.c static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = { · line 149
Quoted 5 lines
arch/arm/mach-tegra/board-paz00.c +2
-0@@ -145,6 +145,12 @@ static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {/* name parent rate enabled */ { "uarta", "pll_p", 216000000, true }, { "uartd", "pll_p", 216000000, true }, + + { "pll_p_out4", "pll_p", 24000000, true },
Do you need the pll_p_out4 entry? What's that driving? Check in /sys/kernel/debug/clock/clock_tree (/sys/kernel/debug is debugfs).
Signature · 1 line
nvpublic
PATCH v2 4/5 ARM: tegra: paz00: add clocks required for usb operation
In reply to Olof JohanssonHi Olof,
Quoted 8 lines · On Tuesday 09 August 2011 20:30:47 Olof Johansson wrote:
arch/arm/mach-tegra/board-
Quoted 7 lines · Marc Dietrich
These clocks are required for usb operation.
--- arch/arm/mach-tegra/board-paz00.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)arch/arm/mach-tegra/board- renamed from arch/arm/mach-tegra/board-paz00.c +0
-0
paz00.c
Quoted 4 lines
arch/arm/mach-tegra/board-paz00.c static __initdata struct tegra_clk_init_table
Quoted 4 lines
index 45111f6..89a3dda 100644
arch/arm/mach-tegra/board-paz00.c +0
-0@@ -145,6 +145,12 @@ static __initdata struct tegra_clk_init_table
paz00_clk_init_table[] = {
Quoted 11 lines
arch/arm/mach-tegra/board-paz00.c static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = { · line 152
Quoted 8 lines
arch/arm/mach-tegra/board-paz00.c +5
-0/* name parent rate enabled */ { "uarta", "pll_p", 216000000, true }, { "uartd", "pll_p", 216000000, true }, + + { "pll_p_out4", "pll_p", 24000000, true }, + { "usbd", "clk_m", 12000000, true }, + { "usb2", "clk_m", 12000000, true }, + { "usb3", "clk_m", 12000000, true },Do they all have to be enabled here? Setting the parent and rate makes sense, but you shouldn't have to enable them.
usb also works with all three usb* clocks set to disabled (they are even not required to be listed there at all). Honestly, the whole clock setup is a little obscure to me.
Can these clocks be safly disabled in the clock table and hope that the ehci host driver will enable them if required? Also independent to what the bootloader does, which I don't know? I'm asking because we may switch from the proprietary bootloader (fastboot?) to u-boot in the near future.
Marc
PATCH v2 4/5 ARM: tegra: paz00: add clocks required for usb operation
Quoted 29 lines · Marc Dietrich
Hi Olof,
Quoted 8 lines · On Tuesday 09 August 2011 20:30:47 Olof Johansson wrote:
arch/arm/mach-tegra/board-
Quoted 7 lines · Marc Dietrich
These clocks are required for usb operation.
---
?arch/arm/mach-tegra/board-paz00.c | ? ?6 ++++++
?1 files changed, 6 insertions(+), 0 deletions(-)arch/arm/mach-tegra/board- renamed from arch/arm/mach-tegra/board-paz00.c +0
-0
paz00.cQuoted 4 lines
arch/arm/mach-tegra/board-paz00.c static __initdata struct tegra_clk_init_table
Quoted 4 lines
index 45111f6..89a3dda 100644
arch/arm/mach-tegra/board-paz00.c +0
-0@@ -145,6 +145,12 @@ static __initdata struct tegra_clk_init_tablepaz00_clk_init_table[] = {
Quoted 11 lines
Quoted 8 lines
? ? ? ?/* name ? ? ? ? parent ? ? ? ? ?rate ? ? ? ? ? ?enabled */ ? ? ? ?{ "uarta", ? ? ?"pll_p", ? ? ? ?216000000, ? ? ?true }, ? ? ? ?{ "uartd", ? ? ?"pll_p", ? ? ? ?216000000, ? ? ?true }, +
+ ? ? ? { "pll_p_out4", "pll_p", ? ? ? ?24000000, ? ? ? true },
+ ? ? ? { "usbd", ? ? ? "clk_m", ? ? ? ?12000000, ? ? ? true },
+ ? ? ? { "usb2", ? ? ? "clk_m", ? ? ? ?12000000, ? ? ? true },
+ ? ? ? { "usb3", ? ? ? "clk_m", ? ? ? ?12000000, ? ? ? true },Do they all have to be enabled here? Setting the parent and rate makes sense, but you shouldn't have to enable them.
Quoted 8 lines
usb also works with all three usb* clocks set to disabled (they are even not required to be listed there at all). Honestly, the whole clock setup is a little obscure to me.
Can these clocks be safly disabled in the clock table and hope that the ehci host driver will enable them if required? Also independent to what the bootloader does, which I don't know? I'm asking because we may switch from the proprietary bootloader (fastboot?) to u-boot in the near future.
In general, the platform code needs to setup the parent/child relationships, and in most cases the clock rates. But the individual drivers will disable and enable clocks as needed. If you set them to 'true' in the table, that last enable will never be disabled, so the clock will never be off. That might be suboptimal from a power consumption point of view for your platform.
Unfortunately, u-boot does very little clock setup so the kernel has to be able to do most of it. Fastboot is better at it, in some sense of the word. We used to have some very large clock setup tables in the chromeos board files, but we have recently pruned out most of it and cut back to the bare minimum.
Note that you might have some issues with autosuspend and detecting hotplugs, we have a chromeos patch for it that I should post sometime soon.
-Olof
cover ARM: tegra: paz00: updates for "for-next"
In reply to Marc DietrichQuoted 8 lines · Marc Dietrich
Colin,
this is an update to the patches I send on July 15th. There are now five patches which add the second serial port (some solder points on the mainboard) and Wifi support (rfkill and LED) to PAZ00. Additionally, usb support is improved and the SDHCI init order is changed.
Please queue them up for "for-next" after positive review of course.
I've applied 1-3 and 5 to boards-for-3.2. Repost patch 4 standalone on next spin. :)
Thanks,
-Olof