From patchwork Thu Oct 22 08:21:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1386067 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=fv+Df8N9; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 ozlabs.org (Postfix) with ESMTPS id 4CH0jc00DQz9sVR for ; Thu, 22 Oct 2020 19:22:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3122F82461; Thu, 22 Oct 2020 10:22:20 +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="fv+Df8N9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8CAB38244F; Thu, 22 Oct 2020 10:22:00 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) (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 1AAFB8243D for ; Thu, 22 Oct 2020 10:21:55 +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=igor.opaniuk@gmail.com Received: by mail-lf1-x144.google.com with SMTP id 184so1154878lfd.6 for ; Thu, 22 Oct 2020 01:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=y1u11hMNjMdp66T6k8wpu0QHo+REZFQOy0KHnQFPHAQ=; b=fv+Df8N938VkDTSFZGIokHmyjchL74hVqwwXbEAQibBAqmSn+d21h9puJIFunQSZxM Hf/DZPR9uV5ao1OZdizSXdNJPwSuMVzQGZMO5uNfglVqUlw7NANittD3Akvi4NyB8Hhc wwx5TONFGRxC6ZzAvtWVGhifQ+rZdbmfSE/+xpumiYY+VMxjQQmRMoKK20XILdgT81ZD HKLd89Btvmmt2VHQehdZnBjIPsc8bm//rzjs6QOTnp3AX0FoCMtH+shuQIMS2IR3Oumh tVXz+TF1uT2jcI1FhBNDG5vCSV4YtmNyBrggjAxrlLcMtycM1B33WKanVN2gq3jH01nu eMbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=y1u11hMNjMdp66T6k8wpu0QHo+REZFQOy0KHnQFPHAQ=; b=tS4keE8FxGZXyu5t6BvrKBkrpcivtotWGhjFhp9Do5tmaExJUQSnlGigIXNlqwaQ6m vVyuhTZ4V0rDxGci9e3clKYpj+B1CsQ/iq4lqLQLKat8i3JYA0CSz0WS2Os5cDV4c1Nb t1XdzCS+WIDBt6STtXa8h2y93gUwIU+WRZ3qlY6GZsJS6w9ThjshSuLa0HGbnlubBVAc 9i2xFjPF73JjZ+v9ylY5a3nHk+EIDfk2I1NTpKJgNwGFQgQptupA59qChMixTuOTl6RH uhRFp76POyCqquAU65kyCm93r0Cub8Hl11E04DtPc7RDPZYEKGk/A5L6kTp+GXzypVl7 d0uw== X-Gm-Message-State: AOAM531k0xmAwQEZhE4fLyQWbvUMf0LNxrNF8vN8ourMy7LMMIJnLCJj MYoBs6svmz1HX6hfAXWCg4/HZu3hiBD4mA== X-Google-Smtp-Source: ABdhPJw/907Jl1/t+9Fd/Z0DeErsM532J3yKLlmOuvIqT/O0mUX7Pi9xBymujSL9yz/61PIYrR7Ung== X-Received: by 2002:a19:ad49:: with SMTP id s9mr417561lfd.173.1603354914034; Thu, 22 Oct 2020 01:21:54 -0700 (PDT) Received: from localhost ([109.108.76.111]) by smtp.gmail.com with ESMTPSA id p26sm152244lfc.75.2020.10.22.01.21.53 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Oct 2020 01:21:53 -0700 (PDT) From: Igor Opaniuk To: u-boot@lists.denx.de Cc: Max Krummenacher , Peng Fan , Stefano Babic , Marcel Ziswiler , Oleksandr Suvorov , Philippe Schenker , Igor Opaniuk Subject: [PATCH v1 5/7] apalis-imx8: add implementation for board_mem_get_layout Date: Thu, 22 Oct 2020 11:21:41 +0300 Message-Id: <20201022082143.21170-6-igor.opaniuk@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201022082143.21170-1-igor.opaniuk@gmail.com> References: <20201022082143.21170-1-igor.opaniuk@gmail.com> 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.102.3 at phobos.denx.de X-Virus-Status: Clean From: Igor Opaniuk Add implementation of board_mem_get_layout for overriding the memory layout. Signed-off-by: Igor Opaniuk Acked-by: Oleksandr Suvorov --- board/toradex/apalis-imx8/apalis-imx8.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c index 9263b0f51f..2ed66261d2 100644 --- a/board/toradex/apalis-imx8/apalis-imx8.c +++ b/board/toradex/apalis-imx8/apalis-imx8.c @@ -37,6 +37,29 @@ static void setup_iomux_uart(void) imx8_iomux_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads)); } +void board_mem_get_layout(u64 *phys_sdram_1_start, + u64 *phys_sdram_1_size, + u64 *phys_sdram_2_start, + u64 *phys_sdram_2_size) +{ + u32 is_quadplus = 0, val = 0; + sc_err_t scierr = sc_misc_otp_fuse_read(-1, 6, &val); + + if (scierr == SC_ERR_NONE) { + /* QP has one A72 core disabled */ + is_quadplus = ((val >> 4) & 0x3) != 0x0; + } + + *phys_sdram_1_start = PHYS_SDRAM_1; + *phys_sdram_1_size = PHYS_SDRAM_1_SIZE; + *phys_sdram_2_start = PHYS_SDRAM_2; + if (is_quadplus) + /* Our QP based SKUs only have 2 GB RAM (PHYS_SDRAM_1_SIZE) */ + *phys_sdram_2_size = 0x0UL; + else + *phys_sdram_2_size = PHYS_SDRAM_2_SIZE; +} + int board_early_init_f(void) { sc_pm_clock_rate_t rate = SC_80MHZ;