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: releng/10.2/sys/boot/arm/at91/bootiic/main.c 161202 2006-08-10 19:55:52Z 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"
30157873Simp
31157873Simp/*
32157873Simp * .KB_C_FN_DEFINITION_START
33157873Simp * int main(void)
34157873Simp *  This global function waits at least one second, but not more than two
35157873Simp * seconds, for input from the serial port.  If no response is recognized,
36157873Simp * it acts according to the parameters specified by the environment.  For
37157873Simp * example, the function might boot an operating system.  Do not return
38157873Simp * from this function.
39157873Simp * .KB_C_FN_DEFINITION_END
40157873Simp */
41157873Simpint
42157873Simpmain(void)
43157873Simp{
44157937Simp	InitEEPROM();
45157873Simp	EMAC_Init();
46157873Simp	LoadBootCommands();
47157873Simp	printf("\n\rKB9202(www.kwikbyte.com)\n\rAuto boot..\n\r");
48157873Simp	if (getc(1) == -1)
49157873Simp		ExecuteEnvironmentFunctions();
50157873Simp	Bootloader(0);
51157873Simp
52157873Simp	return (1);
53157873Simp}
54