the following patch was just integrated into master:
commit d2be1f11e11b68d88f9065ae75f32d7982cc3fe6
Author: Martin Roth <martin.roth(a)se-eng.com>
Date: Mon Mar 11 13:17:27 2013 -0600
AMD hudson & SB800 - Fix issues with mawk
When calculating the offsets of the various binary blobs within the
coreboot.rom file, we noticed that using mawk as the awk tool instead
of using gawk led to build issues. This was finally traced to the
maximum value of the unsigned long variables within mawk - 0x7fff_ffff.
Because we were doing calculations on values up in the 0xffxxxxxx
range, these numbers would either be turned into floating point values
and printed using scientific notation, or truncated at 0x7fff_ffff.
To fix this, we print the values out as floating point, with no decimal
digits. This works in gawk, mawk, and original-awk and as the testing
below show, seems to be the best way to do this.
printf %u 0xFFFFFFFF | awk '{printf("%.0f %u %d", $1 , $1 , $1 )}'
mawk: 4294967295 2147483647 2147483647
original-awk: 4294967295 2147483648 4294967295
gawk: 4294967295 4294967295 4294967295
The issue of %d not matching gawk and original-awk has been reported
to ubuntu.
In the future, I'd recommend that whenever awk is used, a format is
specified. It doesn't seem that we can count on the representation
being the same between the different versions.
Change-Id: I7b6b821c8ab13ad11f72e674ac726a98e8678710
Signed-off-by: Martin Roth <martin.roth(a)se-eng.com>
Reviewed-on: http://review.coreboot.org/2628
Reviewed-by: Dave Frodin <dave.frodin(a)se-eng.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Build-Tested: build bot (Jenkins) at Mon Mar 25 19:53:14 2013, giving +1
Reviewed-By: Stefan Reinauer <stefan.reinauer(a)coreboot.org> at Mon Apr 1 20:52:31 2013, giving +2
See http://review.coreboot.org/2628 for details.
-gerrit
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3002
-gerrit
commit 45a346f15b5ee549698fc6aa274c9f3ef91fd445
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Mon Apr 1 18:26:58 2013 +0200
inteltool: Cast to `ptrdiff_t` instead of `uint64_t`
When building inteltool under x86-32, the following warnings are
shown.
$ gcc --version
gcc-4.7.real (Debian 4.7.2-15) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ make
[…]
amb.c: In function ‘amb_read_config32’:
amb.c:31:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
amb.c:31:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
amb.c: In function ‘amb_read_config16’:
amb.c:45:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
amb.c:45:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
amb.c: In function ‘amb_read_config8’:
amb.c:60:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
amb.c:60:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
[…]
Nico Huber commented the following [1].
I don't see those warnings because I build for x86-64. I guess
they could be fixed by casting to `ptrdiff_t` (from stddef.h)
instead of `uint64_t`.
And indeed, using `ptrdiff_t` fixes the warning.
These warnings were introduced in commit »inteltool: Add support for
dumping AMB registers« (4b7b320f) [2].
[1] http://review.coreboot.org/#/c/2996/1//COMMIT_MSG
[2] http://review.coreboot.org/525
Change-Id: I2ea1a31dc1e3db129e767d6a9e0433fd75a77d0f
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
util/inteltool/amb.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/util/inteltool/amb.c b/util/inteltool/amb.c
index a3ee01d..9ff2977 100644
--- a/util/inteltool/amb.c
+++ b/util/inteltool/amb.c
@@ -17,7 +17,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include "inteltool.h"
@@ -28,7 +28,7 @@
static uint32_t amb_read_config32(volatile void *base, int fn, int reg)
{
- return *(uint32_t *)(AMB_ADDR((uint64_t)base, fn, reg));
+ return *(uint32_t *)(AMB_ADDR((ptrdiff_t)base, fn, reg));
}
static void amb_printreg32(volatile void *base, int fn, int reg,
@@ -42,7 +42,7 @@ static void amb_printreg32(volatile void *base, int fn, int reg,
static uint16_t amb_read_config16(volatile void *base, int fn, int reg)
{
- return *(uint16_t *)(AMB_ADDR((uint64_t)base, fn, reg));
+ return *(uint16_t *)(AMB_ADDR((ptrdiff_t)base, fn, reg));
}
static void amb_printreg16(volatile void *base, int fn, int reg,
@@ -57,7 +57,7 @@ static void amb_printreg16(volatile void *base, int fn, int reg,
static uint8_t amb_read_config8(volatile void *base, int fn, int reg)
{
- return *(uint8_t *)(AMB_ADDR((uint64_t)base, fn, reg));
+ return *(uint8_t *)(AMB_ADDR((ptrdiff_t)base, fn, reg));
}
static void amb_printreg8(volatile void *base, int fn, int reg,
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2996
-gerrit
commit 84ce0eba178ee7636e7f333350bb60294ca7c1d6
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Sun Mar 31 22:15:43 2013 +0200
inteltool: Allow to override Makefile variables
Allow to override the variables `CC`, `INSTALL`, `PREFIX`,
`CFLAGS` and `LDFLAGS`. Though append `-lpci -lz` to `LDFLAGS`.
This way for example a different compiler can easily be used.
CC=clang make
As a side note, Clang in contrast to GCC does *not* issue the
following warnings.
$ clang --version
Debian clang version 3.2-1~exp6 (tags/RELEASE_32/final) (based on LLVM 3.2)
Target: i386-pc-linux-gnu
Thread model: posix
$ gcc --version
gcc-4.7.real (Debian 4.7.2-15) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ make
[…]
amb.c: In function ‘amb_read_config32’:
amb.c:31:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
amb.c:31:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
amb.c: In function ‘amb_read_config16’:
amb.c:45:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
amb.c:45:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
amb.c: In function ‘amb_read_config8’:
amb.c:60:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
amb.c:60:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
[…]
These are only shown under 32-bit and not 64-bit
$ uname -m
i686
and are going to be fixed in a separate patch.
Change-Id: Id75dea081ecb35390f283520a7e5dce520f4c98d
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
util/inteltool/Makefile | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/util/inteltool/Makefile b/util/inteltool/Makefile
index 6c94460..2028a4a 100644
--- a/util/inteltool/Makefile
+++ b/util/inteltool/Makefile
@@ -21,17 +21,17 @@
PROGRAM = inteltool
-CC = gcc
-INSTALL = /usr/bin/install
-PREFIX = /usr/local
-CFLAGS = -O2 -g -Wall -W
-LDFLAGS = -lpci -lz
+CC ?= gcc
+INSTALL ?= /usr/bin/install
+PREFIX ?= /usr/local
+CFLAGS ?= -O2 -g -Wall -W
+LDFLAGS += -lpci -lz
OBJS = inteltool.o cpu.o gpio.o rootcmplx.o powermgt.o memory.o pcie.o amb.o
OS_ARCH = $(shell uname)
ifeq ($(OS_ARCH), Darwin)
-LDFLAGS = -framework DirectHW -lpci -lz
+LDFLAGS += -framework DirectHW
endif
ifeq ($(OS_ARCH), FreeBSD)
CFLAGS += -I/usr/local/include
Stefan Tauner (stefan.tauner(a)gmx.at) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2999
-gerrit
commit 9e4bc8f6b65e81d0f77c66c224317e1cd9944e26
Author: Stefan Tauner <stefan.tauner(a)gmx.at>
Date: Mon Apr 1 13:45:44 2013 +0200
Minor Kconfig help text fix
I did not check what was once after the 'and'.
Change-Id: I9f3f725bec281a94abdb2eeb692a96fecdebcc0c
Signed-off-by: Stefan Tauner <stefan.tauner(a)gmx.at>
---
src/cpu/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/cpu/Kconfig b/src/cpu/Kconfig
index 6177285..ed7d6ab 100644
--- a/src/cpu/Kconfig
+++ b/src/cpu/Kconfig
@@ -87,7 +87,7 @@ config CPU_MICROCODE_CBFS_GENERATE
building coreboot and included in the final image as a separate CBFS
file. Microcode will not be hard-coded into ramstage.
- The microcode file and may be removed from the ROM image at a later
+ The microcode file may be removed from the ROM image at a later
time with cbfstool, if desired.
If unsure, select this option.
@@ -101,7 +101,7 @@ config CPU_MICROCODE_CBFS_EXTERNAL
microcode that you have is newer than the microcode shipping with
coreboot.
- The microcode file and may be removed from the ROM image at a later
+ The microcode file may be removed from the ROM image at a later
time with cbfstool, if desired.
If unsure, select "Generate from tree"