Gabe Black (gabeblack(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3580
-gerrit
commit 45c50082ca4c68b3bea0fcb7f639279848e52dda
Author: Gabe Black <gabeblack(a)chromium.org>
Date: Mon Jul 1 05:03:47 2013 -0700
ARM: Define custom ELF headers for ARM.
At least when building with the gnu toolchain, the headers the linker
automatically generate save space for the actual ELF headers in one of the
loadable segments. This creates two problems. First, the data you intended to
be at the start of the image doesn't actually show up there, it's actually the
ELF headers. Second, the ELF headers are essentially useless for firmware
since there's currently nothing to tell you where they are, and even if there
was, there isn't much of a reason to look at them. They're useful in userspace
for, for instance, the dynamic linker, but not really in firmware.
This change adds a PHDRS construct to each of the linker scripts used on ARM
which define a single segment called to_load which does not have the flag set
which would tell the linker to put headers in it. The first section defined in
the script has ": to_load" to tell the linker which segment to put it in, and
from that point on the other sections go in there by default.
Change-Id: I24b721eb436d17afd234002ae82f9166d2fcf65d
Signed-off-by: Gabe Black <gabeblack(a)chromium.org>
---
src/arch/armv7/bootblock.lds | 7 ++++++-
src/arch/armv7/coreboot_ram.ld | 7 ++++++-
src/arch/armv7/romstage.ld | 7 ++++++-
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/src/arch/armv7/bootblock.lds b/src/arch/armv7/bootblock.lds
index 6f6040d..2003ce4 100644
--- a/src/arch/armv7/bootblock.lds
+++ b/src/arch/armv7/bootblock.lds
@@ -22,6 +22,11 @@
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
+PHDRS
+{
+ to_load PT_LOAD;
+}
+
TARGET(binary)
SECTIONS
{
@@ -40,7 +45,7 @@ SECTIONS
*(.rom.data.*);
*(.rodata.*);
_erom = .;
- } = 0xff
+ } : to_load = 0xff
/DISCARD/ : {
*(.comment)
diff --git a/src/arch/armv7/coreboot_ram.ld b/src/arch/armv7/coreboot_ram.ld
index 487f610..38eaca3 100644
--- a/src/arch/armv7/coreboot_ram.ld
+++ b/src/arch/armv7/coreboot_ram.ld
@@ -24,6 +24,11 @@ INCLUDE ldoptions
ENTRY(stage_entry)
+PHDRS
+{
+ to_load PT_LOAD;
+}
+
SECTIONS
{
. = CONFIG_SYS_SDRAM_BASE;
@@ -38,7 +43,7 @@ SECTIONS
*(.text.*);
. = ALIGN(16);
_etext = .;
- }
+ } : to_load
.ctors : {
. = ALIGN(0x100);
diff --git a/src/arch/armv7/romstage.ld b/src/arch/armv7/romstage.ld
index 568ac1a..0555fc4 100644
--- a/src/arch/armv7/romstage.ld
+++ b/src/arch/armv7/romstage.ld
@@ -30,6 +30,11 @@ OUTPUT_ARCH(arm)
ENTRY(stage_entry)
+PHDRS
+{
+ to_load PT_LOAD;
+}
+
SECTIONS
{
/* TODO make this a configurable option (per chipset). */
@@ -41,7 +46,7 @@ SECTIONS
*(.text.stage_entry.armv7);
*(.text.startup);
*(.text);
- }
+ } : to_load
.romdata . : {
*(.rodata);
Gabe Black (gabeblack(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3574
-gerrit
commit a39ced39afbbb03a406ed5f7a725f029a38f5477
Author: Gabe Black <gabeblack(a)chromium.org>
Date: Sat Jun 29 22:55:15 2013 -0700
am335x: Fix the address of the pinmux registers.
The pinmux register data structure describes a subset of the control module
registers, but the address which pointed to the base of the pinmux registers
was actually being set to the beginning of all the control module registers,
not just those having to do with the pinmux. With this address fixed, the UART
now works on the beaglebone black.
Change-Id: I7c99b6f37d7da359af074127cd0c1a86fda2d9a0
Signed-off-by: Gabe Black <gabeblack(a)chromium.org>
---
src/cpu/ti/am335x/pinmux.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cpu/ti/am335x/pinmux.h b/src/cpu/ti/am335x/pinmux.h
index 69c1459..1b488e8 100644
--- a/src/cpu/ti/am335x/pinmux.h
+++ b/src/cpu/ti/am335x/pinmux.h
@@ -54,7 +54,7 @@ void am335x_pinmux_mii1(void);
void am335x_pinmux_nand(void);
-#define AM335X_PINMUX_REG_ADDR 0x44e10000
+#define AM335X_PINMUX_REG_ADDR 0x44e10800
struct am335x_pinmux_regs {
uint32_t gpmc_ad0;
Gabe Black (gabeblack(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3577
-gerrit
commit 2bcc54c6b01a3a9853d1e0e5f542951d9ee56519
Author: Gabe Black <gabeblack(a)chromium.org>
Date: Mon Jul 1 04:28:23 2013 -0700
CBFS: Use memmove instead of memcpy when loading a file from CBFS.
It might be the case that a file is being loaded from a portion of CBFS which
has already been loaded into a limitted bit of memory somewhere, and we want
to load that file in place, effectively, so that it's original location in
CBFS overlaps with its new location. That's only guaranteed to work if you use
memmove instead of memcpy.
One significant downside of this change is that there aren't yet architecture
optimized (aka not horribly performing) implementations of memmove available
for either x86 or ARM. It's not clear whether the performance difference would
be significant enough to notice in practice since the things in CBFS are
probably not that big. It might still be a good idea to hold off on this
change until optimized versions are available to avoid any potential
performance hit.
This also means that memmove needs to be built into the bootblock.
Change-Id: Id550138c875907749fff05f330fcd2fb5f9ed924
Signed-off-by: Gabe Black <gabeblack(a)chromium.org>
---
src/lib/Makefile.inc | 1 +
src/lib/cbfs_core.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
index d44f4a7..50092b6 100644
--- a/src/lib/Makefile.inc
+++ b/src/lib/Makefile.inc
@@ -26,6 +26,7 @@ ifneq ($(CONFIG_HAVE_ARCH_MEMCPY),y)
bootblock-y += memcpy.c
endif
bootblock-y += memcmp.c
+bootblock-y += memmove.c
ifneq ($(CONFIG_HAVE_ARCH_MEMSET),y)
romstage-y += memset.c
diff --git a/src/lib/cbfs_core.c b/src/lib/cbfs_core.c
index 852b37f..39c1ff6 100644
--- a/src/lib/cbfs_core.c
+++ b/src/lib/cbfs_core.c
@@ -195,7 +195,7 @@ int cbfs_decompress(int algo, void *src, void *dst, int len)
{
switch (algo) {
case CBFS_COMPRESS_NONE:
- memcpy(dst, src, len);
+ memmove(dst, src, len);
return 0;
#ifdef CBFS_CORE_WITH_LZMA
case CBFS_COMPRESS_LZMA:
Gabe Black (gabeblack(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3574
-gerrit
commit a5de8d4db2fca79f074dbbc23fe5b297ba906324
Author: Gabe Black <gabeblack(a)chromium.org>
Date: Sat Jun 29 22:55:15 2013 -0700
am335x: Fix the address of the pinmux registers.
The pinmux register data structure describes a subset of the control module
registers, but the address which pointed to the base of the pinmux registers
was actually being set to the beginning of all the cotrnol module registers,
not just those having to do with the pinmux. With this address fixed, the UART
now works on the beaglebone black.
Change-Id: I7c99b6f37d7da359af074127cd0c1a86fda2d9a0
Signed-off-by: Gabe Black <gabeblack(a)chromium.org>
---
src/cpu/ti/am335x/pinmux.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cpu/ti/am335x/pinmux.h b/src/cpu/ti/am335x/pinmux.h
index 69c1459..1b488e8 100644
--- a/src/cpu/ti/am335x/pinmux.h
+++ b/src/cpu/ti/am335x/pinmux.h
@@ -54,7 +54,7 @@ void am335x_pinmux_mii1(void);
void am335x_pinmux_nand(void);
-#define AM335X_PINMUX_REG_ADDR 0x44e10000
+#define AM335X_PINMUX_REG_ADDR 0x44e10800
struct am335x_pinmux_regs {
uint32_t gpmc_ad0;
Gabe Black (gabeblack(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3574
-gerrit
commit 32ee748da1be7f9ca079e10ddd013b589a96a545
Author: Gabe Black <gabeblack(a)chromium.org>
Date: Sat Jun 29 22:55:15 2013 -0700
am335x: Fix the address of the pinmux registers.
The pinmux register data structure describes a subset of the control module
registers, but the address which pointed to the base of the pinmux registers
was actually being set to the beginning of all the cotrnol module registers,
not just those having to do with the pinmux. With this address fixed, the UART
now works on the beaglebone black.
Change-Id: I7c99b6f37d7da359af074127cd0c1a86fda2d9a0
Signed-off-by: Gabe Black <gabeblack(a)chromium.org>
---
src/cpu/ti/am335x/pinmux.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cpu/ti/am335x/pinmux.h b/src/cpu/ti/am335x/pinmux.h
index 69c1459..1b488e8 100644
--- a/src/cpu/ti/am335x/pinmux.h
+++ b/src/cpu/ti/am335x/pinmux.h
@@ -54,7 +54,7 @@ void am335x_pinmux_mii1(void);
void am335x_pinmux_nand(void);
-#define AM335X_PINMUX_REG_ADDR 0x44e10000
+#define AM335X_PINMUX_REG_ADDR 0x44e10800
struct am335x_pinmux_regs {
uint32_t gpmc_ad0;