this allows to read full NAND model name, which is useful to
distinguish between POP parts that both have the same manufacturer/device
id, but different RAM.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
return 0;
}
+/* reads parameter page */
+int nand_read_param_page(unsigned char *data, unsigned int size)
+{
+ unsigned int i;
+
+ NAND_ENABLE_CE();
+
+ if (NanD_Command(NAND_CMD_RESET)) {
+ NAND_DISABLE_CE();
+ return 1;
+ }
+
+ if (NanD_Command(NAND_CMD_READPARAM)) {
+ NAND_DISABLE_CE();
+ return 1;
+ }
+
+ NanD_Address(ADDR_COLUMN, 0);
+ delay(10000);
+
+ for (i = 0; i < size; i++) {
+ data[i] = READ_NAND(NAND_ADDR);
+ delay(10);
+ }
+
+ NAND_DISABLE_CE();
+ return 0;
+}
+
/* read chip mfr and id
* return 0 if they match board config
* return 1 if not
#define NAND_CMD_READOOB 0x50
#define NAND_CMD_STATUS 0x70
#define NAND_CMD_READID 0x90
+#define NAND_CMD_READPARAM 0xec
#define NAND_CMD_RESET 0xff
/* Extended Commands for Large page devices */
int nand_chip(void);
int nand_read_block(uchar *buf, ulong block_addr);
+int nand_readid(int *mfr, int *id);
+int nand_read_param_page(unsigned char *data, unsigned int size);
int onenand_chip(void);
int onenand_read_block(unsigned char *buf, ulong block);