[{"id":3683114,"web_url":"http://patchwork.ozlabs.org/comment/3683114/","msgid":"<CAN7C2SCzZLTa3Qbz=kTsX4g=UXwTd-eVUFSudfF-CYaG410UOg@mail.gmail.com>","list_archive_url":null,"date":"2026-04-28T05:16:41","subject":"Re: [PATCH v2 3/3] ddr: socfpga: Add ECC DRAM scrubbing support for\n Gen5/Arria10","submitter":{"id":91590,"url":"http://patchwork.ozlabs.org/api/people/91590/","name":"Sune Brian","email":"briansune@gmail.com"},"content":"On Tue, Apr 28, 2026 at 11:32 AM <alif.zakuan.yuslaimi@altera.com> wrote:\n>\n> From: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>\n>\n> The SDRAM must first be rewritten by zeroes if ECC is used to initialize\n> the ECC metadata. Make the CPU overwrite the DRAM with zeroes in such a\n> case.\n>\n> This implementation turns the caches on temporarily, then overwrites the\n> whole RAM with zeroes, flushes the caches and turns them off again.\n> This provides satisfactory performance.\n>\n> Move common code sdram_init_ecc_bits() to new common file sdram_soc32.c.\n> Preparation for Gen5 uses the same memory initialization function as\n> Arria10.\n>\n> New Kconfig is introduced to enable this implementation only on the default\n> Arria10 and CycloneV boards as this will increase the SPL size which\n> will exceed some Gen5 devices' SPL size limit.\n>\n> Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>\n> Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>\n> ---\n\nFor GEN5 cyclone V:\nCustom board\n512x16 DDR3 die x 3\nECC supported to max Cyclone V allowed\nNo boot issue on soft / hard reset\n\nlog:\nU-Boot SPL 2026.07-rc1-dirty (Apr 28 2026 - 13:09:08 +0800)\nDDRCAL: Scrubbing ECC RAM (2048 MiB).\nDDRCAL: SDRAM-ECC initialized success with 1057 ms\nTrying to boot from MMC1\n\n\nU-Boot 2026.07-rc1-dirty (Apr 28 2026 - 13:09:08 +0800)\n\nTested-by: Brian Sune <briansune@gmail.com>\n\n>  arch/arm/mach-socfpga/Kconfig      | 13 ++++-\n\n>  arch/arm/mach-socfpga/spl_gen5.c   | 17 ++++++\n>  drivers/ddr/altera/Makefile        |  4 +-\n\n>  drivers/ddr/altera/sdram_gen5.c    | 41 ++++++++++++--\n>  drivers/ddr/altera/sdram_soc32.c   | 85 ++++++++++++++++++++++++++++++\n>  drivers/ddr/altera/sdram_soc32.h   | 15 ++++++","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=EA7WV+/F;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.b=\"EA7WV+/F\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com","phobos.denx.de;\n spf=pass smtp.mailfrom=briansune@gmail.com"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g4TFR5T4Hz1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 15:16:59 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 2BA5B841F2;\n\tTue, 28 Apr 2026 07:16:57 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id A91FC8421D; Tue, 28 Apr 2026 07:16:56 +0200 (CEST)","from mail-oa1-x35.google.com (mail-oa1-x35.google.com\n [IPv6:2001:4860:4864:20::35])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 9105784106\n for <u-boot@lists.denx.de>; Tue, 28 Apr 2026 07:16:54 +0200 (CEST)","by mail-oa1-x35.google.com with SMTP id\n 586e51a60fabf-42fdab683a9so3719350fac.1\n for <u-boot@lists.denx.de>; Mon, 27 Apr 2026 22:16:54 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_GMAIL_RCVD,FREEMAIL_FROM,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; t=1777353413; cv=none;\n d=google.com; s=arc-20240605;\n b=CG2fUbk2A/D89nYdraB26F+s2YB+c06/1mHZHwF5rZss2+bY/LoaMGZ3roZyCRxPha\n fqHRzbOUL0uCx737PmkGohbWA0dzqMD/Ct9yX2sVpKhJvtx6O1K00vgRITr1QhMZHEH7\n CqVyYQOTJ+g/1reLPEwGlRsPPD78kinlz7ldW9o74utu5ZGwJydBheeOB/5cammTXp8p\n NgQhZ6MFfbRsjOD7pgwH+dy6+KjlxDtSp7gPl0fYeaCPUD7bWflzHZwqvVjUKmpyvQkN\n vY71X3blvc+NuNSFnUH0oVuvjGB6amNyJD6++FAMF8qVOptHU1D65KnTQ08YA3sTsUh+\n f3Vg==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:dkim-signature;\n bh=CHCxe+qoa6R+cO8Qyce4PxcS/aY4VoDfnkTUo1rPeYs=;\n fh=QMZdvVsxvWCHNNEpcAbJd4pzxODbhoOY9yjXiTqL0Z0=;\n b=hAqccQTbJ5DKmSQR8CPiBTLd/SvQdWI3uayiuJAvHI4k4JMeRTPqw65iqtQH9qJSCx\n tBNa0rMh9FvagCmtD1qcbwq18Ary5uaHau/IIoNbI0nBmR6UCzlxC3ZFZ/ln4Z21p+Xd\n hHZeB9fW6lWWmp0A0pgkoqdfVtC1s0YZq9cZZwCSjZGo1uLGO0PTgeuo3w7aeZkBRPFL\n bOQMV622oXdMkaJ2x/iQ7o+bPBXn/RL3l5XkYLh0PCfBm9NZrLsmxp6CDK/88XtrSDBq\n Z/rUze5cnXYf5qxACcQQTk4a1HgAjHj93QHeTlRryBylyt6b0BKfJtrZUaaSui2lw5RT\n o52Q==; darn=lists.denx.de","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1777353413; x=1777958213; darn=lists.denx.de;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:from:to:cc:subject:date\n :message-id:reply-to;\n bh=CHCxe+qoa6R+cO8Qyce4PxcS/aY4VoDfnkTUo1rPeYs=;\n b=EA7WV+/FpsyPhIQNWLEkO2vLXPPzrNZGUAWK8PJp6ow1rJNi+9kUEaW5MduiI35Uu1\n FtCwTSRunxc+euMNid6Yw+4MfQmo5aEavSRxFvsUDRGAs3jvfHY9nKkHuE5qSBWb525q\n P++4jBl2lN5B31KOsjnXZpcfXr0ytgx2YbuaHtpPAE4inI8AapAV1tbKX8yVd9O6QTXc\n vKaE+L/B3llqei1SOsBmXb0oJYfvrWZxZlHr9+nppJnrvnoUQLvWc/upIY4UsEIOu9j4\n XlFB0QMTMgRA45mklQtJPLkZ0+sgUuOPpQQPGywJn5f278NgPGn3qNJB5X7rlrNpWt+3\n Ds6Q==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777353413; x=1777958213;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=CHCxe+qoa6R+cO8Qyce4PxcS/aY4VoDfnkTUo1rPeYs=;\n b=jsbp9iEhZ8WftOACOpVAJQnkTDGLnwE7cA+rzNeCXP3J1L0z/rr7kzJUzSM+rwFHKI\n EPhJthhcSDx5Z01iPLIIjj9eiCtTrKbl7Tg/Ko4eruYYY3aXYAY+KWSDmiPo8O0/LNK4\n v4QuAj94sIZ2stoTth8aWH1Ad8eRGq058GTaZCyY02mWW0hpm0h6UZBp4dSZ6W7PYDDj\n +wSh7a9zHriJoCx3zGBfgA/vx2byimeCaHG5Em1YwfRvyHcPpZWWGIodl5jUNBKL+UEE\n 69Hp+lcU+Y6Cw1S7MFRaICNNkt8HjYiw1xxFJ0nHveKwb7HLUhEM3F1NowQTYojUIwJ5\n 4qYw==","X-Gm-Message-State":"AOJu0Yy7PBXfxMzNwweJcVoFwpC0cVfPYGXIN+6P3fwmlsP3OezKGPEr\n 8AyP1TOQ9DaCFqBMOWg+OVsMhu15f42YTqrpXSmSUX1FEWVkV26rp55PZx/xN0h/MHQlaxWrv/E\n 1Lx2yIYNiL9Ao+GR2zTpnEiRFt8tK83g=","X-Gm-Gg":"AeBDieu5i8+wy319Vn9deRXZRfDJ4F3dFKlg0UzkOmkZQqOMho/yf0/p7PI++SjaTUJ\n nHLI6HPtmQgA1cheH4oGfyOGNLjE76DrCzMx0jhoQeZVbt1DN6QPl1k0JY1/dSNe7LRI1o8YB8N\n yWeDOJ9yaeQEMLf8PwqSQqAte6QFMOpVfYIa1jNgfj52Bdls5IryZNPKPjZhBKyro2NjHB00cmY\n RVhVfMur0/c9+CbJ4R8XuRMUfyqWLRglP8w2alPFvLXN8d9QtiktbS7w/fhNhAY5DeBCftz4ejg\n eWuZvOHm5pC6B3gbNaU=","X-Received":"by 2002:a05:6871:eb08:b0:41c:ccd1:78b4 with SMTP id\n 586e51a60fabf-433f38e339dmr795803fac.10.1777353413263; Mon, 27 Apr 2026\n 22:16:53 -0700 (PDT)","MIME-Version":"1.0","References":"<20260428033230.7777-1-alif.zakuan.yuslaimi@altera.com>\n <20260428033230.7777-4-alif.zakuan.yuslaimi@altera.com>","In-Reply-To":"<20260428033230.7777-4-alif.zakuan.yuslaimi@altera.com>","From":"Sune Brian <briansune@gmail.com>","Date":"Tue, 28 Apr 2026 13:16:41 +0800","X-Gm-Features":"AVHnY4J0NOsxrtB7Xw-aDXY1Szl9f23DXz-Gvo7DzWpH61DRaKQqnGuVjuOg-jk","Message-ID":"\n <CAN7C2SCzZLTa3Qbz=kTsX4g=UXwTd-eVUFSudfF-CYaG410UOg@mail.gmail.com>","Subject":"Re: [PATCH v2 3/3] ddr: socfpga: Add ECC DRAM scrubbing support for\n Gen5/Arria10","To":"alif.zakuan.yuslaimi@altera.com","Cc":"u-boot@lists.denx.de, Marek Vasut <marex@denx.de>,\n Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>,\n Tien Fong Chee <tien.fong.chee@altera.com>, Tom Rini <trini@konsulko.com>,\n Yao Zi <me@ziyao.cc>,\n Patrice Chotard <patrice.chotard@foss.st.com>, Peng Fan <peng.fan@nxp.com>,\n Simon Glass <sjg@chromium.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}}]