9
0
Fork 0
Commit Graph

11 Commits

Author SHA1 Message Date
Trent Piepho 48aecb409d firmware: socfpga: Add parameter "programmed" to fpgamgr driver
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.

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

So what I did here was create a new device.  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>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-11 09:05:20 +01:00
Andrey Smirnov 143eb1d3b4 firmware: socfpga: Fix a bug in fpgamgr_program_write_buf()
Fix a bug in fpgamgr_program_write_buf() where .rbf file whose length
is not a multiple of 4 would cause an integer overflow which would
result in infinite loop.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-23 07:57:56 +02:00
Andrey Smirnov ffbb818808 firmware: socfpga: Add necessary dependency to Kconfig
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-21 14:28:46 +02:00
Andrey Smirnov 79b40a630d firmware: altera: Make nSTAT GPIO optional
By taking parts of the programming handshaking protocol on faith it is
possible to make due with only two GPIO for programming Altera
FPGAs. This is not a very advisable practice, but sometime unavoidable
in GPIO constrained designs.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-19 20:50:19 +01:00
Sascha Hauer 90b90e2655 firmware: altera serial: depend on GENERIC_GPIO
The driver needs gpio support, so depend on GENERIC_GPIO

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-28 15:21:26 +01:00
Lucas Stach 0233462687 firmware: altera-serial: fix printf message
Fixes:
.../altera_serial.c:118:2: warning: too many arguments for format

Also sz is of type size_t, so use proper format specifier.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-24 14:04:07 +01:00
Lucas Stach b7782cc79f firmware: altera-serial: don't try to check void return value
Fixes:
.../altera_serial.c:84:6: error: void value not ignored as it ought to be

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-24 14:04:07 +01:00
Lucas Stach 7376942e46 firmware: altera-serial: depend on SPI
This driver uses SPI bus functions.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-24 14:04:06 +01:00
Lucas Stach b525454de5 firmware: socfpga: depend on ARCH_SOCFPGA
This driver uses a lot of arch specific functionality and
fails to build on anything but SOCFPGA.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-24 14:04:06 +01:00
Sascha Hauer e04540821b Firmware: socfpga: Add SoCFPGA FPGA program support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-09 10:30:26 +02:00
Juergen Beisert 3a7b7f26a6 Firmware: provide a handler to program Altera FPGAs
This handler uses a regular SPI master and a few GPIOs to program an
Altera FPGA in serial mode.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-09 10:30:25 +02:00