[PATCH] firmware: socfpga: Add parameter "programmed" to fpgamgr driver

Sascha Hauer s.hauer at pengutronix.de
Tue Nov 10 23:50:20 PST 2015


On Tue, Nov 10, 2015 at 10:27:23PM +0000, Trent Piepho wrote:
> This boolean parameter tells you if the FPGA is programmed or not.  It
> can be accessed from the shell as "$fpga.programmed".  One could use
> this to not program the FPGA if it's already programmed.
> 
> There is an annoying limitation of the way barebox puts parameters
> into the shell env: it requires they have no periods in the device
> name.  It uses the first period to divide the variable name into a
> device and parameter name, which doesn't work correctly if the device
> name has a period in it.

Yeah, that's really annoying, and so far I haven't found a good way to
work around this issue.

> 
> Since the names of any devices created from the OF device tree have a
> period in them, this is a problem.

They not only have a period in them, they can also begin with a number
which makes the string invalid as a variable name.

> 
> So what I did here was create a new device.

Yes, that's what I did in this case sometimes aswell.


> Its parent will be the OF
> device for the fpgamgr and it will in turn be the parent of the
> firmware cdev.  Previously the cdev's parent was the OF device.  This
> device won't have period in the name and the parameter is attached to
> it.  Even without the period limitation, doing this gives a nicer name
> "fpga.programmed" instead of "ff706000.fpgamgr.programmed".
> 
> The fpgamgr code had a pointer to the OF device in its private state.
> I changed this to be a struct for the new "fpga" device, which is then
> used in all the places the former pointer was (nothing but dev_dbg,
> etc. calls).
> 
> Signed-off-by: Trent Piepho <tpiepho at kymetacorp.com>

Patch looks good, applied.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list