Re: [RFC PATCH] fpga: Introduce new fpga subsystem

Michal Simek
2013-09-25T10:48:43Z

[-- Attachment #1: Type: text/plain, Size: 2119 bytes --]

On 09/23/2013 07:10 PM, Jason Gunthorpe wrote:
> On Mon, Sep 23, 2013 at 03:10:11PM +0200, Michal Simek wrote:
>
>>> 1) The driver doesn't know what firmware to request. It just knows
>>> how to send it to a FPGA.
>>
>> But dts property in the manager driver which uses this as end driver
>> can know that.
>
> I think the device tree maintainers would push back on this since it
> is not "describing the hardware"

Yes. Then if you want to put it in this way firmware name doesn't need
to be specified in DTS and there can be default name in the driver
or you can read this information from i2c. There are options how to do
differently.

>>> 2) Telling the kernel a filename via sysfs and then having it go
>>> around the long way via request_firwmare to get the data is silly.
>>> Just give the kernel the actual data instead of a file name
>>
>> Firmware interface is valid way how to pass bitstream to the kernel.
>> If you don't like just don't use it. For example you can add
>> firmware blob directly to the kernel and load this at bootup phase
>> without user-space access.
>
> I'm not against using request firmware for what it is ment for: having
> the kernel autonomously load firmware.
>
> I am against the sysfs API in the core code where userspace writes a
> file name that is then used to request_firwmare. That is a goofy API
> for the reasons I outlined.
>
> It is appropriate to use request firmware at the driver level where
> the driver somehow knows what FPGA to request.

I don't have enough information if this can be a problem in connection
to have goofy API but I have no problem to keep firmware interface
just at driver level.
And instead sending firmware name which should be loaded just
send data instead.

Thanks,
Michal

--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]