blob: c9847eaac7001c0e8b7abdd95e12c9f52bfb04d0 [file] [log] [blame]
Lee Leahyce9e21a2016-06-05 18:48:31 -07001/*
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 * Copyright (C) 2013-2014 Sage Electronic Engineering, LLC.
7 * Copyright (C) 2015-2016 Intel Corporation
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * Replacement for cache_as_ram.inc when using the C environment boot block.
19 */
20
21#include <rules.h>
22#include <soc/sd.h>
23
24 .section ".text"
25 .global car_stage_entry
26
27car_stage_entry:
28
29 /* Enter the C code */
Lee Leahy0c1843a2016-07-20 08:41:52 -070030 call car_stage_c_entry
Lee Leahyce9e21a2016-06-05 18:48:31 -070031
Lee Leahyce9e21a2016-06-05 18:48:31 -070032 /* The code should never reach this point */
33 movb $0x69, %ah
34 jmp .Lhlt
35
36#----------------------------------------------------------------------------
37#
38# Procedure: .Lhlt
39#
40# Input: ah - Upper 8-bits of POST code
41# al - Lower 8-bits of POST code
42#
43# Description:
44# Infinite loop displaying alternating POST code values
45#
46#----------------------------------------------------------------------------
47
48#define FLASH_DELAY 0x1000 /* I/O delay between post codes on failure */
49#define POST_DELAY 0x50
50
51.Lhlt:
52 xchg %al, %ah
53 mov $POST_DELAY, %dh
Julius Wernercd49cce2019-03-05 16:53:33 -080054#if CONFIG(POST_IO)
Lee Leahyce9e21a2016-06-05 18:48:31 -070055 outb %al, $CONFIG_POST_IO_PORT
56#else
57 post_code(POST_DEAD_CODE)
58#endif
59.flash_setup:
60 movl $FLASH_DELAY, %ecx
61.flash_delay:
62 outb %al, $0xED
63 loop .flash_delay
Julius Wernercd49cce2019-03-05 16:53:33 -080064#if CONFIG(ENABLE_DEBUG_LED)
Lee Leahyce9e21a2016-06-05 18:48:31 -070065 movl $SD_HOST_CTRL, %ebx
66 movb 0(%ebx), %dl
67 xorb $1, %dl
68 movb %dl, 0(%ebx)
69#endif /* CONFIG_ENABLE_DEBUG_LED */
70 decb %dh
71 jnz .flash_setup
72 jmp .Lhlt