On Tue, 2019-10-08 at 02:25 +1100, Jonathan Gray wrote:
> On Mon, Oct 07, 2019 at 10:33:27AM -0400, Kurt Miller wrote:
> > 
> > On Mon, 2019-10-07 at 13:35 +1100, Jonathan Gray wrote:
> > > 
> > > On Sun, Oct 06, 2019 at 09:51:20PM -0400, Kurt Miller wrote:
> > > > 
> > > > 
> > > > On Sun, 2019-10-06 at 18:47 +0200, Mark Kettenis wrote:
> > > > > 
> > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > Date: Sun, 6 Oct 2019 11:42:03 +1100
> > > > > > From: Jonathan Gray <j...@jsg.id.au>
> > > > > > 
> > > > > > On Sat, Oct 05, 2019 at 12:20:57PM -0400, 
> > > > > > k...@intricatesoftware.com wrote:
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > Various rockchip u-boot 2019.10rc4 aarch64 improvements:
> > > > > > > * u-boot.itb is included in the all target for rockpro64 and
> > > > > > >   firefly-rk3399 so remove duplicate make for it.
> > > > > > > * Build rock64-rk3328, except exclude idbloader.img which is 
> > > > > > > broken.
> > > > > > > * Install u-boot-spl-dtb.bin and mkimage for rock64, rockpro64 and
> > > > > > >   firefly-rk3399 so that idbloader.img can be created using rkbin 
> > > > > > > TPL
> > > > > > >   layer.
> > > > > > > * Provide a script to make idbloader.img from rkbin's TPL layer.
> > > > > > > * For rockpro64 backport PCIe support from 5.3 dtb.
> > > > > > > * For rock64 backport most 4.20 dtb components and additional bug
> > > > > > >   fixes.
> > > > > > > 
> > > > > > > For rockpro64, I no longer need to have an updated dtb installed
> > > > > > > in the i partition for PCIe to work. Although I am using the
> > > > > > > rkbin TPL layer because the u-boot one doesn't recognize half
> > > > > > > of my memory (other versions of this board dont have this 
> > > > > > > problem).
> > > > > > > 
> > > > > > > For rock64 the dtb updates corrects the clock bindings so an
> > > > > > > updated dtb is not needed in the i partition as well. However,
> > > > > > > u-boot's TPL layer isn't working yet so the following steps
> > > > > > > are needed to create a usable idbloader.img on a uSD for
> > > > > > > install with miniroot66.fs:
> > > > > > > 
> > > > > > > /usr/local/libexec/u-boot/mkidbloader-rkbin rock64-rk3328
> > > > > > > dd if=miniroot66.fs of=/dev/<uSD> bs=1m
> > > > > > > dd if=idbloader.img of=/dev/<uSD> bs=512 seek=64 conv=sync
> > > > > > > dd if=/usr/local/share/u-boot/rock64-rk3328/u-boot.itb \
> > > > > > >    of=/dev/<uSD> bs=512 seek=16384 conv=sync
> > > > > > > 
> > > > > > > One of the downsides of installing mkimage is the removal of
> > > > > > > PKG_ARCH=*, but we get better support for both rock64 and
> > > > > > > rockpro64 for where rkbin is still needed. I'm not sure how
> > > > > > > well firefly works with the the u-boot TPL layer so it may
> > > > > > > benefit from the ability to build idbloader.img with the
> > > > > > > rkbin TPL layer as well.
> > > > > > > 
> > > > > > > Thoughts?
> > > > > > Dropping PKG_ARCH=* isn't something we should do in my opinion.  For
> > > > > > example arm package snapshots seem to be made every few months and 
> > > > > > with
> > > > > > U-Boot 2019.10 final planned for Monday US time there wouldn't be a
> > > > > > package available for arm in time for the final release build.
> > > > > > 
> > > > > > I think for now you should drop the rk3328/mkimage parts and keep 
> > > > > > the
> > > > > > rockpro64 dtb change.
> > > > > Simon South just posted two patches to the U-Boot mailing list that
> > > > > apparently fixes ro rock64 issues.  That removes the need to use the
> > > > > propriatary Rockchip loader in favour of U-Boot TPL.
> > > > I've adjusted the u-boot changes to address dropping PKG_ARCH=*
> > > > and incorporated Simon South's changes to see if the Rock64
> > > > will work with u-boot's TPL layer. Please see the attached diff
> > > > for review.
> > > This looks good but it isn't clear to me what the 3328 dts files
> > > (rk3328.dtsi rk3328-rock64.dts) are synced against?
> > > 
> > > There is quite a difference in rk3328.dtsi rk3328-rock64.dts and
> > > linux 5.3.  The other files have no or expected diffs to 5.3.
> > > 
> > For rk3328.dtsi I synced to 4.20, but the following headers were
> > not yet in u-boot so I left out components related to them:
> > 
> > #include <dt-bindings/power/rk3328-power.h>
> > #include <dt-bindings/soc/rockchip,boot-mode.h>
> > #include <dt-bindings/thermal/thermal.h>
> > 
> > I needed to keep the mmc[0-2] aliases because rk3328-evb.dts
> > referred to them.
> > 
> > For rk3328-rock64.dts I synced to 4.20 but I noticed that
> > the usb3 entry was later removed as well as some future bug fixes:
> > 
> > https://github.com/torvalds/linux/commit/26e2d7b03ea7ff254bf78305aa44dda62e70b78e
> > https://github.com/torvalds/linux/commit/9301d28dccd05bbcea0e69c382886d6a8b8e6bc2
> > 
> > I removed vcc-host1-5v-regulator when doing that since it
> > wasn't referenced and not configured.
> > 
> > Please let me know if you would like a different approach.
> Thanks for the explanation.  So the baud changes should be the only
> thing to keep if/when U-Boot resyncs with linux.
> 

