Skip to contentSkip to conversation

Add support for the HTC Typhoon, Hurricane and Tornado smartphone

PATCH In review Vivien Chappelier 2 participants 2 messages Jun 9, 2007 – Jun 12, 2007

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

PATCH 1/12 Add support for the HTC Typhoon, Hurricane and Tornado smartphone

This patch adds support for the HTC smartphone boards based on the OMAP730 and OMAP850 platform. Phone model is detected at runtime.

---

arch/arm/mach-omap1/Kconfig               |    7 +
arch/arm/mach-omap1/Makefile              |    1 +
arch/arm/mach-omap1/board-typhoon.c       |  301 +++++++++++++++++++++++++++++
include/asm-arm/arch-omap/board-typhoon.h |   62 ++++++
4 files changed, 371 insertions(+), 0 deletions(-)

create mode 100644 arch/arm/mach-omap1/board-typhoon.c create mode 100644 include/asm-arm/arch-omap/board-typhoon.h

arch/arm/mach-omap1/Kconfig +7 -0
index 79f0b1f..eb12ca5 100644
@@ -125,6 +125,13 @@ config MACH_NOKIA770
      Support for the Nokia 770 Internet Tablet. Say Y here if you
      have such a device.
 
+config MACH_TYPHOON
+    bool "HTC Typhoon"
+    depends on ARCH_OMAP1 && ARCH_OMAP730
+    help
+      Support for the HTC Typhoon/Tornado smartphone. Say Y here if you
+      have such a phone.
+

config MACH_AMS_DELTA
bool "Amstrad E3 (Delta)"
depends on ARCH_OMAP1 && ARCH_OMAP15XX

arch/arm/mach-omap1/Makefile +0 -0
index 8377665..9f6bcbb 100644
@@ -31,6 +31,7 @@ obj-$(CONFIG_MACH_OMAP_PALMTE)        += board-palmte.o

obj-$(CONFIG_MACH_OMAP_PALMZ71) += board-palmz71.o
obj-$(CONFIG_MACH_OMAP_PALMTT) += board-palmtt.o
obj-$(CONFIG_MACH_NOKIA770) += board-nokia770.o
+obj-$(CONFIG_MACH_TYPHOON) += board-typhoon.o
obj-$(CONFIG_MACH_AMS_DELTA) += board-ams-delta.o
obj-$(CONFIG_MACH_SX1) += board-sx1.o

arch/arm/mach-omap1/board-typhoon.c new file +301 -0

301 lines not on this page · raw message

include/asm-arm/arch-omap/board-typhoon.h new file +62 -0

62 lines not on this page · raw message

Signature · 1 line
1.5.1.3
#1 lore raw
Quoted 102 lines · Vivien Chappelier

This patch adds support for the HTC smartphone boards based on the OMAP730 and
OMAP850 platform. Phone model is detected at runtime.

---
 arch/arm/mach-omap1/Kconfig               |    7 +
 arch/arm/mach-omap1/Makefile              |    1 +
 arch/arm/mach-omap1/board-typhoon.c       |  301
+++++++++++++++++++++++++++++
 include/asm-arm/arch-omap/board-typhoon.h |   62 ++++++
 4 files changed, 371 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap1/board-typhoon.c
 create mode 100644 include/asm-arm/arch-omap/board-typhoon.h
arch/arm/mach-omap1/Kconfig +7 -0
index 79f0b1f..eb12ca5 100644
@@ -125,6 +125,13 @@ config MACH_NOKIA770
       Support for the Nokia 770 Internet Tablet. Say Y here if you
       have such a device.
 
+config MACH_TYPHOON
+    bool "HTC Typhoon"
+    depends on ARCH_OMAP1 && ARCH_OMAP730
+    help
+      Support for the HTC Typhoon/Tornado smartphone. Say Y here if you
+      have such a phone.
+
 config MACH_AMS_DELTA
     bool "Amstrad E3 (Delta)"
     depends on ARCH_OMAP1 && ARCH_OMAP15XX
arch/arm/mach-omap1/Makefile +1 -0
index 8377665..9f6bcbb 100644
@@ -31,6 +31,7 @@ obj-$(CONFIG_MACH_OMAP_PALMTE)        += board-palmte.o
 obj-$(CONFIG_MACH_OMAP_PALMZ71)        += board-palmz71.o
 obj-$(CONFIG_MACH_OMAP_PALMTT)        += board-palmtt.o
 obj-$(CONFIG_MACH_NOKIA770)        += board-nokia770.o
+obj-$(CONFIG_MACH_TYPHOON)        += board-typhoon.o
 obj-$(CONFIG_MACH_AMS_DELTA)        += board-ams-delta.o
 obj-$(CONFIG_MACH_SX1)            += board-sx1.o
 
arch/arm/mach-omap1/board-typhoon.c new file +48 -0
new file mode 100644
index 0000000..814cf3f
@@ -0,0 +1,301 @@
+/*
+ * linux/arch/arm/mach-omap1/board-typhoon.c
+ *
+ * Modified from board-perseus2.c
+ *
+ * Copyright 2005 Vivien Chappelier <[email protected]>
+ * Original OMAP730 support by Jean Pihet <[email protected]>
+ * Updated for 2.6 by Kevin Hilman <[email protected]>
+ *
+ * MMC and watchdog reinitialization by Nicolas Schichan
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/device.h>
+#include <linux/delay.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/input.h>
+#include <linux/bootmem.h>
+
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+#include <asm/mach/map.h>
+
+#include <asm/arch/gpio.h>
+#include <asm/arch/mux.h>
+#include <asm/arch/fpga.h>
+#include <asm/arch/common.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/usb.h>
+#include <asm/arch/board-typhoon.h>
+
+/* LCD device */
+static struct platform_device lcd_device = {
+    .name        = "lcd_typhoon",
+    .id        = -1,
+};
+
+/* GSM device */

