should the BB's version of u-boot support "nand lock/unlock"?

after noticing the references to running "nand unlock" to reflash
parts of the BB, i was puzzled as to why configuring u-boot for the
beagle does *not* add in support for those nand subcommands.

  the relevant part of cmd_nand.c in the u-boot source is:

#ifdef CONFIG_CMD_NAND_LOCK_UNLOCK
        if (strcmp(cmd, "lock") == 0) {
                int tight = 0;
                int status = 0;
... etc etc ...

i can see last year's u-boot commit that defined that proprocessor
test:

commit 50657c273278f74378e1ac39b41d612b92fdffa0
Author: Nishanth Menon <menon.nishanth@gmail.com>

    NAND: Enable nand lock, unlock feature

    Enable nand lock, unlock and status of lock feature.
    Not every device and platform requires this, hence,
    it is under define for CONFIG_CMD_NAND_LOCK_UNLOCK
    ...

but:

$ grep -r LOCK_UNLOCK *
CHANGELOG: it is under define for CONFIG_CMD_NAND_LOCK_UNLOCK
common/cmd_nand.c:#ifdef CONFIG_CMD_NAND_LOCK_UNLOCK
common/cmd_nand.c:#ifdef CONFIG_CMD_NAND_LOCK_UNLOCK
common/cmd_nand.c:#ifdef CONFIG_CMD_NAND_LOCK_UNLOCK
drivers/mtd/nand/nand_util.c:#ifdef CONFIG_CMD_NAND_LOCK_UNLOCK
include/configs/omap3_zoom2.h:#define CONFIG_CMD_NAND_LOCK_UNLOCK
include/configs/omap3_zoom1.h:#define CONFIG_CMD_NAND_LOCK_UNLOCK
include/configs/devkit8000.h:#define CONFIG_CMD_NAND_LOCK_UNLOCK
$

shouldn't that be defined for the beagle if it's defined for the
similar devkit8000? or am i misreading something? this is the master
u-boot branch, not a TI or ARM-specific branch.

rday

that depends on the LOCK pin being pulled in the right manner for the
NAND chip concerned. NOT all boards are wired equally. E.g. zoom2
which uses the same NAND chip has the LOCK pin pulled in the manner
which requires the additional unlock command. this is not true for
beagleboard.

Further ref: NAND datasheet I suppose
Regards,
Nishanth Menon

ok, fair enough. i only pointed that out since the script(s) that
are part of the current validation set of files explicitly run "nand
unlock", even though that's clearly not supported by the BB.

rday

yep.. carry over from the "bad old days" when the patch was not
applied.. trouble is we'd get unlock command not found.. but it is a
nuisance rather than a pain.. further, you could "in theory" have
similar instructions across multiple platforms..

but I agree, they dont make sense for beagleboard..
Regards,
NM

ok, just wanted to verify i wasn't misunderstanding. thanks.

rday