Skip to content

Instantly share code, notes, and snippets.

View xdarklight's full-sized avatar

Martin Blumenstingl xdarklight

View GitHub Profile
@xdarklight
xdarklight / gist:571c137a25eebf5e6b4f3d924061e2da
Last active March 26, 2017 14:37
meson8m2 pwm @ 1.2GHz CPU
# example: pwm_ab = 0xc1108550, strip last nibble, insert below:
for OFFSET in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do echo "read 0xc110855${OFFSET}" > debug; done
## TODO: Linux register values seem wrong?
# pwm_ab
MEMORY[0xc1108550]=0x00000001
MEMORY[0xc1108551]=0x54000000
MEMORY[0xc1108552]=0x85540000
MEMORY[0xc1108553]=0x10855400
@xdarklight
xdarklight / meson_saradc.txt
Last active March 11, 2017 12:51
Meson SAR ADC register dumps from various devices
## clkc SAR ADC (same on GXBB and GXM)
# echo 0xc883c3d8 2 > dump ; cat dump
[0xc883c3d8] = 0x114
[0xc883c3dc] = 0x0
# echo 0xc1108680 44 > dump ; cat dump
## GXM (Mecool BB2)
[0xc1108680] = 0x84064041
[0xc1108684] = 0x6
[0xc1108688] = 0x0
@xdarklight
xdarklight / bthomehubv5a-initial-install-partitions.patch
Created June 27, 2015 20:49
lantiq: Add partition scheme from original firmware for initial install script
diff --git a/target/linux/lantiq/dts/BTHOMEHUBV5A.dts b/target/linux/lantiq/dts/BTHOMEHUBV5A.dts
index eb77390..4d0aee6 100644
--- a/target/linux/lantiq/dts/BTHOMEHUBV5A.dts
+++ b/target/linux/lantiq/dts/BTHOMEHUBV5A.dts
@@ -45,6 +45,16 @@
label = "ubi";
reg = <0x2a0000 0x7d60000>;
};
+ partition@100000 {
+ label = "ofw_ubi";
@xdarklight
xdarklight / gist:6f58bcaa4041e7dffee3
Created April 19, 2015 09:40
scan-dvb initial tuning data to tvheadend initial tuning data
cat scan-dvb.initial-tuning-data | while read LINE; do echo -e "[CHANNEL]\n\tDELIVERY_SYSTEM = DVBC/ANNEX_A\n\tFREQUENCY = $(echo $LINE | cut -d' ' -f2)\n\tSYMBOL_RATE = $(echo $LINE | cut -d' ' -f3)\n\tINNER_FEC = NONE\n\tMODULATION = $(echo $LINE | cut -d' ' -f5 | sed 's|QAM|QAM/|')\n\tINVERSION = AUTO\n"; done
@xdarklight
xdarklight / gist:bd509304716d1752dde3
Last active August 29, 2015 14:18
ddrescue backup script
#!/bin/bash
SOURCE="/dev/sdaXXX"
TARGET="/dev/sdcYYY"
LOGFILE="/tmp/ddrescue.log"
ddrescue -f -v --no-split $SOURCE $TARGET $LOGFILE
cp $LOGFILE /home/partimag/ddrescue.log-after-pass1
ddrescue -f -v --direct -r3 $SOURCE $TARGET $LOGFILE
cp $LOGFILE /home/partimag/ddrescue.log-after-pass2
ddrescue -f -v --direct --retrim -r3 $SOURCE $TARGET $LOGFILE