Same problem with T420 and i5-3380 CPU.
Сommenting lines 210 and 215:
printram("OTHP Workaround [%x] = %x\n", addr, reg);
and
  printram("OTHP [%x] = %x\n", addr, reg);
in src/northbridge/intel/sandybridge/raminit_common.c (function static void dram_odt_stretch)
will resolve the error.
 
16.08.2018, 09:27, "Andreas Restle" <andreas.restle@gmail.com>:
Building coreboot for Thinkpad W520 currently fails with the following error:
 
    CC         romstage/northbridge/intel/sandybridge/raminit_common.o
In file included from src/northbridge/intel/sandybridge/raminit_common.c:18:
src/northbridge/intel/sandybridge/raminit_common.c: In function 'dram_odt_stretch':
src/northbridge/intel/sandybridge/raminit_common.c:211:49: error: 'reg' undeclared (first use in this function); did you mean 'prog'?
   printram("OTHP Workaround [%x] = %x\n", addr, reg);
                                                 ^~~
src/include/console/console.h:65:31: note: in definition of macro 'printk'
  do { do_printk(LEVEL, fmt, ##args); } while (0)
                               ^~~~
src/northbridge/intel/sandybridge/raminit_common.c:211:3: note: in expansion of macro 'printram'
   printram("OTHP Workaround [%x] = %x\n", addr, reg);
   ^~~~~~~~
src/northbridge/intel/sandybridge/raminit_common.c:211:49: note: each undeclared identifier is reported only once for each function it appears in
   printram("OTHP Workaround [%x] = %x\n", addr, reg);
                                                 ^~~
src/include/console/console.h:65:31: note: in definition of macro 'printk'
  do { do_printk(LEVEL, fmt, ##args); } while (0)
                               ^~~~
src/northbridge/intel/sandybridge/raminit_common.c:211:3: note: in expansion of macro 'printram'
   printram("OTHP Workaround [%x] = %x\n", addr, reg);
   ^~~~~~~~
make: *** [Makefile:339: build/romstage/northbridge/intel/sandybridge/raminit_common.o] Fehler 1
 
 
I've been using coreboot on the W520 for some time now, thanks to Charlotteplusplus and  Nico Rikken (thank you both!). This is the first time I encountered this error.
 
Branch master, freshly pulled of git. Thinkpad W520, 32GB Ram, i7-3940XM (Ivybridge).
 
Any help is much appreciated.
 
--
<°)))><
Andreas Restle
andreas.restle@gmail.com
,--
coreboot mailing list: coreboot@coreboot.org
https://mail.coreboot.org/mailman/listinfo/coreboot