GRUB port for ARMv7-A U-Boot

2012-10-19 Thread Leif Lindholm
I have created a port of GRUB to the ARMv7-A architecture, running on top of the U-Boot firmware. The U-Boot API, created by Rafal Jaworowsky r...@semihalf.com, provides the hardware abstraction layer. Console is supported on serial port using the termios subsystem. This port supports, and indeed

Re: GRUB port for ARMv7-A U-Boot

2012-10-22 Thread Leif Lindholm
On 10/19/12 20:11, Vladimir 'φ-coder/phcoder' Serbinenko wrote: On 19.10.2012 20:47, Leif Lindholm wrote: libfdt is dual-licensed, GPLv2+/BSD, and the copyright belongs to David Gibson d...@au1.ibm.com. I have a patch against the libfdt included in http://jdl.com/software/dtc-v1.3.0.tgz

[PATCH] grub-mkimage: postpone free(arguments.output)

2012-10-22 Thread Leif Lindholm
The output filename is currently free()d before the call to generate_image(), which takes this as a parameter. This patch delays the free until after generate_image returns.=== modified file 'util/grub-mkimage.c' --- util/grub-mkimage.c 2012-06-26 01:38:10 + +++ util/grub-mkimage.c

[PATCH] Typo in types.h

2012-11-26 Thread Leif Lindholm
- Current version functionally correct, but reads a bit funny. Regards, Leif=== modified file 'include/grub/types.h' --- include/grub/types.h 2012-06-07 12:07:02 + +++ include/grub/types.h 2012-11-26 17:40:33 + @@ -50,7 +50,7 @@ # error This architecture is not supported because

Re: [PATCH] Typo in types.h

2012-11-28 Thread Leif Lindholm
On 28/11/12 12:27, Vladimir 'φ-coder/phcoder' Serbinenko wrote: On 26.11.2012 18:44, Leif Lindholm wrote: - Current version functionally correct, but reads a bit funny. Please add a correct ChangeLog entry. Complete patch attached. / Leif=== modified file 'ChangeLog' --- ChangeLog

Trunk fails to build with -Oanything other than 0

2013-01-30 Thread Leif Lindholm
Our Ubuntu (12.04/12.10) build environment defaults configuring with CFLAGS containing -O2. Trunk currently does not build successfully with this on either my ARM platform or my x86_64 desktop. This isn't causing any serious problems, but I thought I would report what I've found. Commit

Re: Trunk fails to build with -Oanything other than 0

2013-01-31 Thread Leif Lindholm
On 30/01/13 19:41, Andrey Borzenkov wrote: В Wed, 30 Jan 2013 18:32:39 + Leif Lindholm leif.lindh...@arm.com пишет: Our Ubuntu (12.04/12.10) build environment defaults configuring with CFLAGS containing -O2. Trunk currently does not build successfully with this on either my ARM platform

[PATCH 0/7] add support for ARMv7

2013-03-24 Thread Leif Lindholm
Hi, This is the evolution of the patches I submitted as an RFC at the end of last year. Since then, I have been seconded into the Linaro organisation - which required another contribution agreement to be signed... Since the paperwork dragged out a bit, I actually got the port to ARMv7 UEFI

[PATCH 1/7] ARM/U-Boot basic build system additions

2013-03-24 Thread Leif Lindholm
0001-arm-uboot-build-support.patch Description: Binary data ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel

[PATCH 2/7] Initial support for ARMv7 architecture

2013-03-24 Thread Leif Lindholm
0002-arm-support.patch Description: Binary data ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel

[PATCH 4/7] Support for ARM/U-Boot platforms

2013-03-24 Thread Leif Lindholm
0004-arm-uboot-support.patch Description: Binary data ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel

[PATCH 6/7] add ARM Linux loader

2013-03-24 Thread Leif Lindholm
0006-linux-loader.patch Description: Binary data ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel

[PATCH 7/7] Add support for ARM UEFI (EFI) platforms

2013-03-24 Thread Leif Lindholm
0007-uefi-support.patch Description: Binary data ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel

Re: [PATCH] Add missing ARM relocation codes and fix existing ones

2013-04-03 Thread Leif Lindholm
On Mon, Apr 01, 2013 at 06:45:16PM +0200, Francesco Lavra wrote: On 03/17/2013 09:36 PM, Francesco Lavra wrote: I'm working on the GRUB port to ARM using the EFI platform. When generating a relocatable ARM image, some relocation entries use a relocation code (0x33) which is not defined in

Re: [PATCH 4/7] Support for ARM/U-Boot platforms

2013-04-03 Thread Leif Lindholm
On Mon, Apr 01, 2013 at 04:29:02PM +0200, Francesco Lavra wrote: On 04/01/2013 04:15 AM, Vladimir '??-coder/phcoder' Serbinenko wrote: Which architecture is raspberry pie? I have one here and it would be good if I could use it for testing. It's ARMv6, so unfortunately it's not supported by

Re: [PATCH 2/7] Initial support for ARMv7 architecture

