2016-05-04 04:18:28 +08:00
|
|
|
# sunxi-tools
|
2016-10-22 21:47:41 +08:00
|
|
|
[![License](http://img.shields.io/badge/License-GPL-green.svg)](LICENSE.md)
|
2016-05-04 04:18:28 +08:00
|
|
|
[![Build Status](https://travis-ci.org/linux-sunxi/sunxi-tools.svg?branch=master)](https://travis-ci.org/linux-sunxi/sunxi-tools)
|
2016-10-22 22:17:04 +08:00
|
|
|
[![Releases](https://img.shields.io/github/release/linux-sunxi/sunxi-tools.svg)](https://github.com/linux-sunxi/sunxi-tools/releases)
|
2016-11-17 00:24:58 +08:00
|
|
|
[![Commits](https://img.shields.io/github/commits-since/linux-sunxi/sunxi-tools/v1.4.svg)](https://github.com/linux-sunxi/sunxi-tools/compare/v1.4...master)
|
2016-05-04 04:18:28 +08:00
|
|
|
|
2012-05-07 19:08:04 +08:00
|
|
|
Copyright (C) 2012 Alejandro Mery <amery@geeks.cl>
|
2016-10-22 23:01:35 +08: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 19:08:04 +08:00
|
|
|
|
2016-11-14 03:28:43 +08:00
|
|
|
Command line utilities to work with devices based on [Allwinner SoC]s:
|
|
|
|
sun4i, sun5i, ... - that's why the 'x' in the package name.
|
2012-05-07 19:04:11 +08:00
|
|
|
|
2016-05-05 04:13:57 +08:00
|
|
|
### sunxi-fexc
|
|
|
|
`.fex` file (de)compiler
|
2012-05-11 22:30:41 +08:00
|
|
|
|
2016-05-05 04:13:57 +08:00
|
|
|
Usage: ./sunxi-fexc [-vq] [-I <infmt>] [-O <outfmt>] [<input> [<output>]]
|
2012-05-11 22:30:41 +08:00
|
|
|
|
|
|
|
infmt: fex, bin (default:fex)
|
|
|
|
outfmt: fex, bin (default:bin)
|
|
|
|
|
2016-05-05 04:13:57 +08: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 19:04:11 +08:00
|
|
|
|
2016-05-05 04:13:57 +08:00
|
|
|
### fex2bin
|
|
|
|
compatiblity shortcut to call `sunxi-fexc` to compile a `.fex` file
|
2016-12-07 15:19:13 +08:00
|
|
|
into the binary form used by the legacy 3.4 kernel ("linux-sunxi").
|
2012-05-07 19:04:11 +08:00
|
|
|
|
2016-05-05 04:13:57 +08:00
|
|
|
### sunxi-fel
|
2016-12-02 00:07:09 +08:00
|
|
|
script interface for USB communication with the FEL handler built in to
|
|
|
|
the CPU. You usually activate [FEL mode] by pushing the _uboot_ / _recovery_
|
|
|
|
button at poweron, or by having your device "fail over" to FEL when no other
|
|
|
|
boot option is available. See http://linux-sunxi.org/FEL/USBBoot for a detailed
|
|
|
|
usage guide.
|
|
|
|
|
|
|
|
When called with no arguments, _sunxi-fel_ will display a short usage summary.
|
|
|
|
|
|
|
|
_Note:_ Unless you select a specific device using the `--dev` or `--sid`
|
|
|
|
options, the tool will access the first Allwinner device (in FEL mode) that it
|
|
|
|
finds. You can print a list of all FEL devices currently connected/detected
|
2016-12-13 21:10:14 +08:00
|
|
|
with `./sunxi-fel --list --verbose`.
|
2013-05-16 07:36:49 +08:00
|
|
|
|
2016-05-05 04:13:57 +08:00
|
|
|
### fel-gpio
|
|
|
|
Simple wrapper (script) around `fel-pio` and `sunxi-fel`
|
|
|
|
to allow GPIO manipulations via FEL
|
2013-05-16 07:53:10 +08:00
|
|
|
|
2016-05-05 04:13:57 +08:00
|
|
|
### fel-sdboot
|
|
|
|
ARM native sdcard bootloader forcing the device into FEL mode
|
2012-09-08 08:11:12 +08:00
|
|
|
|
2016-05-12 06:54:04 +08: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-05 04:13:57 +08:00
|
|
|
### fel-pio
|
|
|
|
ARM native helper (binary) for `fel-gpio`
|
2012-09-08 08:11:12 +08:00
|
|
|
|
2016-05-05 04:13:57 +08:00
|
|
|
### sunxi-pio
|
|
|
|
Manipulate PIO register dumps
|
2012-09-08 08:11:12 +08:00
|
|
|
|
2016-05-05 04:13:57 +08:00
|
|
|
### sunxi-nand-part
|
|
|
|
Tool for manipulating Allwinner NAND partition tables
|
|
|
|
|
2016-05-30 22:56:28 +08:00
|
|
|
### sunxi-nand-image-builder
|
|
|
|
Tool used to create raw NAND images (including boot0 images)
|
|
|
|
|
2016-05-05 04:13:57 +08: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 08:11:12 +08:00
|
|
|
|
|
|
|
--type=sd include SD boot info
|
|
|
|
--type=nand include NAND boot info (not implemented)
|
2012-07-13 09:38:53 +08:00
|
|
|
|
2016-05-05 04:13:57 +08: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 14:30:35 +08:00
|
|
|
|
2016-05-05 04:13:57 +08: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 21:44:45 +08:00
|
|
|
|
2016-05-05 04:13:57 +08:00
|
|
|
make CROSS_COMPILE=arm-linux-gnueabihf- sunxi-script_extractor
|
|
|
|
---
|
2015-08-30 07:18:57 +08:00
|
|
|
|
2016-10-28 21:29:15 +08: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 18:20:04 +08:00
|
|
|
Currently this means `phoenix_info` and `sunxi-nand-image-builder`.
|
2016-10-28 21:29:15 +08:00
|
|
|
|
|
|
|
* `make install-misc`
|
|
|
|
builds *misc* and installs the resulting binaries.
|
|
|
|
|
2016-05-05 04:13:57 +08:00
|
|
|
## License
|
2012-06-16 04:34:22 +08:00
|
|
|
This software is licensed under the terms of GPLv2+ as defined by the
|
2016-10-22 21:47:41 +08:00
|
|
|
Free Software Foundation, details can be read in the [LICENSE.md](LICENSE.md)
|
|
|
|
file.
|
2016-05-04 04:18:28 +08:00
|
|
|
|
2016-11-14 03:28:43 +08:00
|
|
|
[allwinner soc]: http://linux-sunxi.org/Allwinner_SoC_Family
|
2016-05-05 04:13:57 +08:00
|
|
|
[fel mode]: http://linux-sunxi.org/FEL
|