Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

problems getting a banana pi to boot off a hard disk (long)



It's a while since I did any work on a banana pi, so I thought I would try and 
bring up NetBSD -9 on a BPI-M1.

I made a bootable sdcard following the instructions at:

https://wiki.netbsd.org/ports/evbarm/install_using_sysinst/

and everything came up as expected on a serial console:

U-Boot 2018.11nb4 (Jan 09 2020 - 23:39:22 +0000) Allwinner Technology                                                                                                              

CPU:   Allwinner A20 (SUN7I)                                                                                                                                                       
Model: LeMaker Banana Pi                                                                                                                                                           
I2C:   ready                                                                                                                                                                       
DRAM:  1 GiB                                                                                                                                                                       
MMC:   SUNXI SD/MMC: 0                                                                                                                                                             
Loading Environment from FAT... *** Warning - bad CRC, using default 
environment                                                                                                   

Setting up a 720x576i composite-pal console (overscan 32x20)                                                                                                                       
In:    serial                                                                                                                                                                      
Out:   vga                                                                                                                                                                         
Err:   vga                                                                                                                                                                         
SCSI:  Target spinup took 0 ms.                                                                                                                                                    
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode                                                                                                                          
flags: ncq stag pm led clo only pmp pio slum part ccc apst                                                                                                                         

Net:   eth0: ethernet@1c50000                                                                                                                                                      
starting USB...                                                                                                                                                                    
USB0:   USB EHCI 1.00                                                                                                                                                              
USB1:   USB OHCI 1.0                                                                                                                                                               
USB2:   USB EHCI 1.00                                                                                                                                                              
USB3:   USB OHCI 1.0                                                                                                                                                               
scanning bus 0 for devices... 1 USB Device(s) found                                                                                                                                
scanning bus 2 for devices... 1 USB Device(s) found                                                                                                                                
       scanning usb for storage devices... 0 Storage Device(s) found                                                                                                               
Hit any key to stop autoboot:  0                                                                                                                                                   
switch to partitions #0, OK                                                                                                                                                        
mmc0 is current device                                                                                                                                                             
Scanning mmc 0:1...                                                                                                                                                                
Found U-Boot script /boot.scr                                                                                                                                                      
201 bytes read in 5 ms (39.1 KiB/s)                                                                                                                                                
## Executing script at 43100000                                                                                                                                                    
switch to partitions #0, OK                                                                                                                                                        
mmc0 is current device                                                                                                                                                             
Scanning mmc 0:1...                                                                                                                                                                
43768 bytes read in 19 ms (2.2 MiB/s)                                                                                                                                              
Found EFI removable media binary efi/boot/bootarm.efi                                                                                                                              
Scanning disks on scsi...                                                                                                                                                          
Disk scsi0 not ready                                                                                                                                                               
Scanning disks on usb...                                                                                                                                                           
Disk usb0 not ready                                                                                                                                                                
Disk usb1 not ready                                                                                                                                                                
Disk usb2 not ready                                                                                                                                                                
Disk usb3 not ready                                                                                                                                                                
Scanning disks on mmc...                                                                                                                                                           
MMC Device 1 not found                                                                                                                                                             
MMC Device 2 not found                                                                                                                                                             
MMC Device 3 not found                                                                                                                                                             
Found 3 disks                                                                                                                                                                      
185456 bytes read in 24 ms (7.4 MiB/s)                                                                                                                                             
## Starting EFI application at 42000000 ...                                                                                                                                        

