From patchwork Sun Jan 15 19:53:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 642958 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp251254pvb; Sun, 15 Jan 2023 11:55:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXtn2oA7oZxZtroS8BD3bLAoCIGW9lrjdVVg9zx3EKOX4NX6yrxnqrIq3TVeX/6j0CwCuc1O X-Received: by 2002:a05:6808:438b:b0:364:615a:2260 with SMTP id dz11-20020a056808438b00b00364615a2260mr7895141oib.47.1673812548461; Sun, 15 Jan 2023 11:55:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673812548; cv=none; d=google.com; s=arc-20160816; b=pKgLKsH0W6IZh7ocgZMPuI7ptIhdXNB496TlE3CK1FXYhhly4A4zhAqbCd7OBRz87f vHrnMc/E4hpd67b/0xvQsxVuioL2L54VEmXWrlGiEwOknNe7TiACsLx86EAZ12cS1Omc ho0jL872j3NFmhCW2HfeTlixtHRn2Q9JnY/c1EgB9j5zK5GcKP3OGLvr+22Ek2TkShcI z9DaM+2bWwI0AcLA68JgGHvLUTt86yc606kCWl8alxLplof77U+NUsd/QZQB3JXNtWCp LqnpqDZlgSnmGQlTCvGVI20wdHMOOuM1ZqoYIhaGJQXYrikMDhhVCP05IOAkb9zoXNP4 08OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gHXQQOFqPOHDrmQDTZEWScxDN+5O4bgLMTUZebCtLxc=; b=b91Yzs+vMJx+CsenWB3o8RyOPBueZcdV9rkZwwJIJ1w3KBpN9TsSu5z3oN5rEl6uRk 7SthkohSpXRnSaG6lsf3livVge9eUJ0yoxIWQnJPn40rx4KpT/Q/dUmz9EQxF6iiXZiX mgv8fc5FXaL81JJZeYnOLYfXcs69LaShj1WusmmsFL+G9Ycc4KiLHx2lIyVd+cElZVJY nzPZx3W1nqfz+xosBbUeI1Iik6BS66nJ1KvchnppylxkdKsBUpEvnSAXqhUEfIxeGo47 fncbStBWT4GSktr3YI5Wt9HaJzTxVI2HiWEjJIS3vvmL27zz0iGSLcZ/88Su1O8YqD41 x0SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sPeopwu0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id r13-20020a056830120d00b00684cdf36386si8819338otp.285.2023.01.15.11.55.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 11:55:48 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sPeopwu0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0FEA2855D5; Sun, 15 Jan 2023 20:54:26 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="sPeopwu0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F14D8855A1; Sun, 15 Jan 2023 20:53:52 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D41A585582 for ; Sun, 15 Jan 2023 20:53:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=linus.walleij@linaro.org Received: by mail-lf1-x12e.google.com with SMTP id x40so6030135lfu.12 for ; Sun, 15 Jan 2023 11:53:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gHXQQOFqPOHDrmQDTZEWScxDN+5O4bgLMTUZebCtLxc=; b=sPeopwu0XWFMgtddWfr9T49tfvziqI225j3lFO61fT96otLN7EaW0QwIEGorffbYt+ PyQHbfTs9pcDohmXNU7E9OndqPNeQ9nR6cgEibjk2t7CUyidxOKl52N4LWfm2LghYBKe s2if7SMegETF2QIjhqy7hTGSGcdwsLcjDMIu3giE2Jxk7viu9ZWSVg1UBZIq+Y0sjTrD c6+s7oveubt0AJmVagrKZg2V5Ej3Bktm6yTonQ9+I/hEIqmhsJC7u9Lf9Nj2LW6G9Skn n3g0MuwdxtDWQfzkNB79QwloEV5e+CLgOd9CQDfR1KPSBCxRvNAO+mQIYiJQB0CxkGSY 5qYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gHXQQOFqPOHDrmQDTZEWScxDN+5O4bgLMTUZebCtLxc=; b=S/TxJmUvMGtPCsU8WpCi4VzMK5Y7YeR87ppC/51NHj/bMiowC33rbRxXIf01aq/Qf/ jcHZ0jrLTimWrXu9FVR32Rur4oGxqO8pfLjTKsVA5UOcrye+uw3tkGZOqjR7wWzRWW2r AxsKVjWOnIpRDoOMl8QffZ4p/t3QlaJYhnUFiPQe2cp2Cwx25NmKLiEYp4Rx1BAWEUwe xD8kUrvGOwKwm9fW3V+BZTzjtYqnWyB6n/BIFH93P1iYY4EmGQ4wjXJ0DUnCa48FLkd4 47uxr/SENg/XH+wwAiEEIDOfWh+tvukZL7/fz/sIPUBe2dA+Q2D2e2RN+RgaiYY/fmPL BRAQ== X-Gm-Message-State: AFqh2kpyMBqne4qf+KV1mKWvcCB0s6FsLPUFG4Db+Gt5IDg8COUmllBO 5ggYtR3vPmKSO2ifSPKQ4dfvxmMCgPN2h4xC X-Received: by 2002:ac2:42d1:0:b0:4ca:ffe0:e754 with SMTP id n17-20020ac242d1000000b004caffe0e754mr2489326lfl.18.1673812427861; Sun, 15 Jan 2023 11:53:47 -0800 (PST) Received: from localhost.localdomain (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id r12-20020ac252ac000000b004aab0ca795csm4780439lfm.211.2023.01.15.11.53.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 11:53:47 -0800 (PST) From: Linus Walleij To: u-boot@lists.denx.de, Tom Rini Cc: Anand Gore , William Zhang , Kursad Oney , Joel Peshkin , Philippe Reynes , =?utf-8?q?=C3=81lvaro_Fer?= =?utf-8?q?n=C3=A1ndez_Rojas?= , Florian Fainelli , Miquel Raynal , Linus Walleij Subject: [PATCH 11/14] mtd: rawnand: brcmnand: fix CS0 layout Date: Sun, 15 Jan 2023 20:53:09 +0100 Message-Id: <20230115195312.1477845-12-linus.walleij@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230115195312.1477845-1-linus.walleij@linaro.org> References: <20230115195312.1477845-1-linus.walleij@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean From: Álvaro Fernández Rojas Only v3.3-v5.0 have a different CS0 layout. Controllers before v3.3 use the same layout for every CS. Fixes: 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller") Signed-off-by: Álvaro Fernández Rojas Acked-by: Florian Fainelli Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200522121524.4161539-3-noltari@gmail.com [Ported to U-Boot from the Linux kernel] Signed-off-by: Linus Walleij --- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c index effc7f1ea802..c02d34ffbc95 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -561,8 +561,9 @@ static int brcmnand_revision_init(struct brcmnand_controller *ctrl) } else { ctrl->cs_offsets = brcmnand_cs_offsets; - /* v5.0 and earlier has a different CS0 offset layout */ - if (ctrl->nand_version <= 0x0500) + /* v3.3-5.0 have a different CS0 offset layout */ + if (ctrl->nand_version >= 0x0303 && + ctrl->nand_version <= 0x0500) ctrl->cs0_offsets = brcmnand_cs_offsets_cs0; }