* [PATCH 1/7] ARM/U-Boot basic build system additions
@ 2013-03-24 17:01 Leif Lindholm
2013-03-30 15:09 ` Francesco Lavra
0 siblings, 1 reply; 3+ messages in thread
From: Leif Lindholm @ 2013-03-24 17:01 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: 0001-arm-uboot-build-support.patch --]
[-- Type: application/octet-stream, Size: 5148 bytes --]
=== modified file 'conf/Makefile.common'
--- conf/Makefile.common 2013-03-03 14:57:30 +0000
+++ conf/Makefile.common 2013-03-24 11:00:29 +0000
@@ -37,6 +37,13 @@
CFLAGS_PLATFORM += -mno-app-regs
LDFLAGS_PLATFORM = -Wl,-melf64_sparc -mno-relax
endif
+if COND_arm
+# Image entry point always in ARM (A32) state - ensure proper functionality if
+# the rest is built for the Thumb (T32) state.
+ CFLAGS_PLATFORM += -mthumb-interwork -mno-unaligned-access -mlong-calls
+ CCASFLAGS_PLATFORM = -Wa,-mimplicit-it=thumb
+ LDFLAGS_PLATFORM = -Wl,--wrap=__clear_cache
+endif
# Other options
=== modified file 'configure.ac'
--- configure.ac 2013-03-19 19:25:09 +0000
+++ configure.ac 2013-03-24 11:00:29 +0000
@@ -94,6 +94,9 @@
target_cpu=mips;
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPS=1";
;;
+ arm*)
+ target_cpu=arm;
+ ;;
esac
# Specify the platform (such as firmware).
@@ -114,6 +117,7 @@
mipsel-*) platform=loongson ;;
mips-*) platform=arc ;;
ia64-*) platform=efi ;;
+ arm-*) platform=uboot ;;
*) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
esac
else
@@ -148,6 +152,7 @@
mipsel-yeeloong) platform=loongson ;;
mipsel-fuloong) platform=loongson ;;
mipsel-loongson) ;;
+ arm-uboot) ;;
*-emu) ;;
*) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
esac
@@ -179,6 +184,7 @@
multiboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MULTIBOOT=1" ;;
efi) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EFI=1" ;;
ieee1275) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_IEEE1275=1" ;;
+ uboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_UBOOT=1" ;;
qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;;
pc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;;
emu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EMU=1" ;;
@@ -187,6 +193,7 @@
arc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARC=1" ;;
esac
case "$target_cpu" in
+ arm) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARM=1" ;;
mips |mipsel) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;;
sparc64) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
esac
@@ -1150,6 +1157,8 @@
AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips -o x$target_cpu = xmipsel])
AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel])
AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips])
+AM_CONDITIONAL([COND_arm], [test x$target_cpu = xarm ])
+AM_CONDITIONAL([COND_arm_uboot], [test x$target_cpu = xarm -a x$platform = xuboot])
AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd])
AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux])
=== modified file 'gentpl.py'
--- gentpl.py 2012-09-12 06:27:26 +0000
+++ gentpl.py 2013-03-24 11:00:29 +0000
@@ -23,7 +23,7 @@
"i386_multiboot", "i386_ieee1275", "x86_64_efi",
"mips_loongson", "sparc64_ieee1275",
"powerpc_ieee1275", "mips_arc", "ia64_efi",
- "mips_qemu_mips" ]
+ "mips_qemu_mips", "arm_uboot" ]
GROUPS = {}
@@ -36,10 +36,12 @@
GROUPS["mips"] = [ "mips_loongson", "mips_qemu_mips", "mips_arc" ]
GROUPS["sparc64"] = [ "sparc64_ieee1275" ]
GROUPS["powerpc"] = [ "powerpc_ieee1275" ]
+GROUPS["arm"] = [ "arm_uboot" ]
# Groups based on firmware
GROUPS["efi"] = [ "i386_efi", "x86_64_efi", "ia64_efi" ]
GROUPS["ieee1275"] = [ "i386_ieee1275", "sparc64_ieee1275", "powerpc_ieee1275" ]
+GROUPS["uboot"] = [ "arm_uboot" ]
# emu is a special case so many core functionality isn't needed on this platform
GROUPS["noemu"] = GRUB_PLATFORMS[:]; GROUPS["noemu"].remove("emu")
@@ -57,10 +59,13 @@
for i in GROUPS["videoinkernel"]: GROUPS["videomodules"].remove(i)
# Similar for terminfo
-GROUPS["terminfoinkernel"] = ["mips_loongson", "mips_arc", "mips_qemu_mips" ] + GROUPS["ieee1275"];
+GROUPS["terminfoinkernel"] = ["mips_loongson", "mips_arc", "mips_qemu_mips" ] + GROUPS["ieee1275"] + GROUPS["uboot"];
GROUPS["terminfomodule"] = GRUB_PLATFORMS[:];
for i in GROUPS["terminfoinkernel"]: GROUPS["terminfomodule"].remove(i)
+# Flattened Device Trees (FDT)
+GROUPS["fdt"] = [ "arm_uboot" ]
+
# Miscelaneous groups schedulded to disappear in future
GROUPS["i386_coreboot_multiboot_qemu"] = ["i386_coreboot", "i386_multiboot", "i386_qemu"]
GROUPS["nopc"] = GRUB_PLATFORMS[:]; GROUPS["nopc"].remove("i386_pc")
=== modified file 'grub-core/Makefile.core.def'
--- grub-core/Makefile.core.def 2013-03-22 20:01:28 +0000
+++ grub-core/Makefile.core.def 2013-03-24 11:00:29 +0000
@@ -66,6 +66,8 @@
i386_qemu_cppflags = '-DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)';
emu_cflags = '$(CFLAGS_GNULIB)';
emu_cppflags = '$(CPPFLAGS_GNULIB)';
+ arm_uboot_ldflags = '-Wl,-Ttext=0x08000000';
+ arm_uboot_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';
i386_pc_startup = kern/i386/pc/startup.S;
i386_efi_startup = kern/i386/efi/startup.S;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/7] ARM/U-Boot basic build system additions
2013-03-24 17:01 [PATCH 1/7] ARM/U-Boot basic build system additions Leif Lindholm
@ 2013-03-30 15:09 ` Francesco Lavra
2013-04-03 14:41 ` Leif Lindholm
0 siblings, 1 reply; 3+ messages in thread
From: Francesco Lavra @ 2013-03-30 15:09 UTC (permalink / raw)
To: grub-devel
Hi,
On 03/24/2013 06:01 PM, Leif Lindholm wrote:
> === modified file 'conf/Makefile.common'
> --- conf/Makefile.common 2013-03-03 14:57:30 +0000
> +++ conf/Makefile.common 2013-03-24 11:00:29 +0000
> @@ -37,6 +37,13 @@
> CFLAGS_PLATFORM += -mno-app-regs
> LDFLAGS_PLATFORM = -Wl,-melf64_sparc -mno-relax
> endif
> +if COND_arm
> +# Image entry point always in ARM (A32) state - ensure proper functionality if
> +# the rest is built for the Thumb (T32) state.
> + CFLAGS_PLATFORM += -mthumb-interwork -mno-unaligned-access -mlong-calls
> + CCASFLAGS_PLATFORM = -Wa,-mimplicit-it=thumb
The -mimplicit-it=thumb assembler option is generally frowned upon and
is used mostly to convert existing pieces of code from ARM to Thumb
encoding.
Since you are writing new code, it's better to avoid this option and
manually insert IT instructions in the assembly where appropriate.
> + LDFLAGS_PLATFORM = -Wl,--wrap=__clear_cache
> +endif
>
> # Other options
>
--Francesco
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/7] ARM/U-Boot basic build system additions
2013-03-30 15:09 ` Francesco Lavra
@ 2013-04-03 14:41 ` Leif Lindholm
0 siblings, 0 replies; 3+ messages in thread
From: Leif Lindholm @ 2013-04-03 14:41 UTC (permalink / raw)
To: The development of GNU GRUB
On Sat, Mar 30, 2013 at 04:09:28PM +0100, Francesco Lavra wrote:
> > + CFLAGS_PLATFORM += -mthumb-interwork -mno-unaligned-access -mlong-calls
> > + CCASFLAGS_PLATFORM = -Wa,-mimplicit-it=thumb
>
> The -mimplicit-it=thumb assembler option is generally frowned upon and
> is used mostly to convert existing pieces of code from ARM to Thumb
> encoding.
> Since you are writing new code, it's better to avoid this option and
> manually insert IT instructions in the assembly where appropriate.
Sure, quite a simple change.
Will be in next version of patches.
/
Leif
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-03 14:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-24 17:01 [PATCH 1/7] ARM/U-Boot basic build system additions Leif Lindholm
2013-03-30 15:09 ` Francesco Lavra
2013-04-03 14:41 ` Leif Lindholm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.