[coreboot] k8 and memory training

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Mon Sep 1 01:45:43 CEST 2008


On 31.08.2008 08:46, ron minnich wrote:
> see http://coreboot.pastebin.com/m354e6401
>
> I can't really tell if it's working.
>   

I looked at the log and we're clearly doing something wrong odd. The
execution order simply does not make that much sense.

arch/x86/stage1.c:stage1_main()
{
  //stuff
  global_vars_init();
  hardware_stage1();
  uart_init();  // initialize serial port
  /* Exactly from now on we can use printk to the serial port.
   * Celebrate this by printing a LB banner.
   */
  console_init();
  //more stuff
}

mainboard/amd/serengeti/stage1.c:hardware_stage1()
{
  printk(BIOS_ERR, "Stage1: enable rom ...\n");
  max = ARRAY_SIZE(register_values);
  setup_resource_map(register_values, max);
  enumerate_ht_chain();
  amd8111_enable_rom();
  printk(BIOS_ERR, "Done.\n");
  w83627hf_enable_serial(0x2e, SERIAL_DEV, SERIAL_IOBASE);
  post_code(POST_START_OF_MAIN);
}

Does it only look odd to me that we set up and initialize the serial
port only after we already have printed lots of stuff which may never
see the light of the day?
Three possible solutions:
1. Use the printk buffer to buffer messages until serial is fully set up.
2. Check a global variable which holds the status of serial and start
using serial only after it has been set up completely. (We may need that
anyway.)
3. Introduce hardware_early_stage1 which only sets up the console and
anything needed by the console.

My personal favourite is solution 3, with the additional option of
solution 2 in case some serial chips are sensitive to usage before
initialization.

Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/





More information about the coreboot mailing list