From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jagan Teki Date: Thu, 11 Aug 2016 13:37:35 +0530 Subject: [U-Boot] [PATCH v3 13/27] sf: sandbox: Fix ID exctract from spi_flash_info In-Reply-To: <1470902869-22570-1-git-send-email-jteki@openedev.com> References: <1470902869-22570-1-git-send-email-jteki@openedev.com> Message-ID: <1470902869-22570-13-git-send-email-jteki@openedev.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This patch fix the id exctract from spi_flash_info ids. Cc: Simon Glass Cc: Bin Meng Signed-off-by: Jagan Teki --- drivers/mtd/spi/sandbox.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c index cecebb0..09ce783 100644 --- a/drivers/mtd/spi/sandbox.c +++ b/drivers/mtd/spi/sandbox.c @@ -359,7 +359,8 @@ static int sandbox_sf_xfer(struct udevice *dev, unsigned int bitlen, debug(" id: off:%u tx:", sbsf->off); if (sbsf->off < IDCODE_LEN) { /* Extract correct byte from ID 0x00aabbcc */ - id = sbsf->data->jedec >> + id = ((JEDEC_MFR(sbsf->data) << 16) | + JEDEC_ID(sbsf->data)) >> (8 * (IDCODE_LEN - 1 - sbsf->off)); } else { id = 0; -- 2.7.4