Skip to content

Instantly share code, notes, and snippets.

@nuumio
nuumio / 001-rp64-uboot-tests-2021-11-2021-12.md
Last active December 5, 2021 08:35
ROCKPro64 uboot testing 2021-11 - 2021-12
@nuumio
nuumio / Dockerfile
Created February 2, 2021 13:37
Container for building U-Boot (at least for RK3399, BSP & mainline)
FROM ubuntu:focal
LABEL author="Jari Hämäläinen <nuum.io.fi@gmail.com>"
ENV DEBIAN_FRONTEND 'noninteractive'
ENV XZ_DEFAULTS '-T0'
# Basic setup, install tools etc.
# Some packages are just from my previous tools containers.
# Some packages just grabbed from: https://wiki.radxa.com/Rockpi4/dev/u-boot
# Added gcc-arm-none-eabi, rename, bison, git, python3 and python-pyelftools.
@nuumio
nuumio / 99-marvell.rules
Created December 29, 2020 09:12
udev rule for Marvell 88SE9230 on RockPro64
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1b4b", ATTR{device}=="0x9230", RUN+="/bin/bash -c 'echo %k > /sys/bus/pci/drivers/ahci/bind'"
From ceae51b1cc0e5a5b42999274657bd55606193661 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jari=20H=C3=A4m=C3=A4l=C3=A4inen?= <nuumiofi@gmail.com>
Date: Sun, 22 Nov 2020 15:24:49 +0200
Subject: [PATCH] nuumio: pcie: Reimplement rockchip PCIe bus scan delay
Reimplementation of my old Rockchip PCIe bus scan delay patch for
kernels >= 5.9.
Delay may fix panix with some PCIe devices, like LSI SAS 9201-8i with
SAS2008 chipset in my case.
@nuumio
nuumio / how-to-use.sh
Last active December 28, 2021 17:07
rk3399-rockpro64; control fan "directly" via pwm, not hwmon; linux 5.8.1; modded dt
# pwmchip1 is the one connected to fan header.
# To use it you'll have to export pwm channel first:
cd /sys/class/pwm/pwmchip1
echo 0 > export
# That should create channel dir "pwm0". In there
# you'll have to set period and duty cycle, and then
# enable the pwm.
cd pwm0
@nuumio
nuumio / 99-fan.rules
Created June 21, 2020 06:29
RK3399 "direct PWM" fan control
# FILE:/etc/udev/rules.d/99-fan.rules
KERNEL=="ff420010.pwm", ACTION=="add", PROGRAM="/usr/local/sbin/fan-control.sh"
@nuumio
nuumio / print_colors.sh
Created June 4, 2020 04:21
print_colors.sh
#!/usr/bin/env bash
# From https://github.com/eendroroy/bin_scripts/blob/master/public/print_colors
# with Do What The F*ck You Want To Public License
echo -e "|039| \033[39mDefault \033[m |049| \033[49mDefault \033[m |037| \033[37mLight gray \033[m |047| \033[47mLight gray \033[m"
echo -e "|030| \033[30mBlack \033[m |040| \033[40mBlack \033[m |090| \033[90mDark gray \033[m |100| \033[100mDark gray \033[m"
echo -e "|031| \033[31mRed \033[m |041| \033[41mRed \033[m |091| \033[91mLight red \033[m |101| \033[101mLight red \033[m"
echo -e "|032| \033[32mGreen \033[m |042| \033[42mGreen \033[m |092| \033[92mLight green \033[m |102| \033[102mLight green \033[m"
echo -e "|033| \033[33mYellow \033[m |043| \033[43mYellow \033[m |093| \033[93mLight yellow \033[m |103| \033[103mLight yellow \033[m"
echo -e "|034| \033[34mBlue \033[m |044| \033[44mBlue \033[m |094| \033[94mLight blue \033[m |104| \033[104mLight blue \033[m"
@nuumio
nuumio / emmcrebind.sh
Created May 5, 2020 16:43
Rebind rk3399 emmc
#!/bin/bash
echo 'fe330000.sdhci' | sudo tee /sys/bus/platform/drivers/sdhci-arasan/unbind
echo 'fe330000.sdhci' | sudo tee /sys/bus/platform/drivers/sdhci-arasan/bind
@nuumio
nuumio / diskstats.sh
Last active April 19, 2020 13:57
Disk stat watcher
#!/bin/bash
# Update interval
INT=0.1
# "Sample count" for speed calculations (for averaging)
SC=20
FROMBOOT=false
@nuumio
nuumio / 99-rockchip-pcie.rules
Created June 1, 2019 21:20
RockPro64 trigger PCIe probe
# FILE: /etc/udev/rules.d/99-rockchip-pcie.rules
# Trigger Rockchip PCIe probe
ACTION=="add", KERNEL=="f8000000.pcie", SUBSYSTEM=="platform", RUN+="/usr/local/sbin/rockpro64_pcie_probe.sh"