Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360354
b: refs/heads/master
c: 81f53ff
h: refs/heads/master
v: v3
  • Loading branch information
Uwe Kleine-König authored and Artem Bityutskiy committed Feb 4, 2013
1 parent de1564f commit 384b59e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 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: a2f74a7dacc1c17a0b146eb3112217874c5db436
refs/heads/master: 81f53ff89c136b72fc35a91d676aca2bc332bd33
2 changes: 1 addition & 1 deletion trunk/drivers/mtd/maps/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ config MTD_GPIO_ADDR

config MTD_UCLINUX
bool "Generic uClinux RAM/ROM filesystem support"
depends on MTD_RAM=y && (!MMU || COLDFIRE)
depends on (MTD_RAM=y || MTD_ROM=y) && (!MMU || COLDFIRE)
help
Map driver to support image based filesystems for uClinux.

Expand Down
24 changes: 19 additions & 5 deletions trunk/drivers/mtd/maps/uclinux.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@

/****************************************************************************/

#ifdef CONFIG_MTD_ROM
#define MAP_NAME "rom"
#else
#define MAP_NAME "ram"
#endif

struct map_info uclinux_ram_map = {
.name = "RAM",
.phys = (unsigned long)__bss_stop,
.name = MAP_NAME,
.size = 0,
};

static unsigned long physaddr = -1;
module_param(physaddr, ulong, S_IRUGO);

static struct mtd_info *uclinux_ram_mtdinfo;

/****************************************************************************/
Expand Down Expand Up @@ -60,11 +68,17 @@ static int __init uclinux_mtd_init(void)
struct map_info *mapp;

mapp = &uclinux_ram_map;

if (physaddr == -1)
mapp->phys = (resource_size_t)__bss_stop;
else
mapp->phys = physaddr;

if (!mapp->size)
mapp->size = PAGE_ALIGN(ntohl(*((unsigned long *)(mapp->phys + 8))));
mapp->bankwidth = 4;

printk("uclinux[mtd]: RAM probe address=0x%x size=0x%x\n",
printk("uclinux[mtd]: probe address=0x%x size=0x%x\n",
(int) mapp->phys, (int) mapp->size);

/*
Expand All @@ -82,7 +96,7 @@ static int __init uclinux_mtd_init(void)

simple_map_init(mapp);

mtd = do_map_probe("map_ram", mapp);
mtd = do_map_probe("map_" MAP_NAME, mapp);
if (!mtd) {
printk("uclinux[mtd]: failed to find a mapping?\n");
return(-ENXIO);
Expand Down Expand Up @@ -118,6 +132,6 @@ module_exit(uclinux_mtd_cleanup);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Greg Ungerer <gerg@snapgear.com>");
MODULE_DESCRIPTION("Generic RAM based MTD for uClinux");
MODULE_DESCRIPTION("Generic MTD for uClinux");

/****************************************************************************/

0 comments on commit 384b59e

Please sign in to comment.