Commit graph

18 commits

Author SHA1 Message Date
Myles Watson
eece345b2c This patch makes the vm86 call succeed. It
1. moves the run_bios function down so it can call setup_realmode_idt
2. adds the __attribute__((regnum(0))) to biosint because it is called from assembly

Signed-off-by: Myles Watson <mylesgw@gmail.com>
Acked-by: Stefan Reinauer <stepan@coresystems.de>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@964 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-10-29 20:39:32 +00:00
Myles Watson
b04f94ae37 White space cleanup in vm86.c so that the next patch is more readable.
Signed-off-by: Myles Watson <mylesgw@gmail.com>
Acked-by: Myles Watson <mylesgw@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@962 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-10-29 18:12:22 +00:00
Carl-Daniel Hailfinger
77010a1111 The named unions in the device tree code are obnoxious and degrade
readability. Move to anonymous unions.

Build tested on all targets. Boot tested on qemu.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>

Ron tested this and it boots to Linux.
Acked-by: Ronald G. Minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@730 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-10 00:20:24 +00:00
Ronald G. Minnich
61cd5ae455 This discussion is too useful to lose.
Carl-Daniel Hailfinger wrote:
> On 18.02.2008 23:55, Marc Jones wrote:
>> Carl-Daniel Hailfinger wrote:
>>> it seems that executing VSA requires vm86 to be useful. Since we
>>> unconditionally execute the VSA, we should unconditionally require 
vm86
>>> support (PCI_OPTION_ROM_RUN_VM86) via Kconfig for Geode targets. Not
>>> doing so will either cause compile failures or runtime failures.
>>>
>>> Adding
>>> select PCI_OPTION_ROM_RUN_VM86
>>> below
>>> config CPU_AMD_GEODELX
>>> did not work out for me.
>> Sorry I missed this.
>>
>> VSA requires the GDT that is in vm86.c. VSA loads similar to an 
option
>> ROM so the loader does go into VM86 mode. All the other stuff like
>> interrupt support and PCI BIOS isn't needed by VSA. I think that the
>> GDT at the top of vm86.c can be moved to a header file, gdt.h or
>> something like that.
>
> northbridge/amd/geodelx/vsmsetup.c uses
> util/x86emu/vm86.c:setup_realmode_idt() but it seems most/all of the
> setup there is not needed at all for VSA. Pulling in 
setup_realmode_idt
> pulls in the rest of vm86 through direct and indirect dependencies.
>
>> Care to make a patch? :)
>

I am also leaning towards removing the IDT for VSA init. There is a risk
if either an exception happens or a software interrupt is used you will
get unexpected results. What probably happens is that you jump off to
something that will eventually cause a triple fault and reboot. You may
think this is bad (and it is) but it is the same risk that coreboot runs
today. If coreboot had a generic IDT to handle exceptions, VSA init
would use the same IDT. Note that hardware INT (even timers) should
never happen as they are always masked.

I have built with no PCI_OPTION_ROM_RUN_VM86 and run this to filo.
- Show quoted text -

Marc







--
Marc Jones
Senior Firmware Engineer
(970) 226-9684 Office
mailto:Marc.Jones@amd.com
http://www.amd.com/embeddedprocessors

Reduce the amount of compilation errors for Geode LX targets if x86emu
or no emulation is selected instead of vm86.
Factor out GDT code from vm86.c to vm86_gdt.c
Remove IDT setup for VSA init.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Signed-of-by: Marc Jones <marc.jones@amd.com>

This has booted to runlevel 3 and the ethernet works fine. 
Acked-by: Ronald G. Minnich <rminnich@gmail.com>




git-svn-id: svn://coreboot.org/repository/coreboot-v3@613 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-02-21 05:20:14 +00:00
Ronald G. Minnich
4a6a5313bf The real change here is that paths can now be part of the node label
in dts. This gets rid of the ugly pcipath etc. properties. 

So, instead of

  somedevice {pcipath="1,0";};

We say pci@1,0{ etc. etc. };

As per my agreement I agree to document this in the design doc. 
The alix1c compiles but is untested, and will probably need some work. 
I will do these additional tasks on friday.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by:  Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>

M    include/device/path.h
Add LPC path type, replacing SUPERIO path type, since SUPERIO is only
one type of LPC. Clean up tabbing in parts of the file (cosmetic).

M    mainboard/emulation/qemu-x86/dts
Modify this dts for the new path naming scheme.

