Radxa ROCK Pi N10 Works

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Radxa ROCK Pi N10 Works

Kurt Miller-3
I purchased one of the rev c boards with 8GB ram with the
hopes that it could build the full ports tree. Good news
it installs and boots fairly easily. Bad news is that I
missed that the 8GB ram is split between the CPU and the
NPU (4GB for CPU/GPU, 4GB for NPU) so only 4GB is usable
for building ports.

Install notes:
1) Setup serial console and use 1500000 baud
2) Boot into default os
3) Erase u-boot from eMMC:
   su
   dd if=/dev/zero of=/dev/block/mmcblk2 bs=1m count=16
   sync
   reboot
4) Power off board
5) Prepare uSD with miniroot68.fs and u-boot-rockchip.bin at sector 64
6) Install uSD
7) Switch serial console to use 115200 baud
8) Power on board
9) Install OpenBSD
   root on sd1 (uSD) 1g
   rest of the partions on sd0 (nvme)

I opted to install root on the uSD so that I can test u-boot
and easily revert any versions that don't work by fixing the
uSD on another computer. If u-boot is on the eMMC board it
prefers that over what's on the uSD.

U-Boot TPL 2021.01-dirty (Jan 12 2021 - 09:11:12)
Trying to boot from BOOTROM
Returning to boot ROM...

U-Boot SPL 2021.01-dirty (Jan 12 2021 - 09:11:12 -0500)
Trying to boot from MMC1
NOTICE:  BL31: v2.4(debug):2.4
NOTICE:  BL31: Built : 10:29:07, Jan  6 2021
INFO:    GICv3 with legacy support detected.
INFO:    ARM GICv3 driver initialized in EL3
INFO:    plat_rockchip_pmu_init(1624): pd status 3e
INFO:    BL31: Initializing runtime services
INFO:    BL31: cortex_a53: CPU workaround for 855873 was applied
WARNING: BL31: cortex_a53: CPU workaround for 1530924 was missing!
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2021.01-dirty (Jan 12 2021 - 09:11:12 -0500)

SoC: Rockchip rk3399
Reset cause: RST
Model: Radxa ROCK Pi N10
DRAM:  3.9 GiB
PMIC:  RK8090 (on=0x10, off=0x80)
MMC:   mmc@fe320000: 1, sdhci@fe330000: 0
Loading Environment from MMC... *** Warning - bad CRC, using default environment

