Hi,
I have checked out to the 2012.09.1 branch of the
u-boot-linaro-stable source and built the u-boot for panda. It worked
fine. Then I enabled the Debug prints and again built the u-boot. But
this time the u-boot hanged up in the middle. In my observations, it
hanged up at the end of the board_init_f() function in the
arch/arm/lib/board.c. At the end it has the relocate_code() function
that might cause the problem. Im stuck up with this and any help would
be appreciated.
Thanks,
Davidson. K
Hi,
a normal Linux kernel currently supports reading the start and end
address of a single binary blob via the FDT's /chosen node.
This will be interpreted as the location of an initial RAM disk.
The Xen hypervisor itself is a kernel, but needs up to _two_ binaries
for proper operation: a Dom0 Linux kernel and it's associated initrd.
On x86 this is solved via the multiboot protocol used by the Grub
bootloader, which supports to pass an arbitrary number of binary modules
to any kernel.
Since in the ARM world we have the versatile device tree, we don't need
to implement the mulitboot protocol.
So I'd like to propose a new binding which denotes binary modules a
kernel can use at it's own discretion.
The need is triggered by the Xen hypervisor (which already uses a very
similar scheme), but the approach is deliberately chosen to be as
generic as possible to allow future uses (like passing firmware blobs
for devices or the like).
Credits for this go to Ian Campbell, who started something very similar
[1] for the Xen hypervisor. The intention of this proposal is to make
this generic and publicly documented.
Looking forward to any comments!
Thanks,
Andre.
[1]
http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=docs/misc/arm/device-tree…
----------------------------
* Multiple boot modules device tree bindings
Boot loaders wanting to pass multiple additional binaries to a kernel
shall add a node "module" for each binary blob under the /chosen node
with the following properties:
- compatible:
compatible = "boot,module";
A bootloader may add names to more specifically describe the module,
e.g. Xen may use "xen,dom0-kernel" or "xen,dom0-ramdisk".
If possible a kernel should be able to use modules even without a
descriptive naming, by enumerating them in order and using hard-coded
meanings for each module (e.g. first is kernel, second is initrd).
- reg: specifies the base physical address and size of a region in
memory where the bootloader loaded the respective binary data to.
- bootargs:
An optional property describing arguments to use for this module.
Could be a command line or configuration data.
Example:
/chosen {
#size-cells = <0x1>;
#address-cells = <0x1>;
module@0 {
compatible = "xen,linux-zimage", "xen,multiboot-module",
"boot,module";
reg = <0x80000000 0x003dcff8>;
bootargs = "console=hvc0 earlyprintk ro root=/dev/sda1 nosmp";
};
module@1 {
compatible = "xen,linux-initrd", "xen,multiboot-module",
"boot,module";
reg = <0x08000000 0x00123456>;
};
...
Adding Dennis for a distro perspective.
On Wed, Sep 4, 2013 at 3:44 AM, Ian Campbell <Ian.Campbell(a)citrix.com> wrote:
> On Tue, 2013-09-03 at 17:00 -0500, Rob Herring wrote:
>> On Tue, Sep 3, 2013 at 10:53 AM, Andre Przywara
>> <andre.przywara(a)linaro.org> wrote:
>> > Hi,
>> >
>> > a normal Linux kernel currently supports reading the start and end address
>> > of a single binary blob via the FDT's /chosen node.
>> > This will be interpreted as the location of an initial RAM disk.
>> >
>> > The Xen hypervisor itself is a kernel, but needs up to _two_ binaries for
>> > proper operation: a Dom0 Linux kernel and it's associated initrd.
>> > On x86 this is solved via the multiboot protocol used by the Grub
>> > bootloader, which supports to pass an arbitrary number of binary modules to
>> > any kernel.
>> >
>> > Since in the ARM world we have the versatile device tree, we don't need to
>> > implement the mulitboot protocol.
>>
>> But surely there would be some advantage of reuse by using the
>> multi-boot protocol since Xen, grub, and OS tools already support it
>> for x86.
>
> Multiboot is pretty x86 specific (although MB2 has a MIPS port) and
> covers more stuff than we strictly require (e.g. on x86 it has
> requirements around which processor mode you enter in, has paging
> enabled etc).
>
>> > So I'd like to propose a new binding which denotes binary modules a kernel
>> > can use at it's own discretion.
>> > The need is triggered by the Xen hypervisor (which already uses a very
>> > similar scheme), but the approach is deliberately chosen to be as generic as
>> > possible to allow future uses (like passing firmware blobs for devices or
>> > the like).
>> > Credits for this go to Ian Campbell, who started something very similar [1]
>> > for the Xen hypervisor. The intention of this proposal is to make this
>> > generic and publicly documented.
>>
>> Can you describe how you see the boot flow working starting with OS
>> installer writes kernel, initrd, xen and ??? to disk.
>
> Kernel and initrd are written to /boot in the usual way (probably from
> kernel.deb or whatever). Xen would also normally come from a distro
> package (also in /boot).
>
>> How does the bootloader know what to load?
>
> It's in the bootloader config, e.g. boot.scr or grub.cfg, which are
> either hand written or produced by the distros tooling.
>
> grub on ARM could consume the same stanzas as are used by grub on x86 to
> boot Xen (which are produced by update-grub):
> echo 'Loading Xen 4.1-amd64 ...'
> multiboot /xen-4.1-amd64.gz placeholder
> echo 'Loading Linux 3.10-2-amd64 ...'
> module /vmlinuz-3.10-2-amd64 placeholder root=/dev/mapper/disks-root ro resume=/dev/mapper/disks-swap quiet
> echo 'Loading initial ramdisk ...'
> module /initrd.img-3.10-2-amd64
>
> Since there is no multiboot on ARM (and never will be) this is safe.
>
> If multiboot ever does come to ARM it will necessarily be multiboot2
> which uses a different keyword.
Right, this is just a text file with a list of binaries. It is not
really the multiboot spec. There is no reason for this part to be
different for grub on ARM. There is a big advantage to reusing the
distro side tooling. If there isn't really much reuse on the
bootloader side, then I'm fine with a different bootloader to Xen
interface. I would like to hear that from folks working on grub
though.
> For u-boot Andre has proposed some syntactic sugar over the "fdt"
> command to make boot.scr more trivial to use. We would of course need to
> implement support for using it in the relevant distro tools (but they
> tend to be very distro/machine specific already, e.g. Debian's
> flash-kernel)
And being machine specific is a PITA. flash-kernel is certainly not
something we want to expand on. There is not much love for boot.scr
either. There is work to address what are not really machine
differences, but largely vendor u-boot differences:
http://www.mail-archive.com/u-boot@lists.denx.de/msg119025.html
One option for u-boot which already supports syslinux style menu files
is to adopt the syslinux multiboot parsing support:
http://www.syslinux.org/wiki/index.php/Doc/mboot
We need to back-up and consider what this looks like in the end for
all the pieces and get input from folks on grub, UEFI, and armv8. The
UEFI answer may be this is a grub problem. For armv8, this proposal
does match up well as the kernel boot interface for v8 is DT. Despite
some claims, ACPI will not completely replace DT because of this.
Rob
On Fri, 13 Sep 2013 12:22:13 +0100, Ian Campbell <Ian.Campbell(a)citrix.com> wrote:
> On Fri, 2013-09-13 at 11:13 +0100, Grant Likely wrote:
> > On Wed, Sep 4, 2013 at 5:41 PM, Rob Herring <robherring2(a)gmail.com> wrote:
> > >> For u-boot Andre has proposed some syntactic sugar over the "fdt"
> > >> command to make boot.scr more trivial to use. We would of course need to
> > >> implement support for using it in the relevant distro tools (but they
> > >> tend to be very distro/machine specific already, e.g. Debian's
> > >> flash-kernel)
> > >
> > > And being machine specific is a PITA. flash-kernel is certainly not
> > > something we want to expand on. There is not much love for boot.scr
> > > either. There is work to address what are not really machine
> > > differences, but largely vendor u-boot differences:
> > >
> > > http://www.mail-archive.com/u-boot@lists.denx.de/msg119025.html
> > >
> > > One option for u-boot which already supports syslinux style menu files
> > > is to adopt the syslinux multiboot parsing support:
> > >
> > > http://www.syslinux.org/wiki/index.php/Doc/mboot
> >
> > Even building it into U-Boot is problematic because it leaves older
> > machines out in the cold. Leif's port of Grub to U-Boot is far more
> > interesting since the distro can now be in control of the code that
> > loads the images and jumps into the kernel/hypervisor.
>
> AIUI this is not being developed any further?
Last I checked the patches have been posted for merging, but it is
stalled on the Grub maintainer. I believe he wanted to fix a bug on the
raspberry pi before merging. Leif would know more. LEG isn't actively
working on it anymore since UEFI is the priority, but I wouldn't call it
abandoned.
> > > We need to back-up and consider what this looks like in the end for
> > > all the pieces and get input from folks on grub, UEFI, and armv8. The
> > > UEFI answer may be this is a grub problem. For armv8, this proposal
> > > does match up well as the kernel boot interface for v8 is DT. Despite
> > > some claims, ACPI will not completely replace DT because of this.
> >
> > Yes, for UEFI it is absolutely an OS loader problem. UEFI provides an
> > API and runtime environment. Grub is in general moving towards a boot
> > menu system and a tool for loading images. Actual booting however
> > should be done by a separate OS loader application. For Linux, this
> > will be an in-kernel UEFI Stub.
>
> I'm not sure I follow your distinction between loading the images and
> "actual booting". If grub loads the images and Linux stub does the
> actual booting how does this stub locate the images which grub loaded?
(Note: this isn't implemented yet, but is in progress) The DTB will need
to be passed via the UEFI system table. Initrd is passed by modifying
the dtb with linux,initrd-* properties in the device tree.
In the Xen case, I think the original proposal is conceptually sound.
I'll quibble about a couple of the details, but I'll address those with
a reply to the original proposal. It makes perfect sense to use the same
mechanism as the initrd properties to tell the kernel about additional
blobs.
> Or are you saying the stub should load the initramfs itself? How does it
> know where to find it? Having the kernel in one config file (grub's) and
> the initramfs in another (the Linux UEFI stub's) seems likely to result
> in things getting out of sync. Having Linux's stub parse the grub CFG is
> even less likely to work well IMHO.
The stub has the ability to load both the dtb and initrd itself by
adding "dtb=" and "initrd=" arguments, but it is currently limited to
loading images from the same filesystem that the kernel was loaded from.
GRUB (or gummiboot/refind/etc) is potentially more flexible.
> > For Xen I would recommend taking the
> > Linux EFI stub code and doing the same thing. There really isn't a
> > need for a multiboot spec when you can rely on a runtime execution
> > environment for setting things up exactly as you want them.
>
> If this works for Linux on EFI then I see no reason it could work for
> Xen on EFI (assuming my questions above are just a result of my
> misunderstanding something)
>
> But... Xen also wants to support non-server and therefore non-EFI
> systems i.e. u-boot. We also want to support v7 where EFI is not a given
> even for servers AIUI.
I was only responding to the UEFI question, but that aside, I don't see
a problem with adding properties to the DT for telling Xen where they
are.
> Given that I think it is a given that Xen will have some sort of
> protocol along these lines, for use in these environments even if it
> does the EFI stub thing on EFI systems. The question is shall we make it
> more general and useful to others or just go our own way? I'd prefer to
> do the former.
Yes, make it general. GRUB and the EFI stub will use it.
g.
I discovered a link problem with uefi-next when building for panda.
Apparently a couple new functions need to be added to the
platform-specific helper code for panda. As suggested by Leif I will
reply with the patch.
-dl
Hi Vijay,
On Wed, Sep 4, 2013 at 4:58 PM, Vijay Kilari <vijay.kilari(a)gmail.com> wrote:
> Hi,
>
> I could now able to boot the kernel from MMC card with UEFI.
> However, updating TC2 from u-boot to uefi, only one core is booting up.
> Logs are below
>
> [ 70.779282] CPU0: thread -1, cpu 0, socket 1, mpidr 80000100
> [ 70.779321] Setting up static identity map for 0x804b85f0 - 0x804b8648
> [ 71.837336] CPU1: failed to boot: -38
> [ 72.841858] CPU2: failed to boot: -38
> [ 73.846383] CPU3: failed to boot: -38
> [ 74.850924] CPU4: failed to boot: -38
> [ 74.850958] Brought up 1 CPUs
>
One possible reason for this is the setting in firmware board.txt
If you disable CONFIG_MCPM in kernel, you need to disable
bit[12] of SCC: 0x700in board.txt to use the legacy/sysflag style of
booting secondary cpus.
Regards,
Sudeep
Hi Vijay,
The Linaro boot-architecture mailing list is a better forum for
questions about the Linaro UEFI releases. I have cc:d this email
to that list.
The reason you do not see TFTP boot as an option is that that is not
yet released. We are hoping to do this shortly. It would probably be
a good idea for us to mention that in the documentation.
I do not recognise the other error message.
/
Leif
On Mon, Sep 02, 2013 at 05:01:23PM +0530, Vijay Kilari wrote:
> Hi Leif Lindholm,
>
>
> I am changing to UEFI from u-boot on my TC2 board.
> I have followed the step listed under "Firmware Update" tab from below link
> http://releases.linaro.org/13.06/ubuntu/vexpress/
>
> After reboot, I see that uefi fails to load kernel image with below log
>
>
> The default boot selection will start in 1 seconds
> ERROR: Did not find Linux kernel.
> [1] Linaro image on SD card
> - VenHw(09831032-6FA3-4484-AF4F-0A000A8D3A82)/HD(1,MBR,0x00000000,0x3F,0x19FC0)/uImage
> - Initrd:
> VenHw(09831032-6FA3-4484-AF4F-0A000A8D3A82)/HD(1,MBR,0x00000000,0x3F,0x19FC0)/uInitrd
> - Arguments: console=ttyAMA0,38400n8 root=/dev/mmcblk0p2
> rootwait ro androidboot.console=ttyAMA0 mmci.fmax=12000000
> - FDT: VenHw(09831032-6FA3-4484-AF4F-0A000A8D3A82)/HD(1,MBR,0x00000000,0x3F,0x19FC0)/v2p-ca15-tc2.dtb
> - LoaderType: Linux kernel with Local FDT
> -----------------------
> Global FDT Config
> - VenHw(09831032-6FA3-4484-AF4F-0A000A8D3A82)/HD(1,MBR,0x00000000,0x3F,0x19FC0)/v2p-ca15-tc2.dtb
> -----------------------
> [a] Boot Manager
> [b] Shell
> [c] Reboot
> [d] Shutdown
> Start: a
> [1] Add Boot Device Entry
> [2] Update Boot Device Entry
> [3] Remove Boot Device Entry
> [4] Update FDT path
> [5] Return to main menu
> Choice: 3
> [1] Linaro image on SD card
> Delete entry: 1
> [1] Add Boot Device Entry
> [2] Update Boot Device Entry
> [3] Remove Boot Device Entry
> [4] Update FDT path
> [5] Return to main menu
> Choice: 1
> [1] VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)
> [2] VenHw(02118005-9DA7-443A-92D5-781F022AEDBB)
> [3] VenHw(1F15DA3C-37FF-4070-B471-BB4AF12A724A)
> [4] VenHw(CC2CBF29-1498-4CDD-8171-F8B6B41D0909)
> [5] VenHw(09831032-6FA3-4484-AF4F-0A000A8D3A82)
> Select the Boot Device:
>
>
> When I try to delete and add new boot entry, I dont see option for TFTP option
> unlike it is mentioned in
>
> https://wiki.linaro.org/ARM/UEFI#Configuring_A5.2C_TC1_and_TC2
>
> Can you please help me in configuring it?.
>
> In fact, when I try to add an entry, uefi asks for kernel start
> address like below
>
> [1] Add Boot Device Entry
> [2] Update Boot Device Entry
> [3] Remove Boot Device Entry
> [4] Update FDT path
> [5] Return to main menu
> Choice: 1
> [1] VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)
> [2] VenHw(02118005-9DA7-443A-92D5-781F022AEDBB)
> [3] VenHw(1F15DA3C-37FF-4070-B471-BB4AF12A724A)
> [4] VenHw(CC2CBF29-1498-4CDD-8171-F8B6B41D0909)
> [5] VenHw(09831032-6FA3-4484-AF4F-0A000A8D3A82)
> Select the Boot Device: 5
> Starting Address of the EFI Application or the kernel:
>
> What should be the address that I should give here?. Such information is not
> available in the wiki page
>
> Thanks & Regards
> Vijay
All the patches required to build UEFI for the ARM Foundation and Base
Models have been committed to subversion (revision 14628).
The wikipage
(https://sourceforge.net/apps/mediawiki/tianocore/index.php?title=ArmPlatfor
mPkg/AArch64) has been updated to use the repository instead of the
snapshot.
It is recommended to apply the patch "Fixed calculation of BaseOfCode in
GenFw when the first code section is aligned" (sent on July 16th on the
mailing-list). A copy of this patch can be found in
ArmPlatformPkg/Documentation/patch/BaseTools-Pending-Patches.patch.
patch -p1 <
ArmPlatformPkg/Documentation/patches/BaseTools-Pending-Patches.patch
The snapshot contains changes to add AArch64 support to EdkShellPkg
(required to start UEFI SCT) that is not yet into subversion. The latest
version of this patch will be sent soon on the mailing-list.
From: Olivier Martin [mailto:olivier.martin@arm.com]
Sent: 26 July 2013 21:34
To: edk2-devel(a)lists.sourceforge.net; boot-architecture(a)lists.linaro.org
Cc: Harry Liebel
Subject: ARM 64-bit - UEFI on the AArch64 Models
After the UEFI 2.4 specification - that contains the AArch64 (the ARM 64-bit
architecture) Binding - was approved last week, I started to send the
AArch64 patchset to be reviewed by the different EDK2 maintainers.
Because patches are still waiting to be approved and also not all the
patches have been sent yet (such as the pre-built binaries and few minor
others), I created a snapshot of the latest subversion (svn rev 14505 -
Friday 26 Jul 2013) with the AArch64 pathset to make it easier for people to
play with UEFI on AArch64 platforms.
The main reason of creating a snapshot and not a patch is binary data are
not really portable in patch files.
This archive is only a short term solution and should not be considered as a
release package (some AArch64 patches could diverge from their original
revision). The archive will be removed after all the patches will have been
accepted by the maintainers.
'Direct' link to the archive:
http://sourceforge.net/projects/edk2/files/ARM/aarch64-uefi-rev14505.tgz/dow
nload
Tutorial to build and run AArch64 EDK2 on the Foundation and Base FVP Model:
https://sourceforge.net/apps/mediawiki/tianocore/index.php?title=ArmPlatform
Pkg/AArch64
Note: The AArch64 Foundation FVP Model is free to download. So anyone could
try to build and run AArch64 UEFI on this Virtual Platform.
Thanks,
Olivier
On 09/04/2013 10:55 AM, Ian Campbell wrote:
> On Wed, 2013-09-04 at 10:43 +0200, Andre Przywara wrote:
>
>> I am about to write up a more elaborate technical rationale describing
>> the problems with multiboot on ARM:
>>
>> https://wiki.linaro.org/AndrePrzywara/Multiboot
>
> Doesn't seem to exist? A search for "mulitboot" doesn't seem to throw up
> the one you meant either.
Try again now. As mentioned "I am about to write ..." ;-)
Thanks,
Andre.
>>> So, is having a more generic solution really needed?
>>
>> Not necessarily needed, but useful, I think. As described above I don't
>> see any technical obstacles of doing it in a more generic way, so we
>> could as well go ahead with this. On x86 from time to time the need for
>> additional binaries pops up (early microcode loading, for instance), so
>> why not be be prepared.
>
> I agree. There have also been occasions where people doing
> disaggregation have wanted to start multiple initial domains, requiring
> additional modules at load time. I don't think being generic and
> extensible is costing too much here.
>
> Ian.
>
When testing Roy Franz's ARM UEFI stub kernel loader patches on a TC2
platform, the loader (correctly) highlighted an issue that has been
lurking unnoticed for a while: the very UEFI image actually makes
following the Linux boot protocol impossible.
Roy's stub takes the paranoid (and correct) approach of explicitly
allocating in UEFI the regions the zImage may need to be relocated to
(based on original load address) and that which it will decompress
into (based on some masking operations relative to the resulting entry
point).
It also attempts to allocate a "big enough" region to ensure the
decompressed kernel, with BSS, will fit. This operation fails on the
TC2 tianocore port, and if basic arithmetic does not fail me, would
also fail at least on Samsung Arndale and TI Beagleboard (I have yet
to verify).
The problem is that on all these platforms, the UEFI binary is linked
to execute at or near the start of RAM on the platform. Oliver figured
this out for me for TC2, and has promised to look into what would be
the best way of resolving this for that platform.
On these platforms, kernel decompression may result in overwriting the
initial UEFI image in RAM, before ExitBootServices(). While this may
work on some platforms, there are no guarantees. This region could
even contain code or data required by runtime services.
I have updated the (fairly random) list of UEFI port requirements at
https://wiki.linaro.org/LEG/Engineering/Kernel/UEFI/BSP
But several BSPs will need to change, along with their documentation.
/
Leif