M    device/pci_device.c
Change what used to be a BIOS_ERR (but is no longer) to a BIOS_NOTICE. 
The change is that the device tree includes more than just PCI devices, 
so finding a non-PCI device is no longer fatal; a notice is useful. 

M    device/device_util.c
Add string creation for PCI_BUS nad LPC.

M    northbridge/intel/i440bxemulation/dts
Add ID info for the chip. 

M    northbridge/intel/i440bxemulation/i440bx.c
Change initialization so it is explicitly for the .ops struct member. 

M    util/dtc/flattree.c
Add support for the new path naming scheme. 
I'm in the middle of this commit so I'll fix the hard-coded lengths 
next commit. 
Also delete dead code between #if 0 and /* and //

M    util/x86emu/vm86.c
comment out unused variables. these may someday be use, not ready
to delete them yet. 

M    Makefile
Change -O2 to -g. We need debugging on LAR far more than we need performance. 



git-svn-id: svn://coreboot.org/repository/coreboot-v3@593 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-02-13 21:00:20 +00:00
Ronald G. Minnich
0044d53a10 This set of changes creates irq tables for alix1c and adds the functions
from v2 to install them. Linux boots fine and all interrupts
seem to work correctly -- the network comes up, USB hot plug works, 
I can mount the USB disk, etc. 

To enable pirq tables for a given mainboard, simply add the 
select PIRQ_TABLE (see below) to the Kconfig for that board. 

Again, this code builds and boots linux on the alix1c.

I think, with this change, we are very close to moving ALL LX boards to 
v3 and deprecating v2. The major remaining fix is to add an empty LAR 
entry to fill empty space in LAR and speed up the LAR file search 
process. 

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Stefan Reinauer <stepan@coresystems.de>

Index: include/tables.h
Add prototype, conditioned on CONFIG_PIRQ_TABLE

Index: util/x86emu/vm86.c
Comment out 'debug trap' code that scribbles vectors at 0x4000. 
I don't know why this is here, but I'd like to leave it #if'ed out --
somebody, at some point, thought we needed it. To reenable, we will need
to move stage2 code or these magic vectors. 

Index: arch/x86/Makefile
Add support for conditional compilation of pirq support code. 

Index: arch/x86/pirq_routing.c
Add this file from v2. 

Index: arch/x86/archtables.c
Add call to write_pirq_routing_table (controlled by #ifdef
CONFIG_PIRQ_TABLE)

Index: arch/x86/Kconfig
Add new config variable: PIRQ_TABLE

Index: device/device.c
Fix some trivial bugs. 

Index: mainboard/pcengines/alix1c/Makefile
Add pirq table code for stage2

Index: mainboard/pcengines/alix1c/dts
Modify dts to properly set southbridge variables

Index: mainboard/pcengines/alix1c/irq_tables.c
Add code from v2 for the alix1c. 

Index: mainboard/pcengines/Kconfig
Add 'select PIRQ_TABLE'

Index: include/arch/x86/pirq_routing.h
Add include file from v2.
Remove all the SLOTCOUNT nonsense. This hack was only needed
for a very early version of gcc 3.x, where they screwed up the 
creation of struct members that used the [] syntax for variable-length
array at the end of the struct. 

Index: include/device/pci.h
Add prototype



git-svn-id: svn://coreboot.org/repository/coreboot-v3@582 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-02-09 16:32:59 +00:00
Stefan Reinauer
6220b632e7 Now version 3: LinuxBIOS -> coreboot rename.
- I left LB_TAG_ intact because they are used by the payloads
- file renames are still missing. see next commit
- some lb_ renames might be missing. feel free to provide patches.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@564 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-01-27 18:54:57 +00:00
Ronald G. Minnich
3ac5450814 This is a first cut at the implementation of VSM support. What has do be
done, long term, 
is to remove almost all of the vsmsetup.c file and use functions in the
vm86.c file.
 

The barrier to achieving that goal is the specialized nature of the vga
bios support code vs. the vsm bios support code. 
There are a few issues to resolve but what I'd like
to do is get VSA working first, then work out how to merge the rest of
the code. 

I have already done some merging at this point. 

This code does not yet work. But the board does not work either, and I 
want to get the code into the repo in case my hard drive dies.

Makefile: add vmsetup.o 

vsmsetup.c: Add this file from v2. Fix copyright and includes. 
Remove almost all assembly code in favor of code in vm86.c. 
In future, almost all code will be removed and the vm86.c code used
instead. 

