What's going on... 
I get a lot of questions regarding RK3066 kernel development. Sorry if I didn't answer your question yet. It may take some time, but I'll clean up my email box in the end.

I've been breaking my head on Wifi/Bluetooth support for the MK808B. That took a lot of my time. I disassembled the stock kernel to find out what parts are currently missing in our kernel code. But I still haven't identified the piece of code that is responsible for the RK903 to do it's job. I still don't give up yet, but this one is hard to crack. Thanks again to Rockchip for keeping the kernel closed source. It sucks big time!

In the meantime I got myself an ODROID-U2. This device is based on a quad core Exynos4412 Prime ARM Cortex-A9 running at 1.7Ghz. This is the first quad core device I got my hands on, and first impressions are that this device is really speedy.

I haven't had much time to tinkle with it, but I think this device is capable of running as a full fledged media device.

Good thing is that kernel source is available for the Exynos4412, and there are several distributions to choose from already, including Ubuntu, Xubuntu, Debian, Fedora, OpenSUSE and of course Android.

I also got a V8 donated from Tomato. This dual core RK3066 device has one big advantage over the MK808 device. The external Wifi antenna provides the reception that the MK808 is missing badly.

Apart from the Wifi antenna there's not much difference compared to the MK808 though. It doesn't have Bluetooth, it runs Android 4.1 and has the same connectivity. Stock kernel is so that definitely needs an update.

Since I got this device sponsored by the manufacturer I tried to get my hands on the RK3066 kernel source through them as well. Without success, that's still a no-go. I tried to explain the value of open source, and what the open source community could do to help boost their sales. But somehow they feel that by returning kernel sources to the community, like they're obliged to do according to the GPL license, they are giving away intellectual property. It's like talking to a chair really!

[ 6 comments ] ( 286 views )   |  permalink  |   ( 3 / 16487 )
RK3066 - The MK808B Wifi/Bluetooth chip (RK903) 
I got a MK808B donated recently (thanks again Alejandro!). Where the MK808 has a RK901 Wifi chip on-board, the MK808B model contains the RK903 which combines Wifi and Bluetooth functionality.

A lot of you have tried to build a kernel with support for the RK903 Wifi and Bluetooth, up until now without success. So I gave it a try myself. I used a Broadcom 4330 driver as a base, one that matches the stock kernel driver as close as possible. Stock kernel uses version and I use version

It is still very much a work in progress, since I have to reverse engineer the (closed source) driver used by Rockchip. This is the current status of my findings. Look at the differences in the kernel logs.

In the stock kernel, the driver generates following output:
==== Launching Wi-Fi driver! (Powered by Rockchip) ====
RKWIFI WiFi driver (Powered by Rockchip,Ver 4.23) init.
dhd_module_init: Enter
=========== WLAN placed in POWER ON ========
ANDROID-ERROR) ## wifi_probe
ANDROID-ERROR) wifi_set_power = 1
rk29sdk_wifi_power: 1
wifi turn on power
ANDROID-ERROR) wifi_set_carddetect = 1
mmc1: slot status change detected(0-1)
rk29_sdmmc_change_clk_div..1921.. newDiv=42, newCLK=294Khz [sdio]
Linux Kernel SDIO/MMC Driver

Dongle Host Driver, version
Compiled in drivers/net/wireless/bcmdhd on Aug 24 2012 at 09:28:21
drivers/mmc/core/core.c...1827.. ===== mmc_rescan Begin....[mmc1]

mmc_attach_sdio..800.. ===== Begin to identify card as SDIO-card. [mmc1]
rk29_sdmmc_change_clk_div..1921.. newDiv=0, newCLK=24750Khz [sdio]
mmc1: new high speed SDIO card at address 0001
FW_PATH = /system/etc/firmware/fw_RK903.bin
NVRAM_PATH = /system/etc/firmware/nvram_RK903_26M.cal
F1 signature read @0x18000000=0x16044330
DHD: dongle ram size is set to 294912(orig 294912)

