Notes on edison support (currently not working)
Alexander Sack
asac at canonical.com
Thu May 7 22:22:08 UTC 2015
On Thu, May 7, 2015 at 3:04 AM, Loïc Minier <loic.minier at ubuntu.com> wrote:
> Hi,
>
> I've tried enabling the Edison; haven't succeeded so far, but thought I'd
> share my latest status in case someone wants to help or pick it up. (Help
> welcome!)
>
> == Overview of Edison boot ==
>
> 0) plug micro USB and connect with screen to see boot sequence
>
> 1) boot ROM loads firmware from eMMC; if firmware isn't found, an USB load
> is attempted
>
> ******************************
> PSH KERNEL VERSION: b0182727
> WR: 20104000
> ******************************
>
> SCU IPC: 0x800000d0 0xfffce92c
>
> PSH miaHOB version: TNG.B0.VVBD.0000000c
>
> microkernel built 23:15:13 Apr 24 2014
>
> ******* PSH loader *******
> PCM page cache size = 192 KB
> Cache Constraint = 0 Pages
> Arming IPC driver ..
> Adding page store pool ..
> PagestoreAddr(IMR Start Address) = 0x04899000
> pageStoreSize(IMR Size) = 0x00080000
>
> *** Ready to receive application ***
>
> 2) firmware loads u-boot
>
> U-Boot 2014.04 (Aug 20 2014 - 16:08:32)
>
> Watchdog enabled
> DRAM: 980.6 MiB
> MMC: tangier_sdhci: 0
> In: serial
> Out: serial
> Err: serial
> Hit any key to stop autoboot: 0
>
> 3) u-boot default config will attempt a flash over USB (via dfu-util) then
> fallback to booting from eMMC.
>
> U-Boot also offers some manual commands to trigger an OTA update from a
> special partition which you can mount from your host (via USB gadget driver)
> when the device boot it's default Yocto/Poky rootfs
>
> 4) Yocto loads and offers a console on USB serial
>
> == Target installation to eMMC and intermediate installation to micro SD ==
>
> Ideally, snappy would be running of the eMMC but the partitions / available
> space are too small.
I would have thought we put our system-boot partition on emmc and then
the system-a/b partitions just live on "super comfortable" USB or SD
storage that we can easily manage once our kernel with modules are up
and running!
Cant we repartition that emmc so that we get our system-boot partition
on it as a whole?
>
> However, the eMMC partitions are defined when flashing the initial Edison
> image. To change this, it's possible to rebuild Yocto/Poky from sources;
> this takes about 30G of space and half a day. The output are the files you'd
> write to the eMMC over USB to reflash. This describes the process:
> http://fr.slideshare.net/FantomJAC/how-to-hack-edison
Is the part that we need to do that flashing open source? e.g. is
there a need to build the whole thing just to get the ability to flash
the emmc with our preferred layout and sizing?
>
> So a nicer intermediate step, especially during development, would be to
> boot from external micro SD. Unfortunately, U-Boot doesn't support the
> external SD, only the eMMC.
Maybe we can boot from USB storage given that u-boot knows enough to
flash from USB?
>
> My next bet was to extract target kernels and initrd from a snappy micro SD,
> copy these to eMMC by hand, then use u-boot to launch snappy from micro SD.
> Because U-Boot only supports FAT and not ext4, I've looked for a
> sufficiently large partition to hold my kernel and initrd (the one where the
> Yocto vmlinuz resided was too small even for my own kernel).
>
> I settled on the update partition which is a disk image (with a FAT
> partition in that disk image) as to be exposed via the gadget driver to USB.
> I had to format it to be a plain partition rather than a disk image with a
> partition table and a partition. To do this, run the following from a booted
> Yocto:
> mkfs.vfat -F32 -I /dev/mmcblk0p9
> (then mount /dev/mmcblk0p9 as you please; the micro SD is at /dev/mmcblk1p*)
>
> This could work, but currently fails to boot (see below).
>
> == Current state of snappy bits ==
>
> First, I generated an i386 snappy image starting from the generic-amd64 OEM
> snap and creating my own local generic-i386 snap; it's at:
> http://people.canonical.com/~lool/generic-i386_1.1.1_all.snap
> I guess we should have an official i386 OEM snap, or I should upload an
> unofficial one.
>
> Then I created a 15.04 image with:
> sudo ubuntu-device-flash core 15.04 --channel edge --oem
> generic-i386_1.1.1_all.snap --developer-mode --output x86.img
> and wrote it to micro SD.
>
> I mounted this micro SD from Edison's Yocto install, copied the bits to the
> newly formatted update partition and tried booting this, but I get no
> output:
> ================
> boot > setenv bootargs earlyprintk=ttyMFD2 root=/dev/disk/by-label/system-a
> console=ttyMFD2 init=/lib/systemd/systemd ro
> boot > fatload mmc 0:9 0x100000 vmlinuz
> reading vmlinuz
> 6239536 bytes read in 154 ms (38.6 MiB/s)
> boot > zboot 0x100000
> Valid Boot Flag
> Setup Size = 0x00004400
> Magic signature found
> Using boot protocol version 2.0d
> Linux kernel version 3.19.0-16-generic (buildd at phianna) #16-Ubuntu SMP Thu
> Apr 30 16:13:00 UTC 2015
> Building boot_params at 0x00090000
> Loading bzImage at address 00100000 (6222128 bytes)
> Magic signature found
> Kernel command line: "earlyprintk=ttyMFD2 root=/dev/disk/by-label/system-a
> console=ttyMFD2 init=/lib/systemd/systemd ro"
guess doesnt matter, but why didn't you load our initrd for this variant?
>
> Starting kernel ...
> ================
>
> so I reverted to Edison Yocto kernel + our initrd (our initrd is required to
> setup the proper mounts).
>
> I had to recompress our initrd with gzip instead of xz as xz compression is
> not enabled in the Edison kernel. This does produce output, but fails
> without a clean error message; also note I had to pass ramdisk_size in
> bootargs and compute sizes by hand:
> fatload mmc 0:7 0x100000 vmlinuz
> fatload mmc 0:9 0x8100000 initrd-gz
> zboot 0x100000 5124192 0x8100000 19333091
> =================
> Using boot protocol version 2.0c
> Linux kernel version 3.10.17-poky-edison+ (sys_dswci at ncsndgbuild04) #1 SMP
> PREEM
> PT Wed Aug 20 16:09:18 CEST 2014
> Building boot_params at 0x00090000
> Loading bzImage at address 00100000 (5108832 bytes)
> Magic signature found
> Initial RAM disk at linear address 0x08100000, size 422785169 bytes
> Kernel command line: "earlyprintk=ttyMFD2 root=/dev/disk/by-label/system-a
> console=ttyMFD2 init=/lib/systemd/systemd ro ramdisk_size=50000"
>
> Starting kernel ...
>
> [ 0.000000] Initializing cgroup subsys cpuset
> [ 0.000000] Initializing cgroup subsys cpu
> [ 0.000000] Initializing cgroup subsys cpuacct
> [ 0.000000] Linux version 3.10.17-poky-edison+ (sys_dswci at ncsndgbuild04)
> (gcc version 4.8.2 (GCC) ) #1 SMP PREEMPT Wed Aug 20 16:09:18 CEST 2014
> [ 0.000000] e820: BIOS-provided physical RAM map:
> [...]
> [ 0.000000] Kernel command line: earlyprintk=ttyMFD2
> root=/dev/disk/by-label/
> system-a console=ttyMFD2 init=/lib/systemd/systemd ro ramdisk_size=19333091
> [...]
> [ 0.505057] Trying to unpack rootfs image as initramfs...
> [ 2.671179] rootfs image is not initramfs (junk in compressed archive);
> looks
> like an initrd
> [ 3.627260] Freeing initrd memory: 412880k freed
> [...]
> [ 7.271674] RAMDISK: gzip image found at block 0
> [ 7.619697] mmc2: queuing unknown CIS tuple 0x91 (3 bytes)
> [ 7.625144] mmc2: new ultra high speed DDR50 SDIO card at address 0001
> [ 9.966756] List of all partitions:
> [ 9.970252] b300 3817472 mmcblk0 driver: mmcblk
> [ 9.970350] b301 2048 mmcblk0p1
> d117f98e-6f2c-d04b-a5b2-331a19f91cb2
> [ 9.970444] b302 1024 mmcblk0p2
> 25718777-d0ad-7443-9e60-02cb591c9737
> [ 9.970535] b303 2048 mmcblk0p3
> 8a4bb8b4-e304-ae48-8536-aff5c9c495b1
> [ 9.970624] b304 1024 mmcblk0p4
> 08992135-13c6-084b-9322-3391ff571e19
> [ 9.970714] b305 1024 mmcblk0p5 333a128
> =================
> I suspect my initramfs is not unpacked properly; not sure how to fix that.
>
>
> Help is welcome on the kernel output and on the initramfs issue! :-)
also most likely not helpful, but maybe you just did a mistake
repacking the initramfs as gzip? Have you tried manually unpacking it
to double check?
>
>
> == Recovering from a broken bootloader ==
>
> To reflash a broken u-boot, you will need to reflash the firmware then
> reflash u-boot + system; this should a simple matter of running flash-all.sh
> from the Intel downloads, but you need a special tool to send the firmware
> over USB:
> http://sourceforge.net/projects/xfstk/files/
>
>
> Cheers,
> --
> Loïc
Thanks for this report!
>
> --
> snappy-devel mailing list
> snappy-devel at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/snappy-devel
>
More information about the snappy-devel
mailing list