From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38CD2C07E96 for ; Thu, 8 Jul 2021 17:07:10 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7B81861626 for ; Thu, 8 Jul 2021 17:07:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B81861626 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B0A9B831A5; Thu, 8 Jul 2021 19:07:07 +0200 (CEST) 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="PGQoFhWb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9FD46831B0; Thu, 8 Jul 2021 19:07:06 +0200 (CEST) Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) (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 CB0C483180 for ; Thu, 8 Jul 2021 19:07:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=lftan.linux@gmail.com Received: by mail-oi1-x235.google.com with SMTP id l21so8632756oig.3 for ; Thu, 08 Jul 2021 10:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LvczIsszon2P03y+BTyPn/AG4ONuvJWdnAElNwuqLbM=; b=PGQoFhWbiOVQMI796GCf+zPsxcAWEUi2xYpbP+ifRxjJ1DRaeW9L7Wl+x8eX4cwtdU c1AuTNZnKTcOwRFRtwzoycPDC1MaTDkZmw4GXoW6O0bwk7pxyYe0Yg7CKK/Pp5QHWPyq 2A92DhNgvKrxdzBK/Gxl9uL0LmyfXLOfitUGNvPmt1EaGXGEE/DFPtpmIEVjsmdIfM5i Ae9beEJ9p8gH1IzO86uUnc2wGaPAtJlrUASiJV9merq+/ALd4zKiPYTSeGB5iAvWF44B jjZnu0Z6+iKfpVpQXNchObsViVdgs86cYgPXJdZZh0TGsRBspOqJJ+fQfrCehtKqLMT9 HeDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LvczIsszon2P03y+BTyPn/AG4ONuvJWdnAElNwuqLbM=; b=bu2NQbBeMD2yiAdPzxP7fEXBQOMXabocIgS6DRfYiAcawILOoy67+GRJH2pk0PK5qN qFdpbJbSZ8ZufsgSt4+8RGceqMYcvYzQFykEJGcDsz7ngh/8cweX6VR2Xmzuz3qtV5fh 46rvC7q6BrEDHnMZXbAtDJdTGlIuKQItWXkStLOY29NHk8S7YofJ/c4QpROnmzA6sKJQ Z0220eaYqFyeWBSkamTEuefNReJIPHRUOnzhaWXyYyB7qYfco70Lz4bGhv53m3V4/n41 U/mAxMPqcVEJbeSXl6DnxoGDRCYfS+hv+v7xrwat4l5X+38dKadnkKFzulVKMpYfD2I8 uuSA== X-Gm-Message-State: AOAM5305YxZYSJjHkR3ZAkzxPXS5GUNsdTC/Leng8rhKY14EyU81ginh sH8tfbw5/gMB7vuz85WGohdOzqM681+DWjtcUHg= X-Google-Smtp-Source: ABdhPJz1G2N1jCb4U3Mg9kPPThliuRA4NUp8NaGFhe216/Qp57Zy38rtEuqojuXDdCjwbfhL/89ZSwCjYgOeX6SfL0w= X-Received: by 2002:aca:af07:: with SMTP id y7mr18267175oie.58.1625764022101; Thu, 08 Jul 2021 10:07:02 -0700 (PDT) MIME-Version: 1.0 References: <20210613084852.30868-1-elly.siew.chin.lim@intel.com> <20210613084852.30868-13-elly.siew.chin.lim@intel.com> In-Reply-To: <20210613084852.30868-13-elly.siew.chin.lim@intel.com> From: Ley Foon Tan Date: Fri, 9 Jul 2021 01:06:50 +0800 Message-ID: Subject: Re: [v3 12/17] ddr: altera: Add SDRAM driver for Intel N5X device To: Siew Chin Lim Cc: ZY - u-boot , Marek Vasut , Simon Goldschmidt , Tien Fong Chee , Dalon Westergreen , Simon Glass , Yau Wai Gan Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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 Sun, Jun 13, 2021 at 4:49 PM Siew Chin Lim wrote: > > From: Tien Fong Chee > > The DDR subsystem in Diamond Mesa is consisted of controller, PHY, > memory reset manager and memory clock manager. > > Configuration settings of controller, PHY and memory reset manager > is come from DDR handoff data in bitstream, which contain the register > base addresses and user settings from tool. > > Configuration settings of memory clock manager is come from the HPS > handoff data in bitstream, however the register base address is defined > in device tree. > > The calibration is fully done in HPS, which requires IMEM and DMEM > binaries loading to PHY SRAM for running this calibration, both > IMEM and DMEM binaries are also part of bitstream, this bitstream > would be loaded to OCRAM by SDM, and configured by DDR driver. > > Signed-off-by: Siew Chin Lim > Signed-off-by: Tien Fong Chee > > --- > v3: > - Sorting header > - Used prefix OPM_xxx > - Simplify the code with do...while loop. > - Created common function for processing handoff > - Adding function of calibration data feedback to LPDDR4 controllers > > v2: > - Move is_ddr_init_skipped and its helper functions to DDR driver and > converted function to positive checking > - Using GENMASK() macro > - Fixed typo > - Return status of subfunction > - Changed dm to n5x > --- > arch/arm/mach-socfpga/include/mach/firewall.h | 6 + > .../include/mach/system_manager_soc64.h | 10 +- > drivers/ddr/altera/Makefile | 3 +- > drivers/ddr/altera/sdram_n5x.c | 2298 +++++++++++++++++ > drivers/ddr/altera/sdram_soc64.c | 70 + > drivers/ddr/altera/sdram_soc64.h | 1 + > 6 files changed, 2386 insertions(+), 2 deletions(-) > create mode 100644 drivers/ddr/altera/sdram_n5x.c > Reviewed-by: Ley Foon Tan Regards Ley Foon