Jump to content

Panzerknacker

Members
  • Posts

    36
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Panzerknacker got a reaction from denni_isl in ROC-RK3399-PC (Renegade Elite)   
    I forgot to mention how to build ATF (Arm Trusted Firmware)
     
    git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
     
    make PLAT=rk3399 bl31
    cp build/rk3399/release/bl31/bl31.elf ../u-boot
     
    You need bl31.elf to build your u-boot!
  2. Like
    Panzerknacker got a reaction from denni_isl in ROC-RK3399-PC (Renegade Elite)   
    On roc-rk3399-pc you can short pin 6 of the 8pin SPI-Flash-Chip to GND during
    power on. Then rk3399 boots from SD/eMMC.
  3. Like
    Panzerknacker got a reaction from Redferne in ROC-RK3399-PC (Renegade Elite)   
    I forgot to mention how to build ATF (Arm Trusted Firmware)
     
    git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
     
    make PLAT=rk3399 bl31
    cp build/rk3399/release/bl31/bl31.elf ../u-boot
     
    You need bl31.elf to build your u-boot!
  4. Like
    Panzerknacker got a reaction from Redferne in ROC-RK3399-PC (Renegade Elite)   
    Boot from SPI directly to NVME works:
     
    Latest U-Boot v2021.01-rc4 + this patch:
    rockchip: roc-pc-rk3399: fix boot from SPI flash on spi1
    https://patchwork.kernel.org/project/linux-rockchip/list/?series=403611
     
    To build uboot on roc-pc:
    make roc-pc-mezzanine-rk3399_defconfig
    make -j6
    ./tools/mkimage -n rk3399 -T rkspi -d tpl/u-boot-tpl.bin:spl/u-boot-spl.bin idbloader-spi.img
     
    To deploy uboot on spi:
    dd if=idbloader-spi.img of=spi.img
                      (#0x60000 = 393216 = 4096 * 96)
    dd if=u-boot.itb of=spi.img bs=4096 seek=96
    flashcp -v spi.img /dev/mtd0
     
    in U-Boot:
    edit boot_targets to have nvme0 as first entry
     
    On NVME drive (e.g. Samsung 970EVOPlus):
     
    /boot/extlinux/extlinux.conf:
     
    label mainline-kernel
        kernel /boot/Image
        initrd /boot/Initrd
    #    fdt /rk3399-roc-pc.dtb
        fdt /boot/rk3399-roc-pc-mezzanine.dtb
        append earlycon=uart8250,mmio32,0xff1a0000 console=tty1 console=ttyS2,1500000 swiotlb=1 root=/dev/nvme0n1p1 rootwait rw rootfstype=ext4 init=/sbin/init
     
    ls /boot:
    Image (Image-5.10.0-next-20201223)
    Initrd (Initrd-5.10.0-next-20201223)
    rk3399-roc-pc-mezzanine.dtb (rk3399-roc-pc-mezzanine.dtb-5.10.0-next-20201223)
     
    Kernel built on roc-pc:
    Latest linux-next
     
    make -j6
    make modules_install
    kernelversion=`cat ./include/config/kernel.release`
    cp .config /boot/config-$kernelversion
    mkinitramfs -c gzip -o ./initramfs-$kernelversion $kernelversion
    mkimage -A arm64 -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d ./initramfs-$kernelversion ./Initrd
    cp arch/arm64/boot/Image /boot/Image
    cp Initrd /boot
    cp arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtb /boot
    cp arch/arm64/boot/dts/rockchip/rk3399-roc-pc-mezzanine.dtb /boot
    cp arch/arm64/boot/Image /boot/Image-$kernelversion
    cp Initrd /boot/Initrd-$kernelversion
    cp arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtb /boot/rk3399-roc-pc.dtb-$kernelversion
    cp arch/arm64/boot/dts/rockchip/rk3399-roc-pc-mezzanine.dtb /boot/rk3399-roc-pc-mezzanine.dtb-$kernelversion
     
    example .config:
    config
  5. Like
    Panzerknacker got a reaction from denni_isl in ROC-RK3399-PC (Renegade Elite)   
    Boot from SPI directly to NVME works:
     
    Latest U-Boot v2021.01-rc4 + this patch:
    rockchip: roc-pc-rk3399: fix boot from SPI flash on spi1
    https://patchwork.kernel.org/project/linux-rockchip/list/?series=403611
     
    To build uboot on roc-pc:
    make roc-pc-mezzanine-rk3399_defconfig
    make -j6
    ./tools/mkimage -n rk3399 -T rkspi -d tpl/u-boot-tpl.bin:spl/u-boot-spl.bin idbloader-spi.img
     
    To deploy uboot on spi:
    dd if=idbloader-spi.img of=spi.img
                      (#0x60000 = 393216 = 4096 * 96)
    dd if=u-boot.itb of=spi.img bs=4096 seek=96
    flashcp -v spi.img /dev/mtd0
     
    in U-Boot:
    edit boot_targets to have nvme0 as first entry
     
    On NVME drive (e.g. Samsung 970EVOPlus):
     
    /boot/extlinux/extlinux.conf:
     
    label mainline-kernel
        kernel /boot/Image
        initrd /boot/Initrd
    #    fdt /rk3399-roc-pc.dtb
        fdt /boot/rk3399-roc-pc-mezzanine.dtb
        append earlycon=uart8250,mmio32,0xff1a0000 console=tty1 console=ttyS2,1500000 swiotlb=1 root=/dev/nvme0n1p1 rootwait rw rootfstype=ext4 init=/sbin/init
     
    ls /boot:
    Image (Image-5.10.0-next-20201223)
    Initrd (Initrd-5.10.0-next-20201223)
    rk3399-roc-pc-mezzanine.dtb (rk3399-roc-pc-mezzanine.dtb-5.10.0-next-20201223)
     
    Kernel built on roc-pc:
    Latest linux-next
     
    make -j6
    make modules_install
    kernelversion=`cat ./include/config/kernel.release`
    cp .config /boot/config-$kernelversion
    mkinitramfs -c gzip -o ./initramfs-$kernelversion $kernelversion
    mkimage -A arm64 -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d ./initramfs-$kernelversion ./Initrd
    cp arch/arm64/boot/Image /boot/Image
    cp Initrd /boot
    cp arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtb /boot
    cp arch/arm64/boot/dts/rockchip/rk3399-roc-pc-mezzanine.dtb /boot
    cp arch/arm64/boot/Image /boot/Image-$kernelversion
    cp Initrd /boot/Initrd-$kernelversion
    cp arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtb /boot/rk3399-roc-pc.dtb-$kernelversion
    cp arch/arm64/boot/dts/rockchip/rk3399-roc-pc-mezzanine.dtb /boot/rk3399-roc-pc-mezzanine.dtb-$kernelversion
     
    example .config:
    config
  6. Like
    Panzerknacker got a reaction from jsorocil in ROC-RK3399-PC (Renegade Elite)   
    Boot from SPI directly to NVME works:
     
    Latest U-Boot v2021.01-rc4 + this patch:
    rockchip: roc-pc-rk3399: fix boot from SPI flash on spi1
    https://patchwork.kernel.org/project/linux-rockchip/list/?series=403611
     
    To build uboot on roc-pc:
    make roc-pc-mezzanine-rk3399_defconfig
    make -j6
    ./tools/mkimage -n rk3399 -T rkspi -d tpl/u-boot-tpl.bin:spl/u-boot-spl.bin idbloader-spi.img
     
    To deploy uboot on spi:
    dd if=idbloader-spi.img of=spi.img
                      (#0x60000 = 393216 = 4096 * 96)
    dd if=u-boot.itb of=spi.img bs=4096 seek=96
    flashcp -v spi.img /dev/mtd0
     
    in U-Boot:
    edit boot_targets to have nvme0 as first entry
     
    On NVME drive (e.g. Samsung 970EVOPlus):
     
    /boot/extlinux/extlinux.conf:
     
    label mainline-kernel
        kernel /boot/Image
        initrd /boot/Initrd
    #    fdt /rk3399-roc-pc.dtb
        fdt /boot/rk3399-roc-pc-mezzanine.dtb
        append earlycon=uart8250,mmio32,0xff1a0000 console=tty1 console=ttyS2,1500000 swiotlb=1 root=/dev/nvme0n1p1 rootwait rw rootfstype=ext4 init=/sbin/init
     
    ls /boot:
    Image (Image-5.10.0-next-20201223)
    Initrd (Initrd-5.10.0-next-20201223)
    rk3399-roc-pc-mezzanine.dtb (rk3399-roc-pc-mezzanine.dtb-5.10.0-next-20201223)
     
    Kernel built on roc-pc:
    Latest linux-next
     
    make -j6
    make modules_install
    kernelversion=`cat ./include/config/kernel.release`
    cp .config /boot/config-$kernelversion
    mkinitramfs -c gzip -o ./initramfs-$kernelversion $kernelversion
    mkimage -A arm64 -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d ./initramfs-$kernelversion ./Initrd
    cp arch/arm64/boot/Image /boot/Image
    cp Initrd /boot
    cp arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtb /boot
    cp arch/arm64/boot/dts/rockchip/rk3399-roc-pc-mezzanine.dtb /boot
    cp arch/arm64/boot/Image /boot/Image-$kernelversion
    cp Initrd /boot/Initrd-$kernelversion
    cp arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtb /boot/rk3399-roc-pc.dtb-$kernelversion
    cp arch/arm64/boot/dts/rockchip/rk3399-roc-pc-mezzanine.dtb /boot/rk3399-roc-pc-mezzanine.dtb-$kernelversion
     
    example .config:
    config
  7. Like
    Panzerknacker reacted to Bitschubser in ROC-RK3399-PC (Renegade Elite)   
    Booting from spi into nvme is now working for me ™. It is a hack but if anybody want to try it be aware that you may brick your device.    
     
    Most of the needed stuff is already there.  But you have to power the pci regulator manually.    
     
    To build u-boot from scratch you have to checkout u-boot@50be9f0e1ccc0909e65132cff216743a49046f97 and apply the attached patches. After that follow the usual way:   
    $ make roc-pc-rk3399-spi-nvme_defconfig
    $ make all
     
    and flash   
    idbloader.img at offset 0x00   
    u-boot.itb at offset 0x200 (0x40000)  
     
    NOTE: 0x40000 is the offset in bytes, use 0x200 for the rockchip flash tool
     
    Happy hacking
     
    0004-roc-pc-mezzaine-add-defconfig-to-boot-from-spi-and-n.patch0003-hack-nvme-support-into-bootcmd.patch0002-Rk3399-roc-pc-mezziane-boot-from-nvme.patch0001-roc-pc-boot-from-spi.patch
  8. Like
    Panzerknacker got a reaction from gounthar in ROC-RK3399-PC (Renegade Elite)   
    Steps for building native on the board, boot from mmc or SD:
     
    Get https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
    make -j6 PLAT=rk3399 bl31
    cp build/rk3399/release/bl31/bl31.elf ../u-boot
     
    cd ../u-boot
     
    make roc-pc-rk3399_defconfig
    make -j6
     
    dd if=idbloader.img of=/dev/mmcblkX seek=64
    dd if=u-boot.itb of=/dev/mmcblkX seek=16384
     
    If this works, you can try SPI.
     
  9. Like
    Panzerknacker got a reaction from Fred St-Pierre in ROC-RK3399-PC (Renegade Elite)   
    Steps for building native on the board, boot from mmc or SD:
     
    Get https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
    make -j6 PLAT=rk3399 bl31
    cp build/rk3399/release/bl31/bl31.elf ../u-boot
     
    cd ../u-boot
     
    make roc-pc-rk3399_defconfig
    make -j6
     
    dd if=idbloader.img of=/dev/mmcblkX seek=64
    dd if=u-boot.itb of=/dev/mmcblkX seek=16384
     
    If this works, you can try SPI.
     
  10. Like
    Panzerknacker got a reaction from Fred St-Pierre in ROC-RK3399-PC (Renegade Elite)   
    Presently you have to press power button when booting with mainline uboot.
    If you don't want this patch here:
     
    diff --git a/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c b/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c index de9185a7ce..6410fe377a 100644 --- a/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c +++ b/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c @@ -51,7 +51,7 @@ int board_early_init_f(void) spl_gpio_output(gpio0, GPIO(BANK_A, 2), 1); spl_gpio_set_pull(&pmugrf->gpio0_p, GPIO(BANK_A, 5), GPIO_PULL_NORMAL); - while (readl(&gpio0->ext_port) & 0x20); +// while (readl(&gpio0->ext_port) & 0x20); spl_gpio_output(gpio0, GPIO(BANK_A, 2), 0); spl_gpio_output(gpio0, GPIO(BANK_B, 5), 1);  
  11. Like
    Panzerknacker reacted to Bitschubser in ROC-RK3399-PC (Renegade Elite)   
    With help of this patch I have been able to build a mainline U-Boot which can load the kernel from nvme. Now I want to flash this build into the onboard spi flash. But it is not working, no leds lighten up, no output on serial terminal. I did search for spi builds for rk3399 but I could not find anything that was helpful. Does anybody here on the list have experience how to build an U-Boot for spi flash? Any hint is welcome.
  12. Like
    Panzerknacker got a reaction from a16bitsysop in ROC-RK3399-PC (Renegade Elite)   
    You need an NVME not a SATA type.
  13. Like
    Panzerknacker reacted to Fred St-Pierre in ROC-RK3399-PC (Renegade Elite)   
    I wrote to the firefly team so they could help in fixing USB-C power upstream and received a response on Feb 12th saying they were all remote working due to Corona virus... But the request to get the proper code base would be forwarded to an engineer. No reply on this yet.
  14. Like
    Panzerknacker got a reaction from gounthar in ROC-RK3399-PC (Renegade Elite)   
    If we could solve this:
    https://lore.kernel.org/linux-usb/0ac6bbe7-6395-526d-213c-ac58a19d8673@fivetechno.de/
    we probably had everything working in mainline.
  15. Like
    Panzerknacker reacted to Redferne in ROC-RK3399-PC (Renegade Elite)   
    Not sure this a bug, but the following patch made my EMMC revert back to MMC High Speed (26MHz) after failing @ MMC High Speed (52MHz).
    diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index f683b52e..2e01c75f 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -2139,11 +2143,14 @@ static int mmc_select_mode_and_width(struct mmc *mmc, uint card_caps) if (!err) return 0; error: + pr_debug("error: %d\n", err); mmc_set_signal_voltage(mmc, old_voltage); /* if an error occured, revert to a safer bus mode */ mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BUS_WIDTH, EXT_CSD_BUS_WIDTH_1); mmc_select_mode(mmc, MMC_LEGACY); + mmc_set_clock(mmc, mmc->tran_speed, + MMC_CLK_ENABLE); mmc_set_bus_width(mmc, 1); } }  
  16. Like
    Panzerknacker got a reaction from piter75 in ROC-RK3399-PC (Renegade Elite)   
    Edit: hack deleted. Link to working patches added.
     
    Patches to enable 12V from MPS MP8859 regulator.
    https://github.com/Reichl/linux-next-roc-pc/commit/54ecff244bee053de72230f0b989b4a480d06ec2
    and it's parents.
  17. Like
    Panzerknacker reacted to TonyMac32 in ROC-RK3399-PC (Renegade Elite)   
    There is special driver work done in their kernel to cover an unsupported I2C buck/boost converter that provides the 12V rail on this board, and for reasons I'm digging into, the fusb302 driver is a complete mess after they moved it out of staging, it has a lot of odd behaviors and a completely new set of requirements for the device tree.  I temporarily ran it back to the staging driver for our mainline expert builds (limited improvement), but am working on the proper driver.
  18. Like
    Panzerknacker got a reaction from chwe in ROC-RK3399-PC (Renegade Elite)   
    Does this bring some light to power supply?
    https://lkml.org/lkml/2019/12/10/517
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines