-
Notifications
You must be signed in to change notification settings - Fork 100
Zinc on Cortex-A #283
Comments
Zinc can technically run on anything that is supported by rustc, which includes cortex-a cores. There is no support for any cortex-a9 chips in the works though. While cortex-a cores can usually run things like linux and require more complex init sequences, I'm not entirely against adding bare metal cortex-a support into zinc in the future. |
how much effort is it to add those support? a basic support would already be great...many people use arm cortex a9 with xillinx zynq device... |
There is a very big amount of various Cortex-A cores, so it's a very hard target for zinc. What features would you like to see in Cortex-A code? |
for arm cortex a9: GPIO/s, VFPv3, Timers, shared memory access between the ARM and the FPGA by adding some interrupt logic ... how much effort is it to add those? |
This would be nice to see. @farcaller, can you quickly outline at a high level what would be needed by zinc to support the Zynq SoC? |
Just a clarification to my above comment, what I mean is: in general, what does zinc need to support a platform? Given that I can figure out the Zynq specifics... |
Like most things, zinc has layers:
I hope that is a sufficient overview. Also, don't forget the initialisation code, there is usually a system initialisation document detailing the order that things need to be activated (and please link to it in your comments wherever you reference it). Forgetting to initialise watchdogs causes lots of debugging grief. In the future (when I get some more time for Zinc), I'd like to decouple the above a little bit, so that the definition and instantiation of each layer is separate. i.e. ARM_systick_module_1 is implemented once in layer 1, and we map it into Cortex_M1 in a separate layer. Same for layer 2 peripherals, implement the vendor peripheral in one area, but instantiate it for the particular device somewhere else. |
And for completeness, there is also a layer of Zinc utilities. |
Thanks Ben, good overview. its nice to give each board a crate. Those could grow as large as they want. Now that I understand the layout a bit, I'll have a better time digging around. |
awesome zinc seems to build with nightly.... Any news about very basic support for arm corex a9? e.g. GPIO + Timer to toggle a LED... |
@Arnold1 I don't think anybody is working on it right now, but as always feel free to start it! |
Let's clarify terminology once again. Cortex-A9 is a computing core along with a very little set of peripherals (systick timer and MMU). It is somewhat different from the cores currently supported in zinc (Cortex-M0, M3 and M4), but not very different for adding support to be unbearable. Different MCU vendors incorporate ARM cores in their products, e.g. Raspberry Pi 2 has a BCM2836 CPU featuring Cortex-A7 core. Broadcomm provides IP for gpios, serial ports, audio, video, etc. on the same die as the ARM core is. So, speaking of adding Cortex-M9 support, the only core-specific thing we now have is a set of initialisation vectors, and adding that is trivial. Adding support for specific CPU or a family of CPUs is where complexity is. As far as I know xillinx zynq devices, those are FPGAs with ARM cores inside, so, basically, you provide the peripheral IP yourself (including gpio, serial and other things). I don't see how this fits zinc, as the peripheral configuration is defined by user and we just can't provide any kind of generic drivers. Speaking of Cortex-A profile support, I can consider looking at some easily-available board (RPi, beaglebone?) and giving directions on what is needed to add support for it in zinc. |
Hi Vladimir, I have started to look at the tool chain layer along with the layout On Monday, June 1, 2015, Vladimir Pouzanov <notifications@github.com
|
Ah, makes more sense then. Given that, the support plan would be the same as with other platforms, add support for any boot requirements for CPU, then add peripheral drivers. The issue with latter is that Platform Tree has a big chance to get a redesign, and we don't have good |
@farcaller thanks for the reply. could you prepare a basic toolchain e.g. platform tree as a start implementing the support for arm cortex a9? maybe @Bechamp whats to join in some work too... |
any feedback on this @farcaller @Bechamp ? |
Hi, trying to get hands on a board through work before committing. Also new On Friday, June 5, 2015, Arnold1 notifications@github.com wrote:
|
yes i have a board. i already used rust and mapped the fpga memory to linux using mmap... |
Which board? Also have you gotten vanilla rust to cross compile for it already? because On Friday, June 5, 2015, Arnold1 notifications@github.com wrote:
|
i have this board called redpitaya. but also might get a myirtech Z-turn Board... do you get a myirtech Z-turn Board as well? i already used rust and mapped the fpga memory to linux using mmap... but not yet bare metal... what is vanella rust? |
RedPitaya boards are a great application. I saw them when they were On Friday, June 5, 2015, Arnold1 notifications@github.com wrote:
|
i have not yet tried to build rust for bare metal... @farcaller can you jump in? |
Having worked on a number of Cortex-A devices (working on U-Boot, Embedded Linux, and also and RTOS project), I'm not sure it makes a lot of sense for Zinc to try to target them in the short term. Although targeting the core itself is and getting some code running in SRAM loaded on through JTAG is probably not terrible, these more powerful cores after often found within the context of more complicated SoCs which require more work to integrate with. Let's say we were to target something like the BeagleBone Black or Freescale i.mx6:
Maybe I have only worked with the more complex designs using these cores? I just wonder if it makes sense for Zinc to stay focused on M0, M0+, M3, M4 MCUs rather than targeting more powerful cores that really require an OS for reasonable use. |
I really agree with @posborne on this one, if your hardware supports u-boot, then there's really very little sense to bring zinc in. As for guidelines on where to start, I really have little idea how to initialise Cortex-A systems and can hardly advice on that. Maybe starting with barebones helloworld in rust that inits hw enough to blink a led is a reasonable starting point? We can then see how init code can be fit into zinc. |
why? some people run linux on core0 and bare metal on core1... hello world + blink a led sounds great... can you provide some infos on how to initialize the cortex a9? |
Hi Paul, SoCs are getting very complex with nonhomogeneous mutlicore arrangements I approached this discussion from the notion that 1) Rust is (T.b.h. Where I am right now as far as exposure to Rust, had I the time I On Friday, June 5, 2015, Paul Osborne notifications@github.com wrote:
|
@Bechamp lets build a hello world in rust targeting the arm cortex a9 as a proof of concept? |
@Bechamp you can take any existing C-based OS for Cortex-A9 and run rust code on it with reasonably little effort already. I envision zinc.rs as rust-only [RT]OS with no C code, the reasoning is to see what rust is missing to be used like that. |
That is what I felt this project was and support that. Which is why I'm not But, Arnold,
But after getting there, porting of zinc is somewhat within range. On Friday, June 5, 2015, Vladimir Pouzanov notifications@github.com wrote:
|
@Bechamp i agree... other reference: |
hi, i would like to contribute and started to port some C code to Rust: the original C source is here: Rust project (main.rs will implement a blink app): ...im not sure about the llvm-target for arm cortex a9!?
my c compiler (for linking the object files):
will libcompiler-rt.a only need boot.S? ...boot.S is part of the board support package (BSP): http://www.xilinx.com/support/documentation/sw_manuals/xilinx12_2/SDK_Doc/concepts/sdk_c_bsp_internal.htm How can i port offsetof(struct rproc_resource, code_cout) from C to Rust? @farcaller @posborne @bharrisau can you comment on this? |
can someone comment on this? |
The safest bet is to dump ti_ipc_remoteproc_ResourceTable in a hex editor and just make a [u8] vec in rust to make you going. |
@farcaller |
arm-unknown-eabi sounds like a reasonable target. as for boot.S, I haven't worked with Cortex-A in a long while so I can't really advice on the proper initialisation sequence. |
@farcaller but i cant see how the startup sequence is called. any idea? |
This is the entry: https://github.com/geraldstanje/rust-arm-cortex-a9/blob/master/orig/bare_metal_test.cpu1/lscript.ld#L33 That calls to the vector table: .section .vectors
_vector_table:
B _boot
B Undefined
B SVCHandler
B PrefetchAbortHandler
B DataAbortHandler
NOP /* Placeholder for address exception vector*/
B IRQHandler
B FIQHandler |
@farcaller |
I think it's a reasonable approximation. |
Hi,
is arm cortex a9 bare metal supported?
Thanks,
Gerald
The text was updated successfully, but these errors were encountered: