Enable mahogany_fam10 and Kino family 10h to run the SB HT link at the expected HT3...
[coreboot.git] / src / mainboard / supermicro / h8qme_fam10 / romstage.c
index 95dd659b7f7f4062b80ee2466640b9a66ccb7039..dbef8e9e106ce037130fc03dc5b5fe74d9a64f44 100644 (file)
 #include <lib.h>
 #include <spd.h>
 #include <cpu/amd/model_10xxx_rev.h>
-#include "southbridge/nvidia/mcp55/mcp55_early_smbus.c" // for enable the FAN
+#include "southbridge/nvidia/mcp55/early_smbus.c" // for enable the FAN
 #include "northbridge/amd/amdfam10/raminit.h"
 #include "northbridge/amd/amdfam10/amdfam10.h"
 #include "cpu/amd/model_10xxx/apic_timer.c"
 #include "lib/delay.c"
 #include "cpu/x86/lapic/boot_cpu.c"
 #include "northbridge/amd/amdfam10/reset_test.c"
-#include "superio/winbond/w83627hf/w83627hf_early_serial.c"
-#include "superio/winbond/w83627hf/w83627hf_early_init.c"
+#include "superio/winbond/w83627hf/early_serial.c"
+#include "superio/winbond/w83627hf/early_init.c"
 #include "cpu/x86/bist.h"
 #include "northbridge/amd/amdfam10/debug.c"
 #include "cpu/x86/mtrr/earlymtrr.c"
 #include "northbridge/amd/amdfam10/setup_resource_map.c"
-#include "southbridge/nvidia/mcp55/mcp55_early_ctrl.c"
+#include "southbridge/nvidia/mcp55/early_ctrl.c"
 
 #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)
+#define DUMMY_DEV PNP_DEV(0x2e, 0)
 
 static inline void activate_spd_rom(const struct mem_controller *ctrl)
 {
@@ -66,14 +67,18 @@ static inline int spd_read_byte(unsigned device, unsigned address)
 
 #include "northbridge/amd/amdfam10/amdfam10.h"
 #include "northbridge/amd/amdfam10/raminit_sysinfo_in_ram.c"
-#include "northbridge/amd/amdfam10/amdfam10_pci.c"
+#include "northbridge/amd/amdfam10/pci.c"
 #include "resourcemap.c"
 #include "cpu/amd/quadcore/quadcore.c"
-#include "southbridge/nvidia/mcp55/mcp55_early_setup_ss.h"
-#include "southbridge/nvidia/mcp55/mcp55_early_setup_car.c"
+#include "southbridge/nvidia/mcp55/early_setup_ss.h"
+#include "southbridge/nvidia/mcp55/early_setup_car.c"
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/microcode/microcode.c"
+
+#if CONFIG_UPDATE_CPU_MICROCODE
 #include "cpu/amd/model_10xxx/update_microcode.c"
+#endif
+
 #include "cpu/amd/model_10xxx/init_cpus.c"
 #include "northbridge/amd/amdfam10/early_ht.c"
 
@@ -176,10 +181,8 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 
   post_code(0x32);
 
-       pnp_enter_ext_func_mode(SERIAL_DEV);
-       pnp_write_config(SERIAL_DEV, 0x24, 0x84 | (1 << 6));
-       w83627hf_enable_dev(SERIAL_DEV, CONFIG_TTYS0_BASE);
-       pnp_exit_ext_func_mode(SERIAL_DEV);
+       w83627hf_set_clksel_48(DUMMY_DEV);
+       w83627hf_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
 
        uart_init();
        console_init();
@@ -198,7 +201,9 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
  /* Setup sysinfo defaults */
  set_sysinfo_in_ram(0);
 
+#if CONFIG_UPDATE_CPU_MICROCODE
  update_microcode(val);
+#endif
  post_code(0x33);
 
  cpuSetAMDMSR();
@@ -290,3 +295,37 @@ post_code(0x40);
  post_cache_as_ram();  // BSP switch stack to ram, copy then execute LB.
  post_code(0x42);  // Should never see this post code.
 }
+
+/**
+ * BOOL AMD_CB_ManualBUIDSwapList(u8 Node, u8 Link, u8 **List)
+ * Description:
+ *     This routine is called every time a non-coherent chain is processed.
+ *     BUID assignment may be controlled explicitly on a non-coherent chain. Provide a
+ *     swap list. The first part of the list controls the BUID assignment and the
+ *     second part of the list provides the device to device linking.  Device orientation
+ *     can be detected automatically, or explicitly.  See documentation for more details.
+ *
+ *     Automatic non-coherent init assigns BUIDs starting at 1 and incrementing sequentially
+ *     based on each device's unit count.
+ *
+ * Parameters:
+ *     @param[in]  u8  node    = The node on which this chain is located
+ *     @param[in]  u8  link    = The link on the host for this chain
+ *     @param[out] u8** list   = supply a pointer to a list
+ *     @param[out] BOOL result = true to use a manual list
+ *                               false to initialize the link automatically
+ */
+BOOL AMD_CB_ManualBUIDSwapList (u8 node, u8 link, const u8 **List)
+{
+       static const u8 swaplist[] = { 0xFF, CONFIG_HT_CHAIN_UNITID_BASE, CONFIG_HT_CHAIN_END_UNITID_BASE, 0xFF };
+       /* If the BUID was adjusted in early_ht we need to do the manual override */
+       if ((CONFIG_HT_CHAIN_UNITID_BASE != 0) && (CONFIG_HT_CHAIN_END_UNITID_BASE != 0)) {
+               printk(BIOS_DEBUG, "AMD_CB_ManualBUIDSwapList()\n");
+               if ((node == 0) && (link == 0)) {       /* BSP SB link */
+                       *List = swaplist;
+                       return 1;
+               }
+       }
+
+       return 0;
+}