David Hendricks has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/35831 )
Change subject: flashrom: Add support for ARC platform ......................................................................
flashrom: Add support for ARC platform
Change-Id: I88cbe74b716d5fab16133fbf2ce9c35b74c25f32 Signed-off-by: Rosen Penev rosenp@gmail.com --- M Makefile M hwaccess.h M platform.h 3 files changed, 16 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/31/35831/1
diff --git a/Makefile b/Makefile index 7a21d12..cc9c444 100644 --- a/Makefile +++ b/Makefile @@ -453,7 +453,7 @@ # 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_RAYER_SPI), yes) UNSUPPORTED_FEATURES += CONFIG_RAYER_SPI=yes else diff --git a/hwaccess.h b/hwaccess.h index af7054b..5602c15 100644 --- a/hwaccess.h +++ b/hwaccess.h @@ -291,6 +291,10 @@
/* Non memory mapped I/O is not supported on ARM. */
+#elif IS_ARC + +/* Non memory mapped I/O is not supported on ARC. */ + #else
#error Unknown architecture, please check if it supports PCI port IO. diff --git a/platform.h b/platform.h index d290afc..195ba56 100644 --- a/platform.h +++ b/platform.h @@ -74,9 +74,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_RISCV || IS_SH || IS_S390) +#if !(IS_X86 || IS_MIPS || IS_PPC || IS_ARM || IS_SPARC || IS_ALPHA || IS_HPPA || IS_M68K || IS_RISCV || IS_SH || IS_S390 || IS_ARC) #error Unknown architecture #endif
@@ -123,6 +126,13 @@ /* 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(__arceb__) +#define __FLASHROM_BIG_ENDIAN__ 1 +#else +#define __FLASHROM_LITTLE_ENDIAN__ 1 +#endif + #endif /* IS_? */
#if !defined (__FLASHROM_BIG_ENDIAN__) && !defined (__FLASHROM_LITTLE_ENDIAN__)
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/35831 )
Change subject: flashrom: Add support for ARC platform ......................................................................
Patch Set 1:
From github: https://github.com/flashrom/flashrom/pull/88
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/35831 )
Change subject: flashrom: Add support for ARC platform ......................................................................
Patch Set 2: Code-Review+2
(1 comment)
https://review.coreboot.org/c/flashrom/+/35831/2/platform.h File platform.h:
https://review.coreboot.org/c/flashrom/+/35831/2/platform.h@130 PS2, Line 130: __arceb__ Hmmm, I can't find any reference for this (only Google results are this patch). But looking at other archs here, I assume that toolchain specific anyway and might have to be extended in the future.
It's definitely not wrong to assume BE in this case ^^ just wondering about false negatives.
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/35831 )
Change subject: flashrom: Add support for ARC platform ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/flashrom/+/35831/2/platform.h File platform.h:
https://review.coreboot.org/c/flashrom/+/35831/2/platform.h@130 PS2, Line 130: __arceb__
Hmmm, I can't find any reference for this (only Google results are this […]
Looking at gcc [1] more closely, it seems __BIG_ENDIAN__ and __LITTLE_ENDIAN__ are defined along with __arc__. So perhaps this should become: #elif IS_ARC #if defined(__BIG_ENDIAN__) #define __FLASHROM_BIG_ENDIAN__ 1
I've asked the author on github about that.
[1] https://github.com/gcc-mirror/gcc/blob/master/gcc/config/arc/arc-c.c
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/35831 )
Change subject: flashrom: Add support for ARC platform ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/flashrom/+/35831/2/platform.h File platform.h:
https://review.coreboot.org/c/flashrom/+/35831/2/platform.h@130 PS2, Line 130: __arceb__
Looking at gcc [1] more closely, it seems __BIG_ENDIAN__ and __LITTLE_ENDIAN__ are defined along wit […]
The author seems to agree with this approach, and has updated the PR: https://github.com/flashrom/flashrom/pull/88
LMK what you think and if the change seems sensible I'll upload the updated version to gerrit.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/35831 )
Change subject: flashrom: Add support for ARC platform ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/flashrom/+/35831/2/platform.h File platform.h:
https://review.coreboot.org/c/flashrom/+/35831/2/platform.h@130 PS2, Line 130: __arceb__
The author seems to agree with this approach, and has updated the PR: https://github. […]
sounds good to me, please go ahead.
Hello Angel Pons, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/35831
to look at the new patch set (#3).
Change subject: flashrom: Add support for ARC platform ......................................................................
flashrom: Add support for ARC platform
Signed-off-by: Rosen Penev rosenp@gmail.com Change-Id: I88cbe74b716d5fab16133fbf2ce9c35b74c25f32 --- M Makefile M hwaccess.h M platform.h 3 files changed, 16 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/31/35831/3
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/35831 )
Change subject: flashrom: Add support for ARC platform ......................................................................
Patch Set 3:
(1 comment)
Finally got around to updating this, PTAL when you have a moment.
https://review.coreboot.org/c/flashrom/+/35831/2/platform.h File platform.h:
https://review.coreboot.org/c/flashrom/+/35831/2/platform.h@130 PS2, Line 130: __arceb__
sounds good to me, please go ahead.
Done
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/35831 )
Change subject: flashrom: Add support for ARC platform ......................................................................
Patch Set 4: Code-Review+1
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/35831 )
Change subject: flashrom: Add support for ARC platform ......................................................................
Patch Set 4: Code-Review+2
Nico Huber has submitted this change. ( https://review.coreboot.org/c/flashrom/+/35831 )
Change subject: flashrom: Add support for ARC platform ......................................................................
flashrom: Add support for ARC platform
Signed-off-by: Rosen Penev rosenp@gmail.com Change-Id: I88cbe74b716d5fab16133fbf2ce9c35b74c25f32 Reviewed-on: https://review.coreboot.org/c/flashrom/+/35831 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: David Hendricks david.hendricks@gmail.com Reviewed-by: Nico Huber nico.h@gmx.de --- M Makefile M hwaccess.h M platform.h 3 files changed, 16 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified David Hendricks: Looks good to me, but someone else must approve Nico Huber: Looks good to me, approved
diff --git a/Makefile b/Makefile index 5cf4481..518d41b 100644 --- a/Makefile +++ b/Makefile @@ -466,7 +466,7 @@ # 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_RAYER_SPI), yes) UNSUPPORTED_FEATURES += CONFIG_RAYER_SPI=yes else diff --git a/hwaccess.h b/hwaccess.h index af7054b..5602c15 100644 --- a/hwaccess.h +++ b/hwaccess.h @@ -291,6 +291,10 @@
/* Non memory mapped I/O is not supported on ARM. */
+#elif IS_ARC + +/* Non memory mapped I/O is not supported on ARC. */ + #else
#error Unknown architecture, please check if it supports PCI port IO. diff --git a/platform.h b/platform.h index d290afc..751957c 100644 --- a/platform.h +++ b/platform.h @@ -74,9 +74,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_RISCV || IS_SH || IS_S390) +#if !(IS_X86 || IS_MIPS || IS_PPC || IS_ARM || IS_SPARC || IS_ALPHA || IS_HPPA || IS_M68K || IS_RISCV || IS_SH || IS_S390 || IS_ARC) #error Unknown architecture #endif
@@ -123,6 +126,13 @@ /* 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__)