Skip to content

Instantly share code, notes, and snippets.

View calebccff's full-sized avatar
🏳️‍🌈

Caleb Connolly calebccff

🏳️‍🌈
View GitHub Profile
@calebccff
calebccff / git-send-pr
Created February 22, 2024 16:10
Send a git pull request with one command
#!/bin/bash
start="$1"
url="$2"
end="$3"
shift 3
pull=$(mktemp /tmp/git-pull-XXXXXXX.pull)
echo "From: $(git config user.name) <$(git config user.email)>" >> $pull
@calebccff
calebccff / git-pmr.sh
Created February 14, 2024 23:20
Push an open a GitLab MR with a custom title and description (install in $PATH as git-pmr)
#!/bin/sh
# A crapp tool to push and open a gitlab MR
# with just one command!
# --force-with-lease ensures that we don't override any commits which only exist
# on the remote. But it will let you overwrite commits you've ammended.
cmd="git push --force-with-lease -o merge_request.create -o merge_request.description="
case $# in
1)
@calebccff
calebccff / fastgnome.sh
Last active January 15, 2024 10:28
Make your shell run faster
#!/bin/sh
PROC="gnome-shell"
CLAMP=900
PID=$(pidof "$PROC")
function enable() {
echo "Setting uclamp min to 800 (max: 1024)"
uclampset --pid "$PID" -m "$CLAMP"
@calebccff
calebccff / boards.md
Last active November 1, 2023 00:11
USB control board
  • USB hub that can do power control on one port (via pico), one USB-A female port for going to the phone
  • second USB goes to pico
  • 12v in via a barrel jack which powers an LDO with ~3.8-9v 4A output
  • output adjustable via software or just a pot
  • output voltage/current measured by MCU
  • Pico attached to board
  • pico GPIO pins exposed via some header for phone UART and button control
  • Should have a jumper to adjust between 1.8/3.3v UART
  • (just 1.8/3.3v is fine and i know from experience that a single voltage divider on the TX is enough for this)
  • Spare i2c and a few extra GPIOs for future expansion
@calebccff
calebccff / abortwatch.py
Last active April 24, 2024 12:24
A script to watch U-Boot serial output and automatically decode register dumps when a synchronous abort occurs
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
# Copyright 2023 Linaro Ltd.
# Author: Caleb Connolly <caleb.connolly@linaro.org>
#
# Listens to a serial port and automatically detects and decodes
# Synchronous aborts. DO NOT run your serial monitor at the same
# time as this tool! It will configure a PTY and symlink it to
# /tmp/abortwatch.pty, you should point your serial monitor there
# instead!
@calebccff
calebccff / README.md
Last active October 4, 2023 10:08
regbits - pretty print numbers as binary

Register Bits

Dump in a register value and get a binary representation that makes decoding registers just that bit easier.

Demo

asciicast

kgdb notes

Kernel config

CONFIG_KGDB=y
CONFIG_KGDB_KDB=y
CONFIG_PANIC_TIMEOUT=y
CONFIG_PANIC_ON_OOPS=y
CONFIG_RANDOMIZE_BASE=n # Disable KASLR
@calebccff
calebccff / pixel3-blueline-dmesg-android12.log
Created July 10, 2022 01:02
Pixel 3 / blueline Android 12 full UART boot load
[ 0.000000] c0 0 Booting Linux on physical CPU 0x0
[ 0.000000] c0 0 Linux version 4.9.270-g862f51bac900-ab7613625 (android-build@abfarm-east4-101) (Android (7284624, based on r416183b) clang version 12.0.5 (https://android.googlesource.com/toolchain/llvm-project c935d99d7cf2016289302412d708641d52d2f7ee)) #0 SMP PREEMPT Thu Aug 5 07:04:42 UTC 2021
[ 0.000000] c0 0 Boot CPU: AArch64 Processor [517f803c]
[ 0.000000] c0 0 Machine: Google Inc. MSM sdm845 B1 DVT1.1
[ 0.000000] c0 0 earlycon: msm_geni_serial0 at MMIO 0x0000000000a84000 (options '')
[ 0.000000] c0 0 bootconsole [msm_geni_serial0] enabled
[ 0.000000] c0 0 Reserved memory: created CMA memory pool at 0x00000000fec00000, size 16 MiB
[ 0.000000] c0 0 OF: reserved mem: initialized node adsp_region, compatible id shared-dma-pool
[ 0.000000] c0 0 Reserved memory: created CMA memory pool at 0x00000000fdc00000, size 16 MiB
[ 0.000000] c0 0 OF: reserved mem: initialized node qseecom
@calebccff
calebccff / SHIFT6mq-smb2-dump.log
Created May 11, 2022 15:59
OP6 charger register dump compared to SHIFT6mq
SMB2 DEBUG: (addr = CHGR_BASE, val = 0x00)
SMB2 DEBUG: (addr = 0x1001, val = 0x00)
SMB2 DEBUG: (addr = 0x1002, val = 0x00)
SMB2 DEBUG: (addr = 0x1003, val = 0x00)
SMB2 DEBUG: (addr = 0x1004, val = 0x02)
SMB2 DEBUG: (addr = 0x1005, val = 0x61)
SMB2 DEBUG: (addr = BATTERY_CHARGER_STATUS_1_REG, val = 0x03)
SMB2 DEBUG: (addr = BATTERY_CHARGER_STATUS_2_REG, val = INPUT_CURRENT_LIMITED_BIT)
SMB2 DEBUG: (addr = CHG_OPTION_REG, val = 0x00)
SMB2 DEBUG: (addr = BATTERY_CHARGER_STATUS_3_REG, val = FV_POST_JEITA_MASK=0x7a)
@calebccff
calebccff / qcom_sound_notes.md
Last active May 15, 2022 16:33
Qualcomm sound architecture notes

Qcom (sdm845) audio

db410c notes

From 96boards docsdragonboard/dragonboard410c/guides/enable-ls-i2s.md.html

  • Primary MI2S - Supports only playback
  • Secondary MI2S - Supports only playback
  • Tertiary MI2S - Supports only capture