aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-02-08 07:19:48 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:30 -0500
commitdaeb51e62cacde31c8245866e1096ff79a0c83fe (patch)
tree57b71cf23b1c701ff2492f301bed79da77340e87
parentb920de1b77b72ca9432ac3f97edb26541e65e5dd (diff)
mn10300: add platform MTD support for the ASB2303 board
Add platform MTD support for the ASB2303 board. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/mn10300/configs/asb2303_defconfig5
-rw-r--r--arch/mn10300/unit-asb2303/Makefile2
-rw-r--r--arch/mn10300/unit-asb2303/flash.c100
3 files changed, 105 insertions, 2 deletions
diff --git a/arch/mn10300/configs/asb2303_defconfig b/arch/mn10300/configs/asb2303_defconfig
index 0189a058da9f..ca9876a111d3 100644
--- a/arch/mn10300/configs/asb2303_defconfig
+++ b/arch/mn10300/configs/asb2303_defconfig
@@ -282,7 +282,10 @@ CONFIG_MTD_CFI_UTIL=y
282# Mapping drivers for chip access 282# Mapping drivers for chip access
283# 283#
284# CONFIG_MTD_COMPLEX_MAPPINGS is not set 284# CONFIG_MTD_COMPLEX_MAPPINGS is not set
285# CONFIG_MTD_PHYSMAP is not set 285CONFIG_MTD_PHYSMAP=y
286CONFIG_MTD_PHYSMAP_START=0x8000000
287CONFIG_MTD_PHYSMAP_LEN=0x0
288CONFIG_MTD_PHYSMAP_BANKWIDTH=2
286# CONFIG_MTD_PLATRAM is not set 289# CONFIG_MTD_PLATRAM is not set
287 290
288# 291#
diff --git a/arch/mn10300/unit-asb2303/Makefile b/arch/mn10300/unit-asb2303/Makefile
index 03e579fa99d0..38a5bb43b0bb 100644
--- a/arch/mn10300/unit-asb2303/Makefile
+++ b/arch/mn10300/unit-asb2303/Makefile
@@ -3,4 +3,4 @@
3# Makefile for the ASB2303 board 3# Makefile for the ASB2303 board
4# 4#
5############################################################################### 5###############################################################################
6obj-y := unit-init.o smc91111.o leds.o 6obj-y := unit-init.o smc91111.o flash.o leds.o
diff --git a/arch/mn10300/unit-asb2303/flash.c b/arch/mn10300/unit-asb2303/flash.c
new file mode 100644
index 000000000000..17fe083fcb6f
--- /dev/null
+++ b/arch/mn10300/unit-asb2303/flash.c
@@ -0,0 +1,100 @@
1/* Handle mapping of the flash on the ASB2303 board
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
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.
10 */
11#include <linux/init.h>
12#include <linux/platform_device.h>
13#include <linux/mtd/partitions.h>
14#include <linux/mtd/physmap.h>
15
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)
22
23/*
24 * default MTD partition table for both main flash devices, expected to be
25 * overridden by RedBoot
26 */
27static struct mtd_partition asb2303_partitions[] = {
28 {
29 .name = "Bootloader",
30 .size = 0x00040000,
31 .offset = 0,
32 .mask_flags = MTD_CAP_ROM /* force read-only */
33 }, {
34 .name = "Kernel",
35 .size = 0x00400000,
36 .offset = 0x00040000,
37 }, {
38 .name = "Filesystem",
39 .size = MTDPART_SIZ_FULL,
40 .offset = 0x00440000
41 }
42};
43
44/*
45 * the ASB2303 Boot PROM definition
46 */
47static struct physmap_flash_data asb2303_bootprom_data = {
48 .width = 2,
49 .nr_parts = 1,
50 .parts = asb2303_partitions,
51};
52
53static struct resource asb2303_bootprom_resource = {
54 .start = ASB2303_PROM_ADDR,
55 .end = ASB2303_PROM_ADDR + ASB2303_PROM_SIZE,
56 .flags = IORESOURCE_MEM,
57};
58
59static struct platform_device asb2303_bootprom = {
60 .name = "physmap-flash",
61 .id = 0,
62 .dev.platform_data = &asb2303_bootprom_data,
63 .num_resources = 1,
64 .resource = &asb2303_bootprom_resource,
65};
66
67/*
68 * the ASB2303 System Flash definition
69 */
70static struct physmap_flash_data asb2303_sysflash_data = {
71 .width = 4,
72 .nr_parts = 1,
73 .parts = asb2303_partitions,
74};
75
76static struct resource asb2303_sysflash_resource = {
77 .start = ASB2303_FLASH_ADDR,
78 .end = ASB2303_FLASH_ADDR + ASB2303_FLASH_SIZE,
79 .flags = IORESOURCE_MEM,
80};
81
82static struct platform_device asb2303_sysflash = {
83 .name = "physmap-flash",
84 .id = 1,
85 .dev.platform_data = &asb2303_sysflash_data,
86 .num_resources = 1,
87 .resource = &asb2303_sysflash_resource,
88};
89
90/*
91 * register the ASB2303 flashes
92 */
93static int __init asb2303_mtd_init(void)
94{
95 platform_device_register(&asb2303_bootprom);
96 platform_device_register(&asb2303_sysflash);
97 return 0;
98}
99
100module_init(asb2303_mtd_init);