-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from TrampolineRTOS/fsylvestre/add_cr52_seria…
…l_ethernet_drivers Add cr52 serial ethernet drivers
- Loading branch information
Showing
41 changed files
with
4,879 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
#stop on errors | ||
set -e | ||
|
||
if [[ ! -d "_build" ]] | ||
then | ||
mkdir _build | ||
fi | ||
|
||
echo "*** Run Goil ***" | ||
goil --target=cortex-a-r/armv8/spider --templates=../../../../../goil/templates/ eth.oil | ||
|
||
echo "*** Run Make ***" | ||
./make.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
OIL_VERSION = "4.0"; | ||
|
||
IMPLEMENTATION trampoline { | ||
TASK { | ||
UINT32 STACKSIZE = 2048 ; | ||
} ; | ||
|
||
ISR { | ||
UINT32 STACKSIZE = 2048 ; | ||
} ; | ||
}; | ||
|
||
CPU eth { | ||
OS config { | ||
STATUS = EXTENDED; | ||
|
||
BUILD = TRUE { | ||
TRAMPOLINE_BASE_PATH = "../../../../.."; | ||
APP_SRC = "main.c"; | ||
APP_NAME = "eth_exe.elf"; | ||
CFLAGS = "-O0 -g -DHSCIF_1843200BPS -DNO_SYS"; | ||
LDFLAGS = "-Map=eth_exe.map"; | ||
COMPILER = "arm-none-eabi-gcc"; | ||
CPPCOMPILER = "arm-none-eabi-g++"; | ||
ASSEMBLER = "arm-none-eabi-as"; | ||
LINKER = "arm-none-eabi-ld"; | ||
COPIER = "arm-none-eabi-objcopy"; | ||
SYSTEM = PYTHON; | ||
LIBRARY = serial; | ||
LIBRARY = lwip; | ||
}; | ||
SYSTEM_CALL = TRUE; | ||
MEMMAP = TRUE { | ||
COMPILER = gcc; | ||
LINKER = gnu_ld { SCRIPT = "script.ld"; }; | ||
ASSEMBLER = gnu_as; | ||
MEMORY_PROTECTION = FALSE; | ||
}; | ||
}; | ||
|
||
APPMODE std {}; | ||
|
||
TASK sample_init { | ||
PRIORITY = 1; | ||
AUTOSTART = TRUE { APPMODE = std; }; | ||
ACTIVATION = 1; | ||
SCHEDULE = FULL; | ||
}; | ||
|
||
TASK monitor { | ||
PRIORITY = 1; | ||
AUTOSTART = FALSE; | ||
ACTIVATION = 1; | ||
SCHEDULE = FULL; | ||
}; | ||
|
||
/* ethernet driver needs */ | ||
TASK gwca1_rx_tx_task { | ||
PRIORITY = 2; | ||
AUTOSTART = FALSE; | ||
ACTIVATION = 1; | ||
SCHEDULE = FULL; | ||
}; | ||
|
||
ISR gwca1_rx_tx_int { | ||
CATEGORY = 2; | ||
PRIORITY = 2; | ||
SOURCE = GWCA1_RX_TX_INT; | ||
}; | ||
|
||
ISR gwca1_rx_ts_int { | ||
CATEGORY = 2; | ||
PRIORITY = 3; | ||
SOURCE = GWCA1_RX_TS_INT; | ||
}; | ||
|
||
ISR coma_err_int { | ||
CATEGORY = 2; | ||
PRIORITY = 4; | ||
SOURCE = COMA_ERR_INT; | ||
}; | ||
|
||
ISR gwca1_err_int { | ||
CATEGORY = 2; | ||
PRIORITY = 5; | ||
SOURCE = GWCA1_ERR_INT; | ||
}; | ||
|
||
ISR etha0_err_int { | ||
CATEGORY = 2; | ||
PRIORITY = 6; | ||
SOURCE = ETHA0_ERR_INT; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#include "tpl_os.h" | ||
#include "utils.h" | ||
#include "spider_serial.h" | ||
#include "string.h" | ||
#include "lwip/netif.h" | ||
#include "lwip/ip4_addr.h" | ||
#include "lwip/timeouts.h" | ||
#include "ethif.h" | ||
|
||
#define APP_Task_sample_init_START_SEC_CODE | ||
#include "tpl_memmap.h" | ||
|
||
ip4_addr_t ip4_addr, net_mask, gateway; | ||
struct netif ethif_netif; | ||
|
||
// Is this the right section for the main function?? | ||
FUNC(int, OS_APPL_CODE) main(void) | ||
{ | ||
StartOS(OSDEFAULTAPPMODE); | ||
return 0; | ||
} | ||
|
||
TASK(sample_init) { | ||
Serial_Init(); | ||
|
||
rswitch_enable_clock_and_reset(); | ||
port_init(); | ||
|
||
lwip_init(); | ||
|
||
IP4_ADDR(&ip4_addr, 192, 168, 1, 2); | ||
IP4_ADDR(&net_mask, 255, 255, 255, 0); | ||
IP4_ADDR(&gateway, 0, 0, 0, 0); | ||
|
||
netif_add(ðif_netif, &ip4_addr, &net_mask, &gateway, NULL, | ||
ethif_init, netif_input); | ||
|
||
netif_set_up(ðif_netif); | ||
|
||
ActivateTask(monitor); | ||
|
||
TerminateTask(); | ||
} | ||
|
||
#define APP_Task_sample_init_STOP_SEC_CODE | ||
#include "tpl_memmap.h" | ||
|
||
#define APP_Task_sample_init_START_SEC_CODE | ||
#include "tpl_memmap.h" | ||
|
||
TASK(monitor) { | ||
while (1) { | ||
sys_check_timeouts(); | ||
} | ||
} | ||
|
||
#define APP_Task_sample_init_STOP_SEC_CODE | ||
#include "tpl_memmap.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
#stop on errors | ||
set -e | ||
|
||
if [[ ! -d "_build" ]] | ||
then | ||
mkdir _build | ||
fi | ||
|
||
echo "*** Run Goil ***" | ||
goil --target=cortex-a-r/armv8/spider --templates=../../../../../goil/templates/ eth.oil | ||
|
||
echo "*** Run Make ***" | ||
./make.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
OIL_VERSION = "4.0"; | ||
|
||
IMPLEMENTATION trampoline { | ||
TASK { | ||
UINT32 STACKSIZE = 2048 ; | ||
} ; | ||
|
||
ISR { | ||
UINT32 STACKSIZE = 2048 ; | ||
} ; | ||
}; | ||
|
||
CPU eth { | ||
OS config { | ||
STATUS = EXTENDED; | ||
|
||
BUILD = TRUE { | ||
TRAMPOLINE_BASE_PATH = "../../../../.."; | ||
APP_SRC = "main.c"; | ||
APP_NAME = "eth_exe.elf"; | ||
CFLAGS = "-O0 -g -DHSCIF_1843200BPS"; | ||
LDFLAGS = "-Map=eth_exe.map"; | ||
COMPILER = "arm-none-eabi-gcc"; | ||
CPPCOMPILER = "arm-none-eabi-g++"; | ||
ASSEMBLER = "arm-none-eabi-as"; | ||
LINKER = "arm-none-eabi-ld"; | ||
COPIER = "arm-none-eabi-objcopy"; | ||
SYSTEM = PYTHON; | ||
LIBRARY = serial; | ||
LIBRARY = ethernet; | ||
}; | ||
SYSTEM_CALL = TRUE; | ||
MEMMAP = TRUE { | ||
COMPILER = gcc; | ||
LINKER = gnu_ld { SCRIPT = "script.ld"; }; | ||
ASSEMBLER = gnu_as; | ||
MEMORY_PROTECTION = FALSE; | ||
}; | ||
}; | ||
|
||
APPMODE std {}; | ||
|
||
TASK sample_init { | ||
PRIORITY = 1; | ||
AUTOSTART = TRUE { APPMODE = std; }; | ||
ACTIVATION = 1; | ||
SCHEDULE = FULL; | ||
}; | ||
|
||
TASK echo { | ||
PRIORITY = 1; | ||
AUTOSTART = FALSE; | ||
ACTIVATION = 1; | ||
SCHEDULE = FULL; | ||
}; | ||
|
||
TASK gwca1_rx_tx_task { | ||
PRIORITY = 2; | ||
AUTOSTART = FALSE; | ||
ACTIVATION = 1; | ||
SCHEDULE = FULL; | ||
}; | ||
|
||
ISR gwca1_rx_tx_int { | ||
CATEGORY = 1; | ||
PRIORITY = 3; | ||
SOURCE = GWCA1_RX_TX_INT; | ||
}; | ||
|
||
ISR gwca1_rx_ts_int { | ||
CATEGORY = 1; | ||
PRIORITY = 4; | ||
SOURCE = GWCA1_RX_TS_INT; | ||
}; | ||
|
||
ISR coma_err_int { | ||
CATEGORY = 1; | ||
PRIORITY = 5; | ||
SOURCE = COMA_ERR_INT; | ||
}; | ||
|
||
ISR gwca1_err_int { | ||
CATEGORY = 1; | ||
PRIORITY = 6; | ||
SOURCE = GWCA1_ERR_INT; | ||
}; | ||
|
||
ISR etha0_err_int { | ||
CATEGORY = 1; | ||
PRIORITY = 7; | ||
SOURCE = ETHA0_ERR_INT; | ||
}; | ||
}; |
Oops, something went wrong.