kettenis@ felt that given how far behind u-boot is with rk3328 dtb,
the partial updates of rk3328.dtsi & rk3328-rock64.dts was not a good
idea. However, updating the clock definitions in the rk3328-cru.h
header are helpful. Attached is an updated diff for consideration
which removes the partial update of the rk3328 dtb files.

okay?

Here are the boot message on Rock64 with the attach version from
Klaus Küchemann:

U-Boot TPL 2019.10-rc4 (Oct 06 2019 - 17:11:49)
LPDDR3
Trying to boot from BOOTROM
Returning to boot ROM...

U-Boot SPL 2019.10-rc4 (Oct 06 2019 - 17:11:49 -0400)
Trying to boot from MMC1
dwmmc@ff520000 - probe failed: -22
NOTICE:  BL31: v2.1(debug):2.1
NOTICE:  BL31: Built : 10:16:27, Sep 27 2019
ERROR:   over or zero region, nr=4187432, max=10
NOTICE:  BL31:Rockchip release version: v1.2
INFO:    ARM GICv2 driver initialized
INFO:    plat_rockchip_pmu_init: pd status 0xe
INFO:    BL31: Initializing runtime services
WARNING: BL31: cortex_a53: CPU workaround for 819472 was missing!
WARNING: BL31: cortex_a53: CPU workaround for 824069 was missing!
WARNING: BL31: cortex_a53: CPU workaround for 827319 was missing!
WARNING: BL31: cortex_a53: CPU workaround for 855873 was missing!
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2019.10-rc4 (Oct 06 2019 - 17:11:49 -0400)

