From: Sascha Hauer <s.hauer@pengutronix.de>
To: Trent Piepho <tpiepho@kymetacorp.com>
Cc: barebox <barebox@lists.infradead.org>
Subject: Re: [PATCH] firmware: socfpga: Add parameter "programmed" to fpgamgr driver
Date: Wed, 11 Nov 2015 08:50:20 +0100 [thread overview]
Message-ID: <20151111075020.GN8526@pengutronix.de> (raw)
In-Reply-To: <1447194444.4553.88.camel@rtred1test09.kymeta.local>
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@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 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2015-11-11 7:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-10 22:27 Trent Piepho
2015-11-11 7:50 ` Sascha Hauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151111075020.GN8526@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=tpiepho@kymetacorp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox