Re: RISCV - port to Mango Pi MQ-Pro (D1)

2023-10-01 Thread Peter J. Philipp
On Sat, Sep 23, 2023 at 09:15:30AM +0200, Peter J. Philipp wrote:
> On Mon, Sep 18, 2023 at 02:37:50PM +0200, Peter J. Philipp wrote:
> > Hi,
> > 
> > I've been working a little bit on making OpenBSD run on Mango Pi, I haven't
> > succeeded yet, but I think we're close.  My patches are here:
> > 
> > https://github.com/pbug44/openbsd-src/tree/MANGOPI
> 
> Just a status report, I got it to boot to the exec'ing init.  I had to
> disable plic0 and com0, and am running on the boot loaders console.  That is
> probably why I see no installer message (no /dev/console).

Well I'm out of time, given another month I might have made it work.  Here is
my final commit:

https://github.com/pbug44/openbsd-src/commit/e25ff39b81043bbfb71c588fec7eb6c3c0025d91

Another failure, but I learned a lot so it was a success in my eyes.  I'm going
back to programming on my delphinusdnsd for the rest of this year.  That's my
priority.

I'm passing the torch to Miguel, Moritz and Mark who I've been having steady
contact with throughout this.  They have this hardware and are able to
make it work given time.  If nothing happens by december, I may be able to
pick up on this (if I want).

Best Regards,
-peter

-- 
Over thirty years experience on Unix-like Operating Systems starting with QNX.



Re: RISCV - port to Mango Pi MQ-Pro (D1)

2023-09-23 Thread Peter J. Philipp
On Mon, Sep 18, 2023 at 02:37:50PM +0200, Peter J. Philipp wrote:
> Hi,
> 
> I've been working a little bit on making OpenBSD run on Mango Pi, I haven't
> succeeded yet, but I think we're close.  My patches are here:
> 
> https://github.com/pbug44/openbsd-src/tree/MANGOPI

Just a status report, I got it to boot to the exec'ing init.  I had to
disable plic0 and com0, and am running on the boot loaders console.  That is
probably why I see no installer message (no /dev/console).

So that is the work that still needs to be done, getting the console working
right.  It's the same as the Allwinner H6 (APB driven), though when I enable
cn_tab (which I hashed out) in /sys/dev/fdt/com_fdt.c then all I see is 
one or two bytes in the serial cu, and it reminds me of a speedrate problem.
I haven't figured that out yet.

The other thing is the plic.  I did workarounds to get around its freezing,
but those are likely wrong.  Because when an IRQ gets enabled it freezes the
boot process.  I'll hopefully get this all fixed up by next weekend at which
time I'm going back to dns programming (shift of priorities).

Here is the dmesg to the point of WARNING: CHECK AND RESET THE DATE!


--->
U-Boot 2022.10 (Jul 20 2023 - 09:48:42 +) Allwinner Technology