Model: Pine64 Rock64
DRAM:  4 GiB
MMC:   dwmmc@ff520000 - probe failed: -22
dwmmc@ff500000: 1
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial@ff130000
Out:   serial@ff130000
Err:   serial@ff130000
Model: Pine64 Rock64
Net:
Warning: ethernet@ff540000 (eth0) using random MAC address - de:5a:74:12:d0:ce
eth0: ethernet@ff540000
Hit any key to stop autoboot:  0
no mmc device at slot 0
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found EFI removable media binary efi/boot/bootaa64.efi
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk dw...@ff500000.blk...
Scanning disk dw...@ff520000.blk...
Disk dw...@ff520000.blk not ready
Found 3 disks
BootOrder not defined
EFI boot manager: Cannot load any image
161090 bytes read in 13 ms (11.8 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
disks: sd0*
>> OpenBSD/arm64 BOOTAA64 0.19
boot>
cannot open sd0a:/etc/random.seed: No such file or directory
booting sd0a:/bsd: 2228316+623504+8769504+741040 [221760+109+519552+200640]=0xf0
type 0x2 pa 0x200000 va 0x200000 pages 0x4000 attr 0x8
type 0x7 pa 0x4200000 va 0x4200000 pages 0x3ef2 attr 0x8
type 0x4 pa 0x80f2000 va 0x80f2000 pages 0x1c attr 0x8
type 0x7 pa 0x810e000 va 0x810e000 pages 0xf30a8 attr 0x8
type 0x2 pa 0xfb1b6000 va 0xfb1b6000 pages 0xc34 attr 0x8
type 0x4 pa 0xfbdea000 va 0xfbdea000 pages 0x1 attr 0x8
type 0x2 pa 0xfbdeb000 va 0xfbdeb000 pages 0x3 attr 0x8
type 0x7 pa 0xfbdee000 va 0xfbdee000 pages 0x1 attr 0x8
type 0x2 pa 0xfbdef000 va 0xfbdef000 pages 0x100 attr 0x8
type 0x1 pa 0xfbeef000 va 0xfbeef000 pages 0x28 attr 0x8
type 0x0 pa 0xfbf17000 va 0xfbf17000 pages 0x7 attr 0x8
type 0x4 pa 0xfbf1e000 va 0xfbf1e000 pages 0x1 attr 0x8
type 0x6 pa 0xfbf1f000 va 0x3e024be000 pages 0x1 attr 0x8000000000000008
type 0x4 pa 0xfbf20000 va 0xfbf20000 pages 0x2 attr 0x8
type 0x0 pa 0xfbf22000 va 0xfbf22000 pages 0x4 attr 0x8
type 0x4 pa 0xfbf26000 va 0xfbf26000 pages 0x2 attr 0x8
type 0x6 pa 0xfbf28000 va 0x3e024c7000 pages 0x1 attr 0x8000000000000008
type 0x2 pa 0xfbf29000 va 0xfbf29000 pages 0x3007 attr 0x8
type 0x5 pa 0xfef30000 va 0x3e054cf000 pages 0x10 attr 0x8000000000000008
type 0x2 pa 0xfef40000 va 0xfef40000 pages 0xc0 attr 0x8
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2019 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 6.6 (RAMDISK) #247: Sun Oct  6 13:06:15 MDT 2019
    dera...@arm64.openbsd.org:/usr/src/sys/arch/arm64/compile/RAMDISK
real mem  = 4210663424 (4015MB)
avail mem = 4004032512 (3818MB)
mainbus0 at root: Pine64 Rock64
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: 256KB 64b/line 16-way L2 cache
efi0 at mainbus0: UEFI 2.8
efi0: Das U-Boot rev 0x20191000
psci0 at mainbus0: PSCI 1.1, SMCCC 1.1
syscon0 at mainbus0: "syscon"
"io-domains" at syscon0 not configured
"grf-gpio" at syscon0 not configured
rkclock0 at mainbus0
syscon1 at mainbus0: "syscon"
"usb2-phy" at syscon1 not configured
ampintc0 at mainbus0 nirq 160, ncpu 4: "interrupt-controller"
rkpinctrl0 at mainbus0: "pinctrl"
rkgpio0 at rkpinctrl0
rkgpio1 at rkpinctrl0
rkgpio2 at rkpinctrl0
rkgpio3 at rkpinctrl0
"fit-images" at mainbus0 not configured
"opp_table0" at mainbus0 not configured
simplebus0 at mainbus0: "amba"
"dmac" at simplebus0 not configured
"arm-pmu" at mainbus0 not configured
"display-subsystem" at mainbus0 not configured
agtimer0 at mainbus0: tick rate 24000 KHz
"xin24m" at mainbus0 not configured
"spdif" at mainbus0 not configured
com0 at mainbus0: ns16550, no working fifo
com0: console
rkiic0 at mainbus0
iic0 at rkiic0
rkpmic0 at iic0 addr 0x18: RK805
"spi" at mainbus0 not configured
"watchdog" at mainbus0 not configured
"tsadc" at mainbus0 not configured
"efuse" at mainbus0 not configured
"gpu" at mainbus0 not configured
"vop" at mainbus0 not configured
"iommu" at mainbus0 not configured
"hdmi" at mainbus0 not configured
"phy" at mainbus0 not configured
dwmmc0 at mainbus0: 50 MHz base clock
sdmmc0 at dwmmc0: 4-bit, sd high-speed, mmc high-speed, dma
dwmmc1 at mainbus0: 50 MHz base clock
sdmmc1 at dwmmc1: 8-bit, mmc high-speed, dma
dwge0 at mainbus0: address de:5a:74:12:d0:ce
rgephy0 at dwge0 phy 0: RTL8169S/8110S/8211 PHY, rev. 6
"usb" at mainbus0 not configured
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.001
ohci0 at mainbus0: version 1.0
"external-gmac-clock" at mainbus0 not configured
"sdmmc-regulator" at mainbus0 not configured
"vcc-host-5v-regulator" at mainbus0 not configured
"vcc-sys" at mainbus0 not configured
"sound" at mainbus0 not configured
"spdif-dit" at mainbus0 not configured
"dmc" at mainbus0 not configured
"usb" at mainbus0 not configured
usb1 at ohci0: USB revision 1.0
uhub1 at usb1 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.001
scsibus0 at sdmmc0: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <SD/MMC, SC16G, 0080> removable
sd0: 15193MB, 512 bytes/sector, 31116288 sectors
sdmmc1: can't enable card
softraid0 at root
scsibus1 at softraid0: 256 targets
bootfile: sd0a:/bsd
boot device: sd0
root on rd0a swap on rd0b dump on rd0b
erase ^?, werase ^W, kill ^U, intr ^C, status ^T

Welcome to the OpenBSD/arm64 6.6 installation program.
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?
Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/u-boot/Makefile,v
retrieving revision 1.59
diff -u -p -u -r1.59 Makefile
--- Makefile    28 Sep 2019 01:40:24 -0000      1.59
+++ Makefile    7 Oct 2019 20:25:30 -0000
@@ -7,6 +7,7 @@ FLAVOR?=        arm
 
 COMMENT=       U-Boot firmware
 VERSION=       2019.10-rc4
+REVISION=      0
 DISTNAME=      u-boot-${VERSION}
 PKGNAME=       u-boot-${FLAVOR}-${VERSION:S/-//}
 FULLPKGNAME=   ${PKGNAME}
@@ -40,6 +41,7 @@ BUILD_DEPENDS+=       devel/arm-none-eabi/gcc-
                devel/py-elftools \
                sysutils/arm-trusted-firmware
 MAKE_ENV+=     CROSS_COMPILE="aarch64-none-elf-"
+RK3328_BL31=   "${LOCALBASE}/share/arm-trusted-firmware/rk3328-bl31.elf"
 RK3399_BL31=   "${LOCALBASE}/share/arm-trusted-firmware/rk3399-bl31.elf"
 SUNXI_BL31=    "${LOCALBASE}/share/arm-trusted-firmware/sun50i_a64-bl31.bin"
 .elif "${FLAVOR}" == "arm"
@@ -68,6 +70,7 @@ BOARDS=\
        mvebu_espressobin-88f3720 \
        mvebu_mcbin-88f8040 \
        qemu_arm64 \
+       rock64-rk3328 \
        rockpro64-rk3399 \
        rpi_3 \
        rpi_4
@@ -151,23 +154,27 @@ do-build:
            mkdir -p build/${BOARD} && \
            ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} \
                O="build/${BOARD}" \
-               -f ${MAKE_FILE} "${BOARD}"_defconfig && \
+               -f ${MAKE_FILE} "${BOARD}"_defconfig
+.if "${BOARD}" == "firefly-rk3399" || "${BOARD}" == "rockpro64-rk3399"
+       cd ${WRKSRC} && \
+           ${SETENV} ${MAKE_ENV} BL31=${RK3399_BL31} ${MAKE_PROGRAM} \
+               ${MAKE_FLAGS} O="build/${BOARD}" \
+               -f ${MAKE_FILE} ${ALL_TARGET}
+.elif "${BOARD}" == "rock64-rk3328"
+       cd ${WRKSRC} && \
+           ${SETENV} ${MAKE_ENV} BL31=${RK3328_BL31} ${MAKE_PROGRAM} \
+               ${MAKE_FLAGS} O="build/${BOARD}" \
+               -f ${MAKE_FILE} ${ALL_TARGET} u-boot.itb
+.else
+       cd ${WRKSRC} && \
            ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} \
                O="build/${BOARD}" \
                -f ${MAKE_FILE} ${ALL_TARGET}