2013-04-03 Thread Leif Lindholm
On Sat, Mar 30, 2013 at 04:15:54PM +0100, Francesco Lavra wrote: On 03/24/2013 06:01 PM, Leif Lindholm wrote: [...] === added file 'grub-core/kern/arm/cache.S' --- grub-core/kern/arm/cache.S 1970-01-01 00:00:00 + +++ grub-core/kern/arm/cache.S 2013-03-24 12:56:20 +

Re: [PATCH 3/7] Initial support for U-Boot platforms

2013-04-03 Thread Leif Lindholm
On Mon, Apr 01, 2013 at 04:08:59AM +0200, Vladimir '??-coder/phcoder' Serbinenko wrote: On 24.03.2013 18:01, Leif Lindholm wrote: About memory map: It would make sense to put modules right before heap as module space is reused later as heap if this is enabled. So, move stack to after heap

Re: [PATCH 3/7] Initial support for U-Boot platforms

2013-04-03 Thread Leif Lindholm
On Sat, Mar 30, 2013 at 05:20:54PM +0100, Francesco Lavra wrote: Mostly cosmetic comments from my side here... Typos will be fixed. On 03/24/2013 06:01 PM, Leif Lindholm wrote: [...] === added file 'grub-core/kern/uboot/init.c' --- grub-core/kern/uboot/init.c 1970-01-01 00:00:00

Re: [PATCH 4/7] Support for ARM/U-Boot platforms

2013-04-03 Thread Leif Lindholm
On Mon, Apr 01, 2013 at 04:15:03AM +0200, Vladimir '??-coder/phcoder' Serbinenko wrote: +#define GRUB_KERNEL_MACHINE_STACK_SIZE 0x4 +#define GRUB_KERNEL_MACHINE_HEAP_SIZE (grub_size_t) (2 * 1024 * 1024) Why so small heap? I copied ieee1275 HEAP_MIN_SIZE to begin with, and it was

Re: [PATCH 6/7] add ARM Linux loader

2013-04-03 Thread Leif Lindholm
On Mon, Apr 01, 2013 at 06:18:17PM +0200, Francesco Lavra wrote: On 03/24/2013 06:01 PM, Leif Lindholm wrote: === added directory 'grub-core/loader/arm' === added file 'grub-core/loader/arm/linux.c' --- grub-core/loader/arm/linux.c1970-01-01 00:00:00 + +++ grub-core/loader/arm

Re: [PATCH 7/7] Add support for ARM UEFI (EFI) platforms

