From: Arnaud Mouiche <arnaud.mouiche@gmail.com>
To: Peter Pan <peterpandong@micron.com>,
boris.brezillon@free-electrons.com, richard@nod.at,
computersforpeace@gmail.com, thomas.petazzoni@free-electrons.com,
linux-mtd@lists.infradead.org
Cc: peterpansjtu@gmail.com, linshunquan1@hisilicon.com
Subject: Re: [PATCH v3 3/8] nand: spi: add basic blocks for infrastructure
Date: Fri, 17 Mar 2017 11:20:14 +0100 [thread overview]
Message-ID: <43bedbd0-0a0c-e30d-2158-fcf7c936480d@gmail.com> (raw)
In-Reply-To: <1489646857-10112-4-git-send-email-peterpandong@micron.com>
[...]
> +/*
> + * spinand_detect - [SPI NAND Interface] detect the SPI NAND device
> + * @chip: SPI NAND device structure
> + */
> +int spinand_detect(struct spinand_device *chip)
> +{
> + struct nand_device *nand = &chip->base;
> + u8 raw_id[SPINAND_MAX_ID_LEN] = {0};
> + u8 id[SPINAND_MAX_ID_LEN] = {0};
> + int ret;
> +
> + spinand_reset(chip);
> + spinand_read_id(chip, raw_id);
> + ret = spinand_manufacturer_detect(chip, raw_id, id);
> + if (ret)
Would be great to return an error or warning message when the raw_id
doesn't match any known manufacturer, or when the manufacturer doesn't
know about this device.
something like:
pr_err("SPI NAND: unknown raw ID %*phN\n", SPINAND_MAX_ID_LEN, raw_id);
> + return ret;
> +
> + spinand_fill_id(chip, id);
> +
> + pr_info("SPI NAND: %s is found.\n", chip->name);
> + pr_info("Manufacturer ID: 0x%02x, Chip ID: 0x%02x\n",
> + spinand_get_mfr_id(chip), spinand_get_dev_id(chip));
> + pr_info("%d MiB, block size: %d KiB, page size: %d, OOB size: %d\n",
> + (int)(nand_size(nand) >> 20), nand_eraseblock_size(nand) >> 10,
> + nand_page_size(nand), nand_per_page_oobsize(nand));
> +
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(spinand_detect);
> +
next prev parent reply other threads:[~2017-03-17 10:20 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-16 6:47 [PATCH v3 0/8] Introduction to SPI NAND framework Peter Pan
2017-03-16 6:47 ` [PATCH v3 1/8] mtd: nand: add more helpers in nand.h Peter Pan
2017-03-17 13:07 ` Boris Brezillon
2017-03-20 4:51 ` Peter Pan
2017-03-16 6:47 ` [PATCH v3 2/8] mtd: nand: add oob iterator in nand_for_each_page Peter Pan
2017-03-17 13:11 ` Boris Brezillon
2017-03-20 4:52 ` Peter Pan
2017-03-16 6:47 ` [PATCH v3 3/8] nand: spi: add basic blocks for infrastructure Peter Pan
2017-03-16 9:55 ` Boris Brezillon
2017-03-17 5:45 ` Peter Pan
2017-03-17 10:20 ` Arnaud Mouiche [this message]
2017-03-17 10:22 ` Peter Pan
2017-03-17 13:38 ` Boris Brezillon
2017-03-20 4:55 ` Peter Pan
2017-03-16 6:47 ` [PATCH v3 4/8] nand: spi: add basic operations support Peter Pan
2017-03-17 10:33 ` Arnaud Mouiche
2017-03-17 10:49 ` Peter Pan
2017-03-17 11:02 ` Boris Brezillon
2017-03-17 11:09 ` Peter Pan
2017-03-17 11:12 ` Boris Brezillon
2017-03-17 11:18 ` Peter Pan
2017-03-16 6:47 ` [PATCH v3 5/8] nand: spi: Add bad block support Peter Pan
2017-03-17 12:22 ` Arnaud Mouiche
2017-03-17 12:31 ` Boris Brezillon
2017-03-20 4:49 ` Peter Pan
2017-03-16 6:47 ` [PATCH v3 6/8] nand: spi: add Micron spi nand support Peter Pan
2017-03-16 6:47 ` [PATCH v3 7/8] nand: spi: Add generic SPI controller support Peter Pan
2017-03-17 14:20 ` Boris Brezillon
2017-03-17 17:32 ` Arnaud Mouiche
2017-03-17 17:48 ` Boris Brezillon
2017-03-20 4:58 ` Peter Pan
2017-03-20 5:56 ` Boris Brezillon
2017-03-20 7:15 ` Peter Pan
2017-03-16 6:47 ` [PATCH v3 8/8] MAINTAINERS: Add SPI NAND entry Peter Pan
2017-03-17 10:02 ` [PATCH v3 0/8] Introduction to SPI NAND framework Arnaud Mouiche
2017-03-17 10:34 ` Peter Pan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43bedbd0-0a0c-e30d-2158-fcf7c936480d@gmail.com \
--to=arnaud.mouiche@gmail.com \
--cc=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=linshunquan1@hisilicon.com \
--cc=linux-mtd@lists.infradead.org \
--cc=peterpandong@micron.com \
--cc=peterpansjtu@gmail.com \
--cc=richard@nod.at \
--cc=thomas.petazzoni@free-electrons.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox