From patchwork Thu Oct 22 08:21:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1386070 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=t+1SD+rx; 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 4CH0k241GGz9sSW for ; Thu, 22 Oct 2020 19:23:22 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D29E082471; Thu, 22 Oct 2020 10:22:25 +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="t+1SD+rx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DE73C82461; Thu, 22 Oct 2020 10:22:08 +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-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) (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 4405682462 for ; Thu, 22 Oct 2020 10:22: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=igor.opaniuk@gmail.com Received: by mail-lf1-x143.google.com with SMTP id d24so1149796lfa.8 for ; Thu, 22 Oct 2020 01:22:03 -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=12q9TMlaaBABb2I0FrFmxITMn/P8Lt6fW0BT6SP0tuA=; b=t+1SD+rxUDL7DpGvYmpHVn/chjA+7qubQKzdAQot02LCL3RWlYNr4kP7ACqVRVffRQ 5EYN0YW3oWLNMXJO0/LpQ54R7Srlw1s08O5ntu9jiaPdoiTL7WCTKOAaNs84fMJCkaEv zdnQQI63Dz5gQxWYWONMfFSBPJ5kvMNoc5/NOI6XxJk+ufGjIMqNgvpKJf6HrIFvIOLW 532vbKa7G+9ouabfPmAtt0KPzU65rqTlMiPeZlbUBG2cEsPE0w7+toUpDyORtvzMCfur 76M7do5lD+2FiiCBpVYIh4+hVPdlwGgRasM+i3IJkd1MpA58JzT4seH5K3pVPISCMFez u2LQ== 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=12q9TMlaaBABb2I0FrFmxITMn/P8Lt6fW0BT6SP0tuA=; b=kk9kp/gJQWAViXf1CCLuH0fV5CUXYfx0bmK+eIFDRVqB007My0MA/J/beWA6jypg0u GPshMEqJPuxeQJqpAmf0YJnfmBH5IfZLy5o5JGVyqa6UGLLBQAIuh8xiDICqjci80214 gZObZVS7fc38ek5oArHi8QIqDTElY1IL09kGdf09I8I2/FUzp3lqMs1PoTV3XewqlXsy U0T8JF5mFcDk38/33RjgoKKtgEwsKSOPCN5SevPGyeYcCGRHiMKPYS92HFuRvlaZHuVh fowjdDKUwJ/ekqTM8iKWhopELeaQDS0FiNTAewZecKDLJJlHMMQJLVH+CDSP37jxFp3p /Gaw== X-Gm-Message-State: AOAM53304sQqFxc2cFoLBh1RFn2IPdzJzAircnri/Py0GZ42Y8pi2ORq InDyG91TdO++0ick1cIn1I+DE3Fue3iKsg== X-Google-Smtp-Source: ABdhPJzSwI07+4Vxa70bCxM6dh1PQFTMjL1Pp0ucZxoEelamesAJmhn070gXZ4/qP2ZSKBV1oFDnrw== X-Received: by 2002:a19:81ce:: with SMTP id c197mr501819lfd.269.1603354917154; Thu, 22 Oct 2020 01:21:57 -0700 (PDT) Received: from localhost ([109.108.76.111]) by smtp.gmail.com with ESMTPSA id p145sm152720lfa.256.2020.10.22.01.21.56 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Oct 2020 01:21:56 -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 7/7] colibri-imx8x: add implementation for board_mem_get_layout Date: Thu, 22 Oct 2020 11:21:43 +0300 Message-Id: <20201022082143.21170-8-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 --- board/toradex/colibri-imx8x/colibri-imx8x.c | 23 +++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/board/toradex/colibri-imx8x/colibri-imx8x.c b/board/toradex/colibri-imx8x/colibri-imx8x.c index f981c11a37..da081e30be 100644 --- a/board/toradex/colibri-imx8x/colibri-imx8x.c +++ b/board/toradex/colibri-imx8x/colibri-imx8x.c @@ -39,6 +39,29 @@ static void setup_iomux_uart(void) imx8_iomux_setup_multiple_pads(uart3_pads, ARRAY_SIZE(uart3_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_dualx = 0, val = 0; + sc_err_t scierr = sc_misc_otp_fuse_read(-1, 6, &val); + + if (scierr == SC_ERR_NONE) { + /* DX has two A35 cores disabled */ + is_dualx = (val & 0xf) != 0x0; + } + + *phys_sdram_1_start = PHYS_SDRAM_1; + if (is_dualx) + /* Our DX based SKUs only have 1 GB RAM */ + *phys_sdram_1_size = SZ_1G; + else + *phys_sdram_1_size = PHYS_SDRAM_1_SIZE; + *phys_sdram_2_start = PHYS_SDRAM_2; + *phys_sdram_2_size = PHYS_SDRAM_2_SIZE; +} + int board_early_init_f(void) { sc_pm_clock_rate_t rate;