18 #include <linux/kernel.h>
19 #include <linux/module.h>
25 #include <linux/slab.h>
26 #include <linux/types.h>
31 #include <asm/unaligned.h>
33 #define pr_devinit(fmt, args...) ({ static const __devinitconst char __fmt[] = fmt; printk(__fmt, ## args); })
35 #define DRIVER_NAME "bfin-async-flash"
76 switch_to_flash(state);
86 static void bfin_flash_copy_from(
struct map_info *map,
void *to,
unsigned long from,
ssize_t len)
90 switch_to_flash(state);
104 switch_to_flash(state);
112 static void bfin_flash_copy_to(
struct map_info *map,
unsigned long to,
const void *from,
ssize_t len)
116 switch_to_flash(state);
124 static const char *part_probe_types[] = {
"cmdlinepart",
"RedBoot",
NULL };
139 state->
map.read = bfin_flash_read;
140 state->
map.copy_from = bfin_flash_copy_from;
141 state->
map.write = bfin_flash_write;
142 state->
map.copy_to = bfin_flash_copy_to;
143 state->
map.bankwidth = pdata->
width;
144 state->
map.size = resource_size(memory);
147 state->
map.map_priv_1 = (
unsigned long)
state;
170 platform_set_drvdata(pdev, state);
177 struct async_state *state = platform_get_drvdata(pdev);
186 .probe = bfin_flash_probe,
196 MODULE_DESCRIPTION(
"MTD map driver for Blackfins with flash/ethernet on same async bank");