[coreboot] [PATCH] Kill dead code in Intel E7520 raminit_test

Stefan Reinauer stepan at coresystems.de
Sun Oct 4 21:13:58 CEST 2009

Carl-Daniel Hailfinger wrote:
> /src/northbridge/intel/e7520/raminit_test.c is _the_ file which caused
> the stongest WTF!?! reaction ever when I read it.
> If redefines pci_read_config*() and pci_write_config*() as simple memory
> accesses to a local array without _any_ side effects.
> Same for pci_locate_device() which essentially operates on the fake
> pci_read_config*().
> Its rdmsr() function is hardcoded to return zero and wrmsr() is empty.
> It has fake SPD arrays which are ignored.
> spd_read_byte() accesses the fake SPD arrays, then the result of
> spd_read_byte is discarded.
> It messes with setjmp() and longjmp(), but basically only uses them to
> hlt() upon invalid parameters to log2().
> It calls raminit_main() at least 1 times and at most 73 times.
> It uses AMD Athlon dualcore PCI BDF in sdram_initialize() although it is
> an Intel chipset.
> It writes to stdout and stderr. (Yes, really.)
> Looking at this file is like watching a mass freeway pile-up. It's
> horrible, but you can't stop looking.
> Fix the majority of WTFs.
> Can we just rip this file out?
> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Was this ever merged?

Acked-by: Stefan Reinauer <stepan at coresystems.de>

And, yes, I think we should rip it out.

coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info at coresystems.dehttp://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866

More information about the coreboot mailing list