stdio_add_devices: Video device failed (ret=-22)
In:    serial@ff1a0000
Out:   serial@ff1a0000
Err:   serial@ff1a0000
Model: Radxa ROCK Pi N10
Net:   eth0: ethernet@fe300000
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0(part 0) is current device
** No partition table - mmc 0 **
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk [hidden email]...
** Unrecognized filesystem type **
Scanning disk [hidden email]...
** Unrecognized filesystem type **
Found 4 disks
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
Found EFI removable media binary efi/boot/bootaa64.efi
168728 bytes read in 14 ms (11.5 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Booting /efi\boot\bootaa64.efi
disks: sd0* sd1
>> OpenBSD/arm64 BOOTAA64 1.3
boot> 
booting sd0a:/bsd: 8670824+1774112+568384+829600 [630797+109+1060632+622736]=0xf8a8c8
type 0x2 pa 0x200000 va 0x200000 pages 0x4000 attr 0x8
type 0x7 pa 0x4200000 va 0x4200000 pages 0x3eed attr 0x8
type 0x9 pa 0x80ed000 va 0x80ed000 pages 0x26 attr 0x8
type 0x7 pa 0x8113000 va 0x8113000 pages 0xe7fca attr 0x8
type 0x2 pa 0xf00dd000 va 0xf00dd000 pages 0xcff attr 0x8
type 0x4 pa 0xf0ddc000 va 0xf0ddc000 pages 0x1 attr 0x8
type 0x2 pa 0xf0ddd000 va 0xf0ddd000 pages 0x5 attr 0x8
type 0x7 pa 0xf0de2000 va 0xf0de2000 pages 0x1 attr 0x8
type 0x2 pa 0xf0de3000 va 0xf0de3000 pages 0x100 attr 0x8
type 0x1 pa 0xf0ee3000 va 0xf0ee3000 pages 0x2a attr 0x8
type 0x0 pa 0xf0f0d000 va 0xf0f0d000 pages 0x7 attr 0x8
type 0x4 pa 0xf0f14000 va 0xf0f14000 pages 0x1 attr 0x8
type 0x6 pa 0xf0f15000 va 0x33d4e24000 pages 0x1 attr 0x8000000000000008
type 0x4 pa 0xf0f16000 va 0xf0f16000 pages 0x2 attr 0x8
type 0x0 pa 0xf0f18000 va 0xf0f18000 pages 0x1 attr 0x8
type 0x6 pa 0xf0f19000 va 0x33d4e28000 pages 0x3 attr 0x8000000000000008
type 0x4 pa 0xf0f1c000 va 0xf0f1c000 pages 0x1 attr 0x8
type 0x6 pa 0xf0f1d000 va 0x33d4e2c000 pages 0x4 attr 0x8000000000000008
type 0x4 pa 0xf0f21000 va 0xf0f21000 pages 0x1 attr 0x8
type 0x0 pa 0xf0f22000 va 0xf0f22000 pages 0x2 attr 0x8
type 0x4 pa 0xf0f24000 va 0xf0f24000 pages 0x1 attr 0x8
type 0x0 pa 0xf0f25000 va 0xf0f25000 pages 0x1 attr 0x8
type 0x4 pa 0xf0f26000 va 0xf0f26000 pages 0x2 attr 0x8
type 0x0 pa 0xf0f28000 va 0xf0f28000 pages 0x1 attr 0x8
type 0x4 pa 0xf0f29000 va 0xf0f29000 pages 0x2 attr 0x8
type 0x2 pa 0xf0f2b000 va 0xf0f2b000 pages 0x3015 attr 0x8
type 0x5 pa 0xf3f40000 va 0x33d7e4f000 pages 0x10 attr 0x8000000000000008
type 0x2 pa 0xf3f50000 va 0xf3f50000 pages 0x40b0 attr 0x8
[ using 2315240 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2021 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 6.8-current (GENERIC.MP) #972: Tue Jan 12 00:36:26 MST 2021
    [hidden email]:/usr/src/sys/arch/arm64/compile/GENERIC.MP
real mem  = 4025184256 (3838MB)
avail mem = 3826655232 (3649MB)
random: good seed from bootblocks
mainbus0 at root: Radxa ROCK Pi N10
psci0 at mainbus0: PSCI 1.1, SMCCC 1.2
cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu0: 512KB 64b/line 16-way L2 cache
cpu0: CRC32,SHA2,SHA1,AES+PMULL
cpu1 at mainbus0 mpidr 1: ARM Cortex-A53 r0p4
cpu1: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu1: 512KB 64b/line 16-way L2 cache
cpu1: CRC32,SHA2,SHA1,AES+PMULL
cpu2 at mainbus0 mpidr 2: ARM Cortex-A53 r0p4
cpu2: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu2: 512KB 64b/line 16-way L2 cache
cpu2: CRC32,SHA2,SHA1,AES+PMULL
cpu3 at mainbus0 mpidr 3: ARM Cortex-A53 r0p4
cpu3: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu3: 512KB 64b/line 16-way L2 cache
cpu3: CRC32,SHA2,SHA1,AES+PMULL
cpu4 at mainbus0 mpidr 100: ARM Cortex-A72 r0p2
cpu4: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 D-cache
cpu4: 1024KB 64b/line 16-way L2 cache
cpu4: CRC32,SHA2,SHA1,AES+PMULL
cpu5 at mainbus0 mpidr 101: ARM Cortex-A72 r0p2
cpu5: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 D-cache
cpu5: 1024KB 64b/line 16-way L2 cache
cpu5: CRC32,SHA2,SHA1,AES+PMULL
efi0 at mainbus0: UEFI 2.8
efi0: Das U-Boot rev 0x20210100
apm0 at mainbus0
agintc0 at mainbus0 sec shift 3:3 nirq 288 nredist 6 ipi: 0, 1: "interrupt-controller"
agintcmsi0 at agintc0
syscon0 at mainbus0: "qos"
syscon1 at mainbus0: "qos"
syscon2 at mainbus0: "qos"
syscon3 at mainbus0: "qos"
syscon4 at mainbus0: "qos"
syscon5 at mainbus0: "qos"
syscon6 at mainbus0: "qos"
syscon7 at mainbus0: "qos"
syscon8 at mainbus0: "qos"
syscon9 at mainbus0: "qos"
syscon10 at mainbus0: "qos"
syscon11 at mainbus0: "qos"
syscon12 at mainbus0: "qos"
syscon13 at mainbus0: "qos"
syscon14 at mainbus0: "qos"
syscon15 at mainbus0: "qos"
syscon16 at mainbus0: "qos"
syscon17 at mainbus0: "qos"
syscon18 at mainbus0: "qos"
syscon19 at mainbus0: "qos"
syscon20 at mainbus0: "qos"
syscon21 at mainbus0: "qos"
syscon22 at mainbus0: "qos"
syscon23 at mainbus0: "qos"
syscon24 at mainbus0: "qos"
syscon25 at mainbus0: "power-management"
"power-controller" at syscon25 not configured
syscon26 at mainbus0: "syscon"
"io-domains" at syscon26 not configured
rkclock0 at mainbus0
rkclock1 at mainbus0
syscon27 at mainbus0: "syscon"
"io-domains" at syscon27 not configured
"usb2-phy" at syscon27 not configured
"usb2-phy" at syscon27 not configured
rkemmcphy0 at syscon27
"pcie-phy" at syscon27 not configured
rkpinctrl0 at mainbus0: "pinctrl"
rkgpio0 at rkpinctrl0
rkgpio1 at rkpinctrl0
rkgpio2 at rkpinctrl0
rkgpio3 at rkpinctrl0
rkgpio4 at rkpinctrl0
syscon28 at mainbus0: "syscon"
syscon29 at mainbus0: "syscon"
"fit-images" at mainbus0 not configured
rkdrm0 at mainbus0
drm0 at rkdrm0
"pmu_a53" at mainbus0 not configured
"pmu_a72" at mainbus0 not configured
agtimer0 at mainbus0: tick rate 24000 KHz
"xin24m" at mainbus0 not configured
simplebus0 at mainbus0: "bus"
"dma-controller" at simplebus0 not configured
"dma-controller" at simplebus0 not configured
rkpcie0 at mainbus0
pci0 at rkpcie0
ppb0 at pci0 dev 0 function 0 "Rockchip RK3399 Root Complex" rev 0x00: msi
pci1 at ppb0 bus 1
nvme0 at pci1 dev 0 function 0 "Intel NVMe" rev 0x03: msix, NVMe 1.3
nvme0: INTEL SSDPEKKW512G8, firmware 004C, serial BTHH92450A81512D
scsibus0 at nvme0: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <NVMe, INTEL SSDPEKKW51, 004C>
sd0: 488386MB, 512 bytes/sector, 1000215216 sectors
dwge0 at mainbus0: address ae:a5:98:44:bf:2a
rgephy0 at dwge0 phy 0: RTL8169S/8110S/8211 PHY, rev. 5
dwmmc0 at mainbus0: 50 MHz base clock
sdmmc0 at dwmmc0: 4-bit, sd high-speed, mmc high-speed, dma
sdhc0 at mainbus0
sdhc0: SDHC 3.0, 200 MHz base clock
sdmmc1 at sdhc0: 8-bit, sd high-speed, mmc high-speed, dma
ehci0 at mainbus0
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 mainbus0: version 1.0
ehci1 at mainbus0
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 addr 1
ohci1 at mainbus0: version 1.0
rkdwusb0 at mainbus0: "usb"
xhci0 at rkdwusb0, xHCI 1.10
usb2 at xhci0: USB revision 3.0
uhub2 at usb2 configuration 1 interface 0 "Generic xHCI root hub" rev 3.00/1.00 addr 1
rkiic0 at mainbus0
iic0 at rkiic0
rkiic1 at mainbus0
iic1 at rkiic1
"haoyu,hym8563" at iic1 addr 0x51 not configured
rkiic2 at mainbus0
iic2 at rkiic2
com0 at mainbus0: ns16550, no working fifo
com1 at mainbus0: ns16550, no working fifo
com1: console
rktemp0 at mainbus0
rkiic3 at mainbus0
iic3 at rkiic3
"rockchip,rk809" at iic3 addr 0x20 not configured
rkpwm0 at mainbus0
rkpwm1 at mainbus0
"video-codec" at mainbus0 not configured
"iommu" at mainbus0 not configured
"rga" at mainbus0 not configured
"efuse" at mainbus0 not configured
"phy" at mainbus0 not configured
"watchdog" at mainbus0 not configured
"rktimer" at mainbus0 not configured
rkvop0 at mainbus0: RK3399 VOPL
"iommu" at mainbus0 not configured
rkvop1 at mainbus0: RK3399 VOPB
"iommu" at mainbus0 not configured
"iommu" at mainbus0 not configured
"iommu" at mainbus0 not configured
rkdwhdmi0 at mainbus0: HDMI TX
rkdwhdmi0: version 2.11a, phytype 0xf3
"opp-table0" at mainbus0 not configured
"opp-table1" at mainbus0 not configured
"opp-table2" at mainbus0 not configured
"external-gmac-clock" at mainbus0 not configured
"vcc12v-dcin-regulator" at mainbus0 not configured
"vcc5v0-sys-regulator" at mainbus0 not configured
"vbus-host" at mainbus0 not configured
"vbus-typec" at mainbus0 not configured
"vcc-pcie-regulator" at mainbus0 not configured
"binman" at mainbus0 not configured
"dfi" at mainbus0 not configured
"dmc" at mainbus0 not configured
usb3 at ohci0: USB revision 1.0
uhub3 at usb3 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 addr 1
usb4 at ohci1: USB revision 1.0
uhub4 at usb4 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 addr 1
scsibus1 at sdmmc0: 2 targets, initiator 0
sd1 at scsibus1 targ 1 lun 0: <SD/MMC, SE64G, 0080> removable
sd1: 60906MB, 512 bytes/sector, 124735488 sectors
scsibus2 at sdmmc1: 2 targets, initiator 0
sd2 at scsibus2 targ 1 lun 0: <SD/MMC, SLD64G, 0000> removable
sd2: 59000MB, 512 bytes/sector, 120832000 sectors
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
root on sd1a (7c6a30ccd3120792.a) swap on sd1b dump on sd1b
WARNING: CHECK AND RESET THE DATE!
cpu0: regulator not implemented
rkvop0: using CRTC 0 for RK3399 VOPL
rkvop1: using CRTC 1 for RK3399 VOPB
rkdrm0: 1024x768, 32bpp
wsdisplay0 at rkdrm0 mux 1
wsdisplay0: screen 0-5 added (std, vt100 emulation)
swapctl: adding 467ce1f9876fc931.b as swap device at priority 0
Automatic boot in progress: starting file system checks.
/dev/sd1a (7c6a30ccd3120792.a): file system is clean; not checking
/dev/sd0l (467ce1f9876fc931.l): file system is clean; not checking
/dev/sd0d (467ce1f9876fc931.d): file system is clean; not checking
/dev/sd0f (467ce1f9876fc931.f): file system is clean; not checking
/dev/sd0g (467ce1f9876fc931.g): file system is clean; not checking
/dev/sd0h (467ce1f9876fc931.h): file system is clean; not checking
/dev/sd0k (467ce1f9876fc931.k): file system is clean; not checking
/dev/sd0m (467ce1f9876fc931.m): file system is clean; not checking
/dev/sd0j (467ce1f9876fc931.j): file system is clean; not checking
/dev/sd0e (467ce1f9876fc931.e): file system is clean; not checking
pf enabled
starting network
dwge0: no link....
dwge0: 172.16.1.127 lease accepted from 172.16.1.1 (18:03:73:ee:47:f1)
reordering libraries: done.
starting early daemons: syslogd pflogd ntpd.
starting RPC daemons:.
savecore: /dev/sd1b: Device not configured
checking quotas: done.
clearing /tmp
kern.securelevel: 0 -> 1
creating runtime link editor directory cache.
preserving editor files.
starting network daemons: sshd smtpd sndiod.
starting local daemons: cron.
Tue Jan 12 12:23:27 EST 2021

Reply | Threaded
Open this post in threaded view
|

Re: Radxa ROCK Pi N10 Works

Stuart Henderson
On 2021/01/12 12:29, Kurt Miller wrote:
> I purchased one of the rev c boards with 8GB ram with the
> hopes that it could build the full ports tree. Good news
> it installs and boots fairly easily. Bad news is that I
> missed that the 8GB ram is split between the CPU and the
> NPU (4GB for CPU/GPU, 4GB for NPU) so only 4GB is usable
> for building ports.

Unfortunately rk3399 has a hard limit of 4GB. For 8GB or more I'm
pretty sure the only options are rpi4 or the expensive ones (synquacer,
macchiatobin, emag, or the softiron boards but the latter are not
particularly fast).

Reply | Threaded
Open this post in threaded view
|

Re: Radxa ROCK Pi N10 Works

Mark Kettenis
In reply to this post by Kurt Miller-3
> From: Kurt Miller <[hidden email]>
> Date: Tue, 12 Jan 2021 12:29:34 -0500
>
> I purchased one of the rev c boards with 8GB ram with the
> hopes that it could build the full ports tree. Good news
> it installs and boots fairly easily. Bad news is that I
> missed that the 8GB ram is split between the CPU and the
> NPU (4GB for CPU/GPU, 4GB for NPU) so only 4GB is usable
> for building ports.
>
> Install notes:
> 1) Setup serial console and use 1500000 baud
> 2) Boot into default os
> 3) Erase u-boot from eMMC:
>    su
>    dd if=/dev/zero of=/dev/block/mmcblk2 bs=1m count=16
>    sync
>    reboot
> 4) Power off board
> 5) Prepare uSD with miniroot68.fs and u-boot-rockchip.bin at sector 64
> 6) Install uSD
> 7) Switch serial console to use 115200 baud
> 8) Power on board
> 9) Install OpenBSD
>    root on sd1 (uSD) 1g
>    rest of the partions on sd0 (nvme)
>
> I opted to install root on the uSD so that I can test u-boot
> and easily revert any versions that don't work by fixing the
> uSD on another computer. If u-boot is on the eMMC board it
> prefers that over what's on the uSD.

Note that it is perfectly fine to have the root filesystem on eMMC and
U-Boot on uSD.  That is my preferred configuration as it allows for
easy testing of U-Boot updates since you can simply swap out uSD cards.

> rkiic1 at mainbus0
> iic1 at rkiic1
> "haoyu,hym8563" at iic1 addr 0x51 not configured

So that's your RTC.  Judging from the data sheet, this is a PCF8563
clone.  Can you try the attached diff?

> rkiic3 at mainbus0
> iic3 at rkiic3
> "rockchip,rk809" at iic3 addr 0x20 not configured

So this board uses a different PMIC than the "classic" RK3399 boards.
Judging from the datasheet there are some significant differences, so
this isn't a matter of just adding a compatible string to the
rkpmic(4) driver.  But the hardware is probably similar enough to
extend that driver instead of adding a new one.

This would probably get rid of:

> cpu0: regulator not implemented

and provide proper DVFS support on this board which will make the CPU
run at higher clock speeds.

Reply | Threaded
Open this post in threaded view
|

Re: Radxa ROCK Pi N10 Works

Mark Kettenis
> Date: Tue, 12 Jan 2021 20:40:05 +0100 (CET)
> From: Mark Kettenis <[hidden email]>
>
> > From: Kurt Miller <[hidden email]>
> > Date: Tue, 12 Jan 2021 12:29:34 -0500
> >
> > I purchased one of the rev c boards with 8GB ram with the
> > hopes that it could build the full ports tree. Good news
> > it installs and boots fairly easily. Bad news is that I
> > missed that the 8GB ram is split between the CPU and the
> > NPU (4GB for CPU/GPU, 4GB for NPU) so only 4GB is usable
> > for building ports.
> >
> > Install notes:
> > 1) Setup serial console and use 1500000 baud
> > 2) Boot into default os
> > 3) Erase u-boot from eMMC:
> >    su
> >    dd if=/dev/zero of=/dev/block/mmcblk2 bs=1m count=16
> >    sync
> >    reboot
> > 4) Power off board
> > 5) Prepare uSD with miniroot68.fs and u-boot-rockchip.bin at sector 64
> > 6) Install uSD
> > 7) Switch serial console to use 115200 baud
> > 8) Power on board
> > 9) Install OpenBSD
> >    root on sd1 (uSD) 1g
> >    rest of the partions on sd0 (nvme)
> >
> > I opted to install root on the uSD so that I can test u-boot
> > and easily revert any versions that don't work by fixing the
> > uSD on another computer. If u-boot is on the eMMC board it
> > prefers that over what's on the uSD.
>
> Note that it is perfectly fine to have the root filesystem on eMMC and
> U-Boot on uSD.  That is my preferred configuration as it allows for
> easy testing of U-Boot updates since you can simply swap out uSD cards.
>
> > rkiic1 at mainbus0
> > iic1 at rkiic1
> > "haoyu,hym8563" at iic1 addr 0x51 not configured
>
> So that's your RTC.  Judging from the data sheet, this is a PCF8563
> clone.  Can you try the attached diff?
>
> > rkiic3 at mainbus0
> > iic3 at rkiic3
> > "rockchip,rk809" at iic3 addr 0x20 not configured
>
> So this board uses a different PMIC than the "classic" RK3399 boards.
> Judging from the datasheet there are some significant differences, so
> this isn't a matter of just adding a compatible string to the
> rkpmic(4) driver.  But the hardware is probably similar enough to
> extend that driver instead of adding a new one.
>
> This would probably get rid of:
>
> > cpu0: regulator not implemented
>
> and provide proper DVFS support on this board which will make the CPU
> run at higher clock speeds.

