Index: linux-2.6.24/arch/arm/mach-s3c2440/Kconfig
===================================================================
--- linux-2.6.24.orig/arch/arm/mach-s3c2440/Kconfig	2008-02-13 10:22:14.000000000 +0100
+++ linux-2.6.24/arch/arm/mach-s3c2440/Kconfig	2008-02-15 19:30:50.000000000 +0100
@@ -67,6 +67,16 @@
 	default y if ARCH_S3C2440
 	select CPU_S3C2440
 
+config MACH_G500
+	bool "Eten G500"
+	select CPU_S3C2440
+	select PM_H1940 if PM
+	help
+	  Say Y here if you are using the Eten G500.
+
+	  See <http://www.pierrox.net/G500> or
+	  <http://www.handhelds.org/moin/moin.cgi/EtenG500Home> for more
+	  information on this project
 
 endmenu
 
Index: linux-2.6.24/arch/arm/mach-s3c2440/Makefile
===================================================================
--- linux-2.6.24.orig/arch/arm/mach-s3c2440/Makefile	2008-02-13 10:22:14.000000000 +0100
+++ linux-2.6.24/arch/arm/mach-s3c2440/Makefile	2008-02-13 10:26:23.000000000 +0100
@@ -21,3 +21,4 @@
 obj-$(CONFIG_MACH_RX3715)	+= mach-rx3715.o
 obj-$(CONFIG_ARCH_S3C2440)	+= mach-smdk2440.o
 obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