2013-04-03 Thread Leif Lindholm
On Mon, Apr 01, 2013 at 04:31:13AM +0200, Vladimir '??-coder/phcoder' Serbinenko wrote: +static grub_uint64_t +grub_efi_get_time_ms(void) +{ + grub_efi_time_t now; + grub_uint64_t retval; + grub_efi_status_t status; + + status = efi_call_2

Re: [PATCH 7/7] Add support for ARM UEFI (EFI) platforms

2013-04-03 Thread Leif Lindholm
On Mon, Apr 01, 2013 at 06:24:43PM +0200, Francesco Lavra wrote: On 03/24/2013 06:01 PM, Leif Lindholm wrote: === added file 'grub-core/kern/arm/efi/misc.c' --- grub-core/kern/arm/efi/misc.c 1970-01-01 00:00:00 + +++ grub-core/kern/arm/efi/misc.c 2013-03-24 15:43:19 +

Re: [PATCH 7/7] Add support for ARM UEFI (EFI) platforms

2013-04-04 Thread Leif Lindholm
On Wed, Apr 03, 2013 at 10:01:59PM +0200, Vladimir '??-coder/phcoder' Serbinenko wrote: I don't see grub-mkimage currently being fully cross-platform anyway, so I would (as mentioned in previous email) prefer to postpone any such adjustments until the basic support is in. I have the patches

Re: Raspberry pi support

2013-04-08 Thread Leif Lindholm
On Sun, Apr 07, 2013 at 07:20:35PM +0200, Vladimir '??-coder/phcoder' Serbinenko wrote: Based on Leif Lindholm's patches I could go to GRUB console on raspberry pi. The biggest problem is that cache flushing is simply skipped. Another problem is that due to different linux image format linux

Re: Raspberry pi support

2013-04-08 Thread Leif Lindholm
On Mon, Apr 08, 2013 at 02:59:59PM +0200, Vladimir '??-coder/phcoder' Serbinenko wrote: Is this because you're feeding it a uImage? It is entirely possible to runtime detect the U-Boot signature, and simply skip the header. The kernel shipped with raspbian aren't uImages. they are with

Re: [PATCH 4/7] Support for ARM/U-Boot platforms

2013-04-09 Thread Leif Lindholm
On Mon, Apr 08, 2013 at 12:47:48PM +0200, Vladimir '??-coder/phcoder' Serbinenko wrote: Why so small heap? I copied ieee1275 HEAP_MIN_SIZE to begin with, and it was always enough. (Since U-Boot doesn't provide any memory mapping service, kernel and initrd are not going on the heap.)

Re: [PATCH 2/7] Initial support for ARMv7 architecture

2013-04-09 Thread Leif Lindholm
On Tue, Apr 09, 2013 at 01:27:52AM +0200, Vladimir '??-coder/phcoder' Serbinenko wrote: On 24.03.2013 18:01, Leif Lindholm wrote: + arm = grub-core/kern/arm/dl.c; + Missed this one. It's wrong. All tools are exactly the same on all platforms. The only thing that varies is tool

Re: [PATCH 3/7] Initial support for U-Boot platforms

2013-04-09 Thread Leif Lindholm
On Mon, Apr 08, 2013 at 12:49:18PM +0200, Vladimir '??-coder/phcoder' Serbinenko wrote: On 03.04.2013 18:17, Leif Lindholm wrote: + disk-total_sectors = GRUB_DISK_SIZE_UNKNOWN; Is there any way to get size from uboot? Not that I've found. As in, not that can be relied

Re: [PATCH 4/7] Support for ARM/U-Boot platforms

2013-04-09 Thread Leif Lindholm
On Tue, Apr 09, 2013 at 02:15:20AM +0200, Vladimir '??-coder/phcoder' Serbinenko wrote: === added directory 'grub-core/kern/arm/uboot' === added file 'grub-core/kern/arm/uboot/startup.S' --- grub-core/kern/arm/uboot/startup.S 1970-01-01 00:00:00 + +++

Re: Raspberry pi support

2013-05-01 Thread Leif Lindholm
Apologies for long silence, I've been off prototyping runtime services for UEFI on ARMv7 (in order to make EFI grub-install actually _do_ anything), and am really bad at multi-tasking. I am now focusing 100% on this for the rest of the week. On Mon, Apr 08, 2013 at 09:58:12PM +0200, Vladimir

Re: ARM branch

2013-05-01 Thread Leif Lindholm
On Fri, Apr 12, 2013 at 07:33:21PM +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote: Hello, all. I've uploaded Leif's and my ARM code to http://bzr.savannah.gnu.org/lh/grub/branches/arm/changes. Francesco's code will be added as well once his papers are done. The only dirty part for

[PATCH] U-Boot namespace and device enumeration fixes

2013-05-02 Thread Leif Lindholm
This patch against the arm branch (on top of yesterday's patch) addresses the following issues: - Changes all globally visible uboot_* to grub_uboot_*. - Device enumeration now uses a dynamically allocated array, and all device functions now return/accept pointers rather than handles. - Disk

[PATCH] ARM U-Boot heap updates

2013-05-02 Thread Leif Lindholm
Again, patch is against http://bzr.savannah.gnu.org/r/grub/branches/arm - Increases heap size to 8MB. - Moves heap from after the stack in memory to before the stack, in order to be able to grow into the modules region post load. === modified file 'grub-core/kern/arm/uboot/startup.S' ---

Re: ARM branch

2013-05-07 Thread Leif Lindholm
On Fri, May 03, 2013 at 02:34:11PM +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote: It does also revert the removal of uboot_get_real_bss_start, since this causes GRUB to fail even reaching Welcome to GRUB! on my Trimslice. It may not be the best solution, but it is in there for a

Re: ARM branch

2013-05-07 Thread Leif Lindholm
On Sat, May 04, 2013 at 07:50:02PM +0200, Francesco Lavra wrote: I have attached a patch (against this branch) that contains build system fixes and changes to the assembly files in order to permit the same target-platform combination to build correctly on both ARMv6 and ARMv7, with no

[PATCH] fix grub-install efibootmgr presence test with --removable

2013-05-09 Thread Leif Lindholm
When executed for an EFI target, grub-install checks for the path of efibootmgr - however, this utility is not required (or used) when installing to a removable media (with --removable). However, since grub-install does set -e, the absence of efibootmgr on the system causes the install script to

Re: [PATCH 7/7] Add support for ARM UEFI (EFI) platforms

2013-05-09 Thread Leif Lindholm
On Tue, Apr 09, 2013 at 07:30:46PM +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote: Since I didn't want to have to duplicate my relocation handling between kernel and grub-mkimage, I use kern/arm/dl.c for both. Could you move the common functions to dl_helper.c as in ISA64? Done in

Re: [PATCH] fix grub-install efibootmgr presence test with --removable

2013-05-10 Thread Leif Lindholm
Fri, May 10, 2013 at 04:57:38PM +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote: When executed for an EFI target, grub-install checks for the path of efibootmgr - however, this utility is not required (or used) when installing to a removable media (with --removable). This patch

[PATCH] ARM U-Boot BSS zeroing

2013-05-13 Thread Leif Lindholm
The import into the collaborative branch discarded the call to get_real_bss_start before starting the BSS zeroing operation. While get_real_bss_start might have been a bit of an ugly hack, simply discarding it means that we now end up doing unaligned STR operations, and any platform with MMU

Re: ARM how-to?

2013-07-18 Thread Leif Lindholm
On 18 July 2013 17:58, Andrey Borzenkov arvidj...@gmail.com wrote: Could someone provide simple steps how to actually use ARM port? As I understand core.img need to be installed as payload for native bootloader, right? Is it supported by grub-install or needs manual intervention? If you are

calculation overflow in grub_mm_init_region

2013-08-29 Thread Leif Lindholm
When allocating memory for the heap on ARMv7 UEFI, the init code pretty much just allocates a chunk from the top of available RAM. This means that when grub_mm_init_region is called for a region extending to the top of the 32-bit address space, addr + size == 0. However, this is not taken into

Re: calculation overflow in grub_mm_init_region (patch)

2013-09-10 Thread Leif Lindholm
On Thu, Aug 29, 2013 at 07:26:03PM +0200, Leif Lindholm wrote: When allocating memory for the heap on ARMv7 UEFI, the init code pretty much just allocates a chunk from the top of available RAM. This means that when grub_mm_init_region is called for a region extending to the top of the 32-bit

Fixes and cleanup of ARM cache maintenance code

2013-09-10 Thread Leif Lindholm
in probe_caches(). ChangeLog: 2013-09-10 Leif Lindholm leif.lindh...@linaro.org * kern/arm/cache.S: correct access to ilinesz/dlinesz variables clean up stack manipulation (sync_caches_armv*) === modified file 'grub-core/kern/arm/cache.S' --- grub-core/kern/arm

Re: calculation overflow in grub_mm_init_region (patch)

2013-09-10 Thread Leif Lindholm
On 10 September 2013 22:46, Seth Goldberg seth.goldb...@oracle.com wrote: Why would region_end be zero? That sounds like an invalid value. Because when a heap region sits at the top of RAM, region base + region size == 0. / Leif ___ Grub-devel

Re: calculation overflow in grub_mm_init_region (patch)

2013-09-10 Thread Leif Lindholm
On 10 September 2013 23:36, Leif Lindholm leif.lindh...@linaro.org wrote: On 10 September 2013 22:46, Seth Goldberg seth.goldb...@oracle.com wrote: Why would region_end be zero? That sounds like an invalid value. Because when a heap region sits at the top of RAM, region base + region size

Re: calculation overflow in grub_mm_init_region (patch)

2013-09-11 Thread Leif Lindholm
On 11 September 2013 02:00, Vladimir 'φ-coder/phcoder' Serbinenko phco...@gmail.com wrote: This fix looks correct but as indicated by us not having discovered this bug earlier, this is a very unusual case and it's difficult to ensure that similar bug doesn't pop up in another place or that we

Re: Is: Wrap-up Was: Re: EFI and multiboot2 devlopment work for Xen

2013-11-05 Thread Leif Lindholm
On Mon, Nov 04, 2013 at 08:41:11PM +, Stefano Stabellini wrote: multiboot2 protocol requires some more changes. However, about 80% of code is ready. In this case Xen and modules are loaded by GRUB2 itself. It means that all images could be placed on any filesystem recognized by GRUB2.

Re: [Xen-devel] pvgrub2 for ARM

2013-11-06 Thread Leif Lindholm
On Wed, Nov 06, 2013 at 01:25:55PM +, Ian Campbell wrote: What's with 64-bit ARM? TBH I thought the GRuB On ARM stuff was mainly targeting 64-bit (at least within Linaro). Do you have native grub on 32-bit ARM already then? Linaro Enterprise Group (where I am) is now almost exclusively

Re: [RFT] Use pair of shifts instead of and in ARM code

2013-11-13 Thread Leif Lindholm
On Wed, Nov 13, 2013 at 01:00:17AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: 1ff and 3fff can't be easily loaded on ARM. This patch replaces load+and with pair of shift to keep only wanted bits. Actually, on ARMv7 we could just use MOVW instead: diff --git

Re: arm-uboot: misc.S:56: Error: r13 not allowed here -- `sub sp,fp,#4'

2013-11-13 Thread Leif Lindholm
On Wed, Nov 13, 2013 at 02:49:19PM +, Colin Watson wrote: After my previous fix, arm-uboot still fails to build with: arm-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_UBOOT=1 -DGRUB_MACHINE_ARM=1

Re: arm-uboot: misc.S:56: Error: r13 not allowed here -- `sub sp, fp, #4'

2013-11-13 Thread Leif Lindholm
On Wed, Nov 13, 2013 at 04:15:53PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: On 13.11.2013 15:49, Colin Watson wrote: After my previous fix, arm-uboot still fails to build with: arm-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W

Re: ctz[sd]i2

2013-11-13 Thread Leif Lindholm
Hi Vladimir, On Wed, Nov 13, 2013 at 04:41:46PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: Hello, I've seen that you had problems with ctzdi2. Attached patch may help Thank you. I've had problems similar to the ones I used to have with __clear_cache on 32-bit ARM, in that the linker

Re: arm-uboot: misc.S:56: Error: r13 not allowed here -- `sub sp, fp, #4'

2013-11-13 Thread Leif Lindholm
On Wed, Nov 13, 2013 at 04:45:00PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: misc.S: Assembler messages: misc.S:56: Error: r13 not allowed here -- `sub sp,fp,#4' make[3]: *** [kern/arm/kernel_exec-misc.o] Error 1 I don't think SP can be used that way in Thumb mode? I

.gitignore additions?

2013-11-13 Thread Leif Lindholm
Hi there, Since the migration to git, I end up with a lot of untracked files after a build. The below gets rid of them: diff --git a/.gitignore b/.gitignore index e7251ff..1985a6e 100644 --- a/.gitignore +++ b/.gitignore @@ -127,6 +127,7 @@ mod-*.c missing netboot_test *.o +*.a ohci_test

[RFC] New port to arm64-efi

2013-11-14 Thread Leif Lindholm
100644 include/grub/arm64/setjmp.h create mode 100644 include/grub/arm64/time.h create mode 100644 include/grub/arm64/types.h diff --git a/ChangeLog b/ChangeLog index d68b33a..35e32f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-11-14 Leif Lindholm leif.lindh...@linaro.org

Re: [RFC] New port to arm64-efi

2013-11-14 Thread Leif Lindholm
On Thu, Nov 14, 2013 at 03:12:28PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: It depends on Vladimir's __ctz[sd]i2 implementation, without which grub-mkimage will fail with a missing symbol error. I haven't seen ctz? Is it not needed after all or do you use my patch? Apologies

Re: [RFC] New port to arm64-efi

2013-11-14 Thread Leif Lindholm
On Thu, Nov 14, 2013 at 03:06:25PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: Good work. Few minor problems: On 14.11.2013 13:35, Leif Lindholm wrote: + + grub_arch_sync_caches_real (address, len); Why not do alignment here? You could align for both dcache and icache

Re: [PATCH] [ARM] Enable boot module for arm

2013-11-16 Thread Leif Lindholm
on Ian's qemu vexpress, which he may be posting some updates on later. / Leif From 7d317fc56bb7c5e54b85caa9f749075f4e5bfaf2 Mon Sep 17 00:00:00 2001 From: Leif Lindholm leif.lindh...@linaro.org Date: Sat, 16 Nov 2013 12:15:53 + Subject: [PATCH] arm: fix u-boot port syscall interface va_arg

Re: [PATCH] arm: fix u-boot port syscall interface va_arg handling (was Re: [PATCH] [ARM] Enable boot module for arm)

2013-11-16 Thread Leif Lindholm
On Sat, Nov 16, 2013 at 01:49:51PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: On 16.11.2013 13:39, Leif Lindholm wrote: - str r9, transition_space + 8 You need to save r9. Otherwise GRUB will crash if compiled with clang. Hmm, but this is a bug in clang in that case. From

Re: [PATCH] arm: fix u-boot port syscall interface va_arg handling (was Re: [PATCH] [ARM] Enable boot module for arm)

2013-11-16 Thread Leif Lindholm
* Updated patch attached. / Leif From d1926ea10b47442b4302e0d474cf18dbe65167de Mon Sep 17 00:00:00 2001 From: Leif Lindholm leif.lindh...@linaro.org Date: Sat, 16 Nov 2013 12:15:53 + Subject: [PATCH] arm: fix u-boot port syscall interface va_arg handling Commit c9cd02c broke the u-boot syscall

Re: [PATCH] arm: fix u-boot port syscall interface va_arg handling (was Re: [PATCH] [ARM] Enable boot module for arm)

2013-11-16 Thread Leif Lindholm
On Sat, Nov 16, 2013 at 03:03:16PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: Updated patch attached. Go ahead. Argh... I pushed the above, and almost immediately I realised that in this situation we also need to store u-boot's version of r9 on return: diff --git

Re: [PATCH] arm: fix u-boot port syscall interface va_arg handling (was Re: [PATCH] [ARM] Enable boot module for arm)

2013-11-16 Thread Leif Lindholm
On Sat, Nov 16, 2013 at 03:28:35PM +0100, Leif Lindholm wrote: I pushed the above, and almost immediately I realised that in this situation we also need to store u-boot's version of r9 on return: diff --git a/grub-core/kern/arm/uboot/startup.S b/grub-core/kern/arm/uboot/start index df1e329

Re: [PATCH] Compile asm-files to thumb2

2013-11-16 Thread Leif Lindholm
Hi Vladimir, The code looks/appears correct - a few comments inline. On Thu, Nov 14, 2013 at 08:39:31AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: diff --git a/grub-core/kern/arm/cache.S b/grub-core/kern/arm/cache.S index 8522d24..2ad774d 100644 --- a/grub-core/kern/arm/cache.S +++

Re: [PATCH] arm: fix u-boot port syscall interface va_arg handling (was Re: [PATCH] [ARM] Enable boot module for arm)

2013-11-16 Thread Leif Lindholm
On Sat, Nov 16, 2013 at 04:19:48PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: @@ -138,6 +138,7 @@ FUNCTION(grub_uboot_syscall) mov lr, pc ldr pc, grub_uboot_syscall_ptr str r8, gd_backup + str r9, gd_backup + 4 ldr

Re: [PATCH, RFC, RFT] ARM relocation fixes

2013-12-02 Thread Leif Lindholm
On Sun, Dec 01, 2013 at 07:06:32AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: Current ARM relocation doesn't handle the cases when the relocation cant be satisfied directly (like thumb call over 1M of distance or jump24 to thumb mode. Attached patch adds missing tampoline and missing

Re: [PATCH, RFC, RFT] ARM relocation fixes

2013-12-02 Thread Leif Lindholm
*cough* With actual attachment. On Mon, Dec 02, 2013 at 11:53:31AM +0100, Leif Lindholm wrote: On Sun, Dec 01, 2013 at 07:06:32AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: Current ARM relocation doesn't handle the cases when the relocation cant be satisfied directly (like thumb

Re: [PATCH, RFC, RFT] ARM relocation fixes

2013-12-02 Thread Leif Lindholm
On Mon, Dec 02, 2013 at 11:59:44AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: On 02.12.2013 11:53, Leif Lindholm wrote: On Sun, Dec 01, 2013 at 07:06:32AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: Current ARM relocation doesn't handle the cases when the relocation cant

Re: [PATCH, RFC, RFT] ARM relocation fixes

2013-12-02 Thread Leif Lindholm
On Mon, Dec 02, 2013 at 12:46:13PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: Amusingly, I wrote the attached Nothing is attached to your mail. Right now could you pause work on */dl.c: I'm reorganising them to declare more of it as platform independent and unify handling (ARM

Re: [PATCH, RFC, RFT] ARM relocation fixes

2013-12-02 Thread Leif Lindholm
On Mon, Dec 02, 2013 at 02:30:51PM +0100, Leif Lindholm wrote: Amusingly, I wrote the attached Nothing is attached to your mail. Right now could you pause work on */dl.c: I'm reorganising them to declare more of it as platform independent and unify handling (ARM dl.c is unnecessarily

Re: [PATCH, RFC, RFT] ARM relocation fixes

2013-12-02 Thread Leif Lindholm
On Mon, Dec 02, 2013 at 03:14:50PM +0100, Leif Lindholm wrote: On Mon, Dec 02, 2013 at 02:30:51PM +0100, Leif Lindholm wrote: Amusingly, I wrote the attached Nothing is attached to your mail. Right now could you pause work on */dl.c: I'm reorganising them to declare more

Re: [PATCH, RFC, RFT] ARM relocation fixes

2013-12-02 Thread Leif Lindholm
On Mon, Dec 02, 2013 at 03:33:06PM +0100, Leif Lindholm wrote: Ok, so I've tested this on arm64, and it works on the commercial FVP Base model (which does not trigger veneer generation due to its runtime memory map), but crashes on the Foundation model (which does). So the generic dl

d74b9a1 breaks ARM build (gcc 4.6)

2013-12-02 Thread Leif Lindholm
Commit d74b9a1, Ensure that -mno-unaligned-access or some equivalent option is used., breaks the configure step on my Debian Jessie, with a default 4.6.4 toolchain: configure: error: couldnt instruct compiler not to use unaligned access Where -mno-unalignes-access is not supported by gcc, it does

Re: [PATCH, RFC, RFT] ARM relocation fixes

2013-12-02 Thread Leif Lindholm
On Mon, Dec 02, 2013 at 06:45:48PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: My default ARMv7 UEFI build fails to grub-install with /work/local/grub/uefi/sbin/grub-install: error: bl/b.w targettting ARM. This is a problem because of asm functions which are always ARM and gcc uses

Re: [PATCH, RFC, RFT] ARM relocation fixes

2013-12-02 Thread Leif Lindholm
On Mon, Dec 02, 2013 at 09:04:47PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: My default ARMv7 UEFI build fails to grub-install with /work/local/grub/uefi/sbin/grub-install: error: bl/b.w targettting ARM. This is a problem because of asm functions which are always ARM and gcc

Re: [PATCH, RFC, RFT] ARM relocation fixes

2013-12-03 Thread Leif Lindholm
On Tue, Dec 03, 2013 at 06:37:33AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: No, BLX immediate has been supported since ARMv5T. (Yes, that is effectively a 32-bit encoding in what is a 16-bit instruction set - but so is the basic BL.) I've looked through encoding of those

Re: [PATCH, RFC, RFT] ARM relocation fixes

2013-12-03 Thread Leif Lindholm
On Tue, Dec 03, 2013 at 09:22:56AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: I've looked through encoding of those instructions and see how much it's a mess. b* and b*x don't have similar set of options which makes validating them a difficult error-prone task. So I think, I'll

Re: [PATCH, RFC, RFT] ARM relocation fixes

2013-12-03 Thread Leif Lindholm
On Tue, Dec 03, 2013 at 09:09:36AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: Ah. When linking with a standalone linker, it rewrites BL to BLX where this is required for state change Doesn't this require Thumb2 ? No, BLX immediate has been supported since ARMv5T. (Yes,

fdt: fix for add_subnode()

2013-12-04 Thread Leif Lindholm
The current fdt support fails to update the size of the dt_struct after adding a new node. Attached is the suggested fix. / Leif From d424d2fe0581c1f036aae9a8b0371d65d007ef61 Mon Sep 17 00:00:00 2001 From: Leif Lindholm leif.lindh...@linaro.org Date: Wed, 4 Dec 2013 12:59:21 + Subject

Re: kern/efi/mm.c - MAX_USABLE_ADDRESS

2013-12-09 Thread Leif Lindholm
On Mon, Dec 09, 2013 at 08:08:39PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: A simple fix would be to just stack the ifdefs, but a better one might be to move the define to one of cpu/efi/memory.h (which is currently a dummy for all platforms, simply including efi/memory.h) or

Re: kern/efi/mm.c - MAX_USABLE_ADDRESS

2013-12-10 Thread Leif Lindholm
On Mon, Dec 09, 2013 at 10:17:20PM +0100, Leif Lindholm wrote: On Mon, Dec 09, 2013 at 08:08:39PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: A simple fix would be to just stack the ifdefs, but a better one might be to move the define to one of cpu/efi/memory.h (which is currently

memcpy() in lib/fdt.c

2013-12-10 Thread Leif Lindholm
Hi, There is a typo in fdt.c, invoking memcpy() rather than grub_memcpy(). Suggested trivial fix: diff --git a/grub-core/lib/fdt.c b/grub-core/lib/fdt.c index 9c886fc..9f34dc7 100644 --- a/grub-core/lib/fdt.c +++ b/grub-core/lib/fdt.c @@ -219,8 +219,8 @@ static int rearrange_blocks (void *fdt,

Re: kern/efi/mm.c - MAX_USABLE_ADDRESS

2013-12-10 Thread Leif Lindholm
. Compile tested for arm/arm64/i386/x86_64, runtime tested on arm64. Same again. / Leif From 09d798628d88542b2af361d5898b179efa2194b3 Mon Sep 17 00:00:00 2001 From: Leif Lindholm leif.lindh...@linaro.org Date: Tue, 10 Dec 2013 12:24:57 + Subject: [PATCH] efi: mm: make MAX_USABLE_ADDRESS

Re: [Xen-devel] pvgrub2 is merged

2013-12-14 Thread Leif Lindholm
On Wed, Dec 11, 2013 at 12:54:35PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: On 11.12.2013 12:51, Ian Campbell wrote: I can't confirm for 100% now, but I'll be 90-95% at FOSDEM and if I'll be ther I'm ok to give a talk. Is this offer still on the table? I'm afraid the deadline

[PATCH] add fdt prerequisites for arm64 UEFI Linux loader

2013-12-16 Thread Leif Lindholm
From ac2166a62495381736fa05668035230607d1bb3d Mon Sep 17 00:00:00 2001 From: Leif Lindholm leif.lindh...@linaro.org Date: Wed, 4 Dec 2013 13:09:21 + Subject: [PATCH 1/2] fdt: additions required for arm64 Linux loader - Add grub_fdt_create_empty_tree() function. - Add 64-bit setprop

[PATCH] add arm64 UEFI Linux loader

2013-12-16 Thread Leif Lindholm
This loader supports booting using the UEFI stub method only. Currently debugging an issue with using the load_image method, so usurping the current GRUB image context instead. ___ Grub-devel mailing list Grub-devel@gnu.org

Re: [PATCH] add arm64 UEFI Linux loader

2013-12-16 Thread Leif Lindholm
On Mon, Dec 16, 2013 at 08:13:01PM +0400, Andrey Borzenkov wrote: В Mon, 16 Dec 2013 14:55:51 +0100 Leif Lindholm leif.lindh...@linaro.org пишет: This loader supports booting using the UEFI stub method only. And where is patch? :) Doh! Here. From 03ebc609f33df1ddcdf10668cacf69f1861a5acf

Re: [PATCH] add fdt prerequisites for arm64 UEFI Linux loader

2013-12-18 Thread Leif Lindholm
On Tue, Dec 17, 2013 at 10:27:12AM +0100, Francesco Lavra wrote: + grub_fdt_set_off_dt_strings (fdt, sizeof (*et)); + grub_fdt_set_off_dt_struct (fdt, sizeof (grub_fdt_header_t) + 16); I would write the offset as sizeof (et-header) + sizeof (et-empty_rsvmap) True. Will change. +struct

Re: [PATCH] add fdt prerequisites for arm64 UEFI Linux loader

2013-12-18 Thread Leif Lindholm
On Mon, Dec 16, 2013 at 10:17:12PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: + et-empty_node.node_end = grub_cpu_to_be32 (FDT_END); + et-empty_node.prop_end = grub_cpu_to_be32 (FDT_END_NODE); grub_cpu_to_be32_compile_time is better suited. Ok, will change. +#define

Re: [PATCH] add arm64 UEFI Linux loader

2013-12-18 Thread Leif Lindholm
On Mon, Dec 16, 2013 at 10:34:51PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: +static void +get_fdt (void) +{ + grub_efi_configuration_table_t *tables; + unsigned int i; + int fdt_loaded; + int size; + + if (!orig_fdt) +{ + fdt_loaded = 0; + /*

Re: [PATCH] add arm64 UEFI Linux loader

2013-12-19 Thread Leif Lindholm
On Wed, Dec 18, 2013 at 06:23:06PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote: + if (!orig_fdt) +{ + fdt_loaded = 0; + /* Look for FDT in UEFI config tables. */ + tables = grub_efi_system_table-configuration_table; + + for (i = 0; i

[PATCH v2 1/2] fdt: additions required for arm64 Linux loader

2013-12-19 Thread Leif Lindholm
- Add grub_fdt_create_empty_tree() function. - Add 64-bit setprop. --- grub-core/lib/fdt.c | 29 + include/grub/fdt.h | 20 2 files changed, 49 insertions(+) diff --git a/grub-core/lib/fdt.c b/grub-core/lib/fdt.c index 9f34dc7..57d6f30 100644

[PATCH v3 2/2] arm64: add EFI Linux loader

2013-12-20 Thread Leif Lindholm
Bugfix of v2 loaded_fdt handling and removal of redundant typedefs. --- grub-core/Makefile.core.def|3 +- grub-core/loader/arm64/linux.c | 479 include/grub/arm64/linux.h | 54 + include/grub/efi/api.h |4 + 4 files changed,

[PATCH v4 2/2] arm64: add EFI Linux loader

2013-12-22 Thread Leif Lindholm
- Fixed grub_error handling. - Use utf8_to_utf16() instead of direct copy. - Unload image and clean up if start_image fails. --- grub-core/Makefile.core.def|3 +- grub-core/loader/arm64/linux.c | 487 include/grub/arm64/linux.h | 54 +

Re: aarch64: relocation 0x105 is not implemented yet.

2013-12-28 Thread Leif Lindholm
Hi Andrey, On 28 December 2013 19:00, Andrey Borzenkov arvidj...@gmail.com wrote: On 27.12.2013 20:07, Andrey Borzenkov wrote: I tried to build RPM for aarch64; it fails building image with [ 1273s] + ./grub-mkimage -O arm64-efi -o grub.efi --prefix= -d grub-core all_video boot cat

Re: aarch64: relocation 0x105 is not implemented yet.

2013-12-29 Thread Leif Lindholm
On 29 December 2013 05:24, Andrey Borzenkov arvidj...@gmail.com wrote: В Вс, 29/12/2013 в 01:55 +, Leif Lindholm пишет: It shouldn't, but difficult to say without knowing more details. Can you run the mkimage with -v and pinpoint the triggering module? This comes from .eh_frame section

Re: aarch64: relocation 0x105 is not implemented yet.

2013-12-29 Thread Leif Lindholm
Andrey, Can you give this a try? (Sent through gmail, so garbled.) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index c916246..a716a49 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -96,7 +96,7 @@ kernel = { emu_cflags =

Re: aarch64: relocation 0x105 is not implemented yet.

2013-12-29 Thread Leif Lindholm
Umm, I'm officially going to go make some coffee. On arm64_efi stripflags obviously. On 29 December 2013 13:06, Leif Lindholm leif.lindh...@linaro.org wrote: Andrey, Can you give this a try? (Sent through gmail, so garbled.) diff --git a/grub-core/Makefile.core.def b/grub-core

Re: aarch64: relocation 0x105 is not implemented yet.

2013-12-29 Thread Leif Lindholm
On 29 December 2013 14:01, Andrey Borzenkov arvidj...@gmail.com wrote: В Вс, 29/12/2013 в 13:09 +, Leif Lindholm пишет: Umm, I'm officially going to go make some coffee. On arm64_efi stripflags obviously. Yes, this works (i.e. - grub-mkimage does not fail). Of course, module relocation

Re: aarch64: relocation 0x105 is not implemented yet.

2013-12-29 Thread Leif Lindholm
On 29 December 2013 14:01, Andrey Borzenkov arvidj...@gmail.com wrote: On arm64_efi stripflags obviously. Yes, this works (i.e. - grub-mkimage does not fail). Of course, module relocation happens at run time and I do not have hardware or software to test it - could you do it? You can download

Re: [PATCH 6/7] mkimage: support images which require full relocation at mkimage time.

2013-12-29 Thread Leif Lindholm
On Sun, Dec 29, 2013 at 06:47:35PM +, Ian Campbell wrote: To do so support the specification of a target_address (which must be 0 for image types which do not have this flag) and a new image flag to signal the need for absolute relocation. If this flag is present then image-link_addr is

  1   2   3   4   >