2016-05-03 22:18:28 +02:00
|
|
|
# sunxi-tools
|
2016-10-22 15:47:41 +02:00
|
|
|
[](LICENSE.md)
|
2016-05-03 22:18:28 +02:00
|
|
|
[](https://travis-ci.org/linux-sunxi/sunxi-tools)
|
2016-10-22 16:17:04 +02:00
|
|
|
[](https://github.com/linux-sunxi/sunxi-tools/releases)
|
2016-05-03 22:18:28 +02:00
|
|
|
|
2012-05-07 13:08:04 +02:00
|
|
|
Copyright (C) 2012 Alejandro Mery <amery@geeks.cl>
|
2016-10-22 17:01:35 +02:00
|
|
|
<br>For a full list of contributors, see
|
|
|
|
|
[this link](https://github.com/linux-sunxi/sunxi-tools/contributors)
|
|
|
|
|
or use the command `git shortlog -se --no-merges`.
|
2012-05-07 13:08:04 +02:00
|
|
|
|
2016-10-22 17:01:35 +02:00
|
|
|
Tools to help hacking Allwinner A10 (aka sun4i) based devices and
|
|
|
|
|
its successors ([sunxi][]), that's why the 'x' in the package name.
|
2012-05-07 13:04:11 +02:00
|
|
|
|
2016-05-04 22:13:57 +02:00
|
|
|
### sunxi-fexc
|
|
|
|
|
`.fex` file (de)compiler
|
2012-05-11 16:30:41 +02:00
|
|
|
|
2016-05-04 22:13:57 +02:00
|
|
|
Usage: ./sunxi-fexc [-vq] [-I <infmt>] [-O <outfmt>] [<input> [<output>]]
|
2012-05-11 16:30:41 +02:00
|
|
|
|
|
|
|
|
infmt: fex, bin (default:fex)
|
|
|
|
|
outfmt: fex, bin (default:bin)
|
|
|
|
|
|
2016-05-04 22:13:57 +02:00
|
|
|
### bin2fex
|
|
|
|
|
compatibility shortcut to call `sunxi-fexc` to decompile a _script.bin_
|
|
|
|
|
blob back into `.fex` format used by Allwinner's SDK to configure
|
|
|
|
|
the boards.
|
2012-05-07 13:04:11 +02:00
|
|
|
|
2016-05-04 22:13:57 +02:00
|
|
|
### fex2bin
|
|
|
|
|
compatiblity shortcut to call `sunxi-fexc` to compile a `.fex` file
|
|
|
|
|
into the binary form used by the legacy 3.4 kernel ("linux‑sunxi").
|
2012-05-07 13:04:11 +02:00
|
|
|
|
2016-05-04 22:13:57 +02:00
|
|
|
### sunxi-fel
|
|
|
|
|
script interface for talking to the FEL USB handler built in to
|
|
|
|
|
the CPU. You activate [FEL mode] by pushing the _uboot_ / _recovery_
|
|
|
|
|
button at poweron. See http://linux-sunxi.org/FEL/USBBoot for
|
|
|
|
|
a detailed usage guide.
|
2013-05-16 01:36:49 +02:00
|
|
|
|
2016-05-04 22:13:57 +02:00
|
|
|
### fel-gpio
|
|
|
|
|
Simple wrapper (script) around `fel-pio` and `sunxi-fel`
|
|
|
|
|
to allow GPIO manipulations via FEL
|
2013-05-16 01:53:10 +02:00
|
|
|
|
2016-05-04 22:13:57 +02:00
|
|
|
### fel-sdboot
|
|
|
|
|
ARM native sdcard bootloader forcing the device into FEL mode
|
2012-09-08 02:11:12 +02:00
|
|
|
|
2016-05-12 01:54:04 +03:00
|
|
|
### uart0-helloworld-sdboot
|
|
|
|
|
ARM native sdcard bootloader, which is only printing a short "hello"
|
|
|
|
|
message to the UART0 serial console. Because it relies on runtime
|
|
|
|
|
SoC type detection, this single image is bootable on a wide range of
|
|
|
|
|
Allwinner devices and can be used for testing. Additionally, it may
|
|
|
|
|
serve as a template/example for developing simple bare metal code
|
|
|
|
|
(LED blinking and other similar GPIO related things).
|
|
|
|
|
|
2016-05-04 22:13:57 +02:00
|
|
|
### fel-pio
|
|
|
|
|
ARM native helper (binary) for `fel-gpio`
|
2012-09-08 02:11:12 +02:00
|
|
|
|
2016-05-04 22:13:57 +02:00
|
|
|
### sunxi-pio
|
|
|
|
|
Manipulate PIO register dumps
|
2012-09-08 02:11:12 +02:00
|
|
|
|
2016-05-04 22:13:57 +02:00
|
|
|
### sunxi-nand-part
|
|
|
|
|
Tool for manipulating Allwinner NAND partition tables
|
|
|
|
|
|
2016-05-30 16:56:28 +02:00
|
|
|
### sunxi-nand-image-builder
|
|
|
|
|
Tool used to create raw NAND images (including boot0 images)
|
|
|
|
|
|
2016-05-04 22:13:57 +02:00
|
|
|
### jtag-loop.sunxi
|
|
|
|
|
ARM native boot helper to force the SD port into JTAG and then stop,
|
|
|
|
|
to ease debugging of bootloaders.
|
|
|
|
|
|
|
|
|
|
### sunxi-bootinfo
|
|
|
|
|
Dump information from Allwinner boot files (_boot0_ / _boot1_)
|
2012-09-08 02:11:12 +02:00
|
|
|
|
|
|
|
|
--type=sd include SD boot info
|
|
|
|
|
--type=nand include NAND boot info (not implemented)
|
2012-07-13 03:38:53 +02:00
|
|
|
|
2016-05-04 22:13:57 +02:00
|
|
|
### phoenix_info
|
|
|
|
|
gives information about a phoenix image created by the
|
|
|
|
|
phoenixcard utility and optionally extracts the embedded boot
|
|
|
|
|
code & firmware file from their hidden partitions.
|
|
|
|
|
|
|
|
|
|
### sunxi-meminfo
|
|
|
|
|
Tool for reading DRAM settings from registers. Compiled as a
|
|
|
|
|
static binary for use on android and other OSes.
|
|
|
|
|
To build this, get a toolchain and run:
|
|
|
|
|
|
|
|
|
|
make CROSS_COMPILE=arm-linux-gnueabihf- sunxi-meminfo
|
2012-07-03 08:30:35 +02:00
|
|
|
|
2016-05-04 22:13:57 +02:00
|
|
|
### sunxi-script_extractor
|
|
|
|
|
A simple tool, which can be executed on a rooted Android device
|
|
|
|
|
to dump the _script.bin_ blob from RAM via reading _/dev/mem_.
|
|
|
|
|
To build this, get a toolchain and run:
|
2014-08-10 15:44:45 +02:00
|
|
|
|
2016-05-04 22:13:57 +02:00
|
|
|
make CROSS_COMPILE=arm-linux-gnueabihf- sunxi-script_extractor
|
|
|
|
|
---
|
2015-08-30 02:18:57 +03:00
|
|
|
|
2016-10-28 15:29:15 +02:00
|
|
|
## Building
|
|
|
|
|
|
|
|
|
|
Compilation requires the development version of *libusb-1.0* (include header
|
|
|
|
|
and library) to be installed for `sunxi-fel`. Unless you explicitly pass
|
|
|
|
|
*LIBUSB_CFLAGS* and *LIBUSB_LIBS* to the make utility, `pkg-config` is also
|
|
|
|
|
needed.
|
|
|
|
|
|
|
|
|
|
Available build targets:
|
|
|
|
|
|
|
|
|
|
* `make tools`
|
|
|
|
|
builds tools that are useful on the host. This is what most people will want,
|
|
|
|
|
and our default target (when simply using `make`).
|
|
|
|
|
|
|
|
|
|
* `make target-tools`
|
|
|
|
|
builds tools that are intended for the target (Allwinner SoC), using a
|
|
|
|
|
cross-compiler. The toolchain prefix *CROSS_COMPILE* defaults to `arm-none-eabi-`,
|
|
|
|
|
adjust it if needed.
|
|
|
|
|
<br>_Hint:_ When compiling 'natively' on the target platform you may
|
|
|
|
|
simply use an empty toolchain prefix here (`make target-tools CROSS_COMPILE=`
|
|
|
|
|
or `make all CROSS_COMPILE=`).
|
|
|
|
|
|
|
|
|
|
* `make all`
|
|
|
|
|
builds both *tools* and *target-tools*.
|
|
|
|
|
|
|
|
|
|
* `make install-tools`
|
|
|
|
|
builds *tools* and then copies/installs them to a filesystem location. The
|
|
|
|
|
destination is affected by settings for `DESTDIR`, `PREFIX` and possibly
|
|
|
|
|
`BINDIR`. For details, please refer to the *Makefile*.
|
|
|
|
|
You may use `make install` as a shortcut for this.
|
|
|
|
|
|
|
|
|
|
* `make install-target-tools`
|
|
|
|
|
builds *target-tools* and then copies/installs them to a filesystem location
|
|
|
|
|
selected by `DESTDIR`, `PREFIX` and possibly `BINDIR` - see `make install-tools`
|
|
|
|
|
above.
|
|
|
|
|
|
|
|
|
|
* `make install-all`
|
|
|
|
|
builds and installs both *tools* and *target-tools*.
|
|
|
|
|
|
|
|
|
|
* `make misc`
|
|
|
|
|
builds miscellaneous (host) utilities that are not part of our 'standard' suite.
|
2016-10-29 12:20:04 +02:00
|
|
|
Currently this means `phoenix_info` and `sunxi-nand-image-builder`.
|
2016-10-28 15:29:15 +02:00
|
|
|
|
|
|
|
|
* `make install-misc`
|
|
|
|
|
builds *misc* and installs the resulting binaries.
|
|
|
|
|
|
2016-05-04 22:13:57 +02:00
|
|
|
## License
|
2012-06-15 22:34:22 +02:00
|
|
|
This software is licensed under the terms of GPLv2+ as defined by the
|
2016-10-22 15:47:41 +02:00
|
|
|
Free Software Foundation, details can be read in the [LICENSE.md](LICENSE.md)
|
|
|
|
|
file.
|
2016-05-03 22:18:28 +02:00
|
|
|
|
2016-10-22 17:01:35 +02:00
|
|
|
[sunxi]: http://linux-sunxi.org
|
2016-05-04 22:13:57 +02:00
|
|
|
[fel mode]: http://linux-sunxi.org/FEL
|