This is the first part only. The driver attaches nicely to the SDIO driver. Now this is where I go wrong apparently. Looking at the kernel output of my kernel, the driver shows up as follows:
==== Launching Wi-Fi driver! (Powered by Rockchip) ====
BCMDHD Wi-Fi driver (Powered by Rockchip, reverse engineered by Omegamoon) init.
rockchip_wifi_init_module: Enter
## wifi_probe
wifi_set_power = 1
rk29sdk_wifi_power: 1
wifi turn on power
wifi_set_carddetect = 1
mmc1: slot status change detected(0-1)
rk29_sdmmc_change_clk_div..1921.. newDiv=42, newCLK=294Khz [sdio]
Linux Kernel SDIO/MMC Driver
Dongle Host Driver, version
Compiled in drivers/net/wireless/bcmdhd on Mar 16 2013 at 11:36:56

drivers/mmc/core/core.c...1861.. ===== mmc_rescan Begin....[mmc1]
rockchip_wifi_init_module: sdio_register_driver timeout
## wifi_remove

Somehow the driver is unable to attach to the SDIO driver, resulting in a timeout. So I added some debug information to find out what goes on, resulting in the following output:
==== Launching Wi-Fi driver! (Powered by Rockchip) ====
BCMDHD Wi-Fi driver (Powered by Rockchip, reverse engineered by Omegamoon) init.
rockchip_wifi_init_module: Enter
## wifi_probe
Omegamoon >> wl_android function wifi_set_power entered...
wifi_set_power = 1
rk29sdk_wifi_power: 1
wifi turn on power
wifi_set_carddetect = 1
mmc1: slot status change detected(0-1)
rk29_sdmmc_change_clk_div..1921.. newDiv=42, newCLK=294Khz [sdio]
Omegamoon >> bcmsdh_linux function bcmsdh_register entered...
Linux Kernel SDIO/MMC Driver
Dongle Host Driver, version
Compiled in drivers/net/wireless/bcmdhd on Mar 16 2013 at 11:36:56

drivers/mmc/core/core.c...1861.. ===== mmc_rescan Begin....[mmc1]
Omegamoon >> mmc_rescan_try_freq: mmc_power_up(mmc1) at 300000 Hz...
Omegamoon >> mmc_rescan_try_freq: mmc_go_idle(mmc1)...
Omegamoon >> mmc_rescan_try_freq: mmc_attach_sdio(mmc1)...
Omegamoon >> sdio function mmc_attach_sdio entered...
Omegamoon >> back from mmc_send_io_op_cond with code -12
Omegamoon >> mmc_rescan_try_freq: Could NOT mmc_attach_sdio(mmc1), code 255...
Omegamoon >> mmc_rescan_try_freq: mmc_attach_sd(mmc1)...
Omegamoon >> mmc_rescan_try_freq: Could NOT mmc_attach_sd(mmc1), code 255...
Omegamoon >> mmc_rescan_try_freq: mmc_attach_mmc(mmc1)...
Omegamoon >> mmc_rescan_try_freq: Could NOT mmc_attach_mmc(mmc1), code 255...

rockchip_wifi_init_module: sdio_register_driver timeout
## wifi_remove

Now, "mmc_attach_sdio" is called to attach the SDIO driver. In there "mmc_send_io_op_cond" is called in which a 'probe' command is sent to the Wifi chip. No response is coming back, resulting in a timeout...

These are just quick notes I have taken. I'm still puzzled as to what is wrong. If any of you reading this have any knowledge of what's going on, or have any tips on how to proceed, please give your feedback in the comments!

[ 14 comments ] ( 2304 views )   |  permalink  |   ( 3.5 / 8916 )
RK3066 - Pushing the MK808 to itís limits 
Iíve been investigating several things lately. System Tuner, like other tools, always show a constant CPU speed, never changing. It looks like the CPU speed is fixed. Thatís strange! Tools like System Tuner get their information from sysfs, so I looked at where and how those items are filled from within the kernel, or better, where they should be filled.

