Live data from Hacker News

LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU

github.com

41–50 of 54 posts

Re: LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU

#41
post #31
post #29

Earlier quoted context omitted.

Why is this beneficial? It means you need to change several repositories to add one target triple. This may be a win in terms of in-tree stability, but it reduces accessibility to everyone else.

It is beneficial in that it discourages proprietary backends to LLVM which are not contributed back to LLVM. It is the same benefit GCC enjoys by using GPL.

Sounds like the LLVM project should be using the GPL.

This constant churn kind of turns the MIT license into the GPL but only for small companies and individuals who can't keep up with the churn. I guess that is why Apple likes LLVM.

Re: LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU

#42

What can you do with this?

To elaborate, I made this to develop an open source VPU side bootloader for Raspberry Pi because I was unhappy with the state of other C compilers targeting VC4 (I explained why in my blog). I haven't had the time to work on my firmware recently due to IRL events so I decided to publish the compiler. Not publishing any of the firmware work yet since it can't boot ARM yet (but SDRAM init reliably works across all boar…

Will you be getting this merged into LLVM upstream?

Re: LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU

#43

Earlier quoted context omitted.

To elaborate, I made this to develop an open source VPU side bootloader for Raspberry Pi because I was unhappy with the state of other C compilers targeting VC4 (I explained why in my blog). I haven't had the time to work on my firmware recently due to IRL events so I decided to publish the compiler. Not publishing any of the firmware work yet since it can't boot ARM yet (but SDRAM init reliably works across all boar…

Will you be getting this merged into LLVM upstream?

Don't think I can without first implementing MC emission and running LLVM unit tests on it.

Re: LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU

#44
post #28

Outstanding! Is it possible to use the LLVMLinux patches to run the kernel directly on the VC4?

VC4 itself doesn't have a MMU per se, it supports very limited memory remap (like PPC BATs) so running a conventional kernel on it is probably not possible. Best bet would be to port an RTOS to it, but my current plan for my firmware pretty much involves halting the VPU once the ARM is running.

Re: LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU

#45

Earlier quoted context omitted.

To elaborate, I made this to develop an open source VPU side bootloader for Raspberry Pi because I was unhappy with the state of other C compilers targeting VC4 (I explained why in my blog). I haven't had the time to work on my firmware recently due to IRL events so I decided to publish the compiler. Not publishing any of the firmware work yet since it can't boot ARM yet (but SDRAM init reliably works across all boar…

Great work. Very interested to see what you have going on the firmware side.

I outlined what I did in another comment, here's a log from my current firmware: http://crna.cc/vpu_bootlog.txt

I think I'm on the right track but I don't have ARM working yet, most likely due to clock misconfiguration. Can probably fix it when I have more time.

Sidenote, I wish #raspberrypi-internals was more active :(

Re: LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU

#46
post #35

Earlier quoted context omitted.

Does Apple have some proprietary backends? I guess they have the resources to maintain such.

Yes, they definitely do.

Like what, nowadays? I know their ARM64 backend was, but what is now? Do they still maintain forks of them? (With more target data for their SoCs?)

Re: LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU

#47
post #35

Earlier quoted context omitted.

Yes, they definitely do.

Like what, nowadays? I know their ARM64 backend was , but what is now? Do they still maintain forks of them? (With more target data for their SoCs?)

GPUs.

Re: LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU

#48
post #35

Earlier quoted context omitted.

Yes, they definitely do.

Like what, nowadays? I know their ARM64 backend was , but what is now? Do they still maintain forks of them? (With more target data for their SoCs?)

Swift is still out-of-tree.

Re: LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU

#50
post #49

I did GCC too, https://github.com/puppeh/vc4-toolchain .

Yeah, I saw, I haven't looked at it in detail but I think yours probably works better than mine since you did comprehensive testing. My only tests involved compiling my own firmware code, but from what I can tell, it works well, I haven't ran into any bugs yet aside from what I outlined in the README.

The assembler/linker I'm using is not ideal, I want to get MC code emission working eventually. I saw that you mentioned limitations on ld/st, why not use lea for data?

For example:

  BB1_12:                                 # %sdram_clkman_update_end.exit2
	mov r0, 2114982312 # long
	ld r2, (r0)
	lea r0, .str8(pc) # PCrel load
	lea r1, __FUNCTION__.sdram_init_late(pc) # PCrel load
	bl xprintf
Post reply on HN