main.c revision 269111
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/bootiic/main.c 269111 2014-07-26 03:33:19Z ian $
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
31int main(void);
32
33/*
34 * .KB_C_FN_DEFINITION_START
35 * int main(void)
36 *  This global function waits at least one second, but not more than two
37 * seconds, for input from the serial port.  If no response is recognized,
38 * it acts according to the parameters specified by the environment.  For
39 * example, the function might boot an operating system.  Do not return
40 * from this function.
41 * .KB_C_FN_DEFINITION_END
42 */
43int
44main(void)
45{
46	InitEEPROM();
47	EMAC_Init();
48	LoadBootCommands();
49	printf("\n\rKB9202(www.kwikbyte.com)\n\rAuto boot..\n\r");
50	if (getc(1) == -1)
51		ExecuteEnvironmentFunctions();
52	Bootloader(0);
53
54	return (1);
55}
56