Re: How to create bl1 and bl2?

Moderators: meveric, mdrjr, odroid

Re: How to create bl1 and bl2?

Unread postby odroid » Sun May 26, 2013 10:56 pm

You must have proper bl1 and tzsw binaries which were supplied by Samsung.

http://odroid.com/dokuwiki/doku.php?id=en:exynos4412bootsequence
Refer above link first.
If you need further answers, feel free to post again.
User avatar
odroid
Site Admin
 
Posts: 25293
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: How to create bl1 and bl2?

Unread postby mdrjr » Mon May 27, 2013 1:50 am

Hi,

The code that creates bl2 is closed and sent to us by Samsung is made to run on x86_64. Its the mkbl2 app. inside the uboot sources.
For the exact position please refer to: http://dev.odroid.com/projects/4412boot/
It cover the position on sdcard of each part of it.
This project that you listed on the latest post is for a older product. Use the wiki for 4412 as the link that I've showed above.
Signing bl2 must be done by Hardkernel.

What are your goals?
mdrjr
Site Admin
 
Posts: 11640
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: How to create bl1 and bl2?

Unread postby mdrjr » Mon May 27, 2013 6:28 am

dd if=FILE of=/dev/sdX seek=POSITION

this above :)
mdrjr
Site Admin
 
Posts: 11640
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: How to create bl1 and bl2?

Unread postby mdrjr » Mon May 27, 2013 8:56 am

yy.toh@live.com.my wrote:
mdrjr wrote:dd if=FILE of=/dev/sdX seek=POSITION

this above :)


Hi,

How many positions in a 8GB SDHC?PLease explain in details, thanks for your patient.


No, the information on wiki isn't incomplete nor out-dated.
If you download the attached file on the Wiki it has a shell script that fuses it on the sdcard. You can use it as example.

For Android ?

Positions are:
NAND and SD-card layout:
------------------------
block contents length (512 byte blocks)
0x0000 boot sector 0x00001
0x0001 bl1 0x0001e
0x001f bl2 0x00020
0x003f u-boot 0x00800
0x083f tzsw 0x00138
0x0977 u-boot env 0x00020
0x0997 kernel 0x04000
0x4997 rootfs-ram 0x00800
0x5197 reserved 0x1ccfa
mdrjr
Site Admin
 
Posts: 11640
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: How to create bl1 and bl2?

Unread postby osterluk » Mon May 27, 2013 11:53 am

Simple u-boot fusing examples. First you need to build u-boot.

With SD-Card in SD-Card writer, as device /dev/sdX
Code: Select all
karlo@karloh ~/odroidu2/u-boot/sd_fuse $ ./sd_fusing.sh /dev/sdX
/dev/sdc reader is identified.
BL1 fusing
30+0 records in
30+0 records out
15360 bytes (15 kB) copied, 0.284018 s, 54.1 kB/s
BL2 fusing
28+1 records in
28+1 records out
14592 bytes (15 kB) copied, 0.291256 s, 50.1 kB/s
u-boot fusing
576+1 records in
576+1 records out
295132 bytes (295 kB) copied, 1.37314 s, 215 kB/s
TrustZone S/W fusing
312+0 records in
312+0 records out
159744 bytes (160 kB) copied, 0.984394 s, 162 kB/s
U-boot image is fused successfully.
Eject SD card and insert it again.


You can fusing new unpartitioned space with the flash installed on the board -- but you need to have previously set up the flash with u-boot at least because you need to run u-boot's fastboot command. Abort the boot at the u-boot prompt (any-key), execute the fastboot command under u-boot. Switch to the host and continue: (you must do it as root or the script will fail, waiting for device)

Code: Select all
karlo@karloh ~/odroidu2/u-boot/sd_fuse $ sudo ./emmc_fastboot_fusing.sh
BL1 fusing
sending 'fwbl1' (15 KB)... OKAY
writing 'fwbl1'... OKAY
BL2 fusing
sending 'bl2' (14 KB)... OKAY
writing 'bl2'... OKAY
u-boot fusing
sending 'bootloader' (288 KB)... OKAY
writing 'bootloader'... OKAY
TrustZone S/W fusing
sending 'tzsw' (156 KB)... OKAY
writing 'tzsw'... OKAY
U-boot image is fused successfully.
osterluk
 
Posts: 311
Joined: Sun Feb 24, 2013 2:07 am
languages_spoken: English
ODROIDs: Odroid-U2

Re: How to create bl1 and bl2?

Unread postby mdrjr » Mon May 27, 2013 12:11 pm

usb download of the firmware isn't supported on Exynos 4412 :(
Samsung disabled that feature of the SoC.
mdrjr
Site Admin
 
Posts: 11640
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: How to create bl1 and bl2?

Unread postby odroid » Mon May 27, 2013 3:49 pm

The u-boot env is generated automatically when you type "save env" in u-boot prompt.

