diff options
author | Manuel Lauss <manuel.lauss@googlemail.com> | 2009-10-19 06:53:37 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-02-27 06:52:59 -0500 |
commit | 206aa6cdadad8bbedee5649f1346fe47e922a039 (patch) | |
tree | 1b66e9d98b65d7afe962bb6c6989f3ad212f2e6d /drivers/mtd | |
parent | 8facefd0907ae16f96a35bef7ce654206d87c2fc (diff) |
MIPS: Alchemy: physmap-flash for all devboards
Replace the devboard NOR MTD mapping driver with physmap-flash support.
Also honor the "swapboot" switch settings wrt. to the layout of the
NOR partitions.
Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Cc: Linux-MIPS <linux-mips@linux-mips.org>
Acked-By: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/maps/Kconfig | 6 | ||||
-rw-r--r-- | drivers/mtd/maps/Makefile | 1 | ||||
-rw-r--r-- | drivers/mtd/maps/alchemy-flash.c | 166 |
3 files changed, 0 insertions, 173 deletions
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig index 2de0cc823d60..2bb03a8b9ef1 100644 --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig | |||
@@ -251,12 +251,6 @@ config MTD_NETtel | |||
251 | help | 251 | help |
252 | Support for flash chips on NETtel/SecureEdge/SnapGear boards. | 252 | Support for flash chips on NETtel/SecureEdge/SnapGear boards. |
253 | 253 | ||
254 | config MTD_ALCHEMY | ||
255 | tristate "AMD Alchemy Pb1xxx/Db1xxx/RDK MTD support" | ||
256 | depends on SOC_AU1X00 && MTD_PARTITIONS && MTD_CFI | ||
257 | help | ||
258 | Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards | ||
259 | |||
260 | config MTD_DILNETPC | 254 | config MTD_DILNETPC |
261 | tristate "CFI Flash device mapped on DIL/Net PC" | 255 | tristate "CFI Flash device mapped on DIL/Net PC" |
262 | depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT && BROKEN | 256 | depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT && BROKEN |
diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile index ce315214ff2b..a44919f3f3d2 100644 --- a/drivers/mtd/maps/Makefile +++ b/drivers/mtd/maps/Makefile | |||
@@ -40,7 +40,6 @@ obj-$(CONFIG_MTD_SCx200_DOCFLASH)+= scx200_docflash.o | |||
40 | obj-$(CONFIG_MTD_DBOX2) += dbox2-flash.o | 40 | obj-$(CONFIG_MTD_DBOX2) += dbox2-flash.o |
41 | obj-$(CONFIG_MTD_SOLUTIONENGINE)+= solutionengine.o | 41 | obj-$(CONFIG_MTD_SOLUTIONENGINE)+= solutionengine.o |
42 | obj-$(CONFIG_MTD_PCI) += pci.o | 42 | obj-$(CONFIG_MTD_PCI) += pci.o |
43 | obj-$(CONFIG_MTD_ALCHEMY) += alchemy-flash.o | ||
44 | obj-$(CONFIG_MTD_AUTCPU12) += autcpu12-nvram.o | 43 | obj-$(CONFIG_MTD_AUTCPU12) += autcpu12-nvram.o |
45 | obj-$(CONFIG_MTD_EDB7312) += edb7312.o | 44 | obj-$(CONFIG_MTD_EDB7312) += edb7312.o |
46 | obj-$(CONFIG_MTD_IMPA7) += impa7.o | 45 | obj-$(CONFIG_MTD_IMPA7) += impa7.o |
diff --git a/drivers/mtd/maps/alchemy-flash.c b/drivers/mtd/maps/alchemy-flash.c deleted file mode 100644 index 845ad4f2a542..000000000000 --- a/drivers/mtd/maps/alchemy-flash.c +++ /dev/null | |||
@@ -1,166 +0,0 @@ | |||
1 | /* | ||
2 | * Flash memory access on AMD Alchemy evaluation boards | ||
3 | * | ||
4 | * (C) 2003, 2004 Pete Popov <ppopov@embeddedalley.com> | ||
5 | */ | ||
6 | |||
7 | #include <linux/init.h> | ||
8 | #include <linux/module.h> | ||
9 | #include <linux/types.h> | ||
10 | #include <linux/kernel.h> | ||
11 | |||
12 | #include <linux/mtd/mtd.h> | ||
13 | #include <linux/mtd/map.h> | ||
14 | #include <linux/mtd/partitions.h> | ||
15 | |||
16 | #include <asm/io.h> | ||
17 | |||
18 | #ifdef CONFIG_MIPS_PB1000 | ||
19 | #define BOARD_MAP_NAME "Pb1000 Flash" | ||
20 | #define BOARD_FLASH_SIZE 0x00800000 /* 8MB */ | ||
21 | #define BOARD_FLASH_WIDTH 4 /* 32-bits */ | ||
22 | #endif | ||
23 | |||
24 | #ifdef CONFIG_MIPS_PB1500 | ||
25 | #define BOARD_MAP_NAME "Pb1500 Flash" | ||
26 | #define BOARD_FLASH_SIZE 0x04000000 /* 64MB */ | ||
27 | #define BOARD_FLASH_WIDTH 4 /* 32-bits */ | ||
28 | #endif | ||
29 | |||
30 | #ifdef CONFIG_MIPS_PB1100 | ||
31 | #define BOARD_MAP_NAME "Pb1100 Flash" | ||
32 | #define BOARD_FLASH_SIZE 0x04000000 /* 64MB */ | ||
33 | #define BOARD_FLASH_WIDTH 4 /* 32-bits */ | ||
34 | #endif | ||
35 | |||
36 | #ifdef CONFIG_MIPS_PB1550 | ||
37 | #define BOARD_MAP_NAME "Pb1550 Flash" | ||
38 | #define BOARD_FLASH_SIZE 0x08000000 /* 128MB */ | ||
39 | #define BOARD_FLASH_WIDTH 4 /* 32-bits */ | ||
40 | #endif | ||
41 | |||
42 | #ifdef CONFIG_MIPS_PB1200 | ||
43 | #define BOARD_MAP_NAME "Pb1200 Flash" | ||
44 | #define BOARD_FLASH_SIZE 0x08000000 /* 128MB */ | ||
45 | #define BOARD_FLASH_WIDTH 2 /* 16-bits */ | ||
46 | #endif | ||
47 | |||
48 | #ifdef CONFIG_MIPS_DB1000 | ||
49 | #define BOARD_MAP_NAME "Db1000 Flash" | ||
50 | #define BOARD_FLASH_SIZE 0x02000000 /* 32MB */ | ||
51 | #define BOARD_FLASH_WIDTH 4 /* 32-bits */ | ||
52 | #endif | ||
53 | |||
54 | #ifdef CONFIG_MIPS_DB1500 | ||
55 | #define BOARD_MAP_NAME "Db1500 Flash" | ||
56 | #define BOARD_FLASH_SIZE 0x02000000 /* 32MB */ | ||
57 | #define BOARD_FLASH_WIDTH 4 /* 32-bits */ | ||
58 | #endif | ||
59 | |||
60 | #ifdef CONFIG_MIPS_DB1100 | ||
61 | #define BOARD_MAP_NAME "Db1100 Flash" | ||
62 | #define BOARD_FLASH_SIZE 0x02000000 /* 32MB */ | ||
63 | #define BOARD_FLASH_WIDTH 4 /* 32-bits */ | ||
64 | #endif | ||
65 | |||
66 | #ifdef CONFIG_MIPS_DB1550 | ||
67 | #define BOARD_MAP_NAME "Db1550 Flash" | ||
68 | #define BOARD_FLASH_SIZE 0x08000000 /* 128MB */ | ||
69 | #define BOARD_FLASH_WIDTH 4 /* 32-bits */ | ||
70 | #endif | ||
71 | |||
72 | #ifdef CONFIG_MIPS_DB1200 | ||
73 | #define BOARD_MAP_NAME "Db1200 Flash" | ||
74 | #define BOARD_FLASH_SIZE 0x04000000 /* 64MB */ | ||
75 | #define BOARD_FLASH_WIDTH 2 /* 16-bits */ | ||
76 | #endif | ||
77 | |||
78 | #ifdef CONFIG_MIPS_BOSPORUS | ||
79 | #define BOARD_MAP_NAME "Bosporus Flash" | ||
80 | #define BOARD_FLASH_SIZE 0x01000000 /* 16MB */ | ||
81 | #define BOARD_FLASH_WIDTH 2 /* 16-bits */ | ||
82 | #endif | ||
83 | |||
84 | #ifdef CONFIG_MIPS_MIRAGE | ||
85 | #define BOARD_MAP_NAME "Mirage Flash" | ||
86 | #define BOARD_FLASH_SIZE 0x04000000 /* 64MB */ | ||
87 | #define BOARD_FLASH_WIDTH 4 /* 32-bits */ | ||
88 | #define USE_LOCAL_ACCESSORS /* why? */ | ||
89 | #endif | ||
90 | |||
91 | static struct map_info alchemy_map = { | ||
92 | .name = BOARD_MAP_NAME, | ||
93 | }; | ||
94 | |||
95 | static struct mtd_partition alchemy_partitions[] = { | ||
96 | { | ||
97 | .name = "User FS", | ||
98 | .size = BOARD_FLASH_SIZE - 0x00400000, | ||
99 | .offset = 0x0000000 | ||
100 | },{ | ||
101 | .name = "YAMON", | ||
102 | .size = 0x0100000, | ||
103 | .offset = MTDPART_OFS_APPEND, | ||
104 | .mask_flags = MTD_WRITEABLE | ||
105 | },{ | ||
106 | .name = "raw kernel", | ||
107 | .size = (0x300000 - 0x40000), /* last 256KB is yamon env */ | ||
108 | .offset = MTDPART_OFS_APPEND, | ||
109 | } | ||
110 | }; | ||
111 | |||
112 | static struct mtd_info *mymtd; | ||
113 | |||
114 | static int __init alchemy_mtd_init(void) | ||
115 | { | ||
116 | struct mtd_partition *parts; | ||
117 | int nb_parts = 0; | ||
118 | unsigned long window_addr; | ||
119 | unsigned long window_size; | ||
120 | |||
121 | /* Default flash buswidth */ | ||
122 | alchemy_map.bankwidth = BOARD_FLASH_WIDTH; | ||
123 | |||
124 | window_addr = 0x20000000 - BOARD_FLASH_SIZE; | ||
125 | window_size = BOARD_FLASH_SIZE; | ||
126 | |||
127 | /* | ||
128 | * Static partition definition selection | ||
129 | */ | ||
130 | parts = alchemy_partitions; | ||
131 | nb_parts = ARRAY_SIZE(alchemy_partitions); | ||
132 | alchemy_map.size = window_size; | ||
133 | |||
134 | /* | ||
135 | * Now let's probe for the actual flash. Do it here since | ||
136 | * specific machine settings might have been set above. | ||
137 | */ | ||
138 | printk(KERN_NOTICE BOARD_MAP_NAME ": probing %d-bit flash bus\n", | ||
139 | alchemy_map.bankwidth*8); | ||
140 | alchemy_map.virt = ioremap(window_addr, window_size); | ||
141 | mymtd = do_map_probe("cfi_probe", &alchemy_map); | ||
142 | if (!mymtd) { | ||
143 | iounmap(alchemy_map.virt); | ||
144 | return -ENXIO; | ||
145 | } | ||
146 | mymtd->owner = THIS_MODULE; | ||
147 | |||
148 | add_mtd_partitions(mymtd, parts, nb_parts); | ||
149 | return 0; | ||
150 | } | ||
151 | |||
152 | static void __exit alchemy_mtd_cleanup(void) | ||
153 | { | ||
154 | if (mymtd) { | ||
155 | del_mtd_partitions(mymtd); | ||
156 | map_destroy(mymtd); | ||
157 | iounmap(alchemy_map.virt); | ||
158 | } | ||
159 | } | ||
160 | |||
161 | module_init(alchemy_mtd_init); | ||
162 | module_exit(alchemy_mtd_cleanup); | ||
163 | |||
164 | MODULE_AUTHOR("Embedded Alley Solutions, Inc"); | ||
165 | MODULE_DESCRIPTION(BOARD_MAP_NAME " MTD driver"); | ||
166 | MODULE_LICENSE("GPL"); | ||