aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-s3c2410/include/mach/gpio.h10
-rw-r--r--arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h2
-rw-r--r--arch/arm/mach-s3c2412/s3c2412.c3
-rw-r--r--arch/arm/mach-s3c2416/Kconfig6
-rw-r--r--arch/arm/mach-s3c2416/Makefile2
-rw-r--r--arch/arm/mach-s3c2416/irq.c2
-rw-r--r--arch/arm/mach-s3c2416/pm.c84
-rw-r--r--arch/arm/mach-s3c2416/s3c2416.c3
-rw-r--r--arch/arm/mach-s3c2440/s3c244x.c3
-rw-r--r--arch/arm/mach-s3c2443/s3c2443.c3
-rw-r--r--arch/arm/plat-s3c24xx/common-smdk.c2
-rw-r--r--arch/arm/plat-samsung/include/plat/nand-core.h28
12 files changed, 139 insertions, 9 deletions
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h
index b649bf2ccd5c..f7f6b07df30e 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
@@ -22,6 +22,8 @@
22 22
23#ifdef CONFIG_CPU_S3C244X 23#ifdef CONFIG_CPU_S3C244X
24#define ARCH_NR_GPIOS (32 * 9 + CONFIG_S3C24XX_GPIO_EXTRA) 24#define ARCH_NR_GPIOS (32 * 9 + CONFIG_S3C24XX_GPIO_EXTRA)
25#elif defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416)
26#define ARCH_NR_GPIOS (32 * 12 + CONFIG_S3C24XX_GPIO_EXTRA)
25#else 27#else
26#define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA) 28#define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA)
27#endif 29#endif
@@ -30,8 +32,10 @@
30#include <mach/gpio-nrs.h> 32#include <mach/gpio-nrs.h>
31#include <mach/gpio-fns.h> 33#include <mach/gpio-fns.h>
32 34
33#ifdef CONFIG_CPU_S3C24XX 35#ifdef CONFIG_CPU_S3C244X
34#define S3C_GPIO_END (S3C2410_GPIO_BANKJ + 32) 36#define S3C_GPIO_END (S3C2410_GPJ(0) + 32)
37#elif defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416)
38#define S3C_GPIO_END (S3C2410_GPM(0) + 32)
35#else 39#else
36#define S3C_GPIO_END (S3C2410_GPIO_BANKH + 32) 40#define S3C_GPIO_END (S3C2410_GPH(0) + 32)
37#endif 41#endif
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h b/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
index 08ab9dfb6ae6..101aeea22310 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
@@ -118,6 +118,8 @@
118#define S3C2443_SCLKCON_UARTCLK (1<<8) 118#define S3C2443_SCLKCON_UARTCLK (1<<8)
119#define S3C2443_SCLKCON_USBHOST (1<<1) 119#define S3C2443_SCLKCON_USBHOST (1<<1)
120 120
121#define S3C2443_PWRCFG_SLEEP (1<<15)
122
121#include <asm/div64.h> 123#include <asm/div64.h>
122 124
123static inline unsigned int 125static inline unsigned int
diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c2412/s3c2412.c
index bef39f77729d..4c6df51ddf33 100644
--- a/arch/arm/mach-s3c2412/s3c2412.c
+++ b/arch/arm/mach-s3c2412/s3c2412.c
@@ -51,6 +51,7 @@
51#include <plat/clock.h> 51#include <plat/clock.h>
52#include <plat/pm.h> 52#include <plat/pm.h>
53#include <plat/pll.h> 53#include <plat/pll.h>
54#include <plat/nand-core.h>
54 55
55#ifndef CONFIG_CPU_S3C2412_ONLY 56#ifndef CONFIG_CPU_S3C2412_ONLY
56void __iomem *s3c24xx_va_gpio2 = S3C24XX_VA_GPIO; 57void __iomem *s3c24xx_va_gpio2 = S3C24XX_VA_GPIO;
@@ -92,7 +93,7 @@ void __init s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no)
92 /* rename devices that are s3c2412/s3c2413 specific */ 93 /* rename devices that are s3c2412/s3c2413 specific */
93 s3c_device_sdi.name = "s3c2412-sdi"; 94 s3c_device_sdi.name = "s3c2412-sdi";
94 s3c_device_lcd.name = "s3c2412-lcd"; 95 s3c_device_lcd.name = "s3c2412-lcd";
95 s3c_device_nand.name = "s3c2412-nand"; 96 s3c_nand_setname("s3c2412-nand");
96 97
97 /* alter IRQ of SDI controller */ 98 /* alter IRQ of SDI controller */
98 99
diff --git a/arch/arm/mach-s3c2416/Kconfig b/arch/arm/mach-s3c2416/Kconfig
index 657e4fe17f39..87b9c9f003bd 100644
--- a/arch/arm/mach-s3c2416/Kconfig
+++ b/arch/arm/mach-s3c2416/Kconfig
@@ -25,6 +25,11 @@ config S3C2416_DMA
25 help 25 help
26 Internal config node for S3C2416 DMA support 26 Internal config node for S3C2416 DMA support
27 27
28config S3C2416_PM
29 bool
30 help
31 Internal config node to apply S3C2416 power management
32
28menu "S3C2416 Machines" 33menu "S3C2416 Machines"
29 34
30config MACH_SMDK2416 35config MACH_SMDK2416
@@ -33,6 +38,7 @@ config MACH_SMDK2416
33 select S3C_DEV_FB 38 select S3C_DEV_FB
34 select S3C_DEV_HSMMC 39 select S3C_DEV_HSMMC
35 select S3C_DEV_HSMMC1 40 select S3C_DEV_HSMMC1
41 select S3C2416_PM if PM
36 help 42 help
37 Say Y here if you are using an SMDK2416 43 Say Y here if you are using an SMDK2416
38 44
diff --git a/arch/arm/mach-s3c2416/Makefile b/arch/arm/mach-s3c2416/Makefile
index 6c12c7bf40ad..ef038d62ffdb 100644
--- a/arch/arm/mach-s3c2416/Makefile
+++ b/arch/arm/mach-s3c2416/Makefile
@@ -11,7 +11,7 @@ obj- :=
11 11
12obj-$(CONFIG_CPU_S3C2416) += s3c2416.o clock.o 12obj-$(CONFIG_CPU_S3C2416) += s3c2416.o clock.o
13obj-$(CONFIG_CPU_S3C2416) += irq.o 13obj-$(CONFIG_CPU_S3C2416) += irq.o
14 14obj-$(CONFIG_S3C2416_PM) += pm.o
15#obj-$(CONFIG_S3C2416_DMA) += dma.o 15#obj-$(CONFIG_S3C2416_DMA) += dma.o
16 16
17# Machine support 17# Machine support
diff --git a/arch/arm/mach-s3c2416/irq.c b/arch/arm/mach-s3c2416/irq.c
index 89f521d59d06..084d121f368c 100644
--- a/arch/arm/mach-s3c2416/irq.c
+++ b/arch/arm/mach-s3c2416/irq.c
@@ -243,6 +243,8 @@ static int __init s3c2416_irq_add(struct sys_device *sysdev)
243 243
244static struct sysdev_driver s3c2416_irq_driver = { 244static struct sysdev_driver s3c2416_irq_driver = {
245 .add = s3c2416_irq_add, 245 .add = s3c2416_irq_add,
246 .suspend = s3c24xx_irq_suspend,
247 .resume = s3c24xx_irq_resume,
246}; 248};
247 249
248static int __init s3c2416_irq_init(void) 250static int __init s3c2416_irq_init(void)
diff --git a/arch/arm/mach-s3c2416/pm.c b/arch/arm/mach-s3c2416/pm.c
new file mode 100644
index 000000000000..4a04205b04d5
--- /dev/null
+++ b/arch/arm/mach-s3c2416/pm.c
@@ -0,0 +1,84 @@
1/* linux/arch/arm/mach-s3c2416/pm.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S3C2416 - PM support (Based on Ben Dooks' S3C2412 PM support)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/sysdev.h>
14#include <linux/io.h>
15
16#include <asm/cacheflush.h>
17
18#include <mach/regs-power.h>
19#include <mach/regs-s3c2443-clock.h>
20
21#include <plat/cpu.h>
22#include <plat/pm.h>
23
24extern void s3c2412_sleep_enter(void);
25
26static void s3c2416_cpu_suspend(void)
27{
28 flush_cache_all();
29
30 /* enable wakeup sources regardless of battery state */
31 __raw_writel(S3C2443_PWRCFG_SLEEP, S3C2443_PWRCFG);
32
33 /* set the mode as sleep, 2BED represents "Go to BED" */
34 __raw_writel(0x2BED, S3C2443_PWRMODE);
35
36 s3c2412_sleep_enter();
37}
38
39static void s3c2416_pm_prepare(void)
40{
41 /*
42 * write the magic value u-boot uses to check for resume into
43 * the INFORM0 register, and ensure INFORM1 is set to the
44 * correct address to resume from.
45 */
46 __raw_writel(0x2BED, S3C2412_INFORM0);
47 __raw_writel(virt_to_phys(s3c_cpu_resume), S3C2412_INFORM1);
48}
49
50static int s3c2416_pm_add(struct sys_device *sysdev)
51{
52 pm_cpu_prep = s3c2416_pm_prepare;
53 pm_cpu_sleep = s3c2416_cpu_suspend;
54
55 return 0;
56}
57
58static int s3c2416_pm_suspend(struct sys_device *dev, pm_message_t state)
59{
60 return 0;
61}
62
63static int s3c2416_pm_resume(struct sys_device *dev)
64{
65 /* unset the return-from-sleep amd inform flags */
66 __raw_writel(0x0, S3C2443_PWRMODE);
67 __raw_writel(0x0, S3C2412_INFORM0);
68 __raw_writel(0x0, S3C2412_INFORM1);
69
70 return 0;
71}
72
73static struct sysdev_driver s3c2416_pm_driver = {
74 .add = s3c2416_pm_add,
75 .suspend = s3c2416_pm_suspend,
76 .resume = s3c2416_pm_resume,
77};
78
79static __init int s3c2416_pm_init(void)
80{
81 return sysdev_driver_register(&s3c2416_sysclass, &s3c2416_pm_driver);
82}
83
84arch_initcall(s3c2416_pm_init);
diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c2416/s3c2416.c
index bc30245e133b..63f39cdc0972 100644
--- a/arch/arm/mach-s3c2416/s3c2416.c
+++ b/arch/arm/mach-s3c2416/s3c2416.c
@@ -56,6 +56,7 @@
56 56
57#include <plat/iic-core.h> 57#include <plat/iic-core.h>
58#include <plat/fb-core.h> 58#include <plat/fb-core.h>
59#include <plat/nand-core.h>
59 60
60static struct map_desc s3c2416_iodesc[] __initdata = { 61static struct map_desc s3c2416_iodesc[] __initdata = {
61 IODESC_ENT(WATCHDOG), 62 IODESC_ENT(WATCHDOG),
@@ -100,7 +101,7 @@ void __init s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no)
100{ 101{
101 s3c24xx_init_uartdevs("s3c2440-uart", s3c2410_uart_resources, cfg, no); 102 s3c24xx_init_uartdevs("s3c2440-uart", s3c2410_uart_resources, cfg, no);
102 103
103 s3c_device_nand.name = "s3c2416-nand"; 104 s3c_nand_setname("s3c2412-nand");
104} 105}
105 106
106/* s3c2416_map_io 107/* s3c2416_map_io
diff --git a/arch/arm/mach-s3c2440/s3c244x.c b/arch/arm/mach-s3c2440/s3c244x.c
index 5e4a97e76533..90c1707b9c95 100644
--- a/arch/arm/mach-s3c2440/s3c244x.c
+++ b/arch/arm/mach-s3c2440/s3c244x.c
@@ -44,6 +44,7 @@
44#include <plat/cpu.h> 44#include <plat/cpu.h>
45#include <plat/pm.h> 45#include <plat/pm.h>
46#include <plat/pll.h> 46#include <plat/pll.h>
47#include <plat/nand-core.h>
47 48
48static struct map_desc s3c244x_iodesc[] __initdata = { 49static struct map_desc s3c244x_iodesc[] __initdata = {
49 IODESC_ENT(CLKPWR), 50 IODESC_ENT(CLKPWR),
@@ -68,7 +69,7 @@ void __init s3c244x_map_io(void)
68 69
69 s3c_device_sdi.name = "s3c2440-sdi"; 70 s3c_device_sdi.name = "s3c2440-sdi";
70 s3c_device_i2c0.name = "s3c2440-i2c"; 71 s3c_device_i2c0.name = "s3c2440-i2c";
71 s3c_device_nand.name = "s3c2440-nand"; 72 s3c_nand_setname("s3c2440-nand");
72 s3c_device_ts.name = "s3c2440-ts"; 73 s3c_device_ts.name = "s3c2440-ts";
73 s3c_device_usbgadget.name = "s3c2440-usbgadget"; 74 s3c_device_usbgadget.name = "s3c2440-usbgadget";
74} 75}
diff --git a/arch/arm/mach-s3c2443/s3c2443.c b/arch/arm/mach-s3c2443/s3c2443.c
index 839b6b2ced74..33d18dd1ebd5 100644
--- a/arch/arm/mach-s3c2443/s3c2443.c
+++ b/arch/arm/mach-s3c2443/s3c2443.c
@@ -36,6 +36,7 @@
36#include <plat/devs.h> 36#include <plat/devs.h>
37#include <plat/cpu.h> 37#include <plat/cpu.h>
38#include <plat/fb-core.h> 38#include <plat/fb-core.h>
39#include <plat/nand-core.h>
39 40
40static struct map_desc s3c2443_iodesc[] __initdata = { 41static struct map_desc s3c2443_iodesc[] __initdata = {
41 IODESC_ENT(WATCHDOG), 42 IODESC_ENT(WATCHDOG),
@@ -62,7 +63,7 @@ int __init s3c2443_init(void)
62 63
63 s3c24xx_reset_hook = s3c2443_hard_reset; 64 s3c24xx_reset_hook = s3c2443_hard_reset;
64 65
65 s3c_device_nand.name = "s3c2412-nand"; 66 s3c_nand_setname("s3c2412-nand");
66 s3c_fb_setname("s3c2443-fb"); 67 s3c_fb_setname("s3c2443-fb");
67 68
68 /* change WDT IRQ number */ 69 /* change WDT IRQ number */
diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/plat-s3c24xx/common-smdk.c
index 7b44d0c592b5..bcc43f346272 100644
--- a/arch/arm/plat-s3c24xx/common-smdk.c
+++ b/arch/arm/plat-s3c24xx/common-smdk.c
@@ -147,7 +147,7 @@ static struct mtd_partition smdk_default_nand_part[] = {
147 [7] = { 147 [7] = {
148 .name = "S3C2410 flash partition 7", 148 .name = "S3C2410 flash partition 7",
149 .offset = SZ_1M * 48, 149 .offset = SZ_1M * 48,
150 .size = SZ_16M, 150 .size = MTDPART_SIZ_FULL,
151 } 151 }
152}; 152};
153 153
diff --git a/arch/arm/plat-samsung/include/plat/nand-core.h b/arch/arm/plat-samsung/include/plat/nand-core.h
new file mode 100644
index 000000000000..6de20789a95e
--- /dev/null
+++ b/arch/arm/plat-samsung/include/plat/nand-core.h
@@ -0,0 +1,28 @@
1/* arch/arm/plat-samsung/include/plat/nand-core.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S3C - Nand Controller core functions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_NAND_CORE_H
14#define __ASM_ARCH_NAND_CORE_H __FILE__
15
16/* These functions are only for use with the core support code, such as
17 * the cpu specific initialisation code
18 */
19
20/* re-define device name depending on support. */
21static inline void s3c_nand_setname(char *name)
22{
23#ifdef CONFIG_S3C_DEV_NAND
24 s3c_device_nand.name = name;
25#endif
26}
27
28#endif /* __ASM_ARCH_NAND_CORE_H */