diff options
4 files changed, 96 insertions, 110 deletions
diff --git a/meta-oe/recipes-bsp/flashrom/flashrom/0001-Makefile-Check-for-last-line-only-from-preprocessed-.patch b/meta-oe/recipes-bsp/flashrom/flashrom/0001-Makefile-Check-for-last-line-only-from-preprocessed-.patch deleted file mode 100644 index 7a8be83746..0000000000 --- a/meta-oe/recipes-bsp/flashrom/flashrom/0001-Makefile-Check-for-last-line-only-from-preprocessed-.patch +++ /dev/null | |||
| @@ -1,57 +0,0 @@ | |||
| 1 | From 3c078497e506bd6acb406da5cde7ce20e8896353 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Thu, 23 Jul 2020 14:13:59 -0700 | ||
| 4 | Subject: [PATCH] Makefile: Check for last line only from preprocessed output | ||
| 5 | |||
| 6 | This started to fail with glibc 2.32 since glibc added additional | ||
| 7 | attributes to functions in signal.h therefore existing regexp started to | ||
| 8 | fail as it is not able to handle these functions e.g. | ||
| 9 | |||
| 10 | extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__ , __leaf__)) | ||
| 11 | __attribute__ ((__deprecated__ ("Use sigaction with SA_RESTART instead"))); | ||
| 12 | |||
| 13 | grep -v '^\#' | grep '"' | cut -f 2 -d'"' | ||
| 14 | bit outside of fd_set selected | ||
| 15 | Use sigaction with SA_RESTART instead | ||
| 16 | arm | ||
| 17 | |||
| 18 | So changing it to | ||
| 19 | tail -1 | grep '"' | cut -f 2 -d'"' | ||
| 20 | arm | ||
| 21 | |||
| 22 | Produces the expected result, this was hidden until now | ||
| 23 | |||
| 24 | Upstream-Status: Submitted [https://review.coreboot.org/c/flashrom/+/43770] | ||
| 25 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 26 | Change-Id: I123a046e142d54632f12d54e2aa09b0928c02b91 | ||
| 27 | --- | ||
| 28 | Makefile | 6 +++--- | ||
| 29 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
| 30 | |||
| 31 | diff --git a/Makefile b/Makefile | ||
| 32 | index 803529f..3795681 100644 | ||
| 33 | --- a/Makefile | ||
| 34 | +++ b/Makefile | ||
| 35 | @@ -106,7 +106,7 @@ endif | ||
| 36 | # IMPORTANT: The following line must be placed before TARGET_OS is ever used | ||
| 37 | # (of course), but should come after any lines setting CC because the line | ||
| 38 | # below uses CC itself. | ||
| 39 | -override TARGET_OS := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E os.h 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"')) | ||
| 40 | +override TARGET_OS := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E os.h 2>/dev/null | tail -1 | grep '"' | cut -f 2 -d'"')) | ||
| 41 | |||
| 42 | ifeq ($(TARGET_OS), Darwin) | ||
| 43 | override CPPFLAGS += -I/opt/local/include -I/usr/local/include | ||
| 44 | @@ -460,8 +460,8 @@ endif | ||
| 45 | # IMPORTANT: The following line must be placed before ARCH is ever used | ||
| 46 | # (of course), but should come after any lines setting CC because the line | ||
| 47 | # below uses CC itself. | ||
| 48 | -override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"')) | ||
| 49 | -override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null | grep -v '^\#')) | ||
| 50 | +override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null | tail -1 | grep '"' | cut -f 2 -d'"')) | ||
| 51 | +override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null | tail -1)) | ||
| 52 | |||
| 53 | # Disable the internal programmer on unsupported architectures (everything but x86 and mipsel) | ||
| 54 | ifneq ($(ARCH)-little, $(filter $(ARCH),x86 mips)-$(ENDIAN)) | ||
| 55 | -- | ||
| 56 | 2.27.0 | ||
| 57 | |||
diff --git a/meta-oe/recipes-bsp/flashrom/flashrom/0001-typecast-enum-conversions-explicitly.patch b/meta-oe/recipes-bsp/flashrom/flashrom/0001-typecast-enum-conversions-explicitly.patch index 7ac53650f2..f2302dbcc3 100644 --- a/meta-oe/recipes-bsp/flashrom/flashrom/0001-typecast-enum-conversions-explicitly.patch +++ b/meta-oe/recipes-bsp/flashrom/flashrom/0001-typecast-enum-conversions-explicitly.patch | |||
| @@ -1,69 +1,45 @@ | |||
| 1 | From 8a236330f2af56bde21e9f69208ea3e59f529f0c Mon Sep 17 00:00:00 2001 | 1 | Upstream-Status: Backport |
| 2 | From: Khem Raj <raj.khem@gmail.com> | 2 | Signed-off-by: Ross Burton <ross.burton@arm.com> |
| 3 | Date: Sun, 15 Mar 2020 17:02:30 -0700 | ||
| 4 | Subject: [PATCH] typecast enum conversions explicitly | ||
| 5 | 3 | ||
| 6 | clang complains like below | 4 | From 3a0c1966e4c66f91e6e8551e906b6db38002acb4 Mon Sep 17 00:00:00 2001 |
| 5 | From: Angel Pons <th3fanbus@gmail.com> | ||
| 6 | Date: Wed, 27 May 2020 12:15:51 +0200 | ||
| 7 | Subject: [PATCH] libflashrom.c: Use casts on enum conversions | ||
| 7 | 8 | ||
| 8 | 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] | 9 | This allows flashrom to build with GCC 10. |
| 9 | supported_boards[i].working = binfo[i].working; | ||
| 10 | ~ ~~~~~~~~~^~~~~~~ | ||
| 11 | 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] | ||
| 12 | supported_chipsets[i].status = chipset[i].status; | ||
| 13 | ~ ~~~~~~~~~~~^~~~~~ | ||
| 14 | 10 | ||
| 15 | However these enums are exactly same so they can be typecasted | 11 | Change-Id: I2166cdf3681452631ef8e980face2924e9a6c81a |
| 16 | 12 | Signed-off-by: Angel Pons <th3fanbus@gmail.com> | |
| 17 | libflashrom.h | 13 | Reviewed-on: https://review.coreboot.org/c/flashrom/+/41775 |
| 18 | 14 | Tested-by: build bot (Jenkins) <no-reply@coreboot.org> | |
| 19 | /** @ingroup flashrom-query */ | 15 | Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> |
| 20 | enum flashrom_test_state { | ||
| 21 | FLASHROM_TESTED_OK = 0, | ||
| 22 | FLASHROM_TESTED_NT = 1, | ||
| 23 | FLASHROM_TESTED_BAD = 2, | ||
| 24 | FLASHROM_TESTED_DEP = 3, | ||
| 25 | FLASHROM_TESTED_NA = 4, | ||
| 26 | }; | ||
| 27 | |||
| 28 | flash.h | ||
| 29 | |||
| 30 | enum test_state { | ||
| 31 | OK = 0, | ||
| 32 | NT = 1, /* Not tested */ | ||
| 33 | BAD, /* Known to not work */ | ||
| 34 | DEP, /* Support depends on configuration (e.g. Intel flash descriptor) */ | ||
| 35 | NA, /* Not applicable (e.g. write support on ROM chips) */ | ||
| 36 | }; | ||
| 37 | |||
| 38 | Upstream-Status: Pending | ||
| 39 | |||
| 40 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 41 | --- | 16 | --- |
| 42 | libflashrom.c | 4 ++-- | 17 | libflashrom.c | 6 ++++-- |
| 43 | 1 file changed, 2 insertions(+), 2 deletions(-) | 18 | 1 file changed, 4 insertions(+), 2 deletions(-) |
| 44 | 19 | ||
| 45 | diff --git a/libflashrom.c b/libflashrom.c | 20 | diff --git a/libflashrom.c b/libflashrom.c |
| 46 | index 0dec22e..7956685 100644 | 21 | index ab7e364..c20d9c7 100644 |
| 47 | --- a/libflashrom.c | 22 | --- a/libflashrom.c |
| 48 | +++ b/libflashrom.c | 23 | +++ b/libflashrom.c |
| 49 | @@ -188,7 +188,7 @@ struct flashrom_board_info *flashrom_supported_boards(void) | 24 | @@ -188,7 +188,8 @@ struct flashrom_board_info *flashrom_supported_boards(void) |
| 50 | for (; i < boards_known_size; ++i) { | 25 | for (; i < boards_known_size; ++i) { |
| 51 | supported_boards[i].vendor = binfo[i].vendor; | 26 | supported_boards[i].vendor = binfo[i].vendor; |
| 52 | supported_boards[i].name = binfo[i].name; | 27 | supported_boards[i].name = binfo[i].name; |
| 53 | - supported_boards[i].working = binfo[i].working; | 28 | - supported_boards[i].working = binfo[i].working; |
| 54 | + supported_boards[i].working = (enum flashrom_test_state)binfo[i].working; | 29 | + supported_boards[i].working = |
| 30 | + (enum flashrom_test_state) binfo[i].working; | ||
| 55 | } | 31 | } |
| 56 | } else { | 32 | } else { |
| 57 | msg_gerr("Memory allocation error!\n"); | 33 | msg_gerr("Memory allocation error!\n"); |
| 58 | @@ -226,7 +226,7 @@ struct flashrom_chipset_info *flashrom_supported_chipsets(void) | 34 | @@ -226,7 +227,8 @@ struct flashrom_chipset_info *flashrom_supported_chipsets(void) |
| 59 | supported_chipsets[i].chipset = chipset[i].device_name; | 35 | supported_chipsets[i].chipset = chipset[i].device_name; |
| 60 | supported_chipsets[i].vendor_id = chipset[i].vendor_id; | 36 | supported_chipsets[i].vendor_id = chipset[i].vendor_id; |
| 61 | supported_chipsets[i].chipset_id = chipset[i].device_id; | 37 | supported_chipsets[i].chipset_id = chipset[i].device_id; |
| 62 | - supported_chipsets[i].status = chipset[i].status; | 38 | - supported_chipsets[i].status = chipset[i].status; |
| 63 | + supported_chipsets[i].status = (enum flashrom_test_state)chipset[i].status; | 39 | + supported_chipsets[i].status = |
| 40 | + (enum flashrom_test_state) chipset[i].status; | ||
| 64 | } | 41 | } |
| 65 | } else { | 42 | } else { |
| 66 | msg_gerr("Memory allocation error!\n"); | 43 | msg_gerr("Memory allocation error!\n"); |
| 67 | -- | 44 | -- |
| 68 | 2.25.1 | 45 | 2.25.1 |
| 69 | |||
diff --git a/meta-oe/recipes-bsp/flashrom/flashrom/meson-fixes.patch b/meta-oe/recipes-bsp/flashrom/flashrom/meson-fixes.patch new file mode 100644 index 0000000000..e45236ee07 --- /dev/null +++ b/meta-oe/recipes-bsp/flashrom/flashrom/meson-fixes.patch | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | Add a ftdi option alongside USB and PCI to control the external dependency, and | ||
| 2 | ensure that the build is successful in all combinations of options. | ||
| 3 | |||
| 4 | Upstream-Status: Pending | ||
| 5 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
| 6 | |||
| 7 | diff --git a/meson.build b/meson.build | ||
| 8 | index 375089c..0df9d69 100644 | ||
| 9 | --- a/meson.build | ||
| 10 | +++ b/meson.build | ||
| 11 | @@ -91,6 +91,8 @@ else | ||
| 12 | config_digilent_spi = false | ||
| 13 | config_developerbox_spi = false | ||
| 14 | config_pickit2_spi = false | ||
| 15 | + config_stlinkv3_spi = false | ||
| 16 | + config_usbblaster_spi = false | ||
| 17 | endif | ||
| 18 | |||
| 19 | # some programmers require libpci | ||
| 20 | @@ -118,6 +120,21 @@ else | ||
| 21 | config_satasii = false | ||
| 22 | endif | ||
| 23 | |||
| 24 | +# some programmers require libftdi | ||
| 25 | +if get_option('ftdi') | ||
| 26 | + deps += dependency('libftdi1') | ||
| 27 | +else | ||
| 28 | + config_ft2232_spi = false | ||
| 29 | + config_usbblaster_spi = false | ||
| 30 | +endif | ||
| 31 | + | ||
| 32 | +if not (target_machine.cpu_family() == 'x86' or target_machine.cpu_family() == 'x86_64') | ||
| 33 | + config_satamv = false | ||
| 34 | + config_nic3com = false | ||
| 35 | + config_rayer_spi = false | ||
| 36 | + config_nicrealtek = false | ||
| 37 | +endif | ||
| 38 | + | ||
| 39 | # set defines for configured programmers | ||
| 40 | if config_atahpt | ||
| 41 | srcs += 'atahpt.c' | ||
| 42 | @@ -163,7 +180,6 @@ endif | ||
| 43 | if config_ft2232_spi | ||
| 44 | srcs += 'ft2232_spi.c' | ||
| 45 | cargs += '-DCONFIG_FT2232_SPI=1' | ||
| 46 | - deps += dependency('libftdi1') | ||
| 47 | cargs += '-DHAVE_FT232H=1' | ||
| 48 | endif | ||
| 49 | if config_gfxnvidia | ||
| 50 | @@ -216,6 +232,7 @@ endif | ||
| 51 | if config_nicintel | ||
| 52 | srcs += 'nicintel.c' | ||
| 53 | cargs += '-DCONFIG_NICINTEL=1' | ||
| 54 | + need_raw_access = true | ||
| 55 | endif | ||
| 56 | if config_nicintel_eeprom | ||
| 57 | srcs += 'nicintel_eeprom.c' | ||
| 58 | diff --git a/meson_options.txt b/meson_options.txt | ||
| 59 | index ea87311..b6b842d 100644 | ||
| 60 | --- a/meson_options.txt | ||
| 61 | +++ b/meson_options.txt | ||
| 62 | @@ -1,5 +1,6 @@ | ||
| 63 | option('pciutils', type : 'boolean', value : true, description : 'use pciutils') | ||
| 64 | option('usb', type : 'boolean', value : true, description : 'use libusb1') | ||
| 65 | +option('ftdi', type : 'boolean', value : true, description : 'use libftdi') | ||
| 66 | |||
| 67 | option('config_atahpt', type : 'boolean', value : false, description : 'Highpoint (HPT) ATA/RAID controllers') | ||
| 68 | option('config_atapromise', type : 'boolean', value : false, description : 'Promise ATA controller') | ||
diff --git a/meta-oe/recipes-bsp/flashrom/flashrom_1.2.bb b/meta-oe/recipes-bsp/flashrom/flashrom_1.2.bb index 66ae34af94..4e0b2d4a8c 100644 --- a/meta-oe/recipes-bsp/flashrom/flashrom_1.2.bb +++ b/meta-oe/recipes-bsp/flashrom/flashrom_1.2.bb | |||
| @@ -1,21 +1,20 @@ | |||
| 1 | DESCRIPTION = "flashrom is a utility for identifying, reading, writing, verifying and erasing flash chips" | 1 | DESCRIPTION = "flashrom is a utility for identifying, reading, writing, verifying and erasing flash chips" |
| 2 | LICENSE = "GPLv2" | 2 | LICENSE = "GPLv2+" |
| 3 | HOMEPAGE = "http://flashrom.org" | 3 | HOMEPAGE = "http://flashrom.org" |
| 4 | 4 | ||
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" |
| 6 | DEPENDS = "pciutils libusb libusb-compat" | ||
| 7 | |||
| 8 | SRC_URI = "https://download.flashrom.org/releases/flashrom-v${PV}.tar.bz2 \ | 6 | SRC_URI = "https://download.flashrom.org/releases/flashrom-v${PV}.tar.bz2 \ |
| 9 | file://0001-typecast-enum-conversions-explicitly.patch \ | 7 | file://0001-typecast-enum-conversions-explicitly.patch \ |
| 10 | file://0001-Makefile-Check-for-last-line-only-from-preprocessed-.patch \ | 8 | file://meson-fixes.patch \ |
| 11 | " | 9 | " |
| 12 | SRC_URI[md5sum] = "7f8e4b87087eb12ecee0fcc5445b4956" | 10 | SRC_URI[md5sum] = "7f8e4b87087eb12ecee0fcc5445b4956" |
| 13 | SRC_URI[sha256sum] = "e1f8d95881f5a4365dfe58776ce821dfcee0f138f75d0f44f8a3cd032d9ea42b" | 11 | SRC_URI[sha256sum] = "e1f8d95881f5a4365dfe58776ce821dfcee0f138f75d0f44f8a3cd032d9ea42b" |
| 14 | 12 | ||
| 15 | S = "${WORKDIR}/flashrom-v${PV}" | 13 | S = "${WORKDIR}/flashrom-v${PV}" |
| 16 | 14 | ||
| 17 | inherit pkgconfig | 15 | inherit meson pkgconfig |
| 18 | 16 | ||
| 19 | do_install() { | 17 | PACKAGECONFIG ??= "pci usb ftdi" |
| 20 | oe_runmake PREFIX=${prefix} DESTDIR=${D} install | 18 | PACKAGECONFIG[pci] = "-Dpciutils=true,-Dpciutils=false,pciutils" |
| 21 | } | 19 | PACKAGECONFIG[usb] = "-Dusb=true,-Dusb=false,libusb" |
| 20 | PACKAGECONFIG[ftdi] = "-Dftdi=true,-Dftdi=false,libftdi" | ||
