Skip to content

Instantly share code, notes, and snippets.

View bluecmd's full-sized avatar

Christian Svensson bluecmd

  • Stockholm, Sweden
View GitHub Profile
@bluecmd
bluecmd / Makefile
Last active August 29, 2020 13:20
cocotb scoreboard with binary
TOPLEVEL_LANG = verilog
VERILOG_SOURCES = $(shell pwd)/fejkon_fc_debug.sv
TOPLEVEL = fejkon_fc_debug
MODULE = test
include $(shell cocotb-config --makefiles)/Makefile.sim
@bluecmd
bluecmd / output.log
Created August 28, 2020 21:34
SFP Fejkon
bluecmd@tyan:~/fejkon/driver/i2c$ sudo ./i2c
==== SFP 1 ====
Identifier [0] : 0x03 (SFP)
Extended Identifier [1] : 0x04 (GBIC/SFP defined by 2-wire interface ID)
Connector [2] : 0x07 (LC)
Transceiver Codes [3-10] : 0x00 0x00 0x00 0x00 0x40 0x40 0x0c 0x54
Transceiver Type : FC: short distance (S)
: FC: Shortwave laser w/o OFC (SN)
: FC: Multimode, 50um (M5)
@bluecmd
bluecmd / gist:5a2163dabaaf53d7d82dc2fa42185d9d
Created August 26, 2020 21:03
IUCV init gets "BAD INIT MSG LEN"
0000003 FILES CHANGED
[ 0.162250] IUCV IRQ: path=0, flags=64, type=2
[ 0.162255] new iucv path registerd (path=0), handler=0000000000731868
2020/08/26 20:54:14 System booted
[ 0.189778] new iucv path registerd (path=1), handler=000000000072b798
[ 0.189798] IUCV IRQ: path=1, flags=128, type=2
[ 0.189827] send2way called: data=000000000ed40000 size=20
[ 0.189832] --- iucv_message_send2way path=1
[ 0.189841] send2way buffer: 00000000: c9 e4 c3 e5 c1 d7 c9 40 00 32 00 04 c9 e4 c3 e5 .......@.2......
[ 0.189847] send2way buffer: 00000010: c1 d7 c9 4
b3:00.0 Fibre Channel [0c04]: Device [f1c0:0de5] (rev 01)
Subsystem: Device [f1c0:0de5]
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 32 bytes
Interrupt: pin A routed to IRQ 62
NUMA node: 0
Region 0: Memory at fbe00000 (32-bit, non-prefetchable) [size=64K]
Capabilities: [50] MSI: Enable+ Count=16/32 Maskable- 64bit+
Address: 00000000fee00218 Data: 0000
@bluecmd
bluecmd / metrics.yaml
Created July 17, 2020 21:40
Driver 36 HMC metrics for z114
metric_groups:
# These will only find something if you are in classic mode
cpc-usage-overview:
prefix: cpc
fetch: True
logical-partition-usage:
prefix: lpar
fetch: True
channel-usage:
prefix: channel
@bluecmd
bluecmd / extest.S
Created July 13, 2020 11:35
EXECUTE test for S390x
.text
.section .rodata
.align 2
.print0:
.string "Error code is %d\n"
.text
.align 8
.globl main
.type main, @function
main:
@bluecmd
bluecmd / keylist
Created July 8, 2020 15:42
Get users from github keys
#!/bin/bash
set -o pipefail
[ $# -ne 1 ] && { echo "Usage: $0 userid" >&2; exit 1; }
function manage_keys {
u="${1?}"
d="$(eval echo ~${u})"
install -d -m 0700 -o "${u}" "${d}/.ssh/"
[ -f "${d?}/.ssh/authorized_keys" ] && cat "${d?}/.ssh/authorized_keys"
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0,115200n8"
GRUB_CMDLINE_LINUX=""
1 SF 000000
1 RD 000000
1 RD 008020
1 RD 008030
1 RD 008640
1 RD 008000
1 RD 008030
1 RD 008630
1 RD 008680
1 RD 008638
test: build-qemu/x86_64-softmmu/qemu-system-x86_64 linux/arch/x86/boot/bzImage root/sbin/init root/lib/modules/$(KERNEL)/extra/fejkon.ko
build-qemu/x86_64-softmmu/qemu-system-x86_64 \
-nographic -m 1G \
-machine q35,kernel-irqchip=split \
-device intel-iommu,intremap=on,device-iotlb=on \
-fsdev local,id=root,path=$(PWD)/root,security_model=none,writeout=immediate \
-device virtio-9p-pci,fsdev=root,mount_tag=/dev/root \
-kernel linux/arch/x86/boot/bzImage \
-device fejkon \
-append "root=hostfs rootfstype=9p rootflags=trans=virtio noinitrd console=ttyS0 loglevel=8"