uConsole - R-01 and RISC-V thread

just got the R-01 in the mail - we have snow on the ground so this is a good project - from other threads there have been issues with the keyboard - I think it works great for thumb typing - nice unit - working on some network tools etc on it - will be a great console and good for jotting notes. thanks for the notes on this thread!

1 Like

The Allwinner D1 doesnā€™t have cpufreq support, but the clock controller is very easy to poke at, and thereā€™s loads of overclocking headroom (at least on my machine):

use this at your own risk, you are directly poking SOC CCU registers! this should all reset back to safe defaults on a reboot, but it may be possible to cause hardware damage with this(!). the user manual wants you to switch the CPU clock to something that isnā€™t the PLL before modifying PLL settings (3.2.4.1), but I havenā€™t seen this crash yet (with reasonable overclocks). At your own risk!

see the Allwinner D1 user manual for the background.

to set the PLL multiplier for CPU domain, poke PLL_CPU_CTRL_REG-

busybox devmem 0x02001000 32 0xFA00XX00 (where XX is your multiplier value (N) - 1, in hex)

to set for DDR domain, poke PLL_CPU_CTRL_REG: busybox devmem 0x02001010 32 0xF800XX00 (where XX is your multiplier value (N) - 1, in hex).

the actual clock frequency for each domain is (24MHz * N). stock values are CPU N=0x30, DDR N=0x42. On my uConsole, I can overclock with reasonable stability to CPU N=0x46 (1700MHz CPU clock!), DDR N=0x61 (2328MHz)

This improves CPU performance by more than 50%, according to my benchmarks. (there may be even more room if youā€™re brave enough to increase voltagesā€¦ which is also fairly easy to do but is even more likely to cause hardware damage so iā€™m not going to give instructions for it here). Naturally, it will increase power consumption.

2 Likes

Did anyone try or researched osdev with R-01? So no linux, no nothing, just straight up bare metal?

Hi, I tried bare metal in R-01 and unfortunately, it was a complete fiasco, I would be very grateful if someone who succeeded could share the results.
Alwinner has a big Chinese community but I canā€™t find anything about the problem I tried to solve.

So what I personally have - yes is possible to boot Allwinner D1 by SPL and work with UART and GPIO absolutely fine (example projects like baremetal-lichee-rv or d1-nezha-baremeta), but if you want something more serious is almost not possible. In my case, I want to operate with a ClockworkPi Devterm display :joy:!

Display controlled by MIPI DSI interface in Allwinner documentation nothing about this, and no any open HAL or library.
Only what I found are drivers in the Linux kernel and look like the same drivers but adopted for RT-thread OS. Driver is a thousand lines of code mixed for all Allwinner platforms and with my programming experience is impossible to adapt to bare metal, wonder if someone can do this.
I tried to build a project only with these drivers and cut everything from OS specific, as a result, is compiled great, UART and GPIO work, but the Display is still black, why ? I donā€™t know.
Debugging is another headache to be solved.
I donā€™t want to upset you but I am disappointed and thinking of throwing D1 in the trash and buying some ARM.

I would be very grateful if someone could share the project where they managed to assemble the RT-thread for D1 with Sunxi HAL, I have a compilation error now.

2 Likes