From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21BF6C433B4 for ; Thu, 1 Apr 2021 10:18:37 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2FFF461056 for ; Thu, 1 Apr 2021 10:18:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FFF461056 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4F9zff3x3yz3bpB for ; Thu, 1 Apr 2021 21:18:34 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=oR202F+n; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::432; helo=mail-pf1-x432.google.com; envelope-from=shakeebbk@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=oR202F+n; dkim-atps=neutral Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4F9zfB5fDGz2y6F for ; Thu, 1 Apr 2021 21:18:10 +1100 (AEDT) Received: by mail-pf1-x432.google.com with SMTP id c17so1145476pfn.6 for ; Thu, 01 Apr 2021 03:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8tH3LHqAHGxJ4BYd3W+Xgo8zq0FA9bTfcG77VrBvhUc=; b=oR202F+nJLE8GS/+w7vfwbyejYSfMRt4yCkuc1YzMlDa0t3GCbY7/7YHRxfJPQNcxb V/vCPv5PmCyl6bm9MSOkrWvpASx4VYyjO4Fuici7AI8X9M++dN7H0x5iNBlb78mtNdq7 Z+R0SwIF+MEWNE/ke0DIuMZmz0H6Z+cruD0HEG0LRyZbdnV5rUYwb7LUHzhexME+Ujiq /kySeApWOKwplhCnUvynW1ESEWUJ2LS6Mc47lpxnPzQRBWyJh3AqXnnLb94l05tAE0P2 fLDR30QzGMPh/tFEC7oJ3ltExyN+ICA9Cpw87yBJl8RwM3K8kMomgiSBoUeVNuGD0Nb/ kCRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8tH3LHqAHGxJ4BYd3W+Xgo8zq0FA9bTfcG77VrBvhUc=; b=ePjqCauhCgpLJYXw2RvDiYUvh1fEo3RfH1oamNO2TQg9K1SJfZA0/2XC6wsQtTrYI4 MxMkNtfROx7JQebvKBAxmYKYBT53sATXQ/Ife3u7m3Hr0UuJZ17nruKK5eQpbm8D4EFz axA9B7CB37uAPXXHVvzsX0qkFoosppd6KYe7uu6PJDNC9ekbizK94wXz8D/JZJTQq1+u tbVwLRB7wEyCceIb7xrjtIEZ6Jgj6C8NcKgTh++xwh7Qug6tkxHSi1tNx833f1JUR4CZ xOHa1ztBB72CcmnGCY+qHHmV/UK4/NnKV9JEn+KtCbLz05dsS7zLTFClXDR8L1zqZkAw yc7w== X-Gm-Message-State: AOAM530OIPXyeGS3VrFvi1+pA05+aQE7/tDJHvPIN1+yla32ux+7PpWh hORKWWd9qPB1VHnDuseKn4RCjp6Hg0+WuOPjtJTcct1gQOk= X-Google-Smtp-Source: ABdhPJwiMJKMgoPOHwqWtFE+cMR0T7K7Nh5uoA98l70zsq14TZ9zo6aWthG0wc3NoCMjvkmkGk10H+755wnWza+thI0= X-Received: by 2002:aa7:8a4d:0:b029:211:92f2:658c with SMTP id n13-20020aa78a4d0000b029021192f2658cmr7023474pfa.29.1617272287012; Thu, 01 Apr 2021 03:18:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Shakeeb B K Date: Thu, 1 Apr 2021 15:47:54 +0530 Message-ID: Subject: Re: [ast2500] aspeed-smc fail with MX25L25635F To: openbmc@lists.ozlabs.org Content-Type: multipart/alternative; boundary="0000000000002c296805bee68c64" X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cedric Le Goater Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" --0000000000002c296805bee68c64 Content-Type: text/plain; charset="UTF-8" Hi All, We figured that the issue here is with part MX25L25635F not supporting 4B dual mode opcode - 0x3c. It instead uses 0x3b. aspeed-smc enables dual mode by default with SNOR_HWCAPS_READ_1_1_2 in the setup, and hence disabling dual mode from flash_info table in spi-nor is not helpful. I see that there is no way to override opcode in spi-nor framework either. There are a couple of queries here - 1. Why is SNOR_HWCAPS_READ_1_1_2 enabled by default in aspeed-smc, while we could have done with the flash_info table? 2. Can there be an extension in spi-nor to support read opcode override? Any thoughts on what would be the preferred fix? Thanks, Shakeeb On Thu, Mar 18, 2021 at 9:32 PM Shakeeb B K wrote: > Hi All, > > We are working with Macronix MX25L25635F, and are not able to get spi nor > access working from linux(develop-5.10). > u-boot flash drivers work fine - able to verify the flash contents. > But linux aspeed-smc seems to be having issues, with read calibration > failing all the time > [ 1.746960] aspeed-smc 1e620000.spi: Using 50 MHz SPI frequency > [ 1.753028] aspeed-smc 1e620000.spi: control register: 000b0641 > [ 1.758982] aspeed-smc 1e620000.spi: control register changed to: > 00000600 > [ 1.765947] aspeed-smc 1e620000.spi: default control register: 00000600 > [ 1.772810] aspeed-smc 1e620000.spi: mx25l25635e (32768 Kbytes) > [ 1.778773] aspeed-smc 1e620000.spi: CE0 window [ 0x20000000 - > 0x22000000 ] 32MB > [ 1.786286] aspeed-smc 1e620000.spi: CE1 window [ 0x22000000 - > 0x2a000000 ] 128MB > [ 1.793873] aspeed-smc 1e620000.spi: write control register: 00120602 > [ 1.800341] aspeed-smc 1e620000.spi: read control register: 203c0641 > [ 1.806791] aspeed-smc 1e620000.spi: AHB frequency: 198 MHz > [ 1.823440] aspeed-smc 1e620000.spi: Trying HCLK/5 [203c0d41] ... > [ 1.831524] aspeed-smc 1e620000.spi: * [00080000] 0 HCLK delay, 4ns > DI delay : FAIL > [ 1.841333] aspeed-smc 1e620000.spi: * [00000000] 0 HCLK delay, 0ns > DI delay : FAIL > [ 1.851152] aspeed-smc 1e620000.spi: * [00090000] 1 HCLK delay, 4ns > DI delay : FAIL > [ 1.860969] aspeed-smc 1e620000.spi: * [00010000] 1 HCLK delay, 0ns > DI delay : FAIL > [ 1.870746] aspeed-smc 1e620000.spi: * [000a0000] 2 HCLK delay, 4ns > DI delay : FAIL > [ 1.880579] aspeed-smc 1e620000.spi: * [00020000] 2 HCLK delay, 0ns > DI delay : FAIL > [ 1.890435] aspeed-smc 1e620000.spi: * [000b0000] 3 HCLK delay, 4ns > DI delay : FAIL > [ 1.900301] aspeed-smc 1e620000.spi: * [00030000] 3 HCLK delay, 0ns > DI delay : FAIL > [ 1.910182] aspeed-smc 1e620000.spi: * [000c0000] 4 HCLK delay, 4ns > DI delay : FAIL > [ 1.920060] aspeed-smc 1e620000.spi: * [00040000] 4 HCLK delay, 0ns > DI delay : FAIL > [ 1.929964] aspeed-smc 1e620000.spi: * [000d0000] 5 HCLK delay, 4ns > DI delay : FAIL > [ 1.939869] aspeed-smc 1e620000.spi: * [00050000] 5 HCLK delay, 0ns > DI delay : FAIL > [ 1.947796] aspeed-smc 1e620000.spi: Trying HCLK/4 [203c0641] ... > [ 1.955529] aspeed-smc 1e620000.spi: * [00008000] 0 HCLK delay, 4ns > DI delay : FAIL > [ 1.964998] aspeed-smc 1e620000.spi: * [00000000] 0 HCLK delay, 0ns > DI delay : FAIL > [ 1.974483] aspeed-smc 1e620000.spi: * [00009000] 1 HCLK delay, 4ns > DI delay : FAIL > [ 1.983967] aspeed-smc 1e620000.spi: * [00001000] 1 HCLK delay, 0ns > DI delay : FAIL > [ 1.993475] aspeed-smc 1e620000.spi: * [0000a000] 2 HCLK delay, 4ns > DI delay : FAIL > [ 2.002986] aspeed-smc 1e620000.spi: * [00002000] 2 HCLK delay, 0ns > DI delay : FAIL > [ 2.012508] aspeed-smc 1e620000.spi: * [0000b000] 3 HCLK delay, 4ns > DI delay : FAIL > [ 2.022035] aspeed-smc 1e620000.spi: * [00003000] 3 HCLK delay, 0ns > DI delay : FAIL > [ 2.031581] aspeed-smc 1e620000.spi: * [0000c000] 4 HCLK delay, 4ns > DI delay : FAIL > [ 2.041131] aspeed-smc 1e620000.spi: * [00004000] 4 HCLK delay, 0ns > DI delay : FAIL > [ 2.050639] aspeed-smc 1e620000.spi: * [0000d000] 5 HCLK delay, 4ns > DI delay : FAIL > [ 2.060203] aspeed-smc 1e620000.spi: * [00005000] 5 HCLK delay, 0ns > DI delay : FAIL > [ 2.068116] aspeed-smc 1e620000.spi: No good frequency, using dumb slow > [ 2.077460] 5 fixed-partitions partitions found on MTD device bmc > [ 2.083721] Creating 5 MTD partitions on "bmc": > [ 2.088289] 0x000000000000-0x000000060000 : "u-boot" > [ 2.096067] 0x000000060000-0x000000080000 : "u-boot-env" > [ 2.104054] 0x000000080000-0x0000004c0000 : "kernel" > [ 2.111699] 0x0000004c0000-0x000001c00000 : "rofs" > [ 2.119091] 0x000001c00000-0x000002000000 : "rwfs" > ... > rofs = mtd4 squashfs rwfs = mtd5 jffs2 > mount: mounting /dev/mtdblock4 on run/initramfs/ro failed: Invalid argument > [ 3.654132] jffs2: Node totlen on flash (0xffffffff) != totlen from > node ref (0x0000000c) > [ 3.685843] jffs2: Node totlen on flash (0xffffffff) != totlen from > node ref (0x00000044) > [ 3.694229] overlayfs: upper fs does not support tmpfile. > [ 3.699946] jffs2: Node totlen on flash (0xffffffff) != totlen from > node ref (0x0000002c) > [ 3.708309] jffs2: Node totlen on flash (0xffffffff) != totlen from > node ref (0x00000044) > [ 3.716672] overlayfs: upper fs does not support RENAME_WHITEOUT. > [ 3.722885] overlayfs: upper fs does not support xattr, falling back to > index=off and metacopy=off. > chroot: can't execute '/bin/sh': No such file or directory > > Unable to confirm /sbin/init is an executable non-empty file > in merged file system mounted at /root. > > Found a related discussion on > https://lists.ozlabs.org/pipermail/openbmc/2019-April/015925.html, > but the workaround mentioned there - to drop read calibration with *optimize_read=false > *didn't help. > FYI - Able to boot the same image from tftpboot and qemu. > > Has anyone come across similar issue or any suggestions to try out? > > Thanks, > Shakeeb > > --0000000000002c296805bee68c64 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi All,

