From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754298AbdCJAWc (ORCPT ); Thu, 9 Mar 2017 19:22:32 -0500 Received: from mga05.intel.com ([192.55.52.43]:3457 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751013AbdCJAWb (ORCPT ); Thu, 9 Mar 2017 19:22:31 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,137,1486454400"; d="scan'208";a="1120701721" From: yi1.li@linux.intel.com To: 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 Cc: Yi Li Subject: [RFC 0/2] Add streaming API for firmware and FPGA manager Date: Thu, 9 Mar 2017 18:18:08 -0600 Message-Id: <1489105090-4996-1-git-send-email-yi1.li@linux.intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yi Li 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