tree: drop last paragraph of GPL copyright header
[coreboot.git] / src / mainboard / emulation / qemu-i440fx / cache_as_ram.inc
blobfcd2d3bce7ae8907d8016525863ba42f103a3e12
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2000,2007 Ronald G. Minnich <rminnich@gmail.com>
5  * Copyright (C) 2007-2008 coresystems GmbH
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; version 2 of the License.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  */
17 #include <cpu/x86/mtrr.h>
18 #include <cpu/x86/cache.h>
19 #include <cpu/x86/post_code.h>
20 #include <cbmem.h>
22 #define CACHE_AS_RAM_SIZE 0x10000
23 #define CACHE_AS_RAM_BASE 0xd0000
25 #define CPU_PHYSMASK_HI  (1 << (CONFIG_CPU_ADDR_BITS - 32) - 1)
27         /* Save the BIST result. */
28         movl    %eax, %ebp
30 cache_as_ram:
31         post_code(0x20)
32        /* Clear the cache memory region. This will also fill up the cache */
33         movl    $CACHE_AS_RAM_BASE, %esi
34         movl    %esi, %edi
35         movl    $(CACHE_AS_RAM_SIZE >> 2), %ecx
36         // movl $0x23322332, %eax
37         xorl    %eax, %eax
38         rep     stosl
40         post_code(0x21)
41         /* Set up the stack pointer. */
42         movl    $(CACHE_AS_RAM_SIZE + CACHE_AS_RAM_BASE - 4), %eax
43         movl    %eax, %esp
45         /* Restore the BIST result. */
46         movl    %ebp, %eax
47         movl    %esp, %ebp
48         pushl   %eax
50 before_romstage:
51         post_code(0x29)
52         /* Call romstage.c main function. */
53         call    main
55         post_code(0x30)
57 __main:
58         post_code(POST_PREPARE_RAMSTAGE)
59         cld                     /* Clear direction flag. */
61         movl    $CONFIG_RAMTOP, %esp
62         movl    %esp, %ebp
63         call    copy_and_run
65 .Lhlt:
66         post_code(POST_DEAD_CODE)
67         hlt
68         jmp     .Lhlt