- 28 Dec, 2016 13 commits
-
-
Bernhard Nortmann authored
This also obsoletes fel-copy.c - for details see issue #78. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
The functions represent ARM "thunk" code that can be invoked via FEL to execute arbitrary memory copy operations on the target device, i.e. they deal with overlap and unaligned access. Where possible, the copy operation will use (32-bit) word transfers, otherwise it falls back to bytewise copying. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
NiteHawk authored
SID fix / H3 workaround
-
Bernhard Nortmann authored
Also includes an updated uart0-helloworld-sdboot.sunxi binary. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Icenowy Zheng authored
With fixed SID reading routine, it's now possible to differ H2+ with H3 with SID. Tested on an Orange Pi One and an Orange Pi Zero. Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
-
Bernhard Nortmann authored
The patch also introduces a "sid-register" command for diagnostic purposes. It allows to use/enforce the workaround method for other SoCs, to check if there are any inconsistencies with the values read from memory. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
The new function fel_get_sid_registers() uses ARM code for register access to the SID root key. This is necessary to retrieve correct values for certain SoCs, e.g. when not using this approach the H3 has been observed to return 'mangled' values (when reading SID from memory). See https://groups.google.com/forum/#!topic/linux-sunxi/ynyIP8c61Qs The FEL library provides a uniform fel_get_sid_root_key() wrapper that will automatically use the workaround method for SoCs that are tagged accordingly - so the application program does not have to bother with selecting memory vs. register-based access. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Icenowy Zheng authored
H3 SID controller has some bug, that makes the initial value at 0x01c14200 wrong. This commit workarounds this bug by reading them with register access first. Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz> Reviewed-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
This is a preparatory step. Instead of using memory-based access, we might want to retrieve SID keys (e-fuses) via SID registers. For this, it's convenient if the plain base address is available. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
NiteHawk authored
Add support for Allwinner V3s, which is similar to A10/A13/A20 in terms of SRAM mapping and SID address.
-
Icenowy Zheng authored
Add the SoC ID and UART0 pinmux for V3s. Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
-
Icenowy Zheng authored
The V3s SoC looks like A10/13/20 in SRAM mapping and SID address. Add support for it. Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
-
- 21 Dec, 2016 1 commit
-
-
NiteHawk authored
fel: Improve on handling invalid options
-
- 13 Dec, 2016 2 commits
-
-
Bernhard Nortmann authored
This is to make sure that users get notified accordingly if the "sunxi-fel --list" doesn't find any FEL devices. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
For unknown option-style arguments (starting with '-'), exit after printing an error message. This avoids situations where sunxi-fel would not report incorrect options (with no FEL device attached/detected) and fail with "Allwinner USB FEL device not found" instead, which is undesirable. TODO: Might have to eventually migrate this to some better argument parsing, e.g. getopt(3) or something similar. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
- 07 Dec, 2016 2 commits
-
-
Bernhard Nortmann authored
fel: - Minor review of ARM scratch code - POSIX conformance: Use nanosleep() instead of deprecated usleep() README: - revert Unicode dash to standard ASCII Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
- 01 Dec, 2016 5 commits
-
-
Bernhard Nortmann authored
Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
NiteHawk authored
Make use of FEL library to implement device enumeration and selection by SID
-
Bernhard Nortmann authored
Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
"./sunxi-fel --list" enumerates Allwinner USB devices that are in FEL mode. For each device detected, the SoC name/ID and - if available - the SID key will be printed to stdout. The utility then exits with status code 0 (upon success), or 1 if no devices were found. The current implementation treats the list feature as an option, to be able to handle it *before* the first attempt to call feldev_open() - which could fail (with no FEL devices connected). However, a "list" alias is available for users who expect this to be 'command' syntax, so "./sunxi-fel list" works too. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
- 29 Nov, 2016 16 commits
-
-
Bernhard Nortmann authored
Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
open_fel_device() will automatically provide this member field, based on the SoC ID from FEL/BROM version data. The field will either receive a human-readable identifier, or the ID in 4-digit hexadecimal representation (for unknown SoCs). Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
The feldev_handle struct returned by feldev_open() will now contain this additional data, so the main application no longer needs to care about retrieving that. aw_fel_get_version() has thus become a static (= 'private') function. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
The FEL utility had accumulated enough (mostly USB-related) "low-level" code to justify moving that to a separate code unit. This will allow us to keep better focus on the higher level functionality in fel.c. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
This moves claiming / releasing the interface into the respective "open" / "close" functions. The USB code in main() is now trimmed down to: feldev_init(); handle = open_fel_device(...); feldev_done(handle); Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
We move USB endpoint detection into the feldev_claim() routine, so higher level code is no longer involved with that. Also make use of the "detached" flag within feldev_handle, instead of relying on an isolated variable. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
This enables us to move forward to a cleaner implementation, where the "core" fel.c code will become independent of direct libusb usage. After moving USB code to a separate module, in the end the libusb handle could become an 'opaque' field of feldev_handle. The "device" handle might also be extended later, to provide (FEL) version data and SoC-specific information (chip ID, SRAM info, human-readable name). Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
-
Bernhard Nortmann authored
Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Bernhard Nortmann authored
See pull requests #59 and #83. It looks like various BSD derivates have adopted the more common naming conventions for the endian conversion macros, which means that we would attempt to redefine them without need (potentially even to 'historic' names that no longer exist). Try to avoid this by properly checking for existing functions first. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-
Chen-Yu Tsai authored
The SID block in the A80 is at 0x01c0e000, with the e-fuses we care about at offset 0x200 within the block. Signed-off-by: Chen-Yu Tsai <wens@csie.org>
-
Siarhei Siamashka authored
R40 support for fel and uart0-helloworld
-
Chen-Yu Tsai authored
The R40 is the same as the A20 for all intents and purposes of uart0-helloworld. Add R40's SOC ID. Signed-off-by: Chen-Yu Tsai <wens@csie.org>
-
Chen-Yu Tsai authored
The R40 is marketed as the successor to the A20. The SRAM layout is the same as the A20, but there doesn't seem to be a secure SRAM block. The SID block is at a completely different address. The layout is the same as the newer SoCs, with the e-fuses at an offset of 0x200. Signed-off-by: Chen-Yu Tsai <wens@csie.org>
-
- 19 Nov, 2016 1 commit
-
-
Bernhard Nortmann authored
These functions solve the problem that large readl/writel transfers might be limited by insufficient (scratch) buffer size. To solve this, chunks of no more than LCODE_MAX_WORDS get transferred individually. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
-