Skip to content

Instantly share code, notes, and snippets.

View jernejsk's full-sized avatar

Jernej Škrabec jernejsk

  • Skylabs
  • Slovenia
View GitHub Profile
@jernejsk
jernejsk / uwe5622-mkconfig.py
Created August 17, 2026 12:28
uwe5622 binary config
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-only
"""Convert a vendor UWE5622 RF INI file to the driver's stable container."""
import argparse
import re
import struct
from pathlib import Path
import configparser
from collections import defaultdict
import binascii
import re
import struct
import sys
import uuid
total_sectors = 8 * 1024 * 1024 * 2 # assume 8G image
@jernejsk
jernejsk / memtester.c
Created November 5, 2025 16:33
Memory tester borrowed from SysterKit
/* SPDX-License-Identifier: GPL-2.0 */
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <time.h>
//#include <types.h>
//#include <log.h>
//#include <mmu.h>
diff --git a/config/functions b/config/functions
index 502d63b21eba..d40f339a51df 100644
--- a/config/functions
+++ b/config/functions
@@ -383,47 +383,9 @@ setup_toolchain() {
export MAKEFLAGS
case "$1:$2" in
- target:meson|init:meson)
- export DESTIMAGE="target"
import configparser
import binascii
import struct
import sys
signature = b'IMAGEWTY'
header_ver = 0x300
header_size = 96
format_ver = 0x100234
diff --git a/arch/arm/cpu/armv8/fel_utils.S b/arch/arm/cpu/armv8/fel_utils.S
index 9004b3c27aa3..feb206de2b5e 100644
--- a/arch/arm/cpu/armv8/fel_utils.S
+++ b/arch/arm/cpu/armv8/fel_utils.S
@@ -69,6 +69,16 @@ fel_stash_addr: // must immediately precede back_in_32:
/* AArch32 code to restore the state from fel_stash and return back to FEL. */
back_in_32:
.word 0xe51f000c // ldr r0, [pc, #-12] ; load fel_stash address
+
+ .word 0xe10f2000 // mrs r2,cpsr
diff --git a/arch/arm/mach-sunxi/dram_sun50i_h616.c b/arch/arm/mach-sunxi/dram_sun50i_h616.c
index 37c139e0eea5..d19812c6e3f1 100644
--- a/arch/arm/mach-sunxi/dram_sun50i_h616.c
+++ b/arch/arm/mach-sunxi/dram_sun50i_h616.c
@@ -1318,31 +1318,72 @@ static void mctl_auto_detect_rank_width(const struct dram_para *para,
panic("This DRAM setup is currently not supported.\n");
}
+static bool compare_mem(ulong offset)
+{
@jernejsk
jernejsk / h616-dram.c
Created December 6, 2022 20:55
H616 DRAM settings parser
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
struct dram_para {
uint32_t clk;
uint32_t type;
uint32_t dx_odt;
uint32_t dx_dri;
setenv machid 1029
setenv bootm_boot_mode sec
setenv bootargs console=ttyS0,115200 boot=/dev/mmcblk0p1 disk=/dev/mmcblk0p2 consoleblank=0 no_console_suspend ignore_loglevel
fatload mmc 0 0x43000000 script.bin
fatload mmc 0 0x42000000 KERNEL
bootm 0x42000000
rmmod bcmdhd
modprobe bcmdhd nvram_path=/lib/firmware/brcm/nvram_ap6210.txt