PINE64
Not able to write u-boot to SPI - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: ROCKPRO64 (https://forum.pine64.org/forumdisplay.php?fid=98)
+--- Forum: General Discussion on ROCKPRO64 (https://forum.pine64.org/forumdisplay.php?fid=99)
+--- Thread: Not able to write u-boot to SPI (/showthread.php?tid=6720)



Not able to write u-boot to SPI - Jix0 - 10-29-2018

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?tid=6508&pid=40677&highlight=flash_erase#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.. :-)


RE: Not able to write u-boot to SPI - lybin - 11-13-2018

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/ROCKPro64_Software_Release#LibreELEC_Nightly_Build , do download files from first link in os


RE: Not able to write u-boot to SPI - Bullet64 - 11-13-2018

Please use this image to write to spi.

https://github.com/ayufan-rock64/linux-u-boot/releases/download/2017.09-rockchip-ayufan-1035-gd646df03ac/u-boot-flash-spi-rockpro64.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