Skip to content

Instantly share code, notes, and snippets.

@macromorgan
macromorgan / README.md
Last active February 11, 2025 02:42
Debootstrap Development Image

Start with making your "flashable" image. I use 2GB and work from there. fallocate can work too, but some filesystems may not support it.

dd if=/dev/zero of=disk.img bs=1M count=2048

Create your partitions on the disk. I use fdisk and generate a gpt partition table. Note that I leave a slight offset (16MB) for U-Boot and the Rockchip loader stuff, but in my case I will be using U-Boot from the internal SPI and the storage space is entirely optional.

fdisk disk.img

I create my first partition at offset 32768 (16MB exactly) and have it end at 294911 (128MB + 16MB). This gives my boot partition 128MB to work with and ensures that my root partition starts at sector 294912. When working with 512 byte blocks (which we almost always are) it's important to ensure your starting block numbers are always divisible by 8 so that they are 4k aligned.

@macromorgan
macromorgan / 0000-cover-letter.patch
Created November 10, 2023 01:29
Elida KD35T133 Panel Improvements
From d89363f8476e71d4dce9891fc7ab55db04530c02 Mon Sep 17 00:00:00 2001
From: Chris Morgan <[email protected]>
Date: Thu, 9 Nov 2023 16:42:27 -0600
Subject: [PATCH 0/4] Elida KD35T133 Panel Improvements
Fix a few bugs and clean up no longer needed code on the Elida KD35T133
DSI panel, as used in devices such as the Odroid Go Advance and the
Anbernic RG351M.
Chris Morgan (4):
[PATCH 1/2] board: rockchip: Make panel auto detect error non fatal
Make the inability to detect a panel using the auto detection code not
fail the entire boot process. This means that if the panel ID cannot
be read we don't set an environment variable for the panel, and if an
environment variable for the panel is not set we don't attempt to
update the compatible string. Changes to the code also ensure that
when there are multiple compatible strings required for the panel
we can use them both.
@macromorgan
macromorgan / rg405v-overlay.dts
Created September 5, 2023 14:13
RG405V Device Trees
/dts-v1/;
/ {
model = "Spreadtrum UMS512-1H10 Board";
compatible = "sprd,ums512-1h10\0sprd,ums512";
sprd,sc-id = "ums512 1h10 1000";
fragment {
target-path = "/";
@macromorgan
macromorgan / bootlog
Created September 4, 2023 01:51
UART Dump of RG405V
UUUUUERS
ROM
RBS
SHARKL5pro ddr init...
vref_adj_p0x00000050 0x00000050
0x0021C8C8 0x50000022
@macromorgan
macromorgan / dmesg
Created June 15, 2023 21:29
Anbernic RG Nano Boot Logs
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.14.14-anbernic (zd@ubuntu) (gcc version 10.2.0 (Buildroot -gda0ac4e8)) #1 SMP Wed May 31 01:04:46 PDT 2023
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Anbernic
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] On node 0 totalpages: 16384
[ 0.000000] free_area_init_node: node 0, pgdat c0a3f200, node_mem_map c3f7a000
[ 0.000000] Normal zone: 128 pages used for memmap
@macromorgan
macromorgan / sun8i-v3s-anbernic.dts
Created June 15, 2023 19:04
Anbernic RG-Nano Devicetree
/dts-v1/;
/ {
#address-cells = <0x01>;
#size-cells = <0x01>;
interrupt-parent = <0x01>;
model = "Anbernic";
compatible = "anbernic\0allwinner,sun8i-v3s";
chosen {
From 803127622846e44ea2e55818bcf498493f470434 Mon Sep 17 00:00:00 2001
From: Chris Morgan <[email protected]>
Date: Wed, 17 May 2023 17:26:16 -0500
Subject: [PATCH] package: Add interception package and activate for rk3326
Use the interception package to merge the gpio-keys and adc-joystick
input devices found in mainline Linux to avoid the need to have
an out of tree input driver.
Signed-off-by: Chris Morgan <[email protected]>
@macromorgan
macromorgan / .config
Created April 9, 2023 00:51
aarch64 Kernel Config
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 6.3.0-rc5 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="aarch64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=110300
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23800
@macromorgan
macromorgan / rk3588s-indiedroid-nova.dts
Last active April 27, 2023 16:17
Indiedroid Nova DTS (work in progress)
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/usb/pd.h>
#include "rk3588s.dtsi"
/ {