From d9dfd7341b4e1febcf37c7a973c1f2f13b60f54d Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Mon, 19 Mar 2007 17:34:37 +0000 Subject: Preliminary ADM5120 support, marked as broken SVN-Revision: 6614 --- .../files/drivers/mtd/maps/adm5120_mtd.c | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 target/linux/adm5120-2.6/files/drivers/mtd/maps/adm5120_mtd.c (limited to 'target/linux/adm5120-2.6/files/drivers/mtd') diff --git a/target/linux/adm5120-2.6/files/drivers/mtd/maps/adm5120_mtd.c b/target/linux/adm5120-2.6/files/drivers/mtd/maps/adm5120_mtd.c new file mode 100644 index 0000000..a9e97cb --- /dev/null +++ b/target/linux/adm5120-2.6/files/drivers/mtd/maps/adm5120_mtd.c @@ -0,0 +1,55 @@ +/* + * Flash device on the ADM5120 board + * + * Copyright Jeroen Vreeken (pe1rxq@amsat.org), 2005 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License version + * 2 as published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include + +#define FLASH_PHYS_ADDR 0x1FC00000 +#define FLASH_SIZE 0x200000 + +static struct mtd_info *adm5120_mtd; + +static struct map_info adm5120_mtd_map = { + .name = "ADM5120", + .size = FLASH_SIZE, + .bankwidth = 2, + .phys = FLASH_PHYS_ADDR, +}; + +static int __init adm5120_mtd_init(void) +{ + printk(KERN_INFO "ADM5120 board flash (0x%x at 0x%x)\n", FLASH_SIZE, + FLASH_PHYS_ADDR); + adm5120_mtd_map.virt = ioremap_nocache(FLASH_PHYS_ADDR, FLASH_SIZE); + simple_map_init(&adm5120_mtd_map); + adm5120_mtd = do_map_probe("cfi_probe", &adm5120_mtd_map); + if (adm5120_mtd) { + adm5120_mtd->owner = THIS_MODULE; + add_mtd_device(adm5120_mtd); + return 0; + } + return -ENXIO; +} + +static void __exit adm5120_mtd_exit(void) +{ + del_mtd_device(adm5120_mtd); + map_destroy(adm5120_mtd); +} + +module_init(adm5120_mtd_init); +module_exit(adm5120_mtd_exit); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Jeroen Vreeken (pe1rxq@amsat.org)"); +MODULE_DESCRIPTION("MTD map driver for ADM5120 boards"); -- cgit v1.1