Page 1 of 1
MPC5748G / GreenHills(GHS) porting
Posted: Wed Apr 29, 2015 11:09 am
by alexvinchev
Hi,
I'm trying to port ChibiOS for one of the newest and biggest Freescale Qorivva MCUs - MPC5748G(
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC5748G). Specific part is that I'm using GreenHills compiler, which is a bit different from GCC.
Did anyone tried to do similar port? Is there something (traps, hints, etc.) I should be aware of?
MCU has three cores - two e200z4204n3 cores and one e200z210n3 core, I'm working on core 0 (e200z4204n3).
Re: MPC5748G / GreenHills(GHS) porting
Posted: Wed Apr 29, 2015 1:32 pm
by Giovanni
Hi,
GHS is very similar to GCC, the port should be simple. The things to do are:
1) ASM modules should be translated for the GHS assembler, the syntax is a bit different, the code itself does not change.
2) Linker .ld files should be translated for the GHS linker, it is similar to the GNU linker but I am not sure those will work as-is.
3) Makefiles: probably rules.mk will require some minor changes in order to invoke GHS instead of GCC.
OS and port C code should not change at all.
Giovanni
Re: MPC5748G / GreenHills(GHS) porting
Posted: Wed Apr 29, 2015 9:36 pm
by alexvinchev
Hi,
Thank you for this very fast reply.
I've almost ready with the code, but (so far) I have two questions:
- where did you take the TSR address for IVOR10 implementation?
- where decrementer is initialized?
Regarding porting of the assembler files, it is stated that my cores do not support BookE instruction set, so I had to choose between 16 bit and 32 bit VLE instructions manually.
I've started my work on 2.6.7 and as soon as it seems running I'll most probably go forward to 2.6.8 or 3.0...
Re: MPC5748G / GreenHills(GHS) porting
Posted: Wed Apr 29, 2015 9:47 pm
by Giovanni
Hi,
DEC is initialized in the HAL (hal_lld_init) because it is in that context that the clock frequency is known, if you plan to work without HAL then the initialization is left to the application and should be performed before chSysInit().
SFR numbers are documented in the Z4 manual, I think it is available on the FSL web site. Note that latest Z4 cores do not support MMU, TBR, DEC and IVORs, I am not sure if your device is one of those.
If DEC is missing then you can use one of the MCU timers, the STM or PIT for example.
Giovanni