main.c revision 157937
1157873Simp/*******************************************************************************
2157873Simp *
3157873Simp * Filename: main.c
4157873Simp *
5157873Simp * Basic entry points for top-level functions
6157873Simp *
7157873Simp * Revision information:
8157873Simp *
9157873Simp * 20AUG2004	kb_admin	initial creation
10157873Simp * 12JAN2005	kb_admin	cosmetic changes
11157873Simp * 29APR2005	kb_admin	modified boot delay
12157873Simp *
13157873Simp * BEGIN_KBDD_BLOCK
14157873Simp * No warranty, expressed or implied, is included with this software.  It is
15157873Simp * provided "AS IS" and no warranty of any kind including statutory or aspects
16157873Simp * relating to merchantability or fitness for any purpose is provided.  All
17157873Simp * intellectual property rights of others is maintained with the respective
18157873Simp * owners.  This software is not copyrighted and is intended for reference
19157873Simp * only.
20157873Simp * END_BLOCK
21157873Simp *
22157873Simp * $FreeBSD: head/sys/boot/arm/at91/bootiic/main.c 157937 2006-04-21 13:44:58Z imp $
23157873Simp ******************************************************************************/
24157873Simp
25157873Simp#include "env_vars.h"
26157873Simp#include "at91rm9200_lowlevel.h"
27157873Simp#include "loader_prompt.h"
28157873Simp#include "emac.h"
29157873Simp#include "lib.h"
30157937Simp#include "eeprom.h"
31157873Simp
32157873Simp/*
33157873Simp * .KB_C_FN_DEFINITION_START
34157873Simp * int main(void)
35157873Simp *  This global function waits at least one second, but not more than two
36157873Simp * seconds, for input from the serial port.  If no response is recognized,
37157873Simp * it acts according to the parameters specified by the environment.  For
38157873Simp * example, the function might boot an operating system.  Do not return
39157873Simp * from this function.
40157873Simp * .KB_C_FN_DEFINITION_END
41157873Simp */
42157873Simpint
43157873Simpmain(void)
44157873Simp{
45157937Simp	InitEEPROM();
46157873Simp	EMAC_Init();
47157873Simp	LoadBootCommands();
48157873Simp	printf("\n\rKB9202(www.kwikbyte.com)\n\rAuto boot..\n\r");
49157873Simp	if (getc(1) == -1)
50157873Simp		ExecuteEnvironmentFunctions();
51157873Simp	Bootloader(0);
52157873Simp
53157873Simp	return (1);
54157873Simp}
55