Following patch fixes the XIP computation issue. I removed the normal image
[coreboot.git] / src / mainboard / asus / m2v-mx_se / cache_as_ram_auto.c
index ccdf1fd0b8821a4b871b3f7510c2ae18434b06c2..15dcda5ec1dcf78dda3f4b7cd4099c469f965349 100644 (file)
@@ -47,6 +47,7 @@ unsigned int get_sbdn(unsigned bus);
 /* #define DEBUG_SMBUS 1 */
 
 #include <stdint.h>
+#include <string.h>
 #include <device/pci_def.h>
 #include <arch/io.h>
 #include <device/pnp_def.h>
@@ -61,9 +62,6 @@ unsigned int get_sbdn(unsigned bus);
 #include "northbridge/amd/amdk8/raminit.h"
 #include "cpu/amd/model_fxx/apic_timer.c"
 #include "lib/delay.c"
-#if CONFIG_USE_INIT == 0
-#include "lib/memcpy.c"
-#endif
 #include "cpu/x86/lapic/boot_cpu.c"
 #include "northbridge/amd/amdk8/reset_test.c"
 #include "northbridge/amd/amdk8/debug.c"
@@ -90,17 +88,20 @@ static inline int spd_read_byte(unsigned device, unsigned address)
        return smbus_read_byte(device, address);
 }
 
-#define K8_4RANK_DIMM_SUPPORT 1
+void activate_spd_rom(const struct mem_controller *ctrl)
+{
+}
 
+#define K8_4RANK_DIMM_SUPPORT 1
 
 
+#include "southbridge/via/k8t890/k8t890_early_car.c"
 #include "northbridge/amd/amdk8/amdk8.h"
 #include "northbridge/amd/amdk8/raminit_f.c"
 #include "northbridge/amd/amdk8/coherent_ht.c"
 #include "northbridge/amd/amdk8/incoherent_ht.c"
 #include "sdram/generic_sdram.c"
 #include "cpu/amd/dualcore/dualcore.c"
-#include "southbridge/via/k8t890/k8t890_early_car.c"
 #include "cpu/amd/car/copy_and_run.c"
 #include "cpu/amd/car/post_cache_as_ram.c"
 #include "cpu/amd/model_fxx/init_cpus.c"
@@ -122,10 +123,6 @@ static void ldtstop_sb(void)
 #include "cpu/amd/model_fxx/fidvid.c"
 #include "northbridge/amd/amdk8/resourcemap.c"
 
-void activate_spd_rom(const struct mem_controller *ctrl)
-{
-}
-
 #warning No hard_reset implemented for this board!
 void hard_reset(void)
 {
@@ -165,64 +162,10 @@ void sio_init(void)
 
 }
 
-#if USE_FALLBACK_IMAGE == 1
-
-void failover_process(unsigned long bist, unsigned long cpu_init_detectedx)
-{
-       /* unsigned last_boot_normal_x = last_boot_normal(); */
-       /* FIXME */
-       unsigned last_boot_normal_x = 1;
-
-       sio_init();
-       it8712f_enable_serial(SERIAL_DEV, TTYS0_BASE);
-       it8712f_kill_watchdog();
-       uart_init();
-       console_init();
-       enable_rom_decode();
-
-       print_info("now booting... fallback\r\n");
-
-       /* Is this a CPU only reset? Or is this a secondary CPU? */
-       if ((cpu_init_detectedx) || (!boot_cpu())) {
-               if (last_boot_normal_x)
-                       goto normal_image;
-               else
-                       goto fallback_image;
-       }
-
-       /* Nothing special needs to be done to find bus 0. */
-       /* Allow the HT devices to be found. */
-       enumerate_ht_chain();
-
-       /* Is this a deliberate reset by the BIOS? */
-       if (bios_reset_detected() && last_boot_normal_x) {
-               goto normal_image;
-       }
-       /* This is the primary CPU, how should I boot? */
-       else if (do_normal_boot()) {
-               goto normal_image;
-       } else {
-               goto fallback_image;
-       }
-
-normal_image:
-       /* print_info("JMP normal image\r\n"); */
-
-       __asm__ __volatile__("jmp __normal_image":
-                            :"a" (bist), "b" (cpu_init_detectedx));
-
-fallback_image:
-       ;
-}
-#endif
-
 void real_main(unsigned long bist, unsigned long cpu_init_detectedx);
 
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
-#if USE_FALLBACK_IMAGE == 1
-       failover_process(bist, cpu_init_detectedx);
-#endif
        real_main(bist, cpu_init_detectedx);
 }
 
@@ -242,10 +185,12 @@ void real_main(unsigned long bist, unsigned long cpu_init_detectedx)
        struct sys_info *sysinfo =
            (DCACHE_RAM_BASE + DCACHE_RAM_SIZE - DCACHE_RAM_GLOBAL_VAR_SIZE);
        char *p;
+       u8 reg;
 
        sio_init();
        it8712f_enable_serial(SERIAL_DEV, TTYS0_BASE);
        it8712f_kill_watchdog();
+       it8712f_enable_3vsbsw();
        uart_init();
        console_init();
        enable_rom_decode();
@@ -299,7 +244,6 @@ void real_main(unsigned long bist, unsigned long cpu_init_detectedx)
        enable_fid_change();
        print_debug("after enable_fid_change\r\n");
 
-       /* FIXME does not work yet */
        init_fidvid_bsp(bsp_apicid);
 
        /* Stop the APs so we can start them later in init. */