Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@521 f3766cd6-281f-0410-b1cd-43a5c92072e9
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@519 f3766cd6-281f-0410-b1cd-43a5c92072e9
to have code in header files.
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@518 f3766cd6-281f-0410-b1cd-43a5c92072e9
Makefiles clean and simple.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@517 f3766cd6-281f-0410-b1cd-43a5c92072e9
had _SHARED defined during compilation, each of them would contain an
assignment of stage0_printk to *printk. During linking, this caused
errors as multiple definitions of printk existed.
Make sure _SHARED alone gives you only the printk prototype, and iff
_MAINOBJECT is defined as well, include the assignment.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@516 f3766cd6-281f-0410-b1cd-43a5c92072e9
probably be factored out together with the rest of the lines in
mainboard/* later, but for now it'll do.
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@515 f3766cd6-281f-0410-b1cd-43a5c92072e9
post_code.c (thus drop it from console.h).
Instead, have console.h #include post_code.h and drop other
explicit #includes of post_code.h in the code; console.h is already
included in pretty much every file.
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@513 f3766cd6-281f-0410-b1cd-43a5c92072e9
an artifact from the time when we needed stage2 phase 1 code to make
printk work.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@512 f3766cd6-281f-0410-b1cd-43a5c92072e9
reality.
* We use LAR and not CPIO
* printk() can be called from stage 1 without ill effects
* stage 2 phase 1 is without purpose
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@511 f3766cd6-281f-0410-b1cd-43a5c92072e9
how support for superios might look in the future. This code (like all the
rest, too) will certainly change and evolve in the future, as v3 evolves.
-----
Add support for the Fintek F71805f to LinuxBIOSv3. It hasn't been tested yet
because something's failing to build elsewhere, but the stage1 does build, and
for the moment that's what matters. It's based on working v2 code so it should
work fine.
Signed-off-by: Corey Osgood <corey.osgood@gmail.com>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@508 f3766cd6-281f-0410-b1cd-43a5c92072e9
dereference or worse) in case the archive length is exactly
sizeof(struct lar_header). Such an archive is invalid because the
filename directly after the LAR header is always dereferenced and has to
be at least 1 byte in the "empty filename" case (only terminating \0).
Improve LAR code documentation and reorder variables in one assignment
to make the code more obvious and readable. This will help people
understand what the code does when they look at it half a year from now.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@506 f3766cd6-281f-0410-b1cd-43a5c92072e9
This fixes for example printk calls from initram code.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Jordan Crouse <jordan.crouse@amd.com>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@505 f3766cd6-281f-0410-b1cd-43a5c92072e9
(I think) when the PAYLOAD_NONE change was put in.
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@503 f3766cd6-281f-0410-b1cd-43a5c92072e9
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@502 f3766cd6-281f-0410-b1cd-43a5c92072e9
differentiate between identically named objects during boot.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@501 f3766cd6-281f-0410-b1cd-43a5c92072e9
example to access the device list from Open Firmware.
Signed-off-by: Jens Freimann <jens@freimann.org>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@500 f3766cd6-281f-0410-b1cd-43a5c92072e9
device tree can be created from data in struct device.
Signed-off-by: Jens Freimann <jens@freimann.org>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@499 f3766cd6-281f-0410-b1cd-43a5c92072e9
number from ELF as segment number in the file. This works nicely when
there are no skips (e.g. not PT_LOAD segments, which are discarded).
If one segment is skipped, we get a bump:
normal/payload0/segment0 (27288 bytes, lzma compressed to 14506 bytes @0x64c0)
normal/payload0/segment2 (211136 bytes, lzma compressed to 70905 bytes @0x9dc0)
The LAR loader wont load segment2, and in this particular case, grub2-lb
will only boot into rescue mode (segment0 contains it).
Attached patch adds a counter for segment number in the LAR utility to
solve this bug:
normal/payload0/segment0 (27288 bytes, lzma compressed to 14506 bytes @0x64c0)
normal/payload0/segment1 (211136 bytes, lzma compressed to 70905 bytes @0x9dc0)
Also the eagle eyed can see that I merged in Uwe's multiple-payload
patch into current stage1, which includes the segment support. And this
means that grub2-lb without any hacks works when loaded from LAR segments.
Signed-off-by: Alex Beregszaszi <alex@rtfs.hu>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@498 f3766cd6-281f-0410-b1cd-43a5c92072e9
the common parts of copy_file() and run_file().
Signed-off-by: Alex Beregszaszi <alex@rtfs.hu>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@497 f3766cd6-281f-0410-b1cd-43a5c92072e9
Change lib/lar.c to use strncmp() for magic check. Current code
depends on that the len field will never hold a value bigger than
0xffffff, which is a working assumption given current flash sizes, but
my next patch might affect this.
Signed-off-by: Alex Beregszaszi <alex@rtfs.hu>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@496 f3766cd6-281f-0410-b1cd-43a5c92072e9
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@494 f3766cd6-281f-0410-b1cd-43a5c92072e9
not memcopied to.
Signed-off-by: Alex Beregszaszi <alex@rtfs.hu>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@490 f3766cd6-281f-0410-b1cd-43a5c92072e9
displayed only when the condition happens.
Signed-off-by: Alex Beregszaszi <alex@rtfs.hu>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@489 f3766cd6-281f-0410-b1cd-43a5c92072e9
While doing this, we can remove lot of code duplication about searching
the device, which is already done in the parent pci_device.c.
Signed-off-by: Alex Beregszaszi <alex@rtfs.hu>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@487 f3766cd6-281f-0410-b1cd-43a5c92072e9
Remove a broken proto from a c file.
Fix protos etc. per uwe's request for const where it made
sense.
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Peter Stuge <peter@stuge.se>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@485 f3766cd6-281f-0410-b1cd-43a5c92072e9
one common file.
The first is the noelf option, which is a simple
modification to look for payloads in the form
payload/segmentX where X is a number.
The segments are assumed to be contiguously numbered and the code
steps when the first search fails (i.e. if 0 and 1 are there, and 2
is not, the code stops and will not try to find 3).
The lar code will use the loadaddress to load the segment. Currently,
the lar code will not run each loaded segment, but we need to consider
this for uwe's lbmenu work. Consider this implementation somewhat
preliminary until we integrate lbmenu. There is the complex issue of
interdependent segments, as in the kernel, where no single segment
can run until all are loaded.
The second is the fix for improperly wrapping to 0 when
searching the LAR.
This has been tested with filo and BOCHS.
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@484 f3766cd6-281f-0410-b1cd-43a5c92072e9
These changes extend the larchive structure, and
add a Kconfig EXPERT option to enable the 'no elf' mode.
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@483 f3766cd6-281f-0410-b1cd-43a5c92072e9
replace with LAR" series; this set is for arch/x86.
note that the payload is now payload/segment0, payload/segment1, etc. I've extended
linuxbios to look for these. Note that you can now see all the things
that get loaded ;they're no longer hidden in an ELF header somewhere.
Elf failures are gone!
Note that I've left legacy elf support in, for now, but recommend we
get rid of it as soon as possible.
patch attached. This is a first pass. lar.c needs some refactoring but
I want to get the cmdline going. You can now have a linux payload and
it will uncompress with no problems.
This has been tested with filo and BOCHS.
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@482 f3766cd6-281f-0410-b1cd-43a5c92072e9
The system will default to old behaviour. See Kconfig in the root.
I still wish to kill ELF mode very soon, however.
LAR is a very capable format. With two simple extensions, we can use
LAR to replace all that we are using ELF for now. This change can
really make life better:
1. we can use streaming decompress instead of the current "uncompress
elf to memory and then copy segments" approach. So we can get rid of
THIS hardcode:
#define UNCOMPRESS_AREA (0x400000)
2. A simple lar l can show ALL segments, including payload segments
3. It's really easy to see where things will go in memory, and catch problems
4. We can figure out an ELF input file is bogus BEFORE we flash, not
AFTER we flash and try to boot it
5. did I mention streaming decompress?
6. We no longer have to worry about where we decompress the elf in
memory (this problem was causing trouble when the payload was a linux
kernel -- it was so big)
7. Since we have a load address, we can create this lar entry:
normal/cmdline
and specify that it be loaded at a place where linux will find it as
the cmdline.
8. The decision on whether to XIP can be made in the LAR entry, not in
hardcode. For example, if initram needs to be XIP, set the load
address to 0xffffffff. Done.
The change is simple. Add a load address and entry point to the lar
header. Extend the lar tool to parse the elf file and create multiple
lar segments. It looks like this:
normal/payload0 (33192 bytes, lzma compressed to 18088 bytes @0x38
load @0x100000, entry 0x105258)
normal/payload1 (72 bytes, lzma compressed to 47 bytes @0x4718 load
@0x1225a0, entry 0x105258)
normal/option_table (932 bytes @0x4798 load @0, entry 0)
normal/stage2 (33308 bytes, lzma compressed to 15474 bytes @0x4b78
load @0, entry 0)
normal/initram (4208 bytes @0x8828 load @0, entry 0)
linuxbios.bootblock (16384 bytes @0xfc000 load @0, entry 0)
note that the payload is now payload/segment0, payload/segment1, etc. I've extended
linuxbios to look for these. Note that you can now see all the things
that get loaded ;they're no longer hidden in an ELF header somewhere.
Elf failures are gone!
Note that I've left legacy elf support in, for now, but recommend we
get rid of it as soon as possible.
patch attached. This is a first pass. lar.c needs some refactoring but
I want to get the cmdline going. You can now have a linux payload and
it will uncompress with no problems.
This has been tested with filo and BOCHS.
This patch includes ONLY the lar changes, the other changes are next.
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@481 f3766cd6-281f-0410-b1cd-43a5c92072e9
and ends at the end of a temporary buffer, which doesn't look
right to me (and segfaults if between those two there's an unmapped
region, as happened here).
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@480 f3766cd6-281f-0410-b1cd-43a5c92072e9
conformant, working) %llx in printk/printf.
While I'm at it, affected lines with 271 characters can be broken into
smaller chunks.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@479 f3766cd6-281f-0410-b1cd-43a5c92072e9
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@477 f3766cd6-281f-0410-b1cd-43a5c92072e9
operations to specify the intended pathname for the blob.
Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@474 f3766cd6-281f-0410-b1cd-43a5c92072e9
fleshed out the "usage" screen.
Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@473 f3766cd6-281f-0410-b1cd-43a5c92072e9