From patchwork Mon Nov 23 01:10:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume LECERF X-Patchwork-Id: 39020 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D2124B6F1C for ; Mon, 23 Nov 2009 12:13:03 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NCNSE-0002s6-1G; Mon, 23 Nov 2009 01:10:58 +0000 Received: from mail-fx0-f211.google.com ([209.85.220.211]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NCNS8-0002rk-14 for linux-mtd@lists.infradead.org; Mon, 23 Nov 2009 01:10:56 +0000 Received: by fxm3 with SMTP id 3so5487354fxm.4 for ; Sun, 22 Nov 2009 17:10:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=pwMCTdN0AUte7Y7tzWcxrpY+4bJ6HDmeYy57NaL3KhM=; b=V19VqfrA4tl95wWExR+zW+Jtx9Vs6a3+z8AorZgJeESgIj7WoQZeGRYRQztHtoI/bv 6CHWnuTT1aka7IiLEuYsTqk5vPeBZX26bsfp4GjVU4s5ChnoeQMHKaNO+LhKI+Cqzwio m7HjYPhB6VkrQ+gqaTYSDiTP47jtE9Sy0rzfQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=eqQXKgmX0UQhSq4Kxr/CZcQbShwgmZQZ8XuIsO0Es90KmmTQBlgPaD16C0urymWgJO DwGPlroKpfzNhvO9nkpfFYpUfFacWtlTImrAKpPwIm0iL16nSMt+A9Qlyjg9o2jK/zuY GIiCnWaykR70+xmvL6B27G6Yyc8hET5DTHVnA= MIME-Version: 1.0 Received: by 10.239.141.143 with SMTP id c15mr381285hba.47.1258938649759; Sun, 22 Nov 2009 17:10:49 -0800 (PST) Date: Mon, 23 Nov 2009 02:10:49 +0100 Message-ID: Subject: [MTD] CHIPS: add support for switching old SST chips into QRY mode (tested with 39VF3201) From: Guillaume LECERF To: linux-mtd@lists.infradead.org X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20091122_201052_208115_D7149ECB X-CRM114-Status: UNSURE ( 9.12 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- _SUMMARY_ X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Hi, SST 39VF160x/39VF320x and some old SST chips need a special command sequence to enter CFI QueRY mode [1]. This patch adds the relevant sequence to cfi_qry_mode_on(). Signed-off-by: Guillaume LECERF [1] http://www.sst.com/dotAsset/40479.pdf / Table 6 : Software Command Sequence diff --git a/drivers/mtd/chips/cfi_util.c b/drivers/mtd/chips/cfi_util.c index c5a84fd..ca584d0 100755 --- a/drivers/mtd/chips/cfi_util.c +++ b/drivers/mtd/chips/cfi_util.c @@ -71,6 +71,13 @@ int __xipram cfi_qry_mode_on(uint32_t base, struct map_info *map, cfi_send_gen_cmd(0x98, 0x555, base, map, cfi, cfi->device_type, NULL); if (cfi_qry_present(map, base, cfi)) return 1; + /* some old SST chips, e.g. 39VF160x/39VF320x */ + cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); + cfi_send_gen_cmd(0xAA, 0x5555, base, map, cfi, cfi->device_type, NULL); + cfi_send_gen_cmd(0x55, 0x2AAA, base, map, cfi, cfi->device_type, NULL); + cfi_send_gen_cmd(0x98, 0x5555, base, map, cfi, cfi->device_type, NULL); + if (cfi_qry_present(map, base, cfi)) + return 1; /* QRY not found */ return 0; }