Re: ARM support for RK339 Firefly ?
Le 11 octobre 2019 20:24:20 GMT+02:00, Mark Kettenis a écrit : >> Date: Fri, 11 Oct 2019 19:33:25 +0200 (CEST) >> From: sylvain.sab...@free.fr >> >> Hello. >> >> I have been acquiring a Firefly RK-3399 ARM card, >> with the intention of using it as a support platform >> for diverse projects. >> >> Unfortunately my attempts at running OpenBSD on it >> have not been as fruitful as expected. >> (confer my post on the French OpenBSD community forums) >> https://obsd4a.net/forum/showthread.php?tid=2408&pid=19053 >> >> May I know, where is the support at for this platform ? > >The platform works really well (I have one). There is no graphics >support though, so you'll have to use a serial console. The standard >serial speed is 150 baud (which isn't always supported by usb >serial converters) but the U-Boot firmware in ports has been patched >to support a more standard 115200. > >The main problem is that board comes with firmware already installed >on eMMC and the board boots from eMMC first. I worked around that by >zapping the contents of the eMMC from Linux (risky). Then the board >will boot from uSD. It is also possible to flash the eMMC over one of >the USB ports, but you'd need a machine with Linux and/or Windows to >do that. > >Cheers, > >Mark Indeed, I cannot get the console to display anything. Does this mean that the usb-ttl adapter that is provided with my order is even unfit, and I have to purchase another one? And, yes again, the only solution is to flash the eMMC. Really? That sounds unfortunate, as I prefer to keep things in factory settings, as an option. I guess eventually there might be a workaround with working on the boot manager? I have the second version of the card/firmware at present, which is the second one released in 2018 I think. It seems to not be fully open source although this was promoted... Sylvain sur K9 mail Android
Re: ARM support for RK339 Firefly ?
> Date: Sat, 12 Oct 2019 08:55:50 +0200 > From: Sylvain > > Le 11 octobre 2019 20:24:20 GMT+02:00, Mark Kettenis > a écrit : > >> Date: Fri, 11 Oct 2019 19:33:25 +0200 (CEST) > >> From: sylvain.sab...@free.fr > >> > >> Hello. > >> > >> I have been acquiring a Firefly RK-3399 ARM card, > >> with the intention of using it as a support platform > >> for diverse projects. > >> > >> Unfortunately my attempts at running OpenBSD on it > >> have not been as fruitful as expected. > >> (confer my post on the French OpenBSD community forums) > >> https://obsd4a.net/forum/showthread.php?tid=2408&pid=19053 > >> > >> May I know, where is the support at for this platform ? > > > >The platform works really well (I have one). There is no graphics > >support though, so you'll have to use a serial console. The standard > >serial speed is 150 baud (which isn't always supported by usb > >serial converters) but the U-Boot firmware in ports has been patched > >to support a more standard 115200. > > > >The main problem is that board comes with firmware already installed > >on eMMC and the board boots from eMMC first. I worked around that by > >zapping the contents of the eMMC from Linux (risky). Then the board > >will boot from uSD. It is also possible to flash the eMMC over one of > >the USB ports, but you'd need a machine with Linux and/or Windows to > >do that. > > > >Cheers, > > > >Mark > > Indeed, I cannot get the console to display anything. Does this mean > that the usb-ttl adapter that is provided with my order is even > unfit, and I have to purchase another one? The one that I got with my board worked. If you're using OpenBSD you'll need to use: # cu -l cuaU0 -s 1500 There may be an issue with driver support for those speeds. A dmesg would help in that case. > And, yes again, the only solution is to flash the eMMC. Really? That > sounds unfortunate, as I prefer to keep things in factory settings, > as an option. I guess eventually there might be a workaround with > working on the boot manager? Depending on the firmware in eMMC it may be possible to build your own trust.img and u-boot.img and write them at the appropriate offsets on your uSD card. The miniroot66.fs will have anough space at the start of the image to do that. This needs some binary-only tools that only run on Linux or Windows though. See doc/README.rockchip in the U-Boot source tree. The following URL may be helpful to understand how things work: http://opensource.rock-chips.com/wiki_Boot_option In this setup it would load idbloader.img from eMMC and u-boot.img and trust.img from uSD. > I have the second version of the card/firmware at present, which is > the second one released in 2018 I think. It seems to not be fully > open source although this was promoted... If you want fully open source firmware you'll need to wipe eMMC or replace the firmware on the eMCC. Cheers, Mark
Improve devel/gdb aarch64 support
Improve devel/gdb aarch64 support: * Enable debugging on running threaded programs * Provide sigtramp routine unwinding (support modeled after ppc) okay? Example of unwinding through signal trap page on running target: (gdb) bt #0 handler (sig=11, sip=0x16517e9238, ctx=0x16517e9118) at pthread_attr_setguardsize_test.c:31 #1 #2 0x0011f87d052c in check_bounds (bottom=0x16515e6000 , top=0x16517ea000 ) at pthread_attr_setguardsize_test.c:95 #3 0x0011f87d05e8 in thread_start (arg=0x0) at pthread_attr_setguardsize_test.c:111 #4 0x001647d772bc in _rthread_start (v=) at /usr/src/lib/librthread/rthread.c:96 #5 0x00164bf42afc in __tfork_thread () at /usr/src/lib/libc/arch/aarch64/sys/tfork_thread.S:39 Backtrace stopped: previous frame identical to this frame (corrupt stack?) Example of thread support on running target. (gdb) info threads Id Target Id Frame 1thread 548780 futex () at -:4 * 2thread 457261 handler (sig=11, sip=0x16517e9238, ctx=0x16517e9118) at pthread_attr_setguardsize_test.c:31 (gdb) thread 1 [Switching to thread 1 (thread 548780)] #0 futex () at -:4 4 -: No such file or directory. (gdb) bt #0 futex () at -:4 #1 0x001647d745c8 in _twait (p=0x167a2b9008, val=, clockid=, abs=) at /usr/src/lib/librthread/synch.h:41 #2 _sem_wait (sem=, can_eintr=0, abstime=0x0, delayed_cancel=0x164bfe3cc8 <_initial_thread+200>) at /usr/src/lib/librthread/rthread_sem.c:77 #3 0x001647d76df8 in pthread_join (thread=0x167a2b9000, retval=0x7d6080) at /usr/src/lib/librthread/rthread.c:304 #4 0x0011f87d0744 in main () at pthread_attr_setguardsize_test.c:139 Index: Makefile === RCS file: /cvs/ports/devel/gdb/Makefile,v retrieving revision 1.61 diff -u -p -u -r1.61 Makefile --- Makefile16 Jul 2019 21:29:41 - 1.61 +++ Makefile12 Oct 2019 22:49:59 - @@ -4,7 +4,7 @@ COMMENT=GNU debugger CATEGORIES=devel DISTNAME= gdb-7.12.1 -REVISION= 7 +REVISION= 8 HOMEPAGE= https://www.gnu.org/software/gdb/ Index: patches/patch-gdb_aarch64obsd-nat_c === RCS file: /cvs/ports/devel/gdb/patches/patch-gdb_aarch64obsd-nat_c,v retrieving revision 1.1 diff -u -p -u -r1.1 patch-gdb_aarch64obsd-nat_c --- patches/patch-gdb_aarch64obsd-nat_c 10 Jul 2018 11:03:46 - 1.1 +++ patches/patch-gdb_aarch64obsd-nat_c 12 Oct 2019 22:49:59 - @@ -2,7 +2,7 @@ $OpenBSD: patch-gdb_aarch64obsd-nat_c,v Index: gdb/aarch64obsd-nat.c --- gdb/aarch64obsd-nat.c.orig +++ gdb/aarch64obsd-nat.c -@@ -0,0 +1,205 @@ +@@ -0,0 +1,206 @@ +/* Native-dependent code for OpenBSD/arm64 (AArch64) + + Copyright (C) 2011-2017 Free Software Foundation, Inc. @@ -32,6 +32,7 @@ Index: gdb/aarch64obsd-nat.c + +#include "aarch64-tdep.h" +#include "inf-ptrace.h" ++#include "obsd-nat.h" + +/* Fill GDB's register array with the general-purpose register values + from the current thread. */ @@ -44,7 +45,7 @@ Index: gdb/aarch64obsd-nat.c + int regno; + int ret; + -+ pid = ptid_get_pid (inferior_ptid); ++ pid = get_ptrace_pid (inferior_ptid); + + ret = ptrace(PT_GETREGS, pid, (caddr_t)®s, 0); + if (ret < 0) @@ -69,7 +70,7 @@ Index: gdb/aarch64obsd-nat.c + int regno; + int ret; + -+ pid = ptid_get_pid (inferior_ptid); ++ pid = get_ptrace_pid (inferior_ptid); + + // fetch old values as only 'valid' entries will be replaced. + ret = ptrace(PT_GETREGS, pid, (caddr_t)®s, 0); @@ -106,7 +107,7 @@ Index: gdb/aarch64obsd-nat.c + int regno; + struct fpreg fpregs; + -+ pid = ptid_get_pid (inferior_ptid); ++ pid = get_ptrace_pid (inferior_ptid); + + ret = ptrace(PT_GETFPREGS, pid, (caddr_t)&fpregs, 0); + if (ret < 0) { @@ -132,7 +133,7 @@ Index: gdb/aarch64obsd-nat.c + int regno; + struct fpreg fpregs; + -+ pid = ptid_get_pid (inferior_ptid); ++ pid = get_ptrace_pid (inferior_ptid); + + ret = ptrace(PT_GETFPREGS, pid, (caddr_t)&fpregs, 0); + if (ret < 0) { @@ -206,5 +207,5 @@ Index: gdb/aarch64obsd-nat.c + t->to_store_registers = aarch64_obsd_store_inferior_registers; + + /* Register the target. */ -+ add_target (t); ++ obsd_add_target (t); +} Index: patches/patch-gdb_aarch64obsd-tdep_c === RCS file: /cvs/ports/devel/gdb/patches/patch-gdb_aarch64obsd-tdep_c,v retrieving revision 1.1 diff -u -p -u -r1.1 patch-gdb_aarch64obsd-tdep_c --- patches/patch-gdb_aarch64obsd-tdep_c10 Jul 2018 11:03:46 - 1.1 +++ patches/patch-gdb_aarch64obsd-tdep_c12 Oct 2019 22:49:59 - @@ -2,7 +2,7 @@ $OpenBSD: patch-gdb_aarch64obsd-tdep_c,v Index: gdb/aarch64obsd-tdep.c --- gdb/aarch64obsd-tdep.c.orig +++ gdb/aarch64obsd-tdep.c -@@ -0,0 +1,111 @@ +@@ -0,0 +1,299 @@ +/* Target-dependent code for OpenBSD/aarch64. + + Copyright (C) 2006-2017 Free Software Foundation, I