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