zador.blood.stained Posted January 20, 2017 Posted January 20, 2017 I think I made a perfect device for people who have problems with SD cards on H3 Orange Pi or similar Allwinner based boards. Or for people who just hate the SD cards Why using a SD card if you can use your favorite USB flash drive instead with a small addon board that can be attached to the "RPi compatible" pin header? Ready to boot: As a bonus - no modifications required for the recent Armbian images. Console log for an example: U-Boot SPL 2017.01-armbian (Jan 20 2017 - 11:15:53) DRAM: 512 MiB Trying to boot from sunxi SPI U-Boot 2017.01-armbian (Jan 20 2017 - 11:15:53 +0100) Allwinner Technology CPU: Allwinner H3 (SUN8I 1680) Model: Xunlong Orange Pi Zero DRAM: 512 MiB MMC: SUNXI SD/MMC: 0 MMC: no card present *** Warning - MMC init failed, using default environment In: serial Out: serial Err: serial Net: phy interface0 eth0: ethernet@1c30000 Hit any key to stop autoboot: 0 MMC: no card present ** Bad device mmc 0 ** MMC: no card present ** Bad device mmc 0 ** There is no valid bmp file at the given address MMC: no card present starting USB... USB0: USB EHCI 1.00 USB1: USB OHCI 1.0 scanning bus 0 for devices... 2 USB Device(s) found USB device 0: Device 0: Vendor: JetFlash Rev: 1100 Prod: Transcend 8GB Type: Removable Hard Disk Capacity: 7532.0 MB = 7.3 GB (15425536 x 512) ... is now current device Scanning usb 0:1... Found U-Boot script /boot/boot.scr 2352 bytes read in 213 ms (10.7 KiB/s) ## Executing script at 43100000 U-boot loaded from SPI Boot script loaded from usb 123 bytes read in 147 ms (0 Bytes/s) 4479875 bytes read in 415 ms (10.3 MiB/s) 5047312 bytes read in 450 ms (10.7 MiB/s) ** File not found /boot/.next ** ** File not found .next ** 34704 bytes read in 528 ms (63.5 KiB/s) ## Loading init Ramdisk from Legacy Image at 43300000 ... Image Name: uInitrd Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 4479811 Bytes = 4.3 MiB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK Using machid 0x1029 from environment Starting kernel ... [sun8i_fixup]: From boot, get meminfo: Start: 0x40000000 Size: 512MB ion_carveout reserve: 160m@0 256m@0 130m@1 200m@1 ion_reserve_select: ion chipid [0x2c00081! ion_reserve_common: ion reserve: [0x56000000, 0x60000000]! <5Loading, please wait... starting version 229 Begin: Loading essential drivers ... done. Begin: Running /scripts/init-premount ... done. Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done. Begin: Running /scripts/local-premount ... Scanning for Btrfs filesystems done. Begin: Will now check root file system ... fsck from util-linux 2.27.1 [/sbin/fsck.ext4 (1) -- /dev/sda1] fsck.ext4 -a -C0 /dev/sda1 /dev/sda1: clean, 46813/74240 files, 207741/296448 blocks done. done. Begin: Running /scripts/local-bottom ... done. Begin: Running /scripts/init-bottom ... done. Welcome to Ubuntu 16.04.1 LTS! [ OK ] Listening on udev Control Socket. [ OK ] Created slice System Slice. [ OK ] Listening on /dev/initctl Compatibility Named Pipe. [ OK ] Listening on Journal Socket (/dev/log). [ OK ] Reached target Swap. [ OK ] Reached target Encrypted Volumes. [ OK ] Created slice system-serial\x2dgetty.slice. [ OK ] Listening on fsck to fsckd communication Socket. [ OK ] Listening on Journal Audit Socket. [ OK ] Listening on udev Kernel Socket. [ OK ] Listening on Journal Socket. Mounting POSIX Message Queue File System... Starting Restore / save the current clock... Starting Nameserver information manager... Starting Load Kernel Modules... [ OK ] Created slice User and Session Slice. [ OK ] Reached target Slices. Starting Create list of required st... nodes for the current kernel... [ OK ] Started Dispatch Password Requests to Console Directory Watch. [ OK ] Started Forward Password Requests to Wall Directory Watch. [ OK ] Set up automount Arbitrary Executab...ats File System Automount Point. [ OK ] Listening on Syslog Socket. Starting Remount Root and Kernel File Systems... Starting Set console keymap... [ OK ] Reached target Remote File Systems (Pre). [ OK ] Reached target Remote File Systems. Mounting Debug File System... [ OK ] Mounted POSIX Message Queue File System. [ OK ] Mounted Debug File System. [ OK ] Started Restore / save the current clock. [ OK ] Started Load Kernel Modules. [ OK ] Started Create list of required sta...ce nodes for the current kernel. [ OK ] Started Remount Root and Kernel File Systems. [ OK ] Started Set console keymap. [ OK ] Started Nameserver information manager. Starting Load/Save Random Seed... Starting udev Coldplug all Devices... Starting Create Static Device Nodes in /dev... Starting Apply Kernel Variables... Mounting FUSE Control File System... [ OK ] Started Load/Save Random Seed. [ OK ] Started Create Static Device Nodes in /dev. [ OK ] Started Apply Kernel Variables. [ OK ] Mounted FUSE Control File System. [ OK ] Started udev Coldplug all Devices. [ OK ] Reached target Local File Systems (Pre). Mounting /tmp... Starting udev Kernel Device Manager... [ OK ] Mounted /tmp. [ OK ] Reached target Local File Systems. Starting Raise network interfaces... Starting Armbian enhanced Log2Ram... Starting Set console font and keymap... [ OK ] Started Entropy daemon using the HAVEGE algorithm. Starting Journal Service... [ OK ] Started udev Kernel Device Manager. [ OK ] Started Armbian enhanced Log2Ram. [ OK ] Started Journal Service. [ OK ] Found device /dev/ttyGS0. [ OK ] Found device /dev/ttyS0. [ OK ] Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch. [ OK ] Reached target Sound Card. Starting Flush Journal to Persistent Storage... Starting Load/Save RF Kill Switch Status... [ OK ] Started Flush Journal to Persistent Storage. [ OK ] Started Load/Save RF Kill Switch Status. Starting Create Volatile Files and Directories... [ OK ] Started Raise network interfaces. [ OK ] Started Create Volatile Files and Directories. [ OK ] Stopped LSB: Starts LIRC daemon.. Starting LSB: Starts LIRC daemon.... Starting Update UTMP about System Boot/Shutdown... [ OK ] Reached target System Time Synchronized. [ OK ] Started Update UTMP about System Boot/Shutdown. [ OK ] Started LSB: Starts LIRC daemon.. [ OK ] Reached target System Initialization. [ OK ] Started Daily Cleanup of Temporary Directories. Starting Armbian filesystem resize service... [ OK ] Listening on D-Bus System Message Bus Socket. [ OK ] Reached target Sockets. [ OK ] Started Daily apt activities. [ OK ] Reached target Timers. [ OK ] Reached target Paths. Stopping LSB: Starts LIRC daemon.... [ OK ] Stopped LSB: Starts LIRC daemon.. Starting LSB: Starts LIRC daemon.... [ OK ] Started LSB: Starts LIRC daemon.. [ OK ] Started Armbian filesystem resize service. [ OK ] Reached target Basic System. Starting System Logging Service... Starting LSB: Load kernel modules needed to enable cpufreq scaling... [ OK ] Started Armbian first run tasks. Starting Permit User Sessions... [ OK ] Started Regular background program processing daemon. Starting LSB: Start/stop sysstat's sadc... Starting Save/Restore Sound Card State... Starting Login Service... Starting LSB: Armbian gathering hardware information... [ OK ] Started D-Bus System Message Bus. Starting Network Manager... [ OK ] Started System Logging Service. [ OK ] Started Permit User Sessions. [ OK ] Started Save/Restore Sound Card State. [ OK ] Started LSB: Load kernel modules needed to enable cpufreq scaling. [ OK ] Started LSB: Start/stop sysstat's sadc. [ OK ] Started Network Manager. [ OK ] Started Login Service. Starting Network Manager Script Dispatcher Service... [ OK ] Reached target Network. Starting OpenBSD Secure Shell server... Starting Network Manager Wait Online... Starting LSB: set CPUFreq kernel parameters... Starting Set console scheme... [ OK ] Started OpenBSD Secure Shell server. [ OK ] Started Set console scheme. [ OK ] Started Network Manager Script Dispatcher Service. Starting Hostname Service... [ OK ] Started LSB: set CPUFreq kernel parameters. [ OK ] Started Hostname Service. Starting LSB: Set sysfs variables from /etc/sysfs.conf... [FAILED] Failed to start Set console font and keymap. See 'systemctl status console-setup.service' for details. [ OK ] Created slice system-getty.slice. [ OK ] Started LSB: Set sysfs variables from /etc/sysfs.conf. Starting WPA supplicant... Starting Authenticate and Authorize Users to Run Privileged Tasks... [ OK ] Started LSB: Armbian gathering hardware information. [ OK ] Started WPA supplicant. [ OK ] Started Authenticate and Authorize Users to Run Privileged Tasks. [ OK ] Started Network Manager Wait Online. [ OK ] Reached target Network is Online. Starting /etc/rc.local Compatibility... Starting LSB: Advanced IEEE 802.11 management daemon... Starting LSB: disk temperature monitoring daemon... Starting LSB: Start NTP daemon... [ OK ] Started /etc/rc.local Compatibility. [ OK ] Started LSB: Advanced IEEE 802.11 management daemon. [ OK ] Started Serial Getty on ttyGS0. [ OK ] Started Getty on tty1. [ OK ] Started Serial Getty on ttyS0. [ OK ] Reached target Login Prompts. [ OK ] Started LSB: disk temperature monitoring daemon. [ OK ] Started LSB: Start NTP daemon. [ OK ] Reached target Multi-User System. [ OK ] Reached target Graphical Interface. Starting Update UTMP about System Runlevel Changes... [ OK ] Started Update UTMP about System Runlevel Changes. Ubuntu 16.04.1 LTS orangepilite ttyS0 orangepilite login: I wonder if any Chinese manufacturer can pick this idea and make a small batch of similar devices? 1
borombo Posted January 20, 2017 Posted January 20, 2017 can you please give more detailes. how it works and the pcb scheme
zador.blood.stained Posted January 20, 2017 Author Posted January 20, 2017 can you please give more detailes. how it works and the pcb scheme https://linux-sunxi.org/Bootable_SPI_flash I don't think this needs any schematics, it's just an SPI flash with a bypass capacitor and a Write Protect jumper (optional) wired to the 2x4 2.54mm header. Wiki gives enough details on hardware implementation, and as for software - mainline u-boot can be loaded from the SPI flash, and if it fails to boot the system from SD it will try USB next (though if you have more than 1 USB storage devices attached it will need extra modifications). Armbian boot script in recent images can handle USB boot scenario well, so it works out of the box. 2
martinayotte Posted January 21, 2017 Posted January 21, 2017 Hi Zador, I've done such small piggyback adaptor for SPI-NOR during my SPI-Boot works, it is currently attached on my Pine64. I get access to it thru Python, but I didn't rebuilt Pine64 U-Boot since few weeks. I should probalby do, and therefore been able to boot from USB ... BTW, did you saw that APriztel offically submitted his patches for A64 ? (I'm still stuggling them along with ATF for H5, I will email him later)
zador.blood.stained Posted January 21, 2017 Author Posted January 21, 2017 BTW, did you saw that APriztel offically submitted his patches for A64 ? (I'm still stuggling them along with ATF for H5, I will email him later) Yes, I'm monitoring the linux-sunxi google group. At this stage I don't see any reason to rush with A64/H5 mainline support - this implementation is still being discussed and things may change in the future.
Recommended Posts