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 F3A03C7EE22 for ; Mon, 8 May 2023 18:23:34 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E031584722; Mon, 8 May 2023 20:23:31 +0200 (CEST) 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="nTCCNpPx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D13738564F; Mon, 8 May 2023 20:23:30 +0200 (CEST) Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (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 117618471A for ; Mon, 8 May 2023 20:23:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ralph.siemsen@linaro.org Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-335598ae8b4so2647845ab.2 for ; Mon, 08 May 2023 11:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683570206; x=1686162206; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=eFrXitZk54nZ1RA+/Swiz1ZaBjlNbxIhUhU5k628/Bo=; b=nTCCNpPxKdGFbZA73CDCiH8VUVRZZyXcoEyZMc9mQN1jPpSqUu82WsY9uJwTqMHNAo D2kGaTpZW/VIjyy8MSyJ+8+OCmR2hhyQYRyFDWiMTbFVz4RA7jFLSmtcHhPrWPtMhm3x cL0eIJECZ6dVUlGqc9wmQvJSFArXcPFLlXRL3awnjNU3uRTKeEmTcaemDfvIwg23TrGX rsYXvFmOW4VTHy0VTRQMel7kvRviPyV/S3Y8td/Z00bKEI9Yz64a3fILx5HIutizTjpa qv0h/5tb0Au/hnpK1b5nHdqHXV4zk8BoKiOv4tGSXucsUJVzfKVtBkb+fg11T+SLmUwV oFBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683570206; x=1686162206; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=eFrXitZk54nZ1RA+/Swiz1ZaBjlNbxIhUhU5k628/Bo=; b=R0dmN+VUxVtCv2IMhUE4cpA1MP85fLIaRmJJC6v2ti28kgpn82OhLltwZlO9L96REY AYR/E+cSVHKTig8l8I8Ta+RRVG2t+/eog75+W/Akmp9bZnAOh/VgXRut4hxv7DcuQrN7 pefD2740ym05KJLkGVRZxKxzzhNQ7G4LBkGhp2RH3+aH9dJMEnWgZDj91lEm7viYNlSw 6rhB+EOBobQht9npYuZOISY+6HjR5CZE8MeBmIKOc8xl2ot2Wus5GzR4vieVZYwOwcos eiC/V1ovSxtt9AIqQOApT1my9vdE2XVrd+zfV5SNGINhMs7JQdr4TCX37L+JznQG9gjm IAsw== X-Gm-Message-State: AC+VfDw0mhp8bnfEnRdEc0EB1pK1sYL1zlWKQN5j2+gBPITRRyJDYC9R uAO70NU+qhm/SimC0qHV0hHdEA== X-Google-Smtp-Source: ACHHUZ42xneYnHxvcaz9VkGmYT+W3kFV4uHLgjMoYler0hZmkJFBJJhGbyzZRt0u2x5egNHSl049Mw== X-Received: by 2002:a92:de44:0:b0:328:52d1:6415 with SMTP id e4-20020a92de44000000b0032852d16415mr8642462ilr.15.1683570206705; Mon, 08 May 2023 11:23:26 -0700 (PDT) Received: from localhost (rfs.netwinder.org. [206.248.184.2]) by smtp.gmail.com with ESMTPSA id m14-20020a02c88e000000b0040f94261ab1sm2210941jao.12.2023.05.08.11.23.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 May 2023 11:23:26 -0700 (PDT) Date: Mon, 8 May 2023 14:23:25 -0400 From: Ralph Siemsen To: Marek Vasut Cc: u-boot@lists.denx.de, Chris Packham Subject: Re: [PATCH v5 08/10] board: schneider: add RZN1 board support Message-ID: <20230508182325.GB3380022@maple.netwinder.org> References: <20230424011515.1359255-1-ralph.siemsen@linaro.org> <20230424011515.1359255-9-ralph.siemsen@linaro.org> <068b253c-b813-e918-dec0-741afc60da97@mailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <068b253c-b813-e918-dec0-741afc60da97@mailbox.org> 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 On Sun, May 07, 2023 at 06:06:40PM +0200, Marek Vasut wrote: >On 4/24/23 03:15, Ralph Siemsen wrote: >>Add support for Schneider Electronics RZ/N1D and RZ/N1S boards, which >>are based on the Reneasas RZ/N1 SoC devices. >> >>The intention is to support both boards using a single defconfig, and to >>handle the differences at runtime. > >The DT comes from Linux kernel, right ? Please include commit ID from >which the DT is imported in the commit message, I suspect that would >be Linux 6.3 commit ID. Yes, the DT is copied verbatim from Linux. I have updated the commit message to mention 6.3 and include the hash. (There have been no changes > >>diff --git a/board/schneider/rzn1-snarc/ddr_async.c b/board/schneider/rzn1-snarc/ddr_async.c >>new file mode 100644 >>index 0000000000..4b4c280e45 >>--- /dev/null >>+++ b/board/schneider/rzn1-snarc/ddr_async.c > >Please correct me if I'm wrong, but shouldn't this be in drivers/ram/ ? I had it there originally, but moved it in v5 of the patch series. There is a lot of board-specific (or at least architecture-specific) logic in this file. For example the sequence of steps to setup the clocks and interconnect, prior to bringing the DDR controller out of reset. This depends on choices made by the RZ/N1 designers, rather than the CDNS IP that drivers/ram/cadence is aiming to cover. Likewise for some board-specific PHY settings, and choices such as operating in async mode. I moved it to board-specific directory as an interim step. Hopefully we can do some consolidation of the multiple CDNS DDR controller implementations, and then figure out the right way to split things up. For now this seemed like the less-bad option. >>+ >>+ /* Step 15 Wait for 200us or more, or wait for DFIINITCOMPLETE to be "1" */ >>+ while (!(phy_readl(DLLCTRL) & DLLCTRL_ASDLLOCK)) >>+ ; > >Please avoid endless loops, use readl_poll_timeout() or >wait_for_bit*() where possible. Will do. >>+int board_init(void) >>+{ >>+ /* >>+ * Initial values for gd->ram_base and gd->ram_size >>+ * are obtained from the "/memory" node in devicetree. >>+ * The size will be updated in later when probing DDR. >>+ */ >>+ fdtdec_setup_mem_size_base(); > >Are you absolutely sure this call ^ is needed at all ? I was sure at the time when I wrote it, however I just tried removing it now and it seems to work fine. >You can just do this here: > >err = uclass...(); >if (err) > debug(...); > >return err; Done. >>+#ifndef __RZN1_H > >Better use __RZN1_SNARC_H , so that when other boards get added, there >won't be trouble. Good catch, done. Ralph