Commit Graph

37 Commits

Author SHA1 Message Date
Henrik Grimler 0cf817a591
libpit: MMC4096 is really UFS
Change name to better describe the hardware.
2022-05-04 13:12:31 +02:00
Henrik Grimler c3516307d2
libpit: last number in PIT header is the "LUN count"
Where LUN probably stands for Logical Unit Number.  Previous
assumption that it was the odin protocol version was wrong, so let's
fix this.
2022-05-04 13:12:28 +02:00
Henrik Grimler f6c4698c8b
Revert "PIT: unknown version in PIT header has to be protocol version"
This assumption was wrong.  The number is really the number of logical
units in the storage, which tends to increase over time as the storage
space is increased I suppose.

This reverts commit e916c679ed.
2022-05-04 13:11:18 +02:00
Henrik Grimler e916c679ed
PIT: unknown version in PIT header has to be protocol version
And in that case there now exists a fifth version of the Odin
protocol, seen on Galaxy S9 and newer.

In total we have seen these versions (as of January 2022):

* 0, on devices from around 2014 or older
* 3, on devices from around 2015
* 4, on devices from around 2016 - 2017
* 5, on devices from around 2018 or newer
2022-01-01 20:38:19 +01:00
Henrik Grimler e51c9119f1
libpit: describe more parts of pit header
The unknown string is "COM_TAR2" in all devices I have access to.  The
last unknown 4 bytes might be some sort of version, in old devices it
is 0000, in Galaxy S6 0003, in Galaxy S7 and S8 0004 and in Galaxy S9
and tab S6 lite 0005.

The CPU/bootloader string looks something like:

* LSI5410 - Seen in Exynos 5420, 5433 devices (and perhaps others)
* LSI7420 - Seen in Exynos 7420, 8890, 8895 devices (and perhaps others)
* LSI7880 - Seen in a5y17lte (exynos 7880)
* LSI9610 - Seen in gta4xl (exynos 9611)
* LSI9810 - Seen in star2lte (exynos 9810)
* Mx      - Seen in Galaxy S3 (device codename is m0/m3)
* MSM8916 - Seen in MSM8916 devices
* MSM8960 - Seen in jflte (and probably in others, jflte has a APQ8064AB CPU)
2021-12-16 16:01:18 +01:00
Henrik Grimler 31745c287a
libpit: add DeviceType = 8 entry for MMC with blksize 4096
Newer devices have an emmc with 4096 block size instead of 512.  These
seem to have DeviceType=8 instead of DeviceType=2.
2021-12-16 16:01:15 +01:00
Henrik Grimler 761c2db4d2
cmake: set -std=c+++11 with target_compile_features instead 2021-12-10 09:46:17 +01:00
Henrik Grimler 719edaff9e
heimdall, libpit: fix (MSVC) nullptr check
We should only need to define it for old versions of MSVC.  On linux
it seems that defining nullptr does not really have any downsides, but
on android we get some obscure compiler errors due to how nullptr is
defined.  Fix nullptr check and thereby make heimdall compile on
android.

Error message looked something like:

[  6%] Building CXX object libpit/CMakeFiles/pit.dir/source/libpit.cpp.o
In file included from /data/data/com.termux/files/home/Heimdall/libpit/source/libpit.cpp:22:
In file included from /data/data/com.termux/files/home/Heimdall/libpit/source/libpit.h:38:
In file included from /data/data/com.termux/files/usr/include/c++/v1/string:504:
In file included from /data/data/com.termux/files/usr/include/c++/v1/string_view:175:
In file included from /data/data/com.termux/files/usr/include/c++/v1/__string:57:
In file included from /data/data/com.termux/files/usr/include/c++/v1/algorithm:643:
/data/data/com.termux/files/usr/include/c++/v1/memory:2268:9: error: cannot initialize a member subobject of type 'libpit::PitEntry **' with an rvalue of type 'int'
      : __value_(_VSTD::forward<_Up>(__u))
        ^        ~~~~~~~~~~~~~~~~~~~~~~~~
/data/data/com.termux/files/usr/include/c++/v1/memory:2353:9: note: in instantiation of function template specialization 'std::__compressed_pair_elem<libpit::PitEntry **, 0, false>::__compressed_pair_elem<int, void>' requested here
      : _Base1(std::forward<_U1>(__t1)), _Base2(std::forward<_U2>(__t2)) {}
        ^
/data/data/com.termux/files/usr/include/c++/v1/vector:436:7: note: in instantiation of function template specialization 'std::__compressed_pair<libpit::PitEntry **, std::allocator<libpit::PitEntry *>>::__compressed_pair<int, std::__default_init_tag>' requested here
      __end_cap_(nullptr, __default_init_tag())
      ^
/data/data/com.termux/files/usr/include/c++/v1/vector:495:5: note: in instantiation of member function 'std::__vector_base<libpit::PitEntry *, std::allocator<libpit::PitEntry *>>::__vector_base' requested here
    vector() _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
    ^
/data/data/com.termux/files/home/projects/Heimdall/libpit/source/libpit.cpp:65:10: note: in instantiation of member function 'std::vector<libpit::PitEntry *>::vector' requested here
PitData::PitData()
         ^
2021-11-25 21:26:37 +01:00
Romain Hunault 6ede1f1f33 Fix macOS issues
[ Taken from https://gitlab.e.foundation/e/tools/heimdall/-/tree/new_master ]
2021-05-03 14:53:19 +02:00
Henrik Grimler 9bff064d40 CMake: bump minimum version
Mostly because 2.8.4 will be deprecated in the not too far future
2021-05-03 14:07:33 +02:00
Benjamin Dobell 8709370bc4 It's 2017. Where did the years go? 2017-05-12 03:47:37 +10:00
vaselo 4be0c30302 Fixed libpit array overflows 2016-02-08 09:05:32 +02:00
Benjamin Dobell b22ae7b89f Removed autotools and VS files, and standardised source dir naming 2015-02-19 04:13:33 +11:00
Benjamin Dobell 09ba183922 Update Heimdall CLI build to use an MSYS2 environment 2015-02-19 02:49:11 +11:00
Benjamin Dobell 1ddfdc1a88 CMake files for Heimdall CLI and mingw support 2014-11-17 07:02:39 +11:00
Benjamin Dobell 9f957a1937 Updated copyright notices to 2014 2014-05-06 22:53:10 +10:00
Benjamin Dobell ca6db9a647 Upgraded to libusb-1.0 (1.0.18) post libusbx merge. 2014-05-06 21:39:07 +10:00
Benjamin Dobell a934ad2608 Project file changes (for statically linked vc++ library builds). 2014-05-06 21:39:04 +10:00
Benjamin Dobell 3af0c3ad63 Minor code clean up. 2014-05-06 21:39:04 +10:00
Benjamin Dobell 910ae1d1fe After swapping to clang for OS X, I've now swapped to GNU GCC 4.7+, instead of Apple's out-dated version. 2013-06-08 18:04:12 +10:00
Benjamin Dobell 07dcba54fc Update copyright notices, version identifier and documentation for 1.4.0 release. 2013-05-13 00:08:30 +10:00
Benjamin Dobell 55d6c9551e Fixed two major bugs in libpit related functionality:
- Partitions were being excluded from flashing (and UI) if the block-count
  was zero. Instead this is now done using a new IsFlashable() method
  which checks if the partition name is not blank.
- PitData::Pack() was packing the partition name where it should have been
  packing the "flash filename". This resulted in incorrect PIT files being
  flashed to the device.
2013-05-05 20:53:36 +10:00
Benjamin Dobell 973ad82fef Regenerated autoconf files. 2013-03-14 00:18:50 +11:00
Benjamin Dobell e4011af213 Ancient Mac GCC does not support C++11/C++0x. Swapped to using clang on OS X. 2013-03-14 00:09:39 +11:00
Benjamin Dobell f7f29172cb Updated Linux build files and fixed a string formatting warning in Heimdall Frontend. 2013-03-10 02:33:12 +11:00
Benjamin Dobell ebbc3e7cd2 - Removed legacy command line hard-coded partition name parameters.
- As a result of the above two points, there are no "known boot
  partitions", and hence boot partitions are not automatically flashed
  last.
- Made partitions flash in the order in order in which partition arguments
  are specified. Hence, it's recommended that you specify boot partitions
  last.
- Added --usb-level argument that can be used for debugging libusbx, or
  flashing issues in general.
- Removed generally non-functional firmware dumping behaviour.
- Removed auto-resume functionality - Although this feature was definitely
  nice to have; I believe it may be responsible for flashing compatibility
  issues for a variety of devices.
- As a result of the above. In order perform another action after a
  --no-reboot action, you must provide the --resume flag.
- Heimdall Frontend also has support for specifying the --resume flag
  via a GUI. Heimdall Frontend also tries to keep track of your actions
  and enable "Resume" automatically after a "No Reboot" action.
- Refactored quite a few of the actions, and code responsible for flashing
  (particularly PIT file flashing).
- Bumped version to 1.4RC3 *however* this commit is not yet an official
  release candidate. It's still a WIP. In particular build files still
  have not been updated for Linux and OS X.
2013-03-08 00:12:27 +11:00
Benjamin Dobell 4d850a272a - Updated MSVC projects to MSVC2012.
- Changed from libusb-1.0 to libusbx.
- Upgraded to C++11 (defined as C++0x for backwards compatibility with gcc < 4.7).
2013-01-23 00:44:12 +11:00
Benjamin Dobell 31b1b0b2b0 - Changed interpretation of packet size reponses of 0 from meaning "don't
care" to "unsupported".
- Changed block size in libpit to mean either block size or block offset.
2013-01-22 23:53:30 +11:00
Benjamin Dobell 6cd6b35c73 Heimdall 1.4 RC1:
- Massive refactoring.
    - Support for Qualcomm based devices.
    - Print PIT from file.
    - Use partition names as arguments e.g. --HIDDEN, --KERNEL, --MOVINAND etc.
    - Heimdall Frontend UI improvements.
    - And much more...
2012-10-02 01:41:25 +10:00
Benjamin Dobell 66f1e84dd2 Updated version to 1.3.2 and copyright notices to 2012. 2012-03-31 12:22:17 +11:00
Benjamin Dobell 907c942fd1 Renamed partitionType to chipIdentifier as partition type was incorrect. 2012-03-30 00:50:27 +11:00
Benjamin Dobell 8cb7f6ee8f - Added Utilities tab to Heimdall Frontend.
- Fixed Heimdall command line support for PIT files without a reference to themselves.
- Added tool tips to Heimdall Frontend.
- Added heimdall 'info' and 'download-pit' actions.
- Made 'detect' action return 0 if a device is detected, 1 otherwise.
2011-07-17 19:50:07 +10:00
Benjamin Dobell b72bcd3142 1.3 documentation updates and permission fixes. 2011-07-11 22:53:04 +10:00
Benjamin Dobell bf17bbf573 Version 1.3 (beta) 2011-07-09 17:37:36 +10:00
Benjamin Dobell 70c1e8e5ba 1.3 beta 2011-07-08 23:40:28 +10:00
Benjamin Dobell 5ce92c0786 Version 1.3 beta. 2011-07-08 05:02:18 +10:00
Benjamin Dobell b6ffa766b2 Major 1.3 updates 2011-07-06 02:58:28 +10:00