+.endif
 .if "${BOARD}" == "tinker-rk3288"
        cd ${WRKSRC}/build/${BOARD} && \
            tools/mkimage -n rk3288 -T rksd -d tpl/u-boot-tpl.bin \
                idbloader.img && \
-           cat spl/u-boot-spl-dtb.bin >> idbloader.img
-.endif
-.if "${BOARD}" == "firefly-rk3399" || "${BOARD}" == "rockpro64-rk3399"
-       cd ${WRKSRC}/build/${BOARD} && \
-           ${SETENV} ${MAKE_ENV} BL31=${RK3399_BL31} ${MAKE_PROGRAM} \
-               ${MAKE_FLAGS} O="build/${BOARD}" \
-               -f ${MAKE_FILE} u-boot.itb && \
-           tools/mkimage -n rk3399 -T rksd -d tpl/u-boot-tpl.bin \
-               idbloader.img && \
            cat spl/u-boot-spl-dtb.bin >> idbloader.img
 .endif
 .endfor
Index: patches/patch-arch_arm_dts_rk3328-rock64_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_rk3328-rock64_dts
diff -N patches/patch-arch_arm_dts_rk3328-rock64_dts
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_rk3328-rock64_dts        7 Oct 2019 20:25:30 
-0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: arch/arm/dts/rk3328-rock64.dts
+--- arch/arm/dts/rk3328-rock64.dts.orig
++++ arch/arm/dts/rk3328-rock64.dts
+@@ -11,7 +11,7 @@
+       compatible = "pine64,rock64", "rockchip,rk3328";
+ 
+       chosen {
+-              stdout-path = "serial2:1500000n8";
++              stdout-path = "serial2:115200n8";
+       };
+ 
+       gmac_clkin: external-gmac-clock {
Index: patches/patch-arch_arm_dts_rk3399-rockpro64_dts
===================================================================
RCS file: 
/cvs/ports/sysutils/u-boot/patches/patch-arch_arm_dts_rk3399-rockpro64_dts,v
retrieving revision 1.1
diff -u -p -u -r1.1 patch-arch_arm_dts_rk3399-rockpro64_dts
--- patches/patch-arch_arm_dts_rk3399-rockpro64_dts     28 Sep 2019 01:40:24 
-0000      1.1
+++ patches/patch-arch_arm_dts_rk3399-rockpro64_dts     7 Oct 2019 20:25:30 
-0000
@@ -12,3 +12,52 @@ Index: arch/arm/dts/rk3399-rockpro64.dts
        };
  
        clkin_gmac: external-gmac-clock {
+@@ -222,6 +222,10 @@
+       status = "okay";
+ };
+ 
++&hdmi_sound {
++      status = "okay";
++};
++
+ &gpu {
+       mali-supply = <&vdd_gpu>;
+       status = "okay";
+@@ -504,11 +508,25 @@
+       status = "okay";
+ 
+       bt656-supply = <&vcc1v8_dvp>;
+-      audio-supply = <&vcca1v8_codec>;
++      audio-supply = <&vcc_3v0>;
+       sdmmc-supply = <&vcc_sdio>;
+       gpio1830-supply = <&vcc_3v0>;
+ };
+ 
++&pcie0 {
++      ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>;
++      num-lanes = <4>;
++      pinctrl-names = "default";
++      pinctrl-0 = <&pcie_perst>;
++      vpcie12v-supply = <&vcc12v_dcin>;
++      vpcie3v3-supply = <&vcc3v3_pcie>;
++      status = "okay";
++};
++
++&pcie_phy {
++      status = "okay";
++};
++
+ &pmu_io_domains {
+       pmu1830-supply = <&vcc_3v0>;
+       status = "okay";
+@@ -538,6 +556,10 @@
+       };
+ 
+       pcie {
++              pcie_perst: pcie-perst {
++                      rockchip,pins = <2 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
++              };
++
+               pcie_pwr_en: pcie-pwr-en {
+                       rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
Index: patches/patch-configs_rock64-rk3328_defconfig
===================================================================
RCS file: patches/patch-configs_rock64-rk3328_defconfig
diff -N patches/patch-configs_rock64-rk3328_defconfig
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-configs_rock64-rk3328_defconfig       7 Oct 2019 20:25:30 
-0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: configs/rock64-rk3328_defconfig
+--- configs/rock64-rk3328_defconfig.orig
++++ configs/rock64-rk3328_defconfig
+@@ -76,7 +76,7 @@ CONFIG_RAM=y
+ CONFIG_SPL_RAM=y
+ CONFIG_TPL_RAM=y
+ CONFIG_DM_RESET=y
+-CONFIG_BAUDRATE=1500000
++CONFIG_BAUDRATE=115200
+ CONFIG_DEBUG_UART_SHIFT=2
+ CONFIG_SYSRESET=y
+ CONFIG_USB=y
Index: patches/patch-drivers_ram_rockchip_sdram_rk3328_c
===================================================================
RCS file: patches/patch-drivers_ram_rockchip_sdram_rk3328_c
diff -N patches/patch-drivers_ram_rockchip_sdram_rk3328_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-drivers_ram_rockchip_sdram_rk3328_c   7 Oct 2019 20:25:30 
-0000
@@ -0,0 +1,29 @@
+$OpenBSD$
+
+Index: drivers/ram/rockchip/sdram_rk3328.c
+--- drivers/ram/rockchip/sdram_rk3328.c.orig
++++ drivers/ram/rockchip/sdram_rk3328.c
+@@ -311,12 +311,12 @@ static void phy_dll_bypass_set(struct dram_info *dram,
+       setbits_le32(PHY_REG(phy_base, 0x56), 1 << 4);
+       clrbits_le32(PHY_REG(phy_base, 0x57), 1 << 3);
+ 
+-      if (freq <= (400 * MHz))
++      if (freq <= 400)
+               /* DLL bypass */
+               setbits_le32(PHY_REG(phy_base, 0xa4), 0x1f);
+       else
+               clrbits_le32(PHY_REG(phy_base, 0xa4), 0x1f);
+-      if (freq <= (680 * MHz))
++      if (freq <= 680)
+               tmp = 2;
+       else
+               tmp = 1;
+@@ -394,7 +394,7 @@ static void phy_cfg(struct dram_info *dram,
+       copy_to_reg(PHY_REG(phy_base, 0x70),
+                   &sdram_params->skew.cs0_dm0_skew[0], 44 * 4);
+       copy_to_reg(PHY_REG(phy_base, 0xc0),
+-                  &sdram_params->skew.cs0_dm1_skew[0], 44 * 4);
++                  &sdram_params->skew.cs1_dm0_skew[0], 44 * 4);
+ }
+ 
+ static int update_refresh_reg(struct dram_info *dram)
Index: patches/patch-include_dt-bindings_clock_rk3328-cru_h
===================================================================
RCS file: patches/patch-include_dt-bindings_clock_rk3328-cru_h
diff -N patches/patch-include_dt-bindings_clock_rk3328-cru_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-include_dt-bindings_clock_rk3328-cru_h        7 Oct 2019 
20:25:30 -0000
@@ -0,0 +1,237 @@
+$OpenBSD$
+
+Index: include/dt-bindings/clock/rk3328-cru.h
+--- include/dt-bindings/clock/rk3328-cru.h.orig
++++ include/dt-bindings/clock/rk3328-cru.h
+@@ -1,6 +1,7 @@
+-/* SPDX-License-Identifier: GPL-2.0+ */
++/* SPDX-License-Identifier: GPL-2.0-or-later */
+ /*
+- * (C) Copyright 2016 Rockchip Electronics Co., Ltd
++ * Copyright (c) 2016 Rockchip Electronics Co. Ltd.
++ * Author: Elaine <zhangq...@rock-chips.com>
+  */
+ 
+ #ifndef _DT_BINDINGS_CLK_ROCKCHIP_RK3328_H
+@@ -90,118 +91,117 @@
+ #define SCLK_MAC2IO_EXT               102
+ 
+ /* dclk gates */
+-#define DCLK_LCDC             180
+-#define DCLK_HDMIPHY          181
+-#define HDMIPHY                       182
+-#define USB480M                       183
+-#define DCLK_LCDC_SRC         184
++#define DCLK_LCDC             120
++#define DCLK_HDMIPHY          121
++#define HDMIPHY                       122
++#define USB480M                       123
++#define DCLK_LCDC_SRC         124
+ 
+ /* aclk gates */
+-#define ACLK_AXISRAM          190
+-#define ACLK_VOP_PRE          191
+-#define ACLK_USB3OTG          192
+-#define ACLK_RGA_PRE          193
+-#define ACLK_DMAC             194
+-#define ACLK_GPU              195
+-#define ACLK_BUS_PRE          196
+-#define ACLK_PERI_PRE         197
+-#define ACLK_RKVDEC_PRE               198
+-#define ACLK_RKVDEC           199
+-#define ACLK_RKVENC           200
+-#define ACLK_VPU_PRE          201
+-#define ACLK_VIO_PRE          202
+-#define ACLK_VPU              203
+-#define ACLK_VIO              204
+-#define ACLK_VOP              205
+-#define ACLK_GMAC             206
+-#define ACLK_H265             207
+-#define ACLK_H264             208
+-#define ACLK_MAC2PHY          209
+-#define ACLK_MAC2IO           210
+-#define ACLK_DCF              211
+-#define ACLK_TSP              212
+-#define ACLK_PERI             213
+-#define ACLK_RGA              214
+-#define ACLK_IEP              215
+-#define ACLK_CIF              216
+-#define ACLK_HDCP             217
++#define ACLK_AXISRAM          130
++#define ACLK_VOP_PRE          131
++#define ACLK_USB3OTG          132
++#define ACLK_RGA_PRE          133
++#define ACLK_DMAC             134
++#define ACLK_GPU              135
++#define ACLK_BUS_PRE          136
++#define ACLK_PERI_PRE         137
++#define ACLK_RKVDEC_PRE               138
++#define ACLK_RKVDEC           139
++#define ACLK_RKVENC           140
++#define ACLK_VPU_PRE          141
++#define ACLK_VIO_PRE          142
++#define ACLK_VPU              143
++#define ACLK_VIO              144
++#define ACLK_VOP              145
++#define ACLK_GMAC             146
++#define ACLK_H265             147
++#define ACLK_H264             148
++#define ACLK_MAC2PHY          149
++#define ACLK_MAC2IO           150
++#define ACLK_DCF              151
++#define ACLK_TSP              152
++#define ACLK_PERI             153
++#define ACLK_RGA              154
++#define ACLK_IEP              155
++#define ACLK_CIF              156
++#define ACLK_HDCP             157
+ 
+ /* pclk gates */
+-#define PCLK_GPIO0            300
+-#define PCLK_GPIO1            301
+-#define PCLK_GPIO2            302
+-#define PCLK_GPIO3            303
+-#define PCLK_GRF              304
+-#define PCLK_I2C0             305
+-#define PCLK_I2C1             306
+-#define PCLK_I2C2             307
+-#define PCLK_I2C3             308
+-#define PCLK_SPI              309
+-#define PCLK_UART0            310
+-#define PCLK_UART1            311
+-#define PCLK_UART2            312
+-#define PCLK_TSADC            313
+-#define PCLK_PWM              314
+-#define PCLK_TIMER            315
+-#define PCLK_BUS_PRE          316
+-#define PCLK_PERI_PRE         317
+-#define PCLK_HDMI_CTRL                318
+-#define PCLK_HDMI_PHY         319
+-#define PCLK_GMAC             320
+-#define PCLK_H265             321
+-#define PCLK_MAC2PHY          322
+-#define PCLK_MAC2IO           323
+-#define PCLK_USB3PHY_OTG      324
+-#define PCLK_USB3PHY_PIPE     325
+-#define PCLK_USB3_GRF         326
+-#define PCLK_USB2_GRF         327
+-#define PCLK_HDMIPHY          328
+-#define PCLK_DDR              329
+-#define PCLK_PERI             330
+-#define PCLK_HDMI             331
+-#define PCLK_HDCP             332
+-#define PCLK_DCF              333
+-#define PCLK_SARADC           334
++#define PCLK_GPIO0            200
++#define PCLK_GPIO1            201
++#define PCLK_GPIO2            202
++#define PCLK_GPIO3            203
++#define PCLK_GRF              204
++#define PCLK_I2C0             205
++#define PCLK_I2C1             206
++#define PCLK_I2C2             207
++#define PCLK_I2C3             208
++#define PCLK_SPI              209
++#define PCLK_UART0            210
++#define PCLK_UART1            211
++#define PCLK_UART2            212
++#define PCLK_TSADC            213
++#define PCLK_PWM              214
++#define PCLK_TIMER            215
++#define PCLK_BUS_PRE          216
++#define PCLK_PERI_PRE         217
++#define PCLK_HDMI_CTRL                218
++#define PCLK_HDMI_PHY         219
++#define PCLK_GMAC             220
++#define PCLK_H265             221
++#define PCLK_MAC2PHY          222
++#define PCLK_MAC2IO           223
++#define PCLK_USB3PHY_OTG      224
++#define PCLK_USB3PHY_PIPE     225
++#define PCLK_USB3_GRF         226
++#define PCLK_USB2_GRF         227
++#define PCLK_HDMIPHY          228
++#define PCLK_DDR              229
++#define PCLK_PERI             230
++#define PCLK_HDMI             231
++#define PCLK_HDCP             232
++#define PCLK_DCF              233
++#define PCLK_SARADC           234
++#define PCLK_ACODECPHY                235
++#define PCLK_WDT              236
+ 
+ /* hclk gates */
+-#define HCLK_PERI             408
+-#define HCLK_TSP              409
+-#define HCLK_GMAC             410
+-#define HCLK_I2S0_8CH         411
+-#define HCLK_I2S1_8CH         413
+-#define HCLK_I2S2_2CH         413
+-#define HCLK_SPDIF_8CH                414
+-#define HCLK_VOP              415
+-#define HCLK_NANDC            416
+-#define HCLK_SDMMC            417
+-#define HCLK_SDIO             418
+-#define HCLK_EMMC             419
+-#define HCLK_SDMMC_EXT                420
+-#define HCLK_RKVDEC_PRE               421
+-#define HCLK_RKVDEC           422
+-#define HCLK_RKVENC           423
+-#define HCLK_VPU_PRE          424
+-#define HCLK_VIO_PRE          425
+-#define HCLK_VPU              426
+-#define HCLK_VIO              427
+-#define HCLK_BUS_PRE          428
+-#define HCLK_PERI_PRE         429
+-#define HCLK_H264             430
+-#define HCLK_CIF              431
+-#define HCLK_OTG_PMU          432
+-#define HCLK_OTG              433
+-#define HCLK_HOST0            434
+-#define HCLK_HOST0_ARB                435
+-#define HCLK_CRYPTO_MST               436
+-#define HCLK_CRYPTO_SLV               437
+-#define HCLK_PDM              438
+-#define HCLK_IEP              439
+-#define HCLK_RGA              440
+-#define HCLK_HDCP             441
++#define HCLK_PERI             308
++#define HCLK_TSP              309
++#define HCLK_GMAC             310
++#define HCLK_I2S0_8CH         311
++#define HCLK_I2S1_8CH         312
++#define HCLK_I2S2_2CH         313
++#define HCLK_SPDIF_8CH                314
++#define HCLK_VOP              315
++#define HCLK_NANDC            316
++#define HCLK_SDMMC            317
++#define HCLK_SDIO             318
++#define HCLK_EMMC             319
++#define HCLK_SDMMC_EXT                320
++#define HCLK_RKVDEC_PRE               321
++#define HCLK_RKVDEC           322
++#define HCLK_RKVENC           323
++#define HCLK_VPU_PRE          324
++#define HCLK_VIO_PRE          325
++#define HCLK_VPU              326
++#define HCLK_BUS_PRE          328
++#define HCLK_PERI_PRE         329
++#define HCLK_H264             330
++#define HCLK_CIF              331
++#define HCLK_OTG_PMU          332
++#define HCLK_OTG              333
++#define HCLK_HOST0            334
++#define HCLK_HOST0_ARB                335
++#define HCLK_CRYPTO_MST               336
++#define HCLK_CRYPTO_SLV               337
++#define HCLK_PDM              338
++#define HCLK_IEP              339
++#define HCLK_RGA              340
++#define HCLK_HDCP             341
+ 
+ #define CLK_NR_CLKS           (HCLK_HDCP + 1)
+-
+-#define CLKGRF_NR_CLKS                (SCLK_MAC2PHY + 1)
+ 
+ /* soft-reset indices */
+ #define SRST_CORE0_PO         0
Index: pkg/PFRAG.aarch64
===================================================================
RCS file: /cvs/ports/sysutils/u-boot/pkg/PFRAG.aarch64,v
retrieving revision 1.13
diff -u -p -u -r1.13 PFRAG.aarch64
--- pkg/PFRAG.aarch64   28 Sep 2019 01:40:25 -0000      1.13
+++ pkg/PFRAG.aarch64   7 Oct 2019 20:25:30 -0000
@@ -86,6 +86,12 @@ share/u-boot/pinebook/u-boot.itb
 share/u-boot/qemu_arm64/
 share/u-boot/qemu_arm64/u-boot
 share/u-boot/qemu_arm64/u-boot.bin
+share/u-boot/rock64-rk3328/
+share/u-boot/rock64-rk3328/idbloader.img
+share/u-boot/rock64-rk3328/u-boot
+share/u-boot/rock64-rk3328/u-boot.bin
+share/u-boot/rock64-rk3328/u-boot.img
+share/u-boot/rock64-rk3328/u-boot.itb
 share/u-boot/rockpro64-rk3399/
 share/u-boot/rockpro64-rk3399/idbloader.img
 share/u-boot/rockpro64-rk3399/u-boot

Reply via email to