Commit graph

840 commits

Author SHA1 Message Date
Stefan Reinauer
acf7535747 fix typo
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@840 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-28 07:15:43 +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
Ronald G. Minnich
b4117a2dc3 Fix for globals for qemu.
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@835 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-28 02:32:27 +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
Carl-Daniel Hailfinger
4af8efa416 Documentation improvement for sys_info.
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@833 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-28 01:31:24 +00:00
Carl-Daniel Hailfinger
0aa3dcb0a2 Emergency fixup for r828 to at least get it to compile for one target
(DBE62).

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@832 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-28 01:21:18 +00:00
Carl-Daniel Hailfinger
e6dc58b16f Improve global variable documentation.
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@831 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-27 23:15:28 +00:00
Carl-Daniel Hailfinger
27b2fb4f07 Every GeodeLX target already has spd_read_byte in
mainboard/$VENDOR/$BOARD/initram.c. It's pointless to have it in the
southbridge code as well.
Kill it in the southbridge code and use mainboard code only.

Thanks to Segher for rediscovering this bug.

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@830 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-27 22:58:04 +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
Carl-Daniel Hailfinger
e5fcf247f2 gcc -fwhole-program needs to mark any function which is used outside the
current compilation unit to be marked as externally_visible. We have
EXPORT_SYMBOL exactly for that purpose.

This applies to the following symbols used by x86emu and/or vm86:
- pci_read_config8
- pci_read_config16
- pci_read_config32
- pci_write_config8
- pci_write_config16
- pci_write_config32
- dev_find_pci_device
- dev_find_slot
It also applies to the main entry point of stage2:
- stage2

With this patch, I can use -fwhole-program for stage2 without any
problems. For standard compilation, this is a noop.

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@827 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-27 22:29:38 +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
Ronald G. Minnich
df78385663 1. Add call to stage 1 ht setup for mainboard
2. add support for same, brought over from v2.

Still no luck on 8111 ISA however. What are we missing?
The symptom is simple: Device 0:b.0 does not appear in the PCI list, so 
device with vid/did 1022/7468 is not there, so we can not enable 5 MiB 
flash addressing.

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@824 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-26 22:12:02 +00:00
Ronald G. Minnich
6f251c1d25 Set up resources for the mainboard.
but the 8111 ISA device is still not visible in 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@823 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-26 18:01:19 +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
8a9d1f2b24 Grow rom space. This now gets a triple fault but I am hoping some smart
person can fix it.

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@820 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-24 19:55:45 +00:00
Carl-Daniel Hailfinger
2b9919965b Fix a type warning in printf.
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@819 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-24 18:20:31 +00:00
Ronald G. Minnich
7d7e653fce I can't believe I forgot all these.
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@818 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-24 18:19:40 +00:00
Ronald G. Minnich
a8f0b11b87 it's my lucky day. I deleted a file and don't need it.
This should get you all to building ok.

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@817 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-24 18:11:11 +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
Carl-Daniel Hailfinger
e797704a0e Missing include.
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@815 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-24 17:10:25 +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
Stefan Reinauer
9fc4de30d2 needs to be const, or the segment checker will bail out. (trivial)
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/repository/coreboot-v3@813 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-24 11:29:11 +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
081602b211 More sensible way to conditionally include hypertransport.c
Builds both K8 and Geode bioses with no trouble.

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


git-svn-id: svn://coreboot.org/repository/coreboot-v3@811 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-24 06:16:03 +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
159354e6ba If you get a warning, it's because you SHOULD be getting a warning.
next step is to fix up this:
   LAR     build/coreboot.rom
Bootblock coreboot.bootblock does not appear to be a bootblock.
Error adding the bootblock to the LAR.
make: *** [/home/rminnich/src/bios/coreboot-v3/build/coreboot.rom] Error 
1
make: exit 2

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@809 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-24 03:27:28 +00:00
Ronald G. Minnich
f28a44eb48 This now compiles (with many warnings but ...) and tries to build a rom
image, and fails: 
  LAR     build/coreboot.rom
Bootblock coreboot.bootblock does not appear to be a bootblock.
Error adding the bootblock to the LAR.
make: *** [/home/rminnich/src/bios/coreboot-v3/build/coreboot.rom] Error 
1

