1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 07:02:34 +02:00

Document and enable the linux_spi driver

The linux_spi driver is now enabled by default on Linux.
A man page entry and a line in --list-supported output have been added.

Corresponding to flashrom svn r1498.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
This commit is contained in:
Carl-Daniel Hailfinger 2012-02-16 21:00:27 +00:00
parent 9e9f684908
commit 8541d23121
3 changed files with 34 additions and 9 deletions

View File

@ -209,6 +209,14 @@ override CONFIG_FT2232_SPI = no
endif endif
endif endif
ifneq ($(TARGET_OS), Linux)
ifeq ($(CONFIG_LINUX_SPI), yes)
UNSUPPORTED_FEATURES += CONFIG_LINUX_SPI=yes
else
override CONFIG_LINUX_SPI = no
endif
endif
# Determine the destination processor architecture. # Determine the destination processor architecture.
# IMPORTANT: The following line must be placed before ARCH is ever used # IMPORTANT: The following line must be placed before ARCH is ever used
# (of course), but should come after any lines setting CC because the line # (of course), but should come after any lines setting CC because the line
@ -324,16 +332,15 @@ CONFIG_OGP_SPI ?= yes
# Always enable Bus Pirate SPI for now. # Always enable Bus Pirate SPI for now.
CONFIG_BUSPIRATE_SPI ?= yes CONFIG_BUSPIRATE_SPI ?= yes
# Disable Linux spidev interface support for now, until we check for a Linux
# device (not host, as DOS binaries for example are built on a Linux host).
CONFIG_LINUX_SPI ?= no
# Disable Dediprog SF100 until support is complete and tested. # Disable Dediprog SF100 until support is complete and tested.
CONFIG_DEDIPROG ?= no CONFIG_DEDIPROG ?= no
# Always enable Marvell SATA controllers for now. # Always enable Marvell SATA controllers for now.
CONFIG_SATAMV ?= yes CONFIG_SATAMV ?= yes
# Enable Linux spidev interface by default. We disable it on non-Linux targets.
CONFIG_LINUX_SPI ?= yes
# Disable wiki printing by default. It is only useful if you have wiki access. # Disable wiki printing by default. It is only useful if you have wiki access.
CONFIG_PRINT_WIKI ?= no CONFIG_PRINT_WIKI ?= no
@ -465,11 +472,6 @@ PROGRAMMER_OBJS += buspirate_spi.o
NEED_SERIAL := yes NEED_SERIAL := yes
endif endif
ifeq ($(CONFIG_LINUX_SPI), yes)
FEATURE_CFLAGS += -D'CONFIG_LINUX_SPI=1'
PROGRAMMER_OBJS += linux_spi.o
endif
ifeq ($(CONFIG_DEDIPROG), yes) ifeq ($(CONFIG_DEDIPROG), yes)
FEATURE_CFLAGS += -D'CONFIG_DEDIPROG=1' FEATURE_CFLAGS += -D'CONFIG_DEDIPROG=1'
FEATURE_LIBS += -lusb FEATURE_LIBS += -lusb
@ -482,6 +484,11 @@ PROGRAMMER_OBJS += satamv.o
NEED_PCI := yes NEED_PCI := yes
endif endif
ifeq ($(CONFIG_LINUX_SPI), yes)
FEATURE_CFLAGS += -D'CONFIG_LINUX_SPI=1'
PROGRAMMER_OBJS += linux_spi.o
endif
ifeq ($(NEED_SERIAL), yes) ifeq ($(NEED_SERIAL), yes)
LIB_OBJS += serial.o LIB_OBJS += serial.o
endif endif

View File

@ -205,6 +205,8 @@ or Xilinx DLC5 compatible cable)
.sp .sp
.BR "* ogp_spi" " (for SPI flash ROMs on Open Graphics Project graphics card)" .BR "* ogp_spi" " (for SPI flash ROMs on Open Graphics Project graphics card)"
.sp .sp
.BR "* linux_spi" " (for SPI flash ROMs accessible via /dev/spidevX.Y on Linux)"
.sp
Some programmers have optional or mandatory parameters which are described Some programmers have optional or mandatory parameters which are described
in detail in the in detail in the
.B PROGRAMMER SPECIFIC INFO .B PROGRAMMER SPECIFIC INFO
@ -639,6 +641,17 @@ section above.
.sp .sp
More information about the hardware is available at More information about the hardware is available at
.BR http://wiki.opengraphics.org . .BR http://wiki.opengraphics.org .
.SS
.BR "linux_spi " programmer
You have to specify the SPI controller to use with the
.sp
.B " flashrom \-p linux_spi:dev=/dev/spidevX.Y"
.sp
syntax where
.B /dev/spidevX.Y
is the Linux device node for your SPI controller.
.sp
Please note that the linux_spi driver only works on Linux.
.SH EXIT STATUS .SH EXIT STATUS
flashrom exits with 0 on success, 1 on most failures but with 2 if /dev/mem flashrom exits with 0 on success, 1 on most failures but with 2 if /dev/mem
(/dev/xsvc on Solaris) can not be opened and with 3 if a call to mmap() fails. (/dev/xsvc on Solaris) can not be opened and with 3 if a call to mmap() fails.

View File

@ -527,6 +527,11 @@ void print_supported(void)
programmer_table[PROGRAMMER_SATAMV].name); programmer_table[PROGRAMMER_SATAMV].name);
print_supported_pcidevs(satas_mv); print_supported_pcidevs(satas_mv);
#endif #endif
#if CONFIG_LINUX_SPI == 1
msg_ginfo("\nSupported devices for the %s programmer:\n",
programmer_table[PROGRAMMER_LINUX_SPI].name);
msg_ginfo("Device files /dev/spidev*.*\n");
#endif
} }
#if CONFIG_INTERNAL == 1 #if CONFIG_INTERNAL == 1