Jump to content

Panzerknacker

Members
  • Posts

    36
  • Joined

  • Last visited

Posts posted by Panzerknacker

  1. 5 minutes ago, Fred St-Pierre said:

    but if it doesn't initialize pcie, it won't boot off the nvme drive?

    No, because U-Boot loads the kernel from nvme and boots it.

    Then the defect kernel would find no pcie/nvme and therefore has no root fs.

    You land with a booted kernel in the ramdisk.

  2. root@roc-pc:/usr/src/linux-next# cat .config |grep PCI |grep =y

    CONFIG_BLK_MQ_PCI=y
    CONFIG_HAVE_PCI=y
    CONFIG_PCI=y
    CONFIG_PCI_DOMAINS=y
    CONFIG_PCI_DOMAINS_GENERIC=y
    CONFIG_PCI_SYSCALL=y
    CONFIG_PCIEPORTBUS=y
    CONFIG_PCIEAER=y
    CONFIG_PCIEASPM=y
    CONFIG_PCIEASPM_DEFAULT=y
    CONFIG_PCIE_PME=y
    CONFIG_PCI_MSI=y
    CONFIG_PCI_MSI_IRQ_DOMAIN=y
    CONFIG_PCI_QUIRKS=y
    CONFIG_PCI_LABEL=y
    CONFIG_PCIE_ROCKCHIP=y
    CONFIG_PCIE_ROCKCHIP_HOST=y
    CONFIG_PCIE_DW=y
    CONFIG_PCIE_DW_HOST=y
    CONFIG_PCIE_DW_PLAT=y
    CONFIG_PCIE_DW_PLAT_HOST=y
    CONFIG_SERIAL_8250_PCI=y
    CONFIG_SND_PCI=y
    CONFIG_ARM_GIC_V3_ITS_PCI=y
    CONFIG_PHY_ROCKCHIP_PCIE=y
    CONFIG_GENERIC_PCI_IOMAP=y

  3. [    0.733926] vcc3v3_pcie: supplied by sys_12v
    [    0.927228] rockchip-pcie f8000000.pcie: host bridge /pcie@f8000000 ranges:
    [    0.927911] rockchip-pcie f8000000.pcie:      MEM 0x00fa000000..0x00fbdfffff -> 0x00fa000000
    [    0.928695] rockchip-pcie f8000000.pcie:       IO 0x00fbe00000..0x00fbefffff -> 0x00fbe00000
    [    0.930542] rockchip-pcie f8000000.pcie: no vpcie12v regulator found
    [    1.006248] rockchip-pcie f8000000.pcie: PCI host bridge to bus 0000:00
    [    1.006851] pci_bus 0000:00: root bus resource [bus 00-1f]
    [    1.007343] pci_bus 0000:00: root bus resource [mem 0xfa000000-0xfbdfffff]
    [    1.007956] pci_bus 0000:00: root bus resource [io  0x0000-0xfffff] (bus address [0xfbe00000-0xfbefffff])
    [    1.008833] pci 0000:00:00.0: [1d87:0100] type 01 class 0x060400
    [    1.009486] pci 0000:00:00.0: supports D1
    [    1.009849] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
    [    1.013657] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
    [    1.014561] pci 0000:01:00.0: [144d:a808] type 00 class 0x010802
    [    1.015175] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x00003fff 64bit]
    [    1.015931] pci 0000:01:00.0: Max Payload Size set to 256 (was 128, max 256)
    [    1.017053] pci 0000:01:00.0: 8.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s PCIe x4 link at 0000:00:00.0 (capable of 31.504 Gb/s with 8.0 GT/s PCIe x4 link)
    [    1.033595] pci_bus 0000:01: busn_res: [bus 01-1f] end is updated to 01
    [    1.034235] pci 0000:00:00.0: BAR 8: assigned [mem 0xfa000000-0xfa0fffff]
    [    1.034854] pci 0000:01:00.0: BAR 0: assigned [mem 0xfa000000-0xfa003fff 64bit]
    [    1.035551] pci 0000:00:00.0: PCI bridge to [bus 01]
    [    1.036004] pci 0000:00:00.0:   bridge window [mem 0xfa000000-0xfa0fffff]
    [    1.036811] pcieport 0000:00:00.0: enabling device (0000 -> 0002)
    [    1.037672] pcieport 0000:00:00.0: PME: Signaling with IRQ 87
    [    1.039033] pcieport 0000:00:00.0: AER: enabled with IRQ 87
    [    1.331091] nvme nvme0: pci function 0000:01:00.0

  4. 3 hours ago, denni_isl said:

    How does one use u-boot commands to boot a armbian SD installation?   (This is all done for educational purpose - have few of those single board computers to play with).

    U-Boot scans the boot_targets one by one. So if there is no mmc0 it should try mmc1 and eventually find the SD.

  5. U-Boot TPL 2021.01-rc4-00001-gdecae30da1 (Dec 23 2020 - 11:55:50)
    Trying to boot from BOOTROM
    Returning to boot ROM...

    U-Boot SPL 2021.01-rc4-00001-gdecae30da1 (Dec 23 2020 - 11:55:50 +0100)
    Loading Environment from SPIFlash... OK
    Trying to boot from SPI


    U-Boot 2021.01-rc4-00001-gdecae30da1 (Dec 23 2020 - 11:55:50 +0100)

    SoC: Rockchip rk3399
    Reset cause: RST
    Model: Firefly ROC-RK3399-PC Mezzanine Board
    DRAM:  3.9 GiB
    PMIC:  RK808
    MMC:   mmc@fe310000: 2, mmc@fe320000: 1, sdhci@fe330000: 0
    Loading Environment from SPIFlash... SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
    OK
    In:    serial
    Out:   serial
    Err:   serial
    Model: Firefly ROC-RK3399-PC Mezzanine Board
    Net:
    Error: ethernet@fe300000 address not set.
    No ethernet found.

    Hit any key to stop autoboot:  0

    Device 0: Vendor: 0x144d Rev: 2B2QEXM7 Prod: S4EWNX0NB24402F
                Type: Hard Disk
                Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
    ... is now current device
    Scanning nvme 0:1...
    Found /boot/extlinux/extlinux.conf
    Retrieving file: /boot/extlinux/extlinux.conf
    1035 bytes read in 5 ms (202.1 KiB/s)
    1:      mainline-kernel-5.4
    Retrieving file: /boot/Initrd
    6237882 bytes read in 34 ms (175 MiB/s)
    Retrieving file: /boot/Image
    11958784 bytes read in 49 ms (232.7 MiB/s)
    append: earlycon=uart8250,mmio32,0xff1a0000 console=tty1 console=ttyS2,1500000 swiotlb=1 root=/dev/nvme0n1p1 rootwait rw rootfstype=ext4 init=/sbin/init mitigations=off
    Retrieving file: /boot/rk3399-roc-pc-mezzanine.dtb
    58248 bytes read in 14 ms (4 MiB/s)
    Moving Image from 0x2080000 to 0x2200000, end=2dd0000
    ## Loading init Ramdisk from Legacy Image at 06000000 ...
       Image Name:   initramfs
       Image Type:   AArch64 Linux RAMDisk Image (uncompressed)
       Data Size:    6237818 Bytes = 5.9 MiB
       Load Address: 00000000
       Entry Point:  00000000
       Verifying Checksum ... OK
    ## Flattened Device Tree blob at 01f00000
       Booting using the fdt blob at 0x1f00000
       Loading Ramdisk to f192c000, end f1f1ee7a ... OK
       Loading Device Tree to 00000000f191a000, end 00000000f192b387 ... OK

    Starting kernel ...

    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [    0.000000] Linux version 5.10.0-next-20201223 (root@roc-pc) (gcc (Debian 10.2.1-1) 10.2.1 20201207, GNU ld (GNU Binutils for Debian) 2.35.1) #130 SMP PREEMPT Wed Dec 23 11:59:23 CET 2020
    [    0.000000] Machine model: Firefly ROC-RK3399-PC Mezzanine Board

  6. 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. 14 minutes ago, a16bitsysop said:

    I have a POE mezzanine and the last dtb that works with is 5.5.11 I think, someone else posted this issue before. Just tried 5.6.10 and it doesn't boot, on my poe switch a normal boot is Ethernet interface up, then down, then up again and that's when networking comes up. The current draw is also around 80mA when running. With a newer dtb it shows interface up, it never goes down and networking doesn't come up. The current draw stays around 40mA after initially going up and down a bit.

    If I turn it off and remove the SD card and remove the dtb link in /boot and point it back to 5.5.11 as other post suggested it boots the newer kernel, and nvme is working on mezzanine.

    Sent from my moto g(7) power using Tapatalk
     

    Which power supply and cable do you use?

    Can you log the output from the serial debug port?

  8. 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);

     

  9. On 3/9/2020 at 11:07 PM, Fred St-Pierre said:

    Trying to compile u-boot and I always get an SPL is too large error... Hm. When you haven't built anything in a while, you realize how rusty you are.

     

    **edit** Why exactly did the maintainer of this board name the u-boot board as roc-pc-rk3399 instead of roc-rk3399-pc? Confusing... :O

    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.

     

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines