Release 4.7 drivers/mtd/maps/pxa2xx-flash.c
/*
* Map driver for Intel XScale PXA2xx platforms.
*
* Author: Nicolas Pitre
* Copyright: (C) 2001 MontaVista Software Inc.
*
* 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 <linux/module.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#include <asm/io.h>
#include <mach/hardware.h>
#include <asm/mach/flash.h>
#define CACHELINESIZE 32
static void pxa2xx_map_inval_cache(struct map_info *map, unsigned long from,
ssize_t len)
{
unsigned long start = (unsigned long)map->cached + from;
unsigned long end = start + len;
start &= ~(CACHELINESIZE - 1);
while (start < end) {
/* invalidate D cache line */
asm volatile ("mcr p15, 0, %0, c7, c6, 1" : : "r" (start));
start += CACHELINESIZE;
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
nicolas pitre | nicolas pitre | 41 | 63.08% | 1 | 50.00% |
todd poynor | todd poynor | 24 | 36.92% | 1 | 50.00% |
| Total | 65 | 100.00% | 2 | 100.00% |
struct pxa2xx_flash_info {
struct mtd_info *mtd;
struct map_info map;
};
static const char * const probes[] = { "RedBoot", "cmdlinepart", NULL };
static int pxa2xx_flash_probe(struct platform_device *pdev)
{
struct flash_platform_data *flash = dev_get_platdata(&pdev->dev);
struct pxa2xx_flash_info *info;
struct resource *res;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENODEV;
info = kzalloc(sizeof(struct pxa2xx_flash_info), GFP_KERNEL);
if (!info)
return -ENOMEM;
info->map.name = flash->name;
info->map.bankwidth = flash->width;
info->map.phys = res->start;
info->map.size = resource_size(res);
info->map.virt = ioremap(info->map.phys, info->map.size);
if (!info->map.virt) {
printk(KERN_WARNING "Failed to ioremap %s\n",
info->map.name);
return -ENOMEM;
}
info->map.cached =
ioremap_cached(info->map.phys, info->map.size);
if (!info->map.cached)
printk(KERN_WARNING "Failed to ioremap cached %s\n",
info->map.name);
info->map.inval_cache = pxa2xx_map_inval_cache;
simple_map_init(&info->map);
printk(KERN_NOTICE
"Probing %s at physical address 0x%08lx"
" (%d-bit bankwidth)\n",
info->map.name, (unsigned long)info->map.phys,
info->map.bankwidth * 8);
info->mtd = do_map_probe(flash->map_name, &info->map);
if (!info->mtd) {
iounmap((void *)info->map.virt);
if (info->map.cached)
iounmap(info->map.cached);
return -EIO;
}
info->mtd->dev.parent = &pdev->dev;
mtd_device_parse_register(info->mtd, probes, NULL, flash->parts,
flash->nr_parts);
platform_set_drvdata(pdev, info);
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
todd poynor | todd poynor | 326 | 91.83% | 1 | 9.09% |
frans klaver | frans klaver | 7 | 1.97% | 1 | 9.09% |
jonathan cameron | jonathan cameron | 6 | 1.69% | 1 | 9.09% |
lei ming | lei ming | 4 | 1.13% | 1 | 9.09% |
jingoo han | jingoo han | 4 | 1.13% | 1 | 9.09% |
joe perches | joe perches | 3 | 0.85% | 1 | 9.09% |
jamie iles | jamie iles | 1 | 0.28% | 1 | 9.09% |
artem bityutskiy | artem bityutskiy | 1 | 0.28% | 1 | 9.09% |
dmitry eremin-baryshkov | dmitry eremin-baryshkov | 1 | 0.28% | 1 | 9.09% |
julia lawall | julia lawall | 1 | 0.28% | 1 | 9.09% |
ard biesheuvel | ard biesheuvel | 1 | 0.28% | 1 | 9.09% |
| Total | 355 | 100.00% | 11 | 100.00% |
static int pxa2xx_flash_remove(struct platform_device *dev)
{
struct pxa2xx_flash_info *info = platform_get_drvdata(dev);
mtd_device_unregister(info->mtd);
map_destroy(info->mtd);
iounmap(info->map.virt);
if (info->map.cached)
iounmap(info->map.cached);
kfree(info);
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
todd poynor | todd poynor | 65 | 94.20% | 1 | 25.00% |
lei ming | lei ming | 2 | 2.90% | 1 | 25.00% |
jamie iles | jamie iles | 1 | 1.45% | 1 | 25.00% |
ard biesheuvel | ard biesheuvel | 1 | 1.45% | 1 | 25.00% |
| Total | 69 | 100.00% | 4 | 100.00% |
#ifdef CONFIG_PM
static void pxa2xx_flash_shutdown(struct platform_device *dev)
{
struct pxa2xx_flash_info *info = platform_get_drvdata(dev);
if (info && mtd_suspend(info->mtd) == 0)
mtd_resume(info->mtd);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
todd poynor | todd poynor | 37 | 90.24% | 1 | 25.00% |
lei ming | lei ming | 2 | 4.88% | 1 | 25.00% |
artem bityutskiy | artem bityutskiy | 2 | 4.88% | 2 | 50.00% |
| Total | 41 | 100.00% | 4 | 100.00% |
#else
#define pxa2xx_flash_shutdown NULL
#endif
static struct platform_driver pxa2xx_flash_driver = {
.driver = {
.name = "pxa2xx-flash",
},
.probe = pxa2xx_flash_probe,
.remove = pxa2xx_flash_remove,
.shutdown = pxa2xx_flash_shutdown,
};
module_platform_driver(pxa2xx_flash_driver);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Nicolas Pitre <nico@fluxnic.net>");
MODULE_DESCRIPTION("MTD map driver for Intel XScale PXA2xx");
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
todd poynor | todd poynor | 565 | 85.48% | 1 | 5.26% |
nicolas pitre | nicolas pitre | 46 | 6.96% | 2 | 10.53% |
lei ming | lei ming | 14 | 2.12% | 1 | 5.26% |
frans klaver | frans klaver | 7 | 1.06% | 1 | 5.26% |
jonathan cameron | jonathan cameron | 6 | 0.91% | 1 | 5.26% |
jingoo han | jingoo han | 4 | 0.61% | 1 | 5.26% |
artem bityutskiy | artem bityutskiy | 4 | 0.61% | 4 | 21.05% |
tejun heo | tejun heo | 3 | 0.45% | 1 | 5.26% |
joe perches | joe perches | 3 | 0.45% | 1 | 5.26% |
axel lin | axel lin | 2 | 0.30% | 1 | 5.26% |
ard biesheuvel | ard biesheuvel | 2 | 0.30% | 1 | 5.26% |
jamie iles | jamie iles | 2 | 0.30% | 1 | 5.26% |
dmitry eremin-baryshkov | dmitry eremin-baryshkov | 1 | 0.15% | 1 | 5.26% |
russell king | russell king | 1 | 0.15% | 1 | 5.26% |
julia lawall | julia lawall | 1 | 0.15% | 1 | 5.26% |
| Total | 661 | 100.00% | 19 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.