Migrate to U-Boot: различия между версиями

Материал из Toshiba AC100 wiki
Перейти к навигации Перейти к поиску
(add first part of migration to uboot guide)
 
м (add more details about writing and outputs)
Строка 88: Строка 88:
====Replace factory bootloader with U-Boot====
====Replace factory bootloader with U-Boot====


* Write U-Boot bootloader binary bundled with sosuboot-tegra into AC100 eMMC
Write U-Boot bootloader binary bundled with sosuboot-tegra into AC100 eMMC
 
* Switch to boot folder
<pre>
<pre>
# cd /boot
# cd /boot
</pre>
* Read your current bct from eMMC into file ''paz00.bct''
<pre>
# getbct.sh
# getbct.sh
</pre>
output:
<pre>
1+0 records in
1+0 records out
</pre>
* Check odmdata content in yout bct file
<pre>
# bct_dump paz00.bct
</pre>
output:
<pre>
Version      = 0x00020001;
BlockSize    = 0x00004000;
PageSize      = 0x00000200;
PartitionSize = 0x01000000;
OdmData      = 0x800c0075;
# Bootloader used      = 4;
# Bootloaders max      = 4;
# BCT size              = 4080;
# Hash size            = 16;
# Crypto offset        = 16;
# Crypto length        = 4064;
# Max BCT search blocks = 64;
#
# These values are set by cbootimage using the
# bootloader provided by the Bootloader=...
# configuration option.
#
# Bootloader[0].Version      = 0x00020001;
# Bootloader[0].Start block  = 1;
# Bootloader[0].Start page  = 0;
# Bootloader[0].Length      = 523508;
# Bootloader[0].Load address = 0x00108000;
# Bootloader[0].Entry point  = 0x00108000;
# Bootloader[0].Attributes  = 0x00000000;
# Bootloader[0].Bl AES Hash  = cffdb288ad07d37118b62283db0a38a6;
Segmentation fault
</pre>
* Create new bct with bundled U-Boot binary
<pre>
# mkbct.sh
# mkbct.sh
</pre>
output:
<pre>
bct size: 4080
**update_bl()
begin_update(): bct data: b=14 p=9
writing bootloader
  redundancy = 1
  BL[0]: 131073 0001 0000 469220 0x00108000 0x00108000
ba187ce992addec1435bcb6fa7b87fc6
  BL[1]: 131073 0001 0000 523508 0x00108000 0x00108000
88b2fdcf71d307ad8322b618a6380adb
  BL[2]: 131073 0001 0000 504500 0x00108000 0x00108000
283e24d436b76fe3aec59cf3b2bbcc5b
  BL[3]: 131073 0001 0000 470828 0x00108000 0x00108000
5f3047005434b57991c8c3cb3a0be109
Image file /boot/paz00.bct.new has been successfully generated!
</pre>
* Write new bct into eMMC
<pre>
# uploadbct.sh
# uploadbct.sh
</pre>
</pre>


U-Boot written to eMMC you can reboot AC100 now.
output:
<pre>
949+0 records in
949+0 records out
</pre>
size may vary depending of U-Boot binary size
 
* U-Boot written to eMMC you can reboot AC100 now.


===With prebuilt sosuboot-tegra archive or sdcard image (PC not required)===
===With prebuilt sosuboot-tegra archive or sdcard image (PC not required)===

Версия от 23:04, 22 декабря 2016

Variants of migration


  1. Sosuboot-tegra
    1. With prebuilt sosuboot-tegra binary (require PC)
    2. With prebuilt sosuboot-tegra archive or sdcard image (PC not required)
    3. With self-compiled sosuboot-tegra
  2. Manual
    1. With PC
    2. Without PC


With prebuilt sosuboot-tegra binary (require PC)


Requirements

$ git clone https://github.com/NVIDIA/tegrarcm.git
$ cd tegrarcm
$ ./autogen.sh
$ ./configure
$ make
$ make install
# zypper ar -f http://download.opensuse.org/repositories/hardware/openSUSE_Leap_42.2/ Hardware
# zypper in tegrarcm
  • Connect AC100 miniUSB port to PC
  • Enter RCM aka APX mode on AC100
    • Press CTRL+ESC+Power button

Syslog on PC which shows that RCM/APX mode started

