main.c revision 157873
1/*******************************************************************************
2 *
3 * Filename: main.c
4 *
5 * Basic entry points for top-level functions
6 *
7 * Revision information:
8 *
9 * 20AUG2004	kb_admin	initial creation
10 * 12JAN2005	kb_admin	cosmetic changes
11 * 29APR2005	kb_admin	modified boot delay
12 *
13 * BEGIN_KBDD_BLOCK
14 * No warranty, expressed or implied, is included with this software.  It is
15 * provided "AS IS" and no warranty of any kind including statutory or aspects
16 * relating to merchantability or fitness for any purpose is provided.  All
17 * intellectual property rights of others is maintained with the respective
18 * owners.  This software is not copyrighted and is intended for reference
19 * only.
20 * END_BLOCK
21 *
22 * $FreeBSD: head/sys/boot/arm/at91/bootspi/main.c 157873 2006-04-19 17:16:49Z imp $
23 ******************************************************************************/
24
25#include "env_vars.h"
26#include "at91rm9200_lowlevel.h"
27#include "loader_prompt.h"
28#include "emac.h"
29#include "lib.h"
30
31/*
32 * .KB_C_FN_DEFINITION_START
33 * int main(void)
34 *  This global function waits at least one second, but not more than two
35 * seconds, for input from the serial port.  If no response is recognized,
36 * it acts according to the parameters specified by the environment.  For
37 * example, the function might boot an operating system.  Do not return
38 * from this function.
39 * .KB_C_FN_DEFINITION_END
40 */
41int
42main(void)
43{
44
45	EMAC_Init();
46
47	LoadBootCommands();
48
49	printf("\r\nSPI Boot loader.\r\nAutoboot...\r\n");
50
51	if (getc(1) == -1)
52		ExecuteEnvironmentFunctions();
53
54	Bootloader(0);
55
56	return (1);
57}
58