https://redmine.replicant.us/https://redmine.replicant.us/favicon.ico?15984615062020-05-18T02:18:17ZReplicantReplicant - Issue #2027: Investigate lthor / thor and samsung u-boot for Tizenhttps://redmine.replicant.us/issues/2027?journal_id=80262020-05-18T02:18:17ZDenis 'GNUtoo' CarikliGNUtoo@cyberdimension.org
<ul></ul><p>If we had a fully free software u-boot it could be installed with cat or dd, after booting an upstream Linux kernel.</p>
<p>CONFIG_USB_FUNCTION_THOR=y seem very interesting. I'll check but from the name it looks like it implements the same protocol than heimdall.</p>
<p>If that's the case, then it may enable us to simplify <strong>a lot</strong> the installation instructions of Replicant as we would be able to use heimdall with u-boot too.</p>
<p>I'd like to also be able to use the CONFIG_DISTRO=y that enables to use syslinux config file, like what is used in Parabola.</p>
<p>It may be possible to make everything work together, to enable different users to reuse their GNU/Linux or Android knowledge.</p>
<p>If my memory is correct, in Barebox, which is also a free software booloader like u-boot, you can configure fastboot or DFU to flash files in a filesystem.</p>
<p>Edit: Last summer, I also looked how to export mmcblk2boot0 and mmcblk2boot1 in u-boot and I didn't find how to do it, so I'm unsure how mmcblk2boot* could be made accessible through heimdall.</p> Replicant - Issue #2027: Investigate lthor / thor and samsung u-boot for Tizenhttps://redmine.replicant.us/issues/2027?journal_id=80272020-05-18T02:32:07ZDenis 'GNUtoo' CarikliGNUtoo@cyberdimension.org
<ul></ul><p>Thanks, it looks like the protocol used by Heimdall and Odin.</p>
<p>Thanks to this bugreport we now know the name of that protocol, which is really handy.</p> Replicant - Issue #2027: Investigate lthor / thor and samsung u-boot for Tizenhttps://redmine.replicant.us/issues/2027?journal_id=80282020-05-18T03:27:12ZKurtis HannaKurtis@riseup.net
<ul></ul><p>This suggests that there is a version of s-boot that was used on Samsung's Tizen when running on the Galaxy S2 and S3 <a class="external" href="https://wiki.tizen.org/TM1">https://wiki.tizen.org/TM1</a></p>
<p>I've seen forum posts where people have successfully put Tizen's version of s-boot on their i9300, which then gives them u-boot with lthor, but I don't have the links handy. They used odin to change the s-boot version without being required to open up the phone and short the test point.</p> Replicant - Issue #2027: Investigate lthor / thor and samsung u-boot for Tizenhttps://redmine.replicant.us/issues/2027?journal_id=80352020-05-21T18:16:37ZKurtis HannaKurtis@riseup.net
<ul></ul><p>Here's one of the forum posts I'm referring to. The same author posted a fair bit about this on xda forums too. <a class="external" href="https://developer.tizen.org/forums/general-support/retail-i9300-and-tizen-rd-pq-firmware">https://developer.tizen.org/forums/general-support/retail-i9300-and-tizen-rd-pq-firmware</a></p> Replicant - Issue #2027: Investigate lthor / thor and samsung u-boot for Tizenhttps://redmine.replicant.us/issues/2027?journal_id=80362020-05-22T18:11:51ZKurtis HannaKurtis@riseup.net
<ul></ul><p>Here's Tizen's lthor repo on github: <a class="external" href="https://github.com/tizenpdk/lthor">https://github.com/tizenpdk/lthor</a></p>
<p>Here's another write up on the Tizen forums: <a class="external" href="https://samsung.tizenforum.com/platform/flashing-tizen-to-android-device/msg14383/?PHPSESSID=c3lu20sksk88ptliggf40a47s1#msg14383">https://samsung.tizenforum.com/platform/flashing-tizen-to-android-device/msg14383/?PHPSESSID=c3lu20sksk88ptliggf40a47s1#msg14383</a></p>
<p>Here's a write up that includes a lot of info about lthor and an exynos4412 ODROID dev board: <a class="external" href="https://wiki.tizen.org/How_to_Build_and_Load_Tizen_on_Odroid_U3">https://wiki.tizen.org/How_to_Build_and_Load_Tizen_on_Odroid_U3</a></p>
<p>Here's the post on xda that seems to explain exactly how to install the version of s-boot that includes u-boot and lthor without needing to open up the phone and short a resistor. <a class="external" href="https://forum.xda-developers.com/showpost.php?p=68146979&postcount=77">https://forum.xda-developers.com/showpost.php?p=68146979&postcount=77</a></p>
<p>I think that if we can figure out how to get this tizen version of s-boot we can then use lthor to completely remove s-boot and replace it with an up-to-date version of u-boot (with the proprietary BL1 blob).</p> Replicant - Issue #2027: Investigate lthor / thor and samsung u-boot for Tizenhttps://redmine.replicant.us/issues/2027?journal_id=80512020-06-04T05:59:39ZDenis 'GNUtoo' CarikliGNUtoo@cyberdimension.org
<ul></ul><p>Kurtis Hanna wrote:</p>
<blockquote>
<p>This suggests that there is a version of s-boot that was used on Samsung's Tizen when running on the Galaxy S2 and S3 <a class="external" href="https://wiki.tizen.org/TM1">https://wiki.tizen.org/TM1</a></p>
<p>I've seen forum posts where people have successfully put Tizen's version of s-boot on their i9300, which then gives them u-boot with lthor, but I don't have the links handy. They used odin to change the s-boot version without being required to open up the phone and short the test point.</p>
</blockquote>
<p>Thanks.</p>
<p>The test points are only used for recovery when something goes wrong. Let's say I want to flash x-boot on the eMMC to do a test, or I have flashed a non-working u-boot and can't recover because the u-boot I flashed doesn't boot. Then shorting the test points documented in <a class="wiki-page" href="https://redmine.replicant.us/projects/replicant/wiki/Exynos4Bootrom">Exynos4Bootrom</a> will just make the hardware boot on the microSD first instead of booting on the eMMC first.</p>
However if we find their u-boot version, it might be interesting to understand where it is flashed:
<ul>
<li>If it's flashed in the BOOT partition, then we could ship that u-boot right away in replicant >= 9, and then work with upstream to get support for the midas devices when u-boot is flashed in the BOOT partition or after some nonfree and non-redistributable BL1 too, in order not to step on the feet of the people that are working on that, and if we get a free BL1 one day, we'd already have some of the work done this way.</li>
<li>If not it might still be interesting to look at how it boots, if they have a free software BL1 or not. Even if they don't have a free BL1, it give us new interesting information (more fields on the headers of the BL1, etc)</li>
</ul> Replicant - Issue #2027: Investigate lthor / thor and samsung u-boot for Tizenhttps://redmine.replicant.us/issues/2027?journal_id=80522020-06-04T06:00:15ZDenis 'GNUtoo' CarikliGNUtoo@cyberdimension.org
<ul><li><strong>Subject</strong> changed from <i>Investigate lthor / thor</i> to <i>Investigate lthor / thor and samsung u-boot for Tizen</i></li></ul><p>update bug title to reflect that we discuss about the tizen u-boot too</p> Replicant - Issue #2027: Investigate lthor / thor and samsung u-boot for Tizenhttps://redmine.replicant.us/issues/2027?journal_id=80532020-06-04T06:17:58ZDenis 'GNUtoo' CarikliGNUtoo@cyberdimension.org
<ul></ul><p>It might be possible to flash u-boot with heimdall, however it would require quite some work.</p>
<p>Part of mmcblk2boot0 seem to be read-only:<br /><pre>
--- Entry #0 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 80
Attributes: 2 (STL Read-Only)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 0
Partition Block Count: 1734
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: BOOTLOADER
Flash Filename: sboot.bin
FOTA Filename:
--- Entry #1 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 81
Attributes: 5 (Read/Write)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 1734
Partition Block Count: 312
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: TZSW
Flash Filename: tz.img
FOTA Filename:
</pre></p>
<p>It's still possible to flash a different PIT, as this is read-write:<br /><pre>
--- Entry #2 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 70
Attributes: 5 (Read/Write)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 34
Partition Block Count: 16
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: PIT
Flash Filename: mx.pit
FOTA Filename:
</pre></p>
<p>But someone would need to write a procedure that is robust enough not to make users and developers break their devices.</p>
<p>Another option would be to patch the bootloader in memory with the exploits from the emmc_tooklit, however it's probably hard to find the location to patch if it's not already documented somewhere.</p>
Currently flashing u-boot is done this way:
<ul>
<li>People boot a recovery that has a kernel that doesn't hide the mmcblk0boot0 partition</li>
<li>They flash the bootloader with that recovery</li>
</ul>
<p>Doing a Replicant recovery just for that now is probably not very interesting as we don't have a free software BL1 anyway.</p>
<p>Also, the upstream kernel and replicant >=9 kernel gives access to the mmcblk0boot0 partition. So once we have a Replicant >=9 recovery, or even a Replicant >=9 image, and a free BL1, people could use it to flash u-boot.</p> Replicant - Issue #2027: Investigate lthor / thor and samsung u-boot for Tizenhttps://redmine.replicant.us/issues/2027?journal_id=82212020-07-28T00:52:45ZKurtis HannaKurtis@riseup.net
<ul></ul><p>This patch suggests that upstream u-boot added some sort of support for Tizen's THOR a few years ago: "Enable Tizen's THOR download protocol support in U-Boot. It allows downloading images into memory and flash them to target device." <a class="external" href="https://github.com/u-boot/u-boot/commit/c6c1ca100feaddd0003723f8a06102db1e521412#diff-43b97f93daa343987f97aa1cbb118680R148">https://github.com/u-boot/u-boot/commit/c6c1ca100feaddd0003723f8a06102db1e521412#diff-43b97f93daa343987f97aa1cbb118680R148</a></p> Replicant - Issue #2027: Investigate lthor / thor and samsung u-boot for Tizenhttps://redmine.replicant.us/issues/2027?journal_id=84352020-11-23T20:35:19ZKurtis HannaKurtis@riseup.net
<ul></ul><p>The most recent version of lthor seems to be 3.2.</p>
<p>A pre-compiled binary of it seems to be able to be downloaded here: <a class="external" href="https://download.tizen.org/tools/latest-release/Ubuntu_20.04/">https://download.tizen.org/tools/latest-release/Ubuntu_20.04/</a></p>
<p>The most up to date source code I could find is here: <a class="external" href="https://git.tizen.org/cgit/tools/lthor/">https://git.tizen.org/cgit/tools/lthor/</a></p> Replicant - Issue #2027: Investigate lthor / thor and samsung u-boot for Tizenhttps://redmine.replicant.us/issues/2027?journal_id=90312021-03-27T15:37:14Z_I3^ RELATIVISM
<ul><li><strong>Type of work</strong> <i>Build system integration, Unknown</i> added</li></ul> Replicant - Issue #2027: Investigate lthor / thor and samsung u-boot for Tizenhttps://redmine.replicant.us/issues/2027?journal_id=91132021-05-05T20:55:18ZKurtis HannaKurtis@riseup.net
<ul></ul><p>Denis 'GNUtoo' Carikli wrote in <a href="#note-1">#note-1</a>:</p>
<blockquote>
<p>If my memory is correct, in Barebox, which is also a free software booloader like u-boot, you can configure fastboot or DFU to flash files in a filesystem.</p>
</blockquote>
<p>It looks like fastboot is being used to flash Android with this tiny4412 u-boot:<br /><a class="external" href="https://github.com/List-View/uboot_tiny4412/commit/3025e8f2968c4afda0ca897aa399c74a8769ff73">https://github.com/List-View/uboot_tiny4412/commit/3025e8f2968c4afda0ca897aa399c74a8769ff73</a></p>