summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-oe/recipes-bsp/flashrom
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-bsp/flashrom')
-rw-r--r--meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-Makefile-Check-for-last-line-only-from-preprocessed-.patch57
-rw-r--r--meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-flashrom-Mark-RISCV-as-non-memory-mapped-I-O-archite.patch44
-rw-r--r--meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-typecast-enum-conversions-explicitly.patch66
-rw-r--r--meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/meson-fixes.patch68
-rw-r--r--meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom_1.2.bb16
5 files changed, 141 insertions, 110 deletions
diff --git a/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-Makefile-Check-for-last-line-only-from-preprocessed-.patch b/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-Makefile-Check-for-last-line-only-from-preprocessed-.patch
deleted file mode 100644
index 7a8be8374..000000000
--- a/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-Makefile-Check-for-last-line-only-from-preprocessed-.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 3c078497e506bd6acb406da5cde7ce20e8896353 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Thu, 23 Jul 2020 14:13:59 -0700
-Subject: [PATCH] Makefile: Check for last line only from preprocessed output
-
-This started to fail with glibc 2.32 since glibc added additional
-attributes to functions in signal.h therefore existing regexp started to
-fail as it is not able to handle these functions e.g.
-
-extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__ , __leaf__))
- __attribute__ ((__deprecated__ ("Use sigaction with SA_RESTART instead")));
-
-grep -v '^\#' | grep '"' | cut -f 2 -d'"'
-bit outside of fd_set selected
-Use sigaction with SA_RESTART instead
-arm
-
-So changing it to
-tail -1 | grep '"' | cut -f 2 -d'"'
-arm
-
-Produces the expected result, this was hidden until now
-
-Upstream-Status: Submitted [https://review.coreboot.org/c/flashrom/+/43770]
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Change-Id: I123a046e142d54632f12d54e2aa09b0928c02b91
----
- Makefile | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 803529f..3795681 100644
---- a/Makefile
-+++ b/Makefile
-@@ -106,7 +106,7 @@ endif
- # IMPORTANT: The following line must be placed before TARGET_OS is ever used
- # (of course), but should come after any lines setting CC because the line
- # below uses CC itself.
--override TARGET_OS := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E os.h 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"'))
-+override TARGET_OS := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E os.h 2>/dev/null | tail -1 | grep '"' | cut -f 2 -d'"'))
-
- ifeq ($(TARGET_OS), Darwin)
- override CPPFLAGS += -I/opt/local/include -I/usr/local/include
-@@ -460,8 +460,8 @@ endif
- # 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
- # below uses CC itself.
--override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"'))
--override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null | grep -v '^\#'))
-+override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null | tail -1 | grep '"' | cut -f 2 -d'"'))
-+override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null | tail -1))
-
- # Disable the internal programmer on unsupported architectures (everything but x86 and mipsel)
- ifneq ($(ARCH)-little, $(filter $(ARCH),x86 mips)-$(ENDIAN))
---
-2.27.0
-
diff --git a/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-flashrom-Mark-RISCV-as-non-memory-mapped-I-O-archite.patch b/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-flashrom-Mark-RISCV-as-non-memory-mapped-I-O-archite.patch
new file mode 100644
index 000000000..e481c5a16
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-flashrom-Mark-RISCV-as-non-memory-mapped-I-O-archite.patch
@@ -0,0 +1,44 @@
+From 2c777126765b4095bf481d5cfe4a21470374d940 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 30 Mar 2021 15:12:09 -0700
+Subject: [PATCH] flashrom: Mark RISCV as non memory-mapped I/O architecture
+
+Upstream-Status: Submitted [https://review.coreboot.org/c/flashrom/+/51960]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Change-Id: I55c4e8529d36f0850dd56441c3fb8602c5d889fd
+---
+ Makefile | 2 +-
+ hwaccess.h | 4 ++++
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 6d37d55..203e04b 100644
+--- a/Makefile
++++ b/Makefile
+@@ -559,7 +559,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 arc))
++ifneq ($(ARCH),$(filter $(ARCH),x86 mips ppc arm sparc arc riscv))
+ ifeq ($(CONFIG_RAYER_SPI), yes)
+ UNSUPPORTED_FEATURES += CONFIG_RAYER_SPI=yes
+ else
+diff --git a/hwaccess.h b/hwaccess.h
+index 5602c15..e79988a 100644
+--- a/hwaccess.h
++++ b/hwaccess.h
+@@ -295,6 +295,10 @@ int libpayload_wrmsr(int addr, msr_t msr);
+
+ /* Non memory mapped I/O is not supported on ARC. */
+
++#elif IS_RISCV
++
++/* Non memory mapped I/O is not supported on RISCV. */
++
+ #else
+
+ #error Unknown architecture, please check if it supports PCI port IO.
+--
+2.31.1
+
diff --git a/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-typecast-enum-conversions-explicitly.patch b/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-typecast-enum-conversions-explicitly.patch
index 7ac53650f..f2302dbcc 100644
--- a/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-typecast-enum-conversions-explicitly.patch
+++ b/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/0001-typecast-enum-conversions-explicitly.patch
@@ -1,69 +1,45 @@
-From 8a236330f2af56bde21e9f69208ea3e59f529f0c Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 15 Mar 2020 17:02:30 -0700
-Subject: [PATCH] typecast enum conversions explicitly
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@arm.com>
-clang complains like below
+From 3a0c1966e4c66f91e6e8551e906b6db38002acb4 Mon Sep 17 00:00:00 2001
+From: Angel Pons <th3fanbus@gmail.com>
+Date: Wed, 27 May 2020 12:15:51 +0200
+Subject: [PATCH] libflashrom.c: Use casts on enum conversions
-libflashrom.c:191:43: error: implicit conversion from enumeration type 'const enum test_state' to different enumeration type 'enum flashrom_test_state' [-Werror,-Wenum-conversion]
- supported_boards[i].working = binfo[i].working;
- ~ ~~~~~~~~~^~~~~~~
-libflashrom.c:229:46: error: implicit conversion from enumeration type 'const enum test_state' to different enumeration type 'enum flashrom_test_state' [-Werror,-Wenum-conversion]
- supported_chipsets[i].status = chipset[i].status;
- ~ ~~~~~~~~~~~^~~~~~
+This allows flashrom to build with GCC 10.
-However these enums are exactly same so they can be typecasted
-
-libflashrom.h
-
-/** @ingroup flashrom-query */
-enum flashrom_test_state {
- FLASHROM_TESTED_OK = 0,
- FLASHROM_TESTED_NT = 1,
- FLASHROM_TESTED_BAD = 2,
- FLASHROM_TESTED_DEP = 3,
- FLASHROM_TESTED_NA = 4,
-};
-
-flash.h
-
-enum test_state {
- OK = 0,
- NT = 1, /* Not tested */
- BAD, /* Known to not work */
- DEP, /* Support depends on configuration (e.g. Intel flash descriptor) */
- NA, /* Not applicable (e.g. write support on ROM chips) */
- };
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Change-Id: I2166cdf3681452631ef8e980face2924e9a6c81a
+Signed-off-by: Angel Pons <th3fanbus@gmail.com>
+Reviewed-on: https://review.coreboot.org/c/flashrom/+/41775
+Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
+Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
---
- libflashrom.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ libflashrom.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libflashrom.c b/libflashrom.c
-index 0dec22e..7956685 100644
+index ab7e364..c20d9c7 100644
--- a/libflashrom.c
+++ b/libflashrom.c
-@@ -188,7 +188,7 @@ struct flashrom_board_info *flashrom_supported_boards(void)
+@@ -188,7 +188,8 @@ struct flashrom_board_info *flashrom_supported_boards(void)
for (; i < boards_known_size; ++i) {
supported_boards[i].vendor = binfo[i].vendor;
supported_boards[i].name = binfo[i].name;
- supported_boards[i].working = binfo[i].working;
-+ supported_boards[i].working = (enum flashrom_test_state)binfo[i].working;
++ supported_boards[i].working =
++ (enum flashrom_test_state) binfo[i].working;
}
} else {
msg_gerr("Memory allocation error!\n");
-@@ -226,7 +226,7 @@ struct flashrom_chipset_info *flashrom_supported_chipsets(void)
+@@ -226,7 +227,8 @@ struct flashrom_chipset_info *flashrom_supported_chipsets(void)
supported_chipsets[i].chipset = chipset[i].device_name;
supported_chipsets[i].vendor_id = chipset[i].vendor_id;
supported_chipsets[i].chipset_id = chipset[i].device_id;
- supported_chipsets[i].status = chipset[i].status;
-+ supported_chipsets[i].status = (enum flashrom_test_state)chipset[i].status;
++ supported_chipsets[i].status =
++ (enum flashrom_test_state) chipset[i].status;
}
} else {
msg_gerr("Memory allocation error!\n");
--
2.25.1
-
diff --git a/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/meson-fixes.patch b/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/meson-fixes.patch
new file mode 100644
index 000000000..e45236ee0
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom/meson-fixes.patch
@@ -0,0 +1,68 @@
+Add a ftdi option alongside USB and PCI to control the external dependency, and
+ensure that the build is successful in all combinations of options.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+diff --git a/meson.build b/meson.build
+index 375089c..0df9d69 100644
+--- a/meson.build
++++ b/meson.build
+@@ -91,6 +91,8 @@ else
+ config_digilent_spi = false
+ config_developerbox_spi = false
+ config_pickit2_spi = false
++ config_stlinkv3_spi = false
++ config_usbblaster_spi = false
+ endif
+
+ # some programmers require libpci
+@@ -118,6 +120,21 @@ else
+ config_satasii = false
+ endif
+
++# some programmers require libftdi
++if get_option('ftdi')
++ deps += dependency('libftdi1')
++else
++ config_ft2232_spi = false
++ config_usbblaster_spi = false
++endif
++
++if not (target_machine.cpu_family() == 'x86' or target_machine.cpu_family() == 'x86_64')
++ config_satamv = false
++ config_nic3com = false
++ config_rayer_spi = false
++ config_nicrealtek = false
++endif
++
+ # set defines for configured programmers
+ if config_atahpt
+ srcs += 'atahpt.c'
+@@ -163,7 +180,6 @@ endif
+ if config_ft2232_spi
+ srcs += 'ft2232_spi.c'
+ cargs += '-DCONFIG_FT2232_SPI=1'
+- deps += dependency('libftdi1')
+ cargs += '-DHAVE_FT232H=1'
+ endif
+ if config_gfxnvidia
+@@ -216,6 +232,7 @@ endif
+ if config_nicintel
+ srcs += 'nicintel.c'
+ cargs += '-DCONFIG_NICINTEL=1'
++ need_raw_access = true
+ endif
+ if config_nicintel_eeprom
+ srcs += 'nicintel_eeprom.c'
+diff --git a/meson_options.txt b/meson_options.txt
+index ea87311..b6b842d 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -1,5 +1,6 @@
+ option('pciutils', type : 'boolean', value : true, description : 'use pciutils')
+ option('usb', type : 'boolean', value : true, description : 'use libusb1')
++option('ftdi', type : 'boolean', value : true, description : 'use libftdi')
+
+ option('config_atahpt', type : 'boolean', value : false, description : 'Highpoint (HPT) ATA/RAID controllers')
+ option('config_atapromise', type : 'boolean', value : false, description : 'Promise ATA controller')
diff --git a/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom_1.2.bb b/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom_1.2.bb
index 66ae34af9..145a3cad0 100644
--- a/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom_1.2.bb
+++ b/meta-openembedded/meta-oe/recipes-bsp/flashrom/flashrom_1.2.bb
@@ -1,21 +1,21 @@
DESCRIPTION = "flashrom is a utility for identifying, reading, writing, verifying and erasing flash chips"
-LICENSE = "GPLv2"
+LICENSE = "GPLv2+"
HOMEPAGE = "http://flashrom.org"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-DEPENDS = "pciutils libusb libusb-compat"
-
SRC_URI = "https://download.flashrom.org/releases/flashrom-v${PV}.tar.bz2 \
file://0001-typecast-enum-conversions-explicitly.patch \
- file://0001-Makefile-Check-for-last-line-only-from-preprocessed-.patch \
+ file://meson-fixes.patch \
+ file://0001-flashrom-Mark-RISCV-as-non-memory-mapped-I-O-archite.patch \
"
SRC_URI[md5sum] = "7f8e4b87087eb12ecee0fcc5445b4956"
SRC_URI[sha256sum] = "e1f8d95881f5a4365dfe58776ce821dfcee0f138f75d0f44f8a3cd032d9ea42b"
S = "${WORKDIR}/flashrom-v${PV}"
-inherit pkgconfig
+inherit meson pkgconfig
-do_install() {
- oe_runmake PREFIX=${prefix} DESTDIR=${D} install
-}
+PACKAGECONFIG ??= "pci usb ftdi"
+PACKAGECONFIG[pci] = "-Dpciutils=true,-Dpciutils=false,pciutils"
+PACKAGECONFIG[usb] = "-Dusb=true,-Dusb=false,libusb"
+PACKAGECONFIG[ftdi] = "-Dftdi=true,-Dftdi=false,libftdi"