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

Refinements for DragonflyBSD

- /usr/include/cpu/param.h defines PAGE_MASK already, hence use another
   name for the respective macro in nicintel_eeprom.c.
 - Since DragonflyBSD 3.6 DPorts is used as the default package manager.
   Therefore we should use /usr/local/ instead of /usr/pkg/ on default
   to fetch libraries.

Corresponding to flashrom svn r1866.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
This commit is contained in:
Stefan Tauner 2015-01-10 09:33:06 +00:00
parent 4c32af8999
commit 8d21ff1d63
4 changed files with 11 additions and 15 deletions

View File

@ -111,8 +111,8 @@ LDFLAGS += -L/usr/pkg/lib
endif endif
ifeq ($(TARGET_OS), DragonFlyBSD) ifeq ($(TARGET_OS), DragonFlyBSD)
CPPFLAGS += -I/usr/pkg/include CPPFLAGS += -I/usr/local/include
LDFLAGS += -L/usr/pkg/lib LDFLAGS += -L/usr/local/lib
endif endif
ifeq ($(TARGET_OS), DOS) ifeq ($(TARGET_OS), DOS)
@ -815,7 +815,7 @@ endif
define LIBPCI_TEST define LIBPCI_TEST
/* Avoid a failing test due to libpci header symbol shadowing breakage */ /* Avoid a failing test due to libpci header symbol shadowing breakage */
#define index shadow_workaround_index #define index shadow_workaround_index
#if !defined __NetBSD__ && !defined __DragonFly__ #if !defined __NetBSD__
#include <pci/pci.h> #include <pci/pci.h>
#else #else
#include <pciutils/pci.h> #include <pciutils/pci.h>

8
README
View File

@ -68,7 +68,7 @@ To compile on Linux, use:
make make
To compile on FreeBSD, use: To compile on FreeBSD, OpenBSD or DragonFly BSD, use:
gmake gmake
@ -80,11 +80,7 @@ To compile on Solaris, use:
gmake LDFLAGS="-L$pathtolibpci" CC="gcc -I$pathtopciheaders" CFLAGS=-O2 gmake LDFLAGS="-L$pathtolibpci" CC="gcc -I$pathtopciheaders" CFLAGS=-O2
To compile on NetBSD or DragonFly BSD (with pciutils, libftdi, libusb installed in /usr/pkg/), use: To compile on NetBSD (with pciutils, libftdi, libusb installed in /usr/pkg/), use:
gmake
To compile on OpenBSD, use:
gmake gmake

View File

@ -40,7 +40,7 @@
*/ */
#define index shadow_workaround_index #define index shadow_workaround_index
#if !defined (__NetBSD__) && !defined (__DragonFly__) #if !defined (__NetBSD__)
#include <pci/pci.h> #include <pci/pci.h>
#else #else
#include <pciutils/pci.h> #include <pciutils/pci.h>

View File

@ -57,7 +57,7 @@
#define EERD_DATA 16 #define EERD_DATA 16
#define BIT(x) (1<<x) #define BIT(x) (1<<x)
#define PAGE_MASK 0x3f #define EE_PAGE_MASK 0x3f
static uint8_t *nicintel_eebar; static uint8_t *nicintel_eebar;
static struct pci_dev *nicintel_pci; static struct pci_dev *nicintel_pci;
@ -94,11 +94,11 @@ static int nicintel_ee_probe(struct flashctx *flash)
} }
} }
flash->chip->page_size = PAGE_MASK + 1; flash->chip->page_size = EE_PAGE_MASK + 1;
flash->chip->tested = TEST_OK_PREW; flash->chip->tested = TEST_OK_PREW;
flash->chip->gran = write_gran_1byte_implicit_erase; flash->chip->gran = write_gran_1byte_implicit_erase;
flash->chip->block_erasers->eraseblocks[0].size = (PAGE_MASK + 1); flash->chip->block_erasers->eraseblocks[0].size = (EE_PAGE_MASK + 1);
flash->chip->block_erasers->eraseblocks[0].count = (flash->chip->total_size * 1024) / (PAGE_MASK + 1); flash->chip->block_erasers->eraseblocks[0].count = (flash->chip->total_size * 1024) / (EE_PAGE_MASK + 1);
return 1; return 1;
} }
@ -249,7 +249,7 @@ static int nicintel_ee_write(struct flashctx *flash, const uint8_t *buf, unsigne
nicintel_ee_bitbang((buf) ? *buf++ : 0xff, NULL); nicintel_ee_bitbang((buf) ? *buf++ : 0xff, NULL);
len--; len--;
addr++; addr++;
if (!(addr & PAGE_MASK)) if (!(addr & EE_PAGE_MASK))
break; break;
} }
nicintel_ee_bitset(EEC, EE_CS, 1); nicintel_ee_bitset(EEC, EE_CS, 1);