mtd: nand: create bb devices automatically
When a mtd device can have bad blocks we want to create a bb device, so do this automatically. This allows us to drop bb device creation from the environment. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
33d4f7cb3d
commit
1a8800458b
|
@ -1 +0,0 @@
|
|||
nand -a /dev/nand0.*
|
|
@ -7,10 +7,6 @@ export PATH
|
|||
|
||||
if [ -e /dev/nand0 ]; then
|
||||
addpart /dev/nand0 $nand_parts
|
||||
|
||||
# Uh, oh, hush first expands wildcards and then starts executing
|
||||
# commands. What a bug!
|
||||
source /env/bin/hush_hack
|
||||
fi
|
||||
|
||||
if [ -z $eth0.ethaddr ]; then
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
nand -a /dev/nand0.*
|
|
@ -7,10 +7,6 @@ export PATH
|
|||
|
||||
if [ -e /dev/nand0 ]; then
|
||||
addpart /dev/nand0 $nand_parts
|
||||
|
||||
# Uh, oh, hush first expands wildcards and then starts executing
|
||||
# commands. What a bug!
|
||||
source /env/bin/hush_hack
|
||||
fi
|
||||
|
||||
if [ -z $eth0.ethaddr ]; then
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
nand -a /dev/nand0.*
|
|
@ -10,10 +10,6 @@ fi
|
|||
|
||||
if [ -e /dev/nand0 ]; then
|
||||
addpart /dev/nand0 $nand_parts
|
||||
|
||||
# Uh, oh, hush first expands wildcards and then starts executing
|
||||
# commands. What a bug!
|
||||
source /env/bin/hush_hack
|
||||
fi
|
||||
|
||||
if [ -f /env/logo.bmp ]; then
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
nand -a /dev/nand0.*
|
|
@ -10,10 +10,6 @@ fi
|
|||
|
||||
if [ -e /dev/nand0 ]; then
|
||||
addpart /dev/nand0 $nand_parts
|
||||
|
||||
# Uh, oh, hush first expands wildcards and then starts executing
|
||||
# commands. What a bug!
|
||||
source /env/bin/hush_hack
|
||||
fi
|
||||
|
||||
echo
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
nand -a /dev/nand0.*
|
|
@ -10,10 +10,6 @@ fi
|
|||
|
||||
if [ -e /dev/nand0 ]; then
|
||||
addpart /dev/nand0 $nand_parts
|
||||
|
||||
# Uh, oh, hush first expands wildcards and then starts executing
|
||||
# commands. What a bug!
|
||||
source /env/bin/hush_hack
|
||||
fi
|
||||
|
||||
if [ -z $eth0.ethaddr ]; then
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
nand -a /dev/nand0.*
|
|
@ -10,10 +10,6 @@ fi
|
|||
|
||||
if [ -e /dev/nand0 ]; then
|
||||
addpart /dev/nand0 $nand_parts
|
||||
|
||||
# Uh, oh, hush first expands wildcards and then starts executing
|
||||
# commands. What a bug!
|
||||
source /env/bin/hush_hack
|
||||
fi
|
||||
|
||||
if [ -z $eth0.ethaddr ]; then
|
||||
|
|
|
@ -16,7 +16,6 @@ fi
|
|||
|
||||
if [ -e /dev/nand0 -a -n "$nand_parts" ]; then
|
||||
addpart /dev/nand0 $nand_parts
|
||||
nand -a /dev/nand0.*
|
||||
fi
|
||||
|
||||
if [ -f /env/bin/init_board ]; then
|
||||
|
|
|
@ -39,10 +39,6 @@ fi
|
|||
addpart -n /dev/${device} "$parts" || exit
|
||||
mkdir -p /tmp/mtdparts/${device}
|
||||
|
||||
if [ -n "${bbdev}" ]; then
|
||||
nand -a /dev/${device}.*
|
||||
fi
|
||||
|
||||
if [ -n ${kernelname} ]; then
|
||||
global linux.mtdparts.${device}
|
||||
global.linux.mtdparts.${device}="${kernelname}:${parts}"
|
||||
|
|
|
@ -409,6 +409,9 @@ int add_mtd_device(struct mtd_info *mtd, char *devname, int device_id)
|
|||
|
||||
devfs_create(&mtd->cdev);
|
||||
|
||||
if (mtd_can_have_bb(mtd))
|
||||
mtd->cdev_bb = mtd_add_bb(mtd, NULL);
|
||||
|
||||
if (mtd->parent && !mtd->master)
|
||||
of_parse_partitions(&mtd->cdev, mtd->parent->device_node);
|
||||
|
||||
|
|
|
@ -61,9 +61,6 @@ struct cdev *of_parse_partition(struct cdev *cdev, struct device_node *node)
|
|||
|
||||
new = devfs_add_partition(cdev->name, offset, size, flags, filename);
|
||||
|
||||
if (cdev->mtd && cdev->mtd->type == MTD_NANDFLASH)
|
||||
dev_add_bb_dev(filename, NULL);
|
||||
|
||||
free(filename);
|
||||
|
||||
return new;
|
||||
|
|
|
@ -211,6 +211,8 @@ struct mtd_info {
|
|||
struct device_d *parent;
|
||||
struct cdev cdev;
|
||||
|
||||
struct cdev *cdev_bb;
|
||||
|
||||
struct param_d param_size;
|
||||
char *size_str;
|
||||
|
||||
|
|
Loading…
Reference in New Issue