WIP: renesas_ra: Add (more) support for RA6M5 and RA2E1#2164
WIP: renesas_ra: Add (more) support for RA6M5 and RA2E1#2164desertsagebrush wants to merge 17 commits intoblackmagic-debug:mainfrom
Conversation
Currently missing only write and erase. And testing. That's important.
|
Still todo:
|
dragonmux
left a comment
There was a problem hiding this comment.
Done a review - very happy with the general direction you're managing to take this, there are only a few fairly small details we spotted that could do with being cleaned up/sorted.
src/target/renesas_ra.c
Outdated
| #define MF3_CF_BLOCK_SIZE (0x800U) | ||
| #define MF3_RA2A1_CF_BLOCK_SIZE (0x400U) | ||
| #define MF3_RA2A1_CF_BLOCK_SIZE (0x400U) // Contradicted by RA2A1 Ref Manual | ||
| #define MF3_DF_BLOCK_SIZE (0x400U) | ||
| #define MF3_CF_WRITE_SIZE (0x40U) | ||
| #define MF3_CF_WRITE_SIZE (0x8U) | ||
| #define MF3_RA2E1_CF_WRITE_SIZE (0x4U) | ||
| #define MF3_DF_WRITE_SIZE (0x1U) |
There was a problem hiding this comment.
We're aware this is, on your part, a "following the style set before", however the parens here are not doing anything useful and can (should) be dropped please. Their presence doesn't follow any of the rest of the code base.
There was a problem hiding this comment.
Sounds good! Would you like me to remove those from other places in this file while I'm at it?
src/target/renesas_ra.c
Outdated
| /* Code flash or data flash operation */ | ||
| const bool code_flash = addr < RENESAS_CF_END; | ||
|
|
||
| while (len) { |
There was a problem hiding this comment.
If it's possible to express this as a for loop over len, keeping len and addr constant, it would be better - the compiler's able to generate better code for this and prove to itself the correctness of the loop for optimisation purposes. Adding/tracking an offset turns out to be ~free due to instruction set things the compiler can take advantage of.
There was a problem hiding this comment.
Sounds good; Would you like me to see about doing the same thing for the RV40 flash functions, which follow the same pattern?
src/target/renesas_ra.c
Outdated
| target_mem32_write16(target, MF3_FSARL, (const uint16_t)(dest & 0xffffU)); | ||
| target_mem32_write16(target, MF3_FSARH, (const uint16_t)((dest >> 16) & 0xffffU)); | ||
|
|
||
| while (len) { |
There was a problem hiding this comment.
Same query here, especially as src could be cast to a buffer pointer so you only have one cast to uint8_t to do and then everything else already uses the right pointer width for the remainder
|
Currently, it mostly works; for some reason, repeated scans of the same target may not properly identify the device and report it as an unknown device (but it does call the Progress though! |
f91f8ea to
d9d91f8
Compare
Detailed description
Adding/expanding support for Renesas RA6M5, RA4M1, and RA2E1 microcontrollers.
Todo:
Your checklist for this pull request