Not able to write u-boot to SPI
#1
Hello everyone.

I have a trouble flashing uboot to my RockPro64 4GB variant. I am trying to use rock64_write_spi_flash.sh script, but nothing is flashing.

I made all steps according to wiki, booted from SD card, used latest ubuntu image, but everything I get is following error:


Code:
rock64@rockpro64:/dev$ sudo su
[sudo] password for rock64:
root@rockpro64:/dev# rock64_write_spi_flash.sh
Doing this will overwrite data stored on SPI Flash
 and it will require that you use eMMC or SD
 as your boot device.

Type YES to continue or Ctrl-C to abort.
YES
Writing /dev/mtd0 with content of /usr/lib/u-boot-rockpro64/rkspi_loader.img
Erasing 4 Kibyte @ 0 --  0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 0 (mtd0)
       error 110 (Connection timed out)
flash_erase: error!: /dev/mtd0: MTD Erase failure
            error 110 (Connection timed out)
Erasing 4 Kibyte @ 1000 --  0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 1 (mtd0)
       error 110 (Connection timed out)
flash_erase: error!: /dev/mtd0: MTD Erase failure
            error 110 (Connection timed out)
Erasing 4 Kibyte @ 2000 --  0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 2 (mtd0)
       error 110 (Connection timed out)
flash_erase: error!: /dev/mtd0: MTD Erase failure
            error 110 (Connection timed out)
Erasing 4 Kibyte @ 3000 --  0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 3 (mtd0)
       error 110 (Connection timed out)
flash_erase: error!: /dev/mtd0: MTD Erase failure
            error 110 (Connection timed out)
Erasing 4 Kibyte @ 4000 --  0 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 4 (mtd0)
       error 110 (Connection timed out)
flash_erase: error!: /dev/mtd0: MTD Erase failure
            error 110 (Connection timed out)
Erasing 4 Kibyte @ 5000 --  0 % complete ^C^C


I have even tried steps written here: https://forum.pine64.org/showthread.php?...e#pid40677   (,only changed the overlay address to "ff1d0000" to fit to RockPro64 dts).

I never flashed anything to SPI before, so it can't be messed up. I tried the SD card method with only ayufan uboot image and this don't work either. Nothing is written to it..

Output of "mtdinfo":

Code:
root@rockpro64:/dev# mtdinfo
Count of MTD devices:           3
Present MTD devices:            mtd0, mtd1, mtd2
Sysfs interface supported:      yes

root@rockpro64:/dev# mtdinfo /dev/mtd0
mtd0
Name:                           loader
Type:                           nor
Eraseblock size:                4096 bytes, 4.0 KiB
Amount of eraseblocks:          1016 (4161536 bytes, 4.0 MiB)
Minimum input/output unit size: 1 byte
Sub-page size:                  1 byte
Character device major/minor:   90:0
Bad blocks are allowed:         false
Device is writable:             true

root@rockpro64:/dev# mtdinfo /dev/mtd1
mtd1
Name:                           env
Type:                           nor
Eraseblock size:                4096 bytes, 4.0 KiB
Amount of eraseblocks:          8 (32768 bytes, 32.0 KiB)
Minimum input/output unit size: 1 byte
Sub-page size:                  1 byte
Character device major/minor:   90:2
Bad blocks are allowed:         false
Device is writable:             true

root@rockpro64:/dev# mtdinfo /dev/mtd2
mtd2
Name:                           vendor
Type:                           nor
Eraseblock size:                4096 bytes, 4.0 KiB
Amount of eraseblocks:          64 (262144 bytes, 256.0 KiB)
Minimum input/output unit size: 1 byte
Sub-page size:                  1 byte
Character device major/minor:   90:4
Bad blocks are allowed:         false
Device is writable:             true


Output of dmesg:
Code:
root@rockpro64:/dev# dmesg | grep spi
[    2.015555] rockchip-spi ff1d0000.spi: Failed to request TX DMA channel
[    2.016160] rockchip-spi ff1d0000.spi: Failed to request RX DMA channel
[    2.016778] rockchip-spi ff1d0000.spi: no high_speed pinctrl state
[    2.017904] m25p80 spi32766.0: gd25q128 (16384 Kbytes)
[    2.018394] 3 ofpart partitions found on MTD device spi32766.0
[    2.018924] Creating 3 MTD partitions on "spi32766.0":
[  164.537097] m25p80 spi32766.0: flash operation timed out
[  204.537255] m25p80 spi32766.0: flash operation timed out
[  244.537347] m25p80 spi32766.0: flash operation timed out
[  284.537402] m25p80 spi32766.0: flash operation timed out
[  324.537509] m25p80 spi32766.0: flash operation timed out
[  364.537587] m25p80 spi32766.0: flash operation timed out


Thanks for any suggestions. This is really driving me nuts.. Any help will be appreciated.. :-)
#2
Hi! I have same issue.I tried all roms from https://github.com/ayufan-rock64/linux-build/releases

I found two solution:
1. https://github.com/ayufan-rock64/linux-u-boot/releases write image and do boot, spi will be writen, white led will blinking.
2. I was able to flash SPI using http://wiki.pine64.org/index.php/ROCKPro...htly_Build , do download files from first link in os
#3
Please use this image to write to spi.

https://github.com/ayufan-rock64/linux-u...o64.img.xz

Quick test