We figured that the issue h= ere is with=C2=A0part MX25L25635F not supporting 4B dual mode opcode - 0x3c= . It instead=C2=A0uses=C2=A00x3b.

aspeed-smc enabl= es dual mode by default with SNOR_HWCAPS_READ_1_1_2 in the setup,=C2=A0
and hence disabling dual mode from=C2=A0 flash_info table in spi-nor is not helpful.

I see = that there is no way to override opcode in spi-nor framework either.
<= div>There are a couple of queries here -
1. Why is SNOR_HWCAPS_RE= AD_1_1_2 enabled by default in aspeed-smc, while we could have done with th= e flash_info table?
2. Can there be an extension in spi-nor to su= pport read opcode=C2=A0override?

Any thoughts = on what would be the preferred fix?=C2=A0

Than= ks,
Shakeeb

On Thu, Mar 18, 2021 at 9:32 PM Shakeeb B K <= shakeebbk@gmail.co= m> wrote:
Hi All,

We are working with Macron= ix=C2=A0MX25L25635F, and are not able to get spi nor access working from li= nux(develop-5.10).
u-boot flash drivers work fine - able to verif= y the flash contents.
But linux aspeed-smc seems to be having=C2= =A0issues, with read calibration failing all the time
[ =C2=A0 =C2=A01.746960] aspeed-smc 1e620000.spi:= Using 50 MHz SPI frequency
[ =C2=A0 =C2=A01.753028] aspeed-smc 1e620000= .spi: control register: 000b0641
[ =C2=A0 =C2=A01.758982] aspeed-smc 1e6= 20000.spi: control register changed to: 00000600
[ =C2=A0 =C2=A01.765947= ] aspeed-smc 1e620000.spi: default control register: 00000600
[ =C2=A0 = =C2=A01.772810] aspeed-smc 1e620000.spi: mx25l25635e (32768 Kbytes)
[ = =C2=A0 =C2=A01.778773] aspeed-smc 1e620000.spi: CE0 window [ 0x20000000 - 0= x22000000 ] 32MB
[ =C2=A0 =C2=A01.786286] aspeed-smc 1e620000.spi: CE1 w= indow [ 0x22000000 - 0x2a000000 ] 128MB
[ =C2=A0 =C2=A01.793873] aspeed-= smc 1e620000.spi: write control register: 00120602
[ =C2=A0 =C2=A01.8003= 41] aspeed-smc 1e620000.spi: read control register:= 203c0641
[ =C2=A0 =C2=A01.806791] aspeed-smc 1e620000.spi: AHB f= requency: 198 MHz
[ =C2=A0 =C2=A01.823440] aspeed-smc 1e620000.spi: Tryi= ng HCLK/5 [203c0d41] ...
[ =C2=A0 =C2=A01.831524] aspeed-smc 1e620000.sp= i: =C2=A0 * [00080000] 0 HCLK delay, 4ns DI delay : FAIL
[ =C2=A0 =C2=A0= 1.841333] aspeed-smc 1e620000.spi: =C2=A0 * [00000000] 0 HCLK delay, 0ns DI= delay : FAIL
[ =C2=A0 =C2=A01.851152] aspeed-smc 1e620000.spi: =C2=A0 *= [00090000] 1 HCLK delay, 4ns DI delay : FAIL
[ =C2=A0 =C2=A01.860969] a= speed-smc 1e620000.spi: =C2=A0 * [00010000] 1 HCLK delay, 0ns DI delay : FA= IL
[ =C2=A0 =C2=A01.870746] aspeed-smc 1e620000.spi: =C2=A0 * [000a0000]= 2 HCLK delay, 4ns DI delay : FAIL
[ =C2=A0 =C2=A01.880579] aspeed-smc 1= e620000.spi: =C2=A0 * [00020000] 2 HCLK delay, 0ns DI delay : FAIL
[ =C2= =A0 =C2=A01.890435] aspeed-smc 1e620000.spi: =C2=A0 * [000b0000] 3 HCLK del= ay, 4ns DI delay : FAIL
[ =C2=A0 =C2=A01.900301] aspeed-smc 1e620000.spi= : =C2=A0 * [00030000] 3 HCLK delay, 0ns DI delay : FAIL
[ =C2=A0 =C2=A01= .910182] aspeed-smc 1e620000.spi: =C2=A0 * [000c0000] 4 HCLK delay, 4ns DI = delay : FAIL
[ =C2=A0 =C2=A01.920060] aspeed-smc 1e620000.spi: =C2=A0 * = [00040000] 4 HCLK delay, 0ns DI delay : FAIL
[ =C2=A0 =C2=A01.929964] as= peed-smc 1e620000.spi: =C2=A0 * [000d0000] 5 HCLK delay, 4ns DI delay : FAI= L
[ =C2=A0 =C2=A01.939869] aspeed-smc 1e620000.spi: =C2=A0 * [00050000] = 5 HCLK delay, 0ns DI delay : FAIL
[ =C2=A0 =C2=A01.947796] aspeed-smc 1e= 620000.spi: Trying HCLK/4 [203c0641] ...
[ =C2=A0 =C2=A01.955529] aspeed= -smc 1e620000.spi: =C2=A0 * [00008000] 0 HCLK delay, 4ns DI delay : FAIL[ =C2=A0 =C2=A01.964998] aspeed-smc 1e620000.spi: =C2=A0 * [00000000] 0 HC= LK delay, 0ns DI delay : FAIL
[ =C2=A0 =C2=A01.974483] aspeed-smc 1e6200= 00.spi: =C2=A0 * [00009000] 1 HCLK delay, 4ns DI delay : FAIL
[ =C2=A0 = =C2=A01.983967] aspeed-smc 1e620000.spi: =C2=A0 * [00001000] 1 HCLK delay, = 0ns DI delay : FAIL
[ =C2=A0 =C2=A01.993475] aspeed-smc 1e620000.spi: = =C2=A0 * [0000a000] 2 HCLK delay, 4ns DI delay : FAIL
[ =C2=A0 =C2=A02.0= 02986] aspeed-smc 1e620000.spi: =C2=A0 * [00002000] 2 HCLK delay, 0ns DI de= lay : FAIL
[ =C2=A0 =C2=A02.012508] aspeed-smc 1e620000.spi: =C2=A0 * [0= 000b000] 3 HCLK delay, 4ns DI delay : FAIL
[ =C2=A0 =C2=A02.022035] aspe= ed-smc 1e620000.spi: =C2=A0 * [00003000] 3 HCLK delay, 0ns DI delay : FAIL<= br>[ =C2=A0 =C2=A02.031581] aspeed-smc 1e620000.spi: =C2=A0 * [0000c000] 4 = HCLK delay, 4ns DI delay : FAIL
[ =C2=A0 =C2=A02.041131] aspeed-smc 1e62= 0000.spi: =C2=A0 * [00004000] 4 HCLK delay, 0ns DI delay : FAIL
[ =C2=A0= =C2=A02.050639] aspeed-smc 1e620000.spi: =C2=A0 * [0000d000] 5 HCLK delay,= 4ns DI delay : FAIL
[ =C2=A0 =C2=A02.060203] aspeed-smc 1e620000.spi: = =C2=A0 * [00005000] 5 HCLK delay, 0ns DI delay : FAIL
[ =C2=A0 =C2=A02.0= 68116] aspeed-smc 1e620000.spi: No good frequency, = using dumb slow
[ =C2=A0 =C2=A02.077460] 5 fixed-partitions parti= tions found on MTD device bmc
[ =C2=A0 =C2=A02.083721] Creating 5 MTD pa= rtitions on "bmc":
[ =C2=A0 =C2=A02.088289] 0x000000000000-0x0= 00000060000 : "u-boot"
[ =C2=A0 =C2=A02.096067] 0x000000060000= -0x000000080000 : "u-boot-env"
[ =C2=A0 =C2=A02.104054] 0x0000= 00080000-0x0000004c0000 : "kernel"
[ =C2=A0 =C2=A02.111699] 0x= 0000004c0000-0x000001c00000 : "rofs"
[ =C2=A0 =C2=A02.119091] = 0x000001c00000-0x000002000000 : "rwfs"
...
rofs =3D mtd4 squashfs rwfs =3D mtd5 jffs2
mount: mounting /dev/mtdblock4 on run/initramfs/ro failed: Invalid = argument
[ =C2=A0 =C2=A03.654132] jffs2: Node totlen on flash (0x= ffffffff) !=3D totlen from node ref (0x0000000c)
[ =C2=A0 =C2=A03.685843= ] jffs2: Node totlen on flash (0xffffffff) !=3D totlen from node ref (0x000= 00044)
[ =C2=A0 =C2=A03.694229] overlayfs: upper fs does not support tmp= file.
[ =C2=A0 =C2=A03.699946] jffs2: Node totlen on flash (0xffffffff) = !=3D totlen from node ref (0x0000002c)
[ =C2=A0 =C2=A03.708309] jffs2: N= ode totlen on flash (0xffffffff) !=3D totlen from node ref (0x00000044)
= [ =C2=A0 =C2=A03.716672] overlayfs: upper fs does not support RENAME_WHITEO= UT.
[ =C2=A0 =C2=A03.722885] overlayfs: upper fs does not support xattr,= falling back to index=3Doff and metacopy=3Doff.
chroot: can't execu= te '/bin/sh': No such file or directory


Unable to confirm /sbin/init is an executable non-em= pty file
in merged file system mounted at /root.

Found a related discussion on=C2=A0https:= //lists.ozlabs.org/pipermail/openbmc/2019-April/015925.html,=C2=A0
but the workaround mentioned there - to drop read calibration with=C2= =A0optimize_read=3Dfalse didn't help.
FYI - Able to bo= ot the same image from tftpboot=C2=A0and qemu.

Has= anyone come across similar issue or any suggestions to try out?
=
Thanks,
Shakeeb

--0000000000002c296805bee68c64--