NetBSD/evbarm efiboot (arm), Revision 1.13 (Fri Feb 14 00:06:28 UTC 2020)                                                                                                       
Press return to boot now, any other key for boot prompt                                                                                                                            
booting netbsd - starting in 0 seconds.                                                                                                                                            
6727912+2096344+1393448 [482678+457680+477547]=0xb1e94c                                                                                                                            
EHCI failed to shut down host controller.                                                                                                                                          
EHCI failed to shut down host controller.                                                                                                                                          
[   1.0000000] NetBSD/evbarm (fdt) booting ...                                                                                                                                     
[   1.0000000] [ Kernel symbol table missing! ]                                                                                                                                    
[   1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 
2004, 2005,                                                                                           
[   1.0000000]     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 
2016, 2017,                                                                                         
[   1.0000000]     2018, 2019, 2020 The NetBSD Foundation, Inc.  All rights 
reserved.                                                                                              
[   1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993                                                                                                                          
[   1.0000000]     The Regents of the University of California.  All rights 
reserved.                                                                                              

[   1.0000000] NetBSD 9.0 (GENERIC) #0: Fri Feb 14 00:06:28 UTC 2020                                                                                                               

...


The uboot script seemed a bit strange - things have changed over the last few 
years and I wasn't sure what the efi boot process was, but it seemed to work 
OK.

I decided to attach a SATA disk and get the system to boot from this. 

Tried to use sysinst to do a custom partition of the disk and found a few 
problems with sysinst getting confused in the partitioning process (will file 
a send-pr later). In the end I manually partitioned and newfs'ed the disk, 
created an fstab table and let sysinst install the software. I then copied to 
boot stuff over from the sdcard to /boot (dos) and used fdisk to mark the dos 
and netbsd areas in the partition table.

armv7# mbrlabel wd0
Found MSDOS partition; size 131072 (64 MB), offset 2048
  skipping overlapping 4.2BSD partition at slot a.
Found 4.2BSD partition; size 524288 (256 MB), offset 133120
  skipping overlapping 4.2BSD partition at slot a.

7 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:    512000    130048     4.2BSD      0     0     0  # (Cyl.    129*-    
636*)
 b:   4096000    642048       swap                     # (Cyl.    636*-   
4700*)
 c: 1953525168         0     unused      0     0        # (Cyl.      0 - 
1938020)
 d:    128000      2048      MSDOS                     # (Cyl.      2*-    
129*)
 e: 819200000  41602048     4.2BSD      0     0     0  # (Cyl.  41271*- 
853970*)
 f:  16384000 860802048     4.2BSD      0     0     0  # (Cyl. 853970*- 
870224*)
 g: 1076339120 877186048     4.2BSD      0     0     0  # (Cyl. 870224*- 
1938020)

So far everything looked OK and I just needed to persuade the u-boot system to 
use the hard disk (wd0) rather than the sdcard (ld0). The document above edits 
the boot.cmd file and generates a boot.scr file. So I tried using a boot.cmd 
file with:

scsi scan
scsi dev 0
setenv kernel netbsd-GENERIC.ub
fatload scsi 0:1 82000000 $kernel
bootm 82000000 root=wd0a console=fb

and then  

mkubootimage -A arm -n armv7 -T script boot.cmd boot.scr

I copied the both files to the boot partition on the hard disk (and the 
sdcard).

Rebooting the system:

U-Boot SPL 2018.11 (Jan 09 2020 - 23:39:22 +0000)                                                                                                                                  
DRAM: 1024 MiB                                                                                                                                                                     
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2                                                                                                                                               
Trying to boot from MMC1                                                                                                                                                           


U-Boot 2018.11nb4 (Jan 09 2020 - 23:39:22 +0000) Allwinner Technology                                                                                                              

CPU:   Allwinner A20 (SUN7I)                                                                                                                                                       
Model: LeMaker Banana Pi                                                                                                                                                           
I2C:   ready                                                                                                                                                                       
DRAM:  1 GiB                                                                                                                                                                       
MMC:   SUNXI SD/MMC: 0                                                                                                                                                             
Loading Environment from FAT... *** Warning - bad CRC, using default 
environment                                                                                                   

