Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933161AbdCJRML (ORCPT ); Fri, 10 Mar 2017 12:12:11 -0500 Received: from mga07.intel.com ([134.134.136.100]:34722 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933049AbdCJRL5 (ORCPT ); Fri, 10 Mar 2017 12:11:57 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,141,1486454400"; d="scan'208";a="74669310" Date: Fri, 10 Mar 2017 09:11:54 -0800 (PST) From: matthew.gerlach@linux.intel.com X-X-Sender: mgerlach@mgerlach-VirtualBox To: Yi Li cc: ming.lei@canonical.com, mcgrof@kernel.org, gregkh@linuxfoundation.org, atull@opensource.altera.com, moritz.fischer@ettus.com, linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org Subject: Re: [RFC 0/2] Add streaming API for firmware and FPGA manager In-Reply-To: <1489105090-4996-1-git-send-email-yi1.li@linux.intel.com> Message-ID: References: <1489105090-4996-1-git-send-email-yi1.li@linux.intel.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1588 Lines: 53 On Thu, 9 Mar 2017, yi1.li@linux.intel.com wrote: > From: Yi Li Hi Yi, This functionality is extremely helpful. I am working with a firmware image of about 90 MBs, and even using scatter-gather instead of a continguous piece of memory is a lot of memory. Matthew Gerlach > > As the FPGA hardware advances, the firmware image size grows (hundres > of MBs or more). It could be an issue for kernel to allocate a big > buffer to load the whole firmware file. > Here is an attempt to read the firmware file into a small buffer and > program the FPGA in a loop (or so call the streaming mode). It should not > be a performance hit for FPGA programing since the majority of time > spend is with the FPGA CvP/PR-IP interface. > > pseudo code in fpga manager: > while (size > 0) { > ret = stream_firmware(&fw, image_name, dev, offset, streamsize); > ret = mgr->mops->write(mgr, fw->data, fw->size); > offset += fw->size; > size -= fw->size; > } > > Thanks, > Yi > > Yi Li (2): > firmware class: Add stream_firmware API. > fpga manager: Add fpga_mgr_firmware_stream API > > drivers/base/firmware_class.c | 128 ++++++++++++++++++++++++++++++++++++++++++ > drivers/fpga/fpga-mgr.c | 77 +++++++++++++++++++++++++ > include/linux/firmware.h | 2 + > include/linux/fpga/fpga-mgr.h | 4 ++ > 4 files changed, 211 insertions(+) > > -- > 2.7.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-fpga" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >