Commit graph

289 commits

Author SHA1 Message Date
Uwe Hermann
8e6d45e059 Minor fixes and improvements for v3, mostly for Kconfig files (trivial).
- Coding style and whitespace fixes.
 - Remove obsolete comments, fix incorrect ones.
 - Use the full/canonical name of mainboards/vendors everywhere.
 - Update the list of USB Debug capable chipsets from
   http://www.coreboot.org/EHCI_Debug_Port.
 - s/LB/CB/ for the CONSOLE_PREFIX kconfig option.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@879 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-10-01 18:29:22 +00:00
Ronald G. Minnich
11c6d0d98d m57sli mostly builds again. The stage0 is too large at 24k.
We need to figure out if we should just grow stage0. My inclination is 
to say 'yes'.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@877 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-10-01 07:23:05 +00:00
Ronald G. Minnich
6d38e04683 quick emergency fix for gnu tools that now have elaborate note names
such as .note.this.that. These new note names were making builds 
unbuildable on (e.g.) fc9.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@873 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-09-29 15:37:26 +00:00
Ronald G. Minnich
be03d189db Finally, after two years, put in real code for stop_ap(). Code has to be
moved to stage1 ROM code. Make the struct for nodeid/coreid generic to 
x86. Create the functions for existing architectures are a model for 
future architectures (VIA coming soon we hope). 

Move includes so that things build correctly now. 

This is actually a small patch that impacted a number of files due to 
include order changes. This is build and boot tested on simnow and 
build tested on geode. 

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



git-svn-id: svn://coreboot.org/repository/coreboot-v3@872 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-09-29 14:58:56 +00:00
Jordan Crouse
f9dc3f1528 Signed-off-by: Robert Millan <rmh@aybabtu.com>
Acked-by: Jordan Crouse <jordan.crouse@amd.com>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@870 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-09-24 14:54:33 +00:00
Ronald G. Minnich
e053a1004c substantial cleanups for k8.
AMP TinyGX still builds, this won't affect other platforms. 

clean up 8111 stage1 code; add function to smbus, 
memreset_setup_amd8111, for the 8111 specific parts of memreset. 

include k8 .h to reduce warnings. Turn some things into functions (romcc
legacy cleanup) and put them in .c files. 

simnow actually successfully gets through a reset cycle now. 

Next is to fix the fidvid code. 

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@868 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-09-19 18:35:22 +00:00
Ronald G. Minnich
28ecbeab88 The K8 is one example, but there are other devices (e.g. I2C) that also have
multiple links. The way this was done in v2 was a big confusing; this way is 
less so. 

The changes are easy. Getting them right has been hard :-)

First, for a k8 north that has three links, you can name each one as follows:
pci0@18,0
pci1@18,0
pci2@18,0

We have to have the same pcidevfn on these because that is how the k8 works. 
But the unit numbers (pci0, pci1, etc.) distinguish them. 

The dts will properly generate a "v3 device code" 
compatible static tree that puts the links in the right place in the 
data structure. 

The changes to dts are trivial. 
As before, dts nodes with children are understood to be a bridge. 
But what if there is a dts entry like this:
pci1@18,0 {/config/("northbridge/amd/k8/pci");};


This entry has no children in the dts. 
How does dt compiler know it is a bridge? It can not know unless 
we add information to the dts for that northbridge part. 
To ensure that all bridge devices are detected, we support the following: 
if a dts node for a device has a bridge property, e.g.: 
 {
        device_operations = "k8_ops";
       bridge;
 };

The dt compiler will treat it as a bridge whether it has children or not. 

Why would a device not have children? Because it might be attached to a
pci or other socket, and we don't know at build time if the socket is empty, 
or what might be in the socket. 

This code has been tested on dbe62 and k8 simnow, and works on each. 
It is minimal in size and it does what we need. I hope it resolves our 
discussion for now. We might want to improve or change the device code
later but, at this point, forward motion is important -- I'm on a deadline for
a very important demo Oct. 22!

Also included in this patch are new debug prints in k8 north. 

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@865 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-09-17 16:36:20 +00:00
Carl-Daniel Hailfinger
ade1cd1f11 The current K8 stack preservation code in disable_car() works by chance,
but that's not something we should rely on.

The new code is entirely rewritten, fixes a few missing constraints in
the asm and should be a lot more readable. However, the generated code
is NOT identical. The old code was broken because of the missing ecx
clobber constraint and it did not copy the stack back (ecx was zero at
the beginning of the copy-back loop and so the loop executed exactly
zero times).
So this is a genuine bug fix.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>

Ron writes:
wow! nice catch!

Acked-by: Ronald G. Minnich <rminnich@gmail.com>

We also need disable_car_and_halt, which only disables car and halts,
for the APs (i.e. no need to copy stack back)


git-svn-id: svn://coreboot.org/repository/coreboot-v3@858 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-09-05 10:29:33 +00:00
Carl-Daniel Hailfinger
f9b114054c Improve debugging printks for LAR and PCI access.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@856 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-09-04 00:38:54 +00:00
Ronald G. Minnich
72be710b4b With this change, we get all the way to stage 2 and this output, at
which point we hang:
Show all devs...
root(Root Device): enabled 1 have_resources 0 initialized 0
cpus: Unknown device path type: 0
cpus(): enabled 1 have_resources 0 initialized 0
apic_0(APIC: 00): enabled 1 have_resources 0 initialized 0
pci_1_0(PCI: 00:01.0): enabled 1 have_resources 0 initialized 0
pci_0_0(PCI: 00:00.0): enabled 1 have_resources 0 initialized 0
pci_4_0(PCI: 00:04.0): enabled 1 have_resources 0 initialized 0
pci_5_0(PCI: 00:05.0): enabled 1 have_resources 0 initialized 0
pci_18_0(PCI: 00:18.0): enabled 1 have_resources 0 initialized 0
ioport_2e(IOPORT: 2e): enabled 1 have_resources 0 initialized 0
domain_0(PCI_DOMAIN: 0000): enabled 1 have_resources 0 initialized 0
Phase 6: Initializing devices...
Phase 6: Root Device init.
Phase 6: PCI: 00:04.0 init.

The dts is quite incomplete and that is part of the problem. Doubtless 
there are other problems :-)

But training is indeed working in simnow, and memory is working, and we 
can return from disable_car as on the geode. 

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@855 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-09-02 15:25:06 +00:00
Ronald G. Minnich
47043d7ab3 add some printks to raminit and correct a typo on one comment.
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@851 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-31 02:46:37 +00:00
Ronald G. Minnich
4aebc1be66 Fix a really stupid error on my part :-)
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@850 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-30 05:01:43 +00:00
Ronald G. Minnich
5f1864114d Hacks to get us trying to read the smbus.
There is really strange logic in the init_cpus, and it needs cleanup. 

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@849 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-30 04:20:03 +00:00
Ronald G. Minnich
df00b48496 One typo and one change to get our bootblock back into 20k.
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@848 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-30 03:42:01 +00:00
Ronald G. Minnich
ff2ddcb313 This gets us back to a compiling k8 target.
This code has been tested on dbe62, and builds for qemu as well. 

the next step is testing on simnow. 

k8.h: add more prototypes and some required inline functions. 
cpu.h: same
serengeti: expand defines in mainboard.h, though we need a better 
mechanism; continue to fix initram.c, add new support files to Makefile
lib/console.c: include globalvars.h
lib/lar.c: Provide more informative print as the lar is scanned.
k8 north: needed reset_test.c from v2, fixes to raminit.c
arch/x86
Kconfig: new CONFIG variable CBMEMK, meaning coreboot mem k, memory
	used for coreboot. 
init_cpus.c: functions to start up CPUs
stage1_mtrr.c: bring over early mtrr support from v2.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@847 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-30 03:35:40 +00:00
Ronald G. Minnich
f365719d09 This is closer! There are < 10 functions to be worked out, so most of
what you get are warnings. 

There is lots of room for improvement as we move to all CAR 
code, but that will take time. 

I hope to get this to really compile over the weekend. 

At the same time, if anybody wants to take a crack at it, your efforts
are welcome.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@843 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-29 04:33:56 +00:00
Ronald G. Minnich
fd31dee2a6 Closer to compiling. Add the fidvid functions. Continue to remove romcc
legacy. Use constants as much as possible instead of magic numbers. Set 
up common prototypes in an include file. 

