URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc
- from Rev 466 to Rev 467
- ↔ Reverse comparison
Rev 466 → Rev 467
/trunk/bootloaders/orpmon/services/Makefile
26,8 → 26,7
|
LIB = services.o |
|
#OBJS = net.o tftp.o bootp.o rarp.o arp.o dos.o modem.o |
OBJS = net.o tftp.o bootp.o rarp.o arp.o #dos.o modem.o |
OBJS = net.o tftp.o bootp.o rarp.o arp.o |
|
all: $(LIB) |
|
/trunk/bootloaders/orpmon/include/spincursor.h
File deleted
/trunk/bootloaders/orpmon/include/flash.h
1,6 → 1,8
#ifndef _FLASH_H |
#define _FLASH_H |
|
#ifdef FLASH_BASE_ADDR |
|
#ifdef FLASH_ORG_16_2 |
/* INC_ADDR = for how many bytes address should be incremented */ |
#define INC_ADDR 4 |
48,4 → 50,6
t_fl_ext_program fl_ext_program; |
t_fl_erase fl_ext_erase, fl_ext_unlock; |
|
#endif |
|
#endif /* _FLASH_H */ |
/trunk/bootloaders/orpmon/include/build.h
1,4 → 50,6
#define BUILD_VERSION "Fri Jan 7 15:17:07 CET 2011" |
#define BUILD_VERSION "Sat Jan 8 12:11:53 CET 2011" |
/trunk/bootloaders/orpmon/include/board.h
58,7 → 58,6
# define SDRAM_BANK_SIZE 0x00800000 |
# define IN_CLK 20000000 |
|
# define FLASH_ORG_16_2 1 |
# define BOARD_DEF_NAME "ORSoC devboard" |
#elif BOARD==3 |
//ORSoC ordb1a3p1000 |
184,7 → 183,7
/* Ethernet core defines */ |
#define ETH_BASE 0x92000000 |
#define ETH_IRQ 4 |
#define ETH_DATA_BASE ((((unsigned long)&_src_addr) + 16) & ~0x3) |
#define ETH_DATA_BASE ((((unsigned long)&_stack_top) + 16) & ~0x3) |
#define SPI_BASE 0xb0000000 |
#define CRT_BASE_ADDR 0x97000000 |
#define ATA_BASE_ADDR 0x9e000000 |
193,8 → 192,6
|
#define SDC_CONTROLLER_BASE 0x9e000000 |
|
#define SANCHO_BASE_ADD 0x98000000 |
|
#define CRT_ENABLED 0 |
#define FB_BASE_ADDR 0xa8000000 |
|
/trunk/bootloaders/orpmon/include/common.h
15,7 → 15,7
#endif |
|
/* Stack top */ |
extern unsigned long _src_addr; |
extern unsigned long _stack_top; |
|
/* A Board Information structure that is given to a program when |
* ppcboot starts it up. */ |
/trunk/bootloaders/orpmon/reset.S
6,57 → 6,19
#define EXIT_NOP_ON_ERROR 1 |
#define PRINT_AND_RESET_ON_ERROR 1 |
|
.extern _src_beg |
.extern _dst_beg |
.extern _dst_end |
.extern int_main |
.extern int_error |
.extern tick_interrupt |
.extern _crc32 |
.extern _bstart |
.extern _bend |
.global _calc_mycrc32 |
.global _mycrc32 |
.global _mysize |
|
.section .stack, "aw", @nobits |
.space STACK_SIZE |
_stack: |
.section .crc |
_mycrc32: |
.word 0xcccccccc |
_mysize: |
.word 0xdddddddd |
|
.if SELF_CHECK |
_calc_mycrc32: |
l.addi r3,r0,0 |
l.movhi r4,hi(_calc_mycrc32) |
l.ori r4,r4,lo(_calc_mycrc32) |
l.movhi r5,hi(_mysize) |
l.ori r5,r5,lo(_mysize) |
l.lwz r5,0(r5) |
l.addi r1,r1,-4 |
l.sw 0(r1),r9 |
|
/* unsigned long crc32 (unsigned long crc, const unsigned char *buf, unsigned long len); */ |
l.jal _crc32 |
l.nop |
|
l.movhi r3,hi(_mycrc32) |
l.ori r3,r3,lo(_mycrc32) |
l.lwz r3,0(r3) |
|
l.xor r11,r3,r11 |
l.lwz r9,0(r1) |
l.jr r9 |
l.addi r1,r1,4 |
.endif |
|
.org 0x100 |
|
.section .vectors, "ax" |
|
.org 0x100 |
_reset: |
l.movhi r0, 0 |
/* Clear status register, set supervisor mode */ |
274,6 → 236,7
l.ori r1,r1,lo(_stack-4) |
l.addi r2,r0,-3 |
l.and r1,r1,r2 |
l.or r2,r1,r1 |
|
/* Clear BSS */ |
l.movhi r3, hi(_bstart) |
/trunk/bootloaders/orpmon/sim.cfg
121,7 → 121,7
/*pattern = 0x00 |
type = unknown */ |
|
type = exitnops |
/*type = exitnops*/ |
|
name = "RAM" |
ce = 1 |
716,12 → 716,16
baseaddr = 0x92000000 |
/* dma = 0 */ |
irq = 4 |
rtx_type = 0 |
rtx_type = "tap" |
/* tx_channel = 0 */ |
/* rx_channel = 1 */ |
rxfile = "eth0.rx" |
txfile = "eth0.tx" |
sockif = "eth0" |
/* rxfile = "eth0.rx"*/ |
/*txfile = "eth0.tx"*/ |
/*sockif = "eth0"*/ |
phy_addr = 7 |
tap_dev = "tap0" |
|
|
end |
|
|
/trunk/bootloaders/orpmon/cmds/global.c
69,9 → 69,10
return -1; |
} |
|
#if HELP_ENABLED |
|
int globals_cmd(int argc, char *argv[]) |
{ |
#if HELP_ENABLED |
const char *erase_method_desc[] = |
{ "do not erase", "fully", "as needed" }; |
if (argc) |
84,10 → 85,13
printf("srv_ip = %08lx\n", global.srv_ip); |
printf("erase_method = %i (%s)\n", (int)global.erase_method, |
erase_method_desc[global.erase_method]); |
#endif /* HELP_ENABLED */ |
return 0; |
|
} |
#endif /* HELP_ENABLED */ |
|
|
|
void module_global_init(void) |
{ |
register_command("src_addr", "<value>", |
/trunk/bootloaders/orpmon/cmds/memory.c
1,7 → 1,6
#include "common.h" |
#include "support.h" |
#include "spr-defs.h" |
#include "spincursor.h" |
|
void show_mem(int start, int stop) |
{ |
24,7 → 23,7
unsigned long err_addr = 0; |
unsigned long err_no = 0; |
|
unsigned long stack_top = (unsigned long) &_src_addr; |
unsigned long stack_top = (unsigned long) &_stack_top; |
|
if (start_addr < stack_top) |
{ |
133,21 → 132,16
unsigned long err_no = 0; |
int b; |
printf("\nSetting memory contents to all 1'b1 "); |
//enable_spincursor(); |
for (addr = start_addr; addr <= stop_addr; addr += 1) |
REG8(addr) = 0xff; |
//disable_spincursor(); |
printf("\rVerifying memory contents all set to 1'b1: "); |
//enable_spincursor(); |
/* Verify */ |
for (addr = start_addr; addr <= stop_addr; addr += 1) { |
if (REG8(addr) != 0xff) { |
err_no++; |
err_addr = addr; |
//disable_spincursor(); |
printf("\n%04lx times failed. Last at location %08lx ", |
err_no, err_addr); |
//enable_spincursor(); |
} |
} |
|
/trunk/bootloaders/orpmon/ChangeLog
1,3 → 1,33
2011-01-08 Julius Baxter <julius@opencores.org> |
* include/flash.h: Whole filed surrounded with #ifdef FLASH_BASE_ADDR |
* include/spincursor: Deleted. |
* include/board.h: FLASH_ORG define for board 2 removed. |
<ETH_DATA_BASE>: Changed to reference _stack_top. |
<SANCHO_BASE_ADD>: Unused, so removed. |
* include/common.h: <_src_addr>: Extern define removed. |
<_stack_top>: Extern define added. |
* services/Makefile: Clean up commented-out things. |
* reset.S: Removed several unused .extern. |
<_mycrc32>: Removed. |
<_mysize>: Ditto. |
Removed SELF_CHECK section. |
Shifted .org for reset section to after .section definition (bugfix.) |
* cmds/global.c: |
(globals_cmd): Shifted #if HELP_ENABLED to surround contents of |
function. |
* cmds/memory.c: Changed references from _src_addr to _stack_top. |
Remove all (were already commented out) spincursor references. |
* sim.cfg: Add Ethernet TAP configuration settings. |
* common/spincursos.c: Removed. |
* common/common.c: Change references from _src_addr to _stack_top. |
(main): Clean up. |
* flash.ld: <_stack_top>: Added. |
* ram.ld: <_src_addr>: Removed. |
<_stack_top>: Added. |
Removed reference to .crc section. |
* drivers/uart.c: Some formatting. |
|
|
2011-01-07 Julius Baxter <julius@opencores.org> |
* ChangeLog: Created |
* include/board.h: IP config 3 changes |
/trunk/bootloaders/orpmon/common/spincursor.c
File deleted
/trunk/bootloaders/orpmon/common/common.c
4,7 → 4,6
#include "support.h" |
#include "keyboard.h" |
#include "spr-defs.h" |
#include "spincursor.h" |
#include "int.h" |
|
#include "build.h" |
11,9 → 10,6
|
#define MAX_COMMANDS 100 |
|
// Value from linker script |
extern unsigned long _src_addr; |
|
bd_t bd; |
|
int num_commands = 0; |
59,6 → 55,7
break; |
case CT_NONE: /* just to satisfy the compiler */ |
case CT_SIM: |
default: |
break; |
} |
return -1; |
80,6 → 77,7
break; |
case CT_NONE: /* just to satisfy the compiler */ |
case CT_SIM: |
default: |
break; |
} |
return -1; |
167,8 → 165,10
case CT_SIM: |
break; |
} |
|
bd.bi_console_type = con_type; |
/* Initialize new */ |
|
/* Initialize new */ |
switch (bd.bi_console_type) { |
case CT_NONE: |
break; |
295,11 → 295,11
|
} |
|
#if HELP_ENABLED |
extern unsigned long _src_addr; // Stack section ends here, will print it out |
|
/* Displays help screen */ |
int help_cmd(int argc, char *argv[]) |
{ |
#if HELP_ENABLED |
int i; |
for (i = 0; i < num_commands; i++) |
printf("%-10s %-20s - %s\n", command[i].name, command[i].params, |
311,13 → 311,13
printf("Frequency\t\t%dMHz\n", IN_CLK / 1000000); |
print_or1k_cache_info(); |
printf("\n"); |
printf("Info: Stack section addr 0x%x\n", (unsigned long)&_src_addr); |
printf("Info: Stack section addr 0x%x\n", (unsigned long)&_stack_top); |
printf("Build tag: %s", BUILD_VERSION); |
|
#endif /* HELP_ENABLED */ |
return 0; |
} |
#endif /* HELP_ENABLED */ |
|
|
void module_cpu_init(void); |
void module_memory_init(void); |
void module_eth_init(void); |
335,7 → 335,7
{ |
/* Set defaults */ |
global.erase_method = 2; /* as needed */ |
global.src_addr = (unsigned long)&_src_addr; |
global.src_addr = 0; |
#ifdef FLASH_BASE_ADDR |
global.dst_addr = FLASH_BASE_ADDR; |
#else |
401,37 → 401,28
|
} |
|
int tboot_cmd(int argc, char *argv[]); |
|
|
/* Main shell loop */ |
int main(int argc, char **argv) |
{ |
extern unsigned long calc_mycrc32(void); |
|
#if SELF_CHECK |
extern unsigned long mycrc32, mysize; |
#endif |
|
timestamp = 0; // clear timer counter |
|
int_init(); |
|
/* Init. interface */ |
change_console_type(CONSOLE_TYPE); |
|
/* Init. processor interrupt handlers */ |
int_init(); |
|
/* Enable interrupts in processor */ |
mtspr(SPR_SR, mfspr(SPR_SR) | SPR_SR_IEE); |
|
#if SELF_CHECK |
printf("Self check... "); |
if ((t = calc_mycrc32())) |
printf("FAILED!!!\n"); |
else |
printf("OK\n"); |
#endif /* SELF_CHECK */ |
/* Initialise commands we'll handle */ |
num_commands = 0; |
|
num_commands = 0; |
mon_init(); |
|
disable_spincursor(); |
|
|
/* Init processor timers */ |
tick_init(); |
|
if (HELP_ENABLED) |
/trunk/bootloaders/orpmon/common/Makefile
3,7 → 3,7
|
LIB = common_o.o |
|
OBJS = common.o support.o cprintf.o screen.o font.o ctype.o string.o spincursor.o dosfs.o |
OBJS = common.o support.o cprintf.o screen.o font.o ctype.o string.o dosfs.o |
SOBJS = or32.o |
|
all: $(LIB) |
/trunk/bootloaders/orpmon/flash.ld
66,6 → 66,7
.stack : |
{ |
*(.stack) |
_stack_top = .; |
} > ram |
|
.mytext : |
/trunk/bootloaders/orpmon/config.mk
25,8 → 25,8
|
XCFLAGS += -I$(TOPDIR)/include -DOR1K -Wall -Wstrict-prototypes |
XCFLAGS += -Werror-implicit-function-declaration |
#XCFLAGS += -fno-omit-frame-pointer |
XCFLAGS += -fomit-frame-pointer |
XCFLAGS += -fno-omit-frame-pointer |
#XCFLAGS += -fomit-frame-pointer |
#XCFLAGS += -O0 |
#XCFLAGS += -O2 |
XCFLAGS += -O3 |
/trunk/bootloaders/orpmon/ram.ld
31,7 → 31,6
{ |
.vectors : |
{ |
*(.crc) |
*(.vectors) |
} > vectors |
|
44,7 → 43,6
/* } > ram2*/ |
|
.data : |
/* AT ( ADDR (.text) + SIZEOF(.text) + SIZEOF(.mytext))*/ |
{ |
*(.data) |
} > ram |
55,7 → 53,7
*(.rodata.*) |
} > ram |
|
.bss : |
.bss (NOLOAD): |
{ |
. = ALIGN(4); |
_bstart = . ; |
64,45 → 62,11
} > ram |
/* } > ram2 */ |
|
.stack : |
.stack (NOLOAD): |
{ |
*(.stack) |
_src_addr = .; |
_stack_top = .; |
} > ram |
/* } > ram2 */ |
/* |
.monitor : |
{ |
*(.monitor) |
} > ram |
*/ |
|
/* |
. += 0x100000; |
|
// This section was in cmds/load.c, but we don't need it -jb |
.config : |
{ |
_cfg_start = .; |
*(.config) |
_cfg_end = .; |
} > ram |
*/ |
/* |
. = 0xf0000100; |
|
.monitor ALIGN(0x40000) : |
{ |
*(.monitor) |
} > flash |
|
. += 0x100000; |
|
.config ALIGN(0x40000) : |
{ |
_cfg_start = .; |
*(.config) |
_cfg_end = .; |
} > flash |
*/ |
} |
/trunk/bootloaders/orpmon/drivers/tick.c
2,7 → 2,6
#include "common.h" |
#include "support.h" |
#include "spr-defs.h" |
#include "spincursor.h" |
|
void tick_init(void) |
{ |
15,7 → 14,7
{ |
timestamp++; |
mtspr(SPR_TTMR, SPR_TTMR_IE | SPR_TTMR_RT | ((IN_CLK/TICKS_PER_SEC) & SPR_TTMR_PERIOD)); |
//spincursor(); // Check if we want to spin the cursor... |
|
} |
|
/* |
/trunk/bootloaders/orpmon/drivers/uart.c
33,14 → 33,16
float float_divisor; |
|
/* Reset receiver and transmiter */ |
REG8(UART_BASE + UART_FCR) = UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT | UART_FCR_TRIGGER_4; |
REG8(UART_BASE + UART_FCR) = UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
| UART_FCR_CLEAR_XMIT | UART_FCR_TRIGGER_4; |
|
/* Disable all interrupts */ |
REG8(UART_BASE + UART_IER) = 0x00; |
|
/* Set 8 bit char, 1 stop bit, no parity */ |
REG8(UART_BASE + UART_LCR) = UART_LCR_WLEN8 & ~(UART_LCR_STOP | UART_LCR_PARITY); |
|
REG8(UART_BASE + UART_LCR) = UART_LCR_WLEN8 & ~(UART_LCR_STOP | |
UART_LCR_PARITY); |
|
/* Set baud rate */ |
float_divisor = (float) IN_CLK/(16 * UART_BAUD_RATE); |
float_divisor += 0.50f; // Ensure round up |