GTA04 U-Boot

GTA04 U-Boot Commit Details

Date:2009-04-24 15:59:35 (4 years 27 days ago)
Author:Stefan Roese
Branch:gta04
Commit:dbe29e36a4c2775b69b5a63b0ce2bac89c08e691
Parents: 10bb62d85a0850dbad1fdd34123378686373f166
Message:mtd: nand/onenand: Register mtd device upon device scanning

With this patch the NAND and OneNAND devices are registered in the MTD
subsystem and can then be referenced by the mtdcore code (e.g.
get_mtd_device_nm()). This is needed for the new "ubi part" command
syntax without the flash type parameter (nor|nand|onenand).

Signed-off-by: Stefan Roese <sr@denx.de>
Changes:
Mdrivers/mtd/nand/nand.c (2 diffs)
Mdrivers/mtd/onenand/onenand_uboot.c (2 diffs)

File differences

drivers/mtd/nand/nand.c
3737
3838
3939
40
4041
4142
4243
4344
4445
46
4547
4648
4749
......
5456
5557
5658
59
60
61
62
63
64
65
66
67
68
5769
5870
5971
static ulong base_address[CONFIG_SYS_MAX_NAND_DEVICE] = CONFIG_SYS_NAND_BASE_LIST;
static const char default_nand_name[] = "nand";
static __attribute__((unused)) char dev_name[CONFIG_SYS_MAX_NAND_DEVICE][8];
static void nand_init_chip(struct mtd_info *mtd, struct nand_chip *nand,
ulong base_addr)
{
int maxchips = CONFIG_SYS_NAND_MAX_CHIPS;
int __attribute__((unused)) i = 0;
if (maxchips < 1)
maxchips = 1;
mtd->name = (char *)default_nand_name;
else
mtd->name += gd->reloc_off;
#ifdef CONFIG_MTD_PARTITIONS
/*
* Add MTD device so that we can reference it later
* via the mtdcore infrastructure (e.g. ubi).
*/
sprintf(dev_name[i], "nand%d", i);
mtd->name = dev_name[i++];
add_mtd_device(mtd);
#endif
} else
mtd->name = NULL;
} else {
drivers/mtd/onenand/onenand_uboot.c
2020
2121
2222
23
2324
2425
2526
......
4142
4243
4344
45
46
47
48
49
50
51
52
53
4454
struct mtd_info onenand_mtd;
struct onenand_chip onenand_chip;
static __attribute__((unused)) char dev_name[] = "onenand0";
void onenand_init(void)
{
puts("OneNAND: ");
print_size(onenand_mtd.size, "\n");
#ifdef CONFIG_MTD_PARTITIONS
/*
* Add MTD device so that we can reference it later
* via the mtdcore infrastructure (e.g. ubi).
*/
onenand_mtd.name = dev_name;
add_mtd_device(&onenand_mtd);
#endif
}

Archive Download the corresponding diff file

Branches

Tags