The fidvid needs major cleanup but this code is so tricky I don't want 
to start cleanup until I feel it is more or less working. 

Signed-off-by: Ronald G. minnich <rminnich@gmail.com>
Acked-by: Ronald G. minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@841 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-28 17:14:04 +00:00
Ronald G. Minnich
6fd7abea43 Off to bed. I'm done for now.
If anyone wants to review my comments, or maybe even try to fix compile 
issues, have at it :-)

The more I work with the K8 stuff the more impressed I am with the 
people who got it all to go 6 years ago. (and at how much I've forgotten 
but that's another story :=)

If we can get this next step done we're very close to having a working 
initram. 

And, once you have ram and hit stage2, life is just better all around.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@839 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-28 05:41:48 +00:00
Carl-Daniel Hailfinger
08f7cd8688 stage1_main() calling conventions changed to use two parameters instead
of one. This resulted in a stack underflow for i586 and GeodeLX because
the stack was set up for only one parameter in their stage0 asm code.

Untested. Note that this didn't trigger on K8 because the stack setup
there has excessive room, something that should be fixed as well.

This is a band-aid and we should do it right instead. Discussion
follows:

Carl-Daniel Hailfinger wrote:
> Can't we determine init_detected from C code and avoid working with it
> in asm?
> The Fam10h BKDG states in section 2.3.1:
> "determine the type of this reset. One method is to use [The Link
> Initialization Control Register] F0x6C[InitDet] bit."
> The same register is suggested by the Athlon64/Operon BKDG and the
> Fam0fh BKDG.
> 
> That should work from C and make our lives easier. To be honest, I
> have no idea why we use bit 11 of MTRRdefType_MSR for the
> init_detected purpose.

Ron Minnich wrote:
> I plan to change that in future. For now, I want to change as little
> as I can, since this code is so mysterious anyway. I would say let's
> leave it in with a warning of some sort.


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/coreboot-v3@838 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-28 02:55:14 +00:00
Ronald G. Minnich
d130a25c0d This code is not in a working state but I want to get it into the repo
since the box it is on is kinda old. 

I realize it is wrong but it is getting there. 

The k8 startup is a work of genius. I hope at some point it will be a 
work of genius that the rest of us can understand :-)

But it's very impressive code in how it works.

Discussions with AMD: we're in agreement that the structure of this code 
will change for the better, but it's helpful to have this audit trail of 
changes.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@837 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-28 02:37:29 +00:00
Ronald G. Minnich
b0144f19c7 This code is not in a working state but I want to get it into the repo
since the box it is on is kinda old. 

I realize it is wrong but it is getting there. 

The k8 startup is a work of genius. I hope at some point it will be a 
work of genius that the rest of us can understand :-)

But it's very impressive code in how it works.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@836 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-28 02:35:56 +00:00
Carl-Daniel Hailfinger
3e9b43f32f BIST handling. Unless I'm mistaken, we already die() in stage1_main() if
processor BIST is nonzero. Checking it in initram makes no sense. Having
it as global variable is unnecessary as well. Link BIST is an entirely
different animal.

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/coreboot-v3@834 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-28 01:57:14 +00:00
Ronald G. Minnich
268630d472 This is an intermediate state of the initcpus support for k8.
This is the CPU startup code. I'm documenting and cleaning it up 
(removing all support for pre-f2 CPUs) and trying to get it to the point 
that people can see what's going on. This code is needed for k8 initram. 

I'm adding doxygen comments, all errors are mine, and corrections are 
welcome.

Signed-off-by: Ronald G. Minnich <rminnich@gmai.com>
Acked-by: Ronald G. Minnich <rminnich@gmai.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@829 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-27 22:45:18 +00:00
Ronald G. Minnich
96e0fd18bf Fixes to make k8 and others work.
We need the sys_info struct in the global variables struct for 
cache as ram on k8. The sys_info struct is generally very useful
so it makes sense to start accomodating it.  

This patch adds an (empty for now) sys_info struct for geode. 
It add sys_info to the global variables struct. 

