[ARM] 5355/1: Adding support for the HTC Himalaya and its framebuffer
authorZbynek Michl <Zbynek.Michl@seznam.cz>
Thu, 1 Jan 2009 23:26:13 +0000 (00:26 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 10 Feb 2009 11:29:41 +0000 (11:29 +0000)
Patch adds support for the HTC Himalaya device. It includes hardware definitions and w100fb support.

Signed-off-by: Zbynek Michl <Zbynek.Michl@seznam.cz>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-pxa/Kconfig
arch/arm/mach-pxa/Makefile
arch/arm/mach-pxa/himalaya.c [new file with mode: 0644]

index 9c2221c236635f9a20eaff64a98ba9c4ce8b2a06..04d1a07ced7f13dd6ad0beaa86700e0a8a6b1399 100644 (file)
@@ -305,6 +305,11 @@ config MACH_MAGICIAN
        select HAVE_PWM
        select PXA_HAVE_BOARD_IRQS
 
+config MACH_HIMALAYA
+       bool "HTC Himalaya Support"
+       select CPU_PXA26x
+       select FB_W100
+
 config MACH_MIOA701
        bool "Mitac Mio A701 Support"
        select PXA27x
index 6bfbddc5769d5916b2d1c25332b86093e8df0961..361fcfa7531a347ae82d1ddae48a01bed71cc826 100644 (file)
@@ -46,6 +46,7 @@ obj-$(CONFIG_MACH_PCM990_BASEBOARD)   += pcm990-baseboard.o
 obj-$(CONFIG_MACH_TOSA)                += tosa.o
 obj-$(CONFIG_MACH_EM_X270)     += em-x270.o
 obj-$(CONFIG_MACH_MAGICIAN)    += magician.o
+obj-$(CONFIG_MACH_HIMALAYA)    += himalaya.o
 obj-$(CONFIG_MACH_MIOA701)     += mioa701.o mioa701_bootresume.o
 obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o
 obj-$(CONFIG_MACH_E330)                += e330.o
diff --git a/arch/arm/mach-pxa/himalaya.c b/arch/arm/mach-pxa/himalaya.c
new file mode 100644 (file)
index 0000000..00884e5
--- /dev/null
@@ -0,0 +1,168 @@
+/*
+ * linux/arch/arm/mach-pxa/himalaya.c
+ *
+ * Hardware definitions for the HTC Himalaya
+ *
+ * Based on 2.6.21-hh20's himalaya.c and himalaya_lcd.c
+ *
+ * Copyright (c) 2008 Zbynek Michl <Zbynek.Michl@seznam.cz>
+ *
+ * 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/device.h>
+#include <linux/fb.h>
+#include <linux/platform_device.h>
+
+#include <video/w100fb.h>
+
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+
+#include <mach/mfp-pxa25x.h>
+#include <mach/hardware.h>
+#include <mach/pxa-regs.h>
+#include <mach/pxa2xx-regs.h>
+
+#include "generic.h"
+
+/* ---------------------- Himalaya LCD definitions -------------------- */
+
+static struct w100_gen_regs himalaya_lcd_regs = {
+       .lcd_format =        0x00000003,
+       .lcdd_cntl1 =        0x00000000,
+       .lcdd_cntl2 =        0x0003ffff,
+       .genlcd_cntl1 =      0x00fff003,
+       .genlcd_cntl2 =      0x00000003,
+       .genlcd_cntl3 =      0x000102aa,
+};
+
+static struct w100_mode himalaya4_lcd_mode = {
+       .xres           = 240,
+       .yres           = 320,
+       .left_margin    = 0,
+       .right_margin   = 31,
+       .upper_margin   = 15,
+       .lower_margin   = 0,
+       .crtc_ss        = 0x80150014,
+       .crtc_ls        = 0xa0fb00f7,
+       .crtc_gs        = 0xc0080007,
+       .crtc_vpos_gs   = 0x00080007,
+       .crtc_rev       = 0x0000000a,
+       .crtc_dclk      = 0x81700030,
+       .crtc_gclk      = 0x8015010f,
+       .crtc_goe       = 0x00000000,
+       .pll_freq       = 80,
+       .pixclk_divider = 15,
+       .pixclk_divider_rotated = 15,
+       .pixclk_src     = CLK_SRC_PLL,
+       .sysclk_divider = 0,
+       .sysclk_src     = CLK_SRC_PLL,
+};
+
+static struct w100_mode himalaya6_lcd_mode = {
+       .xres           = 240,
+       .yres           = 320,
+       .left_margin    = 9,
+       .right_margin   = 8,
+       .upper_margin   = 5,
+       .lower_margin   = 4,
+       .crtc_ss        = 0x80150014,
+       .crtc_ls        = 0xa0fb00f7,
+       .crtc_gs        = 0xc0080007,
+       .crtc_vpos_gs   = 0x00080007,
+       .crtc_rev       = 0x0000000a,
+       .crtc_dclk      = 0xa1700030,
+       .crtc_gclk      = 0x8015010f,
+       .crtc_goe       = 0x00000000,
+       .pll_freq       = 95,
+       .pixclk_divider = 0xb,
+       .pixclk_divider_rotated = 4,
+       .pixclk_src     = CLK_SRC_PLL,
+       .sysclk_divider = 1,
+       .sysclk_src     = CLK_SRC_PLL,
+};
+
+static struct w100_gpio_regs himalaya_w100_gpio_info = {
+       .init_data1 = 0xffff0000,       /* GPIO_DATA  */
+       .gpio_dir1  = 0x00000000,       /* GPIO_CNTL1 */
+       .gpio_oe1   = 0x003c0000,       /* GPIO_CNTL2 */
+       .init_data2 = 0x00000000,       /* GPIO_DATA2 */
+       .gpio_dir2  = 0x00000000,       /* GPIO_CNTL3 */
+       .gpio_oe2   = 0x00000000,       /* GPIO_CNTL4 */
+};
+
+static struct w100fb_mach_info himalaya_fb_info = {
+       .num_modes  = 1,
+       .regs       = &himalaya_lcd_regs,
+       .gpio       = &himalaya_w100_gpio_info,
+       .xtal_freq = 16000000,
+};
+
+static struct resource himalaya_fb_resources[] = {
+       [0] = {
+               .start  = 0x08000000,
+               .end    = 0x08ffffff,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device himalaya_fb_device = {
+       .name           = "w100fb",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &himalaya_fb_info,
+       },
+       .num_resources  = ARRAY_SIZE(himalaya_fb_resources),
+       .resource       = himalaya_fb_resources,
+};
+
+/* ----------------------------------------------------------------------- */
+
+static struct platform_device *devices[] __initdata = {
+       &himalaya_fb_device,
+};
+
+static void __init himalaya_lcd_init(void)
+{
+       int himalaya_boardid;
+
+       himalaya_boardid = 0x4; /* hardcoded (detection needs ASIC3 functions) */
+       printk(KERN_INFO "himalaya LCD Driver init. boardid=%d\n",
+               himalaya_boardid);
+
+       switch (himalaya_boardid) {
+       case 0x4:
+               himalaya_fb_info.modelist = &himalaya4_lcd_mode;
+       break;
+       case 0x6:
+               himalaya_fb_info.modelist = &himalaya6_lcd_mode;
+       break;
+       default:
+               printk(KERN_INFO "himalaya lcd_init: unknown boardid=%d. Using 0x4\n",
+                       himalaya_boardid);
+               himalaya_fb_info.modelist = &himalaya4_lcd_mode;
+       }
+}
+
+static void __init himalaya_init(void)
+{
+       himalaya_lcd_init();
+       platform_add_devices(devices, ARRAY_SIZE(devices));
+}
+
+
+MACHINE_START(HIMALAYA, "HTC Himalaya")
+       .phys_io = 0x40000000,
+       .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
+       .boot_params = 0xa0000100,
+       .map_io = pxa_map_io,
+       .init_irq = pxa25x_init_irq,
+       .init_machine = himalaya_init,
+       .timer = &pxa_timer,
+MACHINE_END