1 --- a/arch/mips/sibyte/swarm/platform.c
2 +++ b/arch/mips/sibyte/swarm/platform.c
4 #include <linux/platform_device.h>
5 #include <linux/ata_platform.h>
7 +#include <asm/addrspace.h>
8 #include <asm/sibyte/board.h>
9 #include <asm/sibyte/sb1250_genbus.h>
10 #include <asm/sibyte/sb1250_regs.h>
11 @@ -137,3 +138,71 @@ static int __init sb1250_device_init(voi
14 device_initcall(sb1250_device_init);
16 +#ifdef CONFIG_SIBYTE_RHONE
18 +#include <linux/mtd/partitions.h>
19 +#include <linux/mtd/physmap.h>
21 +/* The board has 16MB flash but CFE sets up only 2MB */
22 +#define PHYS_TO_K1(a) CKSEG1ADDR(a)
23 +#define BOOTROM_SIZE 0x100
25 +static void fixup_cs0_size(void)
27 + SBWRITECSR(((A_IO_EXT_CS_BASE(0)) + R_IO_EXT_MULT_SIZE), BOOTROM_SIZE);
30 +static struct mtd_partition flash_parts[] = {
33 + .offset = 0x00000000,
35 + .mask_flags = MTD_WRITEABLE,
39 + .offset = 0x00200000,
43 + .name = "environment",
44 + .offset = 0x00f00000,
46 + .mask_flags = MTD_WRITEABLE,
50 +static struct physmap_flash_data flash_data = {
52 + .nr_parts = ARRAY_SIZE(flash_parts),
53 + .parts = flash_parts,
56 +static struct resource flash_resource = {
57 + .start = 0x1fc00000,
59 + .flags = IORESOURCE_MEM,
62 +static struct platform_device flash_device = {
63 + .name = "physmap-flash",
65 + .resource = &flash_resource,
68 + .platform_data = &flash_data,
72 +static int __init flash_setup(void)
75 + platform_device_register(&flash_device);
80 +device_initcall(flash_setup);
82 +#endif /* CONFIG_SIBYTE_RHONE */