1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-11-01 19:05:51 +01:00

mtd: nand: Store nand ID in struct nand_chip

Upstream linux commit 7f501f0a72036d.

Store the NAND ID in struct nand_chip to avoid passing id_data and id_len
as function parameters.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
This commit is contained in:
Michael Trimarchi
2022-07-20 18:22:05 +02:00
parent 1ca6f9483e
commit bd87603d5a
2 changed files with 44 additions and 29 deletions

View File

@@ -507,6 +507,19 @@ static inline void nand_hw_control_init(struct nand_hw_control *nfc)
init_waitqueue_head(&nfc->wq);
}
/* The maximum expected count of bytes in the NAND ID sequence */
#define NAND_MAX_ID_LEN 8
/**
* struct nand_id - NAND id structure
* @data: buffer containing the id bytes.
* @len: ID length.
*/
struct nand_id {
u8 data[NAND_MAX_ID_LEN];
int len;
};
/**
* struct nand_ecc_step_info - ECC step information of ECC engine
* @stepsize: data bytes per ECC step
@@ -888,6 +901,8 @@ nand_get_sdr_timings(const struct nand_data_interface *conf)
struct nand_chip {
struct mtd_info mtd;
struct nand_id id;
void __iomem *IO_ADDR_R;
void __iomem *IO_ADDR_W;