Next step is to get rid of all warnings that are not #warning. 

Then it is on to simnow. 

Anyone who wants to work on the warnings is most welcome to. 

DBE62 still builds with no problems. 

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@808 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-24 02:59:05 +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
87914c3169 The ARRAY_SIZE macro is convenient, yet mostly unused. Switch lots of
code to use it. That makes the code more readable and also less
error-prone.

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@805 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-22 18:24:53 +00:00
Ronald G. Minnich
b73481741f This is getting to the link phase. Still won't build as we don't have
dqs timing file compiled in yet. 

Per discussion with YingHai Lu, we are only going to support F2 and 
later CPUs. This will simplify more code. 

I realize this code needs work, but it is in v2, and cleanup will get 
easier once we have the baseline. 

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@804 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-22 16:48:44 +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
88c1727722 i440bxemulation is missing the hole between 640k and 768k for VGA
(0xA0000-0xAFFFF) and text mode (0xB8000-0xBFFFF).

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@802 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-22 11:29:30 +00:00
Carl-Daniel Hailfinger
70c96e3919 Improve/fix PCI device doxygen comments.
Thanks to Ron for explaining this.

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@801 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-22 11:10:04 +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
358403335f smbus_delay() performs its own inb(0x80). We can use the generic
udelay() instead which does the same, and achieve better abstraction.

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@799 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-22 10:56:36 +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
Carl-Daniel Hailfinger
730c94aea0 Look for statictree.h in the standard search path.
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@797 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-22 01:19:25 +00:00
Carl-Daniel Hailfinger
ff03939b79 CS5536 UART: better depbug prints.
This is the part of the acked patch which was to become r649 but missed
in the check in.
I'm reusing the signoff and ack.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
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@796 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-22 00:34:28 +00:00
Carl-Daniel Hailfinger
b23508f4cd Make the section checker executable.
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@795 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-21 19:38:32 +00:00
Carl-Daniel Hailfinger
df65052e93 v3 does not handle .data* and .bss sections in stage1 and initram. We
simply hope they are unused/empty and will get runtime crashes/
corruption/malfunction if they are not empty. Same applies to any
sections with relocation entries which can not be resolved during
link time.

Check for the emptiness of these sections and abort the build on error.
This triggers on all stage1/initram global variables which are not
declared the right way. It also triggers on local static variables.

Features of this checker:
- It doesn't only check for non-empty .data and .bss, but also for
unknown sections which would be a problem.
- It gives you the offending filename, the section and the variable
  name.
- It won't stop after the first error and will tell you about all errors
for a given file list.

This found a long-standing bug introduced in r729 and fixed in r786.
It also broke the build of every Geode target in the v3 tree because
they had multiple bugs. And it broke the build of the K8 code because
of a bug there.
Other fixes resulting from this checker are in r790 and r791.

Ron already fixed some of the bugs uncovered by this checker.

Tested for all possible variations of .data and .bss usage.

Sample output follows:
  CC      build/coreboot.initram (XIP)
  CHECK   initram (non-empty writable/allocatable sections)
build/coreboot.initram_partiallylinked.o: section .data: foo1
build/coreboot.initram_partiallylinked.o: section .bss: foo2
build/coreboot.initram_partiallylinked.o: section .data.rel.ro.local:
msrnames.2746
make: *** [build/coreboot.initram] Error 1

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@794 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-21 17:43:04 +00:00
Carl-Daniel Hailfinger
f1321e1ded Move GeodeLX register name array to .rodata and make my checker happy.
This one is far from obvious, so let me explain:
Basically, *msrnames[] is an array of pointers (strings) and pointers
need relocation. That's why they end up in .data.rel.ro.local and make
lots of trouble.
This should fix the crash Ron was seeing when register name printing was
enabled.

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@793 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-21 17:34:06 +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
Ronald G. Minnich
4bb450cfa3 Emergency patch so that section checker won't bounce option tables.
Also gets rid of hard-codes in fwrite for strings that might, in future,
vary.

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@791 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-08-21 15:49:29 +00:00