blob: 4f1cbea574f10c678951caf42dccf5b97c2b8c30 [file] [log] [blame]
efdesign987c0c64e2011-06-20 19:56:06 -07001/*
2 * This file is part of the coreboot project.
3 *
efdesign987c0c64e2011-06-20 19:56:06 -07004 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
efdesign987c0c64e2011-06-20 19:56:06 -070012 */
efdesign984b508342011-07-13 17:16:13 -070013
efdesign987c0c64e2011-06-20 19:56:06 -070014/******************************************************************************
15 * AMD Generic Encapsulated Software Architecture
16 *
Kyösti Mälkki7076aa52017-09-02 16:20:15 +030017 * $Workfile:: cache_as_ram.S
efdesign987c0c64e2011-06-20 19:56:06 -070018 *
Kyösti Mälkki7076aa52017-09-02 16:20:15 +030019 * Description: cache_as_ram.S - AGESA Module Entry Point for GCC complier
efdesign987c0c64e2011-06-20 19:56:06 -070020 *
21 ******************************************************************************
efdesign984b508342011-07-13 17:16:13 -070022 */
23
efdesign987c0c64e2011-06-20 19:56:06 -070024#include "gcccar.inc"
Kyösti Mälkki7076aa52017-09-02 16:20:15 +030025#include <cpu/x86/post_code.h>
efdesign987c0c64e2011-06-20 19:56:06 -070026
efdesign987c0c64e2011-06-20 19:56:06 -070027.code32
Kyösti Mälkki7076aa52017-09-02 16:20:15 +030028.globl _cache_as_ram_setup, _cache_as_ram_setup_end
efdesign987c0c64e2011-06-20 19:56:06 -070029
Kyösti Mälkki7076aa52017-09-02 16:20:15 +030030_cache_as_ram_setup:
efdesign984b508342011-07-13 17:16:13 -070031
Elyes HAOUASdea45c12018-12-27 09:14:07 +010032 /* Preserve BIST. */
33 movd %eax, %mm0
Kyösti Mälkki1779d532016-11-23 21:29:26 +020034
Elyes HAOUASdea45c12018-12-27 09:14:07 +010035 post_code(0xa0)
efdesign984b508342011-07-13 17:16:13 -070036
Elyes HAOUASdea45c12018-12-27 09:14:07 +010037 AMD_ENABLE_STACK
Kyösti Mälkkif6fe2f12016-11-21 11:26:48 +020038
Elyes HAOUASdea45c12018-12-27 09:14:07 +010039 /* Align the stack. */
40 and $0xFFFFFFF0, %esp
Kyösti Mälkki26929bd2016-11-23 20:40:53 +020041
Elyes HAOUASdea45c12018-12-27 09:14:07 +010042 /* Must maintain 16-byte stack alignment here. */
43 pushl $0x0
44 pushl $0x0
45 pushl $0x0
46 movd %mm0, %eax /* bist */
47 pushl %eax
48 call romstage_main
Kyösti Mälkki63fac812017-09-02 16:41:43 +030049
Elyes HAOUASdea45c12018-12-27 09:14:07 +010050 /* Should never see this postcode */
Kyösti Mälkki56397362017-09-07 22:13:10 +030051 post_code(0xae)
Kyösti Mälkki63fac812017-09-02 16:41:43 +030052
Kyösti Mälkkiba22e152016-11-23 06:47:15 +020053stop:
Elyes HAOUASdea45c12018-12-27 09:14:07 +010054 hlt
55 jmp stop
Kyösti Mälkki63fac812017-09-02 16:41:43 +030056
Kyösti Mälkki7076aa52017-09-02 16:20:15 +030057_cache_as_ram_setup_end: