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

Subversion Repositories aemb

[/] [aemb/] [trunk/] [sw/] [cc/] [bootstrap.c] - Diff between revs 183 and 184

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 183 Rev 184
Line 1... Line 1...
/* $Id: bootstrap.c,v 1.3 2008-06-24 10:34:40 sybreon Exp $
/* $Id: bootstrap.c,v 1.4 2008-06-30 10:14:59 sybreon Exp $
**
**
** BOOTSTRAP
** BOOTSTRAP
** Copyright (C) 2008 Shawn Tan <shawn.tan@aeste.net>
** Copyright (C) 2008 Shawn Tan <shawn.tan@aeste.net>
**
**
** This file is part of AEMB.
** This file is part of AEMB.
Line 16... Line 16...
** License for more details.
** License for more details.
**
**
** You should have received a copy of the GNU General Public License
** You should have received a copy of the GNU General Public License
** along with AEMB.  If not, see <http://www.gnu.org/licenses/>.
** along with AEMB.  If not, see <http://www.gnu.org/licenses/>.
*/
*/
 
/*
 
#define SRAM_BASE 0x00008000
 
The base address of the RAM block
 
 
 
#define SRAM_SIZE 0x8000
 
The size of the RAM block
 
 
//#define SRAM_BASE 0x00008000
#define BOOT_BASE 0x00004000
//#define SRAM_SIZE 0x8000
The base address of the boot loader
//#define BOOT_BASE 0x00004000
*/
 
 
#include "memtest.hh"
#include "memtest.hh"
 
 
/**
/**
   MEMORY TEST
   MEMORY TEST
Line 49... Line 54...
 */
 */
 
 
static inline void runboot(int base)
static inline void runboot(int base)
{
{
  asm volatile ("brai %0"::"i"(base));
  asm volatile ("brai %0"::"i"(base));
 
  //void *fsboot = (void *) base;
 
  //fsboot = (void *) base;
 
  //goto *fsboot;  
}
}
 
 
 
/**
 
   STRING IT ALL TOGETHER
 
 */
 
 
int main ()
int main ()
{
{
  if (memtest(SRAM_BASE, SRAM_SIZE) == 0)
  if (memtest(SRAM_BASE, SRAM_SIZE) == 0)
    runboot(BOOT_BASE);
    runboot(BOOT_BASE);
  else
  else
    while (1) asm volatile ("");
    while (1); // asm volatile ("");  
}
}
 
 
/*
/*
  $Log: not supported by cvs2svn $
  $Log: not supported by cvs2svn $
 
  Revision 1.3  2008/06/24 10:34:40  sybreon
 
  updated
 
 
  Revision 1.2  2008/06/24 00:45:36  sybreon
  Revision 1.2  2008/06/24 00:45:36  sybreon
  basic version
  basic version
 
 
  Revision 1.1  2008/06/23 22:18:04  sybreon
  Revision 1.1  2008/06/23 22:18:04  sybreon
  initial import
  initial import

powered by: WebSVN 2.1.0

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