> Date: Tue, 12 Jan 2021 20:40:05 +0100 (CET)
> From: Mark Kettenis <mark.kette...@xs4all.nl>
> 
> > From: Kurt Miller <k...@intricatesoftware.com>
> > 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 via email to