Difference between revisions of "RockBox"

From PINE64
Jump to navigation Jump to search
(15 intermediate revisions by the same user not shown)
Line 4: Line 4:


== Specifications ==
== Specifications ==
* '''Dimensions''': TODO
* '''Dimensions''': 106mm x 106mm x 16.9mm
* '''Weight''': TODO
* '''Weight''': 143 g
* '''CPU''': Rockchip RK3328, Quad core Cortex-A53 @ up to 1.5GHz
* '''CPU''': Rockchip RK3328, Quad core Cortex-A53 @ up to 1.5GHz
* '''GPU''': Mali-450MP2
* '''GPU''': Mali-450MP2
Line 17: Line 17:


== Software releases ==
== Software releases ==
* [https://www.retro-center.com/about-r-cade/ Retro-Center's R-Cade retro-gaming media center] on the [https://www.retro-center.com/product/rockbox-r-cade/ RockBox R-Cade]
* [https://github.com/mrfixit2001/debian_builds/releases Mrfixit2001's Debian Minimal Release] (note: can be updated to a more recent Debian using the regular updating tools, except for the kernel and u-boot)
* [https://libreelec.tv/downloads/rockchip/ LibreELEC Rockchip] (note: select ''[https://releases.libreelec.tv/LibreELEC-RK3328.arm-9.2.6-rockbox.img.gz LibreELEC-RK3328.arm-9.2.6-rockbox.img.gz]'')
== Hardware ==
=== LED ===
The blue LED can be controlled with via the sysfs (''/sys/devices/platform/leds/leds/power/brightness''):
To turn off the blue LED: <code>echo 0 | sudo tee /sys/devices/platform/leds/leds/power/brightness</code>
To turn on the blue LED: <code>echo 1 | sudo tee /sys/devices/platform/leds/leds/power/brightness</code>
Note: the maximum brightness is defined as 255, it doesn't support dimming however, so 0 and 1 as brightness is sufficient. Turning off the blue LED will turn on a weak red LED. Trigger can be changed via ''/sys/devices/platform/leds/leds/power/trigger''.


== Development ==
== Development ==
Line 27: Line 42:


[[File:Rockbox_internals.jpg|400px|thumb|right|Internals of the RockBox with the UART contacts visible on the bottom right]]
[[File:Rockbox_internals.jpg|400px|thumb|right|Internals of the RockBox with the UART contacts visible on the bottom right]]
A serial console can be connected to the RockBox to retrieve the UART boot logs. A device such as a USB to TTL converter can be used to connect the RockBox. Simply set the USB device to 3.3 volts and connect GND to the GND connector on the mainboard, RTX to TX and TXD to RX. The fourth unlabelled contact on the mainboard should not be connected. Note: Unlike the [[ROCKPro64]], connecting TXD does not prevent the device from booting up.
Connect the USB device to the PC and use a tool such as <code>screen</code> to display the serial output:
screen /dev/ttyUSB0 1500000
Then power up the RockBox and enjoy the serial output on the PC.
To enable UART output in the OS as well (otherwise the output would stop at "''Starting kernel ...''"), <code>console=ttyS2,1500000n8</code> can be added to the <code>append</code> line in the ''/boot/extlinux.conf'' file when using ''EXTLINUX''.


=== Mainline Linux ===
=== Mainline Linux ===
Mainline Linux works on the RockBox without patches. To create a compatible u-boot image, https://github.com/mrfixit2001/uboot_builder may be used. The ''dtb'' has to be compiled from a recent ''dts'', such as [https://github.com/mrfixit2001/mainline-kernel/blob/master/arch/arm64/boot/dts/rockchip/rk3328-rockbox.dts this], otherwise network and video won't work.
==== Building u-boot ====
{{hint|TODO}}
==== Building the dtb ====
The dtb can be compiled from a recent dts. To do that, download a kernel source and add a dts, or use a kernel source with an fitting dts. The second variant is showcased here:
git clone https://github.com/mrfixit2001/mainline-kernel.git
Then change the directory to the kernel sources:
cd mainline-kernel
Then create a config (defaults can be accepted):
make ARCH=arm64 menuconfig
Now compile the dts files:
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 12 dtbs
The compiled dtb file can now be copied from ''/arch/arm64/boot/dts/rockchip/rk3328-rockbox.dtb'' into for example the EXTLINUX location.
==== Configuring EXTLINUX ====
In the EXTLINUX location, the ''/extlinux/extlinux.conf'' should be pointed to the correct kernel image and the correct dtb file. An example configuration (with serial output with 1500000 baud being enabled for the OS and with the root directory set to the second partition ''mmcblk1p2'') can look like the following example:
default ROCKBOX
label ROCKBOX
kernel /Image
fdt /rk3328-rockbox.dtb
append console=tty0 console=ttyS2,1500000n8 rw root=/dev/mmcblk1p2 rootwait rootfstype=ext4 panic=10 init=/sbin/init coherent_pool=1M ethaddr=${ethaddr} eth1addr=${eth1addr} serial=${serial#} cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1 video=HDMI-A-1:1920x1080@60 loglevel=3


== External resources ==
== External resources ==

Revision as of 08:43, 7 December 2021

Rendering of the RockBox

The Popcorn Hour RockBox Basic is a TV box from the Cloud Media company in partnership with PINE64 and the PINE64 community. It is running a Rockchip RK3328 SoC and is supporting multiple different operating systems. The device is similar to the Rock64 and runs some of its operating systems, it has a custom PCB and multiple hardware differences however.

Specifications

  • Dimensions: 106mm x 106mm x 16.9mm
  • Weight: 143 g
  • CPU: Rockchip RK3328, Quad core Cortex-A53 @ up to 1.5GHz
  • GPU: Mali-450MP2
  • System Memory: 1GB LPDDR3
  • Internal Storage: 8GB eMMC
  • Connectivity: 802.11a/b/g/n, Ethernet 10/100
  • USB: 1x USB 2.0 OTG port, 1x USB 3.0 port
  • Video Output: HDMI Standard HDMI 2.0a@60hz
  • Audio Output: Via HDMI, Optical S/PDIF port
  • Power Supply: DC 5V/2A

Software releases

Hardware

LED

The blue LED can be controlled with via the sysfs (/sys/devices/platform/leds/leds/power/brightness):

To turn off the blue LED: echo 0 | sudo tee /sys/devices/platform/leds/leds/power/brightness

To turn on the blue LED: echo 1 | sudo tee /sys/devices/platform/leds/leds/power/brightness

Note: the maximum brightness is defined as 255, it doesn't support dimming however, so 0 and 1 as brightness is sufficient. Turning off the blue LED will turn on a weak red LED. Trigger can be changed via /sys/devices/platform/leds/leds/power/trigger.

Development

Disassembly

The device can be easily disassembled by removing the four rubber feet and by unscrewing the four screws underneath them. The board is held in place by additional two black screws. Note: The board is connected to the main body with a cable.

UART

Internals of the RockBox with the UART contacts visible on the bottom right

A serial console can be connected to the RockBox to retrieve the UART boot logs. A device such as a USB to TTL converter can be used to connect the RockBox. Simply set the USB device to 3.3 volts and connect GND to the GND connector on the mainboard, RTX to TX and TXD to RX. The fourth unlabelled contact on the mainboard should not be connected. Note: Unlike the ROCKPro64, connecting TXD does not prevent the device from booting up.

Connect the USB device to the PC and use a tool such as screen to display the serial output:

screen /dev/ttyUSB0 1500000

Then power up the RockBox and enjoy the serial output on the PC.

To enable UART output in the OS as well (otherwise the output would stop at "Starting kernel ..."), console=ttyS2,1500000n8 can be added to the append line in the /boot/extlinux.conf file when using EXTLINUX.

Mainline Linux

Mainline Linux works on the RockBox without patches. To create a compatible u-boot image, https://github.com/mrfixit2001/uboot_builder may be used. The dtb has to be compiled from a recent dts, such as this, otherwise network and video won't work.

Building u-boot

TODO

Building the dtb

The dtb can be compiled from a recent dts. To do that, download a kernel source and add a dts, or use a kernel source with an fitting dts. The second variant is showcased here:

git clone https://github.com/mrfixit2001/mainline-kernel.git

Then change the directory to the kernel sources:

cd mainline-kernel

Then create a config (defaults can be accepted):

make ARCH=arm64 menuconfig

Now compile the dts files:

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 12 dtbs

The compiled dtb file can now be copied from /arch/arm64/boot/dts/rockchip/rk3328-rockbox.dtb into for example the EXTLINUX location.

Configuring EXTLINUX

In the EXTLINUX location, the /extlinux/extlinux.conf should be pointed to the correct kernel image and the correct dtb file. An example configuration (with serial output with 1500000 baud being enabled for the OS and with the root directory set to the second partition mmcblk1p2) can look like the following example:

default ROCKBOX

label ROCKBOX
kernel /Image
fdt /rk3328-rockbox.dtb
append console=tty0 console=ttyS2,1500000n8 rw root=/dev/mmcblk1p2 rootwait rootfstype=ext4 panic=10 init=/sbin/init coherent_pool=1M ethaddr=${ethaddr} eth1addr=${eth1addr} serial=${serial#} cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1 video=HDMI-A-1:1920x1080@60 loglevel=3

External resources