aboutsummaryrefslogtreecommitdiff
path: root/utils/flashrom
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2019-07-01 10:30:59 -0700
committerRosen Penev <rosenp@gmail.com>2019-07-01 10:39:54 -0700
commit12378cd4d3d96975f1066e26089500cac73ac68e (patch)
treedfb7af8e316ea98c9290cf157bc2446e06cbd37a /utils/flashrom
parent8897ea4d51a660aca141036f1879c2e234797a4f (diff)
flashrom: Add ARC support
Mainly endian definitions are needed. Removed sys/io.h patch. It's a GNU header unsupported by uClibc-ng. Cleaned up Makefile slightly. Added HTTPS everywhere. Added PKG_BUILD_PARALLEL for faster compilation. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'utils/flashrom')
-rw-r--r--utils/flashrom/Makefile12
-rw-r--r--utils/flashrom/patches/0002-fix-io-h-include.patch10
-rw-r--r--utils/flashrom/patches/0003-ch341a_spi-avoid-deprecated-libusb-functions.patch2
-rw-r--r--utils/flashrom/patches/010-add-arc.patch54
4 files changed, 61 insertions, 17 deletions
diff --git a/utils/flashrom/Makefile b/utils/flashrom/Makefile
index e2152b65b..5cea259a1 100644
--- a/utils/flashrom/Makefile
+++ b/utils/flashrom/Makefile
@@ -9,20 +9,20 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=flashrom
PKG_VERSION:=1.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://download.flashrom.org/releases
+PKG_SOURCE_URL:=https://download.flashrom.org/releases
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_HASH:=3702fa215ba5fb5af8e54c852d239899cfa1389194c1e51cb2a170c4dc9dee64
-PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
-
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
-PKG_LICENSE:=GPL-2.0
+PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
+PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
include flashrom.mk
@@ -37,7 +37,7 @@ define Package/flashrom/default
SECTION:=utils
CATEGORY:=Utilities
TITLE:=FlashROM Utility
- URL:=http://www.flashrom.org/
+ URL:=https://www.flashrom.org/
endef
define Package/flashrom
diff --git a/utils/flashrom/patches/0002-fix-io-h-include.patch b/utils/flashrom/patches/0002-fix-io-h-include.patch
deleted file mode 100644
index 63109e1f1..000000000
--- a/utils/flashrom/patches/0002-fix-io-h-include.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/flash.h
-+++ b/flash.h
-@@ -30,6 +30,7 @@
- #include <stdio.h>
- #include <stdint.h>
- #include <stddef.h>
-+#include <sys/io.h>
- #include <stdarg.h>
- #include <stdbool.h>
- #if IS_WINDOWS
diff --git a/utils/flashrom/patches/0003-ch341a_spi-avoid-deprecated-libusb-functions.patch b/utils/flashrom/patches/0003-ch341a_spi-avoid-deprecated-libusb-functions.patch
index 7a9be3b2a..fa941e42d 100644
--- a/utils/flashrom/patches/0003-ch341a_spi-avoid-deprecated-libusb-functions.patch
+++ b/utils/flashrom/patches/0003-ch341a_spi-avoid-deprecated-libusb-functions.patch
@@ -21,7 +21,7 @@ diff --git a/ch341a_spi.c b/ch341a_spi.c
index 95e9c95..ee18624 100644
--- a/ch341a_spi.c
+++ b/ch341a_spi.c
-@@ -441,7 +441,12 @@ int ch341a_spi_init(void)
+@@ -444,7 +444,12 @@ int ch341a_spi_init(void)
return -1;
}
diff --git a/utils/flashrom/patches/010-add-arc.patch b/utils/flashrom/patches/010-add-arc.patch
new file mode 100644
index 000000000..c2ccbe883
--- /dev/null
+++ b/utils/flashrom/patches/010-add-arc.patch
@@ -0,0 +1,54 @@
+--- a/Makefile
++++ b/Makefile
+@@ -420,7 +420,7 @@ endif
+ # Disable all drivers needing raw access (memory, PCI, port I/O) on
+ # architectures with unknown raw access properties.
+ # Right now those architectures are alpha hppa m68k sh s390
+-ifneq ($(ARCH),$(filter $(ARCH),x86 mips ppc arm sparc))
++ifneq ($(ARCH),$(filter $(ARCH),x86 mips ppc arm sparc arc))
+ ifeq ($(CONFIG_INTERNAL), yes)
+ UNSUPPORTED_FEATURES += CONFIG_INTERNAL=yes
+ else
+--- a/hwaccess.h
++++ b/hwaccess.h
+@@ -87,6 +87,13 @@
+ /* SPARC is big endian in general (but allows to access data in little endian too). */
+ #define __FLASHROM_BIG_ENDIAN__ 1
+
++#elif IS_ARC
++#ifdef __arceb__
++#define __FLASHROM_BIG_ENDIAN__ 1
++#else
++#define __FLASHROM_LITTLE_ENDIAN__ 1
++#endif
++
+ #endif /* IS_? */
+
+ #if !defined (__FLASHROM_BIG_ENDIAN__) && !defined (__FLASHROM_LITTLE_ENDIAN__)
+@@ -378,6 +385,8 @@ int libpayload_wrmsr(int addr, msr_t msr);
+
+ /* Non memory mapped I/O is not supported on ARM. */
+
++#elif IS_ARC
++
+ #else
+
+ #error Unknown architecture, please check if it supports PCI port IO.
+diff --git a/platform.h b/platform.h
+index b2fdcd0..2e68e71 100644
+--- a/platform.h
++++ b/platform.h
+@@ -75,9 +75,12 @@
+ #elif defined(__s390__) || defined(__s390x__) || defined(__zarch__)
+ #define __FLASHROM_ARCH__ "s390"
+ #define IS_S390 1
++#elif defined (__arc__)
++ #define __FLASHROM_ARCH__ "arc"
++ #define IS_ARC 1
+ #endif
+
+-#if !(IS_X86 || IS_MIPS || IS_PPC || IS_ARM || IS_SPARC || IS_ALPHA || IS_HPPA || IS_M68K || IS_SH || IS_S390)
++#if !(IS_X86 || IS_MIPS || IS_PPC || IS_ARM || IS_SPARC || IS_ALPHA || IS_HPPA || IS_M68K || IS_SH || IS_S390 || IS_ARC)
+ #error Unknown architecture
+ #endif
+