Skip to content

Commit

Permalink
ARM: Merge for-2635-4/onenand
Browse files Browse the repository at this point in the history
Merge branch 'for-2635-4/onenand' into for-2635-4/partial2

Conflicts:
	arch/arm/mach-s5pc100/cpu.c
	arch/arm/mach-s5pc100/include/mach/map.h
	arch/arm/mach-s5pv210/Makefile
  • Loading branch information
Ben Dooks committed May 20, 2010
2 parents 6aeaad5 + 999304b commit 206a1a8
Show file tree
Hide file tree
Showing 19 changed files with 368 additions and 12 deletions.
5 changes: 5 additions & 0 deletions arch/arm/mach-s3c64xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ config S3C64XX_SETUP_SDHCI
Internal configuration for default SDHCI setup for S3C6400 and
S3C6410 SoCs.

config S3C64XX_DEV_ONENAND1
bool
help
Compile in platform device definition for OneNAND1 controller

# platform specific device setup

config S3C64XX_SETUP_I2C0
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s3c64xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ obj-y += dev-uart.o
obj-y += dev-audio.o
obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o
obj-$(CONFIG_S3C64XX_DEV_TS) += dev-ts.o
obj-$(CONFIG_S3C64XX_DEV_ONENAND1) += dev-onenand1.o
55 changes: 55 additions & 0 deletions arch/arm/mach-s3c64xx/dev-onenand1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* linux/arch/arm/mach-s3c64xx/dev-onenand1.c
*
* Copyright (c) 2008-2010 Samsung Electronics
* Kyungmin Park <kyungmin.park@samsung.com>
*
* S3C64XX series device definition for OneNAND devices
*
* 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/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/onenand.h>

#include <mach/irqs.h>
#include <mach/map.h>

static struct resource s3c64xx_onenand1_resources[] = {
[0] = {
.start = S3C64XX_PA_ONENAND1,
.end = S3C64XX_PA_ONENAND1 + 0x400 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = S3C64XX_PA_ONENAND1_BUF,
.end = S3C64XX_PA_ONENAND1_BUF + S3C64XX_SZ_ONENAND1_BUF - 1,
.flags = IORESOURCE_MEM,
},
[2] = {
.start = IRQ_ONENAND1,
.end = IRQ_ONENAND1,
.flags = IORESOURCE_IRQ,
},
};

struct platform_device s3c64xx_device_onenand1 = {
.name = "samsung-onenand",
.id = 1,
.num_resources = ARRAY_SIZE(s3c64xx_onenand1_resources),
.resource = s3c64xx_onenand1_resources,
};

void s3c64xx_onenand1_set_platdata(struct onenand_platform_data *pdata)
{
struct onenand_platform_data *pd;

pd = kmemdup(pdata, sizeof(struct onenand_platform_data), GFP_KERNEL);
if (!pd)
printk(KERN_ERR "%s: no memory for platform data\n", __func__);
s3c64xx_device_onenand1.dev.platform_data = pd;
}
4 changes: 4 additions & 0 deletions arch/arm/mach-s3c64xx/include/mach/irqs.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,9 @@

#define NR_IRQS (IRQ_BOARD_END + 1)

/* Compatibility */

#define IRQ_ONENAND IRQ_ONENAND0

#endif /* __ASM_MACH_S3C64XX_IRQS_H */

13 changes: 13 additions & 0 deletions arch/arm/mach-s3c64xx/include/mach/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@

#define S3C64XX_PA_SROM (0x70000000)

#define S3C64XX_PA_ONENAND0 (0x70100000)
#define S3C64XX_PA_ONENAND0_BUF (0x20000000)
#define S3C64XX_SZ_ONENAND0_BUF (SZ_64M)

/* NAND and OneNAND1 controllers occupy the same register region
(depending on SoC POP version) */
#define S3C64XX_PA_ONENAND1 (0x70200000)
#define S3C64XX_PA_ONENAND1_BUF (0x28000000)
#define S3C64XX_SZ_ONENAND1_BUF (SZ_64M)

#define S3C64XX_PA_NAND (0x70200000)
#define S3C64XX_PA_FB (0x77100000)
#define S3C64XX_PA_USB_HSOTG (0x7C000000)
Expand Down Expand Up @@ -99,6 +109,9 @@
#define S3C_PA_IIC S3C64XX_PA_IIC0
#define S3C_PA_IIC1 S3C64XX_PA_IIC1
#define S3C_PA_NAND S3C64XX_PA_NAND
#define S3C_PA_ONENAND S3C64XX_PA_ONENAND0
#define S3C_PA_ONENAND_BUF S3C64XX_PA_ONENAND0_BUF
#define S3C_SZ_ONENAND_BUF S3C64XX_SZ_ONENAND0_BUF
#define S3C_PA_FB S3C64XX_PA_FB
#define S3C_PA_USBHOST S3C64XX_PA_USBHOST
#define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/mach-s3c64xx/s3c6400.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <plat/clock.h>
#include <plat/sdhci.h>
#include <plat/iic-core.h>
#include <plat/onenand-core.h>
#include <mach/s3c6400.h>

