IRC log of #cubox of Sat 11 Nov 2017. All times are in CET < Back to index

13:33 vpeter> Is it possible to upgrade lede on sd card for clearfog pro?
16:09 topi`> I've now cloned u-boot from solidrun's repo, how do I configure it for the HB? make imx6_defconfig or something similar?
16:11 topi`> hmm, there is mx6_cuboxi.defconfig
16:20 topi`> ok it compiled. I wonder what "uboot.bin" contains... it is not an ELF executable
16:24 topi`> objdump reveals the .bin begins with 0xea0000be which is unconditional branch
16:24 topi`> so I guess SPL can jump into that binary directly, to offset #0
16:24 wumpus> dunno, probably the raw format expected by the board?
16:25 Ke> it seems to me that most first level bootloaders do want some signature
16:25 Ke> or bootroms
16:25 Ke> I guess 0th level
17:30 vpeter> topi`: https://stackoverflow.com/questions/29494321/what-is-diffrent-between-u-boot-bin-and-u-boot-img
17:32 topi`> hm, my SPL wasn't very successful at loading uboot:
17:32 topi`> U-Boot SPL 2017.11-rc2-01361-g341dafe (Nov 11 2017 - 10:31:54)
17:32 topi`> Trying to boot from MMC1
17:32 topi`> mmc_load_image_raw_sector: mmc block read error
17:32 topi`> (this repeats a million times)
17:33 vpeter> dead card?
17:33 topi`> I wonder if MMC1 is the sdcard or the emmc?
17:34 topi`> it is the card - if I remove it the loop stops with mmc_init: -110
17:35 topi`> the card was just fine while it housed the spl+uboot compiled by solidrun...
17:40 jnettlet[m]> topi`: make sure you have the latest git pull .. I missed a major commit in my early morning lack of coffee state. I pushed it later in the day.
17:40 jnettlet[m]> Basically missed all the emmc support.
17:51 topi`> I'm trying to boot from a SD card, my HB is fused to boot from SD
17:52 topi`> can "MMC1" mean both the SD and the emmc?
17:52 topi`> let's see which is my newest commit
17:53 topi`> mx6cuboxi: Add support for eMMC booting
17:53 topi`> maybe I wrote the uboot image to a wrong offset? I used bs=1k seek=69
17:54 topi`> oddly enough, I re-wrote the original SPL to that card and now it boots uboot 2013.10 built in April
17:54 topi`> I thought I overwrite the whole uboot...
17:56 topi`> I wrote the resulting "u-boot.bin" since it seemed to contain the raw assembly code
18:01 topi`> ah! I think it loaded it from the 1st partitin...
18:01 topi`> lets see if it can still load it if I remove that file.
18:06 topi`> the old SPL seems to be able to use that u-boot.bin file in the first partition (FAT) whereas this newer SPL i jsut compiled won't
18:07 topi`> jnettlet[m]: did you try out the git HEAD on a HB2 with SDcard boot?
18:07 topi`> this is a som-v15 board
18:07 jnettlet[m]> Yes, both emmc and sdcard.
18:07 topi`> meaning, the older Gate mainboard paired with the newer 1.5 som
18:08 topi`> mmc_loadؿÒmage_raw_sector: mmc block read error
18:09 topi`> any idea where this is coming from? the string is found in common/mmc.c but I don't know why/how the read error is formed
18:11 jnettlet[m]> topi`: your best bet is to turn on debug in the mx6 SPL code. The mainline code looks at the fuses and then initializes the proper device as the first device based on that
18:11 topi`> I think it's able to read the image header since I dont' see this debug: "hdr read sector %lx, count=%lu"
18:11 topi`> yeah, maybe my fuses are messed up
18:11 topi`> we initially tried to fuse this board to boot from emmc
18:12 topi`> then it didn't work and we tried to force-fuse this back to boot from SDcard
18:12 vpeter> topi`: Doesn't this message come if CONFIG_SPL_LIBCOMMON_SUPPORT is used?
18:12 topi`> how do I enable this debug() macro?
18:12 topi`> vpeter: yes, it seems to be so
18:12 topi`> vpeter: this also seems to be set to Y in my .config
18:13 topi`> jnettlet[m]: can you give a hint how to hardcode the SPL to boot from sdcard and not try to read the fuses?
18:14 topi`> if there are just a bunch of case: statements, then I bet it won't find my 16-bit fuse code
18:14 jnettlet[m]> topi`: generally I just search and replace debug with printf in the file. Enabling debug in SPL results in a file too large to fit in sdram
18:14 topi`> but does printf work, even?
18:15 jnettlet[m]> Yes
18:15 topi`> ok let's see.
18:15 jnettlet[m]> But forcing it would require changes in a couple of places...doable though
18:16 topi`> I'm now recompiling with debugs changed to printfs
18:16 topi`> lets see what it tries to do
18:16 topi`> *sigh* this is more difficult without a JTAG debugger...
18:19 jnettlet[m]> In the mx6cubox board file look at. board_mmc_init(). There you see the setup code for the main device.
18:19 topi`> spl: mmc boot mode: raw
18:19 topi`> hdr read sector 8a, count=1
18:19 topi`> mmc_load_image_raw_sector: mmc block read error
18:19 topi`> spl: mmc boot mode: fs
18:19 topi`> Failed to mount ext2 filesystem...
18:19 topi`> spl_load_image_ext: ext4fs mount err - 0
18:19 topi`> then the SPL resets...
18:20 jnettlet[m]> Are you writing u-boot.img to sector offset 69? That is where mainline looks for it
18:20 topi`> but why do I get a "mmc block read error"??
18:20 topi`> hm, should I convert my fatfs on partition 1 to ext2fs? maybe it would work then
18:20 topi`> it clearly does not try fatfs at all
18:21 jnettlet[m]> You may need to change the default .config
18:21 jnettlet[m]> I generally just store uboot on the raw device
18:24 topi`> I have CONFIG_SPL_LEGACY_IMAGE_SUPPORT=y
18:24 topi`> I wonder what that is
18:27 topi`> CONFIG_SPL_FAT_SUPPORT is not set
18:27 topi`> lets see if I change that
18:32 topi`> now it loaded
18:47 topi`> CPU: Extended Commercial temperature grade (-20C to 105C) at 38C
18:47 topi`> this new mainline uboot has fancy features :)
18:48 jnettlet[m]> Yep. Glad it is working
18:49 topi`> in case of boot failure, this uboot seems to default to TFTP boot
18:49 topi`> but... ERROR: 'ethaddr' not set
18:49 topi`> hmm, I am not sure if it can tftpboot
18:51 topi`> boot_targets=mmc0 sata0 usb0 pxe dhcp
18:51 topi`> would it help if I fuse my board with an ether addr?
18:55 topi`> => fuse read 4 2 1 returns all zeroes
18:55 topi`> as does fuse read 4 3 1
18:55 topi`> (I'm not sure if that is the right bank & register, I just googled some shit up)
19:19 topi`> learned to use the fuse prog command and now there it is1
19:19 topi`> => echo ${ethaddr}
19:19 topi`> d0:63:b4:10:65:db
20:41 topi`> the tftp client that comes with busybox didn't work for me (it doesn't seem to support sending tftp broadcasts) so I made my own using python modules
20:41 topi`> this will now go to the overlay for buildroot :)
20:41 topi`> ./tftp.py zImage seems to work just fine