Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0367a8d3 authored by Lucas Correia Villa Real's avatar Lucas Correia Villa Real Committed by Russell King
Browse files

[ARM] 3266/1: S3C2400 - adds macro S3C24XX



Patch from Lucas Correia Villa Real

This patch defines S3C2400 memory map and adds a S3C24XX macro for
common resources between S3C2400, S3C2410 and S3C2440 cpus.

Signed-off-by: default avatarLucas Correia Villa Real <lucasvr@gobolinux.org>
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent c43e6f02
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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
 *     15-Jan-2006 LCVR Updated S3C2410_PA_##x to new S3C24XX_PA_##x macro
*/

/* todo - fix when rmk changes iodescs to use `void __iomem *` */

#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C2410_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }

#ifndef MHZ
#define MHZ (1000*1000)
+29 −28
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
 * published by the Free Software Foundation.
 *
 * Modifications:
 *     15-Jan-2006 LCVR Using S3C24XX_PA_##x macro for common S3C24XX devices
 *     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 +47,8 @@ struct platform_device *s3c24xx_uart_devs[3];

static struct resource s3c_usb_resource[] = {
	[0] = {
		.start = S3C2410_PA_USBHOST,
		.end   = S3C2410_PA_USBHOST + S3C24XX_SZ_USBHOST - 1,
		.start = S3C24XX_PA_USBHOST,
		.end   = S3C24XX_PA_USBHOST + S3C24XX_SZ_USBHOST - 1,
		.flags = IORESOURCE_MEM,
	},
	[1] = {
@@ -76,8 +77,8 @@ EXPORT_SYMBOL(s3c_device_usb);

static struct resource s3c_lcd_resource[] = {
	[0] = {
		.start = S3C2410_PA_LCD,
		.end   = S3C2410_PA_LCD + S3C24XX_SZ_LCD - 1,
		.start = S3C24XX_PA_LCD,
		.end   = S3C24XX_PA_LCD + S3C24XX_SZ_LCD - 1,
		.flags = IORESOURCE_MEM,
	},
	[1] = {
@@ -139,8 +140,8 @@ EXPORT_SYMBOL(s3c_device_nand);

static struct resource s3c_usbgadget_resource[] = {
	[0] = {
		.start = S3C2410_PA_USBDEV,
		.end   = S3C2410_PA_USBDEV + S3C24XX_SZ_USBDEV - 1,
		.start = S3C24XX_PA_USBDEV,
		.end   = S3C24XX_PA_USBDEV + S3C24XX_SZ_USBDEV - 1,
		.flags = IORESOURCE_MEM,
	},
	[1] = {
@@ -164,8 +165,8 @@ EXPORT_SYMBOL(s3c_device_usbgadget);

static struct resource s3c_wdt_resource[] = {
	[0] = {
		.start = S3C2410_PA_WATCHDOG,
		.end   = S3C2410_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG - 1,
		.start = S3C24XX_PA_WATCHDOG,
		.end   = S3C24XX_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG - 1,
		.flags = IORESOURCE_MEM,
	},
	[1] = {
@@ -189,8 +190,8 @@ EXPORT_SYMBOL(s3c_device_wdt);

static struct resource s3c_i2c_resource[] = {
	[0] = {
		.start = S3C2410_PA_IIC,
		.end   = S3C2410_PA_IIC + S3C24XX_SZ_IIC - 1,
		.start = S3C24XX_PA_IIC,
		.end   = S3C24XX_PA_IIC + S3C24XX_SZ_IIC - 1,
		.flags = IORESOURCE_MEM,
	},
	[1] = {
@@ -214,8 +215,8 @@ EXPORT_SYMBOL(s3c_device_i2c);

static struct resource s3c_iis_resource[] = {
	[0] = {
		.start = S3C2410_PA_IIS,
		.end   = S3C2410_PA_IIS + S3C24XX_SZ_IIS -1,
		.start = S3C24XX_PA_IIS,
		.end   = S3C24XX_PA_IIS + S3C24XX_SZ_IIS -1,
		.flags = IORESOURCE_MEM,
	}
};
@@ -239,8 +240,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] = {
@@ -268,8 +269,8 @@ EXPORT_SYMBOL(s3c_device_rtc);

static struct resource s3c_adc_resource[] = {
	[0] = {
		.start = S3C2410_PA_ADC,
		.end   = S3C2410_PA_ADC + S3C24XX_SZ_ADC - 1,
		.start = S3C24XX_PA_ADC,
		.end   = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1,
		.flags = IORESOURCE_MEM,
	},
	[1] = {
@@ -316,8 +317,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] = {
@@ -341,8 +342,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] = {
@@ -366,8 +367,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] = {
@@ -391,8 +392,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] = {
@@ -416,8 +417,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] = {
@@ -441,8 +442,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] = {
+1 −1
Original line number Diff line number Diff line
@@ -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;
+3 −3
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -1060,7 +1060,7 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
	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");
Loading