Skip to content

Instantly share code, notes, and snippets.

/*-
* Copyright (c) 2020 Ryo Shimizu <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
@ryo
ryo / odroid-n2-plus.dmesg
Last active December 13, 2020 17:45
netbsd/odroid-n2-plus (WIP)
[ 1.0000000] uboot: args 0x3ffeb000, 0, 0, 0
[ 1.0000000] NetBSD/evbarm (fdt) booting ...
[ 1.0000000] FDT /memory @ 0x0 size 0xf4e5b000
[ 1.0000000] initarm: memory start 0 end f4e5b000 (len f4e5b000)
[ 1.0000000] initarm: fdt_build_bootconfig
[ 1.0000000] Usable memory:
[ 1.0000000] 0 - 4ffffff
[ 1.0000000] 5300000 - f4e5afff
[ 1.0000000] Creating L2 tables: ffff000000000000-ffff000004ffffff : 0000000000000000-0000000004ffffff
[ 1.0000000] pmapboot_enter: va=0xffff000000000000, pa=0x0, size=0x5000000, blocksize=0x200000, attr=0x0060000000000000
N2+ (A73,2400MHz)
# time sh -c 'echo "scale=2000; 4*a(1)" | bc -l' > /dev/null
2.936u 0.001s 0:02.93 100.0% 1+0k 0+0io 0pf+0w
N2+ (A73,1800MHz)
# time sh -c 'echo "scale=2000; 4*a(1)" | bc -l' > /dev/null
4.129u 0.002s 0:04.13 99.7% 1+0k 0+0io 0pf+0w
RP64 (A72,1800MHz)
# time sh -c 'echo "scale=2000; 4*a(1)" | bc -l' > /dev/null
[ 1.0000000] NetBSD/evbarm (fdt) booting ...
[ 1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
[ 1.0000000] 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
[ 1.0000000] 2018, 2019, 2020 The NetBSD Foundation, Inc. All rights reserved.
[ 1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
[ 1.0000000] The Regents of the University of California. All rights reserved.
[ 1.0000000] NetBSD 9.99.75 (GENERIC64) #220: Thu Nov 12 16:36:51 JST 2020
[ 1.0000000] ryo@subq:/usr/src/sys/arch/evbarm/compile/GENERIC64
[ 1.0000000] total memory = 3896 MB
[ 1.0000000] NetBSD/evbarm (fdt) booting ...
[ 1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
[ 1.0000000] 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
[ 1.0000000] 2018, 2019, 2020 The NetBSD Foundation, Inc. All rights reserved.
[ 1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
[ 1.0000000] The Regents of the University of California. All rights reserved.
[ 1.0000000] NetBSD 9.99.75 (GENERIC64) #42: Thu Nov 5 06:33:55 JST 2020
[ 1.0000000] ryo@subq:/usr/src/sys/arch/evbarm/compile/GENERIC64
[ 1.0000000] total memory = 3896 MB
@ryo
ryo / odroid-n2-plus.boot.log
Created October 26, 2020 17:36
NetBSD/evbarm64 (GENERIC64) ODROID-N2
bl31 reboot reason: 0xd
bl31 reboot reason: 0x0
system cmd 1.
G12B:BL:6e7c85:2a3b91;FEAT:E0F83180:402000;POC:F;RCY:0;EMMC:0;READ:0;0.
bl2_stage_init 0x01
bl2_stage_init 0x81
hw id: 0x0000 - pwm id 0x01
bl2_stage_init 0xc1
bl2_stage_init 0x02
@ryo
ryo / log
Created October 25, 2020 10:17
rockpro64 EB log
[ 1.0000000] NetBSD/evbarm (fdt) booting ...
[ 1.0000000] psci_call: FuncID=c4000003, 00000001, 004018e8, 00000000
[ 1.0000000] psci_call: FuncID=c4000003, 00000002, 004018e8, 00000000
[ 1.0000000] psci_call: FuncID=c4000003, 00000003, 004018e8, 00000000
[ 1.0000000] psci_call: FuncID=c4000003, 00000100, 004018e8, 00000000
[ 1.0000000] psci_call: FuncID=c4000003, 00000101, 004018e8, 00000000
[ 1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
[ 1.0000000] 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
[ 1.0000000] 2018, 2019, 2020 The NetBSD Foundation, Inc. All rights reserved.
[ 1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
@ryo
ryo / aarch64_be.patch
Last active September 27, 2020 20:59
cvs -q diff -u -a -p
Index: apache2/llvm/autoconf/autoconf/config.guess
===================================================================
RCS file: /src/cvs/cvsroot-netbsd/src/external/apache2/llvm/autoconf/autoconf/config.guess,v
retrieving revision 1.1
diff -u -a -p -r1.1 config.guess
--- apache2/llvm/autoconf/autoconf/config.guess 11 Nov 2019 22:44:57 -0000 1.1
+++ apache2/llvm/autoconf/autoconf/config.guess 27 Sep 2020 19:53:18 -0000
@@ -158,6 +158,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
% uname -ap
NetBSD subq 9.99.69 NetBSD 9.99.69 (GENERIC.SUBQ) #37: Sun Jul 5 02:54:58 JST 2020 ryo@subq:/usr/src/sys/arch/amd64/compile/GENERIC.SUBQ amd64 x86_64
% cat mmaptest.c
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/mman.h>
@@ -947,10 +947,16 @@ pmap_icache_sync_range(pmap_t pm, vaddr_
void
pmap_procwr(struct proc *p, vaddr_t va, int len)
{
+ paddr_t pa;
+
+ if (p != curproc) {
+ struct pmap *pm = p->p_vmspace->vm_map.pmap;
+ if (!pmap_extract(pm, va, &pa))
+ return;