And here is the diff I promised:

Index: dev/i2c/pcf8563.c
===================================================================
RCS file: /cvs/src/sys/dev/i2c/pcf8563.c,v
retrieving revision 1.2
diff -u -p -r1.2 pcf8563.c
--- dev/i2c/pcf8563.c 6 Oct 2019 15:45:37 -0000 1.2
+++ dev/i2c/pcf8563.c 12 Jan 2021 19:41:54 -0000
@@ -44,8 +44,6 @@
  * PCF8563 Real-Time Clock
  */
 
-#define PCF8563_ADDR 0x51 /* Fixed I2C Slave Address */
-
 #define PCF8563_CONTROL1 0x00
 #define PCF8563_CONTROL2 0x01
 #define PCF8563_SECONDS 0x02
@@ -106,8 +104,8 @@ pcxrtc_match(struct device *parent, void
 {
  struct i2c_attach_args *ia = arg;
 
- if (strcmp(ia->ia_name, "nxp,pcf8563") == 0 &&
-    ia->ia_addr == PCF8563_ADDR)
+ if (strcmp(ia->ia_name, "nxp,pcf8563") == 0 ||
+    strcmp(ia->ia_name, "haoyu,hym8563") == 0)
  return (1);
 
  return (0);

Reply | Threaded
Open this post in threaded view
|

Re: Radxa ROCK Pi N10 Works

Kurt Miller-3
On Tue, 2021-01-12 at 20:42 +0100, Mark Kettenis wrote:

> >
> > Date: Tue, 12 Jan 2021 20:40:05 +0100 (CET)
> > From: Mark Kettenis <[hidden email]>
> >
> > >
> > > From: Kurt Miller <[hidden email]>
> > > Date: Tue, 12 Jan 2021 12:29:34 -0500
> > >
> > > I purchased one of the rev c boards with 8GB ram with the
> > > hopes that it could build the full ports tree. Good news
> > > it installs and boots fairly easily. Bad news is that I
> > > missed that the 8GB ram is split between the CPU and the
> > > NPU (4GB for CPU/GPU, 4GB for NPU) so only 4GB is usable
> > > for building ports.
> > >
> > > Install notes:
> > > 1) Setup serial console and use 1500000 baud
> > > 2) Boot into default os
> > > 3) Erase u-boot from eMMC:
> > >    su
> > >    dd if=/dev/zero of=/dev/block/mmcblk2 bs=1m count=16
> > >    sync
> > >    reboot
> > > 4) Power off board
> > > 5) Prepare uSD with miniroot68.fs and u-boot-rockchip.bin at sector 64
> > > 6) Install uSD
> > > 7) Switch serial console to use 115200 baud
> > > 8) Power on board
> > > 9) Install OpenBSD
> > >    root on sd1 (uSD) 1g
> > >    rest of the partions on sd0 (nvme)
> > >
> > > I opted to install root on the uSD so that I can test u-boot
> > > and easily revert any versions that don't work by fixing the
> > > uSD on another computer. If u-boot is on the eMMC board it
> > > prefers that over what's on the uSD.
> > Note that it is perfectly fine to have the root filesystem on eMMC and
> > U-Boot on uSD.  That is my preferred configuration as it allows for
> > easy testing of U-Boot updates since you can simply swap out uSD cards.
> >
> > >
> > > rkiic1 at mainbus0
> > > iic1 at rkiic1
> > > "haoyu,hym8563" at iic1 addr 0x51 not configured
> > So that's your RTC.  Judging from the data sheet, this is a PCF8563
> > clone.  Can you try the attached diff?
> >
> > >
> > > rkiic3 at mainbus0
> > > iic3 at rkiic3
> > > "rockchip,rk809" at iic3 addr 0x20 not configured
> > So this board uses a different PMIC than the "classic" RK3399 boards.
> > Judging from the datasheet there are some significant differences, so
> > this isn't a matter of just adding a compatible string to the
> > rkpmic(4) driver.  But the hardware is probably similar enough to
> > extend that driver instead of adding a new one.
> >
> > This would probably get rid of:
> >
> > >
> > > cpu0: regulator not implemented
> > and provide proper DVFS support on this board which will make the CPU
> > run at higher clock speeds.
> And here is the diff I promised:
>

Thanks. It worked as expected. Now I see:

rkiic1 at mainbus0
iic1 at rkiic1
pcxrtc0 at iic1 addr 0x51: battery ok

and it got rid of these lines as well:

WARNING: bad clock chip time
WARNING: CHECK AND RESET THE DATE!

okay kurt@

> Index: dev/i2c/pcf8563.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/i2c/pcf8563.c,v
> retrieving revision 1.2
> diff -u -p -r1.2 pcf8563.c
> --- dev/i2c/pcf8563.c 6 Oct 2019 15:45:37 -0000 1.2
> +++ dev/i2c/pcf8563.c 12 Jan 2021 19:41:54 -0000
> @@ -44,8 +44,6 @@
>   * PCF8563 Real-Time Clock
>   */
>  
> -#define PCF8563_ADDR 0x51 /* Fixed I2C Slave Address */
> -
>  #define PCF8563_CONTROL1 0x00
>  #define PCF8563_CONTROL2 0x01
>  #define PCF8563_SECONDS 0x02
> @@ -106,8 +104,8 @@ pcxrtc_match(struct device *parent, void
>  {
>   struct i2c_attach_args *ia = arg;
>  
> - if (strcmp(ia->ia_name, "nxp,pcf8563") == 0 &&
> -     ia->ia_addr == PCF8563_ADDR)
> + if (strcmp(ia->ia_name, "nxp,pcf8563") == 0 ||
> +     strcmp(ia->ia_name, "haoyu,hym8563") == 0)
>   return (1);
>  
>   return (0);
>