I added some extra logging to see what (not) happened and got the part fixed that reported the cpu speed back to userspace. While browsing through the logging I saw a different error early in the boot process saying something like ďvdd_core canít get regulator in clk_enable_dvfsĒ. I wondered what that meant. Investigating the dvfs (Dynamic Voltage & Frequency Scaling) mechanism I found that parts are missing and other parts are not working. The good thing is that the source code is provided, the bad thing is that, although itís easy adding the missing parts, it still doesnít work. The error messages disappeared, but the device now has trouble reading back the current voltage value. I ended up disabling dvfs completely for the time being. By doing so, looking at the code, this also removes some overhead and (hopefully) increases speed and stability.

The RK30 platform code has a build-in ďintelligenceĒ in regards to cpufreq governors, putting hardcoded limits on frequency scaling in place. I donít like hardcoded limits, so I removed them. I added some new governors, being SmartassV2, InteractiveX and SavagedZen and made SmartassV2 the default one. I also added IO schedulers VR and SIO.

From one thing came the other. I started tweaking the frequency table, and added overclock frequencies for 1.7GHz and 1.8GHz. Testing these frequencies with the new governors it looks like 1.7GHz is the highest stable frequency. I normally use the AnTuTu benchmark for testing, but on the MK808 AnTuTu in the current version (v3.1.2) always crashes on executing the 3D benchmark. Testing with 1.8GHz results in a complete device hang-up at some point. It seems to be a heat problem, because after a while it doesnít even boot anymore, and I actually needed to cool the device down to get it working again. So beware if you want to give this a try yourself!

Thatís it for now. Iím still working on the touchscreen driver, and my todo list is getting longer and longer. If I didnít respond to your comments or mails... sorry about that! I added most requests already to the todo list for further investigation.

Thereís a MK808B underway from Spain (thanks Alejandro!) and as you can see on the top-right of this blog, szTomato as one of the manufacturers of the MK808 is sponsoring me as well. More on that later.

Since my last kernel update I updated my github repository with a lot of changes already. There are still changes pending, like the touchscreen driver and the merge with the i-onik A09 code and the Google Common Android kernel tree. So more updates will follow!

Kernel download
The kernel can be downloaded here. Flash it in the usual way. The zip file contains only the 720p for DVI kernel. Sorry about that, but Iím short in time. Needless to say maybe, but be careful when using the CPU overclocking feature. It can damage your device!!

Please give it a try and sent me feedback of your findings. Enjoy!

[ 19 comments ] ( 870 views )   |  permalink  |   ( 3 / 3364 )
New RK3066 kernel(s) - Changes galore - MK808 is getting better and better! 
I've been busy with lots of kernel changes. Too many to mention them all seperately here. I merged a lot of code from the 3.0.50 linux kernel into our 3.0.8+ code base. One big change worth mentioning is that I added touchscreen monitor support from the mainline 3.8 linux kernel. Since I don't own a touchscreen monitor myself I ask all of you proud owners of such a device to test this kernel and see if it works. Please don't forget to report your findings here of course.

Some of you reported that you still have 'No signal/Black screen' problems. I had trouble myself using the MK808 on my TV (HDMI) and my monitor (DVI). Each time one of the two devices ended up having a 'No signal/Black screen'. In the comments of my previous post you also asked for a 720p fixed resolution instead of 1080p. That's why this release has four different versions of the kernel. One for each output connecion, being DVI and HDMI and for each output a 720p and a 1080p fixed resolution. All four kernels have their own distinct default setup, being:
  • HDMI output with 720p fixed resolution
  • HDMI output with 1080p fixed resolution
  • DVI output with 720p fixed resolution
  • DVI output with 1080p fixed resolution
These settings are activated on bootup of the kernel, and are fixed as long as the 'autoconfig' feature is disabled. This feature is disabled on default, and can be re-enabled as described in my previous post. As long as 'autoconfig' is disabled, the fixed output and resolution remain in tact, whatever you do. Even changing the resolution from Android won't work! If you re-enable 'autoconfig' the output as well as the resolution can be changed to your liking again.

Kernel download
The kernel can be downloaded here. Flash it in the usual way. The zip file contains all four kernels.

I realize I haven't uploaded my github account lately. With a shortage of spare time I tend to choose doing more fun stuff than uploading changes. I promise I'll spent some time on cleaning up the code a bit and upload a new snapshot of my code base.

In the meantime I hope you all have fun with this release. Please give it a try and sent me feedback of your findings. Enjoy!

[ 31 comments ] ( 1398 views )   |  permalink  |   ( 2.9 / 3324 )
RK3066 HDMI Driver Overhaul... 
I've had several reports in regards to my 'Black screen/No signal' kernel fix, ranging from "Perfect, it finally works!" to "Still doesn't work" or "Sound doesn't work". I thought about a better solution, so I made another few adjustments to the HDMI driver.

In short, the default HDMI settings in my latest kernel are: HDMI enabled for image AND sound (took a while to get that fixed!), Autoconfig disabled, predefined resolution 1920x1080p at 60Hz. Hopefully these settings work for most of you. My guess is they will.

To give you more control over the HDMI driver you need to get access to the device. Use adb shell to do this from your PC. This is probably the only option you have when you have the 'No signal' problem (duh!). Then you need to find out what the best configuration for your display is. This is done using sysfs. Try experimenting with different settings. After that you can create an init.d boot script to make the settings permanent. On bootup of the device, the init.d script will configure the driver according to your preferred settings.

1. HDMI output
Use this setting to enable or disable HDMI output. Reason for disabling could be that you're using your device headless and you want to save as much power as possible. On default HDMI output is enabled.
Enable (default):
echo "1">/sys/devices/virtual/display/display0.HDMI/enable
echo "0">/sys/devices/virtual/display/display0.HDMI/enable

2. Automatic configuration
The effect of enabling automatic configuration is twofold. First the "Hotplug" feature reacts on connecting and deconnecting a display and second the HDMI driver tries to read configuration information from your display using EDID and configure HDMI image and sound in the highest possible mode. This is the way the original stock kernel worked. In this kernel I disabled automatic configuration on default, but you can re-enable it if you want.
echo "1">/sys/devices/virtual/display/display0.HDMI/autoconfig

Disable (default):
echo "0">/sys/devices/virtual/display/display0.HDMI/autoconfig
By disabling automatic configuration the "Hotplug" feature is disabled as well. The driver then acts as if a HDMI display is always connected. Sound output is set to HDMI as well. Apart from that, the driver no longer tries to read the configuration from your display using EDID. Only a predefined set of display modes can be used. The default resolution is set to 1920x1080p, 60Hz. Be aware that the stock Android image resets the resolution to a lower 1280x720p, at least on the one I use. Currently following predefined resolutions are being supported when automatic configuration is disabled.
  • 2880x480i-60
  • 2880x480p-60
  • 2880x480p-60
  • 2880x480p-50
  • 2880x480p-50
  • 1920x1080p-60
  • 1920x1080p-50
  • 1920x1080p-50
  • 1440x480p-60
  • 1440x240i-50
  • 1440x240p-60
  • 1280x720p-60
  • 1280x720p-50
  • 720x576p-50
  • 720x480p-60
  • 720x480p-50
To change the resolution use the exact format from the list above. For example, to set 1280x720p-60 use:
echo "1280x720p-60">/sys/devices/virtual/display/display0.HDMI/mode
Kernel download
The kernel can be downloaded here. Flash it in the usual way. Although a lot of the kernel is updated to version 3.0.50 already, I still kept the 3.0.8+ version number intact, so the stock Android image can still load it's kernel modules and keeps working as normal.

Please report any of your findings here! I'm very curious to know whether or not this once and for all solves these annoying 'No signal' display problems.

[ 32 comments ] ( 125065 views )   |  permalink  |   ( 3 / 2556 )
MK808 rk30xxHMDI driver - Fixing black screen/no image problem 
From day one I had difficulties working with the MK808. None of my LCD displays worked with the device. All gave a black screen, no image at all. The only exception was my Samsung TV set. Not so handy when developing stuff for the MK808, tweaking the kernel, changing the Android OS or even create new distributions like Ubuntu or XBMC.

So in the beginning I used 'adb' a lot, and walked over to the TV set in the living room like a million times, asking my wife again and again if it's okay to "borrow" the TV for just a minute and test my latest change(s) ;-)

Now, having the serial console feature, debugging has become so much easier. The console is available early in the kernel boot process, and the device is accessible from my PC. A lot of mistakes you make when customizing the kernel show up on the console, which is very helpful.

This is how I found out that, although no image showed up on my LCD monitor, detaching the monitor was detected by the HDMI driver. This made me think. Could it be a flaw in the HDMI driver after all? All the "solutions" I read about online were related to adding (powered!) splitters, (powered!) repeaters or other converters/adapters to the MK808. In my opinion, one of the nice things of a device like this is that is has an ARM CPU which uses very little power. The succes of having such device 100% working for me would be having a small extremely powerful, "always on" and very low powered device. That's why adding all kinds of additional powered hardware is a real show stopper to me.

Delving into the HDMI device driver code, I looked at the "hotplug" feature. This feature signals any changes on the HDMI port, connecting or disconnecting a display for instance. I changed the code by telling the driver that a display is always connected, in effect disabling the hotplug feature. I also set the resolution fixed to 1280x720 60Hz (1080p720p). This works! Booting the customized kernel now finally shows the Android home screen on all my displays.

For all of you having the same black screen/no image problem, please try flashing the kernel, and let me know if this fixes the problem for you as well. Included in this 3.0.8+ kernel are a lot of additional patches and changes, cherry picked from the 3.0.50 kernel release. I'll continue to upgrade the kernel to a higher level.

[Update] 2013-01-20 Sound issue fixed.

The kernel can be downloaded here.

[ 23 comments ] ( 1327 views )   |  permalink  |   ( 3.1 / 2486 )
MK808 Endeavours... 
As some of you know, I've been working on the MK808 TV Stick/Mini PC for some time now. The MK808 is based on the dual-core Rockchip RK3066. A quite powerful SOC, capable of doing the average stuff most of us do every day with a desktop PC. Unfortunately, Rockchip is one of those manufacturers that don't comply to any open source license agreement. Simply put, the rule of thumb is that when you use open source you have to give all the modifications you make when selling products based on GPL back to the community. Well, Rockchip doesn't comply to these rules. Worse, they make their own license rules, saying that they are the sole owner of all software, including all GPL parts. That's why most hardware manufacturers say they aren't allowed to give any of the sources. Too bad they don't seem to understand the value of working together on making things better. Oh well, enough of this, I think I made my point clear. It's just so frustrating!

Luckily there are a few hardware manufacturers that understand the value of GPL. Or it may be that they don't understand the chinese license agreement from Rockchip. Or it may just be that they understand the underlying GPL agreement, unlike Rockchip. It may be a coincident also, but all the manufacturers providing some of the Rockchip adaptations of the Linux kernel seem to be based outside the people's republic of China. Anyway, it doesn't matter how, what matters is that we finally have a few snapshots of the Rockchip linux kernel adaptations after all.

Unfortunately, from all current available snapshots a lot of the essential code is missing. This makes it a difficult process to get all the hardware components working. Some code parts are delivered in binary object files only, which prevents you from making changes without going through the time consuming process of disassembling and reverse engineering.

I tried to upgrade the MK808 kernel to a higher version of the linux kernel a while ago. Reason for this is to apply common (mainline) patches and enhancements and to add some new features as well. I failed miserably. The device didn't boot, and I came to the point that I had no ways to find out what error(s) I had made. The kernel died early in the boot process. This is a common problem in kernel development. One way to find out what goes on during the boot process is the use of a serial console. I saw this great blogpost a while back about the UG802. It's a similar device using the same Rockchip RK3066 CPU. Although the PCB layout is completely different of course, I imagined that PCB designers would always create ways to debug low-level problems like I had. This is easy to say with the little knowledge of hardware that I have ;-) I looked at detailed images of the MK808 PCB and saw some connector pins that could indicate the possible use of a serial console.

