From patchwork Fri Apr 20 03:26:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ang, Chee Hong" X-Patchwork-Id: 901855 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=intel.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40SCQF2lDMz9s5b for ; Fri, 20 Apr 2018 20:53:41 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 1B627C22053; Fri, 20 Apr 2018 10:52:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 1D76CC22048; Fri, 20 Apr 2018 10:51:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 07458C21C6A; Fri, 20 Apr 2018 03:26:58 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lists.denx.de (Postfix) with ESMTPS id 39730C21C2F for ; Fri, 20 Apr 2018 03:26:58 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Apr 2018 20:26:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,299,1520924400"; d="scan'208";a="49350996" Received: from angcheeh-mobl.gar.corp.intel.com (HELO ubuntu.localdomain) ([10.226.242.33]) by orsmga001.jf.intel.com with ESMTP; 19 Apr 2018 20:26:56 -0700 From: chee.hong.ang@intel.com To: u-boot@lists.denx.de, Marek Vasut Date: Fri, 20 Apr 2018 11:26:45 +0800 Message-Id: <1524194806-4821-3-git-send-email-chee.hong.ang@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1524194806-4821-1-git-send-email-chee.hong.ang@intel.com> References: <1524194806-4821-1-git-send-email-chee.hong.ang@intel.com> X-Mailman-Approved-At: Fri, 20 Apr 2018 10:51:32 +0000 Cc: Chee Hong Ang , Chin Liang See Subject: [U-Boot] [PATCH v1 2/3] arm: socfpga: stratix10: Add Stratix10 FPGA into FPGA device table X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Chee Hong Ang Enable 'fpga' command in u-boot. User will be able to use the fpga command to program the FPGA on Stratix10 SoC. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/misc.c | 20 +++++++++++++++++--- arch/arm/mach-socfpga/misc_s10.c | 4 ++++ drivers/fpga/altera.c | 6 ++++++ include/altera.h | 8 ++++++++ 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c index d15cbc7..e36c686 100644 --- a/arch/arm/mach-socfpga/misc.c +++ b/arch/arm/mach-socfpga/misc.c @@ -87,11 +87,24 @@ int overwrite_console(void) #endif #ifdef CONFIG_FPGA -/* - * FPGA programming support for SoC FPGA Cyclone V - */ static Altera_desc altera_fpga[] = { { +#ifdef CONFIG_FPGA_STRATIX10 + /* FPGA programming support for SoC FPGA Stratix 10 */ + /* Family */ + Intel_FPGA_Stratix10, + /* Interface type */ + secure_device_manager_mailbox, + /* No limitation as additional data will be ignored */ + -1, + /* No device function table */ + NULL, + /* Base interface address specified in driver */ + NULL, + /* No cookie implementation */ + 0 +#else + /* FPGA programming support for SoC FPGA Cyclone V */ /* Family */ Altera_SoCFPGA, /* Interface type */ @@ -104,6 +117,7 @@ static Altera_desc altera_fpga[] = { NULL, /* No cookie implementation */ 0 +#endif }, }; diff --git a/arch/arm/mach-socfpga/misc_s10.c b/arch/arm/mach-socfpga/misc_s10.c index b1cc6ca..012d8f6 100644 --- a/arch/arm/mach-socfpga/misc_s10.c +++ b/arch/arm/mach-socfpga/misc_s10.c @@ -71,6 +71,10 @@ int arch_misc_init(void) int arch_early_init_r(void) { +#ifdef CONFIG_FPGA + socfpga_fpga_add(); +#endif + return 0; } diff --git a/drivers/fpga/altera.c b/drivers/fpga/altera.c index 135a357..b662ff5 100644 --- a/drivers/fpga/altera.c +++ b/drivers/fpga/altera.c @@ -40,6 +40,9 @@ static const struct altera_fpga { #if defined(CONFIG_FPGA_STRATIX_V) { Altera_StratixV, "StratixV", stratixv_load, NULL, NULL }, #endif +#if defined(CONFIG_FPGA_STRATIX10) + { Intel_FPGA_Stratix10, "Stratix10", stratix10_load, NULL, NULL }, +#endif #if defined(CONFIG_FPGA_SOCFPGA) { Altera_SoCFPGA, "SoC FPGA", socfpga_load, NULL, NULL }, #endif @@ -155,6 +158,9 @@ int altera_info(Altera_desc *desc) case fast_passive_parallel_security: printf("Fast Passive Parallel with Security (FPPS)\n"); break; + case secure_device_manager_mailbox: + puts("Secure Device Manager (SDM) Mailbox\n"); + break; /* Add new interface types here */ default: printf("Unsupported interface type, %d\n", desc->iface); diff --git a/include/altera.h b/include/altera.h index 48d3eb7..e9ba47a 100644 --- a/include/altera.h +++ b/include/altera.h @@ -40,6 +40,8 @@ enum altera_iface { fast_passive_parallel, /* fast passive parallel with security (FPPS) */ fast_passive_parallel_security, + /* secure device manager (SDM) mailbox */ + secure_device_manager_mailbox, /* insert all new types before this */ max_altera_iface_type, }; @@ -55,6 +57,8 @@ enum altera_family { Altera_StratixII, /* StratixV Family */ Altera_StratixV, + /* Stratix10 Family */ + Intel_FPGA_Stratix10, /* SoCFPGA Family */ Altera_SoCFPGA, @@ -117,4 +121,8 @@ int socfpga_load(Altera_desc *desc, const void *rbf_data, size_t rbf_size); int stratixv_load(Altera_desc *desc, const void *rbf_data, size_t rbf_size); #endif +#ifdef CONFIG_FPGA_STRATIX10 +int stratix10_load(Altera_desc *desc, const void *rbf_data, size_t rbf_size); +#endif + #endif /* _ALTERA_H_ */