Index | Thread | Search

From:
Peter Philipp <ima@callpeter.tel>
Subject:
[mn@superpc.suicide.solutions: Re: riscv: implement clock for Allwinner D1]
To:
tech@openbsd.org
Date:
Sun, 27 Sep 2026 13:32:22 +0200

Download raw body.

Thread
  • Peter Philipp:

    [mn@superpc.suicide.solutions: Re: riscv: implement clock for Allwinner D1]

Hi,

I tested this patch, unfortunately I'm a little late (about one week).  Here
is a dmesg with this patch.  Notice it has the DVFS message here as the
author of the patch has mentioned.  I applied his patch against 7.9 not
-current.  I don't see how it can hurt.

Replies to this will be next week as I am unplugged until November or so.

-peter

OpenBSD 7.9 (MANGO) #0: Sat Sep  5 09:44:19 CEST 2026
    exe@genesys.mainrechner.de:/usr/src/sys/arch/riscv64/compile/MANGO
real mem  = 1073741824 (1024MB)
avail mem = 1008185344 (961MB)
SBI: OpenSBI v1.3, SBI Specification Version 1.0
random: good seed from bootblocks
mainbus0 at root: MangoPi MQ Pro
cpu0 at mainbus0: T-Head arch 0 imp 0
intc0 at cpu0
cpu0: 32KB 64b/line 128-way L1 I-cache, 32KB 64b/line 256-way L1 D-cache
"fit-images" at mainbus0 not configured
"dcxo-clk" at mainbus0 not configured
simplebus0 at mainbus0: "soc"
sxipio0 at simplebus0: 88 pins
sxiccmu0 at simplebus0
plic0 at simplebus0
sxitimer0 at simplebus0: 24000 kHz
sxidog0 at simplebus0
com0 at simplebus0: dw16550
com0: console
com1 at simplebus0: dw16550
"syscon" at simplebus0 not configured
"dma-controller" at simplebus0 not configured
"efuse" at simplebus0 not configured
"crypto" at simplebus0 not configured
"dram-controller" at simplebus0 not configured
sximmc0 at simplebus0
sdmmc0 at sximmc0: 4-bit, sd high-speed, mmc high-speed, dma
sximmc1 at simplebus0
sdmmc1 at sximmc1: 4-bit, sd high-speed, mmc high-speed, dma
"usb" at simplebus0 not configured
"phy" at simplebus0 not configured
ehci0 at simplebus0
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 addr 1
ohci0 at simplebus0: version 1.0
"clock-controller" at simplebus0 not configured
"mixer" at simplebus0 not configured
"mixer" at simplebus0 not configured
"phy" at simplebus0 not configured
"tcon-top" at simplebus0 not configured
"lcd-controller" at simplebus0 not configured
"lcd-controller" at simplebus0 not configured
"power-controller" at simplebus0 not configured
"clock-controller" at simplebus0 not configured
sxirtc0 at simplebus0
sxidog1 at simplebus0
sxidog2 at simplebus0
gpio0 at sxipio0: 32 pins
gpio1 at sxipio0: 32 pins
gpio2 at sxipio0: 32 pins
gpio3 at sxipio0: 32 pins
gpio4 at sxipio0: 32 pins
gpio5 at sxipio0: 32 pins
gpio6 at sxipio0: 32 pins
usb1 at ohci0: USB revision 1.0
uhub1 at usb1 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 addr 1
"opp-table-cpu" at mainbus0 not configured
"pmu" at mainbus0 not configured
"vcc" at mainbus0 not configured
"vcc-3v3" at mainbus0 not configured
"leds" at mainbus0 not configured
"avdd2v8" at mainbus0 not configured
"dvdd" at mainbus0 not configured
"vdd-cpu" at mainbus0 not configured
"wifi-pwrseq" at mainbus0 not configured
"binman" at mainbus0 not configured
scsibus0 at sdmmc0: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <Sandisk, SN128, 0080> removable
sd0: 121942MB, 512 bytes/sector, 249737216 sectors
manufacturer 0x024c, product 0xd723 at sdmmc1 function 1 not configured
axen0 at uhub0 port 1 configuration 1 interface 0 "D-Link Elec. Corp. D-Link DUB-1312" rev 2.10/1.00 addr 2
axen0: AX88179, address f4:8c:eb:4b:5d:70
rgephy0 at axen0 phy 3: RTL8169S/8110S/8211, rev. 5
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
root on sd0a (ff09abc802626de6.a) swap on sd0b dump on sd0b
cpu0: DVFS failed




----- Forwarded message from Nazarenko Mykyta <mn@superpc.suicide.solutions> -----

Date: Fri, 28 Aug 2026 13:52:45 +0200
From: Nazarenko Mykyta <mn@superpc.suicide.solutions>
To: Peter Philipp <ima@callpeter.tel>
Subject: Re: riscv: implement clock for Allwinner D1
X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-unknown-openbsd8.0)

On Tue, 25 Aug 2026 11:42:22 +0200
Peter Philipp <ima@callpeter.tel> wrote:

> On Tue, Aug 25, 2026 at 10:25:39AM +0200, Nazarenko Mykyta wrote:
> > On Mon, 27 Jul 2026 23:28:27 +0200
> > Nazarenko Mykyta <mn@superpc.suicide.solutions> wrote:
> >   
> > > Hola! tech@.
> > > 
> > > I messed up the formatting a few times in the previous thread because of 
> > > my email client, and I also seem to have confused everyone with inline text
> > > and attachments, so I apologize for the noise again...
> > > 
> > > I tried to implement a clock for the D1 cpu, and it seems 
> > > like I succeeded because it seems to be works.
> > > 
> > > Tested on MangoPI MQ Pro ( rev 1.4 )  
> > 
> > Anyone?
> > 
> > With best regards,
> > Nazarenko Mykyta
> >   
> 
> May I see a dmesg with this on?  I'm not a dev but I have the hardware and
> it's been a bit of a lemon to me.  How would it benefit me?
> 
> Does it allow the frequency for the CPU be settable in sysctl.hw?
> 
> I'd like to see your setup, what are you using for network?  I use an
> axen(4) device last it was on, a ure(4) device was horrible and I got
> lock-ups when using it.
> 
> The Mango Pi has an internal 100 Mbit interface that can be aquired with a
> hat.  Are you using that?  Wifi doesn't work last I checked.
> 
> Best Regard,
> -peter
> 

Hi, Philipp! 

Manual frequency control via sysctl hw.setperf is not working right
now. It's because DVFS is not implemented, so... I'm working on it.
DVFS will allow the processor frequency to be adjusted dynamically in 
order to reduce power consumption during idle periods. 

This small patch is removing the stub ( cpu0: clock not implemented )
and adds the correct clock init for D1 CPU. 

I'm not using any HAT in my setup, my choice is ure0, but I'm agree,
it's quite unstable. 

---

scsibus0 at sdmmc0: 2 targets, initiator 0 
sd0 at scsibus0 targ 1 lun 0: <SD/MMC, SD64G, 0061> removable 
sd0: 59652MB, 512 bytes/sector, 122167296 sectors 
manufacturer 0x024c, product 0xd723 at sdmmc1 function 1 not configured 
umass0 at uhub0 port 1 configuration 1 interface 0 "Kingston 
DataTraveler 3.0" rev 2.10/0.01 addr 2 umass0: using SCSI over
Bulk-Only scsibus1 at umass0: 2 targets, initiator 0 
sd1 at scsibus1 targ 1 lun 0: <Kingston, DataTraveler 3.0, > removable 
serial.09511666F47089469423 sd1: 29510MB, 512 bytes/sector, 60437492 
sectors vscsi0 at root 
scsibus2 at vscsi0: 256 targets 
softraid0 at root 
scsibus3 at softraid0: 256 targets 
root on sd0a (df2514290b054d3e.a) swap on sd0b dump on sd0b 
cpu0: DVFS failed

---

I'd really appreciate it if you could test this patch and leave some 
feedback in the mailing list.

With best regards,
Nazarenko Mykyta

----- End forwarded message -----

-- 
Peter J. Philipp
Am Deutschhof 5
97422 Schweinfurt
Contact by mobile: +49 151 7226 5695