It removes global variables from console.h to a new file, 
globalvars.h. Very little code needs to include this file. 

This patch is tested on the dbe62 and simnow with no problems.

k8 compilation is now broken but I'm working on it. I'm going through
the eyeballs-bleed code on k8 startup to document it and with any luck 
we'll have more functionality by the end of today. But it's hard ...

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@828 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-27 22:43:18 +00:00
Ronald G. Minnich
62f8ea8e9b This set of changes gets us much farther, in fact, we get into initram.
This means that basic resource maps are working, initial hypertransport 
setup is working, the amd8111 ISA device is working, config space is 
working for all the parts, we can grow the FLASH part address space to 
more than 64k, and in general we're having a good time. 

Here is the output:
coreboot-3.0.824 Tue Aug 26 22:18:21 PDT 2008 starting... 
(console_loglevel=8)
Choosing fallback boot.
LAR: Attempting to open 'fallback/initram/segment0'.
LAR: Start 0xfff80000 len 0x80000
LAR: normal/option_table@0xfff80000, size 1776
LAR: normal/initram/segment0@0xfff80740, size 24404
LAR: normal/stage2/segment0@0xfff866f0, size 1
LAR: normal/stage2/segment1@0xfff86750, size 18542
LAR: normal/stage2/segment2@0xfff8b010, size 559
LAR: normal/payload/segment0@0xfff8b290, size 18142
LAR: bootblock@0xffff7fc0, size 32768
LAR: File not found!
LAR: Run file fallback/initram/segment0 failed: No such file.
Fallback failed. Try normal boot
LAR: Attempting to open 'normal/initram/segment0'.
LAR: Start 0xfff80000 len 0x80000
LAR: normal/option_table@0xfff80000, size 1776
LAR: normal/initram/segment0@0xfff80740, size 24404
LAR: CHECK normal/initram/segment0 @ 0xfff80740
start 0xfff80790 len 24404 reallen 24404 compression 0 entry 0x00000004 
loadaddress 0x00000000
Entry point is 0xfff80794
Hi there from stage1
stage1 returns
run_file returns with 0

Goal for tomorrow is to get initram done. 

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@826 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-27 05:30:50 +00:00
Carl-Daniel Hailfinger
282ffb535a Enable compilation with -fwhole-program for initram. The setting can be
chosen via Kconfig. Default off.
Depending on the target, this saves between 10% and 20% of initram size.

Compilation still broken for:
- ADL MSM800SEV
- Gigabyte M57SLI

Compilation changed for:
- AMD DB800 (checker doesn't trigger anymore, but we get an unresolved
symbol instead)
- AMD Norwich (same)
(The compilation changes are not bad per se, just a bit misleading. It
seems that gcc 4.2.x is really smart. gcc 4.3.x and later are even
smarter and even fix compilation completely.)

Compilation OK for:
- AMD Serengeti
- Artec DBE61
- Artec DBE62
- PCEngines Alix.1C
- PCEngines Alix.2C3
- 

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/coreboot-v3@825 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-27 01:10:27 +00:00
Carl-Daniel Hailfinger
05095aef07 mainboard_vendor and mainboard_name are constant. Follow that convention
everywhere.
This fixes a bug triggered by combined compilation.

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


git-svn-id: svn://coreboot.org/repository/coreboot-v3@822 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-25 23:54:50 +00:00
Ronald G. Minnich
8f9073449a Fix a simply bug in the find device function.
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@821 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-25 05:11:59 +00:00
Ronald G. Minnich
b2aa6a068d add libstage1.c
Remove pcspeaker until I can resolve space issues. Nobody was using it 
anyway as it happens. It will go back in as soon as we 
1. grow stage1 or
2. reconfigure it again

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@816 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-24 17:47:22 +00:00
Stefan Reinauer
7aed3ac79c For Ron: make BOOTBLOCK_SIZE a variable in the ldscript.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@814 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-24 11:31:19 +00:00
Ronald G. Minnich
1238065ace It's a good idea to set up the segment registers.
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@812 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-24 07:08:17 +00:00
Ronald G. Minnich
c499c2c6bb This now builds a K8 bios image.
Now to start testing.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@810 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-24 06:07:21 +00:00
Ronald G. Minnich
784450567f This now compiles and has a simple error on build to stage2.
Geode still builds fine. 

include/lib.h includes a new function, cycles(), which is a u64 and 
architecture-defined. (Thanks, Plan 9, for a sensible idea). 

All rdtsc removed in favor of cycles()

All other changes are k8 specific. None of these changes adversely 
impact existing platforms AFAICT. 

Goal is that by 31/8/8, we're testing on simnow. 

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@807 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-23 16:51:00 +00:00
Carl-Daniel Hailfinger
aad63ddd8a Improve comments in Fam10h CAR.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@806 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-22 19:42:45 +00:00
Carl-Daniel Hailfinger
e1138c9164 Typo: word duplication.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@803 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-22 11:33:19 +00:00
Carl-Daniel Hailfinger
e8b1edeb4c Add Kconfig for CAR testing code. The code is already in the tree, but
we never used it.

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/coreboot-v3@800 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-22 10:57:34 +00:00
Carl-Daniel Hailfinger
755b36f42e Add objdump and readelf to xcompile and use the results. This kills a
few hardcodes introduced with my checker.

Tested on Linux and OSX.

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


git-svn-id: svn://coreboot.org/repository/coreboot-v3@798 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-22 01:22:21 +00:00
Ronald G. Minnich
4110e67004 Add ddr2 defines.
Continue to upgrade northbridge for k8. 

Add a new standard include (which is optional on some chipsets), 
mainboard.h, which will define important mainboard constants that
1. do not belong in dts
2. do not belong in Kconfig
3. are so tightly tied down to the mainboard they should probably not be 
visible, i.e. the value of the variable is defined by artwork on the 
mainboard, such as the socket type. 

This file resolves the long-standing question of where certain 
mainboard-dependent, compile-time control variables belong. 
We've not resolved this issue in two years so here's how 
we're going to do it. The first use of this is in the definition of 
CPU_SOCKET_TYPE, needed by the northbridge code. 

These changes do not affect existing Geode builds (tested on DBE62). 

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@792 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-21 16:04:41 +00:00
Carl-Daniel Hailfinger
0c255e108b Move console log level management to global variable infrastructure. The
existing code does not work due to the characteristics of stage1. This
has been broken since r729.

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/coreboot-v3@786 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-18 20:13:11 +00:00
Carl-Daniel Hailfinger
1b5c399508 Move stage1 global variable management from asm to C. The stage0 asm
code now unconditionally pushes an empty pointer to the stack which is a
placeholder for the pointer to global variable storage. That pointer and
the global variable storage are initialized in global_vars_init().

Creating global variables is now a piece of cake. You don't even have to
touch any asm code, just add them to struct global_vars.

Build tested on all targets, boot tested on Qemu.

NOTES:
- The code is not yet MP safe, but that's due to v3 not being MP safe in
general (and the comments contradict the code regarding MP features).
- K8 code now works by accident.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Segher Boessenkool <segher@kernel.crashing.org>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@785 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-18 16:54:12 +00:00
Carl-Daniel Hailfinger
67accc1f69 Fix Kconfig dependencies and update defconfigs.
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/coreboot-v3@784 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-18 16:48:27 +00:00
Carl-Daniel Hailfinger
5f2ac21cd8 Move otherwise unused stuff inside CONFIG_PAYLOAD_ELF_LOADER.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@783 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-18 13:03:43 +00:00
Carl-Daniel Hailfinger
1b22622323 Change v3 makefile rules to be source-based, part I.
The individual makefiles in lib/ mainboard/ southbridge/ and superio/
have been changed accordingly and the big glue layer in
arch/x86Makefile has been modified to wrap the new rules correctly.

This pepares the way for additional optimizations during compile and
link time.

Build tested and boot tested on Qemu.

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/coreboot-v3@782 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-18 11:15:43 +00:00
Ronald G. Minnich
7102949d76 We're much closer.
Added a stepping enum to k8.h. This will allow us to do things like this:
if (cpu_stepping(node) < E0)

and so on instead of is_cpu_pre_e0_in_bsp or whatever it is. 

Added and fixed Kconfig variables. 

