Skip to contentSkip to conversation

Revised patch series for minimal HTC Dream support

PATCH In review Brian Swetland 4 participants 11 messages Jun 18, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

This incorporates feedback from lkml/lakml, and I think is in pretty good shape now.

msm_serial.c
- Ryan Mallon
- remove some likely/unlikely not in hot-path code, for clarity
- UART_TO_MSM() -> to_msm_uart()
- clean up static structure declarations
- Pavel Machek
- SUPPORT_SYSRQ needed for console break handling
- remove hrtimer.h, other unused headers
- Kconfig cleanup
- Alan Cox
- set_termios should propogate used settings
- Linus Walleij
- use resource_size() when appropriate
- dev_err instead of printk(KERN_ERR...
- remove some chatty printks
- use __exit, __exit_p()

board-dream.c
- Stefan Schmidt
- remove smc resources
- remove unused headers

ll debug support
- Pavel Machek
- remove extraneous 1002 label

#1 lore raw

PATCH 1/3 msm_serial: serial driver for MSM7K onboard serial peripheral.

From: Robert Love <[email protected]>

Provides support for the "lowspeed" UARTs on the MSM7k and QSD8k family of SoCs from Qualcomm. Serial console support included.

---
 drivers/serial/Kconfig      |   10 +
 drivers/serial/Makefile     |    1 +
 drivers/serial/msm_serial.c |  762 +++++++++++++++++++++++++++++++++++++++++++
 drivers/serial/msm_serial.h |  117 +++++++
 include/linux/serial_core.h |    3 +
 5 files changed, 893 insertions(+), 0 deletions(-)
 create mode 100644 drivers/serial/msm_serial.c
 create mode 100644 drivers/serial/msm_serial.h
drivers/serial/Kconfig +10 -0
index 1132c5c..1e3cc15 100644
@@ -1320,6 +1320,16 @@ config SERIAL_SGI_IOC3
 	  If you have an SGI Altix with an IOC3 serial card,
 	  say Y or M.  Otherwise, say N.
 
+config SERIAL_MSM
+	bool "MSM on-chip serial port support"
+	depends on ARM && ARCH_MSM
+	select SERIAL_CORE
+
+config SERIAL_MSM_CONSOLE
+	bool "MSM serial console support"
+	depends on SERIAL_MSM
+	select SERIAL_CORE_CONSOLE
+
 config SERIAL_NETX
 	tristate "NetX serial port support"
 	depends on ARM && ARCH_NETX
drivers/serial/Makefile +1 -0
index 45a8658..d5a2998 100644
@@ -71,6 +71,7 @@ obj-$(CONFIG_SERIAL_SGI_IOC4) += ioc4_serial.o
 obj-$(CONFIG_SERIAL_SGI_IOC3) += ioc3_serial.o
 obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o
 obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o
+obj-$(CONFIG_SERIAL_MSM) += msm_serial.o
 obj-$(CONFIG_SERIAL_NETX) += netx-serial.o
 obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o
 obj-$(CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL) += nwpserial.o
drivers/serial/msm_serial.c new file +762 -0

762 lines not on this page · raw message

drivers/serial/msm_serial.h new file +117 -0

117 lines not on this page · raw message

include/linux/serial_core.h +3 -0
index 6fd80c4..23d2fb0 100644
@@ -171,6 +171,9 @@
 /* Timberdale UART */
 #define PORT_TIMBUART	87
 
+/* Qualcomm MSM SoCs */
+#define PORT_MSM	88
+
 #ifdef __KERNEL__
 
 #include <linux/compiler.h>
Signature · 1 line
1.6.2.4
#2 lore raw

PATCH 2/3 msm: make debugging UART (for DEBUG_LL) configurable

Provides options to select one of the three "lowspeed" UARTs on MSM7k SoCs for DEBUG_LL output from the zImage decompressor and kernel.

---
 arch/arm/mach-msm/Kconfig                    |   24 ++++++++++++++++++++++++
 arch/arm/mach-msm/include/mach/debug-macro.S |   24 +++++++++++++++++-------
 arch/arm/mach-msm/include/mach/msm_iomap.h   |   12 ++++++++++++
 arch/arm/mach-msm/include/mach/uncompress.h  |    7 +++++++
 arch/arm/mach-msm/io.c                       |    3 +++
 5 files changed, 63 insertions(+), 7 deletions(-)
arch/arm/mach-msm/Kconfig +24 -0
index d140abc..35f2a90 100644
@@ -3,6 +3,30 @@ if ARCH_MSM
 comment "MSM Board Type"
 	depends on ARCH_MSM
 
+config MSM_DEBUG_UART
+	int
+	default 1 if MSM_DEBUG_UART1
+	default 2 if MSM_DEBUG_UART2
+	default 3 if MSM_DEBUG_UART3
+
+choice
+	prompt "Debug UART"
+
+	default MSM_DEBUG_UART_NONE
+
+	config MSM_DEBUG_UART_NONE
+		bool "None"
+
+	config MSM_DEBUG_UART1
+		bool "UART1"
+
+	config MSM_DEBUG_UART2
+		bool "UART2"
+
+	config MSM_DEBUG_UART3
+		bool "UART3"
+endchoice
+
 config MACH_HALIBUT
 	depends on ARCH_MSM
 	default y
arch/arm/mach-msm/include/mach/debug-macro.S +17 -7
index 1db3c97..d48747e 100644
@@ -14,15 +14,18 @@
  *
  */
 
+
+
 #include <mach/hardware.h>
 #include <mach/msm_iomap.h>
 
+#ifdef CONFIG_MSM_DEBUG_UART
 	.macro	addruart,rx
 	@ see if the MMU is enabled and select appropriate base address
 	mrc	p15, 0, \rx, c1, c0
 	tst	\rx, #1
-	ldreq	\rx, =MSM_UART1_PHYS
-	movne	\rx, #0
+	ldreq	\rx, =MSM_DEBUG_UART_PHYS
+	ldrne	\rx, =MSM_DEBUG_UART_BASE
 	.endm
 
 	.macro	senduart,rd,rx
@@ -32,13 +35,20 @@
 
 	.macro	waituart,rd,rx
 	@ wait for TX_READY
-	teq	\rx, #0
-	bne	2f
-1:	ldr	\rd, [\rx, #0x08]
+1001:	ldr	\rd, [\rx, #0x08]
 	tst	\rd, #0x04
-	beq	1b
-2:
+	beq	1001b
+	.endm
+#else
+	.macro	addruart,rx
+	.endm
+
+	.macro	senduart,rd,rx
+	.endm
+
+	.macro	waituart,rd,rx
 	.endm
+#endif
 
 	.macro	busyuart,rd,rx
 	.endm
arch/arm/mach-msm/include/mach/msm_iomap.h +12 -0
index 2f7b4c8..9dae1a9 100644
@@ -84,6 +84,18 @@
 #define MSM_UART3_PHYS        0xA9C00000
 #define MSM_UART3_SIZE        SZ_4K
 
+#ifdef CONFIG_MSM_DEBUG_UART
+#define MSM_DEBUG_UART_BASE   0xE1000000
+#if CONFIG_MSM_DEBUG_UART == 1
+#define MSM_DEBUG_UART_PHYS   MSM_UART1_PHYS
+#elif CONFIG_MSM_DEBUG_UART == 2
+#define MSM_DEBUG_UART_PHYS   MSM_UART2_PHYS
+#elif CONFIG_MSM_DEBUG_UART == 3
+#define MSM_DEBUG_UART_PHYS   MSM_UART3_PHYS
+#endif
+#define MSM_DEBUG_UART_SIZE   SZ_4K
+#endif
+
 #define MSM_SDC1_PHYS         0xA0400000
 #define MSM_SDC1_SIZE         SZ_4K
 
arch/arm/mach-msm/include/mach/uncompress.h +7 -0
index 026e895..d94292c 100644
@@ -16,9 +16,16 @@
 #ifndef __ASM_ARCH_MSM_UNCOMPRESS_H
 
 #include "hardware.h"
+#include "linux/io.h"
+#include "mach/msm_iomap.h"
 
 static void putc(int c)
 {
+#if defined(MSM_DEBUG_UART_PHYS)
+	unsigned base = MSM_DEBUG_UART_PHYS;
+	while (!(readl(base + 0x08) & 0x04)) ;
+	writel(c, base + 0x0c);
+#endif
 }
 
 static inline void flush(void)
arch/arm/mach-msm/io.c +3 -0
index 6e7692f..1c5e7da 100644
@@ -42,6 +42,9 @@ static struct map_desc msm_io_desc[] __initdata = {
 	MSM_DEVICE(GPIO1),
 	MSM_DEVICE(GPIO2),
 	MSM_DEVICE(CLK_CTL),
+#ifdef CONFIG_MSM_DEBUG_UART
+	MSM_DEVICE(DEBUG_UART),
+#endif
 	{
 		.virtual =  (unsigned long) MSM_SHARED_RAM_BASE,
 		.pfn =      __phys_to_pfn(MSM_SHARED_RAM_PHYS),
Signature · 1 line
1.6.2.4
#3 lore raw

PATCH 3/3 msm: add minimal board file for HTC Dream device

This is just enough to get the device booting and serial console working. Sufficient for debugging further MSM7k/Dream Support. This will support HTC Dream / T-Mobile G1 / Android ADP1 (which are all the same hardware, known as "trout" to the ARM machine database).

---
 arch/arm/mach-msm/Kconfig       |    6 +++
 arch/arm/mach-msm/Makefile      |    1 +
 arch/arm/mach-msm/board-dream.c |   84 +++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-msm/board-dream.h |    5 ++
 4 files changed, 96 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-msm/board-dream.c
 create mode 100644 arch/arm/mach-msm/board-dream.h
arch/arm/mach-msm/Kconfig +6 -0
index 35f2a90..f780086 100644
@@ -34,4 +34,10 @@ config MACH_HALIBUT
 	help
 	  Support for the Qualcomm SURF7201A eval board.
 
+config MACH_TROUT
+	default y
+	bool "HTC Dream (aka trout)"
+	help
+	  Support for the HTC Dream, T-Mobile G1, Android ADP1 devices.
+
 endif
arch/arm/mach-msm/Makefile +1 -0
index 1aa4700..91e6f5c 100644
@@ -6,3 +6,4 @@ obj-y += clock.o clock-7x01a.o
 
 obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o
 
+obj-$(CONFIG_MACH_TROUT) += board-dream.o
arch/arm/mach-msm/board-dream.c new file +84 -0

84 lines not on this page · raw message

arch/arm/mach-msm/board-dream.h new file +5 -0
new file mode 100644
index 0000000..4f345a5
@@ -0,0 +1,5 @@
+
+#define TROUT_CPLD_BASE   0xE8100000
+#define TROUT_CPLD_START  0x98000000
+#define TROUT_CPLD_SIZE   SZ_4K
+
Signature · 1 line
1.6.2.4
#4 lore raw

Re: [PATCH 3/3] [ARM] msm: add minimal board file for HTC Dream device

Quoted 5 lines · Brian Swetland

This is just enough to get the device booting and serial console working.  Sufficient for debugging further MSM7k/Dream Support. This will support HTC Dream / T-Mobile G1 / Android ADP1 (which are all the same hardware, known as "trout" to the ARM machine database).

Hi Brian,
I have one silly question.
I still not understand "trout" meaning with your description.

arch/arm/mach-msm/Kconfig config MACH_HALIBUT · line 42

Quoted 6 lines
arch/arm/mach-msm/Kconfig +6 -0
+config MACH_TROUT
+       default y
+       bool "HTC Dream (aka trout)"
+       help
+         Support for the HTC Dream, T-Mobile G1, Android ADP1 devices.
+

"trout" word just means HTC Dream Model. Is it right? Thks,

Signature · 10 lines
Regards,
GeunSik Lim ( Samsung Electronics )
Blog : http://blog.naver.com/invain/
e-Mail: [email protected]
           [email protected] , [email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#5 lore raw

Re: [PATCH 3/3] [ARM] msm: add minimal board file for HTC Dream device

Quoted 10 lines · GeunSik Lim
Quoted 5 lines · Brian Swetland

This is just enough to get the device booting and serial console working.  Sufficient for debugging further MSM7k/Dream Support. This will support HTC Dream / T-Mobile G1 / Android ADP1 (which are all the same hardware, known as "trout" to the ARM machine database).

Hi Brian,
I have one silly question.
I still not understand "trout" meaning with your description.

Quoted 7 lines

arch/arm/mach-msm/Kconfig config MACH_HALIBUT · line 42

Quoted 6 lines
arch/arm/mach-msm/Kconfig +6 -0
+config MACH_TROUT
+       default y
+       bool "HTC Dream (aka trout)"
+       help
+         Support for the HTC Dream, T-Mobile G1, Android ADP1 devices.
+

"trout" word just means HTC Dream Model. Is it right?

Yes -- this is the ARM linux kernel machine ID for this hardware:
http://www.arm.linux.org.uk/developer/machines/list.php?id=1440

Brian

Reviewed-by
#6 lore raw

Re: [PATCH 3/3] [ARM] msm: add minimal board file for HTC Dream device

Quoted 19 lines · Brian Swetland
Quoted 10 lines · GeunSik Lim
Quoted 5 lines · Brian Swetland

This is just enough to get the device booting and serial console working.  Sufficient for debugging further MSM7k/Dream Support. This will support HTC Dream / T-Mobile G1 / Android ADP1 (which are all the same hardware, known as "trout" to the ARM machine database).

Hi Brian,
I have one silly question.
I still not understand "trout" meaning with your description.

Quoted 7 lines

arch/arm/mach-msm/Kconfig config MACH_HALIBUT · line 42

Quoted 6 lines
arch/arm/mach-msm/Kconfig +6 -0
+config MACH_TROUT
+       default y
+       bool "HTC Dream (aka trout)"
+       help
+         Support for the HTC Dream, T-Mobile G1, Android ADP1 devices.
+

"trout" word just means HTC Dream Model. Is it right?

Quoted 5 lines

Yes -- this is the ARM linux kernel machine ID for this hardware:
http://www.arm.linux.org.uk/developer/machines/list.php?id=1440

Brian

Looks good to me.

Signature · 10 lines
Regards,
GeunSik Lim ( Samsung Electronics )
Blog : http://blog.naver.com/invain/
e-Mail: [email protected]
           [email protected] , [email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Acked-by on v1 3/3
#7 lore raw

Re: [PATCH 3/3] [ARM] msm: add minimal board file for HTC Dream device

In reply to Brian Swetland
Quoted 7 lines · Brian Swetland

This is just enough to get the device booting and serial console working. Sufficient for debugging further MSM7k/Dream Support. This will support HTC Dream / T-Mobile G1 / Android ADP1 (which are all the same hardware, known as "trout" to the ARM machine database).

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Acked-by on v1 2/3
#8 lore raw

Re: [PATCH 2/3] [ARM] msm: make debugging UART (for DEBUG_LL) configurable

In reply to Brian Swetland
Quoted 5 lines · Brian Swetland

Provides options to select one of the three "lowspeed" UARTs on MSM7k SoCs for DEBUG_LL output from the zImage decompressor and kernel.

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#9 lore raw

Re: [PATCH 1/3] [ARM] msm_serial: serial driver for MSM7K onboard serial peripheral.

In reply to Brian Swetland
Quoted 8 lines · On Wed, 17 Jun 2009 17:31:13 -0700 Brian Swetland <[email protected]> wrote:

From: Robert Love <[email protected]>

Provides support for the "lowspeed" UARTs on the MSM7k and QSD8k family of SoCs from Qualcomm. Serial console support included.

If you fold other peoples patches into something please preserve the authorship data and preferably keep the two patches separated as it otherwise causes merge problems if stuff (eg the serial patches) goes via two trees at once.

At the moment the ttydev tree has

	-> your original -> my (intel's I guess) fixes ->

and if the updated one also went in via the arm tree git can't always figure out what is going on.

If its only going by one path and you know that then just adding an additional note on the authorship of updates is fine but this being serial/tty and ARM is likely to hit both trees.

Alan

#10 lore raw

Re: [PATCH 1/3] [ARM] msm_serial: serial driver for MSM7K onboard serial peripheral.

Quoted 8 lines · Alan Cox
Quoted 5 lines · On Wed, 17 Jun 2009 17:31:13 -0700 Brian Swetland <[email protected]> wrote:

From: Robert Love <[email protected]>

Provides support for the "lowspeed" UARTs on the MSM7k and QSD8k family of SoCs from Qualcomm.  Serial console support included.

Quoted 8 lines
Quoted 3 lines

If you fold other peoples patches into something please preserve the authorship data and preferably keep the two patches separated as it otherwise causes merge problems if stuff (eg the serial patches) goes via two trees at once.

Ah, sorry about that -- I can resend the revised patch that your patch applies against (but without your changes merged in). Previously, for the ARM stuff I got the impression that a single patch folding small changes in was preferred, but I may have misunderstood the workflow.

Quoted 12 lines

At the moment the ttydev tree has
       -> your original -> my (intel's I guess) fixes ->

and if the updated one also went in via the arm tree git can't always figure out what is going on.

If its only going by one path and you know that then just adding an additional note on the authorship of updates is fine but this being serial/tty and ARM is likely to hit both trees.

Alan