+obj-$(CONFIG_MACH_G500)		+= mach-g500.o
Index: linux-2.6.24/arch/arm/mach-s3c2440/mach-g500.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.24/arch/arm/mach-s3c2440/mach-g500.c	2008-02-15 19:31:37.000000000 +0100
@@ -0,0 +1,205 @@
+/* linux/arch/arm/mach-s3c2410/mach-g500.c
+ *
+ * Copyright (c) 2008 Pierre Hebert <pierrox@pierrox.net>
+ * http://www.pierrox.net/G500 or
+ * http://www.handhelds.org/moin/moin.cgi/EtenG500Home
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/list.h>
+#include <linux/timer.h>
+#include <linux/init.h>
+#include <linux/serial_core.h>
+#include <linux/platform_device.h>
+#include <linux/sysdev.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+
+#include <asm/arch/regs-lcd.h>
+#include <asm/arch/regs-irq.h>
+#include <asm/arch/fb.h>
+
+#include <asm/plat-s3c/regs-serial.h>
+#include <asm/plat-s3c/nand.h>
+#include <asm/plat-s3c24xx/clock.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/irq.h>
+#include <asm/plat-s3c24xx/pm.h>
+
+#include <linux/mtd/nand.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/mtd.h>
+
+static struct map_desc g500_iodesc[] __initdata = {
+	/* nothing */
+};
+
+#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 s3c24xx_uart_clksrc g500_serial_clocks[] = {
+	[0] = {
+		.name   = "fclk",
+		.divisor  = 9,
+		.min_baud = 0,
+		.max_baud = 0,
+	},
+};
+
+static struct s3c2410_uartcfg g500_uartcfgs[] = {
+	[0] = {
+		.hwport	     = 0,
+		.flags	     = 0,
+		.ucon	     = 0x9fc5,
+		.ulcon	     = 0x2b,
+		.ufcon	     = 0xc1,
+		.clocks	     = g500_serial_clocks,
+		.clocks_size = ARRAY_SIZE(g500_serial_clocks),
+	},
+	[1] = {
+		.hwport	     = 1,
+		.flags	     = 0,
+		.ucon	     = 0x1c5,
+		.ulcon	     = 0x03,
+		.ufcon	     = 0x31,
+	},
+	[2] = {
+		.hwport	     = 2,
+		.flags	     = 0,
+		.ucon	     = 0x80c5,
+		.ulcon	     = 0x03,
+		.ufcon	     = 0x31,
+	}
+};
+
+/* LCD driver info */
+
+static struct s3c2410fb_display g500_lcd_cfg = {
+	.lcdcon5	= S3C2410_LCDCON5_FRM565 |
+			S3C2410_LCDCON5_INVVCLK |
+			S3C2410_LCDCON5_INVVLINE |
+			S3C2410_LCDCON5_INVVFRAME |
+			S3C2410_LCDCON5_INVVDEN |
+			S3C2410_LCDCON5_PWREN |
+			S3C2410_LCDCON5_HWSWP,
+
+	.type		= S3C2410_LCDCON1_TFT,
+
+	.width		= 240,
+	.height		= 320,
+
+	.pixclock	= 166667, /* HCLK 60 MHz, divisor 10 */
+	.xres		= 240,
+	.yres		= 320,
+	.bpp		= 16,
+
+	.left_margin	= 8,
+	.right_margin	= 5,
+	.hsync_len	= 3,
+	.upper_margin	= 6,
+	.lower_margin	= 7,
+	.vsync_len	= 2,
+};
+
+static struct s3c2410fb_mach_info g500_fb_info = {
+	.displays	= &g500_lcd_cfg,
+	.num_displays	= 1,
+	.default_display = 0,
+
+#if 0
+	/* currently setup by wince, TODO find exact values */
+	.gpccon		= 0xaa940659,
+	.gpccon_mask	= 0xffffffff,
+	.gpcup		= 0x0000ffff,
+	.gpcup_mask	= 0xffffffff,
+	.gpdcon		= 0xaa84aaa0,
+	.gpdcon_mask	= 0xffffffff,
+	.gpdup		= 0x0000faff,
+	.gpdup_mask	= 0xffffffff,
+#endif
+
+	.lpcsel		= 0xCE6,
+};
+
+static struct mtd_partition g500_nand_part[] = {
+	[0] = {
+		.name		= "Whole Flash",
+		.offset		= 0,
+		.size		= MTDPART_SIZ_FULL,
+		.mask_flags	= MTD_WRITEABLE,
+	}
+};
+
+static struct s3c2410_nand_set g500_nand_sets[] = {
+	[0] = {
+		.name		= "Internal",
+		.nr_chips	= 1,
+		.nr_partitions	= ARRAY_SIZE(g500_nand_part),
+		.partitions	= g500_nand_part,
+	},
+};
+
+static struct s3c2410_platform_nand g500_nand_info = {
+	.tacls		= 20,
+	.twrph0		= 60,
+	.twrph1		= 20,
+	.nr_sets	= ARRAY_SIZE(g500_nand_sets),
+	.sets		= g500_nand_sets,
+};
+
+static struct platform_device *g500_devices[] __initdata = {
+	&s3c_device_rtc,
+	&s3c_device_usb,
+	&s3c_device_lcd,
+	&s3c_device_wdt,
+	&s3c_device_i2c,
+	&s3c_device_iis,
+	&s3c_device_nand,
+	&s3c_device_usbgadget,
+};
+
+static void __init g500_map_io(void)
+{
+	s3c_device_nand.dev.platform_data = &g500_nand_info;
+	s3c24xx_init_io(g500_iodesc, ARRAY_SIZE(g500_iodesc));
+	s3c24xx_init_clocks(16934000);
+	s3c24xx_init_uarts(g500_uartcfgs, ARRAY_SIZE(g500_uartcfgs));
+}
+
+static void __init g500_init_machine(void)
+{
+	platform_add_devices(g500_devices, ARRAY_SIZE(g500_devices));
+
+	s3c24xx_fb_set_platdata(&g500_fb_info);
+
+	s3c2410_pm_init();
+
+  /* wake up source */
+  s3c_irq_wake(IRQ_EINT1, 1);
+}
+
+
+MACHINE_START(G500, "G500")
+	/* Maintainer: Pierre Hebert <pierrox@pierrox.net> */
+	.phys_io	= S3C2410_PA_UART,
+	.io_pg_offst	= (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
+	.boot_params	= S3C2410_SDRAM_PA + 0x100,
+
+	.init_irq	= s3c24xx_init_irq,
+	.map_io		= g500_map_io,
+	.init_machine	= g500_init_machine,
+	.timer		= &s3c24xx_timer,
+MACHINE_END

