Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flashing u-boot to SDCard #2

Open
atilag opened this issue Jun 11, 2014 · 5 comments
Open

Flashing u-boot to SDCard #2

atilag opened this issue Jun 11, 2014 · 5 comments

Comments

@atilag
Copy link

atilag commented Jun 11, 2014

Ok, so I applied the patch to the correct u-boot repositry tag, modified some configuration parameters to force u-boot get into fastboot mode, and built for sun6i hardware successfully.
The result of the compilation creates a u-boot.bin (and other files we don't care so far).
I wrote this file to a SDCard using:
dd if=/dev/zero of=/dev/sdb1 bs=1M count=1 (clear some bits in the SDCard)
dd if=u-boot.img of=/dev/sdb1 bs=1024 seek=8 (write the bootloader into the SDCard)
After that, I have inserted the SDcard into the tablet and booted into FEL mode by pressing and holding Volume - and power buttons.... but it looks like it never reaches my sdcard, it justs boots into FEL mode and stay there.
I read here http://linux-sunxi.org/Bootable_SD_card#Bootloader , that another file should have been created after building: spl/sunxi-spl.bin, but it didn't. Is that ok?
Does u-boot.bin file enough in order to make a bootable SDCard?

Thanks!!

@atilag
Copy link
Author

atilag commented Jun 11, 2014

Well, I think I can answer myself: I do need SPL binary. The real question is: How can we build this SPL file?

@maks
Copy link

maks commented Jun 12, 2014

@atilag great work getting that far! Would you mind posting your diff for going straight into fastboot, even if its only a quick hack ?

And hopefully I can help get this a bit further, thanks to: linux-sunxi/u-boot-sunxi#63

you need to build using:

make CROSS_COMPILE=arm-linux-gnueabihf- CONFIG_SPL=y

now you also need to get rid of the "//" comments in the include files as discovered by the same guy:
https://groups.google.com/d/msg/linux-sunxi/FU3odHBtWUk/B_yy-cbgxL0J

heres my diff:
https://gist.github.com/maks/ff1edf02484f2c09474f

BUT then I still hit the following error:

sun6i.c:292:2: warning: implicit declaration of function ‘script_parser_fetch’ [-Wimplicit-function-declaration]
sun6i.c: In function ‘board_mmc_init’:
sun6i.c:322:2: warning: implicit declaration of function ‘sunxi_mmc_init’ [-Wimplicit-function-declaration]
arm-linux-gnueabihf-ld  -r -o /home/maks/builds/AOSP/u-boot-sunxi/spl/board/allwinner/sun6i/libsun6i.o  /home/maks/builds/AOSP/u-boot-sunxi/spl/board/allwinner/sun6i/sun6i.o
make[2]: Leaving directory `/home/maks/builds/AOSP/u-boot-sunxi/board/allwinner/sun6i'
arm-linux-gnueabihf-gcc -E -g  -Os   -fno-common -ffixed-r8 -msoft-float   -D__KERNEL__ -ffunction-sections -fdata-sections -DCONFIG_SYS_TEXT_BASE=0x4A000000 -DCONFIG_SPL_BUILD -I/home/maks/builds/AOSP/u-boot-sunxi/include -fno-builtin -ffreestanding -nostdinc -isystem /data/AOSP-bins/toolchains/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.7.3/include -pipe  -DCONFIG_ARM -D__ARM__ -marm  -mabi=aapcs-linux -mno-thumb-interwork -march=armv5 -include /home/maks/builds/AOSP/u-boot-sunxi/include/u-boot/u-boot.lds.h -include /home/maks/builds/AOSP/u-boot-sunxi/include/config.h  -ansi -D__ASSEMBLY__ -P - < /home/maks/builds/AOSP/u-boot-sunxi/arch/arm/cpu/armv7/u-boot.lds > /home/maks/builds/AOSP/u-boot-sunxi/spl/u-boot-spl.lds
UNDEF_SYM=`arm-linux-gnueabihf-objdump -x /home/maks/builds/AOSP/u-boot-sunxi/spl/arch/arm/cpu/armv7/libarmv7.o /home/maks/builds/AOSP/u-boot-sunxi/spl/arch/arm/cpu/armv7/sunxi/libsunxi.o /home/maks/builds/AOSP/u-boot-sunxi/spl/arch/arm/lib/libarm.o /home/maks/builds/AOSP/u-boot-sunxi/spl/board/allwinner/sun6i/libsun6i.o | sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`; cd /home/maks/builds/AOSP/u-boot-sunxi/spl/ && arm-linux-gnueabihf-ld  -T /home/maks/builds/AOSP/u-boot-sunxi/spl/u-boot-spl.lds --gc-sections -Bstatic $UNDEF_SYM arch/arm/cpu/armv7/start.o --start-group arch/arm/cpu/armv7/libarmv7.o arch/arm/cpu/armv7/sunxi/libsunxi.o arch/arm/lib/libarm.o board/allwinner/sun6i/libsun6i.o --end-group /home/maks/builds/AOSP/u-boot-sunxi/spl/arch/arm/lib/eabi_compat.o -L /data/AOSP-bins/toolchains/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.7.3 -lgcc -Map u-boot-spl.map -o u-boot-spl
arch/arm/cpu/armv7/start.o: In function `reset':
/home/maks/builds/AOSP/u-boot-sunxi/arch/arm/cpu/armv7/start.S:137: undefined reference to `save_boot_params'
arch/arm/cpu/armv7/start.o: In function `call_board_init_f':
/home/maks/builds/AOSP/u-boot-sunxi/arch/arm/cpu/armv7/start.S:179: undefined reference to `board_init_f'
arch/arm/cpu/armv7/start.o: In function `_board_init_r_ofs':
/home/maks/builds/AOSP/u-boot-sunxi/arch/arm/cpu/armv7/start.S:303: undefined reference to `board_init_r'
arch/arm/cpu/armv7/sunxi/libsunxi.o: In function `s_init':
/home/maks/builds/AOSP/u-boot-sunxi/arch/arm/cpu/armv7/sunxi/dram_sun6i.c:245: undefined reference to `sw_gpio_init'
make[1]: *** [/home/maks/builds/AOSP/u-boot-sunxi/spl/u-boot-spl] Error 1

@maks
Copy link

maks commented Jun 12, 2014

I have a bad feeling that the u-boot in the nand on the device uses the Allwinner propreitary boot0, boo1, boot.axf that then load u-boot as per: http://linux-sunxi.org/Boot_Process

I'm hoping @flatfish-fox will tell us I'm wrong at that it is possible to build the u-boot spl from the code in the rhombus repo?

@maks
Copy link

maks commented Jun 13, 2014

@flatfish-fox Hi so we seem to be stuck now as there does yet seem to be a working SPL for the A31, at least going by this attempt: https://groups.google.com/d/msg/linux-sunxi/MQKxPOxTnpo/jYDDP7-6CNYJ
and it seems that the Allwinner boot0 + boot1 are not publicly available for the A31 either, so without your help we are stuck and cannot get either sdcard or usb (via FEL) working for any tablets that are 'bricked' due to not being abel to boot into android system.img and adb enabled.

Any help would be most appreciated.

@flatfish-fox
Copy link
Owner

To resolve the "bricked" issue, please refer to the following link:

https://bugzilla.mozilla.org/show_bug.cgi?id=1026963

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants