Several GCC warnings were getting generated on various compilers. This
patch solves those warnings.
For various platforms, a uint32_t is not the same as an unsigned int. On
these platforms, printf("%x", (uint32_t)0) generates a warning. Use the
<inttypes.h> formats (i.e. PRIx32) as formatters to silence these warnings.
There was also a security warning picked up by certain compilers when
calling printf(msg) in fernly-usb-loader. This has been fixed.
Finally, lcd.c was refactored to fold the unused lcd_dat_slot() function
into the lcd_cmd_slot() function as a brand-new unified lcd_slot().
Signed-off-by: Sean Cross <xobs@kosagi.com>
cmd-hex: Dump absolute memory address.
This code has been copied-and-pasted across multiple projects, hence the split between
hex_offset() and hex(). This is a fine patch for this project.
Many MTK devices have bootloader connection available only for few seconds
after power-up. To not try to synchronize all of device connection over USB/
power-on and fernly-usb-loader start up, the latter can be run in this "wait"
mode, and a device connected and bootloader start at leisure.
We used to use source files taken from U-Boot to allow for division and
modular arithmetic. With the move to a BSD license, this is no longer
acceptible.
As a workaround, use a libgcc taken from a standard gcc distribution.
Add the .a file, which has not been modified in any way.
Signed-off-by: Sean Cross <xobs@kosagi.com>
This script was used early on to run Fernly on very customized hardware.
Remove it, as it's not relevant anymore.
Signed-off-by: Sean Cross <xobs@kosagi.com>
There is some racy condition where multiple bytes can cause a deadlock.
Until this is figured out, limit the FIFO to 1 byte.
Signed-off-by: Sean Cross <xobs@kosagi.com>
These calls enter into the MT6260 ROM. Explain a bit more about where they
come from and what their function prototypes are.
Signed-off-by: Sean Cross <xobs@kosagi.com>
To interactively communicate with the fernly loader, pass '-s' to the
fernly-usb-loader program. Otherwise it will wait for the shell to
start and then exit.
Signed-off-by: Sean Cross <xobs@kosagi.com>
It's unclear whether this refactor improves things at all, but it's
still limited to 32-byte buffers. Still, it results in less code,
which seems like a good thing.
Signed-off-by: Sean Cross <xobs@kosagi.com>
The set-plls script was running too quickly, and could sometimes
finish before the PLLs were stable. This patch fixes this problem,
in addition to making it clearer what the various settings do.
Signed-off-by: Sean Cross <xobs@kosagi.com>
Make the dqs/dqy values available for printing in other functions, so
we can determine what values were chosen at startup.
Signed-off-by: Sean Cross <xobs@kosagi.com>