tangled
alpha
login
or
join now
tjh.dev
/
kernel
1
fork
atom
Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1
fork
atom
overview
issues
pulls
pipelines
Merge branch 'sa11x0-mtd' into sa11x0
Russell King
14 years ago
e7d863d0
c2132010
-112
1 changed file
expand all
collapse all
unified
split
drivers
mtd
maps
sa1100-flash.c
-112
drivers/mtd/maps/sa1100-flash.c
reviewed
···
23
23
#include <asm/sizes.h>
24
24
#include <asm/mach/flash.h>
25
25
26
26
-
#if 0
27
27
-
/*
28
28
-
* This is here for documentation purposes only - until these people
29
29
-
* submit their machine types. It will be gone January 2005.
30
30
-
*/
31
31
-
static struct mtd_partition consus_partitions[] = {
32
32
-
{
33
33
-
.name = "Consus boot firmware",
34
34
-
.offset = 0,
35
35
-
.size = 0x00040000,
36
36
-
.mask_flags = MTD_WRITABLE, /* force read-only */
37
37
-
}, {
38
38
-
.name = "Consus kernel",
39
39
-
.offset = 0x00040000,
40
40
-
.size = 0x00100000,
41
41
-
.mask_flags = 0,
42
42
-
}, {
43
43
-
.name = "Consus disk",
44
44
-
.offset = 0x00140000,
45
45
-
/* The rest (up to 16M) for jffs. We could put 0 and
46
46
-
make it find the size automatically, but right now
47
47
-
i have 32 megs. jffs will use all 32 megs if given
48
48
-
the chance, and this leads to horrible problems
49
49
-
when you try to re-flash the image because blob
50
50
-
won't erase the whole partition. */
51
51
-
.size = 0x01000000 - 0x00140000,
52
52
-
.mask_flags = 0,
53
53
-
}, {
54
54
-
/* this disk is a secondary disk, which can be used as
55
55
-
needed, for simplicity, make it the size of the other
56
56
-
consus partition, although realistically it could be
57
57
-
the remainder of the disk (depending on the file
58
58
-
system used) */
59
59
-
.name = "Consus disk2",
60
60
-
.offset = 0x01000000,
61
61
-
.size = 0x01000000 - 0x00140000,
62
62
-
.mask_flags = 0,
63
63
-
}
64
64
-
};
65
65
-
66
66
-
/* Frodo has 2 x 16M 28F128J3A flash chips in bank 0: */
67
67
-
static struct mtd_partition frodo_partitions[] =
68
68
-
{
69
69
-
{
70
70
-
.name = "bootloader",
71
71
-
.size = 0x00040000,
72
72
-
.offset = 0x00000000,
73
73
-
.mask_flags = MTD_WRITEABLE
74
74
-
}, {
75
75
-
.name = "bootloader params",
76
76
-
.size = 0x00040000,
77
77
-
.offset = MTDPART_OFS_APPEND,
78
78
-
.mask_flags = MTD_WRITEABLE
79
79
-
}, {
80
80
-
.name = "kernel",
81
81
-
.size = 0x00100000,
82
82
-
.offset = MTDPART_OFS_APPEND,
83
83
-
.mask_flags = MTD_WRITEABLE
84
84
-
}, {
85
85
-
.name = "ramdisk",
86
86
-
.size = 0x00400000,
87
87
-
.offset = MTDPART_OFS_APPEND,
88
88
-
.mask_flags = MTD_WRITEABLE
89
89
-
}, {
90
90
-
.name = "file system",
91
91
-
.size = MTDPART_SIZ_FULL,
92
92
-
.offset = MTDPART_OFS_APPEND
93
93
-
}
94
94
-
};
95
95
-
96
96
-
static struct mtd_partition jornada56x_partitions[] = {
97
97
-
{
98
98
-
.name = "bootldr",
99
99
-
.size = 0x00040000,
100
100
-
.offset = 0,
101
101
-
.mask_flags = MTD_WRITEABLE,
102
102
-
}, {
103
103
-
.name = "rootfs",
104
104
-
.size = MTDPART_SIZ_FULL,
105
105
-
.offset = MTDPART_OFS_APPEND,
106
106
-
}
107
107
-
};
108
108
-
109
109
-
static void jornada56x_set_vpp(int vpp)
110
110
-
{
111
111
-
if (vpp)
112
112
-
GPSR = GPIO_GPIO26;
113
113
-
else
114
114
-
GPCR = GPIO_GPIO26;
115
115
-
GPDR |= GPIO_GPIO26;
116
116
-
}
117
117
-
118
118
-
/*
119
119
-
* Machine Phys Size set_vpp
120
120
-
* Consus : SA1100_CS0_PHYS SZ_32M
121
121
-
* Frodo : SA1100_CS0_PHYS SZ_32M
122
122
-
* Jornada56x: SA1100_CS0_PHYS SZ_32M jornada56x_set_vpp
123
123
-
*/
124
124
-
#endif
125
125
-
126
26
struct sa_subdev_info {
127
27
char name[16];
128
28
struct map_info map;
···
273
373
return 0;
274
374
}
275
375
276
276
-
#ifdef CONFIG_PM
277
277
-
static void sa1100_mtd_shutdown(struct platform_device *dev)
278
278
-
{
279
279
-
struct sa_info *info = platform_get_drvdata(dev);
280
280
-
if (info && mtd_suspend(info->mtd) == 0)
281
281
-
mtd_resume(info->mtd);
282
282
-
}
283
283
-
#else
284
284
-
#define sa1100_mtd_shutdown NULL
285
285
-
#endif
286
286
-
287
376
static struct platform_driver sa1100_mtd_driver = {
288
377
.probe = sa1100_mtd_probe,
289
378
.remove = __exit_p(sa1100_mtd_remove),
290
290
-
.shutdown = sa1100_mtd_shutdown,
291
379
.driver = {
292
380
.name = "sa1100-mtd",
293
381
.owner = THIS_MODULE,