Compare commits
3 Commits
428d3ac285
...
f21ea46bef
Author | SHA1 | Date | |
---|---|---|---|
f21ea46bef | |||
b9b8c51957 | |||
b6ce43f57a |
14
env/ehrenberg/link.lds
vendored
14
env/ehrenberg/link.lds
vendored
@ -131,6 +131,13 @@ SECTIONS
|
||||
*(.gnu.linkonce.d.*)
|
||||
} >ram AT>flash :ram_init
|
||||
|
||||
.sdata :
|
||||
{
|
||||
__SDATA_BEGIN__ = .;
|
||||
*(.sdata .sdata.*)
|
||||
*(.gnu.linkonce.s.*)
|
||||
} >ram AT>flash :ram_init
|
||||
|
||||
.srodata :
|
||||
{
|
||||
*(.srodata.cst16)
|
||||
@ -140,13 +147,6 @@ SECTIONS
|
||||
*(.srodata .srodata.*)
|
||||
} >ram AT>flash :ram_init
|
||||
|
||||
.sdata :
|
||||
{
|
||||
__SDATA_BEGIN__ = .;
|
||||
*(.sdata .sdata.*)
|
||||
*(.gnu.linkonce.s.*)
|
||||
} >ram AT>flash :ram_init
|
||||
|
||||
. = ALIGN(4);
|
||||
PROVIDE( _edata = . );
|
||||
PROVIDE( edata = . );
|
||||
|
2
env/ehrenberg/platform.h
vendored
2
env/ehrenberg/platform.h
vendored
@ -43,7 +43,7 @@
|
||||
#include "ehrenberg/devices/fki_cluster_info.h"
|
||||
|
||||
#define XIP_START_LOC 0xE0040000
|
||||
#define RAM_START_LOC 0x80000000
|
||||
#define RAM_START_LOC 0xC0000000
|
||||
|
||||
// Misc
|
||||
|
||||
|
18
env/ehrenberg/ram.lds
vendored
18
env/ehrenberg/ram.lds
vendored
@ -118,10 +118,18 @@ SECTIONS
|
||||
|
||||
.data :
|
||||
{
|
||||
__DATA_BEGIN__ = .;
|
||||
*(.data .data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
} >ram AT>rom :ram_init
|
||||
|
||||
.sdata :
|
||||
{
|
||||
__SDATA_BEGIN__ = .;
|
||||
*(.sdata .sdata.*)
|
||||
*(.gnu.linkonce.s.*)
|
||||
} >ram AT>rom :ram_init
|
||||
|
||||
.srodata :
|
||||
{
|
||||
PROVIDE( __global_pointer$ = . + 0x800 );
|
||||
@ -132,12 +140,6 @@ SECTIONS
|
||||
*(.srodata .srodata.*)
|
||||
} >ram AT>rom :ram_init
|
||||
|
||||
.sdata :
|
||||
{
|
||||
*(.sdata .sdata.*)
|
||||
*(.gnu.linkonce.s.*)
|
||||
} >ram AT>rom :ram_init
|
||||
|
||||
. = ALIGN(4);
|
||||
PROVIDE( _edata = . );
|
||||
PROVIDE( edata = . );
|
||||
@ -155,6 +157,7 @@ SECTIONS
|
||||
} >ram AT>ram :ram
|
||||
|
||||
. = ALIGN(8);
|
||||
__BSS_END__ = .;
|
||||
PROVIDE( _end = . );
|
||||
PROVIDE( end = . );
|
||||
|
||||
@ -164,4 +167,7 @@ SECTIONS
|
||||
. = __stack_size;
|
||||
PROVIDE( _sp = . );
|
||||
} >ram AT>ram :ram
|
||||
|
||||
PROVIDE( tohost = 0xfffffff0 );
|
||||
PROVIDE( fromhost = 0xfffffff8 );
|
||||
}
|
||||
|
21
env/ehrenberg/rom.lds
vendored
21
env/ehrenberg/rom.lds
vendored
@ -4,8 +4,8 @@ ENTRY( _start )
|
||||
|
||||
MEMORY
|
||||
{
|
||||
rom (rxai!w) : ORIGIN = 0xF0080000, LENGTH = 4k
|
||||
ram (wxa!ri) : ORIGIN = 0xC0000000, LENGTH = 32k
|
||||
rom (rxai!w) : ORIGIN = 0xF0080000, LENGTH = 2k
|
||||
ram (wxa!ri) : ORIGIN = 0xC0000000, LENGTH = 128k
|
||||
}
|
||||
|
||||
PHDRS
|
||||
@ -118,13 +118,20 @@ SECTIONS
|
||||
|
||||
.data :
|
||||
{
|
||||
__DATA_BEGIN__ = .;
|
||||
*(.data .data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
} >ram AT>rom :ram_init
|
||||
|
||||
.sdata :
|
||||
{
|
||||
__SDATA_BEGIN__ = .;
|
||||
*(.sdata .sdata.*)
|
||||
*(.gnu.linkonce.s.*)
|
||||
} >ram AT>rom :ram_init
|
||||
|
||||
.srodata :
|
||||
{
|
||||
PROVIDE( __global_pointer$ = . + 0x800 );
|
||||
*(.srodata.cst16)
|
||||
*(.srodata.cst8)
|
||||
*(.srodata.cst4)
|
||||
@ -132,12 +139,6 @@ SECTIONS
|
||||
*(.srodata .srodata.*)
|
||||
} >ram AT>rom :ram_init
|
||||
|
||||
.sdata :
|
||||
{
|
||||
*(.sdata .sdata.*)
|
||||
*(.gnu.linkonce.s.*)
|
||||
} >ram AT>rom :ram_init
|
||||
|
||||
. = ALIGN(4);
|
||||
PROVIDE( _edata = . );
|
||||
PROVIDE( edata = . );
|
||||
@ -155,6 +156,8 @@ SECTIONS
|
||||
} >ram AT>ram :ram
|
||||
|
||||
. = ALIGN(8);
|
||||
__BSS_END__ = .;
|
||||
__global_pointer$ = MIN(__SDATA_BEGIN__ + 0x800, MAX(__DATA_BEGIN__ + 0x800, __BSS_END__ - 0x800));
|
||||
PROVIDE( _end = . );
|
||||
PROVIDE( end = . );
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "platform.h"
|
||||
#include "stub.h"
|
||||
@ -12,6 +13,8 @@
|
||||
#include "semihosting.h"
|
||||
#endif
|
||||
|
||||
extern uint32_t tohost;
|
||||
|
||||
ssize_t __wrap_write(int fd, const void *ptr, size_t len) {
|
||||
const uint8_t *current = (const uint8_t *)ptr;
|
||||
#if defined(SEMIHOSTING)
|
||||
@ -25,6 +28,14 @@ ssize_t __wrap_write(int fd, const void *ptr, size_t len) {
|
||||
return len;
|
||||
}
|
||||
// return len;
|
||||
#elif defined(BOARD_iss)
|
||||
volatile uint64_t payload[4];
|
||||
payload[0]= 64;
|
||||
payload[1]= 0;
|
||||
payload[2]= (uintptr_t)ptr;
|
||||
payload[3]= len;
|
||||
tohost = (uint32_t)payload;
|
||||
return len;
|
||||
#endif
|
||||
if (isatty(fd)) {
|
||||
for (size_t jj = 0; jj < len; jj++) {
|
||||
@ -38,7 +49,7 @@ ssize_t __wrap_write(int fd, const void *ptr, size_t len) {
|
||||
uart_write(uart, '\r');
|
||||
}
|
||||
#elif defined(BOARD_iss)
|
||||
*((uint32_t *)0xFFFF0000) = current[jj];
|
||||
// *((uint32_t *)0xFFFF0000) = current[jj];
|
||||
#elif defined(BOARD_TGCP)
|
||||
// TODO: implement
|
||||
#else
|
||||
|
Reference in New Issue
Block a user