Code:
U-Boot SPL 2017.09-rockchip-ayufan-1035-gd646df03ac (Oct 26 2018 - 08:36:09)    
booted from SD                                                                  
Trying to boot from MMC2                                                        
NOTICE:  BL31: v1.3(debug):65aa5ce                                              
NOTICE:  BL31: Built : 10:47:37, Jun 19 2018                                    
NOTICE:  BL31: Rockchip release version: v1.1                                  
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    Using opteed sec cpu_context!                                          
INFO:    boot cpu mask: 0                                                      
INFO:    plat_rockchip_pmu_init(1151): pd status 3e                            
INFO:    BL31: Initializing runtime services                                    
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE iniK
ERROR:   Error initializing runtime service opteed_fast                        
INFO:    BL31: Preparing for EL3 exit to normal world                          
INFO:    Entry point address = 0x200000                                        
INFO:    SPSR = 0x3c9                                                          
                                                                               
                                                                               
U-Boot 2017.09-rockchip-ayufan-1035-gd646df03ac (Oct 26 2018 - 08:36:24 +0000)  
                                                                               
Model: Pine64 RockPro64                                                        
DRAM:  2 GiB                                                                    
DCDC_REG1@vdd_center: ; enabling                                                
DCDC_REG2@vdd_cpu_l: ; enabling                                                
DCDC_REG3@vcc_ddr: ; enabling (ret: -38)                                        
DCDC_REG4@vcc_1v8: set 1800000 uV; enabling                                    
LDO_REG1@vcc1v8_dvp: set 1800000 uV; enabling                                  
LDO_REG2@vcc3v0_touch: set 3000000 uV; enabling                                
LDO_REG3@vcc1v8_pmu: set 1800000 uV; enabling                                  
LDO_REG4@vcc_sd: set 3300000 uV; enabling                                      
LDO_REG5@vcca3v0_codec: set 3000000 uV; enabling                                
LDO_REG6@vcc_1v5: set 1500000 uV; enabling                                      
LDO_REG7@vcca1v8_codec: set 1800000 uV; enabling                                
LDO_REG8@vcc_3v0: set 3000000 uV; enabling                                      
SWITCH_REG1@vcc3v3_s3: ; enabling (ret: -38)                                    
SWITCH_REG2@vcc3v3_s0: ; enabling (ret: -38)                                    
vcc1v8-s0@vcc1v8_s0: set 1800000 uV; enabling (ret: -38)                        
dc-12v@dc_12v: set 12000000 uV; enabling (ret: -38)                            
vcc-sys@vcc_sys: set 5000000 uV; enabling (ret: -38)                            
vcc3v3-sys@vcc3v3_sys: set 3300000 uV; enabling (ret: -38)                      
vcc-phy-regulator@vcc_phy: ; enabling (ret: -38)                                
vdd-log@vdd_log: ; enabling (ret: -38)                                          
MMC:   sdhci@fe330000: 0, dwmmc@fe320000: 1                                    
SF: Detected gd25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB  
*** Warning - bad CRC, using default environment                                
                                                                               
In:    serial@ff1a0000                                                          
Out:   serial@ff1a0000                                                          
Err:   serial@ff1a0000                                                          
Model: Pine64 RockPro64                                                        
Net:   eth0: ethernet@fe300000                                                  
Hit any key to stop autoboot:  0                                                
Card did not respond to voltage select!                                        
mmc_init: -95, time 19                                                          
switch to partitions #0, OK                                                    
mmc1 is current device                                                          
Scanning mmc 1:2...                                                            
Found U-Boot script /boot.scr                                                  
reading /boot.scr                                                              
827 bytes read in 3 ms (268.6 KiB/s)                                            
## Executing script at 00500000                                                
SF: Detected gd25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB  
reading rkspi_loader.img                                                        
1461372 bytes read in 156 ms (8.9 MiB/s)                                        
SF: 4194304 bytes @ 0x0 Erased: OK                                              
device 0 offset 0x0, size 0x164c7c                                              
SF: 1461372 bytes @ 0x0 Written: OK          


And please use image for rockpro64 Exclamation
Sorry for any mistakes. English is not my native language

1. RP64 v2.1 / PCIe SATA JMS585 Chipsatz / Booting from an 2,5 Zoll SSD on port 5/ 2 * 3,5 Zoll 4TB HDD (raid1) md0 / 2 * 2,5 Zoll 2TB HDD (raid1) md1 / using as NAS / Kernel 5.6.0-1137-ayufan-ge57f05e7bf8f

2. RP64 v2.1 / testing.....testing....testing 

https://forum.frank-mankel.org/category/14/rockpro64


Possibly Related Threads…
Thread Author Replies Views Last Post
  Device unable to boot Lunix33 1 111 Yesterday, 03:18 AM
Last Post: LMM
  First boot - no fan, no display... is it broken? rantoie 1 273 04-28-2021, 04:41 PM
Last Post: rantoie
  Mainline U-Boot with SPI, NVMe and SATA boot support sigmaris 82 39,471 04-26-2021, 04:09 AM
Last Post: Maxpako
  PXE boot - unable to login LMM 2 389 04-22-2021, 02:59 PM
Last Post: LMM
  unable to boot from SDCard Charles Tarkowski 4 1,180 12-16-2020, 11:11 AM
Last Post: Charles Tarkowski
  Rockpro64 boot issues larsgn 14 7,550 10-21-2020, 07:54 AM
Last Post: quinterro
  RockPro64 eMMC boot euu 4 2,890 08-24-2020, 11:07 PM
Last Post: t4_4t
  RockPro64 so problematic! Boot issues PorterDon 1 1,487 06-04-2020, 12:25 PM
Last Post: dukla2000
  Failure to boot atcwells 1 1,320 05-10-2020, 03:06 PM
Last Post: atcwells
  RockPro 64 V2.1 Boot problem only DDR Version ... message nutilius 5 2,611 05-02-2020, 03:26 AM
Last Post: freeviv

Forum Jump:


Users browsing this thread: 1 Guest(s)