OpenCores
URL https://opencores.org/ocsvn/aemb/aemb/trunk

Subversion Repositories aemb

[/] [aemb/] [trunk/] [sw/] [cc/] [bootstrap.c] - Blame information for rev 206

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 185 sybreon
/* $Id: bootstrap.c,v 1.5 2008-07-01 00:08:34 sybreon Exp $
2 177 sybreon
**
3
** BOOTSTRAP
4
** Copyright (C) 2008 Shawn Tan <shawn.tan@aeste.net>
5
**
6
** This file is part of AEMB.
7
**
8
** AEMB is free software: you can redistribute it and/or modify it
9
** under the terms of the GNU General Public License as published by
10
** the Free Software Foundation, either version 3 of the License, or
11
** (at your option) any later version.
12
**
13
** AEMB is distributed in the hope that it will be useful, but WITHOUT
14
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
** or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
16
** License for more details.
17
**
18
** You should have received a copy of the GNU General Public License
19
** along with AEMB.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21
 
22 185 sybreon
#include <stdlib.h>
23 177 sybreon
#include "memtest.hh"
24
 
25 185 sybreon
/*
26
  BOOTSTRAP CODE
27 181 sybreon
 
28 185 sybreon
  #define SRAM_BASE - The base address of the memory block to test.
29
  #define SRAM_SIZE - The size of the memory block to test.
30
  #define BOOT_BASE - The base address of the next stage boot loader.
31
*/
32 177 sybreon
 
33 185 sybreon
int bootstrap ()
34 181 sybreon
{
35 185 sybreon
  void *fsboot = (void *) BOOT_BASE;
36 181 sybreon
 
37 185 sybreon
  // Memory Test
38
  if ((memTestDataBus(SRAM_BASE) == 0) &&            // test data
39
      (memTestAddrBus(SRAM_BASE, SRAM_SIZE) == 0) && // test address      
40
#ifdef LONGTEST // 1.86kb
41
      (memTestFullDev(SRAM_BASE, SRAM_SIZE) == 0)    // test device
42
#else // 1.3kb
43
      true
44
#endif
45
      )
46
    {
47
      goto *fsboot; // on PASS: branch to boot loader
48
    }
49 181 sybreon
  else
50 185 sybreon
    {
51
      while (1); // on FAIL: lock the system
52
    }
53 181 sybreon
}
54
 
55 177 sybreon
/*
56
  $Log: not supported by cvs2svn $
57 185 sybreon
  Revision 1.4  2008/06/30 10:14:59  sybreon
58
  added some comments
59
 
60 184 sybreon
  Revision 1.3  2008/06/24 10:34:40  sybreon
61
  updated
62
 
63 183 sybreon
  Revision 1.2  2008/06/24 00:45:36  sybreon
64
  basic version
65
 
66 181 sybreon
  Revision 1.1  2008/06/23 22:18:04  sybreon
67
  initial import
68
 
69 177 sybreon
 */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.