diff -NurpP --minimal linux-2.6.9-rc1-bk12/arch/arm/configs/s3c2410_defconfig linux-2.6.9-rc1-bk12-h1940-0.05.2/arch/arm/configs/s3c2410_defconfig --- linux-2.6.9-rc1-bk12/arch/arm/configs/s3c2410_defconfig 2004-08-30 19:38:29.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/arch/arm/configs/s3c2410_defconfig 2004-09-06 02:44:05.000000000 +0200 @@ -493,7 +493,17 @@ CONFIG_PPDEV=y # # Watchdog Cards # -# CONFIG_WATCHDOG is not set +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set + +# +# Watchdog Device Drivers +# +# CONFIG_SOFT_WATCHDOG is not set +CONFIG_S3C2410_WATCHDOG=y +# CONFIG_S3C2410_WATCHDOG_ATBOOT is not set +CONFIG_S3C2410_WATCHDOG_DEBUG=y +CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME=20 # CONFIG_NVRAM is not set CONFIG_RTC=y # CONFIG_DTLK is not set diff -NurpP --minimal linux-2.6.9-rc1-bk12/arch/arm/kernel/calls.S linux-2.6.9-rc1-bk12-h1940-0.05.2/arch/arm/kernel/calls.S --- linux-2.6.9-rc1-bk12/arch/arm/kernel/calls.S 2004-07-19 03:33:40.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/arch/arm/kernel/calls.S 2004-09-06 02:44:05.000000000 +0200 @@ -236,7 +236,7 @@ __syscall_start: .long sys_mincore /* 220 */ .long sys_madvise .long sys_fcntl64 - .long sys_ni_syscall /* TUX */ + .long sys_mhelper .long sys_ni_syscall .long sys_gettid /* 225 */ .long sys_readahead diff -NurpP --minimal linux-2.6.9-rc1-bk12/arch/arm/mach-s3c2410/devs.c linux-2.6.9-rc1-bk12-h1940-0.05.2/arch/arm/mach-s3c2410/devs.c --- linux-2.6.9-rc1-bk12/arch/arm/mach-s3c2410/devs.c 2004-09-06 02:19:41.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/arch/arm/mach-s3c2410/devs.c 2004-09-06 02:44:05.000000000 +0200 @@ -10,6 +10,8 @@ * published by the Free Software Foundation. * * Modifications: + * 29-Aug-2004 BJD Added timers 0 through 3 + * 29-Aug-2004 BJD Changed index of devices we only have one of to -1 * 21-Aug-2004 BJD Added IRQ_TICK to RTC resources * 18-Aug-2004 BJD Created initial version */ @@ -51,7 +53,7 @@ static u64 s3c_device_usb_dmamask = 0xff struct platform_device s3c_device_usb = { .name = "s3c2410-ohci", - .id = 0, + .id = -1, .num_resources = ARRAY_SIZE(s3c_usb_resource), .resource = s3c_usb_resource, .dev = { @@ -82,7 +84,7 @@ static u64 s3c_device_lcd_dmamask = 0xff struct platform_device s3c_device_lcd = { .name = "s3c2410-lcd", - .id = 0, + .id = -1, .num_resources = ARRAY_SIZE(s3c_lcd_resource), .resource = s3c_lcd_resource, .dev = { @@ -111,7 +113,7 @@ static struct resource s3c_nand_resource struct platform_device s3c_device_nand = { .name = "s3c2410-nand", - .id = 0, + .id = -1, .num_resources = ARRAY_SIZE(s3c_nand_resource), .resource = s3c_nand_resource, }; @@ -136,7 +138,7 @@ static struct resource s3c_usbgadget_res struct platform_device s3c_device_usbgadget = { .name = "s3c2410-usbgadget", - .id = 0, + .id = -1, .num_resources = ARRAY_SIZE(s3c_usbgadget_resource), .resource = s3c_usbgadget_resource, }; @@ -161,7 +163,7 @@ static struct resource s3c_wdt_resource[ struct platform_device s3c_device_wdt = { .name = "s3c2410-wdt", - .id = 0, + .id = -1, .num_resources = ARRAY_SIZE(s3c_wdt_resource), .resource = s3c_wdt_resource, }; @@ -186,7 +188,7 @@ static struct resource s3c_i2c_resource[ struct platform_device s3c_device_i2c = { .name = "s3c2410-i2c", - .id = 0, + .id = -1, .num_resources = ARRAY_SIZE(s3c_i2c_resource), .resource = s3c_i2c_resource, }; @@ -207,7 +209,7 @@ static u64 s3c_device_iis_dmamask = 0xff struct platform_device s3c_device_iis = { .name = "s3c2410-iis", - .id = 0, + .id = -1, .num_resources = ARRAY_SIZE(s3c_iis_resource), .resource = s3c_iis_resource, .dev = { @@ -240,7 +242,7 @@ static struct resource s3c_rtc_resource[ struct platform_device s3c_device_rtc = { .name = "s3c2410-rtc", - .id = 0, + .id = -1, .num_resources = ARRAY_SIZE(s3c_rtc_resource), .resource = s3c_rtc_resource, }; @@ -265,7 +267,7 @@ static struct resource s3c_adc_resource[ struct platform_device s3c_device_adc = { .name = "s3c2410-adc", - .id = 0, + .id = -1, .num_resources = ARRAY_SIZE(s3c_adc_resource), .resource = s3c_adc_resource, }; @@ -288,7 +290,7 @@ static struct resource s3c_sdi_resource[ struct platform_device s3c_device_sdi = { .name = "s3c2410-sdi", - .id = 0, + .id = -1, .num_resources = ARRAY_SIZE(s3c_sdi_resource), .resource = s3c_sdi_resource, }; @@ -344,3 +346,103 @@ struct platform_device s3c_device_spi1 = }; EXPORT_SYMBOL(s3c_device_spi1); + +/* pwm timer blocks */ + +static struct resource s3c_timer0_resource[] = { + [0] = { + .start = S3C2410_PA_TIMER + 0x0C, + .end = S3C2410_PA_TIMER + 0x0C + 0xB, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_TIMER0, + .end = IRQ_TIMER0, + .flags = IORESOURCE_IRQ, + } + +}; + +struct platform_device s3c_device_timer0 = { + .name = "s3c2410-timer", + .id = 0, + .num_resources = ARRAY_SIZE(s3c_timer0_resource), + .resource = s3c_timer0_resource, +}; + +EXPORT_SYMBOL(s3c_device_timer0); + +/* timer 1 */ + +static struct resource s3c_timer1_resource[] = { + [0] = { + .start = S3C2410_PA_TIMER + 0x18, + .end = S3C2410_PA_TIMER + 0x23, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_TIMER1, + .end = IRQ_TIMER1, + .flags = IORESOURCE_IRQ, + } + +}; + +struct platform_device s3c_device_timer1 = { + .name = "s3c2410-timer", + .id = 1, + .num_resources = ARRAY_SIZE(s3c_timer1_resource), + .resource = s3c_timer1_resource, +}; + +EXPORT_SYMBOL(s3c_device_timer1); + +/* timer 2 */ + +static struct resource s3c_timer2_resource[] = { + [0] = { + .start = S3C2410_PA_TIMER + 0x24, + .end = S3C2410_PA_TIMER + 0x2F, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_TIMER2, + .end = IRQ_TIMER2, + .flags = IORESOURCE_IRQ, + } + +}; + +struct platform_device s3c_device_timer2 = { + .name = "s3c2410-timer", + .id = 2, + .num_resources = ARRAY_SIZE(s3c_timer2_resource), + .resource = s3c_timer2_resource, +}; + +EXPORT_SYMBOL(s3c_device_timer2); + +/* timer 3 */ + +static struct resource s3c_timer3_resource[] = { + [0] = { + .start = S3C2410_PA_TIMER + 0x30, + .end = S3C2410_PA_TIMER + 0x3B, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_TIMER3, + .end = IRQ_TIMER3, + .flags = IORESOURCE_IRQ, + } + +}; + +struct platform_device s3c_device_timer3 = { + .name = "s3c2410-timer", + .id = 3, + .num_resources = ARRAY_SIZE(s3c_timer3_resource), + .resource = s3c_timer3_resource, +}; + +EXPORT_SYMBOL(s3c_device_timer3); diff -NurpP --minimal linux-2.6.9-rc1-bk12/arch/arm/mach-s3c2410/devs.h linux-2.6.9-rc1-bk12-h1940-0.05.2/arch/arm/mach-s3c2410/devs.h --- linux-2.6.9-rc1-bk12/arch/arm/mach-s3c2410/devs.h 2004-08-30 19:38:30.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/arch/arm/mach-s3c2410/devs.h 2004-09-06 02:44:05.000000000 +0200 @@ -10,8 +10,8 @@ * published by the Free Software Foundation. * * Modifications: - * 18-Aug-2004 BJD Created initial version - * + * 18-Aug-2004 BJD Created initial version + * 27-Aug-2004 BJD Added timers 0 through 3 */ extern struct platform_device s3c_device_usb; @@ -28,4 +28,9 @@ extern struct platform_device s3c_device extern struct platform_device s3c_device_nand; +extern struct platform_device s3c_device_timer0; +extern struct platform_device s3c_device_timer1; +extern struct platform_device s3c_device_timer2; +extern struct platform_device s3c_device_timer3; + extern struct platform_device s3c_device_usbgadget; diff -NurpP --minimal linux-2.6.9-rc1-bk12/arch/arm/mach-s3c2410/mach-h1940.c linux-2.6.9-rc1-bk12-h1940-0.05.2/arch/arm/mach-s3c2410/mach-h1940.c --- linux-2.6.9-rc1-bk12/arch/arm/mach-s3c2410/mach-h1940.c 2004-09-06 02:19:41.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/arch/arm/mach-s3c2410/mach-h1940.c 2004-09-06 02:44:05.000000000 +0200 @@ -42,15 +42,15 @@ #include "s3c2410.h" #include "devs.h" -static struct map_desc ipaq_iodesc[] __initdata = { +static struct map_desc h1940_iodesc[] __initdata = { /* nothing here yet */ }; -#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 +#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 ipaq_uartcfgs[] = { +static struct s3c2410_uartcfg h1940_uartcfgs[] = { [0] = { .hwport = 0, .flags = 0, @@ -78,6 +78,41 @@ static struct s3c2410_uartcfg ipaq_uartc } }; +#include + +static void __init +h1940_fixup(struct machine_desc *desc, struct tag *tag, + char **cmdline, struct meminfo *mi) +{ + unsigned int nr = 0; + + while (tag && tag->hdr.tag != ATAG_NONE) { + printk("[%d] #%08x (%d)\n", nr++, tag->hdr.tag, tag->hdr.size); + switch (tag->hdr.tag) { + case ATAG_CORE: + printk(" CORE: flags=%08x, page=%x, root=%d\n", + tag->u.core.flags, tag->u.core.pagesize, tag->u.core.rootdev); + break; + case ATAG_MEM: + printk(" MEM: %08x (%08x)\n", + tag->u.mem.start, tag->u.mem.size); + + /* for now, exclude video */ + tag->u.mem.size = S3C2410_PA_FBMEM - tag->u.mem.start; + break; + case ATAG_RAMDISK: + printk(" RAMD: flags=%x, %08x (%08x)\n", + tag->u.ramdisk.flags, tag->u.ramdisk.start, tag->u.ramdisk.size); + break; + case ATAG_INITRD: + case ATAG_INITRD2: + printk(" INITRD: %08x (%08x)\n", + tag->u.initrd.start, tag->u.initrd.size); + break; + } + tag = tag_next(tag); + } +} @@ -94,32 +129,30 @@ static struct s3c2410_board h1940_board .devices_count = ARRAY_SIZE(h1940_devices) }; -void __init ipaq_map_io(void) +void __init h1940_map_io(void) { - s3c2410_map_io(ipaq_iodesc, ARRAY_SIZE(ipaq_iodesc)); - s3c2410_uartcfgs = ipaq_uartcfgs; + s3c2410_map_io(h1940_iodesc, ARRAY_SIZE(h1940_iodesc)); + s3c2410_uartcfgs = h1940_uartcfgs; s3c2410_set_board(&h1940_board); } -void __init ipaq_init_irq(void) +void __init h1940_init_irq(void) { - //llprintk("ipaq_init_irq:\n"); - s3c2410_init_irq(); - } -void __init ipaq_init_time(void) +void __init h1940_init_time(void) { s3c2410_init_time(); } MACHINE_START(H1940, "IPAQ-H1940") - MAINTAINER("Ben Dooks ") - BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, S3C2410_VA_UART) - BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) - MAPIO(ipaq_map_io) - INITIRQ(ipaq_init_irq) - INITTIME(ipaq_init_time) + MAINTAINER("Ben Dooks ") + BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, S3C2410_VA_UART) + BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) + MAPIO(h1940_map_io) + FIXUP(h1940_fixup) + INITIRQ(h1940_init_irq) + INITTIME(h1940_init_time) MACHINE_END diff -NurpP --minimal linux-2.6.9-rc1-bk12/arch/arm/mach-s3c2410/s3c2410.c linux-2.6.9-rc1-bk12-h1940-0.05.2/arch/arm/mach-s3c2410/s3c2410.c --- linux-2.6.9-rc1-bk12/arch/arm/mach-s3c2410/s3c2410.c 2004-09-06 02:19:41.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/arch/arm/mach-s3c2410/s3c2410.c 2004-09-06 02:44:05.000000000 +0200 @@ -58,18 +58,31 @@ unsigned long s3c2410_pclk; #define IODESC_ENT(x) { S3C2410_VA_##x, S3C2410_PA_##x, S3C2410_SZ_##x, MT_DEVICE } -static struct map_desc s3c2410_iodesc[] __initdata = { - IODESC_ENT(IRQ), +struct map_desc s3c2410_iodesc[] = { IODESC_ENT(MEMCTRL), IODESC_ENT(USBHOST), - IODESC_ENT(CLKPWR), + IODESC_ENT(IRQ), + IODESC_ENT(DMA), + IODESC_ENT(TIMER), IODESC_ENT(LCD), + IODESC_ENT(NAND), IODESC_ENT(UART), - IODESC_ENT(TIMER), + IODESC_ENT(CLKPWR), + IODESC_ENT(USBDEV), + IODESC_ENT(WATCHDOG), + IODESC_ENT(IIC), + IODESC_ENT(IIS), IODESC_ENT(GPIO), + IODESC_ENT(RTC), IODESC_ENT(ADC), + IODESC_ENT(SPI), + IODESC_ENT(SDI), + + IODESC_ENT(FBMEM), }; +unsigned long s3c2410_iodesc_size = ARRAY_SIZE(s3c2410_iodesc); + static struct resource s3c_uart0_resource[] = { [0] = { .start = S3C2410_PA_UART0, diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/char/Kconfig linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/char/Kconfig --- linux-2.6.9-rc1-bk12/drivers/char/Kconfig 2004-09-06 02:19:46.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/char/Kconfig 2004-09-06 02:44:05.000000000 +0200 @@ -705,7 +705,7 @@ config NVRAM config RTC tristate "Enhanced Real Time Clock Support" - depends on !PPC32 && !PARISC && !IA64 && !M68K + depends on !PPC32 && !PARISC && !IA64 && !M68K && !ARCH_S3C2410 ---help--- If you say Y here and create a character special file /dev/rtc with major number 10 and minor number 135 using mknod ("man mknod"), you @@ -780,6 +780,14 @@ config EFI_RTC bool "EFI Real Time Clock Services" depends on IA64 +config S3C2410_RTC + bool "S3C2410 RTC Driver" + depends on ARCH_S3C2410 + help + RTC (Realtime Clock) driver for the clock inbuilt into the + Samsung S3C2410. This can provide periodic interrupt rates + from 1Hz to 128Hz for user programs. + config COBALT_LCD bool "Support for Cobalt LCD" depends on MIPS_COBALT diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/char/Makefile linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/char/Makefile --- linux-2.6.9-rc1-bk12/drivers/char/Makefile 2004-09-06 02:19:46.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/char/Makefile 2004-09-06 02:44:05.000000000 +0200 @@ -62,6 +62,7 @@ obj-$(CONFIG_GEN_RTC) += genrtc.o obj-$(CONFIG_EFI_RTC) += efirtc.o obj-$(CONFIG_SGI_DS1286) += ds1286.o obj-$(CONFIG_SGI_IP27_RTC) += ip27-rtc.o +obj-$(CONFIG_S3C2410_RTC) += s3c2410_rtc.o ifeq ($(CONFIG_GENERIC_NVRAM),y) obj-$(CONFIG_NVRAM) += generic_nvram.o else diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/char/s3c2410_rtc.c linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/char/s3c2410_rtc.c --- linux-2.6.9-rc1-bk12/drivers/char/s3c2410_rtc.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/char/s3c2410_rtc.c 2004-09-06 02:44:05.000000000 +0200 @@ -0,0 +1,1222 @@ +/* drivers/char/s3c2410_rtc.c + * + * Copyright (c) 2004 Simtec Electronics + * http://www.simtec.co.uk/products/SWLINUX/ + * + * 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. + * + * S3C2410 Internal RTC Driver + * + * Changelog: + * 30-Aug-2004 Ben Dooks Fixed alarm set, incorrect frequency for PIE + * 25-Aug-2004 Ben Dooks Created file +*/ + +/* Based on: + * Real Time Clock interface for Linux + * + * Copyright (C) 1996 Paul Gortmaker + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#undef S3C2410_VA_RTC +#define S3C2410_VA_RTC (0) +#include + +/* need RTC_UIE/RTC_PIE/RTC_AIE definitions */ +#include + +#define PFX "s3c2410_rtc: " + +/* + * We sponge a minor off of the misc major. No need slurping + * up another valuable major dev number for this. If you add + * an ioctl, make sure you don't conflict with SPARC's RTC + * ioctls. + */ + +static struct fasync_struct *rtc_async_queue; + +static DECLARE_WAIT_QUEUE_HEAD(rtc_wait); + +static struct timer_list rtc_irq_timer; + +static ssize_t rtc_read(struct file *file, char __user *buf, + size_t count, loff_t *ppos); + +static int rtc_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); + +static unsigned int rtc_poll(struct file *file, poll_table *wait); + + +static void rtc_dropped_irq(unsigned long data); + +static int rtc_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data); + +/* + * Bits in rtc_status. (6 bits of room for future expansion) + */ + +#define RTC_IS_OPEN 0x01 /* means /dev/rtc is in use */ +#define RTC_TIMER_ON 0x02 /* missed irq timer active */ + +/* + * rtc_status is never changed by rtc_interrupt, and ioctl/open/close is + * protected by the big kernel lock. However, ioctl can still disable the timer + * in rtc_status and then with del_timer after the interrupt has read + * rtc_status but before mod_timer is called, which would then reenable the + * timer (but you would need to have an awful timing before you'd trip on it) + */ +static unsigned long rtc_status = 0; /* bitmapped status byte. */ +static unsigned long rtc_freq = 1; /* Current periodic IRQ rate */ +static unsigned long rtc_freqval = 0; /* value to program */ +static unsigned long rtc_irq_data = 0; /* our output to the world */ +static unsigned long rtc_max_user_freq = 64; /* > this, need CAP_SYS_RESOURCE */ +static struct device *rtc_dev; +static struct resource *rtc_mem; +static struct resource *rtc_almirq; +static struct resource *rtc_rtcirq; +static struct proc_dir_entry *rtc_proc; + +static unsigned char rtc_miscregistered = 0; + +static unsigned long s3c2410_rtc_base; + +/* + * rtc_task_lock nests inside rtc_lock. + */ +static spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +static spinlock_t rtc_task_lock = SPIN_LOCK_UNLOCKED; +static rtc_task_t *rtc_callback = NULL; + +/* + * If this driver ever becomes modularised, it will be really nice + * to make the epoch retain its value across module reload... + */ + +static unsigned long epoch = 2000; /* year corresponding to 0x00 */ + +static const unsigned char days_in_mo[] = +{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + + +static void s3c2410_rtc_writereg(unsigned int reg, unsigned int val) +{ + writeb(val, s3c2410_rtc_base + reg); +} + +static unsigned int s3c2410_rtc_readreg(unsigned int reg) +{ + return readb(s3c2410_rtc_base + reg); +} + +/* */ + +static void s3c2410_rtc_get_time(struct rtc_time *rtc_tm) +{ + unsigned int have_retried = 0; + + spin_lock_irq(&rtc_lock); + + retry_get_time: + rtc_tm->tm_min = s3c2410_rtc_readreg(S3C2410_RTCMIN); + rtc_tm->tm_hour = s3c2410_rtc_readreg(S3C2410_RTCHOUR); + rtc_tm->tm_mday = s3c2410_rtc_readreg(S3C2410_RTCDATE); + rtc_tm->tm_mon = s3c2410_rtc_readreg(S3C2410_RTCMON); + rtc_tm->tm_year = s3c2410_rtc_readreg(S3C2410_RTCYEAR); + rtc_tm->tm_sec = s3c2410_rtc_readreg(S3C2410_RTCSEC); + + /* the only way to work out wether the system was mid-update + * when we read it is to check the second counter, and if it + * is zero, then we re-try the entire read + */ + + if (rtc_tm->tm_sec == 0 && !have_retried) { + have_retried = 1; + goto retry_get_time; + } + + spin_unlock_irq(&rtc_lock); + + BCD_TO_BIN(rtc_tm->tm_sec); + BCD_TO_BIN(rtc_tm->tm_min); + BCD_TO_BIN(rtc_tm->tm_hour); + BCD_TO_BIN(rtc_tm->tm_mday); + BCD_TO_BIN(rtc_tm->tm_mon); + BCD_TO_BIN(rtc_tm->tm_year); + + rtc_tm->tm_year += 100; + rtc_tm->tm_mon -= 1; +} + +static void s3c2410_rtc_get_alm_time(struct rtc_time *alm_tm) +{ + unsigned int alm_en; + + spin_lock_irq(&rtc_lock); + alm_tm->tm_sec = s3c2410_rtc_readreg(S3C2410_ALMSEC); + alm_tm->tm_min = s3c2410_rtc_readreg(S3C2410_ALMMIN); + alm_tm->tm_hour = s3c2410_rtc_readreg(S3C2410_ALMHOUR); + alm_tm->tm_mon = s3c2410_rtc_readreg(S3C2410_ALMMON); + alm_tm->tm_mday = s3c2410_rtc_readreg(S3C2410_ALMDATE); + alm_tm->tm_year = s3c2410_rtc_readreg(S3C2410_ALMYEAR); + + alm_en = s3c2410_rtc_readreg(S3C2410_RTCALM); + spin_unlock_irq(&rtc_lock); + + /* decode the alarm enable field */ + + if (alm_en & S3C2410_RTCALM_SECEN) { + BCD_TO_BIN(alm_tm->tm_sec); + } else { + alm_tm->tm_sec = 0xff; + } + + if (alm_en & S3C2410_RTCALM_MINEN) { + BCD_TO_BIN(alm_tm->tm_min); + } else { + alm_tm->tm_min = 0xff; + } + + if (alm_en & S3C2410_RTCALM_HOUREN) { + BCD_TO_BIN(alm_tm->tm_hour); + } else { + alm_tm->tm_hour = 0xff; + } + + if (alm_en & S3C2410_RTCALM_DAYEN) { + BCD_TO_BIN(alm_tm->tm_mday); + } else { + alm_tm->tm_mday = 0xff; + } + + if (alm_en & S3C2410_RTCALM_MONEN) { + BCD_TO_BIN(alm_tm->tm_mon); + alm_tm->tm_mon -= 1; + } else { + alm_tm->tm_mon = 0xff; + } + + if (alm_en & S3C2410_RTCALM_YEAREN) { + BCD_TO_BIN(alm_tm->tm_year); + } else { + alm_tm->tm_year = 0xffff; + } +} + +/* + * A very tiny interrupt handler. It runs with SA_INTERRUPT set, + * but there is possibility of conflicting with the set_rtc_mmss() + * call (the rtc irq and the timer irq can easily run at the same + * time in two different CPUs). So we need to serialize + * accesses to the chip with the rtc_lock spinlock that each + * architecture should implement in the timer code. + * (See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.) + */ + +#define get_irqno(x) (((x) != NULL) ? (x)->start : -1) + +irqreturn_t s3c2410_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + /* + * Can be an alarm interrupt, update complete interrupt, + * or a periodic interrupt. We store the status in the + * low byte and the number of interrupts received since + * the last read in the remainder of rtc_irq_data. + */ + + spin_lock (&rtc_lock); + rtc_irq_data += 0x100; + rtc_irq_data &= ~0xff; + + if (irq == get_irqno(rtc_almirq)) { + rtc_irq_data |= RTC_AF; + } else if (irq == get_irqno(rtc_rtcirq)) { + rtc_irq_data |= RTC_PF; + } else { + printk("%s: unknown irq %d\n", __FUNCTION__, irq); + spin_unlock(&rtc_lock); + return IRQ_NONE; + } + + if (irq == get_irqno(rtc_rtcirq)) + mod_timer(&rtc_irq_timer, jiffies + HZ/rtc_freq + 2*HZ/100); + + spin_unlock (&rtc_lock); + + /* Now do the rest of the actions */ + spin_lock(&rtc_task_lock); + if (rtc_callback) + rtc_callback->func(rtc_callback->private_data); + spin_unlock(&rtc_task_lock); + wake_up_interruptible(&rtc_wait); + + kill_fasync (&rtc_async_queue, SIGIO, POLL_IN); + + return IRQ_HANDLED; +} + +/* + * sysctl-tuning infrastructure. + */ +static ctl_table rtc_table[] = { + { + .ctl_name = 1, + .procname = "max-user-freq", + .data = &rtc_max_user_freq, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, + { .ctl_name = 0 } +}; + +static ctl_table rtc_root[] = { + { + .ctl_name = 1, + .procname = "rtc", + .maxlen = 0, + .mode = 0555, + .child = rtc_table, + }, + { .ctl_name = 0 } +}; + +static ctl_table dev_root[] = { + { + .ctl_name = CTL_DEV, + .procname = "dev", + .maxlen = 0, + .mode = 0555, + .child = rtc_root, + }, + { .ctl_name = 0 } +}; + +static struct ctl_table_header *sysctl_header; + +static int init_sysctl(void) +{ + sysctl_header = register_sysctl_table(dev_root, 0); + return 0; +} + +static void cleanup_sysctl(void) +{ + unregister_sysctl_table(sysctl_header); +} + +/* + * Now all the various file operations that we export. + */ + +static ssize_t rtc_read(struct file *file, char __user *buf, + size_t count, loff_t *ppos) +{ + DECLARE_WAITQUEUE(wait, current); + unsigned long data; + ssize_t retval; + + if (count < sizeof(unsigned)) + return -EINVAL; + + add_wait_queue(&rtc_wait, &wait); + + do { + /* First make it right. Then make it fast. Putting this whole + * block within the parentheses of a while would be too + * confusing. And no, xchg() is not the answer. */ + + __set_current_state(TASK_INTERRUPTIBLE); + + spin_lock_irq (&rtc_lock); + data = rtc_irq_data; + rtc_irq_data = 0; + spin_unlock_irq (&rtc_lock); + + if (data != 0) + break; + + if (file->f_flags & O_NONBLOCK) { + retval = -EAGAIN; + goto out; + } + if (signal_pending(current)) { + retval = -ERESTARTSYS; + goto out; + } + schedule(); + } while (1); + + if (count < sizeof(unsigned long)) + retval = put_user(data, (unsigned int __user *)buf) ?: sizeof(int); + else + retval = put_user(data, (unsigned long __user *)buf) ?: sizeof(long); + out: + current->state = TASK_RUNNING; + remove_wait_queue(&rtc_wait, &wait); + + return retval; +} + +static int s3c2410_rtc_ioctl_settime(struct rtc_time *tm) +{ + unsigned char mon, day, hrs; + unsigned char min, sec, leap_yr; + unsigned int yrs; + + yrs = tm->tm_year + 1900; + mon = tm->tm_mon + 1; /* tm_mon starts at zero */ + day = tm->tm_mday; + hrs = tm->tm_hour; + min = tm->tm_min; + sec = tm->tm_sec; + + pr_debug("%s: %2d/%2d/%4d %2d:%2d:%2d\n", __FUNCTION__, + day, mon, yrs, hrs, min, sec); + + if (yrs < 1970) { + pr_debug("%s: year is before 1970\n", __FUNCTION__); + return -EINVAL; + } + + leap_yr = ((!(yrs % 4) && (yrs % 100)) || !(yrs % 400)); + + if ((mon > 12) || (day == 0)) { + pr_debug("%s: fail (mon > 12) || (day == 0)\n", __FUNCTION__); + return -EINVAL; + } + + if (day > (days_in_mo[mon] + ((mon == 2) && leap_yr))) { + pr_debug("%s: fail day > (days_in_mo[mon] + ((mon == 2) && leap_yr))\n", __FUNCTION__); + return -EINVAL; + } + + if ((hrs >= 24) || (min >= 60) || (sec >= 60)) { + pr_debug("%s: fail (hrs>=24) || (min>=60) || (sec>=60)\n", + __FUNCTION__); + + return -EINVAL; + } + + if ((yrs -= epoch) >= 100) { /* They are unsigned */ + pr_debug("%s: failed years being too big\n", __FUNCTION__); + return -EINVAL; + } + + spin_lock_irq(&rtc_lock); + + /* the rtc gets round the y2k problem by just not + * supporting it */ + + BIN_TO_BCD(sec); + BIN_TO_BCD(min); + BIN_TO_BCD(hrs); + BIN_TO_BCD(day); + BIN_TO_BCD(mon); + BIN_TO_BCD(yrs); + + pr_debug("%s: %02x:%02x:%02x, %02x/%02x/%02x\n", __FUNCTION__, + hrs, min, sec, day, mon, yrs); + + s3c2410_rtc_writereg(S3C2410_RTCSEC, sec); + s3c2410_rtc_writereg(S3C2410_RTCMIN, min); + s3c2410_rtc_writereg(S3C2410_RTCHOUR, hrs); + s3c2410_rtc_writereg(S3C2410_RTCDATE, day); + s3c2410_rtc_writereg(S3C2410_RTCMON, mon); + s3c2410_rtc_writereg(S3C2410_RTCYEAR, yrs); + + spin_unlock_irq(&rtc_lock); + return 0; +} + +static int s3c2410_rtc_ioctl_setalarm(struct rtc_time *tm) +{ + unsigned int hrs, min, sec; + unsigned int almen; + + /* + * This expects a struct rtc_time. Writing 0xff means + * "don't care" or "match all". Only the tm_hour, + * tm_min and tm_sec are used. + */ + + hrs = tm->tm_hour; + min = tm->tm_min; + sec = tm->tm_sec; + + pr_debug("%s: %d/%d/%d\n", __FUNCTION__, hrs, min, sec); + + spin_lock_irq(&rtc_lock); + + almen = s3c2410_rtc_readreg(S3C2410_RTCALM); + s3c2410_rtc_writereg(S3C2410_RTCALM, 0); + + almen &= ~S3C2410_RTCALM_ALMEN; + + if (sec < 60) { + BIN_TO_BCD(sec); + almen |= S3C2410_RTCALM_SECEN; + s3c2410_rtc_writereg(S3C2410_ALMSEC, sec); + } + + if (min < 60) { + BIN_TO_BCD(min); + almen |= S3C2410_RTCALM_MINEN; + s3c2410_rtc_writereg(S3C2410_ALMMIN, min); + } + + if (hrs < 24) { + BIN_TO_BCD(hrs); + almen |= S3C2410_RTCALM_HOUREN; + s3c2410_rtc_writereg(S3C2410_ALMHOUR, hrs); + } + + /* re-enable the specific alarm comparisions, and + * the alarm interrupt if previois used */ + + s3c2410_rtc_writereg(S3C2410_RTCALM, almen); + + spin_unlock_irq(&rtc_lock); + + return 0; +} + +static int s3c2410_rtc_setaie(int to) +{ + unsigned int tmp; + + pr_debug("%s: aie=%d\n", __FUNCTION__, to); + + spin_lock_irq (&rtc_lock); + tmp = s3c2410_rtc_readreg(S3C2410_RTCALM); + + if (to) + tmp |= S3C2410_RTCALM_ALMEN; + else + tmp &= ~S3C2410_RTCALM_ALMEN; + + + s3c2410_rtc_writereg(S3C2410_RTCALM, tmp); + spin_unlock_irq(&rtc_lock); + + return 0; +} + +static void s3c2410_rtc_setpie(int to) +{ + unsigned int tmp; + + pr_debug("%s: pie=%d, freq=%d\n", __FUNCTION__, to, rtc_freq); + + spin_lock_irq (&rtc_lock); + tmp = rtc_freqval; + + if (to) + tmp |= S3C2410_TICNT_ENABLE; + else + tmp &= ~S3C2410_TICNT_ENABLE; + + s3c2410_rtc_writereg(S3C2410_TICNT, tmp); + spin_unlock_irq (&rtc_lock); +} + +static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel) +{ + struct rtc_time wtime; + + switch (cmd) { + case RTC_AIE_OFF: /* Mask alarm int. enab. bit */ + case RTC_AIE_ON: /* Allow alarm interrupts. */ + return s3c2410_rtc_setaie((cmd == RTC_AIE_ON) ? 1 : 0); + + case RTC_PIE_OFF: /* Mask periodic int. enab. bit */ + + s3c2410_rtc_setpie(0); + + if (rtc_status & RTC_TIMER_ON) { + spin_lock_irq (&rtc_lock); + rtc_status &= ~RTC_TIMER_ON; + del_timer(&rtc_irq_timer); + spin_unlock_irq (&rtc_lock); + } + return 0; + + case RTC_PIE_ON: /* Allow periodic ints */ + + /* + * We don't really want Joe User enabling more + * than 64Hz of interrupts on a multi-user machine. + */ + if (!kernel && (rtc_freq > rtc_max_user_freq) && + (!capable(CAP_SYS_RESOURCE))) + return -EACCES; + + if (!(rtc_status & RTC_TIMER_ON)) { + spin_lock_irq (&rtc_lock); + rtc_irq_timer.expires = jiffies + HZ/rtc_freq + 2*HZ/100; + add_timer(&rtc_irq_timer); + rtc_status |= RTC_TIMER_ON; + spin_unlock_irq (&rtc_lock); + } + + s3c2410_rtc_setpie(1); + return 0; + + case RTC_UIE_OFF: + case RTC_UIE_ON: + return -EINVAL; + + case RTC_ALM_READ: /* Read the present alarm time */ + /* + * This returns a struct rtc_time. Reading >= 0xc0 + * means "don't care" or "match all". + */ + memset(&wtime, 0xff, sizeof(struct rtc_time)); + s3c2410_rtc_get_alm_time(&wtime); + break; + + case RTC_ALM_SET: /* Store a time into the alarm */ + if (!capable(CAP_SYS_TIME)) { + pr_debug("RTC_ALM_SET: not allowed\n"); + return -EACCES; + } + + if (copy_from_user(&wtime, (struct rtc_time __user *)arg, + sizeof(struct rtc_time))) { + pr_debug("RTC_ALM_SET: illegal alarm time\n"); + return -EFAULT; + } + + return s3c2410_rtc_ioctl_setalarm(&wtime); + + case RTC_RD_TIME: /* Read the time/date from RTC */ + memset(&wtime, 0, sizeof(struct rtc_time)); + s3c2410_rtc_get_time(&wtime); + + pr_debug("%s: got %d:%d:%d %d/%d/%d\n", + __FUNCTION__, wtime.tm_hour, + wtime.tm_min, wtime.tm_sec, + wtime.tm_mday, wtime.tm_mon, + wtime.tm_year); + break; + + case RTC_SET_TIME: /* Set the RTC */ + if (!capable(CAP_SYS_TIME)) + return -EACCES; + + if (copy_from_user(&wtime, (struct rtc_time __user *)arg, + sizeof(struct rtc_time))) + return -EFAULT; + + return s3c2410_rtc_ioctl_settime(&wtime); + + case RTC_IRQP_READ: /* Read the periodic IRQ rate. */ + return put_user(rtc_freq, (unsigned long __user *)arg); + + case RTC_IRQP_SET: /* Set periodic IRQ rate. */ + { + int tmp = 0; + int fv; + + if ((arg < 1) || (arg > 128)) + return -EINVAL; + /* + * We don't really want Joe User generating more + * than 64Hz of interrupts on a multi-user machine. + */ + if (!kernel && (arg > rtc_max_user_freq) && + (!capable(CAP_SYS_RESOURCE))) + return -EACCES; + + /* check for the number being power-of-2 */ + if (arg & (arg - 1)) { + return -EINVAL; + } + + fv = (128 / arg) -1; + + spin_lock_irq(&rtc_lock); + rtc_freq = arg; + rtc_freqval = fv; + + tmp = s3c2410_rtc_readreg(S3C2410_TICNT); + tmp &= ~0x7f; + tmp |= rtc_freqval; + s3c2410_rtc_writereg(S3C2410_TICNT, tmp); + + + /* update rtc frequency */ + spin_unlock_irq(&rtc_lock); + return 0; + } + + case RTC_EPOCH_READ: /* Read the epoch. */ + return put_user (epoch, (unsigned long __user *)arg); + + case RTC_EPOCH_SET: /* Set the epoch. */ + { + /* + * There were no RTC clocks before 1900. + */ + if (arg < 1900) + return -EINVAL; + + if (!capable(CAP_SYS_TIME)) + return -EACCES; + + epoch = arg; + return 0; + } + default: + return -ENOTTY; + } + + return copy_to_user((void __user *)arg, &wtime, sizeof wtime) ? -EFAULT : 0; +} + +static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg) +{ + return rtc_do_ioctl(cmd, arg, 0); +} + +/* + * We enforce only one user at a time here with the open/close. + * Also clear the previous interrupt data on an open, and clean + * up things on a close. + */ + +/* We use rtc_lock to protect against concurrent opens. So the BKL is not + * needed here. Or anywhere else in this driver. */ +static int rtc_open(struct inode *inode, struct file *file) +{ + spin_lock_irq (&rtc_lock); + + if(rtc_status & RTC_IS_OPEN) + goto out_busy; + + rtc_status |= RTC_IS_OPEN; + rtc_irq_data = 0; + spin_unlock_irq (&rtc_lock); + return 0; + +out_busy: + spin_unlock_irq (&rtc_lock); + return -EBUSY; +} + +static int rtc_fasync (int fd, struct file *filp, int on) +{ + return fasync_helper (fd, filp, on, &rtc_async_queue); +} + +static int rtc_release(struct inode *inode, struct file *file) +{ + /* + * Turn off all interrupts once the device is no longer + * in use, and clear the data. + */ + + pr_debug("%s: inode=%p, file=%p\n", __FUNCTION__, inode, file); + + spin_lock_irq(&rtc_lock); + + /* turn off the alarm and rtc interrupts */ + + if (rtc_status & RTC_TIMER_ON) { + rtc_status &= ~RTC_TIMER_ON; + del_timer(&rtc_irq_timer); + } + + s3c2410_rtc_setaie(0); + s3c2410_rtc_setpie(0); + spin_unlock_irq(&rtc_lock); + + if (file->f_flags & FASYNC) { + rtc_fasync (-1, file, 0); + } + + spin_lock_irq (&rtc_lock); + rtc_irq_data = 0; + rtc_status &= ~RTC_IS_OPEN; + spin_unlock_irq (&rtc_lock); + return 0; +} + +/* Called without the kernel lock - fine */ +static unsigned int rtc_poll(struct file *file, poll_table *wait) +{ + unsigned long l; + + poll_wait(file, &rtc_wait, wait); + + spin_lock_irq (&rtc_lock); + l = rtc_irq_data; + spin_unlock_irq (&rtc_lock); + + if (l != 0) + return POLLIN | POLLRDNORM; + return 0; +} + +/* + * exported stuffs + */ + +int rtc_register(rtc_task_t *task) +{ + if (task == NULL || task->func == NULL) + return -EINVAL; + spin_lock_irq(&rtc_lock); + if (rtc_status & RTC_IS_OPEN) { + spin_unlock_irq(&rtc_lock); + return -EBUSY; + } + spin_lock(&rtc_task_lock); + if (rtc_callback) { + spin_unlock(&rtc_task_lock); + spin_unlock_irq(&rtc_lock); + return -EBUSY; + } + rtc_status |= RTC_IS_OPEN; + rtc_callback = task; + spin_unlock(&rtc_task_lock); + spin_unlock_irq(&rtc_lock); + return 0; +} + +int rtc_unregister(rtc_task_t *task) +{ + spin_lock_irq(&rtc_lock); + spin_lock(&rtc_task_lock); + if (rtc_callback != task) { + spin_unlock(&rtc_task_lock); + spin_unlock_irq(&rtc_lock); + return -ENXIO; + } + rtc_callback = NULL; + + /* disable controls */ + // todo: disable irqs? + + if (rtc_status & RTC_TIMER_ON) { + rtc_status &= ~RTC_TIMER_ON; + del_timer(&rtc_irq_timer); + } + rtc_status &= ~RTC_IS_OPEN; + spin_unlock(&rtc_task_lock); + spin_unlock_irq(&rtc_lock); + return 0; +} + +int rtc_control(rtc_task_t *task, unsigned int cmd, unsigned long arg) +{ + spin_lock_irq(&rtc_task_lock); + if (rtc_callback != task) { + spin_unlock_irq(&rtc_task_lock); + return -ENXIO; + } + spin_unlock_irq(&rtc_task_lock); + return rtc_do_ioctl(cmd, arg, 1); +} + +EXPORT_SYMBOL(rtc_register); +EXPORT_SYMBOL(rtc_unregister); +EXPORT_SYMBOL(rtc_control); + +static struct file_operations rtc_fops = { + .owner = THIS_MODULE, + .llseek = no_llseek, + .read = rtc_read, + .poll = rtc_poll, + .ioctl = rtc_ioctl, + .open = rtc_open, + .release = rtc_release, + .fasync = rtc_fasync, +}; + +static struct miscdevice rtc_miscdev = +{ + RTC_MINOR, + "rtc", + &rtc_fops +}; + +static int s3c2410_rtc_remove(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + + /* todo - kill any open tasks on this device */ + + cleanup_sysctl(); + + /* disable interrupts */ + s3c2410_rtc_setpie(0); + s3c2410_rtc_setaie(0); + + if (rtc_proc != NULL) { + rtc_proc = NULL; + pr_debug(PFX "removing /proc entry\n"); + remove_proc_entry ("driver/rtc", NULL); + } + + misc_deregister(&rtc_miscdev); + + if (rtc_rtcirq != NULL) { + pr_debug(PFX "freeing rtc tick irq\n"); + free_irq(rtc_rtcirq->start, pdev); + rtc_rtcirq = NULL; + } + + if (rtc_almirq != NULL) { + pr_debug(PFX "freeing rtc alarm irq\n"); + free_irq(rtc_almirq->start, pdev); + rtc_almirq = NULL; + } + + if (rtc_mem != NULL) { + pr_debug(PFX "releasing rtc_mem\n"); + iounmap((void *)s3c2410_rtc_base); + release_resource(rtc_mem); + kfree(rtc_mem); + } + + rtc_dev = NULL; + return 0; +} + +static int +s3c2410rtc_get_irq(struct platform_device *pdev, + struct resource **result_res, + unsigned int no, + const char *name) +{ + struct resource *res; + int ret; + + res = platform_get_resource(pdev, IORESOURCE_IRQ, no); + if (res == NULL) + return -ENOENT; + + pr_debug("%s: %s: resource %p: irq %ld\n", + __FUNCTION__, name, res, res->start); + + ret = request_irq(res->start, s3c2410_rtc_interrupt, + SA_INTERRUPT, name, pdev); + + if (ret == 0) + *result_res = res; + + return ret; +} + +static int s3c2410_rtc_probe(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct resource *res; + int ret; + + pr_debug("%s: probe=%p, device=%p\n", __FUNCTION__, pdev, dev); + + /* get the memory region */ + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (res == NULL) { + printk(KERN_INFO PFX "failed to get memory region resource\n"); + return -ENOENT; + } + + rtc_mem = request_mem_region(res->start, res->end-res->start+1, + pdev->name); + + if (rtc_mem == NULL) { + printk(KERN_INFO PFX "failed to reserve memory region\n"); + ret = -ENOENT; + goto exit_err; + } + + s3c2410_rtc_base = (unsigned long)ioremap(res->start, + res->end - res->start + 1); + if (s3c2410_rtc_base == 0) { + printk(KERN_INFO PFX "failed to ioremap() region\n"); + ret = -EINVAL; + goto exit_err; + } + + rtc_mem = res; + pr_debug(PFX "s3c2410_rtc_base=%08lx\n", s3c2410_rtc_base); + + pr_debug(PFX "RTCCON=%02x\n", s3c2410_rtc_readreg(S3C2410_RTCCON)); + + if ((s3c2410_rtc_readreg(S3C2410_RTCCON) & S3C2410_RTCCON_RTCEN) == 0){ + unsigned int tmp; + + pr_debug(PFX "need to enable rtc\n"); + + tmp = s3c2410_rtc_readreg(S3C2410_RTCCON); + tmp |= S3C2410_RTCCON_RTCEN; + s3c2410_rtc_writereg(S3C2410_RTCCON, tmp); + } + + if ((s3c2410_rtc_readreg(S3C2410_RTCCON) & S3C2410_RTCCON_CNTSEL)){ + unsigned int tmp; + + pr_debug(PFX "need to remove S3C2410_RTCCON_CNTSEL\n"); + + tmp = s3c2410_rtc_readreg(S3C2410_RTCCON); + tmp &= ~S3C2410_RTCCON_CNTSEL; + s3c2410_rtc_writereg(S3C2410_RTCCON, tmp); + } + + if ((s3c2410_rtc_readreg(S3C2410_RTCCON) & S3C2410_RTCCON_CLKRST)){ + unsigned int tmp; + + pr_debug(PFX "need to remove S3C2410_RTCCON_CLKRST\n"); + + tmp = s3c2410_rtc_readreg(S3C2410_RTCCON); + tmp &= ~S3C2410_RTCCON_CLKRST; + s3c2410_rtc_writereg(S3C2410_RTCCON, tmp); + } + + pr_debug(PFX "RTCCON=%02x\n", s3c2410_rtc_readreg(S3C2410_RTCCON)); + + /* find the IRQs */ + + ret = s3c2410rtc_get_irq(pdev, &rtc_almirq, 0, "s3c2410 rtc alarm"); + if (ret != 0) { + printk(KERN_INFO PFX "failed to get alarm irq\n"); + goto exit_err; + } + + ret = s3c2410rtc_get_irq(pdev, &rtc_rtcirq, 1, "s3c2410 rtc tick"); + if (ret != 0) { + printk(KERN_INFO PFX "failed to get tick irq\n"); + goto exit_err; + } + + pr_debug("%s: about to register misc device\n", __FUNCTION__); + + /* ok, now let's try registering our device */ + + rtc_miscdev.dev = dev; + + if (misc_register(&rtc_miscdev)) { + ret = -ENODEV; + goto exit_err; + } + + rtc_miscregistered = 1; + + rtc_proc = create_proc_read_entry ("driver/rtc", 0, NULL, + rtc_read_proc, NULL); + + if (rtc_proc == NULL) { + printk(KERN_ERR PFX "failed to create /proc entry\n"); + } + + init_timer(&rtc_irq_timer); + rtc_irq_timer.function = rtc_dropped_irq; + spin_lock_irq(&rtc_lock); + rtc_freq = 1; + + // todo: set the default periodic frequency + spin_unlock_irq(&rtc_lock); + + rtc_dev = dev; + + (void) init_sysctl(); + return 0; + + exit_err: + printk(PFX "error %d during initialisation\n", ret); + + + return ret; +} + +static struct device_driver s3c2410rtc_driver = { + .name = "s3c2410-rtc", + .bus = &platform_bus_type, + .probe = s3c2410_rtc_probe, + .remove = s3c2410_rtc_remove, +}; + +static int __init rtc_init(void) +{ + printk(KERN_INFO "S3C2410 RTC Driver, (c) 2004 Simtec Electronics\n"); + return driver_register(&s3c2410rtc_driver); +} + +static void __exit rtc_exit (void) +{ + driver_unregister(&s3c2410rtc_driver); +} + +module_init(rtc_init); +module_exit(rtc_exit); + +/* + * At IRQ rates >= 4096Hz, an interrupt may get lost altogether. + * (usually during an IDE disk interrupt, with IRQ unmasking off) + * Since the interrupt handler doesn't get called, the IRQ status + * byte doesn't get read, and the RTC stops generating interrupts. + * A timer is set, and will call this function if/when that happens. + * To get it out of this stalled state, we just read the status. + * At least a jiffy of interrupts (rtc_freq/HZ) will have been lost. + * (You *really* shouldn't be trying to use a non-realtime system + * for something that requires a steady > 1KHz signal anyways.) + */ + +static void rtc_dropped_irq(unsigned long data) +{ + spin_lock_irq (&rtc_lock); + + /* Just in case someone disabled the timer from behind our back... */ + if (rtc_status & RTC_TIMER_ON) + mod_timer(&rtc_irq_timer, jiffies + HZ/rtc_freq + 2*HZ/100); + + rtc_irq_data += ((rtc_freq/HZ)<<8); + rtc_irq_data &= ~0xff; + rtc_irq_data |= RTC_PF; + + spin_unlock_irq(&rtc_lock); + + printk(KERN_WARNING "rtc: lost some interrupts at %ldHz.\n", rtc_freq); + + /* Now we have new data */ + wake_up_interruptible(&rtc_wait); + kill_fasync (&rtc_async_queue, SIGIO, POLL_IN); +} + + +/* + * Info exported via "/proc/driver/rtc". + */ + +static const char enabled[] = "enabled"; +static const char disabled[] = "disabled"; + +static int rtc_proc_output (char *buf) +{ + struct rtc_time tm; + unsigned long freq; + unsigned int alm; + unsigned int ticnt; + char *p; + + spin_lock_irq(&rtc_lock); + freq = rtc_freq; + spin_unlock_irq(&rtc_lock); + + p = buf; + + s3c2410_rtc_get_time(&tm); + + /* + * There is no way to tell if the luser has the RTC set for local + * time or for Universal Standard Time (GMT). Probably local though. + */ + p += sprintf(p, + "rtc_time\t: %02d:%02d:%02d\n" + "rtc_date\t: %04d-%02d-%02d\n" + "rtc_epoch\t: %04lu\n", + tm.tm_hour, tm.tm_min, tm.tm_sec, + tm.tm_year + 1900, tm.tm_mon, tm.tm_mday, epoch); + + s3c2410_rtc_get_alm_time(&tm); + + p += sprintf(p, "alarm\t\t: "); + + if (tm.tm_hour <= 24) + p += sprintf(p, "%02d:", tm.tm_hour); + else + p += sprintf(p, "**:"); + + if (tm.tm_min <= 59) + p += sprintf(p, "%02d:", tm.tm_min); + else + p += sprintf(p, "**:"); + + if (tm.tm_sec <= 59) + p += sprintf(p, "%02d ", tm.tm_sec); + else + p += sprintf(p, "** "); + + if (tm.tm_mday <= 24) + p += sprintf(p, "%02d/", tm.tm_mday); + else + p += sprintf(p, "**/"); + + if (tm.tm_mon <= 31) + p += sprintf(p, "%02d/", tm.tm_mon+1); + else + p += sprintf(p, "**/"); + + if (tm.tm_year <= 100) + p += sprintf(p, "%02d", tm.tm_year+1900); + else + p += sprintf(p, "**"); + + p += sprintf(p, "\n"); + + alm = s3c2410_rtc_readreg(S3C2410_RTCALM); + ticnt = s3c2410_rtc_readreg(S3C2410_TICNT_ENABLE); + + p += sprintf(p, + "alarm interrupt\t: %s\n" + "periodic interrupt\t: %s\n" + "periodic frequency\t: %ld\n", + (alm & S3C2410_RTCALM_ALMEN) ? enabled : disabled, + (ticnt & S3C2410_TICNT_ENABLE) ? enabled : disabled, + freq); + + return p - buf; +} + +static int rtc_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len = rtc_proc_output (page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + return len; +} + + +MODULE_AUTHOR("Ben Dooks, "); +MODULE_LICENSE("GPL"); +MODULE_ALIAS_MISCDEV(RTC_MINOR); diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/char/watchdog/Kconfig linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/char/watchdog/Kconfig --- linux-2.6.9-rc1-bk12/drivers/char/watchdog/Kconfig 2004-09-06 02:19:47.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/char/watchdog/Kconfig 2004-09-06 02:44:05.000000000 +0200 @@ -118,6 +118,43 @@ config SA1100_WATCHDOG To compile this driver as a module, choose M here: the module will be called sa1100_wdt. +config S3C2410_WATCHDOG + tristate "S3C2410 Watchdog" + depends on WATCHDOG && ARCH_S3C2410 + help + Watchdog timer block in the Samsung S3C2410 chips. This will + reboot the system when the timer expires with the watchdog + enabled. + + The driver is limited by the speed of the system's PCLK + signal, so with reasonbaly fast systems (PCLK around 50-66MHz) + then watchdog intervals of over approximately 20seconds are + unavailable. + + The driver can be built as a module by choosing M, and will + be called s3c2410_wdt + +config S3C2410_WATCHDOG_ATBOOT + bool "S3C2410 Watchdog enabled at boot" + depends on WATCHDOG && ARCH_S3C2410 && S3C2410_WATCHDOG != n + help + Watchdog timer is started when first initialised. This means + that if the system fails to load the process controlling the + watchdog within the initial time period, then the system will + reset. + +config S3C2410_WATCHDOG_DEBUG + bool "S3C2410 Watchdog Debug" + depends on WATCHDOG && ARCH_S3C2410 && S3C2410_WATCHDOG != n + help + Enable debugging text from S3C2410 watchdog + +config S3C2410_WATCHDOG_DEFAULT_TIME + int "S3C2410 Watchdog Default Timeout" + depends on WATCHDOG && ARCH_S3C2410 && S3C2410_WATCHDOG != n + help + Sets the default timeout period for the watchdog + # X86 (i386 + ia64 + x86_64) Architecture config ACQUIRE_WDT diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/char/watchdog/Makefile linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/char/watchdog/Makefile --- linux-2.6.9-rc1-bk12/drivers/char/watchdog/Makefile 2004-09-06 02:19:47.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/char/watchdog/Makefile 2004-09-06 02:44:05.000000000 +0200 @@ -22,6 +22,7 @@ obj-$(CONFIG_I8XX_TCO) += i8xx_tco.o obj-$(CONFIG_MACHZ_WDT) += machzwd.o obj-$(CONFIG_SH_WDT) += shwdt.o obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o +obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o obj-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o obj-$(CONFIG_W83877F_WDT) += w83877f_wdt.o diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/char/watchdog/s3c2410_wdt.c linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/char/watchdog/s3c2410_wdt.c --- linux-2.6.9-rc1-bk12/drivers/char/watchdog/s3c2410_wdt.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/char/watchdog/s3c2410_wdt.c 2004-09-06 02:44:05.000000000 +0200 @@ -0,0 +1,507 @@ +/* linux/drivers/char/watchdog/s3c2410_wdt.c + * + * Copyright (c) 2004 Simtec Electronics + * Ben Dooks + * + * S3C2410 Watchdog Timer Support + * + * Based on, softdog.c by Alan Cox, + * (c) Copyright 1996 Alan Cox + * + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#undef S3C2410_VA_WATCHDOG +#define S3C2410_VA_WATCHDOG (0) + +#include + +#define PFX "s3c2410-wdt: " + +#ifdef CONFIG_S3C2410_WATCHDOG_DEBUG +#undef pr_debug +#define pr_debug(msg, x...) do { printk(KERN_INFO msg, x); } while(0) +#endif + +/* configurations from makefile */ + +#ifndef CONFIG_WATCHDOG_NOWAYOUT +#define CONFIG_WATCHDOG_NOWAYOUT (0) +#endif + +#ifndef CONFIG_S3C2410_WATCHDOG_ATBOOT +#define CONFIG_S3C2410_WATCHDOG_ATBOOT (0) +#endif + +#ifndef CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME +#define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME (15) +#endif + +static int tmr_margin = CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME; +static int tmr_atboot = CONFIG_S3C2410_WATCHDOG_ATBOOT; +static int nowayout = CONFIG_WATCHDOG_NOWAYOUT; +static int soft_noboot = 0; + +module_param(tmr_margin, int, 0); +module_param(tmr_atboot, int, 0); +module_param(nowayout, int, 0); +module_param(soft_noboot, int, 0); + +MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. default=" __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME) ")"); + +MODULE_PARM_DESC(tmr_atboot, "Watchdog is started at boot time if set to 1, default=" __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_ATBOOT)); + +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); + +MODULE_PARM_DESC(soft_noboot, "Watchdog action, set to 1 to ignore reboots, 0 to reboot (default depends on ONLY_TESTING)"); + + +typedef enum close_state { + CLOSE_STATE_NOT, + CLOSE_STATE_ALLOW=0x4021 +} close_state_t; + +static struct semaphore open_lock; +static struct resource *wdt_mem; +static struct resource *wdt_irq; +static struct clk *wdt_clock; +static unsigned long wdt_base; +static unsigned int wdt_count; +static close_state_t allow_close; + +static unsigned int tmr_count; + +/* watchdog control routines */ + +static int s3c2410wdt_keepalive(void) +{ + writel(wdt_count, wdt_base + S3C2410_WTCNT); + return 0; +} + +static int s3c2410wdt_stop(void) +{ + unsigned long wtcon; + + wtcon = readl(wdt_base + S3C2410_WTCON); + wtcon &= ~(S3C2410_WTCON_ENABLE | S3C2410_WTCON_RSTEN); + writel(wtcon, wdt_base + S3C2410_WTCON); + + return 0; +} + +static int s3c2410wdt_start(void) +{ + unsigned long wtcon; + + wtcon = readl(wdt_base + S3C2410_WTCON); + wtcon |= S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128; + + if (soft_noboot) { + wtcon |= S3C2410_WTCON_INTEN; + wtcon &= ~S3C2410_WTCON_RSTEN; + } else { + wtcon &= ~S3C2410_WTCON_INTEN; + wtcon |= S3C2410_WTCON_RSTEN; + } + + clk_enable(wdt_clock); + + pr_debug("%s: tmr_count=0x%08x, wtcon=%08lx\n", + __FUNCTION__, tmr_count, wtcon); + + writel(tmr_count, wdt_base + S3C2410_WTDAT); + writel(wtcon, wdt_base + S3C2410_WTCON); + + return 0; +} + +static int s3c2410wdt_set_heartbeat(int timeout) +{ + unsigned int freq = clk_get_rate(wdt_clock); + unsigned int count; + unsigned int divisor = 1; + unsigned long wtcon; + + if (timeout < 1) + return -EINVAL; + + tmr_margin = timeout; + + /* I think someone must have missed a divide-by-2 in the 2410, + * as a divisor of 128 gives half the calculated delay... + */ + + freq /= 128/2; + count = timeout * freq; + + pr_debug("%s: count=%d, timeout=%d, freq=%d\n", + __FUNCTION__, count, timeout, freq); + + /* if the count is bigger than the watchdog register, + then work out what we need to do (and if) we can + actually make this value + */ + + if (count >= 0x10000) { + for (divisor = 1; divisor <= 0x100; divisor++) { + if ((count / divisor) < 0x10000) + break; + } + + if ((count / divisor) >= 0x10000) { + printk(KERN_ERR PFX "timeout %d too big\n", timeout); + return -EINVAL; + } + } + + pr_debug("%s: timeout=%d, divisor=%d, count=%d (%08x)\n", + __FUNCTION__, timeout, divisor, count, count/divisor); + + count /= divisor; + tmr_count = count; + + /* update the pre-scaler */ + wtcon = readl(wdt_base + S3C2410_WTCON); + wtcon &= ~S3C2410_WTCON_PRESCALE_MASK; + wtcon |= S3C2410_WTCON_PRESCALE(divisor-1); + + writel(count, wdt_base + S3C2410_WTDAT); + writel(wtcon, wdt_base + S3C2410_WTCON); + + return 0; +} + +/* + * /dev/watchdog handling + */ + +static int s3c2410wdt_open(struct inode *inode, struct file *file) +{ + if(down_trylock(&open_lock)) + return -EBUSY; + + if (nowayout) { + __module_get(THIS_MODULE); + } else { + allow_close = CLOSE_STATE_ALLOW; + } + + /* start the timer */ + s3c2410wdt_start(); + return nonseekable_open(inode, file); +} + +static int s3c2410wdt_release(struct inode *inode, struct file *file) +{ + /* + * Shut off the timer. + * Lock it in if it's a module and we set nowayout + */ + if (allow_close == CLOSE_STATE_ALLOW) { + s3c2410wdt_stop(); + } else { + printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n"); + s3c2410wdt_keepalive(); + } + + up(&open_lock); + allow_close = CLOSE_STATE_NOT; + return 0; +} + +static ssize_t s3c2410wdt_write(struct file *file, const char __user *data, + size_t len, loff_t *ppos) +{ + /* + * Refresh the timer. + */ + if(len) { + if (!nowayout) { + size_t i; + + /* In case it was set long ago */ + allow_close = CLOSE_STATE_NOT; + + for (i = 0; i != len; i++) { + char c; + + if (get_user(c, data + i)) + return -EFAULT; + if (c == 'V') + allow_close = CLOSE_STATE_ALLOW; + } + } + + s3c2410wdt_keepalive(); + } + return len; +} + +#define OPTIONS WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE + +static struct watchdog_info s3c2410_wdt_ident = { + .options = OPTIONS, + .firmware_version = 0, + .identity = "S3C2410 Watchdog", +}; + + +static int s3c2410wdt_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ + void __user *argp = (void __user *)arg; + int __user *p = argp; + int new_margin; + + switch (cmd) { + default: + return -ENOIOCTLCMD; + + case WDIOC_GETSUPPORT: + return copy_to_user(argp, &s3c2410_wdt_ident, + sizeof(s3c2410_wdt_ident)) ? -EFAULT : 0; + + case WDIOC_GETSTATUS: + case WDIOC_GETBOOTSTATUS: + return put_user(0, p); + + case WDIOC_KEEPALIVE: + s3c2410wdt_keepalive(); + return 0; + + case WDIOC_SETTIMEOUT: + if (get_user(new_margin, p)) + return -EFAULT; + + if (s3c2410wdt_set_heartbeat(new_margin)) + return -EINVAL; + + s3c2410wdt_keepalive(); + return put_user(tmr_margin, p); + + case WDIOC_GETTIMEOUT: + return put_user(tmr_margin, p); + } +} + +/* + * Notifier for system down + */ + +static int s3c2410wdt_notify_sys(struct notifier_block *this, unsigned long code, + void *unused) +{ + if(code==SYS_DOWN || code==SYS_HALT) { + /* Turn the WDT off */ + s3c2410wdt_stop(); + } + return NOTIFY_DONE; +} + +/* kernel interface */ + +static struct file_operations s3c2410wdt_fops = { + .owner = THIS_MODULE, + .llseek = no_llseek, + .write = s3c2410wdt_write, + .ioctl = s3c2410wdt_ioctl, + .open = s3c2410wdt_open, + .release = s3c2410wdt_release, +}; + +static struct miscdevice s3c2410wdt_miscdev = { + .minor = WATCHDOG_MINOR, + .name = "watchdog", + .fops = &s3c2410wdt_fops, +}; + +static struct notifier_block s3c2410wdt_notifier = { + .notifier_call = s3c2410wdt_notify_sys, +}; + +/* interrupt handler code */ + +static irqreturn_t s3c2410wdt_irq(int irqno, void *param, + struct pt_regs *regs) +{ + printk(KERN_INFO PFX "Watchdog timer expired!\n"); + + s3c2410wdt_keepalive(); + return IRQ_HANDLED; +} +/* device interface */ + +static int s3c2410wdt_probe(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct resource *res; + int started = 0; + int ret; + + pr_debug("%s: probe=%p, device=%p\n", __FUNCTION__, pdev, dev); + + /* get the memory region for the watchdog timer */ + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (res == NULL) { + printk(KERN_INFO PFX "failed to get memory region resouce\n"); + return -ENOENT; + } + + if (!request_mem_region(res->start, res->end-res->start, pdev->name)) { + printk(KERN_INFO PFX "failed to get memory region\n"); + return -ENOENT; + } + + wdt_base = (unsigned long)ioremap(res->start, res->end - res->start); + if (wdt_base == 0) { + printk(KERN_INFO PFX "failed to ioremap() region\n"); + return -EINVAL; + } + + pr_debug("wdt_base=%08lx\n", wdt_base); + + res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); + if (res == NULL) { + printk(KERN_INFO PFX "failed to get irq resource\n"); + return -ENOENT; + } + + ret = request_irq(res->start, s3c2410wdt_irq, 0, pdev->name, dev); + if (ret != 0) { + printk(KERN_INFO PFX "failed to install irq (%d)\n", ret); + return ret; + } + + wdt_clock = clk_get(dev, "watchdog"); + if (wdt_clock == NULL) { + printk(KERN_INFO PFX "failed to find watchdog clock source\n"); + return -ENOENT; + } + + clk_use(wdt_clock); + + /* see if we can actually set the requested timer margin, and if + * not, try the default value */ + + if (s3c2410wdt_set_heartbeat(tmr_margin)) { + started = s3c2410wdt_set_heartbeat(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME); + + if (started == 0) { + printk(KERN_INFO PFX "tmr_margin value out of range, default %d used\n", + CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME); + } else { + printk(KERN_INFO PFX "default timer value is out of range, cannot start\n"); + } + } + + ret = register_reboot_notifier(&s3c2410wdt_notifier); + if (ret) { + printk (KERN_ERR PFX "cannot register reboot notifier (%d)\n", + ret); + return ret; + } + + ret = misc_register(&s3c2410wdt_miscdev); + if (ret) { + printk (KERN_ERR PFX "cannot register miscdev on minor=%d (%d)\n", + WATCHDOG_MINOR, ret); + unregister_reboot_notifier(&s3c2410wdt_notifier); + return ret; + } + + if (tmr_atboot && started == 0) { + printk(KERN_INFO PFX "Starting Watchdog Timer\n"); + s3c2410wdt_start(); + } + + return 0; +} + +static int s3c2410wdt_remove(struct device *dev) +{ + if (wdt_mem != NULL) { + release_mem_region(wdt_mem->start, + wdt_mem->end - wdt_mem->start); + wdt_mem = NULL; + } + + if (wdt_irq != NULL) { + free_irq(wdt_irq->start, dev); + wdt_irq = NULL; + } + + if (wdt_clock != NULL) { + clk_disable(wdt_clock); + clk_unuse(wdt_clock); + clk_put(wdt_clock); + wdt_clock = NULL; + } + + misc_deregister(&s3c2410wdt_miscdev); + return 0; +} + +static struct device_driver s3c2410wdt_driver = { + .name = "s3c2410-wdt", + .bus = &platform_bus_type, + .probe = s3c2410wdt_probe, + .remove = s3c2410wdt_remove, +}; + + + +static char banner[] __initdata = KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics"; + +static int __init watchdog_init(void) +{ + printk(banner); + return driver_register(&s3c2410wdt_driver); +} + +static void __exit watchdog_exit(void) +{ + driver_unregister(&s3c2410wdt_driver); + unregister_reboot_notifier(&s3c2410wdt_notifier); +} + +module_init(watchdog_init); +module_exit(watchdog_exit); + +MODULE_AUTHOR("Ben Dooks "); +MODULE_DESCRIPTION("S3C2410 Watchdog Device Driver"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/input/Kconfig linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/input/Kconfig --- linux-2.6.9-rc1-bk12/drivers/input/Kconfig 2004-07-19 03:33:39.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/input/Kconfig 2004-09-06 02:44:05.000000000 +0200 @@ -91,7 +91,7 @@ config INPUT_TSDEV depends on INPUT ---help--- Say Y here if you have an application that only can understand the - Compaq touchscreen protocol for absolute pointer data. This is + HP touchscreen protocol for absolute pointer data. This is useful namely for embedded configurations. If unsure, say N. diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/input/touchscreen/h1940ts.c linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/input/touchscreen/h1940ts.c --- linux-2.6.9-rc1-bk12/drivers/input/touchscreen/h1940ts.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/input/touchscreen/h1940ts.c 2004-09-06 02:59:04.000000000 +0200 @@ -0,0 +1,234 @@ +/* + * Copyright (c) 2004 Arnaud Patard + * iPAQ H1940 touchscreen support + * + * ChangeLog + * + * 2004-09-05: Herbert Pötzl + * - added clock (de-)allocation code + * + */ +/* + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +MODULE_AUTHOR("Arnaud Patard "); +MODULE_DESCRIPTION("h1940 touchscreen driver"); +MODULE_LICENSE("GPL"); + +#undef KERN_DEBUG +#define KERN_DEBUG "ts: " + +/* + * Definitions & global arrays. + */ + + +static char *h1940ts_name = "h1940 TouchScreen"; + +/* + * Per-touchscreen data. + */ + +struct h1940ts { + struct input_dev dev; + long xp; + long yp; + char phys[32]; +}; + +static struct h1940ts ts; + +static irqreturn_t stylus_down(int irq, void *dev_id, struct pt_regs *regs) +{ + unsigned long adctsc; + unsigned long adccon; + unsigned long data0; + unsigned long data1; + disable_irq(IRQ_TC); + + adccon = __raw_readl(S3C2410_ADCCON); + adctsc = __raw_readl(S3C2410_ADCTSC); + data0 = __raw_readl(S3C2410_ADCDAT0); + data1 = __raw_readl(S3C2410_ADCDAT1); + + + printk(KERN_DEBUG "stylus down\n"); + // BUG_ON(1); + + /* start X conversion */ + adctsc &= ~0x07; + adctsc |= 1; + __raw_writel(adctsc,S3C2410_ADCTSC); + __raw_writel(adccon|1,S3C2410_ADCCON); + + enable_irq(IRQ_TC); + return IRQ_HANDLED; +} + + +static irqreturn_t stylus_action(int irq, void *dev_id, struct pt_regs *regs) +{ + unsigned long adccon; + unsigned long data0; + unsigned long data1; + unsigned long adctsc; + + disable_irq(IRQ_ADC); + + adccon = __raw_readl(S3C2410_ADCCON); + adctsc = __raw_readl(S3C2410_ADCTSC); + + switch(adctsc & 3) + { + case 1: /* X conversion ended, starts Y conversion */ + adctsc &= ~0x07; + adctsc |= 2; + __raw_writel(adctsc,S3C2410_ADCTSC); + data0 = __raw_readl(S3C2410_ADCDAT0); + ts.xp=data0&0x3FF; + printk(KERN_DEBUG "X : %ld, U/D: %ld\n",data0&0x3FF,data0>>15); + __raw_writel(adccon|1,S3C2410_ADCCON); + break; + case 2: + adctsc &= ~0x07; + adctsc |= 3; + __raw_writel(adctsc,S3C2410_ADCTSC); + data1 = __raw_readl(S3C2410_ADCDAT1); + ts.yp = data1&0x3FF; + printk(KERN_DEBUG "Y : %ld, U/D: %ld\n",data1&0x3FF,data1>>15); + input_report_abs(&ts.dev, ABS_X, ts.xp); + input_report_abs(&ts.dev, ABS_Y, ts.yp); + input_report_key(&ts.dev, BTN_TOUCH, 1); + input_sync(&ts.dev); + + /* if stylus down, starts X conversion */ + if (!(data1>>15)) + { + adctsc &= ~0x07; + adctsc |= 1; + __raw_writel(adctsc,S3C2410_ADCTSC); + __raw_writel(adccon|1,S3C2410_ADCCON); + } + break; + default: + break; + } + + enable_irq(IRQ_ADC); + return IRQ_HANDLED; +} + + +static struct clk *adc_clock; + +/* + * The functions for inserting/removing us as a module. + */ + +int __init h1940ts_init(void) +{ + + printk(KERN_DEBUG "Entering h1940ts_connect\n"); + + adc_clock = clk_get(NULL, "adc"); + if (!adc_clock) { + printk(KERN_ERR "failed to get adc clock source\n"); + return -ENOENT; + } + clk_use(adc_clock); + clk_enable(adc_clock); + printk(KERN_INFO "got and enabled clock\n"); + + /* probably not required */ + msleep(10); + + /* Initialise registers */ + __raw_writel(0xcc78, S3C2410_ADCCON); + __raw_writel( 0xD3, S3C2410_ADCTSC); + __raw_writel(0x2710, S3C2410_ADCDLY); + __raw_writel(0xb1b4, S3C2410_ADCDAT0); + __raw_writel(0xb24c, S3C2410_ADCDAT1); + + + memset(&ts, 0, sizeof(struct h1940ts)); + + init_input_dev(&ts.dev); + ts.dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + ts.dev.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); +/* input_set_abs_params(&ts.dev, ABS_X, 0, 0x3FF, 0, 0); + input_set_abs_params(&ts.dev, ABS_Y, 0, 0x3FF, 0, 0);*/ + + sprintf(ts.phys, "ts0"); + + ts.dev.private = &ts; + ts.dev.name = h1940ts_name; + ts.dev.phys = ts.phys; + ts.dev.id.bustype = BUS_RS232; + ts.dev.id.vendor = 0xDEAD; + ts.dev.id.product = 0xBEEF; + ts.dev.id.version = 0x0100; + + if (request_irq(IRQ_ADC, stylus_action, SA_SAMPLE_RANDOM, + "h1940_action", &ts.dev)) { + printk(KERN_ERR "h1940ts.c: Could not allocate ts IRQ_ADC !\n"); + return -EIO; + } + if (request_irq(IRQ_TC, stylus_down, SA_SAMPLE_RANDOM, + "h1940_action", &ts.dev)) { + printk(KERN_ERR "h1940ts.c: Could not allocate ts IRQ_TC !\n"); + return -EIO; + } + + printk(KERN_DEBUG "input: %s on ts0\n", h1940ts_name); + + input_register_device(&ts.dev); + return 0; +} + +void __exit h1940ts_exit(void) +{ + disable_irq(IRQ_ADC); + disable_irq(IRQ_TC); + free_irq(IRQ_TC,&ts.dev); + free_irq(IRQ_ADC,&ts.dev); + + if (adc_clock) { + clk_disable(adc_clock); + clk_unuse(adc_clock); + clk_put(adc_clock); + adc_clock = NULL; + } + + input_unregister_device(&ts.dev); +} + +module_init(h1940ts_init); +module_exit(h1940ts_exit); diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/input/touchscreen/Kconfig linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/input/touchscreen/Kconfig --- linux-2.6.9-rc1-bk12/drivers/input/touchscreen/Kconfig 2004-07-19 03:33:39.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/input/touchscreen/Kconfig 2004-09-06 02:44:05.000000000 +0200 @@ -22,6 +22,19 @@ config TOUCHSCREEN_BITSY To compile this driver as a module, choose M here: the module will be called h3600_ts_input. +config TOUCHSCREEN_H1940 + tristate "HP iPAQ H1940 touchscreen input driver" + depends on ARCH_H1940 && INPUT && INPUT_TOUCHSCREEN + select SERIO + help + Say Y here if you have the h1940 touchscreen. + + If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called h1940ts_input. + + config TOUCHSCREEN_GUNZE tristate "Gunze AHL-51S touchscreen" depends on INPUT && INPUT_TOUCHSCREEN diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/input/touchscreen/Makefile linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/input/touchscreen/Makefile --- linux-2.6.9-rc1-bk12/drivers/input/touchscreen/Makefile 2004-07-19 03:33:39.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/input/touchscreen/Makefile 2004-09-06 02:44:05.000000000 +0200 @@ -4,5 +4,7 @@ # Each configuration option enables a list of files. + obj-$(CONFIG_TOUCHSCREEN_BITSY) += h3600_ts_input.o +obj-$(CONFIG_TOUCHSCREEN_H1940) += h1940ts.o obj-$(CONFIG_TOUCHSCREEN_GUNZE) += gunze.o diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/serial/s3c2410.c linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/serial/s3c2410.c --- linux-2.6.9-rc1-bk12/drivers/serial/s3c2410.c 2004-07-16 03:11:49.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/serial/s3c2410.c 2004-09-06 03:26:45.000000000 +0200 @@ -9,6 +9,14 @@ * * Changelog: * + * 2004-07-23: Herbert Pötzl + * - implemented the IR echo cancellation + * - added exception irq for testing + * + * 2004-07-19: Herbert Pötzl + * - enhanced debugging output + * - fixed uart baud rate setting + * */ #include #include @@ -17,11 +25,18 @@ #include #include #include +#include + +#if defined(CONFIG_SERIAL_S3C2410_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) +#define SUPPORT_SYSRQ +#endif + #include #include #include #include +#include #include #include @@ -29,13 +44,13 @@ #include #if 0 -#include -#define dbg(x...) llprintk(x) +#define dbg(msg...) printk(KERN_DEBUG "s3c2410: " msg) #else -#define dbg(x...) +#define dbg(msg...) while (0) { } #endif #define SERIAL_S3C2410_NAME "ttySAC" +#define SERIAL_S3C2410_DEVFS "tts/" #define SERIAL_S3C2410_MAJOR 204 #define SERIAL_S3C2410_MINOR 64 @@ -47,11 +62,12 @@ static const char serial_s3c2410_name[] /* port irq numbers */ -#define TX_IRQ(port) ((port)->irq + 1) #define RX_IRQ(port) ((port)->irq) +#define TX_IRQ(port) ((port)->irq + 1) +#define ES_IRQ(port) ((port)->irq + 2) -#define tx_enabled(port) ((port)->unused[0]) -#define rx_enabled(port) ((port)->unused[1]) +#define rx_enabled(port) ((port)->unused[0]) +#define tx_enabled(port) ((port)->unused[1]) /* flag to ignore all characters comming in */ #define RXSTAT_DUMMY_READ (0x10000000) @@ -70,15 +86,75 @@ static const char serial_s3c2410_name[] do { __raw_writel(val, portaddr(port, reg)); } while(0) +/* code */ +#define S3C2410_UFCON_RESETRX (1<<1) +#define S3C2410_UFCON_RESETTX (1<<2) + +static unsigned int +serial_s3c2410_tx_empty(struct uart_port *port) +{ + unsigned int utrstat; + + utrstat = rd_regb(port, S3C2410_UTRSTAT); + return (utrstat & S3C2410_UTRSTAT_TXE) ? TIOCSER_TEMT : 0; +} + + +static void +serial_s3c2410_rx_enable(struct uart_port *port) +{ + unsigned long flags; + unsigned int ucon, ufcon; + int count = 10000; + + spin_lock_irqsave(&port->lock, flags); + + while (--count) { + if (serial_s3c2410_tx_empty(port)) + break; + udelay(100); + } + + ufcon = rd_regl(port, S3C2410_UFCON); + ufcon |= S3C2410_UFCON_RESETRX; + wr_regl(port, S3C2410_UFCON, ufcon); + + ucon = rd_regl(port, S3C2410_UCON); + ucon |= S3C2410_UCON_RXIRQMODE; + wr_regl(port, S3C2410_UCON, ucon); + + rx_enabled(port) = 1; + + spin_unlock_irqrestore(&port->lock, flags); +} + +static void +serial_s3c2410_rx_disable(struct uart_port *port) +{ + unsigned long flags; + unsigned int ucon; + + spin_lock_irqsave(&port->lock, flags); + + ucon = rd_regl(port, S3C2410_UCON); + ucon &= ~S3C2410_UCON_RXIRQMODE; + wr_regl(port, S3C2410_UCON, ucon); + + rx_enabled(port) = 0; + + spin_unlock_irqrestore(&port->lock, flags); +} -/* code */ static void serial_s3c2410_stop_tx(struct uart_port *port, unsigned int tty_stop) { if (tx_enabled(port)) { + dbg("serial_s3c2410_stop_tx: port=%p\n", port); disable_irq(TX_IRQ(port)); + if (port->flags & UPF_CONS_FLOW) + serial_s3c2410_rx_enable(port); tx_enabled(port) = 0; } } @@ -87,6 +163,9 @@ static void serial_s3c2410_start_tx(struct uart_port *port, unsigned int tty_start) { if (!tx_enabled(port)) { + dbg("serial_s3c2410_start_tx: port=%p\n", port); + if (port->flags & UPF_CONS_FLOW) + serial_s3c2410_rx_disable(port); enable_irq(TX_IRQ(port)); tx_enabled(port) = 1; } @@ -114,7 +193,7 @@ serial_s3c2410_rx_chars(int irq, void *d struct uart_port *port = dev_id; struct tty_struct *tty = port->info->tty; unsigned int ufcon, ch, rxs, ufstat; - int max_count = 256; + int max_count = 32; while (max_count-- > 0) { ufcon = rd_regl(port, S3C2410_UFCON); @@ -132,12 +211,32 @@ serial_s3c2410_rx_chars(int irq, void *d } ch = rd_regb(port, S3C2410_URXH); + rxs = rd_regl(port, S3C2410_UERSTAT) | RXSTAT_DUMMY_READ; + + if (port->flags & UPF_CONS_FLOW) { + int txe = serial_s3c2410_tx_empty(port); + + if (rx_enabled(port)) { + if (!txe) { + rx_enabled(port) = 0; + continue; + } + } else { + if (txe) { + ufcon |= S3C2410_UFCON_RESETRX; + wr_regl(port, S3C2410_UFCON, ufcon); + rx_enabled(port) = 1; + goto out; + } + continue; + } + } *tty->flip.char_buf_ptr = ch; *tty->flip.flag_buf_ptr = TTY_NORMAL; port->icount.rx++; - rxs = rd_regb(port, S3C2410_UERSTAT) | RXSTAT_DUMMY_READ; + dbg("rx: ch=0x%02x, rxs=0x%08x\n", ch, rxs); if (rxs & S3C2410_UERSTAT_ANY) { if (rxs & S3C2410_UERSTAT_FRAME) @@ -153,12 +252,15 @@ serial_s3c2410_rx_chars(int irq, void *d *tty->flip.flag_buf_ptr = TTY_FRAME; } + if (uart_handle_sysrq_char(port, ch, regs)) + goto ignore; + if ((rxs & port->ignore_status_mask) == 0) { tty->flip.flag_buf_ptr++; tty->flip.char_buf_ptr++; tty->flip.count++; } - + ignore: if ((rxs & S3C2410_UERSTAT_OVERRUN) && tty->flip.count < TTY_FLIPBUF_SIZE) { /* @@ -221,12 +323,51 @@ serial_s3c2410_tx_chars(int irq, void *d return IRQ_HANDLED; } -static unsigned int -serial_s3c2410_tx_empty(struct uart_port *port) +#if 0 +static irqreturn_t +serial_s3c2410_exception(int irq, void *dev_id, struct pt_regs *regs) { - unsigned int ufcon = rd_regl(port, S3C2410_UFCON); - return (S3C2410_UFCON_TXC(ufcon) != 0) ? 0 : TIOCSER_TEMT; + struct uart_port *port = dev_id; + struct tty_struct *tty = port->info->tty; + unsigned int uerstat, ufcon; + + uerstat = rd_regb(port, S3C2410_UERSTAT); + + if (!uerstat) { + port->icount.brk++; + if (uart_handle_break(port)) + goto ignore; + + if (tty->flip.count >= TTY_FLIPBUF_SIZE) + goto ignore; + + *tty->flip.char_buf_ptr++ = 0; + *tty->flip.flag_buf_ptr++ = TTY_BREAK; + tty->flip.count++; + } else { + if (tty->flip.count >= TTY_FLIPBUF_SIZE) + goto ignore; + + if (uerstat & S3C2410_UERSTAT_OVERRUN) { + /* + * Overrun is special, since it's reported + * immediately, and doesn't affect the current + * character. + */ + *tty->flip.char_buf_ptr++ = 0; + *tty->flip.flag_buf_ptr++ = TTY_OVERRUN; + tty->flip.count++; + + ufcon = rd_regl(port, S3C2410_UFCON); + ufcon |= S3C2410_UFCON_RESETRX; + wr_regl(port, S3C2410_UFCON, ufcon); + } + } + tty_flip_buffer_push(tty); +ignore: + return IRQ_HANDLED; } +#endif /* no modem control lines */ static unsigned int @@ -272,31 +413,44 @@ static int serial_s3c2410_startup(struct tx_enabled(port) = 1; rx_enabled(port) = 1; - dbg("serial_s3c2410_startup: port=%p (%p)\n", + dbg("serial_s3c2410_startup: port=%p (0x%08lx)\n", port, port->mapbase); ret = request_irq(RX_IRQ(port), serial_s3c2410_rx_chars, 0, serial_s3c2410_name, port); - if (ret != 0) - return ret; + if (ret) + goto rx_out; ret = request_irq(TX_IRQ(port), serial_s3c2410_tx_chars, 0, serial_s3c2410_name, port); - if (ret) { - free_irq(RX_IRQ(port), port); - return ret; - } + if (ret) + goto tx_out; + +#if 0 + ret = request_irq(ES_IRQ(port), serial_s3c2410_exception, 0, + serial_s3c2410_name, port); + + if (ret) + goto es_out; +#endif /* the port reset code should have done the correct * register setup for the port controls */ + return 0; +// es_out: + free_irq(TX_IRQ(port), port); +tx_out: + free_irq(RX_IRQ(port), port); +rx_out: return ret; } static void serial_s3c2410_shutdown(struct uart_port *port) { +// free_irq(ES_IRQ(port), port); free_irq(TX_IRQ(port), port); free_irq(RX_IRQ(port), port); } @@ -318,7 +472,7 @@ serial_s3c2410_set_termios(struct uart_p /* * We don't support BREAK character recognition. */ - termios->c_iflag &= ~(IGNBRK | BRKINT); +// termios->c_iflag &= ~(IGNBRK | BRKINT); /* * Ask the core to calculate the divisor for us. @@ -326,6 +480,8 @@ serial_s3c2410_set_termios(struct uart_p baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); quot = uart_get_divisor(port, baud); + dbg("config: baud=%d, quot=%d(%x)\n", baud, quot, quot); + switch (termios->c_cflag & CSIZE) { case CS5: dbg("config: 5bits/char\n"); @@ -358,6 +514,9 @@ serial_s3c2410_set_termios(struct uart_p ulcon |= S3C2410_LCON_PNONE; } + if (machine_is_h1940() && (port->line == 2)) + ulcon |= S3C2410_LCON_IRM; + /* if (port->fifosize) enable_fifo() @@ -370,6 +529,7 @@ serial_s3c2410_set_termios(struct uart_p /* set the ulcon register */ wr_regl(port, S3C2410_ULCON, ulcon); + wr_regl(port, S3C2410_UBRDIV, quot); dbg("uart: ulcon = 0x%08x, ucon = 0x%08x, ufcon = 0x%08x\n", rd_regl(port, S3C2410_ULCON), @@ -500,7 +660,7 @@ static struct uart_port serial_s3c2410_p .uartclk = 0, .fifosize = 16, .ops = &serial_s3c2410_ops, - .flags = UPF_BOOT_AUTOCONF, + .flags = UPF_BOOT_AUTOCONF | UPF_CONS_FLOW, .line = 2, } #endif @@ -512,7 +672,7 @@ serial_s3c2410_resetport(struct uart_por { /* ensure registers are setup */ - dbg("serial_s3c2410_resetport: port=%p (%08x), cfg=%p\n", + dbg("serial_s3c2410_resetport: port=%p (0x%08lx), cfg=%p\n", port, port->mapbase, cfg); wr_regl(port, S3C2410_UCON, cfg->ucon); @@ -607,7 +767,7 @@ serial_s3c2410_console_txrdy(struct uart utrstat = rd_regl(port, S3C2410_UTRSTAT); - return (utrstat & S3C2410_UTRSTAT_TXFE) ? 1 : 0; + return (utrstat & S3C2410_UTRSTAT_TXBE) ? 1 : 0; } static void @@ -644,7 +804,7 @@ serial_s3c2410_get_options(struct uart_p ubrdiv = rd_regl(port, S3C2410_UBRDIV); dbg("serial_s3c2410_get_options: port=%p\n" - "registers: ulcon=%08x, ucon=%08x, ubdriv=%08x\n", + "registers: ulcon=%08x, ucon=%08x, ubrdiv=%08x\n", port, ulcon, ucon, ubrdiv); if ((ucon & 0xf) != 0) { @@ -675,9 +835,11 @@ serial_s3c2410_get_options(struct uart_p *parity = 'o'; break; - default: case S3C2410_LCON_PNONE: + break; + default: /* nothing */ + break; } /* now calculate the baud rate */ @@ -714,6 +876,7 @@ serial_s3c2410_console_setup(struct cons cons_uart = port; dbg("serial_s3c2410_console_setup: port=%p (%d)\n", port, co->index); + dbg("serial_s3c2410_console_setup: options=%s\n", options); /* * Check whether an invalid uart number has been specified, and @@ -725,6 +888,9 @@ serial_s3c2410_console_setup(struct cons else serial_s3c2410_get_options(port, &baud, &parity, &bits); + dbg("serial_s3c2410_console_setup: baud=%d, parity=%d, bits=%d\n", + baud, parity, bits); + return uart_set_options(port, co, baud, parity, bits, flow); } @@ -758,7 +924,8 @@ console_initcall(s3c2410_console_init); static struct uart_driver s3c2410_uart_drv = { .owner = THIS_MODULE, - .driver_name = SERIAL_S3C2410_NAME, + .driver_name = "s3c2410_serial", + .devfs_name = SERIAL_S3C2410_DEVFS, .dev_name = SERIAL_S3C2410_NAME, .major = SERIAL_S3C2410_MAJOR, .minor = SERIAL_S3C2410_MINOR, @@ -798,7 +965,7 @@ static int s3c2410_serial_probe(struct d struct uart_port *ptr = serial_s3c2410_ports; for (i = 0; i < NR_PORTS; i++, ptr++) { - dbg("s3c2410_serial_probe: ptr=%p (%08x, %08x)\n", + dbg("s3c2410_serial_probe: ptr=%p (0x%08lx, %p)\n", ptr, ptr->mapbase, ptr->membase); if (ptr->mapbase != res->start) diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/video/console/font_clean_4x6.c linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/console/font_clean_4x6.c --- linux-2.6.9-rc1-bk12/drivers/video/console/font_clean_4x6.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/console/font_clean_4x6.c 2004-09-06 02:44:05.000000000 +0200 @@ -0,0 +1,1059 @@ +/* Font file generated by Jay Carlson from clR4x6.bdf */ + +/* +COMMENT Copyright 1989 Dale Schumacher, dal@syntel.mn.org +COMMENT 399 Beacon Ave. +COMMENT St. Paul, MN 55104-3527 +COMMENT +COMMENT Permission to use, copy, modify, and distribute this software and +COMMENT its documentation for any purpose and without fee is hereby +COMMENT granted, provided that the above copyright notice appear in all +COMMENT copies and that both that copyright notice and this permission +COMMENT notice appear in supporting documentation, and that the name of +COMMENT Dale Schumacher not be used in advertising or publicity pertaining to +COMMENT distribution of the software without specific, written prior +COMMENT permission. Dale Schumacher makes no representations about the +COMMENT suitability of this software for any purpose. It is provided "as +COMMENT is" without express or implied warranty. +*/ + +#include + +#define FONTDATAMAX (6 * 256) + +static unsigned char fontdata_clean_4x6[FONTDATAMAX] = { + + /* 0 0x00 C000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0xf0, /* 11110000 */ + + /* 1 0x01 C001 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 2 0x02 C002 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 3 0x03 C003 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 4 0x04 C004 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 5 0x05 C005 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 6 0x06 C006 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 7 0x07 C007 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 8 0x08 C010 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 9 0x09 C011 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 10 0x0a C012 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 11 0x0b C013 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 12 0x0c C014 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 13 0x0d C015 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 14 0x0e C016 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 15 0x0f C017 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 16 0x10 C020 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 17 0x11 C021 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 18 0x12 C022 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 19 0x13 C023 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 20 0x14 C024 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 21 0x15 C025 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 22 0x16 C026 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 23 0x17 C027 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 24 0x18 C030 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 25 0x19 C031 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 26 0x1a C032 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 27 0x1b C033 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 28 0x1c C034 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 29 0x1d C035 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 30 0x1e C036 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 31 0x1f C037 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 32 0x20 C040 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 33 0x21 ! */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 34 0x22 " */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 35 0x23 # */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + + /* 36 0x24 $ */ + 0xe0, /* 11100000 */ + 0xc0, /* 11000000 */ + 0xe0, /* 11100000 */ + 0x60, /* 01100000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 37 0x25 % */ + 0xa0, /* 10100000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x80, /* 10000000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + + /* 38 0x26 & */ + 0xe0, /* 11100000 */ + 0x40, /* 01000000 */ + 0xe0, /* 11100000 */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 39 0x27 ' */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 40 0x28 ( */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + + /* 41 0x29 ) */ + 0x40, /* 01000000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 42 0x2a * */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0xe0, /* 11100000 */ + 0x40, /* 01000000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + + /* 43 0x2b + */ + 0x00, /* 00000000 */ + 0x40, /* 01000000 */ + 0xe0, /* 11100000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 44 0x2c , */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 45 0x2d - */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 46 0x2e . */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 47 0x2f / */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x80, /* 10000000 */ + 0x80, /* 10000000 */ + 0x00, /* 00000000 */ + + /* 48 0x30 0 */ + 0xe0, /* 11100000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 49 0x31 1 */ + 0x40, /* 01000000 */ + 0xc0, /* 11000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 50 0x32 2 */ + 0xe0, /* 11100000 */ + 0x20, /* 00100000 */ + 0xe0, /* 11100000 */ + 0x80, /* 10000000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 51 0x33 3 */ + 0xe0, /* 11100000 */ + 0x20, /* 00100000 */ + 0xe0, /* 11100000 */ + 0x20, /* 00100000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 52 0x34 4 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + + /* 53 0x35 5 */ + 0xe0, /* 11100000 */ + 0x80, /* 10000000 */ + 0xe0, /* 11100000 */ + 0x20, /* 00100000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 54 0x36 6 */ + 0xe0, /* 11100000 */ + 0x80, /* 10000000 */ + 0xe0, /* 11100000 */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 55 0x37 7 */ + 0xe0, /* 11100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + + /* 56 0x38 8 */ + 0xe0, /* 11100000 */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 57 0x39 9 */ + 0xe0, /* 11100000 */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0x20, /* 00100000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 58 0x3a : */ + 0x00, /* 00000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 59 0x3b ; */ + 0x00, /* 00000000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 60 0x3c < */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x80, /* 10000000 */ + 0x40, /* 01000000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + + /* 61 0x3d = */ + 0x00, /* 00000000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 62 0x3e > */ + 0x80, /* 10000000 */ + 0x40, /* 01000000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x80, /* 10000000 */ + 0x00, /* 00000000 */ + + /* 63 0x3f ? */ + 0xc0, /* 11000000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 64 0x40 @ */ + 0xe0, /* 11100000 */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0x80, /* 10000000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 65 0x41 A */ + 0x40, /* 01000000 */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + + /* 66 0x42 B */ + 0xc0, /* 11000000 */ + 0xa0, /* 10100000 */ + 0xc0, /* 11000000 */ + 0xa0, /* 10100000 */ + 0xc0, /* 11000000 */ + 0x00, /* 00000000 */ + + /* 67 0x43 C */ + 0x60, /* 01100000 */ + 0x80, /* 10000000 */ + 0x80, /* 10000000 */ + 0x80, /* 10000000 */ + 0x60, /* 01100000 */ + 0x00, /* 00000000 */ + + /* 68 0x44 D */ + 0xc0, /* 11000000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xc0, /* 11000000 */ + 0x00, /* 00000000 */ + + /* 69 0x45 E */ + 0xe0, /* 11100000 */ + 0x80, /* 10000000 */ + 0xc0, /* 11000000 */ + 0x80, /* 10000000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 70 0x46 F */ + 0xe0, /* 11100000 */ + 0x80, /* 10000000 */ + 0xc0, /* 11000000 */ + 0x80, /* 10000000 */ + 0x80, /* 10000000 */ + 0x00, /* 00000000 */ + + /* 71 0x47 G */ + 0x60, /* 01100000 */ + 0x80, /* 10000000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x60, /* 01100000 */ + 0x00, /* 00000000 */ + + /* 72 0x48 H */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + + /* 73 0x49 I */ + 0xe0, /* 11100000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 74 0x4a J */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0xa0, /* 10100000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 75 0x4b K */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xc0, /* 11000000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + + /* 76 0x4c L */ + 0x80, /* 10000000 */ + 0x80, /* 10000000 */ + 0x80, /* 10000000 */ + 0x80, /* 10000000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 77 0x4d M */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0xe0, /* 11100000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + + /* 78 0x4e N */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0xe0, /* 11100000 */ + 0xe0, /* 11100000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + + /* 79 0x4f O */ + 0x40, /* 01000000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 80 0x50 P */ + 0xc0, /* 11000000 */ + 0xa0, /* 10100000 */ + 0xc0, /* 11000000 */ + 0x80, /* 10000000 */ + 0x80, /* 10000000 */ + 0x00, /* 00000000 */ + + /* 81 0x51 Q */ + 0x40, /* 01000000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xc0, /* 11000000 */ + 0x60, /* 01100000 */ + 0x00, /* 00000000 */ + + /* 82 0x52 R */ + 0xc0, /* 11000000 */ + 0xa0, /* 10100000 */ + 0xc0, /* 11000000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + + /* 83 0x53 S */ + 0x60, /* 01100000 */ + 0x80, /* 10000000 */ + 0x40, /* 01000000 */ + 0x20, /* 00100000 */ + 0xc0, /* 11000000 */ + 0x00, /* 00000000 */ + + /* 84 0x54 T */ + 0xe0, /* 11100000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 85 0x55 U */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 86 0x56 V */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 87 0x57 W */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0xe0, /* 11100000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + + /* 88 0x58 X */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x40, /* 01000000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + + /* 89 0x59 Y */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 90 0x5a Z */ + 0xe0, /* 11100000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x80, /* 10000000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 91 0x5b [ */ + 0x60, /* 01100000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x60, /* 01100000 */ + 0x00, /* 00000000 */ + + /* 92 0x5c \ */ + 0x80, /* 10000000 */ + 0x80, /* 10000000 */ + 0x40, /* 01000000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + + /* 93 0x5d ] */ + 0x60, /* 01100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x60, /* 01100000 */ + 0x00, /* 00000000 */ + + /* 94 0x5e ^ */ + 0x40, /* 01000000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 95 0x5f _ */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 96 0x60 ` */ + 0x40, /* 01000000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 97 0x61 a */ + 0x00, /* 00000000 */ + 0x40, /* 01000000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x60, /* 01100000 */ + 0x00, /* 00000000 */ + + /* 98 0x62 b */ + 0x80, /* 10000000 */ + 0xc0, /* 11000000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xc0, /* 11000000 */ + 0x00, /* 00000000 */ + + /* 99 0x63 c */ + 0x00, /* 00000000 */ + 0x60, /* 01100000 */ + 0x80, /* 10000000 */ + 0x80, /* 10000000 */ + 0x60, /* 01100000 */ + 0x00, /* 00000000 */ + + /* 100 0x64 d */ + 0x20, /* 00100000 */ + 0x60, /* 01100000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x60, /* 01100000 */ + 0x00, /* 00000000 */ + + /* 101 0x65 e */ + 0x00, /* 00000000 */ + 0x60, /* 01100000 */ + 0xe0, /* 11100000 */ + 0x80, /* 10000000 */ + 0x60, /* 01100000 */ + 0x00, /* 00000000 */ + + /* 102 0x66 f */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0xe0, /* 11100000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 103 0x67 g */ + 0x00, /* 00000000 */ + 0x60, /* 01100000 */ + 0xa0, /* 10100000 */ + 0x60, /* 01100000 */ + 0x20, /* 00100000 */ + 0xc0, /* 11000000 */ + + /* 104 0x68 h */ + 0x80, /* 10000000 */ + 0xc0, /* 11000000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + + /* 105 0x69 i */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 106 0x6a j */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0xa0, /* 10100000 */ + 0x40, /* 01000000 */ + + /* 107 0x6b k */ + 0x80, /* 10000000 */ + 0xa0, /* 10100000 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + + /* 108 0x6c l */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 109 0x6d m */ + 0x00, /* 00000000 */ + 0xe0, /* 11100000 */ + 0xe0, /* 11100000 */ + 0xe0, /* 11100000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + + /* 110 0x6e n */ + 0x00, /* 00000000 */ + 0xc0, /* 11000000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + + /* 111 0x6f o */ + 0x00, /* 00000000 */ + 0x40, /* 01000000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 112 0x70 p */ + 0x00, /* 00000000 */ + 0xc0, /* 11000000 */ + 0xa0, /* 10100000 */ + 0xc0, /* 11000000 */ + 0x80, /* 10000000 */ + 0x80, /* 10000000 */ + + /* 113 0x71 q */ + 0x00, /* 00000000 */ + 0x60, /* 01100000 */ + 0xa0, /* 10100000 */ + 0x60, /* 01100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + + /* 114 0x72 r */ + 0x00, /* 00000000 */ + 0xc0, /* 11000000 */ + 0xa0, /* 10100000 */ + 0x80, /* 10000000 */ + 0x80, /* 10000000 */ + 0x00, /* 00000000 */ + + /* 115 0x73 s */ + 0x00, /* 00000000 */ + 0x60, /* 01100000 */ + 0xc0, /* 11000000 */ + 0x60, /* 01100000 */ + 0xc0, /* 11000000 */ + 0x00, /* 00000000 */ + + /* 116 0x74 t */ + 0x40, /* 01000000 */ + 0xe0, /* 11100000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 117 0x75 u */ + 0x00, /* 00000000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 118 0x76 v */ + 0x00, /* 00000000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 119 0x77 w */ + 0x00, /* 00000000 */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0xe0, /* 11100000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 120 0x78 x */ + 0x00, /* 00000000 */ + 0xa0, /* 10100000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0xa0, /* 10100000 */ + 0x00, /* 00000000 */ + + /* 121 0x79 y */ + 0x00, /* 00000000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0x60, /* 01100000 */ + 0x20, /* 00100000 */ + 0xc0, /* 11000000 */ + + /* 122 0x7a z */ + 0x00, /* 00000000 */ + 0xe0, /* 11100000 */ + 0x60, /* 01100000 */ + 0xc0, /* 11000000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + + /* 123 0x7b { */ + 0x60, /* 01100000 */ + 0x40, /* 01000000 */ + 0xc0, /* 11000000 */ + 0x40, /* 01000000 */ + 0x60, /* 01100000 */ + 0x00, /* 00000000 */ + + /* 124 0x7c | */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 125 0x7d } */ + 0xc0, /* 11000000 */ + 0x40, /* 01000000 */ + 0x60, /* 01100000 */ + 0x40, /* 01000000 */ + 0xc0, /* 11000000 */ + 0x00, /* 00000000 */ + + /* 126 0x7e ~ */ + 0x20, /* 00100000 */ + 0xe0, /* 11100000 */ + 0x80, /* 10000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 127 0x7f C177 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0xa0, /* 10100000 */ + 0xa0, /* 10100000 */ + 0xe0, /* 11100000 */ + 0x00, /* 00000000 */ + +}; + +struct font_desc font_clean_4x6 = { + CLEAN4x6_IDX, + "Clean4x6", + 4, + 6, + fontdata_clean_4x6, + 3 +}; diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/video/console/font_clean_5x8.c linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/console/font_clean_5x8.c --- linux-2.6.9-rc1-bk12/drivers/video/console/font_clean_5x8.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/console/font_clean_5x8.c 2004-09-06 02:44:05.000000000 +0200 @@ -0,0 +1,1314 @@ +/* Font file generated by Jay Carlson from clR5x8.bdf */ + +/* +COMMENT Copyright 1989 Dale Schumacher, dal@syntel.mn.org +COMMENT 399 Beacon Ave. +COMMENT St. Paul, MN 55104-3527 +COMMENT +COMMENT Permission to use, copy, modify, and distribute this software and +COMMENT its documentation for any purpose and without fee is hereby +COMMENT granted, provided that the above copyright notice appear in all +COMMENT copies and that both that copyright notice and this permission +COMMENT notice appear in supporting documentation, and that the name of +COMMENT Dale Schumacher not be used in advertising or publicity pertaining to +COMMENT distribution of the software without specific, written prior +COMMENT permission. Dale Schumacher makes no representations about the +COMMENT suitability of this software for any purpose. It is provided "as +COMMENT is" without express or implied warranty. +*/ + +#include + +#define FONTDATAMAX (8 * 256) + +static unsigned char fontdata_clean_5x8[FONTDATAMAX] = { + + /* 0 0x00 C000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 1 0x01 C001 */ + 0x00, /* 00000000 */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x78, /* 01111000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 2 0x02 C002 */ + 0x00, /* 00000000 */ + 0x70, /* 01110000 */ + 0x48, /* 01001000 */ + 0x70, /* 01110000 */ + 0x48, /* 01001000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 3 0x03 C003 */ + 0x00, /* 00000000 */ + 0x38, /* 00111000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 4 0x04 C004 */ + 0x00, /* 00000000 */ + 0x70, /* 01110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 5 0x05 C005 */ + 0x00, /* 00000000 */ + 0x78, /* 01111000 */ + 0x40, /* 01000000 */ + 0x70, /* 01110000 */ + 0x40, /* 01000000 */ + 0x78, /* 01111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 6 0x06 C006 */ + 0x00, /* 00000000 */ + 0x78, /* 01111000 */ + 0x40, /* 01000000 */ + 0x70, /* 01110000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 7 0x07 C007 */ + 0x00, /* 00000000 */ + 0x38, /* 00111000 */ + 0x40, /* 01000000 */ + 0x58, /* 01011000 */ + 0x48, /* 01001000 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 8 0x08 C010 */ + 0x00, /* 00000000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x78, /* 01111000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 9 0x09 C011 */ + 0x00, /* 00000000 */ + 0x70, /* 01110000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 10 0x0a C012 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x08, /* 00001000 */ + 0x08, /* 00001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 11 0x0b C013 */ + 0x00, /* 00000000 */ + 0x48, /* 01001000 */ + 0x50, /* 01010000 */ + 0x60, /* 01100000 */ + 0x50, /* 01010000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 12 0x0c C014 */ + 0x00, /* 00000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x78, /* 01111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 13 0x0d C015 */ + 0x00, /* 00000000 */ + 0x48, /* 01001000 */ + 0x78, /* 01111000 */ + 0x78, /* 01111000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 14 0x0e C016 */ + 0x00, /* 00000000 */ + 0x48, /* 01001000 */ + 0x68, /* 01101000 */ + 0x58, /* 01011000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 15 0x0f C017 */ + 0x00, /* 00000000 */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 16 0x10 C020 */ + 0x00, /* 00000000 */ + 0x70, /* 01110000 */ + 0x48, /* 01001000 */ + 0x70, /* 01110000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 17 0x11 C021 */ + 0x00, /* 00000000 */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* 18 0x12 C022 */ + 0x00, /* 00000000 */ + 0x70, /* 01110000 */ + 0x48, /* 01001000 */ + 0x70, /* 01110000 */ + 0x50, /* 01010000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 19 0x13 C023 */ + 0x00, /* 00000000 */ + 0x38, /* 00111000 */ + 0x40, /* 01000000 */ + 0x30, /* 00110000 */ + 0x08, /* 00001000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 20 0x14 C024 */ + 0x00, /* 00000000 */ + 0xf8, /* 11111000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 21 0x15 C025 */ + 0x00, /* 00000000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 22 0x16 C026 */ + 0x00, /* 00000000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 23 0x17 C027 */ + 0x00, /* 00000000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x78, /* 01111000 */ + 0x78, /* 01111000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 24 0x18 C030 */ + 0x00, /* 00000000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 25 0x19 C031 */ + 0x00, /* 00000000 */ + 0x88, /* 10001000 */ + 0x50, /* 01010000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 26 0x1a C032 */ + 0x00, /* 00000000 */ + 0x78, /* 01111000 */ + 0x10, /* 00010000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x78, /* 01111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 27 0x1b C033 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 28 0x1c C034 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 29 0x1d C035 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 30 0x1e C036 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 31 0x1f C037 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 32 0x20 C040 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 33 0x21 ! */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + + /* 34 0x22 " */ + 0x28, /* 00101000 */ + 0x28, /* 00101000 */ + 0x28, /* 00101000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 35 0x23 # */ + 0x50, /* 01010000 */ + 0x50, /* 01010000 */ + 0xf8, /* 11111000 */ + 0x50, /* 01010000 */ + 0xf8, /* 11111000 */ + 0x50, /* 01010000 */ + 0x50, /* 01010000 */ + 0x00, /* 00000000 */ + + /* 36 0x24 $ */ + 0x20, /* 00100000 */ + 0x78, /* 01111000 */ + 0xa0, /* 10100000 */ + 0x70, /* 01110000 */ + 0x28, /* 00101000 */ + 0xf0, /* 11110000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + + /* 37 0x25 % */ + 0x60, /* 01100000 */ + 0x68, /* 01101000 */ + 0x10, /* 00010000 */ + 0x20, /* 00100000 */ + 0x58, /* 01011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 38 0x26 & */ + 0x30, /* 00110000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x28, /* 00101000 */ + 0x50, /* 01010000 */ + 0x50, /* 01010000 */ + 0x28, /* 00101000 */ + 0x00, /* 00000000 */ + + /* 39 0x27 ' */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 40 0x28 ( */ + 0x08, /* 00001000 */ + 0x10, /* 00010000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x10, /* 00010000 */ + 0x08, /* 00001000 */ + 0x00, /* 00000000 */ + + /* 41 0x29 ) */ + 0x40, /* 01000000 */ + 0x20, /* 00100000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 42 0x2a * */ + 0x00, /* 00000000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x78, /* 01111000 */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 43 0x2b + */ + 0x00, /* 00000000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0xf8, /* 11111000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 44 0x2c , */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + + /* 45 0x2d - */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xf8, /* 11111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 46 0x2e . */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + + /* 47 0x2f / */ + 0x08, /* 00001000 */ + 0x08, /* 00001000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + + /* 48 0x30 0 */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x58, /* 01011000 */ + 0x68, /* 01101000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 49 0x31 1 */ + 0x20, /* 00100000 */ + 0x60, /* 01100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + + /* 50 0x32 2 */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x08, /* 00001000 */ + 0x10, /* 00010000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x78, /* 01111000 */ + 0x00, /* 00000000 */ + + /* 51 0x33 3 */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x08, /* 00001000 */ + 0x30, /* 00110000 */ + 0x08, /* 00001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 52 0x34 4 */ + 0x08, /* 00001000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x28, /* 00101000 */ + 0x28, /* 00101000 */ + 0x78, /* 01111000 */ + 0x08, /* 00001000 */ + 0x00, /* 00000000 */ + + /* 53 0x35 5 */ + 0x78, /* 01111000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x70, /* 01110000 */ + 0x08, /* 00001000 */ + 0x08, /* 00001000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + + /* 54 0x36 6 */ + 0x30, /* 00110000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x70, /* 01110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 55 0x37 7 */ + 0x78, /* 01111000 */ + 0x08, /* 00001000 */ + 0x08, /* 00001000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + + /* 56 0x38 8 */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 57 0x39 9 */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x38, /* 00111000 */ + 0x08, /* 00001000 */ + 0x08, /* 00001000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 58 0x3a : */ + 0x00, /* 00000000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + + /* 59 0x3b ; */ + 0x00, /* 00000000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + + /* 60 0x3c < */ + 0x08, /* 00001000 */ + 0x10, /* 00010000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x20, /* 00100000 */ + 0x10, /* 00010000 */ + 0x08, /* 00001000 */ + 0x00, /* 00000000 */ + + /* 61 0x3d = */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xf8, /* 11111000 */ + 0x00, /* 00000000 */ + 0xf8, /* 11111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 62 0x3e > */ + 0x40, /* 01000000 */ + 0x20, /* 00100000 */ + 0x10, /* 00010000 */ + 0x08, /* 00001000 */ + 0x10, /* 00010000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 63 0x3f ? */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x08, /* 00001000 */ + 0x10, /* 00010000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + + /* 64 0x40 @ */ + 0x00, /* 00000000 */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x58, /* 01011000 */ + 0x58, /* 01011000 */ + 0x40, /* 01000000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 65 0x41 A */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x78, /* 01111000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + + /* 66 0x42 B */ + 0x70, /* 01110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x70, /* 01110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + + /* 67 0x43 C */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 68 0x44 D */ + 0x70, /* 01110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + + /* 69 0x45 E */ + 0x78, /* 01111000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x70, /* 01110000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x78, /* 01111000 */ + 0x00, /* 00000000 */ + + /* 70 0x46 F */ + 0x78, /* 01111000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x70, /* 01110000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 71 0x47 G */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x40, /* 01000000 */ + 0x58, /* 01011000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + + /* 72 0x48 H */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x78, /* 01111000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + + /* 73 0x49 I */ + 0x70, /* 01110000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + + /* 74 0x4a J */ + 0x18, /* 00011000 */ + 0x08, /* 00001000 */ + 0x08, /* 00001000 */ + 0x08, /* 00001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 75 0x4b K */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x50, /* 01010000 */ + 0x60, /* 01100000 */ + 0x50, /* 01010000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + + /* 76 0x4c L */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x78, /* 01111000 */ + 0x00, /* 00000000 */ + + /* 77 0x4d M */ + 0x48, /* 01001000 */ + 0x78, /* 01111000 */ + 0x78, /* 01111000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + + /* 78 0x4e N */ + 0x48, /* 01001000 */ + 0x68, /* 01101000 */ + 0x68, /* 01101000 */ + 0x58, /* 01011000 */ + 0x58, /* 01011000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + + /* 79 0x4f O */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 80 0x50 P */ + 0x70, /* 01110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x70, /* 01110000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 81 0x51 Q */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + + /* 82 0x52 R */ + 0x70, /* 01110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x70, /* 01110000 */ + 0x50, /* 01010000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + + /* 83 0x53 S */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x40, /* 01000000 */ + 0x30, /* 00110000 */ + 0x08, /* 00001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 84 0x54 T */ + 0xf8, /* 11111000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + + /* 85 0x55 U */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 86 0x56 V */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 87 0x57 W */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x78, /* 01111000 */ + 0x78, /* 01111000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + + /* 88 0x58 X */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + + /* 89 0x59 Y */ + 0x88, /* 10001000 */ + 0x88, /* 10001000 */ + 0x50, /* 01010000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + + /* 90 0x5a Z */ + 0x78, /* 01111000 */ + 0x08, /* 00001000 */ + 0x10, /* 00010000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x78, /* 01111000 */ + 0x00, /* 00000000 */ + + /* 91 0x5b [ */ + 0x38, /* 00111000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + + /* 92 0x5c \ */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x08, /* 00001000 */ + 0x08, /* 00001000 */ + + /* 93 0x5d ] */ + 0x70, /* 01110000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + + /* 94 0x5e ^ */ + 0x20, /* 00100000 */ + 0x50, /* 01010000 */ + 0x88, /* 10001000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 95 0x5f _ */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xf8, /* 11111000 */ + + /* 96 0x60 ` */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x10, /* 00010000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 97 0x61 a */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00111000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x58, /* 01011000 */ + 0x28, /* 00101000 */ + 0x00, /* 00000000 */ + + /* 98 0x62 b */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x70, /* 01110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + + /* 99 0x63 c */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00111000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + + /* 100 0x64 d */ + 0x08, /* 00001000 */ + 0x08, /* 00001000 */ + 0x38, /* 00111000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + + /* 101 0x65 e */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x78, /* 01111000 */ + 0x40, /* 01000000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 102 0x66 f */ + 0x18, /* 00011000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x70, /* 01110000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + + /* 103 0x67 g */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00111000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x38, /* 00111000 */ + 0x08, /* 00001000 */ + 0x30, /* 00110000 */ + + /* 104 0x68 h */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x70, /* 01110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + + /* 105 0x69 i */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + 0x60, /* 01100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + + /* 106 0x6a j */ + 0x10, /* 00010000 */ + 0x00, /* 00000000 */ + 0x30, /* 00110000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x60, /* 01100000 */ + + /* 107 0x6b k */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x48, /* 01001000 */ + 0x50, /* 01010000 */ + 0x60, /* 01100000 */ + 0x50, /* 01010000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + + /* 108 0x6c l */ + 0x60, /* 01100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + + /* 109 0x6d m */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xd0, /* 11010000 */ + 0xa8, /* 10101000 */ + 0xa8, /* 10101000 */ + 0xa8, /* 10101000 */ + 0x88, /* 10001000 */ + 0x00, /* 00000000 */ + + /* 110 0x6e n */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x70, /* 01110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + + /* 111 0x6f o */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 112 0x70 p */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x70, /* 01110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x70, /* 01110000 */ + 0x40, /* 01000000 */ + + /* 113 0x71 q */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00111000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x38, /* 00111000 */ + 0x08, /* 00001000 */ + + /* 114 0x72 r */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x58, /* 01011000 */ + 0x60, /* 01100000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 115 0x73 s */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00111000 */ + 0x40, /* 01000000 */ + 0x30, /* 00110000 */ + 0x08, /* 00001000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + + /* 116 0x74 t */ + 0x00, /* 00000000 */ + 0x20, /* 00100000 */ + 0x78, /* 01111000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* 117 0x75 u */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + + /* 118 0x76 v */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* 119 0x77 w */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x88, /* 10001000 */ + 0xa8, /* 10101000 */ + 0xa8, /* 10101000 */ + 0xa8, /* 10101000 */ + 0x50, /* 01010000 */ + 0x00, /* 00000000 */ + + /* 120 0x78 x */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x30, /* 00110000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x00, /* 00000000 */ + + /* 121 0x79 y */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x48, /* 01001000 */ + 0x38, /* 00111000 */ + 0x08, /* 00001000 */ + 0x30, /* 00110000 */ + + /* 122 0x7a z */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x78, /* 01111000 */ + 0x10, /* 00010000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x78, /* 01111000 */ + 0x00, /* 00000000 */ + + /* 123 0x7b { */ + 0x08, /* 00001000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x20, /* 00100000 */ + 0x10, /* 00010000 */ + 0x10, /* 00010000 */ + 0x08, /* 00001000 */ + 0x00, /* 00000000 */ + + /* 124 0x7c | */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x00, /* 00000000 */ + + /* 125 0x7d } */ + 0x40, /* 01000000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x10, /* 00010000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x40, /* 01000000 */ + 0x00, /* 00000000 */ + + /* 126 0x7e ~ */ + 0x28, /* 00101000 */ + 0x50, /* 01010000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* 127 0x7f C177 */ + 0x00, /* 00000000 */ + 0x20, /* 00100000 */ + 0x20, /* 00100000 */ + 0x50, /* 01010000 */ + 0x50, /* 01010000 */ + 0x88, /* 10001000 */ + 0xf8, /* 11111000 */ + 0x00, /* 00000000 */ +}; + +struct font_desc font_clean_5x8 = { + CLEAN5x8_IDX, + "Clean5x8", + 5, + 8, + fontdata_clean_5x8, + 3 +}; diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/video/console/fonts.c linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/console/fonts.c --- linux-2.6.9-rc1-bk12/drivers/video/console/fonts.c 2004-07-19 03:33:39.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/console/fonts.c 2004-09-06 02:44:05.000000000 +0200 @@ -56,6 +56,14 @@ static struct font_desc *fonts[] = { #undef NO_FONTS &font_mini_4x6, #endif +#ifdef CONFIG_FONT_CLEAN_4x6 +#undef NO_FONTS + &font_clean_4x6, +#endif +#ifdef CONFIG_FONT_CLEAN_5x8 +#undef NO_FONTS + &font_clean_5x8, +#endif }; #define num_fonts (sizeof(fonts)/sizeof(*fonts)) diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/video/console/Kconfig linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/console/Kconfig --- linux-2.6.9-rc1-bk12/drivers/video/console/Kconfig 2004-09-06 02:19:55.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/console/Kconfig 2004-09-06 02:44:05.000000000 +0200 @@ -170,6 +170,20 @@ config FONT_ACORN_8x8 config FONT_MINI_4x6 bool "Mini 4x6 font" depends on !SPARC32 && !SPARC64 && FONTS + help + Mini console font for tiny displays + +config FONT_CLEAN_4x6 + bool "Clean 4x6 font" + depends on !SPARC32 && !SPARC64 && FONTS + help + Mini console font for tiny displays + +config FONT_CLEAN_5x8 + bool "Clean 5x8 font" + depends on !SPARC32 && !SPARC64 && FONTS + help + Small console font for small displays config FONT_SUN8x16 bool "Sparc console 8x16 font" diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/video/console/Makefile linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/console/Makefile --- linux-2.6.9-rc1-bk12/drivers/video/console/Makefile 2004-07-19 03:33:39.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/console/Makefile 2004-09-06 02:44:05.000000000 +0200 @@ -13,6 +13,8 @@ font-objs-$(CONFIG_FONT_6x11) += fo font-objs-$(CONFIG_FONT_PEARL_8x8) += font_pearl_8x8.o font-objs-$(CONFIG_FONT_ACORN_8x8) += font_acorn_8x8.o font-objs-$(CONFIG_FONT_MINI_4x6) += font_mini_4x6.o +font-objs-$(CONFIG_FONT_CLEAN_4x6) += font_clean_4x6.o +font-objs-$(CONFIG_FONT_CLEAN_5x8) += font_clean_5x8.o font-objs += $(font-objs-y) diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/video/fbmem.c linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/fbmem.c --- linux-2.6.9-rc1-bk12/drivers/video/fbmem.c 2004-09-06 02:19:55.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/fbmem.c 2004-09-06 02:44:05.000000000 +0200 @@ -117,6 +117,8 @@ extern int g364fb_init(void); extern int sa1100fb_init(void); extern int pxafb_init(void); extern int pxafb_setup(char*); +extern int h1940fb_init(void); +extern int h1940fb_setup(char*); extern int fm2fb_init(void); extern int fm2fb_setup(char*); extern int q40fb_init(void); @@ -357,6 +359,9 @@ static struct { #ifdef CONFIG_FB_PXA { "pxafb", pxafb_init, pxafb_setup }, #endif +#ifdef CONFIG_FB_H1940 + { "h1940fb", h1940fb_init, h1940fb_setup }, +#endif #ifdef CONFIG_FB_SUN3 { "sun3fb", sun3fb_init, sun3fb_setup }, #endif diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/video/h1940fb.c linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/h1940fb.c --- linux-2.6.9-rc1-bk12/drivers/video/h1940fb.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/h1940fb.c 2004-09-06 02:44:05.000000000 +0200 @@ -0,0 +1,473 @@ +/* + * linux/drivers/h1940fb.c + * Copyright (c) Arnaud Patard + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive for + * more details. + * + * iPAQ h1940/S3C2410 LCD Controller Frame Buffer Driver + * based on skeletonfb.c, sa1100fb.c + * + * ChangeLog + * + * 2004-09-05: Herbert Pötzl + * - added clock (de-)allocation code + * - added fixem fbmem option + * + * 2004-07-27: Arnaud Patard + * - code cleanup + * - added a forgotten return in h1940fb_init + * + * 2004-07-19: Herbert Pötzl + * - code cleanup and extended debugging + * + * 2004-07-15: Arnaud Patard + * - First version + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "h1940fb.h" + + +extern void *dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t *handle, int gfp); + +static struct h1940fb_info info; + + +#if 1 +#define dprintk(msg...) printk(KERN_INFO "h1940fb: " msg) +#else +#define dprintk(msg...) while (0) { } +#endif + +/* + * h1940fb_check_var(): + * Get the video params out of 'var'. If a value doesn't fit, round it up, + * if it's too big, return -EINVAL. + * + * Round up in the following order: bits_per_pixel, xres, + * yres, xres_virtual, yres_virtual, xoffset, yoffset, grayscale, + * bitfields, horizontal timing, vertical timing. + */ +static int h1940fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) +{ + dprintk("check_var(var=%p, info=%p)\n", var, info); + + var->red.offset=11; + var->green.offset=5; + var->blue.offset=0; + var->red.length=5; + var->green.length=6; + var->blue.length=5; + + return 0; +} + +/** + * h1940fb_set_par - Optional function. Alters the hardware state. + * @info: frame buffer structure that represents a single frame buffer + * + */ +static int h1940fb_set_par(struct fb_info *info) +{ + struct h1940fb_info *fbi = (struct h1940fb_info *)info; + + dprintk("set_par(info=%p)\n", info); + + /* We support only 16BPP true color */ + fbi->fb.fix.visual = FB_VISUAL_TRUECOLOR; + fbi->fb.fix.line_length = 240*16/8; + return 0; +} + + +static int h1940fb_setcolreg(unsigned regno, + unsigned red, unsigned green, unsigned blue, + unsigned transp, struct fb_info *info) +{ + struct h1940fb_info *fbi = (struct h1940fb_info *)info; + int bpp, m = 0; + +/* dprintk("setcolreg(reg=%d, RGBA=%d,%d,%d,%d info=%p)\n", + regno, red, green, blue, transp, info); +*/ + bpp = fbi->fb.var.bits_per_pixel; + m = 1 << bpp; + if (regno >= m) { + return -EINVAL; + } + + switch (bpp) { + case 16: + /* RGB 565 */ + fbi->pseudo_pal[regno] = ((red & 0xF800) + | ((green & 0xFC00) >> 5) + | ((blue & 0xF800) >> 11)); + break; + } + + return 0; +} + + +/** + * h1940fb_pan_display - NOT a required function. Pans the display. + * @var: frame buffer variable screen structure + * @info: frame buffer structure that represents a single frame buffer + * + * Pan (or wrap, depending on the `vmode' field) the display using the + * `xoffset' and `yoffset' fields of the `var' structure. + * If the values don't fit, return -EINVAL. + * + * Returns negative errno on error, or zero on success. + */ +static int h1940fb_pan_display(struct fb_var_screeninfo *var, + struct fb_info *info) +{ + dprintk("pan_display(var=%p, info=%p)\n", var, info); + return 0; +} + +/** + * xxxfb_blank - NOT a required function. Blanks the display. + * @blank_mode: the blank mode we want. + * @info: frame buffer structure that represents a single frame buffer + * + * Blank the screen if blank_mode != 0, else unblank. Return 0 if + * blanking succeeded, != 0 if un-/blanking failed due to e.g. a + * video mode which doesn't support it. Implements VESA suspend + * and powerdown modes on hardware that supports disabling hsync/vsync: + * blank_mode == 2: suspend vsync + * blank_mode == 3: suspend hsync + * blank_mode == 4: powerdown + * + * Returns negative errno on error, or zero on success. + * + */ +static int h1940fb_blank(int blank_mode, struct fb_info *info) +{ + dprintk("blank(mode=%d, info=%p)\n", blank_mode, info); + return 0; +} + + +static struct fb_ops h1940fb_ops = { + .owner = THIS_MODULE, + .fb_check_var = h1940fb_check_var, + .fb_set_par = h1940fb_set_par, + .fb_blank = h1940fb_blank, + .fb_pan_display = h1940fb_pan_display, + .fb_setcolreg = h1940fb_setcolreg, + .fb_fillrect = cfb_fillrect, + .fb_copyarea = cfb_copyarea, + .fb_imageblit = cfb_imageblit, + .fb_cursor = soft_cursor, +}; + + +/* Fake monspecs to fill in fbinfo structure */ +/* Don't know if the values are important */ +static struct fb_monspecs monspecs __initdata = { + .hfmin = 30000, + .hfmax = 70000, + .vfmin = 50, + .vfmax = 65, +}; + +/* + * h1940fb_map_video_memory(): + * Allocates the DRAM memory for the frame buffer. This buffer is + * remapped into a non-cached, non-buffered, memory region to + * allow palette and pixel writes to occur without flushing the + * cache. Once this area is remapped, all virtual memory + * access to the video memory should occur at the new region. + */ +static int __init h1940fb_map_video_memory(struct h1940fb_info *fbi) +{ + dprintk("map_video_memory(fbi=%p)\n", fbi); + +#ifdef CONFIG_FB_H1940_FIXED + fbi->map_cpu = (void *)S3C2410_VA_FBMEM; + fbi->map_dma = S3C2410_PA_FBMEM; +#else + fbi->map_size = PAGE_ALIGN(fbi->fb.fix.smem_len + PAGE_SIZE); + fbi->map_cpu = dma_alloc_writecombine(fbi->dev, fbi->map_size, + &fbi->map_dma, GFP_KERNEL); +#endif + fbi->map_size = fbi->fb.fix.smem_len; + + if (fbi->map_cpu) { + /* prevent initial garbage on screen */ + + dprintk("map_video_memory: clear %p:%08x\n", + fbi->map_cpu, fbi->map_size); + memset(fbi->map_cpu, 0xf0, fbi->map_size); + +#ifdef CONFIG_FB_H1940_FIXED + fbi->screen_dma = fbi->map_dma; + fbi->fb.screen_base = fbi->map_cpu; +#else + fbi->fb.screen_base = fbi->map_cpu + PAGE_SIZE; + fbi->screen_dma = fbi->map_dma + PAGE_SIZE; +#endif + fbi->fb.fix.smem_start = fbi->screen_dma; + + dprintk("map_video_memory: dma=%08x cpu=%p size=%08x\n", + fbi->map_dma, fbi->map_cpu, fbi->fb.fix.smem_len); + } + + return fbi->map_cpu ? 0 : -ENOMEM; +} + + +int __devinit h1940fb_init_registers(struct h1940fb_info *fbi) +{ + unsigned long saddr1, saddr2, saddr3; + + /* Initialise LCD with values from haret */ +/* __raw_writel( S3C2410_LCDCON1_TFT16BPP | \ + S3C2410_LCDCON1_TFT | \ + S3C2410_LCDCON1_CLKVAL(0x0C), \ + S3C2410_LCDCON1); + + __raw_writel( S3C2410_LCDCON2_VBPD(7) | \ + S3C2410_LCDCON2_LINEVAL(319) | \ + S3C2410_LCDCON2_VFPD(6) | \ + S3C2410_LCDCON2_VSPW(0), \ + S3C2410_LCDCON2); + __raw_writel( S3C2410_LCDCON3_HBPD(38) | \ + S3C2410_LCDCON3_HOZVAL(239) | \ + S3C2410_LCDCON3_HFPD(7), \ + S3C2410_LCDCON3); + + __raw_writel( S3C2410_LCDCON4_MVAL(0) | \ + S3C2410_LCDCON4_HSPW(3), \ + S3C2410_LCDCON4); + + __raw_writel( S3C2410_LCDCON5_FRM565 | \ + S3C2410_LCDCON5_INVVLINE | \ + S3C2410_LCDCON5_HWSWP, \ + S3C2410_LCDCON5);*/ + + __raw_writel(0x035c0c78, S3C2410_LCDCON1); + __raw_writel(0x074fc180, S3C2410_LCDCON2); + __raw_writel(0x0098ef07, S3C2410_LCDCON3); + __raw_writel(0x00000003, S3C2410_LCDCON4); + __raw_writel(0x00014a01, S3C2410_LCDCON5); + + saddr1 = S3C2410_LCDBANK(fbi->fb.fix.smem_start >> 22) + | S3C2410_LCDBASEU(fbi->fb.fix.smem_start >> 1); + saddr2 = (fbi->fb.fix.smem_start+(320*240*2)) >> 1; + saddr3 = S3C2410_OFFSIZE(0) | S3C2410_PAGEWIDTH(240); + + + dprintk("LCDSADDR1 = 0x%08lx\n", saddr1); + __raw_writel(saddr1, S3C2410_LCDSADDR1); + + dprintk("LCDSADDR2 = 0x%08lx\n", saddr2); + __raw_writel(saddr2, S3C2410_LCDSADDR2); + + dprintk("LCDSADDR3 = 0x%08lx\n", saddr3); + __raw_writel(saddr3, S3C2410_LCDSADDR3); + + __raw_writel(0x00000002, S3C2410_LPCSEL); + + /* Enable video by setting the ENVID bit to 1 */ +/* __raw_writel( S3C2410_LCDCON1_ENVID | \ + S3C2410_LCDCON1_TFT16BPP | \ + S3C2410_LCDCON1_TFT | \ + S3C2410_LCDCON1_CLKVAL(0x0C), \ + S3C2410_LCDCON1);*/ + + /* probably not required */ + msleep(10); + + __raw_writel(0x035c0c79, S3C2410_LCDCON1); + + return 0; +} + +static struct clk *lcd_clock; + +int __devinit h1940fb_init(void) +{ + char driver_name[]="h1940fb"; + int ret; + +#ifdef CONFIG_FB_H1940_FIXED + +#if 0 + static struct resource fb_resource __initdata = { + .name = "Video Memory", + .start = H1940_PA_FBMEM, + .end = H1940_PA_FBMEM + H1940_SZ_FBMEM, + .flags = IORESOURCE_MEM, + }; + static struct map_desc fb_iotable[] __initdata = { + [0] = { + .physical = H1940_PA_FBMEM, + .virtual = H1940_VA_FBMEM, + .length = H1940_SZ_FBMEM, + .type = MT_MEMORY, + }, + }; + + dprintk("insert resource\n"); + insert_resource(&iomem_resource, &fb_resource); + + dprintk("create mapping\n"); + iotable_init(fb_iotable, ARRAY_SIZE(fb_iotable)); + +#else + if (!request_mem_region(S3C2410_PA_FBMEM, + S3C2410_SZ_FBMEM, "Video Memory")) + return -EBUSY; +#endif + +#endif + dprintk("devinit\n"); + + strcpy(info.fb.fix.id, driver_name); + + info.fb.fix.type = FB_TYPE_PACKED_PIXELS; + info.fb.fix.type_aux = 0; + info.fb.fix.xpanstep = 0; + info.fb.fix.ypanstep = 0; + info.fb.fix.ywrapstep = 0; + info.fb.fix.accel = FB_ACCEL_NONE; + + info.fb.var.nonstd = 0; + info.fb.var.activate = FB_ACTIVATE_NOW; + info.fb.var.height = 320; + info.fb.var.width = 240; + info.fb.var.accel_flags = 0; + info.fb.var.vmode = FB_VMODE_NONINTERLACED; + + info.fb.fbops = &h1940fb_ops; + info.fb.flags = FBINFO_FLAG_DEFAULT; + info.fb.monspecs = monspecs; + info.fb.currcon = -1; + info.fb.pseudo_palette = &info.pseudo_pal; + + + info.fb.var.xres = 240; + info.fb.var.xres_virtual = 240; + info.fb.var.yres = 320; + info.fb.var.yres_virtual = 320; + info.fb.var.bits_per_pixel = 16; + + + info.fb.var.red.offset = 11; + info.fb.var.green.offset = 5; + info.fb.var.blue.offset = 0; + info.fb.var.transp.offset = 0; + info.fb.var.red.length = 5; + info.fb.var.green.length = 6; + info.fb.var.blue.length = 5; + info.fb.var.transp.length = 0; + + info.fb.fix.smem_len = info.fb.var.xres * info.fb.var.yres * + info.fb.var.bits_per_pixel / 8; + + if (!request_mem_region(S3C2410_VA_LCD, SZ_1M, "LCD")) + return -EBUSY; + dprintk("got LCD region\n"); + + lcd_clock = clk_get(NULL, "lcd"); + if (!lcd_clock) { + printk(KERN_INFO "failed to get lcd clock source\n"); + return -ENOENT; + } + clk_use(lcd_clock); + clk_enable(lcd_clock); + dprintk("got and enabled clock\n"); + + /* maybe not required */ + msleep(10); + + + /* Initialize video memory */ + ret = h1940fb_map_video_memory(&info); + if (ret) { + printk("Failed to allocate video RAM: %d\n", ret); + ret = -ENOMEM; + goto failed; + } + dprintk("got video memory\n"); + + ret = h1940fb_init_registers(&info); + + ret = h1940fb_check_var(&info.fb.var, &info.fb); + + ret = register_framebuffer(&info.fb); + if (ret < 0) { + printk("Failed to register framebuffer device: %d\n", ret); + goto failed; + } + + + printk(KERN_INFO "fb%d: %s frame buffer device\n", + info.fb.node, info.fb.fix.id); + + return 0; +failed: + release_mem_region(S3C2410_VA_LCD, S3C2410_SZ_LCD); +#ifdef CONFIG_FB_H1940_FIXED + release_mem_region(S3C2410_VA_FBMEM, S3C2410_SZ_FBMEM); +#endif + return ret; +} + + /* + * Cleanup + */ + +static void __exit h1940fb_cleanup(void) +{ + if (lcd_clock) { + clk_disable(lcd_clock); + clk_unuse(lcd_clock); + clk_put(lcd_clock); + lcd_clock = NULL; + } + + unregister_framebuffer(&info.fb); + release_mem_region(S3C2410_VA_LCD, S3C2410_SZ_LCD); +#ifdef CONFIG_FB_H1940_FIXED + release_mem_region(S3C2410_VA_FBMEM, S3C2410_SZ_FBMEM); +#endif +} + +#ifndef MODULE + +int __devinit h1940fb_setup(char *options) +{ + dprintk("setup(%s)\n", options); + return 0; +} + +#else + +module_init(h1940fb_init); +module_exit(h1940fb_cleanup); + +#endif + +MODULE_AUTHOR("Arnaud Patard "); +MODULE_DESCRIPTION("Framebuffer driver for the iPAQ h1940"); +MODULE_LICENSE("GPL"); diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/video/h1940fb.h linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/h1940fb.h --- linux-2.6.9-rc1-bk12/drivers/video/h1940fb.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/h1940fb.h 2004-09-06 02:44:05.000000000 +0200 @@ -0,0 +1,65 @@ +/* + * linux/drivers/h1940fb.h + * Copyright (c) Arnaud Patard + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive for + * more details. + * + * iPAQ h1940/S3C2410 LCD Controller Frame Buffer Driver + * based on skeletonfb.c, sa1100fb.h + * + * ChangeLog + * + * 2004-07-15: Arnaud Patard + * - First version + */ + + + /* Shadows for LCD controller registers */ + +struct sa1100fb_lcd_reg { + unsigned long lcdcon1; + unsigned long lcdcon2; + unsigned long lcdcon3; + unsigned long lcdcon4; + unsigned long lcdcon5; + unsigned long lcdsaddr1; + unsigned long lcdsaddr2; + unsigned long lcdsaddr3; + unsigned long lpc_en; +}; + +struct h1940fb_info { + struct fb_info fb; + struct device *dev; + + /* raw memory addresses */ + dma_addr_t map_dma; /* physical */ + u_char * map_cpu; /* virtual */ + u_int map_size; + + /* addresses of pieces placed in raw buffer */ + u_char * screen_cpu; /* virtual address of frame buffer */ + dma_addr_t screen_dma; /* physical address of frame buffer */ + +#ifdef CONFIG_LCD_DEVICE +/* struct lcd_device *lm; + struct backlight_device *bm;*/ +#endif + u_int reg_lcdcon1; + u_int reg_lcdcon2; + u_int reg_lcdcon3; + u_int reg_lcdcon4; + u_int reg_lcdcon5; + + u_int reg_lcdsaddr1; + u_int reg_lcdsaddr2; + u_int reg_lcdsaddr3; + u_int reg_lpc_en; + + u32 pseudo_pal[16]; +}; + +int h1940fb_init(void); + diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/video/Kconfig linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/Kconfig --- linux-2.6.9-rc1-bk12/drivers/video/Kconfig 2004-08-30 19:38:37.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/Kconfig 2004-09-06 02:44:05.000000000 +0200 @@ -986,6 +986,27 @@ config FB_PXA_PARAMETERS Documentation/fb/pxafb.txt describes the available parameters. +config FB_H1940 + tristate "H1940 LCD framebuffer support" + depends on FB && ARCH_S3C2410 + ---help--- + Frame buffer driver for the built-in LCD controller in the Samsung + S3C2410 processor. + + This driver is also available as a module ( = code which can be + inserted and removed from the running kernel whenever you want). The + module will be called h1940fb. If you want to compile it as a module, + say M here and read . + + If unsure, say N. + +config FB_H1940_FIXED + bool "Fixed Location for the Framebuffer" + depends on FB_H1940 && EXPERIMENTAL + default y + ---help--- + Put the Framebuffer in a fixed location. + config FB_VIRTUAL tristate "Virtual Frame Buffer support (ONLY FOR TESTING!)" depends on FB diff -NurpP --minimal linux-2.6.9-rc1-bk12/drivers/video/Makefile linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/Makefile --- linux-2.6.9-rc1-bk12/drivers/video/Makefile 2004-09-06 02:19:55.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/drivers/video/Makefile 2004-09-06 02:44:05.000000000 +0200 @@ -94,3 +94,4 @@ obj-$(CONFIG_FB_TCX) += tc obj-$(CONFIG_FB_LEO) += leo.o sbuslib.o cfbimgblt.o cfbcopyarea.o \ cfbfillrect.o obj-$(CONFIG_FB_PXA) += pxafb.o cfbimgblt.o cfbcopyarea.o cfbfillrect.o +obj-$(CONFIG_FB_H1940) += h1940fb.o cfbimgblt.o cfbcopyarea.o cfbfillrect.o diff -NurpP --minimal linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/map.h linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/map.h --- linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/map.h 2004-08-02 00:05:25.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/map.h 2004-09-06 02:44:05.000000000 +0200 @@ -124,6 +124,11 @@ #define S3C2410_PA_SDI (0x5A000000) #define S3C2410_SZ_SDI SZ_1M +/* FBMEM */ +#define S3C2410_VA_FBMEM (0xE0000000) +#define S3C2410_PA_FBMEM (0x33F00000) +#define S3C2410_SZ_FBMEM SZ_1M + /* ISA style IO, for each machine to sort out mappings for, if it * implements it. We reserve two 16M regions for ISA. */ diff -NurpP --minimal linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/regs-adc.h linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/regs-adc.h --- linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/regs-adc.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/regs-adc.h 2004-09-06 02:44:05.000000000 +0200 @@ -0,0 +1,36 @@ +#ifndef __ASM_ARCH_REGS_ADC_H +#define __ASM_ARCH_REGS_ADC_H + +#define S3C2410_ADCREG(x) ((x) + S3C2410_VA_ADC) + +#define S3C2410_ADCCON S3C2410_ADCREG(0x00) +#define S3C2410_ECFLG (1<<15) +#define S3C2410_PRSCEN (1<<14) +#define S3C2410_PRSCVL(x) ((x)<<6) +#define S3C2410_SEL_MUX(x) ((x)<<3) +#define S3C2410_STDBM (1<<2) +#define S3C2410_READ_START (1<<1) +#define S3C2410_ENABLE_START (1<<0) + +#define S3C2410_ADCTSC S3C2410_ADCREG(0x04) +#define S3C2410_YM_SEN (1<<7) +#define S3C2410_YP_SEN (1<<6) +#define S3C2410_XM_SEN (1<<5) +#define S3C2410_XP_SEN (1<<4) +#define S3C2410_PULL_UP (1<<3) +#define S3C2410_AUTO_PST (1<<2) +#define S3C2410_XY_PST(x) (x) + +#define S3C2410_ADCDLY S3C2410_ADCREG(0x08) +#define S3C2410_DELAY(x) (x) + +#define S3C2410_ADCDAT0 S3C2410_ADCREG(0x0C) +#define S3C2410_ADCDAT1 S3C2410_ADCREG(0x10) +#define S3C2410_DAT_UPDOWN (1<<15) +#define S3C2410_DAT_AUTO_PST (1<<14) +#define S3C2410_DAT_XY_PST(x) ((x)<<12) + + +#endif + + diff -NurpP --minimal linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/regs-lcd.h linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/regs-lcd.h --- linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/regs-lcd.h 2004-07-16 03:11:55.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/regs-lcd.h 2004-09-06 02:44:05.000000000 +0200 @@ -29,7 +29,7 @@ #define S3C2410_LCDCON5 S3C2410_LCDREG(0x10) #define S3C2410_LCDCON1_CLKVAL(x) ((x) << 8) -#define S3C2410_LCDCON1_MMODE (1<<6) +#define S3C2410_LCDCON1_MMODE (1<<7) #define S3C2410_LCDCON1_DSCAN4 (0<<5) #define S3C2410_LCDCON1_STN4 (1<<5) #define S3C2410_LCDCON1_STN8 (2<<5) @@ -48,15 +48,15 @@ #define S3C2410_LCDCON1_TFT16BPP (12<<1) #define S3C2410_LCDCON1_TFT24BPP (13<<1) -#define S3C2410_LCDCON1_ENVDI (1) +#define S3C2410_LCDCON1_ENVID (1) #define S3C2410_LCDCON2_VBPD(x) ((x) << 24) #define S3C2410_LCDCON2_LINEVAL(x) ((x) << 14) #define S3C2410_LCDCON2_VFPD(x) ((x) << 6) #define S3C2410_LCDCON2_VSPW(x) ((x) << 0) -#define S3C2410_LCDCON3_HBPD(x) ((x) << 25) -#define S3C2410_LCDCON3_WDLY(x) ((x) << 25) +#define S3C2410_LCDCON3_HBPD(x) ((x) << 19) +#define S3C2410_LCDCON3_WDLY(x) ((x) << 19) #define S3C2410_LCDCON3_HOZVAL(x) ((x) << 8) #define S3C2410_LCDCON3_HFPD(x) ((x) << 0) #define S3C2410_LCDCON3_LINEBLANK(x)((x) << 0) @@ -84,6 +84,12 @@ #define S3C2410_LCDSADDR2 S3C2410_LCDREG(0x18) #define S3C2410_LCDSADDR3 S3C2410_LCDREG(0x1C) +#define S3C2410_LCDBANK(x) ((x) << 21) +#define S3C2410_LCDBASEU(x) (x) + +#define S3C2410_OFFSIZE(x) ((x) << 11) +#define S3C2410_PAGEWIDTH(x) (x) + /* colour lookup and miscellaneous controls */ #define S3C2410_REDLUT S3C2410_LCDREG(0x20) diff -NurpP --minimal linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/regs-nand.h linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/regs-nand.h --- linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/regs-nand.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/regs-nand.h 2004-09-06 02:44:05.000000000 +0200 @@ -0,0 +1,43 @@ +/* linux/include/asm-arm/arch-s3c2410/regs-nand.h + * + * Copyright (c) 2004 Simtec Electronics + * http://www.simtec.co.uk/products/SWLINUX/ + * + * 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. + * + * S3C2410 clock register definitions + * + * Changelog: + * 18-Aug-2004 BJD Copied file from 2.4 and updated +*/ + +#ifndef __ASM_ARM_REGS_NAND +#define __ASM_ARM_REGS_NAND "$Id: nand.h,v 1.3 2003/12/09 11:36:29 ben Exp $" + + +#define S3C2410_NFREG(x) (x) + +#define S3C2410_NFCONF S3C2410_NFREG(0x00) +#define S3C2410_NFCMD S3C2410_NFREG(0x04) +#define S3C2410_NFADDR S3C2410_NFREG(0x08) +#define S3C2410_NFDATA S3C2410_NFREG(0x0C) +#define S3C2410_NFSTAT S3C2410_NFREG(0x10) +#define S3C2410_NFECC S3C2410_NFREG(0x14) + +#define S3C2410_NFCONF_EN (1<<15) +#define S3C2410_NFCONF_512BYTE (1<<14) +#define S3C2410_NFCONF_4STEP (1<<13) +#define S3C2410_NFCONF_INITECC (1<<12) +#define S3C2410_NFCONF_nFCE (1<<11) +#define S3C2410_NFCONF_TACLS(x) ((x)<<8) +#define S3C2410_NFCONF_TWRPH0(x) ((x)<<4) +#define S3C2410_NFCONF_TWRPH1(x) ((x)<<0) + +#define S3C2410_NFSTAT_BUSY (1<<0) + +/* think ECC can only be 8bit read? */ + +#endif /* __ASM_ARM_REGS_NAND */ + diff -NurpP --minimal linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/regs-rtc.h linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/regs-rtc.h --- linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/regs-rtc.h 2004-08-02 00:05:25.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/regs-rtc.h 2004-09-06 02:44:05.000000000 +0200 @@ -21,6 +21,8 @@ #define S3C2410_RTCCON S3C2410_RTCREG(0x40) #define S3C2410_RTCCON_RTCEN (1<<0) +#define S3C2410_RTCCON_CLKSEL (1<<1) +#define S3C2410_RTCCON_CNTSEL (1<<2) #define S3C2410_RTCCON_CLKRST (1<<3) #define S3C2410_TICNT S3C2410_RTCREG(0x44) diff -NurpP --minimal linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/regs-sdi.h linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/regs-sdi.h --- linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/regs-sdi.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/regs-sdi.h 2004-09-06 02:44:05.000000000 +0200 @@ -0,0 +1,112 @@ +/* linux/include/asm/arch-s3c2410/regs-sdi.h + * + * Copyright (c) 2004 Simtec Electronics + * http://www.simtec.co.uk/products/SWLINUX/ + * + * 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. + * + * S3C2410 MMC/SDIO register definitions + * + * Changelog: + * 18-Aug-2004 Ben Dooks Created initial file +*/ + +#ifndef __ASM_ARM_REGS_SDI +#define __ASM_ARM_REGS_SDI "regs-sdi.h" + +#define S3C2410_SDICON (0x00) +#define S3C2410_SDIPRE (0x04) +#define S3C2410_SDICMDARG (0x08) +#define S3C2410_SDICMDCON (0x0C) +#define S3C2410_SDICMDSTAT (0x10) +#define S3C2410_SDIRSP0 (0x14) +#define S3C2410_SDIRSP1 (0x18) +#define S3C2410_SDIRSP2 (0x1C) +#define S3C2410_SDIRSP3 (0x20) +#define S3C2410_SDITIMER (0x24) +#define S3C2410_SDIBSIZE (0x28) +#define S3C2410_SDIDCON (0x2C) +#define S3C2410_SDIDCNT (0x30) +#define S3C2410_SDIDSTA (0x34) +#define S3C2410_SDIFSTA (0x38) +#define S3C2410_SDIDATA (0x3C) +#define S3C2410_SDIIMSK (0x40) + +#define S3C2410_SDICON_BYTEORDER (1<<4) +#define S3C2410_SDICON_SDIOIRQ (1<<3) +#define S3C2410_SDICON_RWAITEN (1<<2) +#define S3C2410_SDICON_FIFORESET (1<<1) +#define S3C2410_SDICON_CLOCKTYPE (1<<0) + +#define S3C2410_SDICMDCON_ABORT (1<<12) +#define S3C2410_SDICMDCON_WITHDATA (1<<11) +#define S3C2410_SDICMDCON_LONGRSP (1<<10) +#define S3C2410_SDICMDCON_WAITRSP (1<<9) +#define S3C2410_SDICMDCON_CMDSTART (1<<8) +#define S3C2410_SDICMDCON_INDEX (0xff) + +#define S3C2410_SDICMDSTAT_CRCFAIL (1<<12) +#define S3C2410_SDICMDSTAT_CMDSENT (1<<11) +#define S3C2410_SDICMDSTAT_CMDTIMEOUT (1<<10) +#define S3C2410_SDICMDSTAT_RSPFIN (1<<9) +#define S3C2410_SDICMDSTAT_XFERING (1<<8) +#define S3C2410_SDICMDSTAT_INDEX (0xff) + +#define S3C2410_SDIDCON_IRQPERIOD (1<<21) +#define S3C2410_SDIDCON_TXAFTERRESP (1<<20) +#define S3C2410_SDIDCON_RXAFTERCMD (1<<19) +#define S3C2410_SDIDCON_BUSYAFTERCMD (1<<18) +#define S3C2410_SDIDCON_BLOCKMODE (1<<17) +#define S3C2410_SDIDCON_WIDEBUS (1<<16) +#define S3C2410_SDIDCON_DMAEN (1<<15) +#define S3C2410_SDIDCON_STOP (1<<14) + +#define S3C2410_SDIDCON_XFER_MASK (3<<12) +#define S3C2410_SDIDCON_XFER_READY (0<<12) +#define S3C2410_SDIDCON_XFER_CHKSTART (1<<12) +#define S3C2410_SDIDCON_XFER_RXSTART (2<<12) +#define S3C2410_SDIDCON_XFER_TXSTART (3<<12) + +#define S3C2410_SDIDCNT_BLKNUM_SHIFT (12) + +#define S3C2410_SDIDSTA_RDYWAITREQ (1<<10) +#define S3C2410_SDIDSTA_SDIOIRQDETECT (1<<9) +#define S3C2410_SDIDSTA_FIFOFAIL (1<<8) +#define S3C2410_SDIDSTA_CRCFAIL (1<<7) +#define S3C2410_SDIDSTA_RXCRCFAIL (1<<6) +#define S3C2410_SDIDSTA_DATATIMEOUT (1<<5) +#define S3C2410_SDIDSTA_XFERFINISH (1<<4) +#define S3C2410_SDIDSTA_BUSYFINISH (1<<3) +#define S3C2410_SDIDSTA_TXDATAON (1<<1) +#define S3C2410_SDIDSTA_RXDATAON (1<<0) + +#define S3C2410_SDIFSTA_TXFULL (1<<13) +#define S3C2410_SDIFSTA_RXFULL (1<<12) +#define S3C2410_SDIFSTA_TXHALF (1<<11) +#define S3C2410_SDIFSTA_TXEMPTY (1<<10) +#define S3C2410_SDIFSTA_RXLAST (1<<9) +#define S3C2410_SDIFSTA_RXFULL (1<<8) +#define S3C2410_SDIFSTA_RXHALF (1<<7) +#define S3C2410_SDIFSTA_COUNTMASK (0x7f) + +#define S3C2410_SDIIMSK_RESPONSECRC (1<<17) +#define S3C2410_SDIIMSK_CMDSENT (1<<16) +#define S3C2410_SDIIMSK_CMDTIMEOUT (1<<15) +#define S3C2410_SDIIMSK_RESPONSEND (1<<14) +#define S3C2410_SDIIMSK_READWAIT (1<<13) +#define S3C2410_SDIIMSK_SDIOIRQ (1<<12) +#define S3C2410_SDIIMSK_FIFOFAIL (1<<11) +#define S3C2410_SDIIMSK_CRCSTATUS (1<<10) +#define S3C2410_SDIIMSK_DATACRC (1<<9) +#define S3C2410_SDIIMSK_DATATIMEOUT (1<<8) +#define S3C2410_SDIIMSK_DATAFINISH (1<<7) +#define S3C2410_SDIIMSK_BUSYFINISH (1<<6) +#define S3C2410_SDIIMSK_TXFIFOHALF (1<<4) +#define S3C2410_SDIIMSK_TXFIFOEMPTY (1<<3) +#define S3C2410_SDIIMSK_RXFIFOLAST (1<<2) +#define S3C2410_SDIIMSK_RXFIFOFULL (1<<1) +#define S3C2410_SDIIMSK_RXFIFOHALF (1<<0) + +#endif /* __ASM_ARM_REGS_SDI */ diff -NurpP --minimal linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/regs-serial.h linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/regs-serial.h --- linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/regs-serial.h 2004-08-30 19:30:44.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/regs-serial.h 2004-09-06 02:44:05.000000000 +0200 @@ -66,6 +66,7 @@ #define S3C2410_LCON_PMASK (0x7 << 3) #define S3C2410_LCON_STOPB (1<<2) +#define S3C2410_LCON_IRM (1<<6) #define S3C2410_UCON_UCLK (1<<10) #define S3C2410_UCON_SBREAK (1<<4) @@ -97,7 +98,8 @@ #define S3C2410_UFSTAT_RXMASK (15<<0) #define S3C2410_UFSTAT_RXSHIFT (0) -#define S3C2410_UTRSTAT_TXFE (1<<1) +#define S3C2410_UTRSTAT_TXE (1<<2) +#define S3C2410_UTRSTAT_TXBE (1<<1) #define S3C2410_UTRSTAT_RXDR (1<<0) #define S3C2410_UERSTAT_OVERRUN (1<<0) diff -NurpP --minimal linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/regs-watchdog.h linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/regs-watchdog.h --- linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/regs-watchdog.h 2004-08-02 00:05:25.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/regs-watchdog.h 2004-09-06 02:44:05.000000000 +0200 @@ -38,6 +38,7 @@ #define S3C2410_WTCON_DIV128 (3<<3) #define S3C2410_WTCON_PRESCALE(x) ((x) << 8) +#define S3C2410_WTCON_PRESCALE_MASK (0xff00) #endif /* __ASM_ARCH_REGS_WATCHDOG_H */ diff -NurpP --minimal linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/uncompress.h linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/uncompress.h --- linux-2.6.9-rc1-bk12/include/asm-arm/arch-s3c2410/uncompress.h 2004-07-19 03:33:40.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/include/asm-arm/arch-s3c2410/uncompress.h 2004-09-06 02:44:05.000000000 +0200 @@ -92,7 +92,8 @@ putc(char ch) } else { /* not using fifos */ - while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXFE) != S3C2410_UTRSTAT_TXFE); + while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXBE) + != S3C2410_UTRSTAT_TXBE); } /* write byte to transmission register */ diff -NurpP --minimal linux-2.6.9-rc1-bk12/include/linux/font.h linux-2.6.9-rc1-bk12-h1940-0.05.2/include/linux/font.h --- linux-2.6.9-rc1-bk12/include/linux/font.h 2004-07-19 03:33:40.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/include/linux/font.h 2004-09-06 02:44:05.000000000 +0200 @@ -29,15 +29,19 @@ struct font_desc { #define SUN12x22_IDX 5 #define ACORN8x8_IDX 6 #define MINI4x6_IDX 7 +#define CLEAN4x6_IDX 8 +#define CLEAN5x8_IDX 9 extern struct font_desc font_vga_8x8, - font_vga_8x16, - font_pearl_8x8, - font_vga_6x11, - font_sun_8x16, - font_sun_12x22, - font_acorn_8x8, - font_mini_4x6; + font_vga_8x16, + font_pearl_8x8, + font_vga_6x11, + font_sun_8x16, + font_sun_12x22, + font_acorn_8x8, + font_mini_4x6, + font_clean_4x6, + font_clean_5x8; /* Find a font with a specific name */ diff -NurpP --minimal linux-2.6.9-rc1-bk12/kernel/Makefile linux-2.6.9-rc1-bk12-h1940-0.05.2/kernel/Makefile --- linux-2.6.9-rc1-bk12/kernel/Makefile 2004-09-06 02:20:02.000000000 +0200 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/kernel/Makefile 2004-09-06 02:44:05.000000000 +0200 @@ -7,7 +7,7 @@ obj-y = sched.o fork.o exec_domain.o sysctl.o capability.o ptrace.o timer.o user.o \ signal.o sys.o kmod.o workqueue.o pid.o \ rcupdate.o intermodule.o extable.o params.o posix-timers.o \ - kthread.o + kthread.o mhelper.o obj-$(CONFIG_FUTEX) += futex.o obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o diff -NurpP --minimal linux-2.6.9-rc1-bk12/kernel/mhelper.c linux-2.6.9-rc1-bk12-h1940-0.05.2/kernel/mhelper.c --- linux-2.6.9-rc1-bk12/kernel/mhelper.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/kernel/mhelper.c 2004-09-06 02:44:05.000000000 +0200 @@ -0,0 +1,83 @@ + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "mhelper.h" + + + +#define IODESC_ENT(x) { S3C2410_VA_##x, S3C2410_PA_##x, S3C2410_SZ_##x, MT_DEVICE } + +extern struct map_desc s3c2410_iodesc[]; +extern unsigned long s3c2410_iodesc_size; + +static inline unsigned long +map_io_to_va(unsigned long addr) +{ + int index; + + for (index=0; index= phys) & (addr < phys+len)) + break; + } + if (index < s3c2410_iodesc_size) { + unsigned long phys = s3c2410_iodesc[index].physical; + unsigned long virt = s3c2410_iodesc[index].virtual; + + return (addr - phys + virt); + } + return 0; +} + + +extern asmlinkage long +sys_mhelper(uint32_t cmd, uint32_t addr, uint32_t value) +{ + unsigned long vaddr = 0; + + if (!(vaddr = map_io_to_va(addr))) + return -ENXIO; + + switch (cmd) { + + case CMD_READ_B: + value = __raw_readb(vaddr); + printk("0x%08x: 0x%02x (%d)\n", addr, value, value); + break; + case CMD_READ_W: + value = __raw_readw(vaddr); + printk("0x%08x: 0x%04x (%d)\n", addr, value, value); + break; + case CMD_READ_L: + value = __raw_readl(vaddr); + printk("0x%08x: 0x%08x (%d)\n", addr, value, value); + break; + + case CMD_WRITE_B: + __raw_writeb(value, vaddr); + break; + case CMD_WRITE_W: + __raw_writew(value, vaddr); + break; + case CMD_WRITE_L: + __raw_writel(value, vaddr); + break; + + default: + return -EINVAL; + break; + } + + return 0; +} + diff -NurpP --minimal linux-2.6.9-rc1-bk12/kernel/mhelper.h linux-2.6.9-rc1-bk12-h1940-0.05.2/kernel/mhelper.h --- linux-2.6.9-rc1-bk12/kernel/mhelper.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-rc1-bk12-h1940-0.05.2/kernel/mhelper.h 2004-09-06 02:44:05.000000000 +0200 @@ -0,0 +1,22 @@ + +#define CAT_READ 0x10 +#define CAT_WRITE 0x20 + +#define CAT_BYTE 0x01 +#define CAT_WORD 0x02 +#define CAT_LONG 0x03 + + +enum { + CMD_VERSION = 0, + + CMD_READ_B = 0x11, + CMD_READ_W, + CMD_READ_L, + + CMD_WRITE_B = 0x21, + CMD_WRITE_W, + CMD_WRITE_L, + +}; +