Skip to content

Instantly share code, notes, and snippets.

@hanetzer
hanetzer / stdin
Created April 28, 2022 03:30
stdin
[ 0.253960] 8<--- cut here ---
[ 0.262026] Unable to handle kernel paging request at virtual address fffffe3b
[ 0.281097] [fffffe3b] *pgd=affff841, *pte=00000000, *ppte=00000000
[ 0.297677] Internal error: Oops: 27 [#1] PREEMPT SMP ARM
[ 0.311920] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.18.0-rc4-00006-gd615b5416f8a-dirty #46
[ 0.334647] Hardware name: Generic DT based system
[ 0.347277] PC is at kmem_cache_alloc+0xdc/0x214
[ 0.359475] LR is at kmem_cache_alloc+0x28/0x214
[ 0.371654] pc : [<c020e7cc>] lr : [<c020e718>] psr: 20000053
[ 0.388182] sp : c0b01f28 ip : 00000001 fp : 00000000
@hanetzer
hanetzer / stdin
Created April 20, 2022 23:29
stdin
cross-compile = armv7a-hardfloat-linux-gnueabihf-
cc = ${cross-compile}gcc
ld = ${cross-compile}ld
cpp = ${cross-compile}cpp
objdump = ${cross-compile}objdump
objcopy = ${cross-compile}objcopy
cflags = -O0 -gdwarf-4 -Iinclude
@hanetzer
hanetzer / stdin
Created April 20, 2022 22:46
stdin
project('bootrom', 'c')
inc = include_directories('include')
bootrom_elf = executable(
'bootrom',
sources: ['bootrom.S'],
c_args: ['-nostdlib'],
include_directories : inc,
link_args: ['-nostdlib'],
)
bootrom_bin = custom_target('bootrom.bin',
@hanetzer
hanetzer / stdin
Created April 20, 2022 22:15
stdin
#ifndef CRG_H
#define CRG_H
#define CRG_REG_APLL0 0x0000
#define R_PLLx_FRAC_SHIFT 0
#define R_PLLx_FRAC_LENGTH 24
#define R_PLLx_FRAC_MASK ((~0ULL) >> (32 - (24))) << (0)
#define R_PLLx_POSTDIV1_SHIFT 23
#define R_PLLx_POSTDIV1_LENGTH 3
#define R_PLLx_POSTDIV1_MASK ((~0) >> (32 - (3))) << (23)
@hanetzer
hanetzer / stdin
Created April 20, 2022 20:53
stdin
{
"register_field": {
"prefix": "regf",
"body": [
"\t#define R_${1:reg}_${2:field}_SHIFT (${3:shift})",
"\t#define R_$1_$2_LENGTH (${4:length})",
"\t#define R_$1_$2_MASK (((~0) >> (64 - ($4))) << ($3))",
"$0"
],
"description": "Code snippet for register bitfield definitions"
@hanetzer
hanetzer / stdin
Created April 8, 2022 16:31
stdin
Illegal AArch32 mode switch attempt from hyp to svc
hi3521a_sysctrl_read: offset 0x0140 val 0x00000000
hi3521a_sysctrl_read: offset 0x0000 val 0x00000212
hi3521a_sysctrl_write: offset 0x0000 val 0x00000312
bootaddr: unimplemented device write (size 4, offset 0x0000000, value 0xea000417)
bootaddr: unimplemented device write (size 4, offset 0x0000004, value 0xe59ff014)
bootaddr: unimplemented device write (size 4, offset 0x0000008, value 0xe59ff014)
bootaddr: unimplemented device write (size 4, offset 0x000000c, value 0xe59ff014)
bootaddr: unimplemented device write (size 4, offset 0x0000010, value 0xe59ff014)
bootaddr: unimplemented device write (size 4, offset 0x0000014, value 0xe59ff014)
@hanetzer
hanetzer / stdin
Created April 8, 2022 16:30
stdin
hi3521a_crg_read: offset 0x0084 val 0x00000000
hi3521a_crg_write: offset 0x0084 val 0x00080000
hi3521a_crg_read: offset 0x0034 val 0x00000000
hi3521a_sysctrl_read: offset 0x0000 val 0x00000212
hi3521a_sysctrl_write: offset 0x0000 val 0xaa550212
rtc: unimplemented device read (size 4, offset 0x0fe0)
rtc: unimplemented device read (size 4, offset 0x0fe4)
rtc: unimplemented device read (size 4, offset 0x0fe8)
rtc: unimplemented device read (size 4, offset 0x0fec)
rtc: unimplemented device read (size 4, offset 0x0ff0)
(gdb) run
Starting program: /home/hanetzer/Projects/qemu/build/qemu-system-arm -M rsdm290e -nographic
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff2397640 (LWP 100910)]
Thread 1 "qemu-system-arm" received signal SIGSEGV, Segmentation fault.
0x0000555555cb6d26 in cpu_get_address_space (cpu=cpu@entry=0x5555569882e0, asidx=0) at ../softmmu/physmem.c:769
769 return cpu->cpu_ases[asidx].as;
(gdb) thread apply all bt
@hanetzer
hanetzer / stdin
Created April 1, 2022 03:38
stdin
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "ar9344.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
chosen {
@hanetzer
hanetzer / stdin
Created March 30, 2022 16:25
stdin
/usr/libexec/gcc/mips64-unknown-linux-musl/ld: cannot find crti.o: No such file or directory
/usr/libexec/gcc/mips64-unknown-linux-musl/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:995: libgcc_s.so] Error 1
make[2]: Leaving directory '/var/tmp/portage/cross-mips64-unknown-linux-musl/gcc-11.2.1_p20220115/work/build/mips64-unknown-linux-musl/libgcc'
make[1]: *** [Makefile:12856: all-target-libgcc] Error 2
make[1]: Leaving directory '/var/tmp/portage/cross-mips64-unknown-linux-musl/gcc-11.2.1_p20220115/work/build'
make: *** [Makefile:961: al] Error 2