ramdisk or other Android root file systems can be transferred with fastboot command as our WiKi described.
http://dev.odroid.com/projects/howtobuild4
User avatar
odroid
Site Admin
 
Posts: 25293
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: How to create bl1 and bl2?

Unread postby osterluk » Tue May 28, 2013 12:02 am

yy.toh@live.com.my wrote:I have questions, what file to be fused into u-boot env and rootfs-ram (uramdisk?)?


The u-boot environment lives in two blocks starting at block offset 0x0977. This area is not actually fused to the SD-Card. U-boot has default values defined in code. On boot u-boot looks at the env area and can tell the env has not ever been written -- or has failed CRC check. It writes the env from default values, and fixes up the CRC. From then on, the env area is used instead of default values.

The initial ramdisk, as uInitrd in our case, is loaded to memory by u-boot and the kernel is given a pointer to it. It is constructed with a u-boot style header, so the kernel can make sense of it. uInitrd is not related to anything in u-boot -- it just has a u-boot header. It may be confusing...

For us, uInitrd is actually a bunch of binaries, libraries, scripts and kernel modules. They are derived from buildroot/busybox, not Debian source -- or any other "standard" distro. uInitrd is normally used to load filesystem drivers when the eventual root filesystem lives on media that is not directly accessable by the kernel boot code. Your system might need to have a cryptolooped root filesystem, so you would have to manage keys and mount it before continuing the boot.
osterluk
 
Posts: 311
Joined: Sun Feb 24, 2013 2:07 am
languages_spoken: English
ODROIDs: Odroid-U2

Re: How to create bl1 and bl2?

Unread postby odroid » Wed Jun 05, 2013 12:06 pm

After performing the fusing script, just plug the sd card into U2.
You don't need to format the SD.

To check your USB-UART configuration, just insall recovery image on your SD and test the serial console.
http://forum.odroid.com/viewtopic.php?f=53&t=73

Please search the forum first!
User avatar
odroid
Site Admin
 
Posts: 25293
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: How to create bl1 and bl2?

Unread postby mdrjr » Sat Jun 22, 2013 2:51 am

system partition has nothing to do with memory addresses used to load the kernel and the ramdisk.
Those are just plain and simple hex address of the ram address to load those from a media and execute them..
mdrjr
Site Admin
 
Posts: 11640
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: How to create bl1 and bl2?

Unread postby mdrjr » Sat Jun 22, 2013 10:59 am

You have to flash them with compression. Bootloader/kernel will handle everything.
mdrjr
Site Admin
 
Posts: 11640
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: How to create bl1 and bl2?

Unread postby mdrjr » Sun Jun 23, 2013 2:37 am

you can dd system.img directly to the partition ... system should be partition 2

so, dd if=system.img of=/dev/sdX2
will work..
mdrjr
Site Admin
 
Posts: 11640
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: How to create bl1 and bl2?

Unread postby kiwi_jonathan » Fri Sep 19, 2014 2:03 am

I have searched the Odroid forum, and a couple of posts on "how to build your own bootable image" from scratch, refer to this thread. But the link cited in the first post appears to be dead, at least to access from California.

As I understand it, BL1 and BL2 are a public-key and low-level bootstrap code (independent of u-boot). So it should be possible to dd them off a working bootable image. (tzsw, too). In effect, reversing what "fuse" does. And those should work with a newer or upstream u-boot -- as described here: <http://lists.denx.de/pipermail/u-boot/2014-July/183912.html>

is there a better/cleaner/open-source way? Is the samsung-provided package in the first post in this thread still available somewhere? Thanks in advance.
kiwi_jonathan
 
Posts: 63
Joined: Sat Jul 12, 2014 3:38 am
languages_spoken: english
ODROIDs: Ue

Re: How to create bl1 and bl2?

Unread postby mdrjr » Fri Sep 19, 2014 2:11 am

mdrjr
Site Admin
 
Posts: 11640
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: How to create bl1 and bl2?

Unread postby kiwi_jonathan » Sat Sep 20, 2014 2:42 am

mdrjr, thank you for the information. Could you, or "odroid", please update the link in the top post? There are a couple of other Forum threads which link to this one.

I have been working on Unix and Linux open-source for nearly three decades. I find it very, very difficult to find low-level information about Odroid. If you haven't been following the forum for a couple of years, it's very hard to find. If you want to grow the community, maintaining information like this is important. Thanks again.
kiwi_jonathan
 
Posts: 63
Joined: Sat Jul 12, 2014 3:38 am
languages_spoken: english
ODROIDs: Ue

Re: Re: How to create bl1 and bl2?

Unread postby mdrjr » Sat Sep 20, 2014 6:08 am

Done :)
mdrjr
Site Admin
 
Posts: 11640
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -


Return to Android

Who is online

Users browsing this forum: No registered users and 1 guest