diff --git a/sys/dev/nand/nand.h b/sys/dev/nand/nand.h index 0d6d7b453d7..d2aa6619591 100644 --- a/sys/dev/nand/nand.h +++ b/sys/dev/nand/nand.h @@ -122,7 +122,8 @@ MALLOC_DECLARE(M_NAND); #define NAND_MAN_SAMSUNG 0xec #define NAND_MAN_HYNIX 0xad -#define NAND_MAN_STMICRO 0x20 +#define NAND_MAN_STMICRO 0x20 +#define NAND_MAN_MICRON 0x2c struct nand_id { uint8_t man_id; diff --git a/sys/dev/nand/nand_generic.c b/sys/dev/nand/nand_generic.c index 85e81beb6b6..2e78ab609a6 100644 --- a/sys/dev/nand/nand_generic.c +++ b/sys/dev/nand/nand_generic.c @@ -341,8 +341,12 @@ onfi_read_parameter(struct nand_chip *chip, struct onfi_params *params) NANDBUS_READ_BUFFER(nandbus, params, sizeof(struct onfi_params)); + if (memcmp(params->signature, "ONFI", sizeof(params->signature))) { + device_printf(chip->dev, "Error: bad signature\n"); + return (ENXIO); + } + /* TODO */ - /* Check for signature */ /* Check CRC */ /* Use redundant page if necessary */ diff --git a/sys/dev/nand/nand_id.c b/sys/dev/nand/nand_id.c index 76c5f9fd3bb..89008085723 100644 --- a/sys/dev/nand/nand_id.c +++ b/sys/dev/nand/nand_id.c @@ -47,6 +47,8 @@ struct nand_params nand_ids[] = { 0x80, 0x200, 0x10, 0x20, 0 }, { { NAND_MAN_STMICRO, 0xf1 }, "STMicro 128MB 3,3V 8-bit", 0x80, 2048, 64, 0x40, 0 }, + { { NAND_MAN_MICRON, 0xcc }, "Micron NAND 512MiB 3,3V 16-bit", + 0x200, 2048, 64, 0x40, 0 }, }; struct nand_params *nand_get_params(struct nand_id *id)