<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pine64.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Calebccff</id>
	<title>PINE64 - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pine64.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Calebccff"/>
	<link rel="alternate" type="text/html" href="https://wiki.pine64.org/wiki/Special:Contributions/Calebccff"/>
	<updated>2026-04-18T10:05:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineNote_Development&amp;diff=11386</id>
		<title>PineNote Development</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineNote_Development&amp;diff=11386"/>
		<updated>2021-09-12T16:08:19Z</updated>

		<summary type="html">&lt;p&gt;Calebccff: Add some mainline instructions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article seeks to provide general development information for the [[PineNote]]&lt;br /&gt;
&lt;br /&gt;
= Flashing Software =&lt;br /&gt;
&lt;br /&gt;
Currently, the only way to flash software is using rkdeveloptool.&lt;br /&gt;
&lt;br /&gt;
== Using rkdeveloptool ==&lt;br /&gt;
&lt;br /&gt;
rkdeveloptool is a command line utility built on libusb.&lt;br /&gt;
&lt;br /&gt;
=== Downloading and Building rkdeveloptool ===&lt;br /&gt;
&lt;br /&gt;
PINE64 develops [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool its own updated fork of rkdeveloptool on GitLab].&lt;br /&gt;
&lt;br /&gt;
You will need to have libusb 1.0 and its development headers installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool.git&lt;br /&gt;
cd rkdeveloptool&lt;br /&gt;
mkdir build&lt;br /&gt;
cd build&lt;br /&gt;
cmake ..&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets up all the build files. You can then compile with &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; inside the build directory.&lt;br /&gt;
&lt;br /&gt;
After you're done, you'll likely also need to install the udev rules, or else your user won't have permission to access the USB devices:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo cp 99-rk-rockusb.rules /etc/udev/rules.d/&lt;br /&gt;
sudo udevadm --control reload&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building Downstream U-Boot ===&lt;br /&gt;
&lt;br /&gt;
While in maskrom mode, we need to have a u-boot to download onto the device for any of the other commands to work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone -b quartz64 https://gitlab.com/pgwipeout/u-boot-rockchip.git&lt;br /&gt;
git clone -b rkbin https://github.com/JeffyCN/rockchip_mirrors.git rkbin&lt;br /&gt;
cd u-boot-rockchip&lt;br /&gt;
export CROSS_COMPILE=aarch64-none-linux-gnu-&lt;br /&gt;
make rk3566-quartz64_defconfig&lt;br /&gt;
./make.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running rkdeveloptool ===&lt;br /&gt;
&lt;br /&gt;
First, you'll want to make sure the device you've connected is in maskrom mode:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should output something like &amp;lt;code&amp;gt;DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=202    Maskrom&amp;lt;/code&amp;gt;. If it doesn't, see [[PineNote Development#Entering Maskrom Mode]].&lt;br /&gt;
&lt;br /&gt;
You can now download u-boot onto it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool boot ../u-boot-rockchip/rk356x_spl_loader_v1.08.111.bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should output &amp;lt;code&amp;gt;Downloading bootloader succeeded.&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can now verify that this worked using e.g. the &amp;quot;read flash info&amp;quot; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./rkdeveloptool read-flash-info&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''TODO:''' finish this section&lt;br /&gt;
&lt;br /&gt;
= Entering Maskrom Mode =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Flip the device around so that the display faces down&lt;br /&gt;
# Lay the pen on the right side, with its tip pointing towards the speaker grill, and its magnet pointing towards the upper right corner of the label on the back.&lt;br /&gt;
# Turn the device on and wait for it to show up in &amp;lt;code&amp;gt;lsusb&amp;lt;/code&amp;gt;. It should now be in Loader mode, according to &amp;lt;code&amp;gt;rkdeveloptool list-devices&amp;lt;/code&amp;gt;&lt;br /&gt;
# Unplug the device and plug it back in. It should now be in maskrom mode.&lt;br /&gt;
&lt;br /&gt;
This can be a bit fiddly to get right, and may need a few tries.&lt;br /&gt;
&lt;br /&gt;
= Mainline development =&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
&lt;br /&gt;
Some work happening here: https://gitlab.com/calebccff/linux, the idea is to import the parts of the eink/ebc drivers which are open source and use the downstream u-boot framebuffer driver as a reference to create a basic framebuffer driver.&lt;br /&gt;
&lt;br /&gt;
Currently mainline struggles to boot due to weird issues while probing fixed regulators (?). It also fails to detect eMMC.&lt;br /&gt;
&lt;br /&gt;
== How to boot mainline ==&lt;br /&gt;
&lt;br /&gt;
'''TODO:''' Add more details&lt;br /&gt;
&lt;br /&gt;
UART is currently REQUIRED for this to work! We depend on u-boot falling back to console. Once we have a prebuilt u-boot which will use extlinux by default UART won't be needed anymore.&lt;br /&gt;
&lt;br /&gt;
Currently it's possible to boot mainline by doing roughly the following:&lt;br /&gt;
&lt;br /&gt;
1. Erase boot and dtbo with rkdeveloptool (back them up first!!!)&lt;br /&gt;
&lt;br /&gt;
2. Create an ext2 partition image and mount it (fallocate, mkfs.ext2)&lt;br /&gt;
&lt;br /&gt;
3. Build your mainline kernel&lt;br /&gt;
&lt;br /&gt;
4. Copy the kernel, dtb and an initramfs to the root of the mounted image (use any old postmarketOS initramfs)&lt;br /&gt;
&lt;br /&gt;
5. Create a file in the root of the mounted image called &amp;lt;code&amp;gt;extlinux.conf&amp;lt;/code&amp;gt; with the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timeout 10&lt;br /&gt;
default MAINLINE&lt;br /&gt;
menu title boot prev kernel&lt;br /&gt;
&lt;br /&gt;
label MAINLINE&lt;br /&gt;
  kernel /vmlinuz&lt;br /&gt;
  fdt /rk3566-pinenote.dtb&lt;br /&gt;
  initrd /initramfs&lt;br /&gt;
  append earlycon console=tty0 console=ttyS2,1500000n8 fw_devlink=off PMOS_NO_OUTPUT_REDIRECT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. Unmount the image and then use rkdeveloptool to flash it to the &amp;quot;recovery&amp;quot; partition on the pinenote (it's about the right size until we get around to replacing the partition layout).&lt;br /&gt;
&lt;br /&gt;
7. Reboot your pinenote, it should boot to a u-boot console, run the following command to boot your mainline kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysboot ${devtype} ${devnum}:9 any ${scriptaddr} extlinux.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Calebccff</name></author>
	</entry>
</feed>