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@gmx.net
Was this ever merged?
Acked-by: Stefan Reinauer stepan@coresystems.de
And, yes, I think we should rip it out.