Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283611
b: refs/heads/master
c: 603129a
h: refs/heads/master
i:
  283609: d7ff987
  283607: e7ae6ef
v: v3
  • Loading branch information
Paul Mundt committed Jan 12, 2012
1 parent a0b9b0c commit 2de3497
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 38 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b1bdd255661369cb6eb90b6e181169b5e6d0f9b6
refs/heads/master: 603129afe6f8174c6305498dd5903304c41cd00d
43 changes: 6 additions & 37 deletions trunk/arch/sh/boards/mach-rsk/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
#ifdef CONFIG_MTD
#include <linux/mtd/map.h>
#endif
#include <asm/machvec.h>
#include <asm/io.h>

static const char *part_probes[] = { "cmdlinepart", NULL };

static struct mtd_partition rsk_partitions[] = {
{
.name = "Bootloader",
Expand All @@ -39,9 +39,10 @@ static struct mtd_partition rsk_partitions[] = {
};

static struct physmap_flash_data flash_data = {
.parts = rsk_partitions,
.nr_parts = ARRAY_SIZE(rsk_partitions),
.width = 2,
.parts = rsk_partitions,
.nr_parts = ARRAY_SIZE(rsk_partitions),
.width = 2,
.part_probe_types = part_probes,
};

static struct resource flash_resource = {
Expand All @@ -60,44 +61,12 @@ static struct platform_device flash_device = {
},
};

#ifdef CONFIG_MTD
static const char *probes[] = { "cmdlinepart", NULL };

static struct map_info rsk_flash_map = {
.name = "RSK+ Flash",
.size = 0x400000,
.bankwidth = 2,
};

static struct mtd_info *flash_mtd;

static struct mtd_partition *parsed_partitions;

static void __init set_mtd_partitions(void)
{
int nr_parts = 0;

simple_map_init(&rsk_flash_map);
flash_mtd = do_map_probe("cfi_probe", &rsk_flash_map);
nr_parts = parse_mtd_partitions(flash_mtd, probes,
&parsed_partitions, 0);
/* If there is no partition table, used the hard coded table */
if (nr_parts > 0) {
flash_data.nr_parts = nr_parts;
flash_data.parts = parsed_partitions;
}
}
#else
static inline void set_mtd_partitions(void) {}
#endif

static struct platform_device *rsk_devices[] __initdata = {
&flash_device,
};

static int __init rsk_devices_setup(void)
{
set_mtd_partitions();
return platform_add_devices(rsk_devices,
ARRAY_SIZE(rsk_devices));
}
Expand Down

0 comments on commit 2de3497

Please sign in to comment.