Skip to content

Instantly share code, notes, and snippets.

View ayufan's full-sized avatar

Kamil Trzciński ayufan

View GitHub Profile
/dts-v1/;
/memreserve/ 0x0000000045000000 0x0000000000200000;
/memreserve/ 0x0000000041010000 0x0000000000010000;
/memreserve/ 0x0000000041020000 0x0000000000000800;
/memreserve/ 0x0000000040100000 0x0000000000004000;
/memreserve/ 0x0000000040104000 0x0000000000001000;
/memreserve/ 0x0000000040105000 0x0000000000001000;
/ {
model = "sun50iw1p1";
@ayufan
ayufan / boot0_head.c
Created January 3, 2017 13:41
Pine A64 boot0 parameters
const boot0_file_head_t BT0_head =
{
{
/* jump_instruction */
( 0xEA000000 | ( ( ( sizeof( boot0_file_head_t ) + sizeof(uboot_hash_value) + sizeof( int ) - 1 ) / sizeof( int ) - 2 ) & 0x00FFFFFF ) ),
BOOT0_MAGIC,
STAMP_VALUE,
#ifdef ALIGN_SIZE_8K
0x2000,
@ayufan
ayufan / boot0.log
Created January 3, 2017 15:17
Pine A64 boot0 fails to start u-boot
boot0 commit : 0bc348ab272ad81a4faf128ef38f4724f36fded6
boot0 version : 4.0.0
set pll start
set pll end
rtc[0] value = 0x00000000
rtc[1] value = 0x00000000
rtc[2] value = 0x00000000
rtc[3] value = 0x00000000
rtc[4] value = 0x00000000
static int i2cB_clock( void )
{
int sample = 0;
sunxi_lcd_delay_us(5);
IIC_SCLB_HIGH();
sunxi_lcd_delay_us(5);
IIC_SCLB_LOW();
return (sample);
}
@ayufan
ayufan / pinebook-iozone-emmc.txt
Created January 30, 2017 21:02
Pinebook eMMC performance
Iozone: Performance Test of File I/O
Version $Revision: 3.429 $
Compiled for 64 bit mode.
Build: linux
Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins
Al Slater, Scott Rhine, Mike Wisner, Ken Goss
Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR,
Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner,
Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone,
[ 179.656929] PM: suspend devices took 1.150 seconds
[ 179.662376] [pm]prepare
[ 179.665735] PM: late suspend of devices complete after 0.698 msecs
[ 179.673403] PM: noirq suspend of devices complete after 0.726 msecs
[ 179.680385] [pm]prepare_late
[ 179.685731] Disabling non-boot CPUs ...
[ 179.691857] CPU1: shutdown
[ 179.694838] psci: CPU1 killed.
[ 179.703237] CPU2: shutdown
#!/bin/bash
join_by() {
local IFS=","
echo "$*"
}
get_data() {
local QUERIES=$(join_by "$@")
while read -d "," VALUE REST; do
package main
import (
"crypto/tls"
"flag"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"

Keybase proof

I hereby claim:

  • I am ayufan on github.
  • I am ayufan (https://keybase.io/ayufan) on keybase.
  • I have a public key whose fingerprint is 0442 B363 40A3 074D 812A 6A20 1E99 8518 0FCF BA1E

To claim this, I am signing this object:

@ayufan
ayufan / qemu-arm64.bash
Last active July 6, 2017 11:05
Run KVM machine on AARCH64
set -xe
dd if=/dev/zero of=flash0.img bs=1M count=64
dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=flash0.img conv=notrunc
dd if=/dev/zero of=flash1.img bs=1M count=64
wget -c http://ftp.ubuntu-tw.net/ubuntu-cloud-images/xenial/current/xenial-server-cloudimg-arm64-uefi1.img
sudo apt-get install qemu-system-arm qemu-efi
sudo qemu-system-aarch64 -enable-kvm -m 1024 -cpu host -M virt -nographic -pflash flash0.img -pflash flash1.img -drive if=none,file=xenial-server-cloudimg-arm64-uefi1.img,id=hd0 -device virtio-blk-device,drive=hd0 -netdev type=tap,id=net0 -device virtio-net-device,netdev=net0,mac=00:01:02:03:04:05