From patchwork Wed Nov 8 14:33:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13450230 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5D2F5C4332F for ; Wed, 8 Nov 2023 14:34:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iUKJrlQwq9Vcn2uhvv4cyiZkm87FFiWtGanVOGX7Ues=; b=CIaf0XmSTlcEUD 5TCbvGDQ5j2plhK7z4taxgvOSPn+1kpbYgzBFE2SzetZR0nT6gX0GxLooozkt8EnEw6Lc0aLkR21R fpxdXv48Sew9X1rNhs8fW1kLcE0X0twN9++pzZwxzYGg9GtixroGe9mjID2LbBcYq1xKoYt+ACyEi ic16DXqWSWiRf4pKs7K3B530W8FelcG+1pv7n/LRTQuJZNiKvWFZRmyfqkDZJqv0WF6wDdfOWy5eH k2FHSEZRDqlZcVFVsO+ZFwr5r1gi0pMqAVi5x3vlf057PRNh6gGiBNL/4AqpozSVlS5J9OL6aoQgJ boK2xHSS89ckBN+qQK8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0jdI-0041T4-0X; Wed, 08 Nov 2023 14:34:16 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0jd9-0041Ib-2g for linux-arm-kernel@lists.infradead.org; Wed, 08 Nov 2023 14:34:10 +0000 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-507bd64814fso9468534e87.1 for ; Wed, 08 Nov 2023 06:34:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699454044; x=1700058844; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=pGzclwbFLS82d1Yy6hJpVSYEp7mUVdHhXoDoAeHaQ9o=; b=HFXabJBIvPEsFCdGOcpLB/SVS4rgICsBnkj6z8rM4SCxCAC+NanTKi28YSWA7VshOW wGBbWts72cyRLKMVcXo4/vY4kjNxZnPCyoxqAqAuR5RgdnDACJynF4xbTADqK0/aZUTq FwjQS5D96t86pWZmGrCAOLojDkmqm/sHNRJT/LmlgM3zbitF2oOEmME7SgRWv77lZ0F9 +eikoc9XA4OJW62wdOT8dD8R1ZMg20rsTPNr6VVCLx8ARF6aFeFEue1gcn5066I3/rRE EHsUIFy8iNcLoxdsSQ7bXLMDDqkDAoRqhZn9Fs0WEsd7ojCViXOwt269vF9fPGXB78fP Vpew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699454044; x=1700058844; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pGzclwbFLS82d1Yy6hJpVSYEp7mUVdHhXoDoAeHaQ9o=; b=R27/a6/bHPMpHlGF89LXMAzb+tkjyeI2+nVysptToVa60rAV6kRAjvPif+h2m7Zrqm L6EBENfxTy5PtXnvAuQMyRLXv9ytO+rCyzo/zcuruNnO+ksopGGOac/ik/K9jYn848sw DRjRT1R2tpWtjspdxoSs2AHIqdC1M+xuR9ua9az9GOzUhtYwUAfQR+qibG4SC7m0h2jp Ijukm6qbPDAJBrWjbxs9s0goCH1UzesIoqn/D4pl2k9vOjYLTkKdGUbpQY73spPt/BP9 Mgu/awDKI/LxcTRLduHp9x8xd2LTYLfnZIUcBmdypSpSNhyY8Ftmv1FCnuW9v2bjkXTB YDxQ== X-Gm-Message-State: AOJu0YwSLSO9jpCnlT91WAjUenYq5Pnd9Ta0oMVDzrwKIt5b0LJXtm59 wOqV5D257YCjGMr6dN+A5Su3GA== X-Google-Smtp-Source: AGHT+IHO/EX+mYFpXV9cnozSua00aYKVLxHpApEI0ijPX+/t/mJFnU4RbkNl70WWo+NHt88Fl9uYmA== X-Received: by 2002:ac2:5a1a:0:b0:509:4541:5e97 with SMTP id q26-20020ac25a1a000000b0050945415e97mr1368218lfn.29.1699454043887; Wed, 08 Nov 2023 06:34:03 -0800 (PST) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id q10-20020ac24a6a000000b00507a3b8b007sm686773lfp.110.2023.11.08.06.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 06:34:03 -0800 (PST) From: Linus Walleij Date: Wed, 08 Nov 2023 15:33:53 +0100 Subject: [PATCH 5/6] mtd: rawnand: gpio: Support standard nand width MIME-Version: 1.0 Message-Id: <20231108-fix-mips-nand-v1-5-5fc5586d04de@linaro.org> References: <20231108-fix-mips-nand-v1-0-5fc5586d04de@linaro.org> In-Reply-To: <20231108-fix-mips-nand-v1-0-5fc5586d04de@linaro.org> To: Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Bogendoerfer , Ben Dooks Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231108_063407_957679_CE5B3824 X-CRM114-Status: GOOD ( 14.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The standard property for describing the band width of a NAND memory is "nand-bus-width" not "bank-width". The new bindings support both so make Linux check both in priority order. Signed-off-by: Linus Walleij --- drivers/mtd/nand/raw/gpio.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/gpio.c b/drivers/mtd/nand/raw/gpio.c index 5553101c709c..d5bd245b0c0d 100644 --- a/drivers/mtd/nand/raw/gpio.c +++ b/drivers/mtd/nand/raw/gpio.c @@ -183,7 +183,15 @@ static int gpio_nand_get_config(struct device *dev, { u32 val; - if (!device_property_read_u32(dev, "bank-width", &val)) { + /* The preferred binding takes precedence */ + if (!device_property_read_u32(dev, "nand-bus-width", &val)) { + if (val == 16) { + chip->options |= NAND_BUSWIDTH_16; + } else if (val != 8) { + dev_err(dev, "invalid nand-bus-width %u\n", val); + return -EINVAL; + } + } else if (!device_property_read_u32(dev, "bank-width", &val)) { if (val == 2) { chip->options |= NAND_BUSWIDTH_16; } else if (val != 1) {