blob: 641affc62945462a72214c648fd71fd6dd07ebed [file] [log] [blame]
Svyatoslav Ryhel238f4182025-03-05 15:05:30 +02001.. SPDX-License-Identifier: GPL-2.0+
2
3U-Boot for the Ouya Game Console (ouya)
4=======================================
5
6``DISCLAMER!`` Moving your Ouya to use U-Boot assumes replacement of the
7vendor bootloader. Vendor android firmwares will no longer be able to run on the
8device. This replacement IS reversible.
9
10Quick Start
11-----------
12
13- Build U-Boot
14- Process U-Boot
15- Flashing U-Boot into the eMMC
16- Boot
17- Self Upgrading
18
19Build U-Boot
20------------
21
22.. code-block:: bash
23
24 $ export CROSS_COMPILE=arm-none-eabi-
25 $ make ouya_defconfig
26 $ make
27
28After the build succeeds, you will obtain the final ``u-boot-dtb-tegra.bin``
29image, ready for further processing.
30
31Process U-Boot
32--------------
33
34``DISCLAMER!`` All questions related to the re-crypt work should be asked
35in re-crypt repo issues. NOT HERE!
36
37re-crypt is a tool that processes the ``u-boot-dtb-tegra.bin`` binary into form
38usable by device. This process is required only on the first installation or
39to recover the device in case of a failed update.
40
41Permanent installation can be performed either by using the nv3p protocol or by
42pre-loading just built U-Boot into RAM.
43
44Processing for the NV3P protocol
45********************************
46
47.. code-block:: bash
48
49 $ git clone https://gitlab.com/grate-driver/re-crypt.git
50 $ cd re-crypt # place your u-boot-dtb-tegra.bin here
51 $ ./re-crypt.py --dev ouya
52
53The script will produce a ``repart-block.bin`` ready to flash.
54
55Processing for pre-loaded U-Boot
56********************************
57
58The procedure is the same, but the ``--split`` argument is used with the
59``re-crypt.py``. The script will produce ``bct.img`` and ``ebt.img`` ready
60to flash.
61
62Flashing U-Boot into the eMMC
63-----------------------------
64
65Permanent installation can be performed either by using the nv3p protocol or by
66pre-loading just built U-Boot into RAM. Regardless of the method bct and bootloader
67will end up in boot0 and boot1 partitions of eMMC.
68
69Flashing with the NV3P protocol
70*******************************
71
72``DISCLAMER!`` All questions related to NvFlash should be asked in the proper
73place. NOT HERE! Flashing U-Boot will erase all eMMC, so make a backup before!
74
75Nv3p is a custom Nvidia protocol used to recover bricked devices. Devices can
76enter it by pre-loading vendor bootloader with the Fusée Gelée.
77
78With nv3p, ``repart-block.bin`` is used. It contains BCT and a bootloader in
79encrypted state in form, which can just be written RAW at the start of eMMC.
80
81.. code-block:: bash
82
83 $ ./run_bootloader.sh -s T30 -t ./bct/ouya.bct -b android_bootloader.bin
84 $ ./utiils/nvflash_v1.13.87205 --resume --rawdevicewrite 0 1024 repart-block.bin
85
86When flashing is done, reboot the device.
87
88Flashing with a pre-loaded U-Boot
89*********************************
90
91U-Boot pre-loaded into RAM acts the same as when it was booted "cold". Currently
92U-Boot supports bootmenu entry fastboot, which allows to write a processed copy
93of U-Boot permanently into eMMC.
94
95While pre-loading U-Boot, interrupt bootflow by pressing ``CTRL + C`` (USB keyboard
96must be plugged in before U-Boot is preloaded, else it will not work), input
97``bootmenu`` from the keyboard and hit enter. The bootmenu will appear. There, select
98``fastboot`` using the up and down arrows and enter key. After, on host PC, do:
99
100.. code-block:: bash
101
102 $ fastboot flash 0.1 bct.img
103 $ fastboot flash 0.2 ebt.img
104 $ fastboot reboot
105
106Device will reboot.
107
108Boot
109----
110
111To boot Linux, U-Boot will look for an ``extlinux.conf`` on eMMC. Additionally,
112bootmenu provides entries to mount eMMC as mass storage, fastboot, reboot,
113reboot RCM, poweroff, enter U-Boot console and update bootloader (check
114the next chapter).
115
116Flashing ``repart-block.bin`` eliminates vendor restrictions on eMMC and allows
117the user to use/partition it in any way the user desires.
118
119Self Upgrading
120--------------
121
122Place your ``u-boot-dtb-tegra.bin`` on the first partition of the USB. Enter
123bootmenu, choose update bootloader option with Enter and U-Boot should update
124itself. Once the process is completed, U-Boot will ask to press any button to reboot.