From patchwork Wed Apr 8 08:50:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1267810 X-Patchwork-Delegate: trini@ti.com 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=JFvoSzZu; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 48xyfG0tLXz9sRN for ; Wed, 8 Apr 2020 18:50:30 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 555E081915; Wed, 8 Apr 2020 10:50:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="JFvoSzZu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 34469818E7; Wed, 8 Apr 2020 10:50:17 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 1245E818E7 for ; Wed, 8 Apr 2020 10:50:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-wr1-x429.google.com with SMTP id h9so6838926wrc.8 for ; Wed, 08 Apr 2020 01:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jyRhAxzmC6B3ELFZzmzhxSHscgkg/s5qI3GrodT8LhQ=; b=JFvoSzZueEfNyXgWzCwMVWlX/YguQSmo9vhf+wiagO+Tp3Ij+5qfJ1d7/l9YiFe/Kd 8HvQl+Tp3+R8nfFC/HElrI6k0EHMRlAOjPOMIxIeyXiHBiNU11pVDLPwvkSanw1+EOHS Cfcs2XcxVDmFjs1Ewy6+O3v9lQPFxlgRlvD0bUnQP9GlgcV2FYSHwPx28wpwEmX7HiP4 qIJMCxoIcq9Q2fw0PUGSNGPyLUNpRhhA8wWDV9VYHTMjYyQfLAvFethkrJWPGp2DA3AF 1wkEgATg5C4Yl7wGT6Panf613pWY+lmYFJrVcp1zXqGaOlmHpgfUZoWXMtZ9zRPQbw1X oomA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=jyRhAxzmC6B3ELFZzmzhxSHscgkg/s5qI3GrodT8LhQ=; b=RpPxuN6RWBY3izAAphnGXKHsLUuGqSjf9ySK4wET2ItcYnmMcyQLTMXwqAu4EU1+o/ nujMnUHgsHsmNDh2CbX/quWLM+cWCdVnQ+R0TqGVxmW7/fJ6jtjsU6+uSAVhPDNvQRuT KhRkIxgzWKCMbIxEWwHTPFWoGKh5frrIJrQYJDZrCMbkrlE7t7Yni1n6moBdTbEjGLHw 1Md+Ilk4bjdjp+Saa93SNsHrYG/uV1kDcxDR9eXXgVpwDuesdhYVfV9eoBRUen+pceXa PNVZj9t3Bpu4UisjdjTNuSbPXwqgjK4xojr5Tt0aAH9ZfYOFS8ZmS1o91ssayyGPzb24 MKcA== X-Gm-Message-State: AGi0PuZom4Bul2UawIelkLfLCcOszfdH2+DdvwdKg+LtbNbUZKQQ6H6F Dv0ObZ7buzQ0HO1TcimJm9xo6B0y7vdxRQ== X-Google-Smtp-Source: APiQypI4dtNkRvwMjtW68lZ0LJjHIKZ9y6dvBRZbR0d+NSfJEwBsQlYXHuOiVM3CMV2gpGzMrgNpKw== X-Received: by 2002:adf:b186:: with SMTP id q6mr7144179wra.253.1586335811684; Wed, 08 Apr 2020 01:50:11 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id t16sm36259098wra.17.2020.04.08.01.50.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Apr 2020 01:50:11 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Ibai Erkiaga , Michal Simek , Simon Glass Subject: [PATCH] xilinx: Introduce board_late_init_xilinx() Date: Wed, 8 Apr 2020 10:50:10 +0200 Message-Id: <1c80f929f9ff22330c791c3c4441b487ad271b16.1586335808.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean This function should keep common shared late configurations for Xilinx SoCs. Signed-off-by: Michal Simek --- board/xilinx/common/board.c | 8 ++++++++ board/xilinx/common/board.h | 12 ++++++++++++ board/xilinx/versal/board.c | 5 ++--- board/xilinx/zynq/board.c | 5 ++--- board/xilinx/zynqmp/zynqmp.c | 5 ++--- 5 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 board/xilinx/common/board.h diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index e83c692f2174..7c191e53fb71 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -8,6 +8,7 @@ #include #include #include +#include "board.h" int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) { @@ -71,3 +72,10 @@ void *board_fdt_blob_setup(void) return NULL; } #endif + +int board_late_init_xilinx(void) +{ + env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET); + + return 0; +} diff --git a/board/xilinx/common/board.h b/board/xilinx/common/board.h new file mode 100644 index 000000000000..180dfbca1082 --- /dev/null +++ b/board/xilinx/common/board.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * (C) Copyright 2020 Xilinx, Inc. + * Michal Simek + */ + +#ifndef _BOARD_XILINX_COMMON_BOARD_H +#define _BOARD_XILINX_COMMON_BOARD_H + +int board_late_init_xilinx(void); + +#endif /* BOARD_XILINX_COMMON_BOARD_H */ diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c index 75aedb092922..908ea87163f8 100644 --- a/board/xilinx/versal/board.c +++ b/board/xilinx/versal/board.c @@ -17,6 +17,7 @@ #include #include #include +#include "../common/board.h" DECLARE_GLOBAL_DATA_PTR; @@ -204,9 +205,7 @@ int board_late_init(void) initrd_hi = round_down(initrd_hi, SZ_16M); env_set_addr("initrd_high", (void *)initrd_hi); - env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET); - - return 0; + return board_late_init_xilinx(); } int dram_init_banksize(void) diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c index 420a5ca66311..2164eac8d518 100644 --- a/board/xilinx/zynq/board.c +++ b/board/xilinx/zynq/board.c @@ -17,6 +17,7 @@ #include #include #include +#include "../common/board.h" DECLARE_GLOBAL_DATA_PTR; @@ -76,9 +77,7 @@ int board_late_init(void) env_set("boot_targets", new_targets); - env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET); - - return 0; + return board_late_init_xilinx(); } #if !defined(CONFIG_SYS_SDRAM_BASE) && !defined(CONFIG_SYS_SDRAM_SIZE) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 3c92b1a5825f..b2172356ad0a 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -27,6 +27,7 @@ #include #include #include +#include "../common/board.h" #include "pm_cfg_obj.h" @@ -695,11 +696,9 @@ int board_late_init(void) initrd_hi = round_down(initrd_hi, SZ_16M); env_set_addr("initrd_high", (void *)initrd_hi); - env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET); - reset_reason(); - return 0; + return board_late_init_xilinx(); } #endif