Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am johalun on github.
* I am jlundberg (https://keybase.io/jlundberg) on keybase.
* I have a public key ASBOaAMETf8buyzZOM9wd_JyTzmQmBRAzhc5x6u7hwc-ngo
To claim this, I am signing this object:
@johalun
johalun / gist:a0c1886dfdec9256e5063c1bb9bc9227
Created September 24, 2020 21:51
m68k llvm problems..
johalun@xc8 ~/d/M/build (master)> cmake ../llvm -G Ninja -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="M680x0" -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_INSTALL_PREFIX=/opt/llvm-m68k -DCMAKE_BUILD_TYPE=RelWithDebInfo
-- The C compiler identification is Clang 10.0.0
-- The CXX compiler identification is Clang 10.0.0
-- The ASM compiler identification is Clang
-- Found assembler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
@johalun
johalun / gist:3a7c5a8cea01e7031ffbafd92356ad40
Created October 28, 2019 20:21
clock_gettime benchmarks in bhyve
HOST FREEBSD 13:
johalun@jm ~/d/bench-clock> target/release/deps/bench-528070f83c4850f3
running 2 tests
test bench_get_monotonic_coarsetime ... bench: 50 ns/iter (+/- 26)
test bench_get_monotonic_time ... bench: 92 ns/iter (+/- 25)
test result: ok. 0 passed; 0 failed; 0 ignored; 2 measured
@johalun
johalun / iichid.diff
Created September 27, 2019 16:32
iichid.diff
diff --git a/sys/conf/files b/sys/conf/files
index 7eaa38aa6f50..8077d6a80783 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1787,6 +1787,7 @@ dev/iicbus/iicbb.c optional iicbb
dev/iicbus/iicbb_if.m optional iicbb
dev/iicbus/iicbus.c optional iicbus
dev/iicbus/iicbus_if.m optional iicbus
+dev/iicubs/iichid.c optional iichid acpi iicbus
dev/iicbus/iiconf.c optional iicbus
@johalun
johalun / gist:362e6b1584c6adff8a680a76dd722ea3
Created September 12, 2019 22:42
Build results stable/12
johannes@jm:~/dev/freebsd/kms-drm % git status
On branch drm-v5.0-fbsd12.1
Your branch is up to date with 'origin/drm-v5.0-fbsd12.1'.
nothing to commit, working tree clean
johannes@jm:~/dev/freebsd/kms-drm % ./scripts/crossbuild.sh sysdir=/usr/src-stable12/sys
Got sysdir=/usr/src-stable12/sys
Building amd64 SYSDIR=/usr/src-stable12/sys...
Entering world for amd64:amd64
===> linuxkpi (all)
@johalun
johalun / crossbuild.sh
Last active August 30, 2019 21:41
Script to cross compile drm packages
#!/bin/sh
# Requires:
# pkg install devel/powerpc64-xtoolchain-gcc (gcc in base is too old)
# cd /usr/src; make kernel-toolchain TARGET_ARCH=aarch64
CLEAN=no
UPDATE=no
PWD=`pwd`
OBJDIRPREFIX=/tmp/kms-drm-
$ (x=`pwd`; cd /usr/src ; make buildenv CROSS_TOOLCHAIN=powerpc64-gcc TARGET=powerpc TARGET_ARCH=powerpc64 BUILDENV_SHELL="cd ${x}; make -s -j8")
Entering world for powerpc64:powerpc
Explicit target required. Likely "buildworld" is wanted. See build(7).
--- _guard ---
*** [_guard] Error code 1
if ( ! $?XDG_RUNTIME_DIR ) then
setenv XDG_RUNTIME_DIR /tmp/${uid}-runtime-dir
if ( ! -d "$XDG_RUNTIME_DIR" ) then
mkdir "$XDG_RUNTIME_DIR"
chmod 0700 "$XDG_RUNTIME_DIR"
endif
endif
# XKB For Sway:
setenv XKB_DEFAULT_RULES evdev
@johalun
johalun / iichid-suspend-resume.diff
Created June 23, 2019 19:13
iichid suspend resume
commit c86f6c434c203ab8325cd56fff2bc27f2ae0b142
Author: Johannes Lundberg <[email protected]>
Date: Wed May 22 14:54:23 2019
Implement suspend resume for ig4 and i2c devices
diff --git a/sys/dev/ichiic/ig4_acpi.c b/sys/dev/ichiic/ig4_acpi.c
index f0b431fd1007..c3d8be6e0149 100644
--- a/sys/dev/ichiic/ig4_acpi.c
+++ b/sys/dev/ichiic/ig4_acpi.c
@johalun
johalun / drm.diff
Created May 25, 2019 19:55
drm update
diff --git a/graphics/drm-current-kmod/Makefile b/graphics/drm-current-kmod/Makefile
index a026dfa03c86..e5f3f8103d22 100644
--- a/graphics/drm-current-kmod/Makefile
+++ b/graphics/drm-current-kmod/Makefile
@@ -19,6 +19,7 @@ RUN_DEPENDS= gpu-firmware-kmod>=g20180319:graphics/gpu-firmware-kmod
CONFLICTS_INSTALL= drm-devel-kmod \
drm-fbsd11.2-kmod \
drm-fbsd12.0-kmod \
+ drm-fbsd12.1-kmod \
drm-legacy-kmod