Broke out northbridge by function, so we can see what goes with what. 

This tree still builds a working DBE62 coreboot that boots a kernel; no harm done to existing ports. 

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@781 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-17 22:18:09 +00:00
Carl-Daniel Hailfinger
9342d1be4e The ABI wrapper from r775 made the SHARED definitions obsolete. They're
not that readable anyway, so kill them and use standard definitions
instead.

Introduce EXPORT_SYMBOL for shared symbols. EXPORT_SYMBOL tells the
compiler to use the standard calling conventions for a given symbol and
not to optimize it away.
Benefits:
- We can later use gcc -combine -fwhole-program without problems.
- It's a correctness fix for some optimizations.
- We could check for duplicated exported functions at link time.
- We could check whether exported functions are linked into initram or
stage2 by accident.
- We could generate usage statistics and possibly optimize away unused
shared functions.
- Through the above points, significant side reductions of 10-40%

Build and boot tested on qemu.
Build tested on all targets.

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/coreboot-v3@780 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-17 21:51:13 +00:00
Carl-Daniel Hailfinger
3392900db9 The decompressors linked into stage0 end up in the variable
DECOMPRESSORS in arch/x86/Makefile. They absolutely do no belong there
because they're not arch specific.
lib/Makefile has a variable COMPRESSORS with identical content, but that
variable is completely unused. Move DECOMPRESSORS to lib/Makefile and
kill the unused one.

Build and boot tested on qemu.

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/coreboot-v3@778 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-17 14:21:50 +00:00
Carl-Daniel Hailfinger
48fe3ab5ef Current v3 code has a big problem: Shared functions.
Calling non-PIC code from PIC code needs an ABI wrapper and we don't
provide one. Our trick with function pointers is exceedingly fragile:
- it depends on gcc not being clever enough
- it forces us to compile all initram source files in one go
- parallelizing initram compilation breaks the code
- compiling one initram source file at a time breaks the code
- enabling higher optimizations breaks the code
- enabling -fwhole-program breaks the code
- declaring the function pointers const breaks the code
- it's an undocumented side effect of gcc which will go away
- we need excessively ugly shared function wrappers
- the shared function wrappers had more than their fair share of bugs
- almost nobody understands the wrappers completely
- Segher warns against them: "So why do you think this should work?
You're telling it to link PIC to non-PIC. Did you read the manual? It's
just not allowed. It cannot ever work."

Kill the SHARED wrappers and use a real ABI wrapper.
The wrapper code is autogenerated on demand.
Any function compiled into stage0 is now shared by default, yet the size
and code generation of stage0/1/2 code are unchanged. Initram code size
does decrease quite a bit and the difficulty of creating shared
functions is now zero.

The patch includes extensive documentation about the inner workings of
the new wrappers and the reasons why they look like this.

Build and boot tested on qemu.
Build tested on all targets.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>

Ron says:
Wow. we've need this fix for a long time.

Acked-by: Ronald G. Minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@775 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-16 00:10:25 +00:00
Ronald G. Minnich
79a26f9247 Some corrections to the 8132.
Add the 8152. 

Add a config variable ACPI_TABLE

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@772 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-15 21:40:20 +00:00
Carl-Daniel Hailfinger
07f3009f43 Introduce a generic global variable storage mechanism and switch the
printk buffer management to it.

Build tested and boot tested and result tested on Qemu.

Adding a new global variable is not as easy as it looks, but the
comments in the code should be good enough to tell you how.

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/coreboot-v3@760 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-14 09:25:58 +00:00
Ronald G. Minnich
bfc217a8ce This is the current state of my mcp55 commits. I realize I overload
the system a bit so I am going to let this one get acked and I won't 
push
any more patches until this goes through. 

Add lpc support. 

Make things compile lpc.

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

And also: 
That code is really buggy. I wonder how/if it ever worked in v2. If you
address the comments below, this is
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>

Comments (mostly) addressed. That said, I don't change functional code 
that I know works -- we can fix that later. The ops_pci is addressed by 
Carl-Daniel's patch. 


git-svn-id: svn://coreboot.org/repository/coreboot-v3@756 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-13 15:41:04 +00:00