Lines Matching refs:p
29 struct nand_jedec_params *p; in nand_jedec_detect() local
45 p = kzalloc(sizeof(*p), GFP_KERNEL); in nand_jedec_detect()
46 if (!p) in nand_jedec_detect()
54 ret = nand_read_param_page_op(chip, 0x40, p, in nand_jedec_detect()
55 sizeof(*p)); in nand_jedec_detect()
57 ret = nand_read_data_op(chip, p, sizeof(*p), true, in nand_jedec_detect()
60 ret = nand_change_read_column_op(chip, sizeof(*p) * i, in nand_jedec_detect()
61 p, sizeof(*p), true); in nand_jedec_detect()
67 crc = onfi_crc16(ONFI_CRC_BASE, (u8 *)p, 510); in nand_jedec_detect()
68 if (crc == le16_to_cpu(p->crc)) in nand_jedec_detect()
78 val = le16_to_cpu(p->revision); in nand_jedec_detect()
89 sanitize_string(p->manufacturer, sizeof(p->manufacturer)); in nand_jedec_detect()
90 sanitize_string(p->model, sizeof(p->model)); in nand_jedec_detect()
91 chip->parameters.model = kstrdup(p->model, GFP_KERNEL); in nand_jedec_detect()
97 if (p->opt_cmd[0] & JEDEC_OPT_CMD_READ_CACHE) in nand_jedec_detect()
100 memorg->pagesize = le32_to_cpu(p->byte_per_page); in nand_jedec_detect()
105 1 << (fls(le32_to_cpu(p->pages_per_block)) - 1); in nand_jedec_detect()
108 memorg->oobsize = le16_to_cpu(p->spare_bytes_per_page); in nand_jedec_detect()
111 memorg->luns_per_target = p->lun_count; in nand_jedec_detect()
112 memorg->planes_per_lun = 1 << p->multi_plane_addr; in nand_jedec_detect()
116 1 << (fls(le32_to_cpu(p->blocks_per_lun)) - 1); in nand_jedec_detect()
117 memorg->bits_per_cell = p->bits_per_cell; in nand_jedec_detect()
119 if (le16_to_cpu(p->features) & JEDEC_FEATURE_16_BIT_BUS) in nand_jedec_detect()
123 ecc = &p->ecc_info[0]; in nand_jedec_detect()
139 kfree(p); in nand_jedec_detect()