DRAM:  1 GiB
sunxi_set_gate: (CLK#24) unhandled
Core:  54 devices, 20 uclasses, devicetree: separate
WDT:   Not starting watchdog@6011000
MMC:   mmc@402: 0, mmc@4021000: 1
Loading Environment from FAT... PLL reg = 0xf8216300, freq = 12
OK
In:serial@250
Out:   serial@250
Err:   serial@250
Net:   eth0: ethernet@450
starting USB...
Bus usb@4101000: USB EHCI 1.00
Bus usb@4101400: USB OHCI 1.0
Bus usb@420: USB EHCI 1.00
Bus usb@4200400: USB OHCI 1.0
scanning bus usb@4101000 for devices... 1 USB Device(s) found
scanning bus usb@4101400 for devices... 1 USB Device(s) found
scanning bus usb@420 for devices... 3 USB Device(s) found
scanning bus usb@4200400 for devices... 1 USB Device(s) found
   scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
=> run bootobsd
24525 bytes read in 10 ms (2.3 MiB/s)
152332 bytes read in 30 ms (4.8 MiB/s)
Card did not respond to voltage select! : -110
** Unable to read file ubootefi.var **
Failed to load EFI variables
Booting /\EFI\OpenBSD\BOOTRISCV64.EFI
disks: sd0*
>> OpenBSD/riscv64 BOOTRISCV64 1.5
boot> boot -c
cannot open sd0a:/etc/random.seed: No such file or directory
booting sd0a:/bsd: 2142436+1168164+8505520+538824 
[181570+122+283152+186205]=0xf3f470
bootargs: -c
[oh it's a Mango Pi, hold on this might take a whi. :-)]
all mapped
type 0x0 pa 0x4000 va 0x4000 pages 0x40 attr 0x8
type 0x7 pa 0x4004 va 0x4004 pages 0x1c0 attr 0x8
type 0x2 pa 0x4020 va 0x4020 pages 0x4000 attr 0x8
type 0x7 pa 0x4420 va 0x4420 pages 0x3d00 attr 0x8
type 0x9 pa 0x47f0 va 0x47f0 pages 0x9 attr 0x8
type 0x7 pa 0x47f09000 va 0x47f09000 pages 0x36cd7 attr 0x8
type 0x2 pa 0x7ebe va 0x7ebe pages 0x8 attr 0x8
type 0x4 pa 0x7ebe8000 va 0x7ebe8000 pages 0x1 attr 0x8
type 0x7 pa 0x7ebe9000 va 0x7ebe9000 pages 0x1 attr 0x8
type 0x2 pa 0x7ebea000 va 0x7ebea000 pages 0x100 attr 0x8
type 0x1 pa 0x7ecea000 va 0x7ecea000 pages 0x26 attr 0x8
type 0x4 pa 0x7ed1 va 0x7ed1 pages 0x5 attr 0x8
type 0x6 pa 0x7ed15000 va 0x7ed15000 pages 0x1 attr 0x8008
type 0x4 pa 0x7ed16000 va 0x7ed16000 pages 0x3 attr 0x8
type 0x6 pa 0x7ed19000 va 0x7ed19000 pages 0x1 attr 0x8008
type 0x4 pa 0x7ed1a000 va 0x7ed1a000 pages 0x1 attr 0x8
type 0x6 pa 0x7ed1b000 va 0x7ed1b000 pages 0x6 attr 0x8008
type 0x4 pa 0x7ed21000 va 0x7ed21000 pages 0x17 attr 0x8
type 0x2 pa 0x7ed38000 va 0x7ed38000 pages 0x122c attr 0x8
type 0x5 pa 0x7ff64000 va 0x7ff64000 pages 0x1 attr 0x8008
type 0x2 pa 0x7ff65000 va 0x7ff65000 pages 0x9b attr 0x8
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2023 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 7.3-current (MANGOPI) #185: Sat Sep 23 08:52:28 CEST 2023
p...@stern.mainrechner.de:/riscv64/compile/MANGOPI
real mem  = 1073741824 (1024MB)
avail mem = 988495872 (942MB)
SBI: OpenSBI v1.3, SBI Specification Version 1.0
User Kernel Config
UKC> disable com
 67 com* disabled
UKC> disable plic
  5 plic* disabled
UKC> quit
Continuing...
random: boothowto does not indicate good seed
mainbus0 at root: Allwinner D1 Nezha
cpu0 at mainbus0: T-Head C906 imp 0 rv64imafdc
intc0 at cpu0
cpu0: 32KB 64b/line 128-way L1 I-cache, 32KB 64b/line 256-way L1 D-cache
"dcxo-clk" at mainbus0 not configured
"display-engine" at mainbus0 not configured
simplebus0 at mainbus0: "soc"
sxipio0 at simplebus0: 88 pins
sxiccmu0 at simplebus0
syscon0 at simplebus0: "audio-codec"
"regulators" at syscon0 not configured
"pwm" at simplebus0 not configured
"iommu" at simplebus0 not configured
"timer" at simplebus0 not 

RISCV - port to Mango Pi MQ-Pro (D1)

2023-09-18 Thread Peter J. Philipp
Hi,

I've been working a little bit on making OpenBSD run on Mango Pi, I haven't
succeeded yet, but I think we're close.  My patches are here:

https://github.com/pbug44/openbsd-src/tree/MANGOPI

it's a forked version of OpenBSD src with a "MANGOPI" branch.  I used to
send patches around to several OpenBSD devs but now it's probably better
to have a repo for it.

If you have this hardware and want OpenBSD running on it, help us!  If you
don't know how to program perhaps you can build-test.  I haven't merged
this patch yet, but I'll be working on this (it was compiling on a sept. 1st
version of -current).

A Mango Pi was sent to OpenBSD but came back to me after some time waiting
to be picked up at a postal outlet.  I don't know why they didn't call the
OpenBSD dev, the number was on the address.  Or perhaps they did and he
was on vacation at the time.  I still want to give this to the OpenBSD dev
that I sent it to, unless he doesn't want it, I still want to give this to
OpenBSD.  OpenBSD, contact me with new postal address information.

Best Regards,
-peter

-- 
Over thirty years experience on Unix-like Operating Systems starting with QNX.