arch/arm/mach-omap1/board-typhoon.c line 58

Quoted 10 lines
arch/arm/mach-omap1/board-typhoon.c new file +10 -0
+#define TYPHOON_GSM_PHYS_START        0x11d80000 /* end of RAM */
+#define TYPHOON_GSM_PHYS_SIZE        0x00280000 /* 2.5 MB code/data/fifo */
+
+#define TORNADO_GSM_PHYS_START        0x13c00000 /* end of RAM */
+#define TORNADO_GSM_PHYS_SIZE        0x00400000 /* 4.0 MB code/data/fifo */
+
+static struct resource gsm_resources[] = {
+    {    /* GSM DSP MMU */
+        .start        = IO_ADDRESS(OMAP730_DSP_MMU_BASE),
+        .end        = IO_ADDRESS(OMAP730_DSP_MMU_BASE) + 0x54,

Is it tabs or spaces? use tabs not spaces for indentation.

Quoted 8 lines
arch/arm/mach-omap1/board-typhoon.c new file +8 -0
+        .flags        = IORESOURCE_MEM,
+    },
+    {    /* GSM software interrupt */
+        .start        = INT_730_ICR,
+        .flags        = IORESOURCE_IRQ,
+    },
+    {       /* GSM radio interrupt */
+        .start        = INT_730_DBB_RF_EN,

arch/arm/mach-omap1/board-typhoon.c line 76

Quoted 10 lines
arch/arm/mach-omap1/board-typhoon.c new file +10 -0
+        .flags        = IORESOURCE_IRQ,
+    },
+};
+
+static struct platform_device gsm_device = {
+        .name           = "typhoon-gsm",
+        .id             = 1,
+    .num_resources    = ARRAY_SIZE(gsm_resources),
+    .resource    = gsm_resources,
+};

Ditto. Please check other parts of files too.

....

Quoted 5 lines
arch/arm/mach-omap1/board-typhoon.c new file +5 -0
+
+# define       OMAP_MMC_REG_SYSC       (0xfffb7800 + 0x32)
+# define       OMAP_MMC_REG_SYSS       (0xfffb7800 + 0x34)
+# define       OMAP_MMC_REG_CTO        (0xfffb7800 + 0x0e)
+# define       OMAP_MMC_REG_DTO        (0xfffb7800 + 0x1c)

arch/arm/mach-omap1/board-typhoon.c line 188

Quoted 10 lines
arch/arm/mach-omap1/board-typhoon.c new file +10 -0
+
+       /* put mmc host into reset ... */
+       omap_writew(1, OMAP_MMC_REG_SYSC);
+
+       tries = 100;
+       while (omap_readw(OMAP_MMC_REG_SYSS) == 0 && tries) {
+               mdelay(50);
+               --tries;
+       }
+       printk("MMC host reset done: remaining tries: %i\n", tries);

KERN_* facility level is required.

Quoted 3 lines
arch/arm/mach-omap1/board-typhoon.c new file +2 -0
+
+       /* force mode 0 for D_SMC_DAT3, D_SMC_DAT2, D_SMC, no pull up

enable */

multiline comment format is not correct.

It should be /*
* start here
*/

Quoted 17 lines

+ omap_writel(omap_readl(OMAP730_IO_CONF_2) & ~(0xF << 8),
OMAP730_IO_CONF_2);
+ omap_writel(omap_readl(OMAP730_IO_CONF_2) & ~(0xF << 12),
OMAP730_IO_CONF_2);
+ omap_writel(omap_readl(OMAP730_IO_CONF_2) & ~(0xF << 16),
OMAP730_IO_CONF_2);

arch/arm/mach-omap1/board-typhoon.c new file +11 -0
+}
+
+static void omap_typhoon_lcd_init(void)
+{
+    u32 reg;
+
+# define       OMAP_LCDC_CONTROL               (0xfffec000 + 0x00)
+# define       OMAP_LCDC_STATUS                (0xfffec000 + 0x10)
+# define       OMAP_DMA_LCD_CCR                (0xfffee300 + 0xc2)
+# define       OMAP_DMA_LCD_CTRL               (0xfffee300 + 0xc4)
+# define       OMAP_LCDC_CTRL_LCD_EN           (1 << 0)

arch/arm/mach-omap1/board-typhoon.c line 214

Quoted 10 lines
arch/arm/mach-omap1/board-typhoon.c new file +10 -0
+# define       OMAP_LCDC_STAT_DONE             (1 << 0)
+
+    /* disable controller if active */
+    reg = omap_readl(OMAP_LCDC_CONTROL);
+    if (reg & OMAP_LCDC_CTRL_LCD_EN) {
+        reg &= ~OMAP_LCDC_CTRL_LCD_EN;
+        omap_writel(reg, OMAP_LCDC_CONTROL);
+
+        /* wait for end of frame */
+        while(!(omap_readl(OMAP_LCDC_STATUS) & OMAP_LCDC_STAT_DONE));

space before opening parenthesis.

Quoted 12 lines
arch/arm/mach-omap1/board-typhoon.c new file +12 -0
+
+        /* turn off DMA */
+        reg = omap_readw(OMAP_DMA_LCD_CCR);
+        reg &= ~(1 << 7);
+        omap_writew(reg, OMAP_DMA_LCD_CCR);
+
+        reg = omap_readw(OMAP_DMA_LCD_CTRL);
+        reg &= ~(1 << 8);
+        omap_writew(reg, OMAP_DMA_LCD_CTRL);
+    }
+}
+

...

Signature · 1 line
--Trilok Soni