mips: Import of mips32r2_common module#6060
Conversation
|
Took the freedom to rename the PR :-) |
|
@miri64 No worries, much nicer ;-) |
| @@ -0,0 +1,3 @@ | |||
| FEATURES_PROVIDED += periph_timer | |||
| FEATURES_PROVIDED += periph_uart | |||
| FEATURES_PROVIDED += cpp | |||
There was a problem hiding this comment.
Please use some existing Makefile.features as template for structuring this file:
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
# Various other features (if any)
FEATURES_PROVIDED += cpp
# The board MPU family (used for grouping by the CI system)
FEATURES_MCU_GROUP = mips32
boards/mips-malta/include/board.h
Outdated
| * @file | ||
| * @brief Board specific definitions for the MIPS Malta FPGA System. | ||
| * | ||
| * @author Imagination Technologies. |
There was a problem hiding this comment.
The author should AFAIK be person(s)
There was a problem hiding this comment.
does it matter, I'm not vain ;-)
There was a problem hiding this comment.
Actually, yes. We want to know who to ask when something breaks. ;)
boards/mips-malta/include/board.h
Outdated
| #endif | ||
|
|
||
| /** | ||
| * @brief Set how many increments of the count register per uS |
| * @brief Set how many increments of the count register per uS | ||
| * needed by timer code | ||
| */ | ||
| #define TICKS_PER_US (15) |
There was a problem hiding this comment.
If this is configuring the timer, I would expect it to be placed in the periph_conf.h
There was a problem hiding this comment.
The timer uses it, its the number of CPU core ticks per uS, so its not necessarily peripheral specific, peripherals could be (and often are) running from a different clock.
There was a problem hiding this comment.
I see, so never mind
| /* | ||
| * Copyright 2016, Imagination Technologies Limited and/or its | ||
| * affiliated group companies. | ||
| * This file is subject to the terms and conditions of the GNU Lesser |
| #define MIPS_MALTA_ADDR (0xbf000500) | ||
| #define MIPS_MALTA_VAL_RST (0x42) | ||
|
|
||
| static void malta_reset(void) |
There was a problem hiding this comment.
these addresses are CPU dependent, right? So they should go into the CPU code?!
There was a problem hiding this comment.
No, they are specific to the Malta FPGA platform only.
cpu/mips32r2_common/include/cpu.h
Outdated
| */ | ||
| static inline void cpu_init_early(void) | ||
| { | ||
| /* This function must exist else RIOT won't compile */ |
There was a problem hiding this comment.
Is this function mandatory by some parts of the MIPS toolchain or similar? RIOT itself does not care about it...
There was a problem hiding this comment.
Nope, looks like that one can go.
boards/mips-malta/Makefile.include
Outdated
| @@ -0,0 +1,3 @@ | |||
| export CPU = mips32r2_common | |||
| export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/ | |||
| export CFLAGS += -mhard-float -mdsp | |||
There was a problem hiding this comment.
How about a simple variable like USE_HARD_FLOAT and then checking that in the mips_common/Makefile.include and set the CFLAGS there?
cpu/mips32r2_common/thread_arch.c
Outdated
| p--; | ||
| *p-- = STACK_END_PAINT; | ||
|
|
||
|
|
There was a problem hiding this comment.
sorry, I meant to remove the double newline l74
|
Sorry for the late review and about being so picky about formatting and such... IMHO the PR looks quite good to me, mainly minor things that I noticed. Now when trying to compile it, I get and error resulting from |
|
Thanks for the review.
There are two toolchains for MIPS pre r6 (mips-mti-elf) and r6 onwards (mips-img-elf), MIPS_ELF_ROOT thus needs setting appropriately, I did add default paths to the makefile but Oleg asked me to remove them:
@OlegHahm on Sep 29 Member I don't think we want to have absolute paths here. 😉 @neiljay on Sep 30 They are '?=' ie defaults if nothing else is set and are the default locations the toolchain installs too, but I can remove them if that's what you prefer. @OlegHahm on Oct 13 Member Yes, I would prefer to remove the absolute paths. |
|
Hm, okay, maybe I misjudged. Not sure. On the one hand, I still don't like to have these absolute paths in the build system, on the other hand that's probably the most convenient to do for most of the users. @haukepetersen, do you have a preference? |
|
Hmm, I think not setting a default value sounds better to me, but how about some descriptive error message in case the variable is not set?! |
|
Before I forget, there is one more important problem we have to solve before we can merge this PR: we need to integrate the MIPS toolchain into our CI system. @kaspar030: is it easy to integrate the toolchain into Murdock?! |
done, along with the other changes you requested. Neill |
|
Cool, thanks. I already triggered @kaspar030 offline, to include the MIPS toolchain into the CI system, so we can put Murdock onto this PR |
|
Cool, thanks. I already triggered @kaspar030 offline, to include the MIPS toolchain into the CI system, so we can put Murdock onto this PR
I'm on int. Are you guys using the installer SDK version, or one of the
binary tarballs?
|
|
Just the tarballs, you'll want the 'MTI Bare Metal' ones, not 'IMG' ones
(or 'GNU Linux' ones).
…On 01/11/17 15:09, Kaspar Schleiser wrote:
> Cool, thanks. I already triggered @kaspar030 offline, to include the
MIPS toolchain into the CI system, so we can put Murdock onto this PR
I'm on int. Are you guys using the installer SDK version, or one of the
binary tarballs?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6060 (comment)>, or
mute the thread
<https://github.com/notifications/unsubscribe-auth/AUEU6pmSXVoilK7MfbBXPiXHG4ufN2A2ks5rRPC8gaJpZM4KphNc>.
|
|
Thanks @neiljay. The Docker image update is PR'ed here: RIOT-OS/riotdocker#24 Once that is merged, I'll update the image Murdock is using, and we should be able to test this. |
|
Murdock should be ready, let's see! |
|
The CI found a couple of problems. |
|
@neiljay would you please rebase to latest master? |
|
The rebase was clean, so I pushed it without a compile check first :-s |
|
See #5824 for the change. |
cpu/mips32r2_common adds base architecture support for mips32r2 cores it can be built in it own right as a 'CPU', but is dependant on a bootloader (like u-boot) to have bootstrapped the system, this has been tested on a 'malta' FPGA system (BOARD=mips-malta) with various mips32r2 compliant cores (interAptiv, P5600, etc).
Add basic support for the MIPS malta FPGA platform.
No UART is available on the mips-malta board so blacklist this board.
d8a66c4 to
00f2ae3
Compare
tests/leds/main.c
Outdated
| #include "board.h" | ||
| #include "periph_conf.h" | ||
|
|
||
|
|
There was a problem hiding this comment.
this one wasn't here before...
There was a problem hiding this comment.
hmm how did that get in, I'll fix.
00f2ae3 to
8434f9c
Compare
|
@haukepetersen Can you please revert your review request so we can finally get this merged! haukepetersen on Dec 12, 2016 Member these addresses are CPU dependent, right? So they should go into the CPU code?! No, they are specific to the Malta FPGA platform only. ah ok. |
|
Please update |
|
@gebart In a separate PR ? |
|
@neiljay I'm fine with having the info script update in a separate PR. |
kaspar030
left a comment
There was a problem hiding this comment.
There's minor stuff, but I think we should get this in and improve later. ACK.
|
@haukepetersen I'll dismiss your review, reading your comment it seems your comment has been addressed. |
All comments addressed, last one @haukepetersen said "ahok".
|
Congrats @neiljay for adding the first new architecture in years! Thanks for all the work! |
|
Thanks all ! |
|
Thank you very much everyone for your great work ! |
|
At last! Congratz and thanks for your big contribution and your patience @neiljay :party: ✨ |
|
yay! Congrats! |
|
Wow congrats! I'm looking forward to test it! Thanks to all people here. |
|
Congratulations on getting this large PR merged! |
Add support for the mips32r2 architecture to RIOT.
cpu/mips32r2_common adds base architecture support for mips32r2 cores it can be
built in it own right as a 'CPU', but is dependant on a bootloader (like u-boot)
to have bootstrapped the system, this has been tested on a 'malta' FPGA system
(BOARD=mips-malta) with various mips32r2 compliant cores (interAptiv, P5600,
etc).
NOTE: This port requires the use of the GCC based MIPS Codescape SDK toolchain
available here:
https://community.imgtec.com/developers/mips/tools/codescape-mips-sdk/download-codescape-mips-sdk-essentials/
This has been tested against the following examples:
hello-world
default
ipc_pingpong
timer_periodic_wakeup
riot_and_cpp
Note this is a re-work of #5885 with review comments addressed but now broken down into 3 separate PR's of which this is the first.