1 /* Handle mapping of the flash on the ASB2303 board
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
11 #include <linux/init.h>
12 #include <linux/platform_device.h>
13 #include <linux/mtd/partitions.h>
14 #include <linux/mtd/physmap.h>
16 #define ASB2303_PROM_ADDR 0xA0000000 /* Boot PROM */
17 #define ASB2303_PROM_SIZE (2 * 1024 * 1024)
18 #define ASB2303_FLASH_ADDR 0xA4000000 /* System Flash */
19 #define ASB2303_FLASH_SIZE (32 * 1024 * 1024)
20 #define ASB2303_CONFIG_ADDR 0xA6000000 /* System Config EEPROM */
21 #define ASB2303_CONFIG_SIZE (8 * 1024)
24 * default MTD partition table for both main flash devices, expected to be
25 * overridden by RedBoot
27 static struct mtd_partition asb2303_partitions[] = {
32 .mask_flags = MTD_CAP_ROM /* force read-only */
39 .size = MTDPART_SIZ_FULL,
45 * the ASB2303 Boot PROM definition
47 static struct physmap_flash_data asb2303_bootprom_data = {
50 .parts = asb2303_partitions,
53 static struct resource asb2303_bootprom_resource = {
54 .start = ASB2303_PROM_ADDR,
55 .end = ASB2303_PROM_ADDR + ASB2303_PROM_SIZE,
56 .flags = IORESOURCE_MEM,
59 static struct platform_device asb2303_bootprom = {
60 .name = "physmap-flash",
62 .dev.platform_data = &asb2303_bootprom_data,
64 .resource = &asb2303_bootprom_resource,
68 * the ASB2303 System Flash definition
70 static struct physmap_flash_data asb2303_sysflash_data = {
73 .parts = asb2303_partitions,
76 static struct resource asb2303_sysflash_resource = {
77 .start = ASB2303_FLASH_ADDR,
78 .end = ASB2303_FLASH_ADDR + ASB2303_FLASH_SIZE,
79 .flags = IORESOURCE_MEM,
82 static struct platform_device asb2303_sysflash = {
83 .name = "physmap-flash",
85 .dev.platform_data = &asb2303_sysflash_data,
87 .resource = &asb2303_sysflash_resource,
91 * register the ASB2303 flashes
93 static int __init asb2303_mtd_init(void)
95 platform_device_register(&asb2303_bootprom);
96 platform_device_register(&asb2303_sysflash);
100 module_init(asb2303_mtd_init);