vm86.c: make some assembly symbols .globl so that vsmsetup.c can use
them. 

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/coreboot-v3@560 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-01-24 21:54:22 +00:00
Carl-Daniel Hailfinger
68b97a6034 include/device/device.h
Remove old vendor,device struct members since we are now using the
device_id struct. 
Change declaration of dev_find_device to use device_id struct. 

device/device_util.c
Change dev_find_device to use device_id struct instead of vendor, device
parameters.
Add convenience function, dev_find_pci_device, to make it easier for
users. 

device/pci_device.c
Change uses of dev->vendor and dev->device to dev->id. 
Change prints of dev->vendor, dev->device to use the 
dev_id_string function. 

device/pci_rom.c
Change uses of dev->vendor and dev->device to dev->id. 

southbridge/amd/cs5536/cs5536.c
Change uses of dev_find_device to dev_find_pci_device

southbridge/amd/cs5536/dts
Add pciid of the cs5536

northbridge/amd/geodelx/dts
add pciid of the geodelx northbridge. 

util/x86emu/vm86.c
Change uses of dev_find_device to dev_find_pci_device

With these changes, the chipsetinit function now finds the southbridge
in the static tree, which is the first time this has worked in v3.
This success in turn means that the chipsetinit code is running for the
first time. 
We are still failing in "Finding PCI configuration type"

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/coreboot-v3@558 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-01-20 23:03:40 +00:00
Stefan Reinauer
dde116bd69 this patch changes vm86.c:do_bios to run_bios(dev, addr).
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
2007-09-05 01:41:52 +00:00
Stefan Reinauer
0598fd602a This patch removes all printk format warnings from my LBv3 build (Qemu
x86 config). This was tested with gcc 4.1.0 on x86 and gcc 4.2.1 on x86_64.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@466 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-08-11 18:38:24 +00:00
Stefan Reinauer
4a6f1fc46c fix somw printk calls and print warnings for those that still need to be fixed.
(trivial)

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@462 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-07-21 19:22:40 +00:00
Uwe Hermann
71ccb36afc Massive file rename and moving orgy:
- Everything in include/cpu/generic/x86/arch/* goes into
   include/arch/x86 now.

 - include/cpu/generic/x86/div64.h moves into include/arch/x86, too.

 - The former include/cpu/generic/x86/arch/elf.h moved to
   include/arch/x86/archelf.h, as elf.h already exists in include/
   and we must prevent a name clash.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@314 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-05-05 21:36:52 +00:00
Uwe Hermann
7e752a0631 Move include/console/console.h to include/console.h in order to
get rid of a directory which only contains a single file, and
at the same time simplify the #includes and their hierarchies.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@313 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-05-05 20:18:28 +00:00
Stefan Reinauer
bea6044faa Trivial:
* include cleanup. We don't provide stdint.h, so use arch/types.h
  instead.
* drop some unused variables
* fix comment style in some headers to match the template
* Fix the loglevel of some debugging output.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@275 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-04-06 14:05:26 +00:00
Uwe Hermann
bec074295e Fix incorrect comment nesting.
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@267 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-03-14 11:54:38 +00:00
Stefan Reinauer
0528863e20 This patch reshapes northbridge and southbridge inclusion. It selects
southbridge drivers in Kconfig.

* It includes initial superio code as well, but there is at least one
  error in the pnp_device.c/superio scenario left

* Fixed biosemu.c, vm86.c, pnp_device.c (sort of)

* Enable vm86 instead of x86emu per default for vga init for now. This
  makes VGA in qemu work. There might be a bug in x86emu or the compiler
  I am using. (gcc version 4.1.2 20070115 (prerelease) (SUSE Linux))

* Import isa-dma.c, keyboard.c and i8259.c from v2 /pc80, which was taken
  from LinuxBIOSv1 released from LANL under release LA-CC Number 00-34
  and using parts from the Linux kernel.

This patch makes vga and keyboard work in qemu. Yippie

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@260 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-03-13 09:31:08 +00:00
Stefan Reinauer
fe23cd79ba Add x86emu support. This adds initial x86emu/vm86 support to LinuxBIOSv3
This is an infrastructure patch, it will not make vga output work yet. 
Another patch will follow.

This code is imported from LinuxBIOSv2 which had this code imported from
LinuxBIOSv1.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@256 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-03-12 23:47:26 +00:00