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 072D0C77B76 for ; Mon, 17 Apr 2023 17:34:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 34E7C86031; Mon, 17 Apr 2023 19:33:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=mailbox.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; secure) header.d=mailbox.org header.i=@mailbox.org header.b="Zhy6Grpp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E802F86018; Mon, 17 Apr 2023 19:33:18 +0200 (CEST) Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [IPv6:2001:67c:2050:0:465::201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0C3BB85FE8 for ; Mon, 17 Apr 2023 19:33:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.vasut@mailbox.org Received: from smtp2.mailbox.org (unknown [10.196.197.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4Q0Yzs16Ktz9sTC; Mon, 17 Apr 2023 19:33:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1681752793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dYuBKLDUdhM5H3pncgu6PbyWfNXw2ud1QK4jpM7nNOk=; b=Zhy6GrppNZjrHeL86Y1L9gSfr8CyRaEQGH6VlLiM34ki/zexfuHuMpzVBRiIsj/8h2L1QV tmO29wZixlIVOCmdXnRthvNRwdQoA6nqNpVfvkuKLzUzHvVgH2Z1vXntjDPo8Nv1HVXOW3 sOFPVFA/T62BKmgf+eIjY5cC+hBEUWlaCIYAK9usD3Z3BPMTiSvcKHIdwB6H9fBi4UlzkT yuy+O14MqPUi9tLwqqp/vuqk1jqB2+Pjx8TA/SUqbbRCQK3lPAaJvu+xLGrh3MVkE5d3yD v6DBcsMWdcKc0CR9rzs7nUTcO5KakivAJjLDhE8LaU4zp2T/FxU3TOPFnCD8SA== Message-ID: <3a8dc96b-c3e4-b0e2-24d4-c9b4c35dda92@mailbox.org> Date: Mon, 17 Apr 2023 19:18:46 +0200 MIME-Version: 1.0 Subject: Re: [PATCH v4 08/10] board: schneider: add RZN1 board support Content-Language: en-US To: Ralph Siemsen , u-boot@lists.denx.de Cc: Chris Packham References: <20230308202653.1926303-1-ralph.siemsen@linaro.org> <20230308202653.1926303-9-ralph.siemsen@linaro.org> From: Marek Vasut In-Reply-To: <20230308202653.1926303-9-ralph.siemsen@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-MBO-RS-META: fjrscz78trnqiuzcqo1yo6tyb4ez87ua X-MBO-RS-ID: af8f971cce5cb1d0765 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 3/8/23 21:26, Ralph Siemsen wrote: [...] > diff --git a/board/schneider/rzn1-snarc/ddr_timing.c b/board/schneider/rzn1-snarc/ddr_timing.c > new file mode 100644 > index 0000000000..8bc3fe7be4 > --- /dev/null > +++ b/board/schneider/rzn1-snarc/ddr_timing.c > @@ -0,0 +1,140 @@ > +// SPDX-License-Identifier: GPL-2.0 > + > +#include > + > +#include "jedec_ddr3_2g_x16_1333h_500_cl8.h" > + > +u32 ddr_00_87_async[] = { Should this be 'static u32...' ? > + DENALI_CTL_00_DATA, > + DENALI_CTL_01_DATA, > + DENALI_CTL_02_DATA, > + DENALI_CTL_03_DATA, > + DENALI_CTL_04_DATA, > + DENALI_CTL_05_DATA, > + DENALI_CTL_06_DATA, > + DENALI_CTL_07_DATA, > + DENALI_CTL_08_DATA, > + DENALI_CTL_09_DATA, [...] > diff --git a/board/schneider/rzn1-snarc/jedec_ddr3_2g_x16_1333h_500_cl8.h b/board/schneider/rzn1-snarc/jedec_ddr3_2g_x16_1333h_500_cl8.h > new file mode 100644 > index 0000000000..5c55518bc1 > --- /dev/null > +++ b/board/schneider/rzn1-snarc/jedec_ddr3_2g_x16_1333h_500_cl8.h > @@ -0,0 +1,399 @@ > + > +/* **************************************************************** > + * CADENCE Copyright (c) 2001-2011 * > + * Cadence Design Systems, Inc. * > + * All rights reserved. * > + * * > + ****************************************************************** > + * The values calculated from this script are meant to be * > + * representative programmings. The values may not reflect the * > + * actual required programming for production use. Please * > + * closely review all programmed values for technical accuracy * > + * before use in production parts. * > + ****************************************************************** > + * > + * Module: regconfig.h > + * Documentation: Register programming header file > + * > + ****************************************************************** > + ****************************************************************** > + * WARNING: This file was automatically generated. Manual > + * editing may result in undetermined behavior. > + ****************************************************************** > + ******************************************************************/ > + > +#define DENALI_CTL_00_DATA 0x00000600 You might want to run checkpatch --f --fix --fix-inplace on this to fix formatting , esp. use one space after #define and tab after the macro name. Note that diff -wdb will let you diff updates to this file while ignoring space changes. > +#define DENALI_CTL_01_DATA 0x00000000 > +#define DENALI_CTL_02_DATA 0x00000000 > +#define DENALI_CTL_03_DATA 0x00000000 > +#define DENALI_CTL_04_DATA 0x00000000 [...] > +++ b/board/schneider/rzn1-snarc/rzn1.c > @@ -0,0 +1,39 @@ > +// SPDX-License-Identifier: GPL-2.0+ > + > +#include > +#include > +#include > + > +DECLARE_GLOBAL_DATA_PTR; > + > +int board_init(void) > +{ > + gd->bd->bi_boot_params = CFG_SYS_SDRAM_BASE + 0x100; > + > + return 0; > +} > + > +int dram_init(void) > +{ > + struct udevice *dev; > + int err; > + > + /* This will end up calling cadence_ddr_probe() */ > + err = uclass_get_device(UCLASS_RAM, 0, &dev); > + if (err) { > + debug("DRAM init failed: %d\n", err); > + return err; > + } > + > + if (fdtdec_setup_mem_size_base() != 0) > + return -EINVAL; > + > + return 0; > +} > + > +int dram_init_banksize(void) > +{ > + fdtdec_setup_memory_banksize(); > + > + return 0; > +} I wonder how much of this should really be in arch/... since this is common to all machines with RZN1 . Maybe move it there instead ? [...]