This is where my brother comes in. He has a strong hardware background, always messing around with Arduino's and the like. I asked him if it was as easy as I thought it would be. The short answer was... No, it's not "just" soldering three wires onto the MK808 mainboard and connect them to the serial port of a PC. You have to know, I'm a software guy, so in terms of background my brother and I come from two completely different worlds. He tried to explain the importance of voltage conversion for instance. The PC using 12V whereas the MK808 only uses 3.3V. Talking about the risk of blowing up the device if not being careful. Or why it doesn't make sense to "just" replace the Wifi antenna with a bigger model. I have to say, most of this is all way beyond the scope of my understanding!

Anyway, to cut an already long story a little shorter, my brother came visiting me saturday afternoon and we took the plunge and started to mod the MK808. What I suspected was that the three pins just outside the CPU area were meant for debug purposes. Like on the UG802. This was a long shot of course, but that was just my simplistic way of thinking :-)

With my newly bought soldering iron, multimeter, connectors and a FTDI serial to USB breakout board we started checking out these three pins. We were in luck. The first pin we checked was the receive (RX) pin for a serial console. Tadaaaa! The MK808 booted, and we saw console output on the PC. Wow! After that it was easy to guess the transmit (TX) pin, having only two more pins left, leading to a complete working serial console in no time. How cool is that!

Most time went into putting everything back together. The heatsink had to be put back in place and we needed to get the wires connected to the FTDI board outside the case. We made a connector on top of the device so the FTDI board can now be easily connected and removed if needed. Look for yourself, I think it looks slick, and more importantly, it works perfectly well!

I couldn't have done this without the help of my brother, so all credits go to him. Thanks bro, a job very well done!

Now back to kernel hacking, so hopefully more on that later :-)

For a detailed series of hi-res photo see here

[ 10 comments ] ( 342 views )   |  permalink  |   ( 3 / 2655 )
[update] Huawei G300/U8815 kernel (added zRam) 
I've added "zRam" to the kernel. This feature was previously known as "compcache". It increases performance by avoiding paging on disk and instead uses a compressed block device in RAM in which paging takes place until it is necessary to use external (disk) swap space.

I'm still testing it, but it seems to have a positive effect in terms of performance.

You have to enable it manually for now. Use a terminal emulator or use "adb shell" to do this more comfortably from your desktop.

To setup a 100Kb (100*1024*1024) zRam:
echo 104857600 > /sys/block/zram0/disksize
mkswap /dev/block/zram0
swapon /dev/block/zram0

To disable the zRam:
swapoff /dev/block/zram0

Remember this won't survive a reboot, so you have to re-enable it again after reboot.

Download the kernel here (MD5: a89bd97f940cc33c11ca7cc73d521abb)

[ 9 comments ] ( 413 views )   |  permalink  |   ( 3 / 2787 )
[update] Huawei G300/U8815 kernel (camera flash fixed) 

I got in touch with "genokolar" today, since he managed to get the camera flash fixed on the U8818. He was kind enough to send me his patches, so all credits go to him for this release. I also added some more overclock frequencies, up to 1.5GHz, but they result in reboots only. At least for now...

I've created a repository on github, so please feel free to fiddle around with the sources yourself.

Download the kernel here (MD5: da9199471e4ce538d2a16bfc1d3dc1c3)

[ 3 comments ] ( 158 views )   |  permalink  |   ( 3 / 2684 )
[update] Huawei G300/U8815 kernel 
A quick update of the G300/U8815 kernel. This update fixes bluetooth. Tested this afternoon, and it works perfectly now. Tomorrow I will look into the camera flash that's not working. I will also start stripping the kernel a bit, removing unnecessary parts that only take up precious memory. Maybe I try to add some extra overclocking as well, although I don't think the current "lagging" most of us see every now and then is fixed by only increasing the CPU frequency.

Download the kernel here (MD5: ccd3c44e20ce1b79b0030341f4c6f68e)

[ 2 comments ] ( 111 views )   |  permalink  |   ( 3.1 / 2701 )

<<First <Back | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Next> Last>>