From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chee, Tien Fong Date: Thu, 7 Jun 2018 08:36:39 +0000 Subject: [U-Boot] [PATCH v2 3/3] common: Generic loader for file system In-Reply-To: References: <1527138244-16058-1-git-send-email-tien.fong.chee@intel.com> <1527138244-16058-4-git-send-email-tien.fong.chee@intel.com> <1528344245.10642.1.camel@intel.com> Message-ID: <1528360598.10642.8.camel@intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 2018-06-07 at 08:51 +0200, Marek Vasut wrote: > On 06/07/2018 06:04 AM, Chee, Tien Fong wrote: > > > > On Wed, 2018-06-06 at 10:39 +0200, Marek Vasut wrote: > > > > > > On 05/24/2018 07:04 AM, tien.fong.chee at intel.com wrote: > > > > > > > > > > > > From: Tien Fong Chee > > > > > > > > This is file system generic loader which can be used to load > > > > the file image from the storage into target such as memory. > > > > The consumer driver would then use this loader to program > > > > whatever, > > > > ie. the FPGA device. > > > > > > > > Signed-off-by: Tien Fong Chee > > > > --- > > > [...] > > > > > > > > > > > > +static int fs_loader_probe(struct udevice *dev) > > > > +{ > > > > + return 0; > > > > +}; > > > > + > > > > +static const struct udevice_id fs_loader_ids[] = { > > > > + { .compatible = "fs_loader"}, > > > Why exactly is there a DT compatible for a firmware loader? > > > > > Correct me if i'm wrong, this is required to look the platform data > > from DTS, right? Details of DTS in patch 2. > How so ? The FW loader should behave as a library for other drivers > to > use, not like a driver. > The fs_loader node in DTS just provide a way for user to tell the firmware loader what storage device and default partition to load data from. Default partition can be overriden through the variable environment. Caller/other drivers can create different firmware loader instance based on different fs_loader node(different storage device) for their loading purpose. Why this cannot be used by other driver? > > > > > > > > > > > > > > > > > + { } > > > > +}; > > > > + > > > > +U_BOOT_DRIVER(fs_loader) = { > > > > + .name = "fs_loader", > > > > + .id = > > > > UCLASS_FS_FIRMWARE_LOADER, > > > > + .of_match = fs_loader_ids, > > > > + .probe = fs_loader_probe, > > > > + .ofdata_to_platdata = > > > > fs_loader_ofdata_to_platdata, > > > > + .platdata_auto_alloc_size = sizeof(struct > > > > device_platdata), > > > > +}; > > > > + > > > > +UCLASS_DRIVER(fs_loader) = { > > > > + .id = UCLASS_FS_FIRMWARE_LOADER, > > > > + .name = "fs_loader", > > > > +}; > > > [...] >