Following patch adds support for the ACPI resume on Asus M2V-MX SE. The ACPI
authorRudolf Marek <r.marek@assembler.cz>
Mon, 13 Apr 2009 18:37:17 +0000 (18:37 +0000)
committerRudolf Marek <r.marek@assembler.cz>
Mon, 13 Apr 2009 18:37:17 +0000 (18:37 +0000)
code just blinks the leds. The motherboard resources are use to reserve coreboot
used memory.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Acked-by: Peter Stuge <peter@stuge.se>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4103 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

src/mainboard/asus/m2v-mx_se/Options.lb
src/mainboard/asus/m2v-mx_se/cache_as_ram_auto.c
src/mainboard/asus/m2v-mx_se/dsdt.asl
src/mainboard/asus/m2v-mx_se/mainboard.c

index 974903b81b618f9faab30546a53af34dc58bcf70..c388831cc99ff532ddb0104487285dcee983cc6f 100644 (file)
@@ -49,6 +49,7 @@ uses CONFIG_LB_MEM_TOPK
 uses HAVE_ACPI_TABLES
 uses HAVE_MAINBOARD_RESOURCES
 uses HAVE_HIGH_TABLES
+uses HAVE_ACPI_RESUME
 uses HAVE_LOW_TABLES
 uses LB_CKS_RANGE_START
 uses LB_CKS_RANGE_END
@@ -116,6 +117,7 @@ default HAVE_ACPI_TABLES = 1
 default HAVE_MAINBOARD_RESOURCES = 1
 default HAVE_HIGH_TABLES = 1
 default HAVE_LOW_TABLES = 0
+default HAVE_ACPI_RESUME = 1
 
 # 1G memory hole
 # bx_b001- default K8_HW_MEM_HOLE_SIZEK = 0x100000
@@ -157,9 +159,9 @@ default ROM_IMAGE_SIZE = 64 * 1024
 default STACK_SIZE = 8 * 1024
 default HEAP_SIZE = 256 * 1024
 # More 1M for pgtbl.
-default CONFIG_LB_MEM_TOPK = 2048
+default CONFIG_LB_MEM_TOPK = 32768
 # to 1MB
-default _RAMBASE = 0x100000
+default _RAMBASE = 0x1F00000
 # default USE_OPTION_TABLE = !USE_FALLBACK_IMAGE
 default CONFIG_ROM_PAYLOAD = 1
 default CC = "$(CROSS_COMPILE)gcc -m32"
index 540dff9fda1906868a76d9896b251ff3f819d017..f6400947116e76eb9b2f9b9ec299d5956978654d 100644 (file)
@@ -97,14 +97,13 @@ 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"
@@ -242,10 +241,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();
index 5ba184a0a6449e01ccc2afe8a991f54583f4fd70..68eabc6072e7c63f5e4b10789376bd0f1fae7130 100644 (file)
@@ -30,8 +30,24 @@ DefinitionBlock ("DSDT.aml", "DSDT", 1, "LXBIOS", "LXB-DSDT", 1)
         * Any others would involve declaring the wake up methods.
         */
        Name (\_S0, Package () { 0x00, 0x00, 0x00, 0x00 })
+       Name (\_S3, Package () { 0x01, 0x01, 0x00, 0x00 })
        Name (\_S5, Package () { 0x02, 0x02, 0x00, 0x00 })
 
+
+       /* blink a LED when entering the sleep (any type) */
+       Method (_PTS, 1, NotSerialized)
+       {
+               Store (0x1, \_SB.PCI0.ISA.LEDR)
+       }
+
+       /* cancel a LED blinking when waking from sleep (any type) */
+       Method (_WAK, 1, NotSerialized)
+       {
+               Store (0x0, \_SB.PCI0.ISA.LEDR)
+               /* wake OK */
+               Return(Package(0x02){0x00, 0x00})
+       }
+
        /* Root of the bus hierarchy */
        Scope (\_SB)
        {
@@ -160,7 +176,14 @@ DefinitionBlock ("DSDT.aml", "DSDT", 1, "LXBIOS", "LXB-DSDT", 1)
                        }
                        Device (ISA) {
                                Name (_ADR, 0x00110000)
-
+                               OperationRegion (PCIC, PCI_Config, 0x0, 0xff)
+                               Field (PCIC, ByteAcc, NoLock, Preserve)
+                               {
+                                       Offset (0x94),
+                                       /* two LSB bits are blink rate */
+                                       LEDR,   2,
+                               }
+                               
                                /* PS/2 keyboard (seems to be important for WinXP install) */
                                Device (KBD)
                                {
index 1d2094f76179e43c5bb1cd2ce7f3bb1a342db76e..ce3b66c4b867cfbcdd83bb9253cb1cae0594986b 100644 (file)
@@ -33,6 +33,12 @@ int add_mainboard_resources(struct lb_memory *mem)
        printk_debug("Adding high table area\n");
        lb_add_memory_range(mem, LB_MEM_TABLE,
                high_tables_base, high_tables_size);
+#endif
+#if HAVE_ACPI_RESUME == 1
+       lb_add_memory_range(mem, LB_MEM_RESERVED,
+               _RAMBASE, ((CONFIG_LB_MEM_TOPK<<10) - _RAMBASE));
+       lb_add_memory_range(mem, LB_MEM_RESERVED,
+               DCACHE_RAM_BASE, DCACHE_RAM_SIZE);
 #endif
        return 0;
 }