Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2AFEFC433EF for ; Sun, 2 Jan 2022 23:54:46 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2750381420; Mon, 3 Jan 2022 00:54:44 +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="TVlP2RBk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3BE4282FB5; Mon, 3 Jan 2022 00:54:42 +0100 (CET) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (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 7C99B8141B for ; Mon, 3 Jan 2022 00:54:39 +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=tomm.merciai@gmail.com Received: by mail-ed1-x529.google.com with SMTP id bm14so129840713edb.5 for ; Sun, 02 Jan 2022 15:54:39 -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=DiMn2+gshgmwqxW38qUNVv3uealjo8RCA3VtIOFJlGk=; b=TVlP2RBkvRk+yrMltlOV74VERL/tD2H/9+9jaix8t/QvBFqKqwifk+lFy/C8tjA5cB /zU8hG5HsT1A4LZv7lKa9nlm1nvwi7JMzRDnqOSyH2e8mCIxJnbYNn1TyJHxbJJ8o3Yt p6Lw/VfElc/n4Av9zJs6Q6Yd0GcgcK2+y7XRBqLKutOEztoa7xzIPSYxO+Iszwm78bIP F6diTt/PWS+u42JMe7AwMBKqv7MieP0MDi8ZfkLq/jyPhNgJdRq++i0PYSQ3/egh6iy2 cMI1vzRS9JocUaOLvsFQ4hjG9NL3coaNvmTPQKaeHxrBC4j6TE86CNtujjYP0x3qqn1/ pcHw== 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=DiMn2+gshgmwqxW38qUNVv3uealjo8RCA3VtIOFJlGk=; b=XRYyjc9xqqxmmFLGinjpO1kNzmRmJNUmwy0hFj1Jj8f++GR4dnONklJwaxvtRRKeZp 69GutzdYOLY5TLKgqITSxpFPmnDOBx2UT9OMCOrGKZe2WtEioq0M0aAM26aqP+OeU9jM +UpAKgW+1D4YugyMiEI/D+cN5lI1TH8U4eRufFWQRHyfynT54E2Mymk0trXEqQPKH5s2 Tx0ehDv4DrWxD56s9tUAmGUsOrpHPvF9E4KGVJhSE6Npmx/H+loYTh5t6HOYsPmXyCE5 e5VMwT+2pBvHbwrBzg/2mHGDVSGcPgbZA1CuIwojhTpI10hYYC/i2dnjBOX5F8HWoFZ7 SkEw== X-Gm-Message-State: AOAM533qysAqAMEiKdfTntYvK6jZfYmMqhIshgi5zMIpeDTrnkfHDa3u dei6dytkGEjpouUnz43lcS8= X-Google-Smtp-Source: ABdhPJwz/YwMRcF5fhe80TXFs75k3Vqw7Cpd4aNYLiJfamBs3+tpOUixXwwW8SHSV4/iXrWushOwZA== X-Received: by 2002:a50:9d48:: with SMTP id j8mr43379287edk.192.1641167679124; Sun, 02 Jan 2022 15:54:39 -0800 (PST) Received: from tom-desktop.station (net-93-71-218-227.cust.vodafonedsl.it. [93.71.218.227]) by smtp.gmail.com with ESMTPSA id y12sm8004334edd.31.2022.01.02.15.54.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jan 2022 15:54:38 -0800 (PST) From: Tommaso Merciai To: Cc: tomm.merciai@gmail.com, linuxfancy@googlegroups.com, Breno Lima , Francesco Montefoschi , Fabio Estevam , u-boot@lists.denx.de Subject: [PATCH v2] udoo_neo: fix udoo neo UNDEFINED Date: Mon, 3 Jan 2022 00:54:35 +0100 Message-Id: <20220102235435.40001-1-tomm.merciai@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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 get_board_value function fails to get the right board configuration on second time that is call. This patch move get_board_value function at spl level, once is call, store the right configuration into gd static variable gd->board_type and fix the previous error. get_board_value is now call only one time. Signed-off-by: Tommaso Merciai --- Changes since v1 - get_board_value declared as void - fix gd->board_type, re-initialized after spl board/udoo/neo/neo.c | 12 ++++++------ configs/udoo_neo_defconfig | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/board/udoo/neo/neo.c b/board/udoo/neo/neo.c index 62f81fff68..808b727fb0 100644 --- a/board/udoo/neo/neo.c +++ b/board/udoo/neo/neo.c @@ -308,7 +308,7 @@ int board_init(void) return 0; } -static int get_board_value(void) +static void get_board_value(void) { int r184, r185; @@ -333,12 +333,13 @@ static int get_board_value(void) * Extended 1 1 */ - return (r184 << 1) + r185; + gd->board_type = (r184 << 1) + r185; } int board_early_init_f(void) { setup_iomux_uart(); + get_board_value(); return 0; } @@ -370,7 +371,7 @@ int board_mmc_init(struct bd_info *bis) static char *board_string(void) { - switch (get_board_value()) { + switch (gd->board_type) { case UDOO_NEO_TYPE_BASIC: return "BASIC"; case UDOO_NEO_TYPE_BASIC_KS: @@ -498,8 +499,6 @@ static void ccgr_init(void) static void spl_dram_init(void) { - int board = get_board_value(); - struct mx6_ddr_sysinfo sysinfo = { .dsize = 1, /* width of data bus: 1 = 32 bits */ .cs_density = 24, @@ -516,7 +515,8 @@ static void spl_dram_init(void) }; mx6sx_dram_iocfg(32, &mx6_ddr_ioregs, &mx6_grp_ioregs); - if (board == UDOO_NEO_TYPE_BASIC || board == UDOO_NEO_TYPE_BASIC_KS) + if (gd->board_type == UDOO_NEO_TYPE_BASIC || + gd->board_type == UDOO_NEO_TYPE_BASIC_KS) mx6_dram_cfg(&sysinfo, &neo_basic_mmcd_calib, &neo_basic_mem_ddr); else diff --git a/configs/udoo_neo_defconfig b/configs/udoo_neo_defconfig index ca08de1bd4..eff33909d7 100644 --- a/configs/udoo_neo_defconfig +++ b/configs/udoo_neo_defconfig @@ -62,3 +62,4 @@ CONFIG_DM_USB=y CONFIG_USB_STORAGE=y CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y +CONFIG_BOARD_TYPES=y \ No newline at end of file -- 2.25.1