2 * board-sg.c -- support for the SnapGear KS8695 based boards
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
9 #include <linux/kernel.h>
10 #include <linux/types.h>
11 #include <linux/init.h>
12 #include <linux/platform_device.h>
13 #include <linux/mtd/mtd.h>
14 #include <linux/mtd/map.h>
15 #include <linux/mtd/physmap.h>
16 #include <linux/mtd/partitions.h>
17 #include <asm/mach-types.h>
18 #include <asm/mach/arch.h>
19 #include <mach/devices.h>
23 * The SG310 machine type is fitted with a conventional 8MB Strataflash
24 * device. Define its partitioning.
26 #define FL_BASE 0x02000000
29 static struct mtd_partition sg_mtd_partitions
[] = {
31 .name
= "SnapGear Boot Loader",
35 .name
= "SnapGear non-volatile configuration",
40 .name
= "SnapGear image",
41 .offset
= SZ_512K
+ SZ_256K
,
44 .name
= "SnapGear StrataFlash",
47 .name
= "SnapGear Boot Tags",
53 static struct physmap_flash_data sg_mtd_pdata
= {
55 .nr_parts
= ARRAY_SIZE(sg_mtd_partitions
),
56 .parts
= sg_mtd_partitions
,
60 static struct resource sg_mtd_resource
[] = {
63 .end
= FL_BASE
+ FL_SIZE
- 1,
64 .flags
= IORESOURCE_MEM
,
68 static struct platform_device sg_mtd_device
= {
69 .name
= "physmap-flash",
71 .num_resources
= ARRAY_SIZE(sg_mtd_resource
),
72 .resource
= sg_mtd_resource
,
74 .platform_data
= &sg_mtd_pdata
,
78 static void __init
sg_init(void)
80 ks8695_add_device_lan();
81 ks8695_add_device_wan();
83 if (machine_is_sg310())
84 platform_device_register(&sg_mtd_device
);
87 #ifdef CONFIG_MACH_LITE300
88 MACHINE_START(LITE300
, "SecureComputing/SG300")
91 .map_io
= ks8695_map_io
,
92 .init_irq
= ks8695_init_irq
,
93 .init_machine
= sg_init
,
94 .init_time
= ks8695_timer_init
,
95 .restart
= ks8695_restart
,
99 #ifdef CONFIG_MACH_SG310
100 MACHINE_START(SG310
, "McAfee/SG310")
102 .atag_offset
= 0x100,
103 .map_io
= ks8695_map_io
,
104 .init_irq
= ks8695_init_irq
,
105 .init_machine
= sg_init
,
106 .init_time
= ks8695_timer_init
,
107 .restart
= ks8695_restart
,
111 #ifdef CONFIG_MACH_SE4200
112 MACHINE_START(SE4200
, "SecureComputing/SE4200")
114 .atag_offset
= 0x100,
115 .map_io
= ks8695_map_io
,
116 .init_irq
= ks8695_init_irq
,
117 .init_machine
= sg_init
,
118 .init_time
= ks8695_timer_init
,
119 .restart
= ks8695_restart
,