mirror of
https://github.com/retroSoC/retroSoC.git
synced 2026-11-04 22:32:36 +00:00
- Added build_hp_rtthread.py for building the RT-Thread kernel with RV64 support. - Updated build_hp_smoke.py to target RV64 architecture and modified output filenames. - Modified generate_vexiiriscv.py to reflect RV64 configuration and memory management. - Created hp_tools.py for shared utilities related to RV64 builds. - Enhanced package_hp_boot.py to package RV64 workloads and updated versioning. - Implemented run_hp_sim.py for executing and validating HP workloads with specific markers. - Developed setup_hp_rtthread.py for installing RT-Thread source and environment setup. - Updated GenerateRetroSocHp.scala to generate RV64 application cores. - Enhanced tests for HP boot bundles, platform specifications, and tool utilities to accommodate RV64 changes. - Adjusted test cases to validate new workload types and ensure compatibility with RV64 architecture.
50 lines
1.4 KiB
C
50 lines
1.4 KiB
C
/* Linux-only acceptance helper; the freestanding SDK does not depend on libc. */
|
|
#include <fcntl.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include <sys/mman.h>
|
|
#include <unistd.h>
|
|
|
|
int main(int argc, char **argv) {
|
|
uint32_t error = 0U;
|
|
int descriptor;
|
|
void *mapping;
|
|
volatile uint32_t *mailbox;
|
|
if (argc == 2) {
|
|
if ((argv[1][0] == '1') && (argv[1][1] >= '1') && (argv[1][1] <= '7') &&
|
|
(argv[1][2] == '\0')) {
|
|
error = 10U + (uint32_t)(argv[1][1] - '0');
|
|
} else {
|
|
error = 20U;
|
|
}
|
|
} else if (argc != 1) {
|
|
error = 21U;
|
|
}
|
|
descriptor = open("/dev/mem", O_RDWR | O_SYNC);
|
|
if (descriptor < 0) {
|
|
(void)puts("HP_LINUX_INIT_FAILED devmem");
|
|
return 1;
|
|
}
|
|
mapping = mmap(NULL, 4096U, PROT_READ | PROT_WRITE, MAP_SHARED, descriptor, 0x10019000);
|
|
if (mapping == MAP_FAILED) {
|
|
(void)puts("HP_LINUX_INIT_FAILED mmap");
|
|
(void)close(descriptor);
|
|
return 1;
|
|
}
|
|
mailbox = (volatile uint32_t *)mapping;
|
|
if (error == 0U) {
|
|
(void)puts("retroSoC HP Linux ready");
|
|
} else {
|
|
(void)printf("HP_LINUX_INIT_FAILED code=%u\n", error);
|
|
}
|
|
(void)fflush(stdout);
|
|
mailbox[8] = (error == 0U) ? 1U : 3U;
|
|
mailbox[9] = (error == 0U) ? UINT32_C(0x4C4E5801) : error;
|
|
mailbox[10] = 1U;
|
|
__asm__ volatile("fence iorw, iorw" ::: "memory");
|
|
mailbox[11] = 1U;
|
|
for (;;) {
|
|
(void)pause();
|
|
}
|
|
}
|