[12060.106270] usb 1-1.2.5.2: new high-speed USB device number 15 using ehci-pci
[12060.200163] usb 1-1.2.5.2: New USB device found, idVendor=0955, idProduct=7820
[12060.200170] usb 1-1.2.5.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[12060.200173] usb 1-1.2.5.2: Product: APX
[12060.200175] usb 1-1.2.5.2: Manufacturer: NVIDIA Corp.

Load sosuboot-tegra

  • Read current bct from AC100 with tegrarcm
# tegrarcm readbct --bct=ac100.bct
  • Load sosuboot-tegra into AC100 RAM
# tegrarcm --bct=ac100.bct --bootloader=sos-uboot-2017.02-git-00562-g60ea164.bin --loadaddr=0x108000

PC Output:

bct file: ac100.bct
booloader file: sos-uboot-2017.02-git-00562-g60ea164.bin
load addr 0x108000
entry addr 0x108000
device id: 0x7820
Chip UID:                0x0000000000000000161c10c742e09257
Chip ID:                 0x20
Chip ID Major Version:   0x1
Chip ID Minor Version:   0x2
Chip SKU:                0x8 (t20)
Boot ROM Version:        0x1
Boot Device:             0x2 (EMMC)
Operating Mode:          0x3 (developer mode)
Device Config Strap:     0x1
Device Config Fuse:      0x0
SDRAM Config Strap:      0x0
sending file: ac100.bct
- 4080/4080 bytes sent
ac100.bct sent successfully
sending file: sos-uboot-2017.02-git-00562-g60ea164.bin
- 33587434/33587434 bytes sent
sos-uboot-2017.02-git-00562-g60ea164.bin sent successfully

AC100 will boot into Linux.

Replace factory bootloader with U-Boot

Write U-Boot bootloader binary bundled with sosuboot-tegra into AC100 eMMC

  • Switch to boot folder
# cd /boot
  • Read your current bct from eMMC into file paz00.bct
# getbct.sh

output:

1+0 records in
1+0 records out
  • Check odmdata content in yout bct file
# bct_dump paz00.bct

output:

Version       = 0x00020001;
BlockSize     = 0x00004000;
PageSize      = 0x00000200;
PartitionSize = 0x01000000;
OdmData       = 0x800c0075;
# Bootloader used       = 4;
# Bootloaders max       = 4;
# BCT size              = 4080;
# Hash size             = 16;
# Crypto offset         = 16;
# Crypto length         = 4064;
# Max BCT search blocks = 64;
#
# These values are set by cbootimage using the
# bootloader provided by the Bootloader=...
# configuration option.
#
# Bootloader[0].Version      = 0x00020001;
# Bootloader[0].Start block  = 1;
# Bootloader[0].Start page   = 0;
# Bootloader[0].Length       = 523508;
# Bootloader[0].Load address = 0x00108000;
# Bootloader[0].Entry point  = 0x00108000;
# Bootloader[0].Attributes   = 0x00000000;
# Bootloader[0].Bl AES Hash  = cffdb288ad07d37118b62283db0a38a6;
Segmentation fault
  • Create new bct with bundled U-Boot binary
# mkbct.sh

output:

bct size: 4080
**update_bl()
begin_update(): bct data: b=14 p=9
writing bootloader
  redundancy = 1
  BL[0]: 131073 0001 0000 469220 0x00108000 0x00108000
ba187ce992addec1435bcb6fa7b87fc6
  BL[1]: 131073 0001 0000 523508 0x00108000 0x00108000
88b2fdcf71d307ad8322b618a6380adb
  BL[2]: 131073 0001 0000 504500 0x00108000 0x00108000
283e24d436b76fe3aec59cf3b2bbcc5b
  BL[3]: 131073 0001 0000 470828 0x00108000 0x00108000
5f3047005434b57991c8c3cb3a0be109
Image file /boot/paz00.bct.new has been successfully generated!
  • Write new bct into eMMC
# uploadbct.sh

output:

949+0 records in
949+0 records out

size may vary depending of U-Boot binary size

  • U-Boot written to eMMC you can reboot AC100 now.

With prebuilt sosuboot-tegra archive or sdcard image (PC not required)


With self-compiled sosuboot-tegra


Manual with crosscompilation on PC


Manual with compilation on AC100