void __init s3c6400_map_io(void)
Expand All @@ -51,6 +52,9 @@ void __init s3c6400_map_io(void)
s3c_i2c0_setname("s3c2440-i2c");

s3c_device_nand.name = "s3c6400-nand";

s3c_onenand_setname("s3c6400-onenand");
s3c64xx_onenand1_setname("s3c6400-onenand");
}

void __init s3c6400_init_clocks(int xtal)
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-s3c64xx/s3c6410.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <plat/sdhci.h>
#include <plat/iic-core.h>
#include <plat/adc.h>
#include <plat/onenand-core.h>
#include <mach/s3c6400.h>
#include <mach/s3c6410.h>

Expand All @@ -55,6 +56,8 @@ void __init s3c6410_map_io(void)

s3c_device_adc.name = "s3c64xx-adc";
s3c_device_nand.name = "s3c6400-nand";
s3c_onenand_setname("s3c6410-onenand");
s3c64xx_onenand1_setname("s3c6410-onenand");
}

void __init s3c6410_init_clocks(int xtal)
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/mach-s5pc100/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include <plat/clock.h>
#include <plat/iic-core.h>
#include <plat/sdhci.h>
#include <plat/onenand-core.h>

#include <plat/s5pc100.h>

/* Initial IO mappings */
Expand Down Expand Up @@ -88,6 +90,8 @@ void __init s5pc100_map_io(void)
/* the i2c devices are directly compatible with s3c2440 */
s3c_i2c0_setname("s3c2440-i2c");
s3c_i2c1_setname("s3c2440-i2c");

s3c_onenand_setname("s5pc100-onenand");
}

void __init s5pc100_init_clocks(int xtal)
Expand Down
68 changes: 56 additions & 12 deletions arch/arm/mach-s5pc100/include/mach/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@
#include <plat/map-base.h>
#include <plat/map-s5p.h>

/*
* map-base.h has already defined virtual memory address
* S3C_VA_IRQ S3C_ADDR(0x00000000) irq controller(s)
* S3C_VA_SYS S3C_ADDR(0x00100000) system control
* S3C_VA_MEM S3C_ADDR(0x00200000) system control (not used)
* S3C_VA_TIMER S3C_ADDR(0x00300000) timer block
* S3C_VA_WATCHDOG S3C_ADDR(0x00400000) watchdog
* S3C_VA_UART S3C_ADDR(0x01000000) UART
*
* S5PC100 specific virtual memory address can be defined here
* S5PC1XX_VA_GPIO S3C_ADDR(0x00500000) GPIO
*
*/

#define S5PC100_PA_ONENAND_BUF (0xB0000000)
#define S5PC100_SZ_ONENAND_BUF (SZ_256M - SZ_32M)

/* Chip ID */

#define S5PC100_PA_CHIPID (0xE0000000)
#define S5P_PA_CHIPID S5PC100_PA_CHIPID

Expand All @@ -26,17 +45,26 @@
#define S5PC100_VA_OTHERS (S3C_VA_SYS + 0x10000)

#define S5PC100_PA_GPIO (0xE0300000)
#define S5P_PA_GPIO S5PC100_PA_GPIO

#define S5PC100_PA_VIC0 (0xE4000000)
#define S5P_PA_VIC0 S5PC100_PA_VIC0
#define S5PC1XX_PA_GPIO S5PC100_PA_GPIO
#define S5PC1XX_VA_GPIO S3C_ADDR(0x00500000)

/* Interrupt */
#define S5PC100_PA_VIC (0xE4000000)
#define S5PC100_VA_VIC S3C_VA_IRQ
#define S5PC100_PA_VIC_OFFSET 0x100000
#define S5PC100_VA_VIC_OFFSET 0x10000
#define S5PC1XX_PA_VIC(x) (S5PC100_PA_VIC + ((x) * S5PC100_PA_VIC_OFFSET))
#define S5PC1XX_VA_VIC(x) (S5PC100_VA_VIC + ((x) * S5PC100_VA_VIC_OFFSET))

#define S5PC100_PA_VIC1 (0xE4100000)
#define S5P_PA_VIC1 S5PC100_PA_VIC1
#define S5PC100_PA_ONENAND (0xE7100000)

#define S5PC100_PA_VIC2 (0xE4200000)
#define S5P_PA_VIC2 S5PC100_PA_VIC2
/* DMA */
#define S5PC100_PA_MDMA (0xE8100000)
#define S5PC100_PA_PDMA0 (0xE9000000)
#define S5PC100_PA_PDMA1 (0xE9200000)

/* Timer */
#define S5PC100_PA_TIMER (0xEA000000)
#define S5P_PA_TIMER S5PC100_PA_TIMER

Expand Down Expand Up @@ -83,8 +111,24 @@
#define S3C_PA_IIC S5PC100_PA_IIC0
#define S3C_PA_IIC1 S5PC100_PA_IIC1
#define S3C_PA_FB S5PC100_PA_FB
#define S3C_PA_HSMMC0 S5PC100_PA_HSMMC(0)
#define S3C_PA_HSMMC1 S5PC100_PA_HSMMC(1)
#define S3C_PA_HSMMC2 S5PC100_PA_HSMMC(2)

