aboutsummaryrefslogtreecommitdiff
path: root/llfw/boot_abort.S
blob: 47a9178c635aabb77020cfbea6aefc0eb76330a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/******************************************************************************
 * Copyright (c) 2004, 2008 IBM Corporation
 * All rights reserved.
 * This program and the accompanying materials
 * are made available under the terms of the BSD License
 * which accompanies this distribution, and is available at
 * http://www.opensource.org/licenses/bsd-license.php
 *
 * Contributors:
 *     IBM Corporation - initial implementation
 *****************************************************************************/
#include "macros.h"
#include "termctrl.h"
#include "boot_abort.h"
#include <cpu.h>

#define MSG_LOOK_HDR TERM_CTRL_BRIGHT, TERM_BG_RED, TERM_FG_WHITE

ASM_ENTRY(msg_e_crc)
	.ascii	MSG_LOOK_HDR
	.ascii	"\n\r\n\rE1001 - Boot ROM CRC failure\n\r"
	.ascii	TERM_CTRL_RESET, "\0"
	.align	2

ASM_ENTRY(msg_e_nomem)
	.ascii	MSG_LOOK_HDR
	.ascii	"\n\r\n\rE1002 - Memory could not be initialized\n\r"
	.ascii	TERM_CTRL_RESET, "\0"
	.align	2

ASM_ENTRY(msg_e_nofile)
	.ascii	MSG_LOOK_HDR
	.ascii	"\n\r\n\rE1003 - Firmware image incomplete"
	.ascii	TERM_CTRL_RESET
	.ascii	    "\n\r       internal FLS1-FFS-0.\0"
	.align	2

ASM_ENTRY(msg_e_ierror)
	.ascii	MSG_LOOK_HDR
	.ascii	"\n\r\n\rE1004 - Unspecified Internal Firmware Error"
	.ascii	TERM_CTRL_RESET
	.ascii	    "\n\r       internal FLSX-SE-0.\0"
	.align	2

/* E1005 : used in memory init code */

/*****************************************************************************
 * Boot Abort Handler
 *
 * Input:
 *        R3 - capability informatin (i/o etc.)
 *        R4 - handling suggestion
 *        R5 - error string reference
 *        R6 - error number
 * 
 * Return: 
 *        if possible input to H8 and NVRAM log and console , then reboot/halt
 *
 * Input definitions:
 *
 * R3 bits: 63 (h8/console possible) ... add more
 * R4 bits: 63 (do not attempt reboot)
 * R5 reference to error message string
 * R6 32-bit error enumerator
 *
 ******************************************************************************/
ASM_ENTRY(boot_abort)
	/* save arguments */
	mr	r31, r3
	mr	r30, r4
	mr	r29, r5
	mr	r28, r6
	
	/* check if i/o is possible, if yes then print message */
	li	r10, ABORT_CANIO
	and.	r3, r31, r10
	bne	abort_noio

	/* use i/o ..., first print reference message */
	/* then add internal number if != 0           */
	mr	r3, r29
	mfspr	r4, HSPRG0 /* get runbase */
	or	r3, r3, r4
	bl	io_print
	mr	r3, r28
	li	r28, 0
	cmpd	r3, r28
	beq	0f
	bl	io_printhex32
0:

  abort_noio:
  	b	$	// FIXME
	/* never reached */