1 |
2 |
csantifort |
/*----------------------------------------------------------------
|
2 |
|
|
// //
|
3 |
|
|
// boot-loader.h //
|
4 |
|
|
// //
|
5 |
|
|
// This file is part of the Amber project //
|
6 |
|
|
// http://www.opencores.org/project,amber //
|
7 |
|
|
// //
|
8 |
|
|
// Description //
|
9 |
|
|
// Defines for the boot-loader application. //
|
10 |
|
|
// //
|
11 |
|
|
// Author(s): //
|
12 |
|
|
// - Conor Santifort, csantifort.amber@gmail.com //
|
13 |
|
|
// //
|
14 |
|
|
//////////////////////////////////////////////////////////////////
|
15 |
|
|
// //
|
16 |
|
|
// Copyright (C) 2010 Authors and OPENCORES.ORG //
|
17 |
|
|
// //
|
18 |
|
|
// This source file may be used and distributed without //
|
19 |
|
|
// restriction provided that this copyright statement is not //
|
20 |
|
|
// removed from the file and that any derivative work contains //
|
21 |
|
|
// the original copyright notice and the associated disclaimer. //
|
22 |
|
|
// //
|
23 |
|
|
// This source file is free software; you can redistribute it //
|
24 |
|
|
// and/or modify it under the terms of the GNU Lesser General //
|
25 |
|
|
// Public License as published by the Free Software Foundation; //
|
26 |
|
|
// either version 2.1 of the License, or (at your option) any //
|
27 |
|
|
// later version. //
|
28 |
|
|
// //
|
29 |
|
|
// This source is distributed in the hope that it will be //
|
30 |
|
|
// useful, but WITHOUT ANY WARRANTY; without even the implied //
|
31 |
|
|
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
|
32 |
|
|
// PURPOSE. See the GNU Lesser General Public License for more //
|
33 |
|
|
// details. //
|
34 |
|
|
// //
|
35 |
|
|
// You should have received a copy of the GNU Lesser General //
|
36 |
|
|
// Public License along with this source; if not, download it //
|
37 |
|
|
// from http://www.opencores.org/lgpl.shtml //
|
38 |
|
|
// //
|
39 |
|
|
----------------------------------------------------------------*/
|
40 |
|
|
|
41 |
|
|
/* These uart input delay values are correct for a 33MHz system clock */
|
42 |
11 |
csantifort |
#define DLY_1S 1000
|
43 |
|
|
#define DLY_300MS 300
|
44 |
2 |
csantifort |
|
45 |
48 |
csantifort |
#define LINUX_JUMP_ADR 0x00080000 /* Boot loader jumps to this address to run vmlinux */
|
46 |
|
|
#define APP_JUMP_ADR 0x00008000 /* Boot loader jumps to this address to run test programs */
|
47 |
11 |
csantifort |
#define FILE_LOAD_BASE 0x01000000
|
48 |
|
|
#define DEBUG_BUF 0x01800000
|
49 |
|
|
#define FILE_MAX_SIZE 0x00800000 /* 8MB max Xmodem transfer file size */
|
50 |
2 |
csantifort |
|
51 |
28 |
csantifort |
/* Function prototypes */
|
52 |
|
|
void parse ( char * buf );
|
53 |
|
|
void printm ( unsigned int address );
|
54 |
|
|
int get_hex ( char * buf, int start_position, unsigned int *address, unsigned int *length );
|
55 |
|
|
int get_address_data ( char * buf, unsigned int *address, unsigned int *data );
|
56 |
|
|
void load_run( int type, unsigned int address );
|
57 |
|
|
void print_spaces ( int num );
|
58 |
|
|
void print_help ( void );
|