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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 27883EB64DA for ; Mon, 3 Jul 2023 03:40:00 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D7B7F86648; Mon, 3 Jul 2023 05:39:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="qLiDE3rG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C482E865F3; Mon, 3 Jul 2023 05:39:16 +0200 (CEST) Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) (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 6C5A9865D1 for ; Mon, 3 Jul 2023 05:39:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=judge.packham@gmail.com Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-262e3c597b9so2940071a91.0 for ; Sun, 02 Jul 2023 20:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688355552; x=1690947552; 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=ixJp6081cyay/BVj50dpu37RP8VQKQ2foHgoSRMCv8E=; b=qLiDE3rGyHjtTGkLlg4ktPohxbwwxlKcppgsstPqKoiSxUZrk4L3JYQ27eDMCTuMag oBPjuwpunekZS+xWn6Kyvj4EHDvAWayi4y2aBbKpQJbtuvOLI1hxy8oyHoMzRwhwgFcL nw6LrLxTfg+lbb2+UTUm+RG/THCpI0OigTNWQhjT9wjSmByx6KjUHE7dLXPCUYh5jb2j SFosgy2rdpEdDrb5cH9C038w+OfnN7e+Nd857jVxMrnccLY7rLoSXojN8xBuChp053P2 g45A31rxvxej7ZAfLFNtbwMTYUVshT0ipuF5k0vvOr1CmMHPJ9lyy4jIcNdq/G5rByl8 aXZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688355552; x=1690947552; 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=ixJp6081cyay/BVj50dpu37RP8VQKQ2foHgoSRMCv8E=; b=ROfPDl5IS5BIslffezKK0JI2jPSaFNQNg1sahczeDHOm6LZIWPMOSR/xoHNck/bfSV 7DUFJqN5YBy+pcUBygkBGlh7Tvay3N0LA4b/zuJGEzqANmhXN5b00Fr7A/j6R8dLRw9/ FhmIXjgmhLL1hzrNvtGUJ4UomI1m4I9zMko1tHHZyQh/IEn0OhzNp4LbnkOYYO7SJUjP pWOFC5qVj0hMv7u6Z0U+cs6GztBOxId0j4vb3rCVe2HmNyv/pc4dQw33G5ju9v1SoQHv 60S+GK5yX+T502SkGuz5kB4DYUwcpxJs4HOCPMtUqINL2v55DSCUiaAhyIMkUIoIcEns lyKw== X-Gm-Message-State: ABy/qLa9gQ1QEfa0n3eq2GUiUIbucApQ3frUxbMAqEIhGUvxwtgyOZKL vSU6mjKYbS01pvwMnq7o3VI= X-Google-Smtp-Source: APBJJlG60IfYij1CEY39YAa9cu+jI7qCu8AQ9m7w7bynpstB9MhCmy/WwYprQagg424NQk8P5+dSkA== X-Received: by 2002:a17:90a:19:b0:25e:9aa6:2dfc with SMTP id 25-20020a17090a001900b0025e9aa62dfcmr9025965pja.40.1688355551785; Sun, 02 Jul 2023 20:39:11 -0700 (PDT) Received: from chrisp-dl.atlnz.lc ([2001:df5:b000:22:4a20:7a49:a460:dca7]) by smtp.gmail.com with ESMTPSA id 29-20020a17090a195d00b00263cfc9c065sm326784pjh.30.2023.07.02.20.39.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jul 2023 20:39:11 -0700 (PDT) From: Chris Packham To: sr@denx.de, dario.binacchi@amarulasolutions.com, michael@amarulasolutions.com Cc: chris.packham@alliedtelesis.co.nz, u-boot@lists.denx.de, Chris Packham Subject: [PATCH 4/6] mtd: nand: pxa3xx: Enable devbus/nand arbiter on Armada 8K Date: Mon, 3 Jul 2023 15:38:38 +1200 Message-ID: <20230703033840.2060702-5-judge.packham@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230703033840.2060702-1-judge.packham@gmail.com> References: <20230703033840.2060702-1-judge.packham@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.8 at phobos.denx.de X-Virus-Status: Clean The CN9130 SoC (an ARMADA 8K type) has both a NAND Flash Controller and a generic local bus controller (Device Bus Controller) that share common pins. With a board design that incorporates both a NAND flash and uses the Device Bus (in our case for an SRAM) accessing the Device Bus device fails unless the NfArbiterEn bit is set. Setting the bit enables arbitration between the Device Bus and the NAND flash. Since there is no obvious downside in enabling this for designs that don't require arbitration, we always enable it. Signed-off-by: Chris Packham --- drivers/mtd/nand/raw/pxa3xx_nand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/pxa3xx_nand.c b/drivers/mtd/nand/raw/pxa3xx_nand.c index 9dee580ab9c2..d502e967f92c 100644 --- a/drivers/mtd/nand/raw/pxa3xx_nand.c +++ b/drivers/mtd/nand/raw/pxa3xx_nand.c @@ -125,6 +125,7 @@ DECLARE_GLOBAL_DATA_PTR; /* System control register and bit to enable NAND on some SoCs */ #define GENCONF_SOC_DEVICE_MUX 0x208 #define GENCONF_SOC_DEVICE_MUX_NFC_EN BIT(0) +#define GENCONF_SOC_DEVICE_MUX_NFC_DEVBUS_ARB_EN BIT(27) /* * This should be large enough to read 'ONFI' and 'JEDEC'. @@ -1739,7 +1740,7 @@ static int alloc_nand_resource(struct udevice *dev, struct pxa3xx_nand_info *inf return PTR_ERR(sysctrl_base); regmap_read(sysctrl_base, GENCONF_SOC_DEVICE_MUX, ®); - reg |= GENCONF_SOC_DEVICE_MUX_NFC_EN; + reg |= GENCONF_SOC_DEVICE_MUX_NFC_EN | GENCONF_SOC_DEVICE_MUX_NFC_DEVBUS_ARB_EN; regmap_write(sysctrl_base, GENCONF_SOC_DEVICE_MUX, reg); } -- 2.41.0