From patchwork Fri Sep 2 01:58:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sieu Mun Tang X-Patchwork-Id: 1673336 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=f1IJhAZb; 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MJh0T3h4rz1yj1 for ; Fri, 2 Sep 2022 11:58:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E871F84A04; Fri, 2 Sep 2022 03:58:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=intel.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=intel.com header.i=@intel.com header.b="f1IJhAZb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4FE0583108; Fri, 2 Sep 2022 03:58:39 +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.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,T_SPF_PERMERROR autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 89EB784A08 for ; Fri, 2 Sep 2022 03:58:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sieu.mun.tang@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662083916; x=1693619916; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=niw9hDfy214sJs/dwPZ87Jjx7MmIs1yNdw22PIe8SQc=; b=f1IJhAZbA/Hb37LaGOyoEyT3WyBwqyzvv83Aot8sguwrtQ9WwTh/Wgr1 UkZ2xCz5wh7k1/CrPqvgNt/Iw2LszfdvpOxLZo89x/73ANxk+dSirm0WU Ct0U3vUP86krarHIVR7LxRsHtkM6+EkjdlZzOUsOpecr1Bdwkc+nl8CV5 zNGtdw50/47Bm7fVymKS63s3Ty8KLpF0Yxs26pHfgZarAF+a+coDG1T0k SXwsAQqyX8hWYSJDbBLfXH7vbNdPCb5J5Sw9Sp5QS/g+MIQ1W1j3nyghZ wqbRIF3TkNcUapjf9TmuPoP7a3gYPHbbbRC1z5p8Yh2IUnM5qJ5VCyP15 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10457"; a="359829897" X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="359829897" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 18:58:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="755081291" Received: from pglc1182.png.intel.com ([172.30.235.29]) by fmsmga001.fm.intel.com with ESMTP; 01 Sep 2022 18:58:27 -0700 From: sieu.mun.tang@intel.com To: u-boot@lists.denx.de Cc: Jagan Teki , Vignesh R , Marek , Simon , Kris , Tien Fong , Kok Kiang , Siew Chin , Sin Hui , Raaj , Dinesh , Boon Khai , Alif , Teik Heng , Hazim , Jit Loon Lim , Sieu Mun Tang Subject: [PATCH 1/2] arch: arm: mach-socfpga: Use custom header target buffer in SPL Date: Fri, 2 Sep 2022 09:58:08 +0800 Message-Id: <20220902015809.4889-2-sieu.mun.tang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220902015809.4889-1-sieu.mun.tang@intel.com> References: <20220902015809.4889-1-sieu.mun.tang@intel.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean From: Tien Fong Chee Allocate buffer from bottom half of DDR for the image headers in SPL on Arria10. This allows SPL to load the fitImage header, parse it, extract the FPGA core bitstream section from it, and program the FPGA. Signed-off-by: Tien Fong Chee Signed-off-by: Sieu Mun Tang --- arch/arm/mach-socfpga/spl_a10.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/mach-socfpga/spl_a10.c b/arch/arm/mach-socfpga/spl_a10.c index ec67a5b0eb..bfcbd1dfe1 100644 --- a/arch/arm/mach-socfpga/spl_a10.c +++ b/arch/arm/mach-socfpga/spl_a10.c @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include #include @@ -281,3 +283,13 @@ void spl_board_prepare_for_boot(void) writel(FSBL_IMAGE_IS_VALID, socfpga_get_sysmgr_addr() + SYSMGR_A10_ROMCODE_INITSWSTATE); } + +#if defined(CONFIG_SPL_LOAD_FIT) && defined(CONFIG_SPL_SPI_LOAD) +struct image_header *spl_get_load_buffer(int offset, size_t size) +{ + if (gd->ram_size) + return (struct image_header *)(gd->ram_size / 2); + else + return NULL; +} +#endif