-
Notifications
You must be signed in to change notification settings - Fork 165
feat(tricore): Initial tricore support #242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
f92535a to
57284c8
Compare
9ad59e5 to
474545c
Compare
b9e1caf to
7da4f29
Compare
829c219 to
61b37aa
Compare
0e5ea75 to
bf61453
Compare
bf61453 to
20a40db
Compare
674ffd5 to
3d1e91a
Compare
20a40db to
fd1cd5d
Compare
3d1e91a to
53e6ea9
Compare
44a2cbb to
3d6619f
Compare
04f6748 to
1a50d5c
Compare
3d6619f to
1e889fb
Compare
bffccac to
661df87
Compare
ba20ef7 to
f2194f5
Compare
f2194f5 to
f245bf9
Compare
2f2f67b to
e1f3764
Compare
b48e54e to
589db10
Compare
eaff81e to
2604d12
Compare
6a7ac60 to
aa1cc63
Compare
19ee033 to
cb1d682
Compare
26b96ec to
85e295e
Compare
85e295e to
319dace
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a quick review.
For now the my main comments are regarding stale code comments and magic numbers, I don't think my comments address them all, please check them more carefully than I did.
There's also some instances of using platformed defined values that need to be made more general to handle multiple platforms.
src/arch/tricore/inc/arch/cache.h
Outdated
|
|
||
| #include <bao.h> | ||
|
|
||
| #define CACHE_MAX_LVL 8 // Does this make sense in all architectures? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this?
| { | ||
| __asm__ volatile("isync\n\t" ::: "memory"); | ||
| } | ||
|
|
||
| static inline void fence_ord_read(void) | ||
| { | ||
| __asm__ volatile("isync\n\t" ::: "memory"); | ||
| } | ||
|
|
||
| static inline void fence_ord(void) | ||
| { | ||
| __asm__ volatile("isync\n\t" ::: "memory"); | ||
| } | ||
|
|
||
| static inline void fence_sync_write(void) | ||
| { | ||
| __asm__ volatile("isync\n\t" ::: "memory"); | ||
| } | ||
|
|
||
| static inline void fence_sync_read(void) | ||
| { | ||
| __asm__ volatile("isync\n\t" ::: "memory"); | ||
| } | ||
|
|
||
| static inline void fence_sync(void) | ||
| { | ||
| __asm__ volatile("isync\n\t" ::: "memory"); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implement the correct fence
| #define HYPCALL_IN_ARG_REG(ARG) ((ARG) + 1 + 15 + 5) | ||
| #define HYPCALL_OUT_ARG_REG(ARG) (HYPCALL_IN_ARG_REG(ARG)) | ||
|
|
||
| // #define HYPCALL_ARG_REG(ARG) ((ARG) + REG_A0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment
| #define IPI_CPU_MSG (0x1460 / 4) /* TODO this is the first GPSR in TC49 */ | ||
| #define GSPR_SRC_BASE (0x1460 / 4) /* TODO this is the first GPSR in TC49 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to a platform defined
src/arch/tricore/inc/arch/ir.h
Outdated
| #define GET_IR_SR_VALID(reg) (((reg) & IR_SR_VALID_MASK) >> IR_SR_VALID_POS) | ||
| #define GET_IR_SR_PN(reg) (((reg) & IR_SR_PN_MASK) >> IR_SR_PN_POS) | ||
|
|
||
| /* ACCESSEN Register */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lost comment
| // TODO: All vms start running at "same" time? | ||
| if (1) { | ||
| vcpu_arch_entry(); | ||
| } /*else { | ||
| cpu_idle(); | ||
| }*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfinished
| uart->FLAGSENABLE = 0; | ||
| uart->FLAGSCLEAR = 0xFFFFFFFF; | ||
|
|
||
| uart->FLAGSENABLE = 1 << 16 | 1 << 18 | 1 << 26 | 1 << 27 | 1 << 30; // parity error PEE, frame |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use macros instead of magic numbers
src/platform/tc4dx/platform.mk
Outdated
| platform_description:=tc4dx_desc.c | ||
|
|
||
| TRICORE_MCPU=tc4DAx | ||
| #TRICORE_MCPU=tc4xx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stale
Makefile
Outdated
| -Wstrict-prototypes -Wunused-but-set-variable \ | ||
| -Wno-multistatement-macros |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity why is this needed?
| const uint32_t plat_int_size = sizeof(plat_ints) / 4; | ||
| #endif | ||
|
|
||
| const struct plat_device dev_array[] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bao needs to explicitly lock access to these peripherals before selectively assigning them to each VM
0878a8c to
c3db84e
Compare
c3db84e to
abd09d6
Compare
abd09d6 to
83500c2
Compare
Signed-off-by: Miguel Silva <[email protected]>
83500c2 to
c5745c5
Compare
PR Description
This PR introduces the initial support for Infineon Tricore architectures.
This PR requires #218 to support boot from flash with a non-unified memory model.
The current state of this port supports baremetal and freeRTOS guests in single or multicore setups. At the moment, each guest is given an unique ID, and each core only executes one guest.
The following list shows what is missing: