199767f8919635c4928607450d9e0abb932109ceToomas Soome/*******************************************************************************
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Filename: main.c
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Basic entry points for top-level functions
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Revision information:
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 20AUG2004 kb_admin initial creation
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 12JAN2005 kb_admin cosmetic changes
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 29APR2005 kb_admin modified boot delay
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * BEGIN_KBDD_BLOCK
199767f8919635c4928607450d9e0abb932109ceToomas Soome * No warranty, expressed or implied, is included with this software. It is
199767f8919635c4928607450d9e0abb932109ceToomas Soome * provided "AS IS" and no warranty of any kind including statutory or aspects
199767f8919635c4928607450d9e0abb932109ceToomas Soome * relating to merchantability or fitness for any purpose is provided. All
199767f8919635c4928607450d9e0abb932109ceToomas Soome * intellectual property rights of others is maintained with the respective
199767f8919635c4928607450d9e0abb932109ceToomas Soome * owners. This software is not copyrighted and is intended for reference
199767f8919635c4928607450d9e0abb932109ceToomas Soome * only.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * END_BLOCK
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * $FreeBSD$
199767f8919635c4928607450d9e0abb932109ceToomas Soome ******************************************************************************/
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include "env_vars.h"
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include "at91rm9200_lowlevel.h"
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include "loader_prompt.h"
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include "emac.h"
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include "lib.h"
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint main(void);
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome/*
199767f8919635c4928607450d9e0abb932109ceToomas Soome * .KB_C_FN_DEFINITION_START
199767f8919635c4928607450d9e0abb932109ceToomas Soome * int main(void)
199767f8919635c4928607450d9e0abb932109ceToomas Soome * This global function waits at least one second, but not more than two
199767f8919635c4928607450d9e0abb932109ceToomas Soome * seconds, for input from the serial port. If no response is recognized,
199767f8919635c4928607450d9e0abb932109ceToomas Soome * it acts according to the parameters specified by the environment. For
199767f8919635c4928607450d9e0abb932109ceToomas Soome * example, the function might boot an operating system. Do not return
199767f8919635c4928607450d9e0abb932109ceToomas Soome * from this function.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * .KB_C_FN_DEFINITION_END
199767f8919635c4928607450d9e0abb932109ceToomas Soome */
199767f8919635c4928607450d9e0abb932109ceToomas Soomeint
199767f8919635c4928607450d9e0abb932109ceToomas Soomemain(void)
199767f8919635c4928607450d9e0abb932109ceToomas Soome{
199767f8919635c4928607450d9e0abb932109ceToomas Soome InitEEPROM();
199767f8919635c4928607450d9e0abb932109ceToomas Soome EMAC_Init();
199767f8919635c4928607450d9e0abb932109ceToomas Soome LoadBootCommands();
199767f8919635c4928607450d9e0abb932109ceToomas Soome printf("\n\rKB9202(www.kwikbyte.com)\n\rAuto boot..\n\r");
199767f8919635c4928607450d9e0abb932109ceToomas Soome if (getc(1) == -1)
199767f8919635c4928607450d9e0abb932109ceToomas Soome ExecuteEnvironmentFunctions();
199767f8919635c4928607450d9e0abb932109ceToomas Soome Bootloader(0);
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome return (1);
199767f8919635c4928607450d9e0abb932109ceToomas Soome}