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

Subversion Repositories amber

[/] [amber/] [trunk/] [sw/] [boot-loader-ethmac/] [boot-loader-ethmac.c] - Blame information for rev 81

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 61 csantifort
/*----------------------------------------------------------------
2
//                                                              //
3
//  boot-loader-ethmac.c                                        //
4
//                                                              //
5
//  This file is part of the Amber project                      //
6
//  http://www.opencores.org/project,amber                      //
7
//                                                              //
8
//  Description                                                 //
9
//  The main functions for the boot loader application. This    //
10 78 csantifort
//  application is embedded in the FPGA's SRAM and is used      //
11 61 csantifort
//  to load larger applications into the DDR3 memory on         //
12
//  the development board.                                      //
13
//                                                              //
14
//  Author(s):                                                  //
15
//      - Conor Santifort, csantifort.amber@gmail.com           //
16
//                                                              //
17
//////////////////////////////////////////////////////////////////
18
//                                                              //
19 81 csantifort
// Copyright (C) 2011-2013 Authors and OPENCORES.ORG            //
20 61 csantifort
//                                                              //
21
// This source file may be used and distributed without         //
22
// restriction provided that this copyright statement is not    //
23
// removed from the file and that any derivative work contains  //
24
// the original copyright notice and the associated disclaimer. //
25
//                                                              //
26
// This source file is free software; you can redistribute it   //
27
// and/or modify it under the terms of the GNU Lesser General   //
28
// Public License as published by the Free Software Foundation; //
29
// either version 2.1 of the License, or (at your option) any   //
30
// later version.                                               //
31
//                                                              //
32
// This source is distributed in the hope that it will be       //
33
// useful, but WITHOUT ANY WARRANTY; without even the implied   //
34
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
35
// PURPOSE.  See the GNU Lesser General Public License for more //
36
// details.                                                     //
37
//                                                              //
38
// You should have received a copy of the GNU Lesser General    //
39
// Public License along with this source; if not, download it   //
40
// from http://www.opencores.org/lgpl.shtml                     //
41
//                                                              //
42
----------------------------------------------------------------*/
43
 
44
#include "line-buffer.h"
45
#include "timer.h"
46
#include "utilities.h"
47 80 csantifort
#include "packet.h"
48 61 csantifort
#include "ethmac.h"
49
#include "tcp.h"
50
#include "udp.h"
51
#include "telnet.h"
52 78 csantifort
#include "serial.h"
53 61 csantifort
 
54
 
55
int main ( void ) {
56 78 csantifort
    /* Enable the serial debug port */
57
    init_serial();
58
    print_serial("Amber debug port\n\r");
59
 
60
 
61
    /* initialize the memory allocation system */
62 61 csantifort
    init_malloc();
63 78 csantifort
 
64 80 csantifort
    /* Enable the hardware timer to generate interrrupts 100 timer per second,
65
       current time will start incrementing from this point onwards */
66
    init_timer();
67 78 csantifort
 
68 80 csantifort
    /* Create a timer to flash a led periodically */
69
    init_led();
70 78 csantifort
 
71 80 csantifort
    /* initialize the PHY and MAC and listen for connections
72
       This is the last init because packets will be received from this point
73
       onwards. */
74
    init_ethmac();
75 78 csantifort
 
76 81 csantifort
    /* create a tcp socket for listening on port 23 */
77
    listen_telnet();
78 78 csantifort
 
79 81 csantifort
    /* initialize the tftp stuff */
80
    init_tftp();
81
 
82
 
83 80 csantifort
    /* Process loop. Everything is timer, interrupt and queue driven from here on down */
84 61 csantifort
    while (1) {
85 78 csantifort
 
86 80 csantifort
        /* flash an led */
87
        process_led();
88 78 csantifort
 
89 80 csantifort
        /* Check for received tftp files and reboot */
90
        process_tftp();
91 78 csantifort
 
92 81 csantifort
        /* Process all socket traffic */
93
        process_sockets();
94 61 csantifort
    }
95
}
96
 
97
 
98
 
99 78 csantifort
 
100
 

powered by: WebSVN 2.1.0

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