r1558 - trunk/src/target/kernel/patches
laforge at sita.openmoko.org
laforge at sita.openmoko.org
Thu Mar 29 23:12:42 CEST 2007
Author: laforge
Date: 2007-03-29 23:12:42 +0200 (Thu, 29 Mar 2007)
New Revision: 1558
Added:
trunk/src/target/kernel/patches/hxd8-core.patch
trunk/src/target/kernel/patches/s3c2410_fb-truecolor.patch
Modified:
trunk/src/target/kernel/patches/series
Log:
* add support for the HXD8 hardware
* add a patch that supposedly should add 24bpp support to s3c2410 fb, but which is still broken
(patch is not activated in 'series' yet)
Added: trunk/src/target/kernel/patches/hxd8-core.patch
===================================================================
--- trunk/src/target/kernel/patches/hxd8-core.patch 2007-03-29 19:59:42 UTC (rev 1557)
+++ trunk/src/target/kernel/patches/hxd8-core.patch 2007-03-29 21:12:42 UTC (rev 1558)
@@ -0,0 +1,411 @@
+This patch adds another machine, the FIC HXD8
+Index: linux-2.6.20.4/arch/arm/mach-s3c2410/Kconfig
+===================================================================
+--- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Kconfig 2007-03-28 23:11:54.000000000 +0200
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/Kconfig 2007-03-28 23:11:54.000000000 +0200
+@@ -94,6 +94,12 @@
+ help
+ Say Y here if you are using the FIC Neo1973 GSM Phone
+
++config MACH_HXD8
++ bool "FIC HXD8"
++ select CPU_S3C2440
++ select SENSORS_PCF50606
++ help
++ Say Y here if you are using the FIC Neo1973 GSM Phone
+
+ config ARCH_S3C2440
+ bool "SMDK2440"
+Index: linux-2.6.20.4/arch/arm/mach-s3c2410/Makefile
+===================================================================
+--- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Makefile 2007-03-28 23:11:54.000000000 +0200
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/Makefile 2007-03-28 23:11:54.000000000 +0200
+@@ -90,5 +90,6 @@
+ obj-$(CONFIG_MACH_VSTMS) += mach-vstms.o
+ obj-$(CONFIG_MACH_QT2410) += mach-qt2410.o
+ obj-$(CONFIG_MACH_GTA01) += mach-gta01.o
++obj-$(CONFIG_MACH_HXD8) += mach-hxd8.o
+
+ obj-$(CONFIG_MACH_SMDK) += common-smdk.o
+Index: linux-2.6.20.4/arch/arm/mach-s3c2410/mach-hxd8.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/mach-hxd8.c 2007-03-29 22:20:21.000000000 +0200
+@@ -0,0 +1,359 @@
++/* linux/arch/arm/mach-s3c2410/mach-hxd8.c
++ *
++ * S3C2440 Machine Support for the FIC HXD8
++ *
++ * Copyright (c) 2007 OpenMoko, Inc.
++ * Author: Harald Welte <laforge at openmoko.org>
++ * All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/types.h>
++#include <linux/interrupt.h>
++#include <linux/list.h>
++#include <linux/timer.h>
++#include <linux/init.h>
++#include <linux/workqueue.h>
++#include <linux/serial_core.h>
++#include <linux/platform_device.h>
++#include <linux/mmc/protocol.h>
++
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/nand.h>
++#include <linux/mtd/nand_ecc.h>
++#include <linux/mtd/partitions.h>
++
++#include <asm/mach/arch.h>
++#include <asm/mach/map.h>
++#include <asm/mach/irq.h>
++
++#include <asm/hardware.h>
++#include <asm/hardware/iomd.h>
++#include <asm/io.h>
++#include <asm/irq.h>
++#include <asm/mach-types.h>
++
++//#include <asm/debug-ll.h>
++#include <asm/arch/regs-serial.h>
++#include <asm/arch/regs-gpio.h>
++#include <asm/arch/regs-lcd.h>
++#include <asm/arch/idle.h>
++#include <asm/arch/fb.h>
++#include <asm/arch/udc.h>
++#include <asm/arch/nand.h>
++#include <asm/arch/mci.h>
++#include <asm/arch/ts.h>
++#include <asm/arch/spi.h>
++#include <asm/arch/spi-gpio.h>
++#include <asm/arch/usb-control.h>
++
++#include <asm/arch/hxd8.h>
++#include <asm/arch/gta01.h>
++
++//#include "s3c2410.h"
++//#include "s3c2440.h"
++//#include "clock.h"
++#include "devs.h"
++#include "cpu.h"
++#include "pm.h"
++
++static struct map_desc hxd8_iodesc[] __initdata = {
++ /* ISA IO Space map (memory space selected by A24) */
++
++ {
++ .virtual = (u32)S3C24XX_VA_ISA_WORD,
++ .pfn = __phys_to_pfn(S3C2410_CS2),
++ .length = 0x10000,
++ .type = MT_DEVICE,
++ }, {
++ .virtual = (u32)S3C24XX_VA_ISA_WORD + 0x10000,
++ .pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
++ .length = SZ_4M,
++ .type = MT_DEVICE,
++ }, {
++ .virtual = (u32)S3C24XX_VA_ISA_BYTE,
++ .pfn = __phys_to_pfn(S3C2410_CS2),
++ .length = 0x10000,
++ .type = MT_DEVICE,
++ }, {
++ .virtual = (u32)S3C24XX_VA_ISA_BYTE + 0x10000,
++ .pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
++ .length = SZ_4M,
++ .type = MT_DEVICE,
++ }
++};
++
++#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
++#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
++#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
++
++static struct s3c2410_uartcfg hxd8_uartcfgs[] __initdata = {
++ [0] = {
++ .hwport = 0,
++ .flags = 0,
++ .ucon = 0x3c5,
++ .ulcon = 0x03,
++ .ufcon = 0x51,
++ },
++ [1] = {
++ .hwport = 1,
++ .flags = 0,
++ .ucon = 0x3c5,
++ .ulcon = 0x03,
++ .ufcon = 0x51,
++ },
++ [2] = {
++ .hwport = 2,
++ .flags = 0,
++ .ucon = 0x3c5,
++ .ulcon = 0x03,
++ .ufcon = 0x51,
++ }
++};
++
++/* NAND partitions. Once we use dynpart, this goes away */
++static struct mtd_partition hxd8_default_nand_part[] = {
++ [0] = {
++ .name = "U-Boot",
++ .size = 0x100000,
++ .offset = 0,
++ },
++ [1] = {
++ .name = "kernel",
++ .offset = 0x100000,
++ .size = SZ_2M,
++ },
++ [2] = {
++ .name = "update",
++ .offset = 0x300000,
++ .size = SZ_2M,
++ },
++ [3] = {
++ .name = "splash",
++ .offset = 0x500000,
++ .size = SZ_1M,
++ },
++ [4] = {
++ .name = "jffs2",
++ .offset = 0x600000,
++ .size = SZ_2M * 10,
++ },
++ [5] = {
++ .name = "temp",
++ .offset = 0x1a00000,
++ .size = 0x30000000,
++ },
++};
++
++static struct s3c2410_nand_set hxd8_nand_sets[] = {
++ [0] = {
++ .name = "hxd8-nand",
++ .nr_chips = 1,
++ /* FIXME: the static partition table should be removed soon */
++ .nr_partitions = ARRAY_SIZE(hxd8_default_nand_part),
++ .partitions = hxd8_default_nand_part,
++ },
++};
++
++/* choose a set of timings which should suit most 512Mbit
++ * chips and beyond.
++*/
++
++static struct s3c2410_platform_nand hxd8_nand_info = {
++ .tacls = 20,
++ .twrph0 = 60,
++ .twrph1 = 20,
++ .nr_sets = ARRAY_SIZE(hxd8_nand_sets),
++ .sets = hxd8_nand_sets,
++};
++
++/* LCD driver info */
++
++static struct s3c2410fb_mach_info hxd8_lcd_cfg __initdata = {
++ .regs = {
++
++ .lcdcon1 = S3C2410_LCDCON1_TFT24BPP |
++ S3C2410_LCDCON1_TFT |
++ S3C2410_LCDCON1_CLKVAL(0x05),
++
++ .lcdcon2 = S3C2410_LCDCON2_VBPD(1) |
++ S3C2410_LCDCON2_LINEVAL(271) |
++ S3C2410_LCDCON2_VFPD(1) |
++ S3C2410_LCDCON2_VSPW(9),
++
++ .lcdcon3 = S3C2410_LCDCON3_HBPD(1) |
++ S3C2410_LCDCON3_HOZVAL(479) |
++ S3C2410_LCDCON3_HFPD(1),
++
++ .lcdcon4 = S3C2410_LCDCON4_MVAL(0) |
++ S3C2410_LCDCON4_HSPW(40),
++
++ .lcdcon5 = S3C2410_LCDCON5_FRM565 |
++ S3C2410_LCDCON5_INVVLINE |
++ S3C2410_LCDCON5_INVVFRAME,
++ },
++
++ .lpcsel = ((0xCE6) & ~7),
++
++ .width = 480,
++ .height = 272,
++
++ .xres = {
++ .min = 480,
++ .max = 480,
++ .defval = 480,
++ },
++
++ .yres = {
++ .min = 272,
++ .max = 272,
++ .defval = 272,
++ },
++
++ .bpp = {
++ .min = 16,
++ .max = 32,
++ .defval = 32,
++ },
++};
++
++static struct gta01bl_machinfo backlight_machinfo = {
++ .default_intensity = 1,
++ .max_intensity = 1,
++ .limit_mask = 1,
++};
++
++static struct resource hxd8_bl_resources[] = {
++ [0] = {
++ .start = HXD8_GPIO_BACKLIGHT,
++ .end = HXD8_GPIO_BACKLIGHT,
++ },
++};
++
++struct platform_device hxd8_bl_dev = {
++ .name = "gta01-bl",
++ .num_resources = ARRAY_SIZE(hxd8_bl_resources),
++ .resource = hxd8_bl_resources,
++ .dev = {
++ .platform_data = &backlight_machinfo,
++ },
++};
++
++static struct platform_device hxd8_pm_gsm_dev = {
++ .name = "gta01-pm-gsm",
++};
++
++static void gta01_udc_command(enum s3c2410_udc_cmd_e cmd)
++{
++ printk(KERN_DEBUG "%s(%d)\n", __func__, cmd);
++
++ switch (cmd) {
++ case S3C2410_UDC_P_ENABLE:
++ s3c2410_gpio_setpin(HXD8_GPIO_USB_PULLUP, 1);
++ break;
++ case S3C2410_UDC_P_DISABLE:
++ s3c2410_gpio_setpin(HXD8_GPIO_USB_PULLUP, 0);
++ break;
++ case S3C2410_UDC_P_RESET:
++ /* FIXME! */
++ break;
++ default:
++ break;
++ }
++}
++
++/* USB Charger */
++
++static void hxd8_udc_vbus_draw(unsigned int ma)
++{
++ if (ma >= 500) {
++ /* enable fast charge */
++ printk(KERN_DEBUG "udc: enabling fast charge\n");
++ s3c2410_gpio_setpin(HXD8_GPIO_USB_CUR_SEL, 1);
++ } else {
++ /* disable fast charge */
++ printk(KERN_DEBUG "udc: disabling fast charge\n");
++ s3c2410_gpio_setpin(HXD8_GPIO_USB_CUR_SEL, 0);
++ }
++}
++
++static struct s3c2410_udc_mach_info hxd8_udc_cfg = {
++ .vbus_draw = hxd8_udc_vbus_draw,
++};
++
++/* Touch Screen */
++static struct s3c2410_ts_mach_info hxd8_ts_cfg = {
++ .delay = 10000,
++ .presc = 49,
++ .oversampling_shift = 2,
++};
++
++static struct platform_device *hxd8_devices[] __initdata = {
++ &s3c_device_usb,
++ &s3c_device_lcd,
++ &s3c_device_wdt,
++ &s3c_device_i2c,
++ &s3c_device_iis,
++ &s3c_device_sdi,
++ &s3c_device_usbgadget,
++ &s3c_device_nand,
++ &s3c_device_ts,
++};
++
++static struct s3c24xx_board hxd8_board __initdata = {
++ .devices = hxd8_devices,
++ .devices_count = ARRAY_SIZE(hxd8_devices)
++};
++
++static void __init hxd8_map_io(void)
++{
++ s3c24xx_init_io(hxd8_iodesc, ARRAY_SIZE(hxd8_iodesc));
++ s3c24xx_init_clocks(16934400);
++ s3c24xx_init_uarts(hxd8_uartcfgs, ARRAY_SIZE(hxd8_uartcfgs));
++ s3c24xx_set_board(&hxd8_board);
++}
++
++static void __init hxd8_machine_init(void)
++{
++ hxd8_udc_cfg.udc_command = gta01_udc_command;
++ s3c_device_nand.dev.platform_data = &hxd8_nand_info;
++
++ s3c24xx_fb_set_platdata(&hxd8_lcd_cfg);
++
++ s3c24xx_udc_set_platdata(&hxd8_udc_cfg);
++ set_s3c2410ts_info(&hxd8_ts_cfg);
++
++ platform_device_register(&hxd8_bl_dev);
++ //platform_device_register(>a01_button_dev);
++ platform_device_register(&hxd8_pm_gsm_dev);
++
++ s3c2410_pm_init();
++}
++
++MACHINE_START(S3C2440, "HXD8")
++ /* Maintainer: Harald Welte <laforge at openmoko.org> */
++ .phys_io = S3C2410_PA_UART,
++ .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
++ .boot_params = S3C2410_SDRAM_PA + 0x100,
++
++ .init_irq = s3c24xx_init_irq,
++ .map_io = hxd8_map_io,
++ .init_machine = hxd8_machine_init,
++ .timer = &s3c24xx_timer,
++MACHINE_END
+Index: linux-2.6.20.4/include/asm-arm/arch-s3c2410/hxd8.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.20.4/include/asm-arm/arch-s3c2410/hxd8.h 2007-03-29 22:17:17.000000000 +0200
+@@ -0,0 +1,13 @@
++#ifndef _HXD8_H
++#define _HXD8_H
++
++#include <asm/arch/regs-gpio.h>
++#include <asm/arch/irqs.h>
++
++#define HXD8v1_SYSTEM_REV 0x00000110
++
++#define HXD8_GPIO_USB_CUR_SEL S3C2410_GPA0
++#define HXD8_GPIO_BACKLIGHT S3C2410_GPB0
++#define HXD8_GPIO_USB_PULLUP S3C2410_GPB9
++
++#endif
Added: trunk/src/target/kernel/patches/s3c2410_fb-truecolor.patch
===================================================================
--- trunk/src/target/kernel/patches/s3c2410_fb-truecolor.patch 2007-03-29 19:59:42 UTC (rev 1557)
+++ trunk/src/target/kernel/patches/s3c2410_fb-truecolor.patch 2007-03-29 21:12:42 UTC (rev 1558)
@@ -0,0 +1,144 @@
+Index: linux-2.6.20.4/drivers/video/s3c2410fb.c
+===================================================================
+--- linux-2.6.20.4.orig/drivers/video/s3c2410fb.c 2007-03-28 23:12:49.000000000 +0200
++++ linux-2.6.20.4/drivers/video/s3c2410fb.c 2007-03-29 22:22:40.000000000 +0200
+@@ -104,7 +104,7 @@
+
+
+ static struct s3c2410fb_mach_info *mach_info;
+-
++#define CONFIG_FB_S3C2410_DEBUG
+ /* Debugging stuff */
+ #ifdef CONFIG_FB_S3C2410_DEBUG
+ static int debug = 1;
+@@ -315,8 +315,13 @@
+ break;
+ case 16:
+ fbi->regs.lcdcon1 |= S3C2410_LCDCON1_TFT16BPP;
++ fbi->regs.lcdcon5 |= S3C2410_LCDCON5_HWSWP;
++ break;
++ case 24:
++ case 32:
++ fbi->regs.lcdcon1 |= S3C2410_LCDCON1_TFT24BPP;
++ fbi->regs.lcdcon5 &= ~S3C2410_LCDCON5_HWSWP;
+ break;
+-
+ default:
+ /* invalid pixel depth */
+ dev_err(fbi->dev, "invalid bpp %d\n", var->bits_per_pixel);
+@@ -451,6 +456,8 @@
+ switch (var->bits_per_pixel)
+ {
+ case 16:
++ case 24:
++ case 32:
+ fbi->fb->fix.visual = FB_VISUAL_TRUECOLOR;
+ break;
+ case 1:
+@@ -514,11 +521,21 @@
+
+ if (regno < 16) {
+ u32 *pal = fbi->fb->pseudo_palette;
+-
++#if 1
++ switch (info->var.bits_per_pixel) {
++ case 16:
++ val = (red & 0xf800) | ((green & 0xfc00) >> 5) | ((blue ^ 0xf800) >> 11);
++ break;
++ case 32:
++ red >>= 8; green >>= 8; blue >>= 8; transp >>= 8;
++ val = (transp << 24) | (red << 16) | (green << 8) | blue;
++ break;
++ }
++#else
+ val = chan_to_field(red, &fbi->fb->var.red);
+ val |= chan_to_field(green, &fbi->fb->var.green);
+ val |= chan_to_field(blue, &fbi->fb->var.blue);
+-
++#endif
+ pal[regno] = val;
+ }
+ break;
+@@ -710,9 +727,15 @@
+ /* ensure temporary palette disabled */
+ writel(0x00, S3C2410_TPAL);
+
++ /* johnny */
++ mdelay(500);
+ /* Enable video by setting the ENVID bit to 1 */
+ fbi->regs.lcdcon1 |= S3C2410_LCDCON1_ENVID;
+ writel(fbi->regs.lcdcon1, S3C2410_LCDCON1);
++
++ mdelay(500);
++ fbi->regs.lcdcon5 |= S3C2410_LCDCON5_PWREN;
++ writel(fbi->regs.lcdcon5, S3C2410_LCDCON5);
+ return 0;
+ }
+
+@@ -839,7 +862,31 @@
+ fbinfo->var.left_margin = S3C2410_LCDCON3_GET_HFPD(mregs->lcdcon3) + 1;
+ fbinfo->var.right_margin = S3C2410_LCDCON3_GET_HBPD(mregs->lcdcon3) + 1;
+ fbinfo->var.hsync_len = S3C2410_LCDCON4_GET_HSPW(mregs->lcdcon4) + 1;
+-
++// johnny
++ switch (fbinfo->var.bits_per_pixel)
++ {
++ case 16:
++ fbinfo->var.red.offset = 11;
++ fbinfo->var.red.length = 5;
++ fbinfo->var.green.offset = 5;
++ fbinfo->var.green.length = 6;
++ fbinfo->var.blue.offset = 0;
++ fbinfo->var.blue.length = 5;
++ fbinfo->var.transp.offset = 0;
++ fbinfo->var.transp.length = 0;
++ break;
++ case 32:
++ fbinfo->var.red.offset = 16;
++ fbinfo->var.red.length = 8;
++ fbinfo->var.green.offset = 8;
++ fbinfo->var.green.length = 8;
++ fbinfo->var.blue.offset = 0;
++ fbinfo->var.blue.length = 8;
++ fbinfo->var.transp.offset = 24;
++ fbinfo->var.transp.length = 8;
++ break;
++ }
++#if 0
+ fbinfo->var.red.offset = 11;
+ fbinfo->var.green.offset = 5;
+ fbinfo->var.blue.offset = 0;
+@@ -848,10 +895,11 @@
+ fbinfo->var.green.length = 6;
+ fbinfo->var.blue.length = 5;
+ fbinfo->var.transp.length = 0;
++#endif
+ fbinfo->fix.smem_len = mach_info->xres.max *
+ mach_info->yres.max *
+ mach_info->bpp.max / 8;
+-
++ dprintk("fix.smem_len=%d\n",fbinfo->fix.smem_len);
+ for (i = 0; i < 256; i++)
+ info->palette_buffer[i] = PALETTE_BUFF_CLEAR;
+
+@@ -934,6 +982,11 @@
+
+ local_irq_save(flags);
+
++ /* johnny */
++ fbi->regs.lcdcon5 &= ~S3C2410_LCDCON5_PWREN;
++ writel(fbi->regs.lcdcon5, S3C2410_LCDCON5);
++
++ mdelay(2000);
+ fbi->regs.lcdcon1 &= ~S3C2410_LCDCON1_ENVID;
+ writel(fbi->regs.lcdcon1, S3C2410_LCDCON1);
+
+@@ -997,8 +1050,6 @@
+ clk_enable(info->clk);
+ msleep(1);
+
+- s3c2410fb_init_registers(info);
+-
+ return 0;
+ }
+
Modified: trunk/src/target/kernel/patches/series
===================================================================
--- trunk/src/target/kernel/patches/series 2007-03-29 19:59:42 UTC (rev 1557)
+++ trunk/src/target/kernel/patches/series 2007-03-29 21:12:42 UTC (rev 1558)
@@ -37,3 +37,5 @@
ts0710.patch
s3c2410-qt2410-buttons.patch
config-nr-tty-devices.patch
+hxd8-core.patch
+#s3c2410_fb-truecolor.patch
More information about the commitlog
mailing list