#endif /* __ASM_ARCH_MAP_H */
#define S3C_PA_G2D S5PC100_PA_G2D
#define S3C_PA_G3D S5PC100_PA_G3D
#define S3C_PA_JPEG S5PC100_PA_JPEG
#define S3C_PA_ROTATOR S5PC100_PA_ROTATOR
#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x0)
#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000)
#define S3C_VA_VIC2 (S3C_VA_IRQ + 0x20000)
#define S3C_PA_IIC S5PC100_PA_I2C
#define S3C_PA_IIC1 S5PC100_PA_I2C1
#define S3C_PA_USB_HSOTG S5PC100_PA_USB_HSOTG
#define S3C_PA_USB_HSPHY S5PC100_PA_USB_HSPHY
#define S3C_PA_HSMMC0 S5PC100_PA_HSMMC0
#define S3C_PA_HSMMC1 S5PC100_PA_HSMMC1
#define S3C_PA_HSMMC2 S5PC100_PA_HSMMC2
#define S3C_PA_KEYPAD S5PC100_PA_KEYPAD
#define S3C_PA_TSADC S5PC100_PA_TSADC
#define S3C_PA_ONENAND S5PC100_PA_ONENAND
#define S3C_PA_ONENAND_BUF S5PC100_PA_ONENAND_BUF
#define S3C_SZ_ONENAND_BUF S5PC100_SZ_ONENAND_BUF

#endif /* __ASM_ARCH_C100_MAP_H */
5 changes: 5 additions & 0 deletions arch/arm/mach-s5pv210/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ config MACH_GONI
Machine support for Samsung GONI board
S5PC110(MCP) is one of package option of S5PV210

config S5PC110_DEV_ONENAND
bool
help
Compile in platform device definition for OneNAND1 controller

config MACH_SMDKV210
bool "SMDKV210"
select CPU_S5PV210
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s5pv210/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ obj-$(CONFIG_MACH_GONI) += mach-goni.o

obj-y += dev-audio.o
obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o
obj-$(CONFIG_S5PC110_DEV_ONENAND) += dev-onenand.o

obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o
obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o
Expand Down
50 changes: 50 additions & 0 deletions arch/arm/mach-s5pv210/dev-onenand.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* linux/arch/arm/mach-s5pv210/dev-onenand.c
*
* Copyright (c) 2008-2010 Samsung Electronics
* Kyungmin Park <kyungmin.park@samsung.com>
*
* S5PC110 series device definition for OneNAND devices
*
* 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/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/onenand.h>

#include <mach/irqs.h>
#include <mach/map.h>

static struct resource s5pc110_onenand_resources[] = {
[0] = {
.start = S5PC110_PA_ONENAND,
.end = S5PC110_PA_ONENAND + SZ_128K - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = S5PC110_PA_ONENAND_DMA,
.end = S5PC110_PA_ONENAND_DMA + SZ_2K - 1,
.flags = IORESOURCE_MEM,
},
};

struct platform_device s5pc110_device_onenand = {
.name = "s5pc110-onenand",
.id = -1,
.num_resources = ARRAY_SIZE(s5pc110_onenand_resources),
.resource = s5pc110_onenand_resources,
};

void s5pc110_onenand_set_platdata(struct onenand_platform_data *pdata)
{
struct onenand_platform_data *pd;

pd = kmemdup(pdata, sizeof(struct onenand_platform_data), GFP_KERNEL);
if (!pd)
printk(KERN_ERR "%s: no memory for platform data\n", __func__);
s5pc110_device_onenand.dev.platform_data = pd;
}
3 changes: 3 additions & 0 deletions arch/arm/mach-s5pv210/include/mach/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
#include <plat/map-base.h>
#include <plat/map-s5p.h>

#define S5PC110_PA_ONENAND (0xB0000000)
#define S5PC110_PA_ONENAND_DMA (0xB0600000)

#define S5PV210_PA_CHIPID (0xE0000000)
#define S5P_PA_CHIPID S5PV210_PA_CHIPID

Expand Down
5 changes: 5 additions & 0 deletions arch/arm/plat-samsung/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ config S3C_DEV_NAND
help
Compile in platform device definition for NAND controller

config S3C_DEV_ONENAND
bool
help
Compile in platform device definition for OneNAND controller

config S3C_DEV_RTC
bool
help
Expand Down
1 change: 1 addition & 0 deletions arch/arm/plat-samsung/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o
obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
obj-$(CONFIG_S3C_DEV_WDT) += dev-wdt.o
obj-$(CONFIG_S3C_DEV_NAND) += dev-nand.o
obj-$(CONFIG_S3C_DEV_ONENAND) += dev-onenand.o
obj-$(CONFIG_S3C_DEV_RTC) += dev-rtc.o

obj-$(CONFIG_SAMSUNG_DEV_ADC) += dev-adc.o
Expand Down
Loading

0 comments on commit 206a1a8

Please sign in to comment.