From patchwork Tue Mar 22 07:38:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 600456 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3qTlFg5y1zz9s5l for ; Tue, 22 Mar 2016 18:49:11 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D1955A783B; Tue, 22 Mar 2016 08:44:31 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HWvtEq6mHTl6; Tue, 22 Mar 2016 08:44:31 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3026CA7703; Tue, 22 Mar 2016 08:44:18 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2B895A782F for ; Tue, 22 Mar 2016 08:43:36 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pd0cnY5SA4Ku for ; Tue, 22 Mar 2016 08:43:36 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by theia.denx.de (Postfix) with ESMTPS id C1C67A77D2 for ; Tue, 22 Mar 2016 08:42:43 +0100 (CET) Received: by mail-pf0-f195.google.com with SMTP id u190so34377397pfb.2 for ; Tue, 22 Mar 2016 00:42:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=x9xUt+eNFskuUJSPWCFJ/ubUkItqPegL0nnrPn86Ll0=; b=hypfeMr/yhtjnrr3m2TuDAcy0PIAZ4U8J4qtNhVNsblbdXF3lrXrAzOWxyor3N+PWS WhKv0M62dFcqSwOZimAdRoAtJbzOkR7yNw0btIMnAdAGC29PYJ+fepygWZVILkccocnA SUvTAGJhdOxqHCKABR8iAkIBmXtZkaK415V93GHxAd4hhJSnuUPCdp3eN6vtMrWvTlTv fm3BoIB+lLPIOtm4SeJSfip9XFJNhqE2556BUQRzhJOXH2bJlDxmk7Yf3+Zoc8CTdPcT H4BVQ7M3DwytJRUMF9grqvy9KqMlfcejIG7mSz/f1LffjU9dJzqniNfIHA+VtdcZ5p65 vHcw== X-Gm-Message-State: AD7BkJLVNJLJVi9EHgeTzTtR7mF412yQqQdX3fUtVEuE+XzhhoswO7BflTyQaqoJjY7S/Q== X-Received: by 10.66.153.44 with SMTP id vd12mr51353178pab.82.1458632562476; Tue, 22 Mar 2016 00:42:42 -0700 (PDT) Received: from jteki-Latitude-E7450.amcc.com ([182.73.239.130]) by smtp.gmail.com with ESMTPSA id ko9sm45814957pab.37.2016.03.22.00.42.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Mar 2016 00:42:41 -0700 (PDT) From: Jagan Teki To: u-boot@lists.denx.de Date: Tue, 22 Mar 2016 13:08:00 +0530 Message-Id: <1458632319-24866-48-git-send-email-jteki@openedev.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1458632319-24866-1-git-send-email-jteki@openedev.com> References: <1458632319-24866-1-git-send-email-jteki@openedev.com> Cc: Jagan Teki Subject: [U-Boot] [PATCH v7 48/87] mtd: spi-nor: sandbox: Fix ID exctract from spi_nor_info X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This patch fix the id exctract from spi_nor_info ids. Cc: Simon Glass Cc: Bin Meng Signed-off-by: Jagan Teki --- drivers/mtd/spi-nor/sandbox.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/sandbox.c b/drivers/mtd/spi-nor/sandbox.c index cc7b2a4..8bd06f4 100644 --- a/drivers/mtd/spi-nor/sandbox.c +++ b/drivers/mtd/spi-nor/sandbox.c @@ -362,7 +362,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;