From patchwork Thu Jan 9 10:07:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 1220288 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=S64PKTNw; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47thdm4qKPz9sNx for ; Thu, 9 Jan 2020 21:08:28 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E9B9A8189D; Thu, 9 Jan 2020 11:08:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1578564492; bh=3Rwo2RaD1zJFHfq7ul0bNqc0OsKqhYywmsvd5m47MRs=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=S64PKTNw4bmj3K7utvNvXeqoCj1fld7EH7ydgtnP5R8dhdtzlvexZM+OgpIK8M54C MgQkBWJzEwIw/+suipTPNvnN8OOku/6DWDZgMTI/RvUCiUBoWXRnGv+aNEJ8TB8dRK Gmk6NrA74l+NuhKiOKgtRd4QOkkfvaOdY7a6TpVhvdU4KDUFEUVd20Z4J4ZtLGQfkz INOF+Zwg0+NGpBejTUxb8fXjSxLi6O3ML43zqX7Ns7nzrZCJKHw9e5JcwHz7Rwyqlx sd6x5/LJAqT7q0p8lEV3jk9A0eEjuvWK/QLlsFYH1Xqr8aAd80ABL/uoGwdx9yUBl4 bXw/pLS6vBddw== Received: by phobos.denx.de (Postfix, from userid 109) id 62D7581894; Thu, 9 Jan 2020 11:08:10 +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=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A68668188A for ; Thu, 9 Jan 2020 11:08:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=marex@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 47thdH6qDdz1qqkP; Thu, 9 Jan 2020 11:08:03 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 47thdH6dtkz1qr2J; Thu, 9 Jan 2020 11:08:03 +0100 (CET) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id u4SISULAXnXu; Thu, 9 Jan 2020 11:08:02 +0100 (CET) X-Auth-Info: itgs+OgBKQn/nLgtpQOXzTxHRpxyPLKeKeFexyQOUds= Received: from desktop.lan (ip-86-49-35-8.net.upcbroadband.cz [86.49.35.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Thu, 9 Jan 2020 11:08:02 +0100 (CET) From: Marek Vasut To: u-boot@lists.denx.de Subject: [PATCH 3/3] mtd: rawnand: denali: Do not reset the block on SoCFPGA Date: Thu, 9 Jan 2020 11:07:54 +0100 Message-Id: <20200109100754.1007705-3-marex@denx.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200109100754.1007705-1-marex@denx.de> References: <20200109100754.1007705-1-marex@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean Legacy kernel versions for SoCFPGA may not implement proper reset handling. Apply the same approach as SoCFPGA reset driver, check environment variable "socfpga_legacy_reset_compat", and if it is set, do not reset the IP before booting Linux. This way, even the older kernel versions can be booted by up to date U-Boot. Signed-off-by: Marek Vasut Cc: Masahiro Yamada --- drivers/mtd/nand/raw/denali_dt.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/mtd/nand/raw/denali_dt.c b/drivers/mtd/nand/raw/denali_dt.c index 2c9e249ab6..d35f2a3543 100644 --- a/drivers/mtd/nand/raw/denali_dt.c +++ b/drivers/mtd/nand/raw/denali_dt.c @@ -148,6 +148,18 @@ static int denali_dt_remove(struct udevice *dev) { struct denali_nand_info *denali = dev_get_priv(dev); +#if CONFIG_IS_ENABLED(ARCH_SOCFPGA) + /* + * Legacy kernel versions do not implement proper reset handling on + * SoCFPGA. To let those older kernel versions work, reuse the same + * approach as the SoCFPGA reset driver does -- check environment + * variable socfpga_legacy_reset_compat and avoid resetting the IP + * before booting the kernel if it is set to 1. + */ + if (env_get_ulong("socfpga_legacy_reset_compat", 10, 0)) + return 0; +#endif + return reset_release_bulk(&denali->resets); }