mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-28 07:23:43 +02:00
Add OpenBSD support
Add a requirements section to the man page which lists the needed access permissions for each programmer. This feature needs my pciutils/libpci 8/16-bit write emulation patch at http://marc.info/?l=openbsd-ports&m=127780030728045 titled [PATCH] Fix pciutils non-32bit PCI write on OpenBSD Corresponding to flashrom svn r1067. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stuart Henderson <sthen@openbsd.org>
This commit is contained in:
parent
f93b36a6bc
commit
b63b067ae2
8
Makefile
8
Makefile
@ -48,6 +48,10 @@ ifeq ($(OS_ARCH), FreeBSD)
|
|||||||
CPPFLAGS += -I/usr/local/include
|
CPPFLAGS += -I/usr/local/include
|
||||||
LDFLAGS += -L/usr/local/lib
|
LDFLAGS += -L/usr/local/lib
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(OS_ARCH), OpenBSD)
|
||||||
|
CPPFLAGS += -I/usr/local/include
|
||||||
|
LDFLAGS += -L/usr/local/lib
|
||||||
|
endif
|
||||||
ifeq ($(OS_ARCH), DOS)
|
ifeq ($(OS_ARCH), DOS)
|
||||||
EXEC_SUFFIX := .exe
|
EXEC_SUFFIX := .exe
|
||||||
CPPFLAGS += -I../libgetopt -I../libpci/include
|
CPPFLAGS += -I../libgetopt -I../libpci/include
|
||||||
@ -259,6 +263,10 @@ ifeq ($(OS_ARCH), DOS)
|
|||||||
LIBS += ../libpci/lib/libpci.a
|
LIBS += ../libpci/lib/libpci.a
|
||||||
else
|
else
|
||||||
LIBS += -lpci
|
LIBS += -lpci
|
||||||
|
ifeq ($(OS_ARCH), OpenBSD)
|
||||||
|
# For (i386|amd64)_iopl(2).
|
||||||
|
LIBS += -l$(shell uname -m)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
9
README
9
README
@ -55,6 +55,11 @@ On FreeBSD, you need the following ports:
|
|||||||
* devel/gmake
|
* devel/gmake
|
||||||
* devel/libpci
|
* devel/libpci
|
||||||
|
|
||||||
|
On OpenBSD, you need the following ports:
|
||||||
|
|
||||||
|
* devel/gmake
|
||||||
|
* sysutils/pciutils
|
||||||
|
|
||||||
To compile on Linux, use:
|
To compile on Linux, use:
|
||||||
|
|
||||||
make
|
make
|
||||||
@ -76,6 +81,10 @@ To compile on NetBSD or DragonFly BSD, use:
|
|||||||
ln -s /usr/pkg/include/pciutils pci
|
ln -s /usr/pkg/include/pciutils pci
|
||||||
gmake CPPFLAGS=-I. LDFLAGS="-L/usr/pkg/lib -Wl,-rpath-link,/usr/pkg/lib"
|
gmake CPPFLAGS=-I. LDFLAGS="-L/usr/pkg/lib -Wl,-rpath-link,/usr/pkg/lib"
|
||||||
|
|
||||||
|
To compile on OpenBSD, use:
|
||||||
|
|
||||||
|
gmake
|
||||||
|
|
||||||
To compile and run on Darwin/Mac OS X:
|
To compile and run on Darwin/Mac OS X:
|
||||||
|
|
||||||
Install DirectIO from coresystems GmbH.
|
Install DirectIO from coresystems GmbH.
|
||||||
|
47
flashrom.8
47
flashrom.8
@ -306,7 +306,7 @@ can be any comma-separated combination of
|
|||||||
Example:
|
Example:
|
||||||
.B "flashrom \-p dummy:lpc,fwh"
|
.B "flashrom \-p dummy:lpc,fwh"
|
||||||
.TP
|
.TP
|
||||||
.BR "nic3com" , " nicrealtek" , " nicsmc1211" , " gfxnvidia" , " satasii\
|
.BR "nic3com" , " nicrealtek" , " nicsmc1211" , " gfxnvidia" , " satasii \
|
||||||
" and " atahpt " programmers
|
" and " atahpt " programmers
|
||||||
These programmers have an option to specify the PCI address of the card
|
These programmers have an option to specify the PCI address of the card
|
||||||
your want to use, which must be specified if more than one card supported
|
your want to use, which must be specified if more than one card supported
|
||||||
@ -391,6 +391,51 @@ can be any of
|
|||||||
.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.
|
||||||
|
.SH REQUIREMENTS
|
||||||
|
flashrom needs different access permissions for different programmers.
|
||||||
|
.sp
|
||||||
|
.B internal
|
||||||
|
needs raw memory access, PCI configuration space access, raw I/O port
|
||||||
|
access (x86) and MSR access (x86).
|
||||||
|
.sp
|
||||||
|
.B it87spi
|
||||||
|
needs raw I/O port access (x86).
|
||||||
|
.sp
|
||||||
|
.BR nic3com ", " nicrealtek ", " nicsmc1211 " and " nicnatsemi "
|
||||||
|
need PCI configuration space read access and raw I/O port access.
|
||||||
|
.sp
|
||||||
|
.B atahpt
|
||||||
|
needs PCI configuration space access and raw I/O port access.
|
||||||
|
.sp
|
||||||
|
.BR gfxnvidia " and " drkaiser
|
||||||
|
need PCI configuration space access and raw memory access.
|
||||||
|
.sp
|
||||||
|
.B satasii
|
||||||
|
needs PCI configuration space read access and raw memory access.
|
||||||
|
.sp
|
||||||
|
.B serprog
|
||||||
|
needs TCP access to the network or userspace access to a serial port.
|
||||||
|
.sp
|
||||||
|
.B buspirate_spi
|
||||||
|
needs userspace access to a serial port.
|
||||||
|
.sp
|
||||||
|
.BR dediprog " and " ft2232_spi
|
||||||
|
need access to the USB device via libusb.
|
||||||
|
.sp
|
||||||
|
.B dummy
|
||||||
|
needs no access permissions at all.
|
||||||
|
.sp
|
||||||
|
.BR internal ", " it87spi ", " nic3com ", " nicrealtek ", " nicsmc1211 ", "
|
||||||
|
.BR nicnatsemi ", " "gfxnvidia" ", " drkaiser ", " satasii " and " atahpt
|
||||||
|
have to be run as superuser/root, and need additional raw access permission.
|
||||||
|
.sp
|
||||||
|
.BR serprog ", " buspirate_spi ", " dediprog " and " ft2232_spi
|
||||||
|
can be run as normal user on most operating systems if appropriate device
|
||||||
|
permissions are set.
|
||||||
|
.sp
|
||||||
|
On OpenBSD, you can obtain raw access permission by setting
|
||||||
|
securelevel=-1 in /etc/rc.securelevel and rebooting, or rebooting into single
|
||||||
|
user mode.
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
Please report any bugs at
|
Please report any bugs at
|
||||||
.sp
|
.sp
|
||||||
|
@ -57,6 +57,11 @@ void get_io_perms(void)
|
|||||||
#endif
|
#endif
|
||||||
msg_perr("ERROR: Could not get I/O privileges (%s).\n"
|
msg_perr("ERROR: Could not get I/O privileges (%s).\n"
|
||||||
"You need to be root.\n", strerror(errno));
|
"You need to be root.\n", strerror(errno));
|
||||||
|
#if defined (__OpenBSD__)
|
||||||
|
msg_perr("Please set securelevel=-1 in /etc/rc.securelevel "
|
||||||
|
"and reboot, or reboot into \n");
|
||||||
|
msg_perr("single user mode.\n");
|
||||||
|
#endif
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
10
hwaccess.h
10
hwaccess.h
@ -228,17 +228,25 @@ cpu_to_be(64)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__NetBSD__)
|
#if defined(__NetBSD__) || defined (__OpenBSD__)
|
||||||
#define off64_t off_t
|
#define off64_t off_t
|
||||||
#define lseek64 lseek
|
#define lseek64 lseek
|
||||||
#if defined(__i386__) || defined(__x86_64__)
|
#if defined(__i386__) || defined(__x86_64__)
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <machine/sysarch.h>
|
#include <machine/sysarch.h>
|
||||||
|
#if defined(__NetBSD__)
|
||||||
#if defined(__i386__)
|
#if defined(__i386__)
|
||||||
#define iopl i386_iopl
|
#define iopl i386_iopl
|
||||||
#elif defined(__x86_64__)
|
#elif defined(__x86_64__)
|
||||||
#define iopl x86_64_iopl
|
#define iopl x86_64_iopl
|
||||||
#endif
|
#endif
|
||||||
|
#elif defined (__OpenBSD__)
|
||||||
|
#if defined(__i386__)
|
||||||
|
#define iopl i386_iopl
|
||||||
|
#elif defined(__amd64__)
|
||||||
|
#define iopl amd64_iopl
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
static inline void outb(uint8_t value, uint16_t port)
|
static inline void outb(uint8_t value, uint16_t port)
|
||||||
|
@ -229,6 +229,10 @@ void *physmap_common(const char *descr, unsigned long phys_addr, size_t len, int
|
|||||||
msg_perr("You can override CONFIG_X86_PAT at boot with the nopat kernel parameter but\n");
|
msg_perr("You can override CONFIG_X86_PAT at boot with the nopat kernel parameter but\n");
|
||||||
msg_perr("disabling the other option unfortunately requires a kernel recompile. Sorry!\n");
|
msg_perr("disabling the other option unfortunately requires a kernel recompile. Sorry!\n");
|
||||||
}
|
}
|
||||||
|
#elif defined (__OpenBSD__)
|
||||||
|
msg_perr("Please set securelevel=-1 in /etc/rc.securelevel "
|
||||||
|
"and reboot, or reboot into \n");
|
||||||
|
msg_perr("single user mode.\n");
|
||||||
#endif
|
#endif
|
||||||
if (!mayfail)
|
if (!mayfail)
|
||||||
exit(3);
|
exit(3);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user