Setting up a 720x576i composite-pal console (overscan 32x20)                                                                                                                       
In:    serial                                                                                                                                                                      
Out:   vga                                                                                                                                                                         
Err:   vga                                                                                                                                                                         
SCSI:  Target spinup took 0 ms.                                                                                                                                                    
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode                                                                                                                          
flags: ncq stag pm led clo only pmp pio slum part ccc apst                                                                                                                         

Net:   eth0: ethernet@1c50000                                                                                                                                                      
starting USB...                                                                                                                                                                    
USB0:   USB EHCI 1.00                                                                                                                                                              
USB1:   USB OHCI 1.0                                                                                                                                                               
USB2:   USB EHCI 1.00                                                                                                                                                              
USB3:   USB OHCI 1.0                                                                                                                                                               
scanning bus 0 for devices... 1 USB Device(s) found                                                                                                                                
scanning bus 2 for devices... 1 USB Device(s) found                                                                                                                                
       scanning usb for storage devices... 0 Storage Device(s) found                                                                                                               
Hit any key to stop autoboot:  0                                                                                                                                                   
switch to partitions #0, OK                                                                                                                                                        
mmc0 is current device                                                                                                                                                             
Scanning mmc 0:1...                                                                                                                                                                
Found U-Boot script /boot.scr                                                                                                                                                      
195 bytes read in 5 ms (38.1 KiB/s)                                                                                                                                                
## Executing script at 43100000                                                                                                                                                    
scanning bus for devices...                                                                                                                                                        
  Device 0: (0:0) Vendor: ATA Prod.: WDC WD10JPVX-60J Rev: 02.0                                                                                                                    
            Type: Hard Disk                                                                                                                                                        
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)                                                                                                                    
Found 1 device(s).                                                                                                                                                                 

Device 0: (0:0) Vendor: ATA Prod.: WDC WD10JPVX-60J Rev: 02.0                                                                                                                      
            Type: Hard Disk                                                                                                                                                        
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)                                                                                                                    
... is now current device                                                                                                                                                          
8846552 bytes read in 431 ms (19.6 MiB/s)                                                                                                                                          
## Booting kernel from Legacy Image at 82000000 ...                                                                                                                                
   Image Name:   NetBSD/earmv7hf 9.0                                                                                                                                               
   Image Type:   ARM Linux Kernel Image (no loading done) (uncompressed)                                                                                                           
   Data Size:    8846488 Bytes = 8.4 MiB                                                                                                                                           
   Load Address: 00000000                                                                                                                                                          
   Entry Point:  00000000                                                                                                                                                          
   Verifying Checksum ... OK                                                                                                                                                       
Wrong Ramdisk Image Format                                                                                                                                                         
Ramdisk image is corrupt or invalid                                                                                                                                                
SCRIPT FAILED: continuing...                                                                                                                                                       
43768 bytes read in 19 ms (2.2 MiB/s)                                                                                                                                              
Found EFI removable media binary efi/boot/bootarm.efi                                                                                                                              
Scanning disks on scsi...                                                                                                                                                          
Scanning disks on usb...                                                                                                                                                           
Disk usb0 not ready                                                                                                                                                                
Disk usb1 not ready                                                                                                                                                                
Disk usb2 not ready                                                                                                                                                                
Disk usb3 not ready                                                                                                                                                                
Scanning disks on mmc...                                                                                                                                                           
MMC Device 1 not found                                                                                                                                                             
MMC Device 2 not found                                                                                                                                                             
MMC Device 3 not found                                                                                                                                                             
Found 6 disks                                                                                                                                                                      
185456 bytes read in 24 ms (7.4 MiB/s)                                                                                                    
## Starting EFI application at 42000000 ...    

(at this point the system boots off the sdcard)


So clearly there is something wrong with the kernel image - yet this 
boots OK from the sdcard and the image on the hard disk is identical - so some 
other magic is needed. What's the efiboot bit? Can someone enlighten me as to 
what I need to do...

Cheers,
Dave

                                                                                                                                    



Home | Main Index | Thread Index | Old Index