3 #include <device/pci_def.h>
5 #include <device/pnp.h>
6 #include <arch/romcc_io.h>
7 #include <arch/smp/lapic.h>
8 #include "option_table.h"
9 #include "pc80/mc146818rtc_early.c"
10 #include "pc80/serial.c"
11 #include "arch/i386/lib/console.c"
12 #include "ram/ramtest.c"
13 #include "northbridge/amd/amdk8/incoherent_ht.c"
14 #include "southbridge/amd/amd8111/amd8111_early_smbus.c"
15 #include "northbridge/amd/amdk8/raminit.h"
16 #include "cpu/k8/apic_timer.c"
17 #include "lib/delay.c"
18 #include "cpu/p6/boot_cpu.c"
19 #include "northbridge/amd/amdk8/reset_test.c"
21 #include "northbridge/amd/amdk8/cpu_rev.c"
22 #include "superio/NSC/pc87360/pc87360_early_serial.c"
26 static void hard_reset(void)
31 pci_write_config8(PCI_DEV(0, 0x05, 3), 0x41, 0xf1);
36 static void soft_reset(void)
39 pci_write_config8(PCI_DEV(0, 0x05, 0), 0x47, 1);
42 static void memreset_setup(void)
44 if (is_cpu_pre_c0()) {
45 /* Set the memreset low */
46 outb((0 << 7)|(0 << 6)|(0<<5)|(0<<4)|(1<<2)|(0<<0), SMBUS_IO_BASE + 0xc0 + 28);
47 /* Ensure the BIOS has control of the memory lines */
48 outb((0 << 7)|(0 << 6)|(0<<5)|(0<<4)|(1<<2)|(0<<0), SMBUS_IO_BASE + 0xc0 + 29);
51 /* Ensure the CPU has controll of the memory lines */
52 outb((0 << 7)|(0 << 6)|(0<<5)|(0<<4)|(1<<2)|(1<<0), SMBUS_IO_BASE + 0xc0 + 29);
56 static void memreset(int controllers, const struct mem_controller *ctrl)
58 if (is_cpu_pre_c0()) {
60 /* Set memreset_high */
61 outb((0<<7)|(0<<6)|(0<<5)|(0<<4)|(1<<2)|(1<<0), SMBUS_IO_BASE + 0xc0 + 28);
66 static unsigned int generate_row(uint8_t node, uint8_t row, uint8_t maxnodes)
68 /* since the AMD Solo is a UP only machine, we can
69 * always return the default row entry value
71 return 0x00010101; /* default row entry */
74 static inline void activate_spd_rom(const struct mem_controller *ctrl)
79 static inline int spd_read_byte(unsigned device, unsigned address)
81 return smbus_read_byte(device, address);
85 #include "northbridge/amd/amdk8/raminit.c"
86 #include "northbridge/amd/amdk8/coherent_ht.c"
87 #include "sdram/generic_sdram.c"
89 static void main(void)
91 static const struct mem_controller cpu[] = {
94 .f0 = PCI_DEV(0, 0x18, 0),
95 .f1 = PCI_DEV(0, 0x18, 1),
96 .f2 = PCI_DEV(0, 0x18, 2),
97 .f3 = PCI_DEV(0, 0x18, 3),
98 .channel0 = { (0xa<<3)|0, (0xa<<3)|1, 0, 0 },
99 .channel1 = { 0, 0, 0, 0 },
105 if (cpu_init_detected()) {
106 asm("jmp __cpu_reset");
110 distinguish_cpu_resets();
112 print_err("This LinuxBIOS image is built for UP only.\n");
115 pc87360_enable_serial(SIO_BASE, TTYS0_BASE);
118 setup_default_resource_map();
119 needs_reset = setup_coherent_ht_domain();
120 needs_reset = ht_setup_chain(PCI_DEV(0, 0x18, 0), 0x80);
122 print_info("ht reset -");
130 dump_spd_registers(&cpu[0]);
133 sdram_initialize(sizeof(cpu)/sizeof(cpu[0]), cpu);
139 dump_pci_device(PCI_DEV(0, 0x18, 2));
142 /* Check all of memory */
145 msr = rdmsr(TOP_MEM);
146 print_debug("TOP_MEM: ");
147 print_debug_hex32(msr.hi);
148 print_debug_hex32(msr.lo);
152 ram_check(0x00000000, msr.lo);
155 static const struct {
156 unsigned long lo, hi;
158 /* Check 16MB of memory @ 0*/
159 { 0x00000000, 0x01000000 },
162 for(i = 0; i < sizeof(check_addrs)/sizeof(check_addrs[0]); i++) {
163 ram_check(check_addrs[i].lo, check_addrs[i].hi);