Attention is currently required from: Thomas Heijligen.
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/58273
to look at the new patch set (#2).
Change subject: endian: Decide __FLASHROM_XXX_ENDIAN__ in the buildsystem
......................................................................
endian: Decide __FLASHROM_XXX_ENDIAN__ in the buildsystem
Change-Id: I37093528ae55e712cc30a0267a8ceac332750e7d
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.de>
---
M Makefile
M meson.build
M platform.h
3 files changed, 14 insertions(+), 89 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/73/58273/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/58273
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I37093528ae55e712cc30a0267a8ceac332750e7d
Gerrit-Change-Number: 58273
Gerrit-PatchSet: 2
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: newpatchset
Thomas Heijligen has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/58273 )
Change subject: endian: Decide __FLASHROM_XXX_ENDIAN__ in the Makefile
......................................................................
endian: Decide __FLASHROM_XXX_ENDIAN__ in the Makefile
Change-Id: I37093528ae55e712cc30a0267a8ceac332750e7d
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.de>
---
M Makefile
M platform.h
2 files changed, 7 insertions(+), 89 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/73/58273/1
diff --git a/Makefile b/Makefile
index 993cfc0..7c52e9b 100644
--- a/Makefile
+++ b/Makefile
@@ -248,6 +248,13 @@
$(call mark_unsupported,CONFIG_INTERNAL)
endif
+ifeq ($(ENDIAN), little)
+FEATURE_CFLAGS += -D'__FLASHROM_LITTLE_ENDIAN__=1'
+endif
+ifeq ($(ENDIAN), big)
+FEATURE_CFLAGS += -D'__FLASHROM_BIG_ENDIAN__=1'
+endif
+
# PCI port I/O support is unimplemented on PPC/MIPS/SPARC and unavailable on ARM.
# Right now this means the drivers below only work on x86.
ifneq ($(ARCH), x86)
diff --git a/platform.h b/platform.h
index cd8e54b..9bbde54 100644
--- a/platform.h
+++ b/platform.h
@@ -71,93 +71,4 @@
#error Unknown architecture
#endif
-/* The next big hunk tries to guess endianness from various preprocessor macros */
-/* First some error checking in case some weird header has defined both.
- * NB: OpenBSD always defines _BIG_ENDIAN and _LITTLE_ENDIAN. */
-#if defined (__LITTLE_ENDIAN__) && defined (__BIG_ENDIAN__)
-#error Conflicting endianness #define
-#endif
-
-#if IS_X86
-
-/* All x86 is little-endian. */
-#define __FLASHROM_LITTLE_ENDIAN__ 1
-
-#elif IS_MIPS
-
-/* MIPS can be either endian. */
-#if defined (__MIPSEL) || defined (__MIPSEL__) || defined (_MIPSEL) || defined (MIPSEL)
-#define __FLASHROM_LITTLE_ENDIAN__ 1
-#elif defined (__MIPSEB) || defined (__MIPSEB__) || defined (_MIPSEB) || defined (MIPSEB)
-#define __FLASHROM_BIG_ENDIAN__ 1
-#endif
-
-#elif IS_PPC
-
-/* PowerPC can be either endian. */
-#if defined (_BIG_ENDIAN) || defined (__BIG_ENDIAN__)
-#define __FLASHROM_BIG_ENDIAN__ 1
-#elif defined (_LITTLE_ENDIAN) || defined (__LITTLE_ENDIAN__)
-#define __FLASHROM_LITTLE_ENDIAN__ 1
-#endif
-
-#elif IS_ARM
-
-/* ARM can be either endian. */
-#if defined (__ARMEB__) || defined (__BIG_ENDIAN__)
-#define __FLASHROM_BIG_ENDIAN__ 1
-#elif defined (__ARMEL__) || defined (__LITTLE_ENDIAN__)
-#define __FLASHROM_LITTLE_ENDIAN__ 1
-#endif
-
-#elif IS_SPARC
-/* SPARC is big endian in general (but allows to access data in little endian too). */
-#define __FLASHROM_BIG_ENDIAN__ 1
-
-#elif IS_ARC
-#if defined(__BIG_ENDIAN__)
-#define __FLASHROM_BIG_ENDIAN__ 1
-#else
-#define __FLASHROM_LITTLE_ENDIAN__ 1
-#endif
-
-#endif /* IS_? */
-
-#if !defined (__FLASHROM_BIG_ENDIAN__) && !defined (__FLASHROM_LITTLE_ENDIAN__)
-
-/* If architecture-specific approaches fail try generic variants. First: BSD (works about everywhere). */
-#if !IS_WINDOWS
-#include <sys/param.h>
-
-#if defined (__BYTE_ORDER)
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define __FLASHROM_LITTLE_ENDIAN__
-#elif __BYTE_ORDER == __BIG_ENDIAN
-#define __FLASHROM_BIG_ENDIAN__
-#else
-#error Unknown byte order!
-#endif
-#endif /* defined __BYTE_ORDER */
-#endif /* !IS_WINDOWS */
-
-#if !defined (__FLASHROM_BIG_ENDIAN__) && !defined (__FLASHROM_LITTLE_ENDIAN__)
-
-/* Nonstandard libc-specific macros for determining endianness. */
-/* musl provides an endian.h as well... but it can not be detected from within C. */
-#if defined(__GLIBC__)
-#include <endian.h>
-#if BYTE_ORDER == LITTLE_ENDIAN
-#define __FLASHROM_LITTLE_ENDIAN__ 1
-#elif BYTE_ORDER == BIG_ENDIAN
-#define __FLASHROM_BIG_ENDIAN__ 1
-#endif
-#endif
-#endif
-
-#endif
-
-#if !defined (__FLASHROM_BIG_ENDIAN__) && !defined (__FLASHROM_LITTLE_ENDIAN__)
-#error Unable to determine endianness.
-#endif
-
#endif /* !__PLATFORM_H__ */
--
To view, visit https://review.coreboot.org/c/flashrom/+/58273
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I37093528ae55e712cc30a0267a8ceac332750e7d
Gerrit-Change-Number: 58273
Gerrit-PatchSet: 1
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: newchange
Attention is currently required from: Felix Singer, Nico Huber, Angel Pons.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/58015 )
Change subject: Makefile: move OS test into the Makefile
......................................................................
Set Ready For Review
--
To view, visit https://review.coreboot.org/c/flashrom/+/58015
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Id911f17f4100f242e1fde10d23a8459ddf38b369
Gerrit-Change-Number: 58015
Gerrit-PatchSet: 3
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Tue, 12 Oct 2021 14:02:06 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Thomas Heijligen has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/58248 )
Change subject: Makefile: reorder ARCH and ENDIAN test
......................................................................
Makefile: reorder ARCH and ENDIAN test
Change-Id: Ia1b3f0257aaeebb355700b65c51a2ba70b80d5ae
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.de>
---
M Makefile
1 file changed, 9 insertions(+), 17 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/48/58248/1
diff --git a/Makefile b/Makefile
index bc0047f..8b8611b 100644
--- a/Makefile
+++ b/Makefile
@@ -158,12 +158,17 @@
CC = gcc
endif
-# Determine the destination OS.
-# 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.
+# Determine the destination OS, architecture and endian
+# IMPORTANT: The following line must be placed before TARGET_OS, ARCH or ENDIAN
+# 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 \
| tail -1 | cut -f 2 -d'"'))
+override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null \
+ | tail -1 | cut -f 2 -d'"'))
+override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null \
+ | tail -1))
+
ifeq ($(TARGET_OS), $(filter $(TARGET_OS), FreeBSD OpenBSD DragonFlyBSD))
override CPPFLAGS += -I/usr/local/include
@@ -242,19 +247,6 @@
CONFIG_LINUX_I2C_HELPER = yes
endif
-###############################################################################
-# General architecture-specific settings.
-# Like above for the OS, below we verify user-supplied options depending on the target architecture.
-
-# Determine the destination processor architecture.
-# 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 \
- | tail -1 | 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))
$(call mark_unsupported,CONFIG_INTERNAL)
--
To view, visit https://review.coreboot.org/c/flashrom/+/58248
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ia1b3f0257aaeebb355700b65c51a2ba70b80d5ae
Gerrit-Change-Number: 58248
Gerrit-PatchSet: 1
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: newchange
Thomas Heijligen has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/58246 )
Change subject: Makefile: use STRIP_ARGS = -s on all platforms
......................................................................
Makefile: use STRIP_ARGS = -s on all platforms
Strip-all should be the default behavior of strip, but not all systems
support this. Use -s (--strip-all) on all systems to not depend on default behavior.
Change-Id: I2c80d553fb54d94bc65f07e700c90dd1bae4854e
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.de>
---
M Makefile
1 file changed, 1 insertion(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/46/58246/1
diff --git a/Makefile b/Makefile
index 8e06dee..29d1020 100644
--- a/Makefile
+++ b/Makefile
@@ -28,6 +28,7 @@
# Note for anyone editing this Makefile: gnumake will happily ignore any
# changes in this Makefile to variables set on the command line.
STRIP ?= strip
+STRIP_ARGS = -s
INSTALL = install
DIFF = diff
PREFIX ?= /usr/local
@@ -157,10 +158,6 @@
CC = gcc
endif
-ifneq ($(HOST_OS), SunOS)
-STRIP_ARGS = -s
-endif
-
# Determine the destination OS.
# 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
--
To view, visit https://review.coreboot.org/c/flashrom/+/58246
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I2c80d553fb54d94bc65f07e700c90dd1bae4854e
Gerrit-Change-Number: 58246
Gerrit-PatchSet: 1
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: newchange
Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/57917 )
Change subject: tests: Add wrap for libusb_init and use it in dediprog test
......................................................................
Patch Set 3:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/57917/comment/e2ffff4e_7d659534
PS3, Line 15: real libusb_init
> Actually, there are two things: 1. `libusb.h`, we can either use the original or […]
Thank you for explanation, it is helpful! I need to do some thinking about all this, and then I will upload new version of the chain, incorporating all the comments.
--
To view, visit https://review.coreboot.org/c/flashrom/+/57917
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I51c9cb96db1afb3298f4d098df96509d3cb3c046
Gerrit-Change-Number: 57917
Gerrit-PatchSet: 3
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Mon, 11 Oct 2021 08:09:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment