Commit 7f84f915 authored by David Woodhouse's avatar David Woodhouse Committed by David Woodhouse

MTD map driver update: Alchemy DB1xxx boards

- Change Pete Popov's email address
- Tglx's __iomem fixes
- Include file cleanups
Signed-Off-By: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent d6909cf6
/*
* Flash memory access on Alchemy Db1550 board
*
* $Id: db1550-flash.c,v 1.3 2004/07/14 17:45:40 dwmw2 Exp $
* $Id: db1550-flash.c,v 1.6 2004/10/20 05:50:19 ppopov Exp $
*
* (C) 2004 Embedded Edge, LLC, based on db1550-flash.c:
* (C) 2003 Pete Popov <pete_popov@yahoo.com>
* (C) 2003, 2004 Pete Popov <ppopov@embeddedalley.com>
*
*/
......@@ -19,7 +19,6 @@
#include <linux/mtd/partitions.h>
#include <asm/io.h>
#include <asm/au1000.h>
#ifdef DEBUG_RW
#define DBG(x...) printk(x)
......@@ -132,7 +131,7 @@ int setup_flash_params(void)
window_addr = 0x1C000000;
window_size = 0x4000000;
#else /* USER ONLY */
window_addr = 0x1E000000;
window_addr = 0x18000000;
window_size = 0x4000000;
#endif
return 0;
......@@ -160,10 +159,10 @@ int __init db1550_mtd_init(void)
* Now let's probe for the actual flash. Do it here since
* specific machine settings might have been set above.
*/
printk(KERN_NOTICE "Pb1550 flash: probing %d-bit flash bus\n",
printk(KERN_NOTICE "Db1550 flash: probing %d-bit flash bus\n",
db1550_map.bankwidth*8);
db1550_map.virt =
(unsigned long)ioremap(window_addr, window_size);
(void __iomem *)ioremap(window_addr, window_size);
mymtd = do_map_probe("cfi_probe", &db1550_map);
if (!mymtd) return -ENXIO;
mymtd->owner = THIS_MODULE;
......@@ -177,6 +176,7 @@ static void __exit db1550_mtd_cleanup(void)
if (mymtd) {
del_mtd_partitions(mymtd);
map_destroy(mymtd);
iounmap((void *) db1550_map.virt);
}
}
......
/*
* Flash memory access on Alchemy Db1xxx boards
*
* $Id: db1x00-flash.c,v 1.3 2004/07/14 17:45:40 dwmw2 Exp $
* $Id: db1x00-flash.c,v 1.5 2004/09/18 23:22:35 ppopov Exp $
*
* (C) 2003 Pete Popov <ppopov@pacbell.net>
* (C) 2003 Pete Popov <ppopov@embeddedalley.com>
*
*/
......@@ -18,8 +18,6 @@
#include <linux/mtd/partitions.h>
#include <asm/io.h>
#include <asm/au1000.h>
#include <asm/db1x00.h>
#ifdef DEBUG_RW
#define DBG(x...) printk(x)
......@@ -27,11 +25,20 @@
#define DBG(x...)
#endif
/* MTD CONFIG OPTIONS */
#if defined(CONFIG_MTD_DB1X00_BOOT) && defined(CONFIG_MTD_DB1X00_USER)
#define DB1X00_BOTH_BANKS
#elif defined(CONFIG_MTD_DB1X00_BOOT) && !defined(CONFIG_MTD_DB1X00_USER)
#define DB1X00_BOOT_ONLY
#elif !defined(CONFIG_MTD_DB1X00_BOOT) && defined(CONFIG_MTD_DB1X00_USER)
#define DB1X00_USER_ONLY
#endif
static unsigned long window_addr;
static unsigned long window_size;
static unsigned long flash_size;
static BCSR * const bcsr = (BCSR *)0xAE000000;
static unsigned short *bcsr = (unsigned short *)0xAE000000;
static unsigned char flash_bankwidth = 4;
/*
......@@ -113,7 +120,7 @@ static struct mtd_info *db1xxx_mtd;
*/
int setup_flash_params(void)
{
switch ((bcsr->status >> 14) & 0x3) {
switch ((bcsr[2] >> 14) & 0x3) {
case 0: /* 64Mbit devices */
flash_size = 0x800000; /* 8MB per part */
#if defined(DB1X00_BOTH_BANKS)
......@@ -192,7 +199,7 @@ int __init db1x00_mtd_init(void)
*/
printk(KERN_NOTICE "Db1xxx flash: probing %d-bit flash bus\n",
db1xxx_mtd_map.bankwidth*8);
db1xxx_mtd_map.virt = (unsigned long)ioremap(window_addr, window_size);
db1xxx_mtd_map.virt = (void __iomem *)ioremap(window_addr, window_size);
db1xxx_mtd = do_map_probe("cfi_probe", &db1xxx_mtd_map);
if (!db1xxx_mtd) return -ENXIO;
db1xxx_mtd->owner = THIS_MODULE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment