diff -X dontdiff-2.6 -Nurp linux-2.6.14-rc3-git4/arch/arm/mach-s3c2410/cpu.h linux-2.6.14-rc3-git4-lucasvr/arch/arm/mach-s3c2410/cpu.h --- linux-2.6.14-rc3-git4/arch/arm/mach-s3c2410/cpu.h 2005-10-04 11:27:02.000000000 -0300 +++ linux-2.6.14-rc3-git4-lucasvr/arch/arm/mach-s3c2410/cpu.h 2005-10-04 11:34:58.000000000 -0300 @@ -17,11 +17,12 @@ * 14-Jan-2005 BJD Added s3c24xx_init_clocks() call * 10-Mar-2005 LCVR Changed S3C2410_{VA,SZ} to S3C24XX_{VA,SZ} & IODESC_ENT * 14-Mar-2005 BJD Updated for __iomem + * 19-Oct-2005 LCVR Modified IODESC_ENT to use S3C24XX_PA(x) */ /* todo - fix when rmk changes iodescs to use `void __iomem *` */ -#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, S3C2410_PA_##x, S3C24XX_SZ_##x, MT_DEVICE } +#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, S3C24XX_PA(x), S3C24XX_SZ_##x, MT_DEVICE } #ifndef MHZ #define MHZ (1000*1000) diff -X dontdiff-2.6 -Nurp linux-2.6.14-rc3-git4/arch/arm/mach-s3c2410/devs.c linux-2.6.14-rc3-git4-lucasvr/arch/arm/mach-s3c2410/devs.c --- linux-2.6.14-rc3-git4/arch/arm/mach-s3c2410/devs.c 2005-10-04 11:27:48.000000000 -0300 +++ linux-2.6.14-rc3-git4-lucasvr/arch/arm/mach-s3c2410/devs.c 2005-10-04 11:34:58.000000000 -0300 @@ -10,6 +10,8 @@ * published by the Free Software Foundation. * * Modifications: + * 05-Oct-2005 LCVR Added s3c_timer4_resource for S3C2400, replaced + * S3C2410_PA_##x macros by S3C24XX_PA(x) * 10-Mar-2005 LCVR Changed S3C2410_{VA,SZ} to S3C24XX_{VA,SZ} * 10-Feb-2005 BJD Added camera from guillaume.gourat@nexvision.tv * 29-Aug-2004 BJD Added timers 0 through 3 @@ -46,8 +48,8 @@ struct platform_device *s3c24xx_uart_dev static struct resource s3c_usb_resource[] = { [0] = { - .start = S3C2410_PA_USBHOST, - .end = S3C2410_PA_USBHOST + S3C24XX_SZ_USBHOST, + .start = S3C24XX_PA(USBHOST), + .end = S3C24XX_PA(USBHOST) + S3C24XX_SZ_USBHOST, .flags = IORESOURCE_MEM, }, [1] = { @@ -76,8 +78,8 @@ EXPORT_SYMBOL(s3c_device_usb); static struct resource s3c_lcd_resource[] = { [0] = { - .start = S3C2410_PA_LCD, - .end = S3C2410_PA_LCD + S3C24XX_SZ_LCD, + .start = S3C24XX_PA(LCD), + .end = S3C24XX_PA(LCD) + S3C24XX_SZ_LCD, .flags = IORESOURCE_MEM, }, [1] = { @@ -135,8 +137,8 @@ EXPORT_SYMBOL(s3c_device_nand); static struct resource s3c_usbgadget_resource[] = { [0] = { - .start = S3C2410_PA_USBDEV, - .end = S3C2410_PA_USBDEV + S3C24XX_SZ_USBDEV, + .start = S3C24XX_PA(USBDEV), + .end = S3C24XX_PA(USBDEV) + S3C24XX_SZ_USBDEV, .flags = IORESOURCE_MEM, }, [1] = { @@ -160,8 +162,8 @@ EXPORT_SYMBOL(s3c_device_usbgadget); static struct resource s3c_wdt_resource[] = { [0] = { - .start = S3C2410_PA_WATCHDOG, - .end = S3C2410_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG, + .start = S3C24XX_PA(WATCHDOG), + .end = S3C24XX_PA(WATCHDOG) + S3C24XX_SZ_WATCHDOG, .flags = IORESOURCE_MEM, }, [1] = { @@ -185,8 +187,8 @@ EXPORT_SYMBOL(s3c_device_wdt); static struct resource s3c_i2c_resource[] = { [0] = { - .start = S3C2410_PA_IIC, - .end = S3C2410_PA_IIC + S3C24XX_SZ_IIC, + .start = S3C24XX_PA(IIC), + .end = S3C24XX_PA(IIC) + S3C24XX_SZ_IIC, .flags = IORESOURCE_MEM, }, [1] = { @@ -210,8 +212,8 @@ EXPORT_SYMBOL(s3c_device_i2c); static struct resource s3c_iis_resource[] = { [0] = { - .start = S3C2410_PA_IIS, - .end = S3C2410_PA_IIS + S3C24XX_SZ_IIS, + .start = S3C24XX_PA(IIS), + .end = S3C24XX_PA(IIS) + S3C24XX_SZ_IIS, .flags = IORESOURCE_MEM, } }; @@ -235,8 +237,8 @@ EXPORT_SYMBOL(s3c_device_iis); static struct resource s3c_rtc_resource[] = { [0] = { - .start = S3C2410_PA_RTC, - .end = S3C2410_PA_RTC + 0xff, + .start = S3C24XX_PA(RTC), + .end = S3C24XX_PA(RTC) + 0xff, .flags = IORESOURCE_MEM, }, [1] = { @@ -264,8 +266,8 @@ EXPORT_SYMBOL(s3c_device_rtc); static struct resource s3c_adc_resource[] = { [0] = { - .start = S3C2410_PA_ADC, - .end = S3C2410_PA_ADC + S3C24XX_SZ_ADC, + .start = S3C24XX_PA(ADC), + .end = S3C24XX_PA(ADC) + S3C24XX_SZ_ADC, .flags = IORESOURCE_MEM, }, [1] = { @@ -312,8 +314,8 @@ EXPORT_SYMBOL(s3c_device_sdi); static struct resource s3c_spi0_resource[] = { [0] = { - .start = S3C2410_PA_SPI, - .end = S3C2410_PA_SPI + 0x1f, + .start = S3C24XX_PA(SPI), + .end = S3C24XX_PA(SPI) + 0x1f, .flags = IORESOURCE_MEM, }, [1] = { @@ -337,8 +339,8 @@ EXPORT_SYMBOL(s3c_device_spi0); static struct resource s3c_spi1_resource[] = { [0] = { - .start = S3C2410_PA_SPI + 0x20, - .end = S3C2410_PA_SPI + 0x20 + 0x1f, + .start = S3C24XX_PA(SPI) + 0x20, + .end = S3C24XX_PA(SPI) + 0x20 + 0x1f, .flags = IORESOURCE_MEM, }, [1] = { @@ -362,8 +364,8 @@ EXPORT_SYMBOL(s3c_device_spi1); static struct resource s3c_timer0_resource[] = { [0] = { - .start = S3C2410_PA_TIMER + 0x0C, - .end = S3C2410_PA_TIMER + 0x0C + 0xB, + .start = S3C24XX_PA(TIMER) + 0x0C, + .end = S3C24XX_PA(TIMER) + 0x0C + 0xB, .flags = IORESOURCE_MEM, }, [1] = { @@ -387,8 +389,8 @@ EXPORT_SYMBOL(s3c_device_timer0); static struct resource s3c_timer1_resource[] = { [0] = { - .start = S3C2410_PA_TIMER + 0x18, - .end = S3C2410_PA_TIMER + 0x23, + .start = S3C24XX_PA(TIMER) + 0x18, + .end = S3C24XX_PA(TIMER) + 0x23, .flags = IORESOURCE_MEM, }, [1] = { @@ -412,8 +414,8 @@ EXPORT_SYMBOL(s3c_device_timer1); static struct resource s3c_timer2_resource[] = { [0] = { - .start = S3C2410_PA_TIMER + 0x24, - .end = S3C2410_PA_TIMER + 0x2F, + .start = S3C24XX_PA(TIMER) + 0x24, + .end = S3C24XX_PA(TIMER) + 0x2F, .flags = IORESOURCE_MEM, }, [1] = { @@ -437,8 +439,8 @@ EXPORT_SYMBOL(s3c_device_timer2); static struct resource s3c_timer3_resource[] = { [0] = { - .start = S3C2410_PA_TIMER + 0x30, - .end = S3C2410_PA_TIMER + 0x3B, + .start = S3C24XX_PA(TIMER) + 0x30, + .end = S3C24XX_PA(TIMER) + 0x3B, .flags = IORESOURCE_MEM, }, [1] = { diff -X dontdiff-2.6 -Nurp linux-2.6.14-rc3-git4/arch/arm/mach-s3c2410/dma.c linux-2.6.14-rc3-git4-lucasvr/arch/arm/mach-s3c2410/dma.c --- linux-2.6.14-rc3-git4/arch/arm/mach-s3c2410/dma.c 2005-10-04 11:27:26.000000000 -0300 +++ linux-2.6.14-rc3-git4-lucasvr/arch/arm/mach-s3c2410/dma.c 2005-10-04 11:34:58.000000000 -0300 @@ -1152,7 +1152,7 @@ static int __init s3c2410_init_dma(void) printk("S3C2410 DMA Driver, (c) 2003-2004 Simtec Electronics\n"); - dma_base = ioremap(S3C2410_PA_DMA, 0x200); + dma_base = ioremap(S3C24XX_PA(DMA), 0x200); if (dma_base == NULL) { printk(KERN_ERR "dma failed to remap register block\n"); return -ENOMEM; diff -X dontdiff-2.6 -Nurp linux-2.6.14-rc3-git4/arch/arm/mach-s3c2410/sleep.S linux-2.6.14-rc3-git4-lucasvr/arch/arm/mach-s3c2410/sleep.S --- linux-2.6.14-rc3-git4/arch/arm/mach-s3c2410/sleep.S 2005-03-02 04:38:18.000000000 -0300 +++ linux-2.6.14-rc3-git4-lucasvr/arch/arm/mach-s3c2410/sleep.S 2005-10-04 11:34:58.000000000 -0300 @@ -133,12 +133,12 @@ ENTRY(s3c2410_cpu_resume) @@ load UART to allow us to print the two characters for @@ resume debug - mov r2, #S3C2410_PA_UART & 0xff000000 - orr r2, r2, #S3C2410_PA_UART & 0xff000 + mov r2, #S3C24XX_PA(UART) & 0xff000000 + orr r2, r2, #S3C24XX_PA(UART) & 0xff000 #if 0 /* SMDK2440 LED set */ - mov r14, #S3C2410_PA_GPIO + mov r14, #S3C24XX_PA(GPIO) ldr r12, [ r14, #0x54 ] bic r12, r12, #3<<4 orr r12, r12, #1<<7 diff -X dontdiff-2.6 -Nurp linux-2.6.14-rc3-git4/drivers/serial/s3c2410.c linux-2.6.14-rc3-git4-lucasvr/drivers/serial/s3c2410.c --- linux-2.6.14-rc3-git4/drivers/serial/s3c2410.c 2005-10-04 11:27:55.000000000 -0300 +++ linux-2.6.14-rc3-git4-lucasvr/drivers/serial/s3c2410.c 2005-10-04 11:34:58.000000000 -0300 @@ -161,7 +161,11 @@ s3c24xx_serial_dbg(const char *fmt, ...) /* we can support 3 uarts, but not always use them */ +#ifdef CONFIG_CPU_S3C2400 +#define NR_PORTS (2) +#else #define NR_PORTS (3) +#endif /* port irq numbers */ @@ -1072,7 +1076,7 @@ static int s3c24xx_serial_init_port(stru dbg("resource %p (%lx..%lx)\n", res, res->start, res->end); port->mapbase = res->start; - port->membase = S3C24XX_VA_UART + (res->start - S3C2410_PA_UART); + port->membase = S3C24XX_VA_UART + (res->start - S3C24XX_PA(UART)); port->irq = platform_get_irq(platdev, 0); ourport->clk = clk_get(&platdev->dev, "uart"); diff -X dontdiff-2.6 -Nurp linux-2.6.14-rc3-git4/include/asm-arm/arch-s3c2410/debug-macro.S linux-2.6.14-rc3-git4-lucasvr/include/asm-arm/arch-s3c2410/debug-macro.S --- linux-2.6.14-rc3-git4/include/asm-arm/arch-s3c2410/debug-macro.S 2005-10-04 11:27:09.000000000 -0300 +++ linux-2.6.14-rc3-git4-lucasvr/include/asm-arm/arch-s3c2410/debug-macro.S 2005-10-04 11:34:58.000000000 -0300 @@ -25,7 +25,7 @@ .macro addruart, rx mrc p15, 0, \rx, c1, c0 tst \rx, #1 - ldreq \rx, = S3C2410_PA_UART + ldreq \rx, = S3C24XX_PA(UART) ldrne \rx, = S3C24XX_VA_UART #if CONFIG_DEBUG_S3C2410_UART != 0 add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART) @@ -44,7 +44,7 @@ 1003: mrc p15, 0, \rd, c1, c0 tst \rd, #1 - addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART) + addeq \rd, \rx, #(S3C24XX_PA(GPIO)- S3C24XX_PA(UART)) addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART) bic \rd, \rd, #0xff000 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] @@ -75,7 +75,7 @@ 1003: mrc p15, 0, \rd, c1, c0 tst \rd, #1 - addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART) + addeq \rd, \rx, #(S3C24XX_PA(GPIO) - S3C24XX_PA(UART)) addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART) bic \rd, \rd, #0xff000 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] diff -X dontdiff-2.6 -Nurp linux-2.6.14-rc3-git4/include/asm-arm/arch-s3c2410/map.h linux-2.6.14-rc3-git4-lucasvr/include/asm-arm/arch-s3c2410/map.h --- linux-2.6.14-rc3-git4/include/asm-arm/arch-s3c2410/map.h 2005-10-04 11:27:09.000000000 -0300 +++ linux-2.6.14-rc3-git4-lucasvr/include/asm-arm/arch-s3c2410/map.h 2005-10-04 11:34:58.000000000 -0300 @@ -14,6 +14,7 @@ * 06-Jan-2003 BJD Linux 2.6.0 version, moved bast specifics out * 10-Feb-2005 BJD Added CAMIF definition from guillaume.gourat@nexvision.tv * 10-Mar-2005 LCVR Added support to S3C2400, changed {VA,SZ} names + * 19-Oct-2005 LCVR Wrote S3C24XX_PA macro */ #ifndef __ASM_ARCH_MAP_H @@ -38,6 +39,13 @@ #define S3C2400_ADDR(x) S3C2410_ADDR(x) +/* useful macros to write code independent of the cpu core */ +#ifdef CONFIG_CPU_S3C2400 +# define S3C24XX_PA(x) S3C2400_PA_##x +#else +# define S3C24XX_PA(x) S3C2410_PA_##x +#endif + /* interrupt controller is the first thing we put in, to make * the assembly code for the irq detection easier */ diff -X dontdiff-2.6 -Nurp linux-2.6.14-rc3-git4/include/asm-arm/arch-s3c2410/regs-serial.h linux-2.6.14-rc3-git4-lucasvr/include/asm-arm/arch-s3c2410/regs-serial.h --- linux-2.6.14-rc3-git4/include/asm-arm/arch-s3c2410/regs-serial.h 2005-10-04 11:27:09.000000000 -0300 +++ linux-2.6.14-rc3-git4-lucasvr/include/asm-arm/arch-s3c2410/regs-serial.h 2005-10-04 11:34:58.000000000 -0300 @@ -39,9 +39,9 @@ #define S3C24XX_VA_UART1 (S3C24XX_VA_UART + 0x4000 ) #define S3C24XX_VA_UART2 (S3C24XX_VA_UART + 0x8000 ) -#define S3C2410_PA_UART0 (S3C2410_PA_UART) -#define S3C2410_PA_UART1 (S3C2410_PA_UART + 0x4000 ) -#define S3C2410_PA_UART2 (S3C2410_PA_UART + 0x8000 ) +#define S3C2410_PA_UART0 (S3C24XX_PA(UART)) +#define S3C2410_PA_UART1 (S3C24XX_PA(UART) + 0x4000 ) +#define S3C2410_PA_UART2 (S3C24XX_PA(UART) + 0x8000 ) #define S3C2410_URXH (0x24) #define S3C2410_UTXH (0x20) diff -X dontdiff-2.6 -Nurp linux-2.6.14-rc3-git4/include/asm-arm/arch-s3c2410/uncompress.h linux-2.6.14-rc3-git4-lucasvr/include/asm-arm/arch-s3c2410/uncompress.h --- linux-2.6.14-rc3-git4/include/asm-arm/arch-s3c2410/uncompress.h 2005-10-04 11:27:09.000000000 -0300 +++ linux-2.6.14-rc3-git4-lucasvr/include/asm-arm/arch-s3c2410/uncompress.h 2005-10-04 11:34:58.000000000 -0300 @@ -35,13 +35,13 @@ #undef S3C2410_GPIOREG #undef S3C2410_WDOGREG -#define S3C2410_GPIOREG(x) ((S3C2410_PA_GPIO + (x))) -#define S3C2410_WDOGREG(x) ((S3C2410_PA_WATCHDOG + (x))) +#define S3C2410_GPIOREG(x) ((S3C24XX_PA(GPIO) + (x))) +#define S3C2410_WDOGREG(x) ((S3C24XX_PA(WATCHDOG) + (x))) /* how many bytes we allow into the FIFO at a time in FIFO mode */ #define FIFO_MAX (14) -#define uart_base S3C2410_PA_UART + (0x4000*CONFIG_S3C2410_LOWLEVEL_UART_PORT) +#define uart_base S3C24XX_PA(UART) + (0x4000*CONFIG_S3C2410_LOWLEVEL_UART_PORT) static __inline__ void uart_wr(unsigned int reg, unsigned int val)