diff options
author | Heiko Stuebner <heiko@sntech.de> | 2012-03-07 04:47:11 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2012-03-07 04:47:11 -0500 |
commit | ec2cc753f47bfb4ce3584eb8cd9119340617bf12 (patch) | |
tree | 5419b4255c07996e6ea6ed52f6fd7a85758daf92 /arch/arm/mach-s3c24xx/simtec-nor.c | |
parent | 9072dc983fb1743b711791a63ddfe5a7a52ef361 (diff) |
ARM: S3C24XX: Consolidate Simtec extensions
The Simtec extension didn't follow a specific naming scheme for files
and config options until now. This distributed the files throughout
the whole mach-s3c24xx directory.
This patch fixes the naming of files and option names and also creates
a simtec.h header instead of using many one-liners.
As the plat/audio-simtec.h only contains the platform-data struct now,
it can also move to include/sound in a later patch.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s3c24xx/simtec-nor.c')
-rw-r--r-- | arch/arm/mach-s3c24xx/simtec-nor.c | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c24xx/simtec-nor.c b/arch/arm/mach-s3c24xx/simtec-nor.c new file mode 100644 index 000000000000..2119ca6a73bc --- /dev/null +++ b/arch/arm/mach-s3c24xx/simtec-nor.c | |||
@@ -0,0 +1,87 @@ | |||
1 | /* linux/arch/arm/mach-s3c2410/nor-simtec.c | ||
2 | * | ||
3 | * Copyright (c) 2008 Simtec Electronics | ||
4 | * http://armlinux.simtec.co.uk/ | ||
5 | * Ben Dooks <ben@simtec.co.uk> | ||
6 | * | ||
7 | * Simtec NOR mapping | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/module.h> | ||
15 | #include <linux/types.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | |||
20 | #include <linux/mtd/mtd.h> | ||
21 | #include <linux/mtd/map.h> | ||
22 | #include <linux/mtd/physmap.h> | ||
23 | #include <linux/mtd/partitions.h> | ||
24 | |||
25 | #include <asm/mach/arch.h> | ||
26 | #include <asm/mach/map.h> | ||
27 | #include <asm/mach/irq.h> | ||
28 | |||
29 | #include <mach/map.h> | ||
30 | #include <mach/bast-map.h> | ||
31 | #include <mach/bast-cpld.h> | ||
32 | |||
33 | #include "simtec.h" | ||
34 | |||
35 | static void simtec_nor_vpp(struct platform_device *pdev, int vpp) | ||
36 | { | ||
37 | unsigned int val; | ||
38 | unsigned long flags; | ||
39 | |||
40 | local_irq_save(flags); | ||
41 | val = __raw_readb(BAST_VA_CTRL3); | ||
42 | |||
43 | printk(KERN_DEBUG "%s(%d)\n", __func__, vpp); | ||
44 | |||
45 | if (vpp) | ||
46 | val |= BAST_CPLD_CTRL3_ROMWEN; | ||
47 | else | ||
48 | val &= ~BAST_CPLD_CTRL3_ROMWEN; | ||
49 | |||
50 | __raw_writeb(val, BAST_VA_CTRL3); | ||
51 | local_irq_restore(flags); | ||
52 | } | ||
53 | |||
54 | static struct physmap_flash_data simtec_nor_pdata = { | ||
55 | .width = 2, | ||
56 | .set_vpp = simtec_nor_vpp, | ||
57 | .nr_parts = 0, | ||
58 | }; | ||
59 | |||
60 | static struct resource simtec_nor_resource[] = { | ||
61 | [0] = { | ||
62 | .start = S3C2410_CS1 + 0x4000000, | ||
63 | .end = S3C2410_CS1 + 0x4000000 + SZ_8M - 1, | ||
64 | .flags = IORESOURCE_MEM, | ||
65 | } | ||
66 | }; | ||
67 | |||
68 | static struct platform_device simtec_device_nor = { | ||
69 | .name = "physmap-flash", | ||
70 | .id = -1, | ||
71 | .num_resources = ARRAY_SIZE(simtec_nor_resource), | ||
72 | .resource = simtec_nor_resource, | ||
73 | .dev = { | ||
74 | .platform_data = &simtec_nor_pdata, | ||
75 | }, | ||
76 | }; | ||
77 | |||
78 | void __init nor_simtec_init(void) | ||
79 | { | ||
80 | int ret; | ||
81 | |||
82 | ret = platform_device_register(&simtec_device_nor); | ||
83 | if (ret < 0) | ||
84 | printk(KERN_ERR "failed to register physmap-flash device\n"); | ||
85 | else | ||
86 | simtec_nor_vpp(NULL, 1); | ||
87 | } | ||