3 * Copyright (C) 2007 Advanced Micro Devices
10 #include <device/pci_def.h>
12 #include <device/pnp_def.h>
13 #include <arch/romcc_io.h>
15 #include "pc80/serial.c"
16 #include "arch/i386/lib/console.c"
17 #include "ram/ramtest.c"
18 #include "cpu/x86/bist.h"
19 #include "cpu/x86/msr.h"
20 #include <cpu/amd/lxdef.h>
21 #include <cpu/amd/geode_post_code.h>
22 #include "southbridge/amd/cs5536/cs5536.h"
24 #define POST_CODE(x) outb(x, 0x80)
26 #include "southbridge/amd/cs5536/cs5536_early_smbus.c"
27 #include "southbridge/amd/cs5536/cs5536_early_setup.c"
29 static inline int spd_read_byte(unsigned device, unsigned address)
31 return smbus_read_byte(device, address);
34 #define ManualConf 0 /* Do automatic strapped PLL config */
35 #define PLLMSRhi 0x00001490 /* manual settings for the PLL */
36 #define PLLMSRlo 0x02000030
39 #include "northbridge/amd/lx/raminit.h"
40 #include "northbridge/amd/lx/pll_reset.c"
41 #include "northbridge/amd/lx/raminit.c"
42 #include "sdram/generic_sdram.c"
43 #include "cpu/amd/model_lx/cpureginit.c"
44 #include "cpu/amd/model_lx/syspreinit.c"
46 static void msr_init(void)
49 /* Setup access to the cache for under 1MB. */
51 msr.lo = 0x1000A000; /* 0-A0000 write back */
52 wrmsr(CPU_RCONF_DEFAULT, msr);
54 msr.hi = 0x0; /* write back */
56 wrmsr(CPU_RCONF_A0_BF, msr);
57 wrmsr(CPU_RCONF_C0_DF, msr);
58 wrmsr(CPU_RCONF_E0_FF, msr);
60 /* Setup access to the cache for under 640K. Note MC not setup yet. */
63 wrmsr(MSR_GLIU0 + 0x20, msr);
67 wrmsr(MSR_GLIU0 + 0x21, msr);
71 wrmsr(MSR_GLIU1 + 0x20, msr);
75 wrmsr(MSR_GLIU1 + 0x21, msr);
79 static void mb_gpio_init(void)
81 /* Early mainboard specific GPIO setup */
84 void cache_as_ram_main(void)
88 static const struct mem_controller memctrl [] = {
89 {.channel0 = {(0xa<<3)|0, (0xa<<3)|1}}
97 /* NOTE: must do this AFTER the early_setup!
98 * it is counting on some early MSR setup
101 /* cs5536_disable_internal_uart disable them for now, set them up later...*/
102 cs5536_setup_onchipuart(); /* if debug. real setup done in chipset init via config.lb */
107 pll_reset(ManualConf);
111 sdram_initialize(1, memctrl);
113 /* Check all of memory */
114 /*ram_check(0x00000000, 640*1024);*/
116 /* Memory is setup. Return to cache_as_ram.inc and continue to boot */