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 4ACF2C433EF for ; Tue, 11 Jan 2022 05:46:59 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4709C819D3; Tue, 11 Jan 2022 06:46:57 +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=1641880017; bh=5+KlBCr2gBEu7vP2d8MCYZOIRMUqXIFFPufj7xcWPN0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=H02BTRvzZNmiCdW8n979EzVALJABoTShvrJmAKNII1HBOiaSrxOoKyK2Xa/nbvCuc UyTgp3a2BHSOiGXfmIY86CJF074crZBqW8ByizGSLgGJnP29tQpb83bGwoYDNBaW6Q 3pT5x4dFDHR+z2raKAprZfl/plTvk+i7jM8QkFWlYsJGqR0c8/HbA3ow2tCppDm7Sc c0ilKyORNlOsr0sTOe9KVtSoRullKvz5sPfNpj+VvM2AcMQmZRRSVQ4NR9SQGWJZby POrpFWUXFv+FtTjuBzDHtqbBTZ6cuKx8Av5UWUBbzEx3A0UosixOHuDvcQfsRg+Zw7 hF6/xhM9gVzkQ== Received: by phobos.denx.de (Postfix, from userid 109) id DBB1681982; Tue, 11 Jan 2022 06:46:55 +0100 (CET) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [91.198.250.253]) (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 546BC81982 for ; Tue, 11 Jan 2022 06:46:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (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-u-204.mailbox.org (Postfix) with ESMTPS id 4JY07c5c9TzQjCq; Tue, 11 Jan 2022 06:46:52 +0100 (CET) Message-ID: Date: Tue, 11 Jan 2022 06:46:47 +0100 MIME-Version: 1.0 Subject: Re: [PATCH 2/2] ARM: mvebu: x530: Add option for ECC Content-Language: en-US To: Chris Packham Cc: u-boot , Chris Packham , =?UTF-8?Q?Marek_Beh=c3=ban?= , Tom Rini References: <20220106030857.1410516-1-judge.packham@gmail.com> <20220106030857.1410516-2-judge.packham@gmail.com> From: Stefan Roese In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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.2 at phobos.denx.de X-Virus-Status: Clean On 1/11/22 02:37, Chris Packham wrote: > On Mon, Jan 10, 2022 at 9:10 PM Chris Packham wrote: >> >> >> >> On Mon, 10 Jan 2022, 8:37 PM Stefan Roese, wrote: >>> >>> On 1/6/22 04:08, Chris Packham wrote: >>>> Some older x530 boards have layout issues that cause problems for DDR. >>>> These are usually seen as training failures but can also cause problems >>>> after training has completed. Add an option to enable ECC leaving the >>>> default as N which will work with both old and new boards. >>>> >>>> Signed-off-by: Chris Packham >>> >>> Just checking: Most likely you don't have the possibility to detect the >>> board version at runtime? >> >> >> Not in a way that can be done without working RAM. For our internal fork we maintain 2 defconfigs one with ECC one without. We can manage via the BOM which boards get which bootloader. >> >>> >>> If this is not possible: >>> >>> Reviewed-by: Stefan Roese >>> >>> Thanks, >>> Stefan >>> >>>> --- >>>> >>>> arch/arm/mach-mvebu/Kconfig | 1 + >>>> board/alliedtelesis/x530/Kconfig | 20 ++++++++++++++++++++ >>>> board/alliedtelesis/x530/x530.c | 8 +++++++- >>>> 3 files changed, 28 insertions(+), 1 deletion(-) >>>> create mode 100644 board/alliedtelesis/x530/Kconfig >>>> >>>> diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig >>>> index d23cc0c760f1..7388ade98d52 100644 >>>> --- a/arch/arm/mach-mvebu/Kconfig >>>> +++ b/arch/arm/mach-mvebu/Kconfig >>>> @@ -341,5 +341,6 @@ config SECURED_MODE_CSK_INDEX >>>> >>>> source "board/solidrun/clearfog/Kconfig" >>>> source "board/kobol/helios4/Kconfig" >>>> +source "board/alliedtelesis/x530/Kconfig" >>>> >>>> endif >>>> diff --git a/board/alliedtelesis/x530/Kconfig b/board/alliedtelesis/x530/Kconfig >>>> new file mode 100644 >>>> index 000000000000..5c1ae36aebaa >>>> --- /dev/null >>>> +++ b/board/alliedtelesis/x530/Kconfig >>>> @@ -0,0 +1,20 @@ >>>> +menu "x530 configuration" >>>> + depends on TARGET_X530 >>>> + >>>> +config X530_ECC >>>> + bool "Enable DDR3 ECC" >>>> + help >>>> + Some of the older x530 board have layout issues which cause problems >>>> + for the DDR which usually exhibit as DDR training failures or >>>> + problems accessing DDR after training. >>>> + >>>> + The known affected boards are: >>>> + >>>> + * 844-001897-00 (x530-28GTXm, x530-28GPXm, GS980MX/28PSm) >>>> + * 844-001948-00 (GS980MX/28) >>>> + * 844-002008-00 (x530L-52GTX, x530L-52GPX) >>>> + * 844-001974-00 (x530-52GTXm, x530-52GPXm, GS980MX/52PSm) >>>> + >>>> + If you have a newer board you can set Y here, otherwise say N. >>>> + >>>> +endmenu >>>> diff --git a/board/alliedtelesis/x530/x530.c b/board/alliedtelesis/x530/x530.c >>>> index 866b6e68cc16..de20684f4353 100644 >>>> --- a/board/alliedtelesis/x530/x530.c >>>> +++ b/board/alliedtelesis/x530/x530.c >>>> @@ -45,6 +45,12 @@ int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count) >>>> return 0; >>>> } >>>> >>>> +#if CONFIG_IS_ENABLED(X530_ECC) >>>> + #define BUS_MASK BUS_MASK_32BIT_ECC >>>> +#else >>>> + #define BUS_MASK BUS_MASK_32BIT >>>> +#endif >>>> + > > Hmm this doesn't actually appear to be working as intended. When the > SPL is built I end up with CONFIG_IS_ENABLED(X530_ECC) == 0 even when > I set it to y. Do I need to define a SPL version of this Kconfig > symbol? AFAIK, IS_ENABLED(CONFIG_X530_ECC) would be a solution here. There is no need for a new SPL Kconfig option this way. Please give it a try. Thanks, Stefan