From patchwork Tue Jan 11 01:49:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 1578246 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=oz/aJ9SQ; dkim-atps=neutral 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=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4JXttR11Xvz9s1l for ; Tue, 11 Jan 2022 12:50:07 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EF29381879; Tue, 11 Jan 2022 02:49:57 +0100 (CET) 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="oz/aJ9SQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5CF5981879; Tue, 11 Jan 2022 02:49:56 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (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 5438581C08 for ; Tue, 11 Jan 2022 02:49:53 +0100 (CET) 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-x102b.google.com with SMTP id m13so15932908pji.3 for ; Mon, 10 Jan 2022 17:49:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Co571S2N3F/RsrblkKLdVq4BYOZWTLprzrOv+iT6iSI=; b=oz/aJ9SQ8Fcn0xZg72gxbfxBEGLzRWQbI8jokvfDVzpYBcRLNsTEm4xjrK4dfhgHPF inguH6CqdZxwN66TU1Vw0yDz3hXISZnhIjb3xqPs6zvdcSTj/bMdFzJoxA5fNLQxFnGB ccf9cD/f2NF3Afc+UDqwNnoJ42iko3Sjjr35qcG4danmcn4f4oFChBhF1782W5yjklnE kIf2hbmZanZPCoKMvBXZazd5ZmMSyh/oa4fl6FOOd54l+hu0WZYHmFuzeH2nfeLbQl26 w7r3VO9IIyTE4jqUI0cOQuShbnLnVqGIAxX25gozMXqin8vSnNcpuytht3UqZlDNjXNC WRmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Co571S2N3F/RsrblkKLdVq4BYOZWTLprzrOv+iT6iSI=; b=g7B19cdLU2nvWx3a17hRsV/2VTs2kKKhBZRWIS2HUcC/pcF+FvFYn5t9WZNMXZawWp MstgwPVOVHHDSrJG40NhBfBlnGTcnhbEasE7QBILLQ+1muZrQ1CoQVT/2FTdSNcCsSJz XJOczzFJq3cLmyqfqf34jyHG7tLkoqiIxJgoKhH66HrAsOcQ5H2RzBZY7o4Tz/7uwa4+ EPeEySUWZM0hAJe+a+ribc2U1q7VbC/LjOFKeWnon1WDgOW6pTxRplNlgrKOeuGPczfP ViYPTXkFE26bCcqp5EFUSxezF1iV8Fc3z/Uspwv+BqhBVpo52s3rFUeO2G8HZLIjNFAp r8aw== X-Gm-Message-State: AOAM530Lm3OnNds3WtxWhpf7Cq7k5+8n1Y3l6/z4EzVFyG/rTbFz7Wy+ SYPy5b/vyFgL2E/LJ+a+5xG1XHxdgFE= X-Google-Smtp-Source: ABdhPJwhAPjhdzk71VpJBtzUMAJZ3XtDNr7wJL2vj+piblzwwvrM9rpByDP/T0Ij2wNVw7m7KlaRag== X-Received: by 2002:a63:ac43:: with SMTP id z3mr2150223pgn.598.1641865791303; Mon, 10 Jan 2022 17:49:51 -0800 (PST) Received: from chrisp-dl.atlnz.lc ([2001:df5:b000:22:5662:1a5f:bb46:6d31]) by smtp.gmail.com with ESMTPSA id x1sm596565pgh.44.2022.01.10.17.49.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 17:49:50 -0800 (PST) From: Chris Packham To: u-boot@lists.denx.de Cc: Chris Packham , Chris Packham , =?utf-8?q?Marek_Beh?= =?utf-8?q?=C3=BAn?= , Stefan Roese , Tom Rini Subject: [PATCH v2] ARM: mvebu: x530: Add option for ECC Date: Tue, 11 Jan 2022 14:49:42 +1300 Message-Id: <20220111014942.3476139-1-judge.packham@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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 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 Reviewed-by: Stefan Roese --- Changes in v2: - Define Kconfig symbol for SPL. arch/arm/mach-mvebu/Kconfig | 1 + board/alliedtelesis/x530/Kconfig | 25 +++++++++++++++++++++++++ board/alliedtelesis/x530/x530.c | 8 +++++++- 3 files changed, 33 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..9e676f17f39c --- /dev/null +++ b/board/alliedtelesis/x530/Kconfig @@ -0,0 +1,25 @@ +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. + +config SPL_X530_ECC + bool + depends on X530_ECC + default X530_ECC + +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 + /* * Define the DDR layout / topology here in the board file. This will * be used by the DDR3 init code in the SPL U-Boot version to configure @@ -66,7 +72,7 @@ static struct mv_ddr_topology_map board_topology_map = { 0, 0, /* cas_l cas_wl */ MV_DDR_TEMP_LOW, /* temperature */ MV_DDR_TIM_2T} }, /* timing */ - BUS_MASK_32BIT_ECC, /* subphys mask */ + BUS_MASK, /* subphys mask */ MV_DDR_CFG_DEFAULT, /* ddr configuration data source */ NOT_COMBINED, /* ddr twin-die combined */ { {0} }, /* raw spd data */