Comments (5)
Hi,
Thanks for the through testing!
The mbox[4]=8 is correct, because "set clock rate" has an 8 bytes response, see https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface#set-clock-rate
According to my tests, with some tags on real hardware you have to tell the GPU how much space you've allocated for the response, so I like to set the response buffer size for all tags (won't hurt even if it's not strictly required). You'll see that with the LFB Mailbox as well. Spending some time with ARM documentations and you'll realize that they are sometimes contradictional, and real hardware does not necessarily work as described.
And about the 12 bytes input, you're right. I've copied this code from my production ready bootloader, where readibility wasn't a goal. It's working because the "last tag" macro is 0, so this also works as a third parameter which clears turbo as intended. To be 100% correct, it should be
mbox[0]=9*4;
...
mbox[7]=0;
mbox[8]=MBOX_TAG_LAST;
But doesn't really matter because now mbox[7] is zero anyway and we have mbox[0]=8*4, so GPU won't read mbox[8] (MBOX_TAG_LAST is not mandatory, mbox size is more important).
But I'll fix that to make the code clearer, give me a day or so, unfortunately right now I've other things to attend to. If you find anything else in the meantime, I'll commit them too.
Thanks again,
bzt
from raspi3-tutorial.
hmm compare to this tutorial:
http://www.valvers.com/open-software/raspberry-pi/step05-bare-metal-programming-in-c-pt5/
After set tag and size of buffer is olways 0 as /* Request */. I didn't find anywhere info about setting response buffer size.
from raspi3-tutorial.
hmm compare to this tutorial:
That tutorial has other issues as well, although I give you that using va args for mbox tags is pretty smart and elegant. Btw that's not for BCM2837, and I'm not sure they have tested it on RPi3 at all.
I didn't find anywhere info about setting response buffer size.
Me neither :-) I know that empirically. I've also made that mistake first to trust ARM documentation. Never do that. Use any documentation as a guide, and ALWAYS test your code on a real machine. I've spent more than a week figuring out what's wrong with my MMU code. As it turned out, it was a documentation issue, as the official ARM Developer Guide neglected to mention that the encoding of 4k page size in TCR differs for TTBR0 and TTBR1. Who'd have thought of that?
Also compare the doc with the arm trusted firmware example code. There'll be lots of differences, but thankfully you can try out the code :-) For example this little nuance about CnP bit is not mentioned in the docs at all (at least it wasn't last time I checked).
Oh, and always look for errata. There are lots of fixes for the BCM2835/6/7 which can save your day.
bzt
from raspi3-tutorial.
Hi again,
It took me a while, but at last I have my raspberry pi 3 A+. I test it with this 0 after buffer size and it work well. However your version work too, so this is only detail.
from raspi3-tutorial.
I know that this is a little late, but I'd like to point out that the mailbox interface is not hardware and is monitored by the software running on the GPU.
from raspi3-tutorial.
Related Issues (20)
- Reference document to understand code and commands in 0B_readsector HOT 1
- 0x1C2 no longer has 0xE or 0xC partition type HOT 2
- 0B ReadSector - Stable clock troubleshooting HOT 8
- Typos - bareminimum readme HOT 3
- Using sd_readblock() for reading directories HOT 9
- 0A PCScreenFont only works in QEMU HOT 7
- 0B_readsector stuck after EMMC: Sending command 33220010 arg 00000000 HOT 1
- Segmentation fault on execution of 09_framebuffer and 0A_pcscreenfont HOT 6
- Using U-boot to boot kernel8.img HOT 2
- about the uart HOT 4
- Emulating the raspi 3 on jetson nano failed with a black screen. HOT 1
- Explanation for mailboxes HOT 4
- How to tune the booting parameters of Lineage 16 for Raspi 3 to boot it with qemu / kvm on the Jetson nano... HOT 1
- 14_raspbooin64 HOT 5
- Please help to understand the load address 0x800000 in the linker file HOT 2
- uart0 tutorial issue HOT 1
- Why *EMMC_INTERRUPT=*EMMC_INTERRUPT; in sd.c? HOT 1
- How do you debugger with gdb-multiarch? HOT 6
- Why ptr+=4 or ptr+=3? HOT 7
- qemu emulation not working HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raspi3-tutorial.