8 Commits

Author SHA1 Message Date
Bjorn Andersson
156d9673a2 ramdump: Provide some user feedback
Dumping all the DDR takes significant time and there's currently no
user-visible feedback provided to indicate that even the process has
started.

Solve this by wiring up the ux module and provide a progress bar while
dumping segments, as well as information as the segments are skipped or
dumped.

Add missing ux_init() to the ramdump setup, and make sure to clamp value
to max in the progress calculation, to avoid funky issues when progress
is made beyond the size of the chunk.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2026-02-02 12:23:24 -06:00
Igor Opaniuk
25562d208d qdl: move MIN and ROUND_UP macros
Move MIN and ROUND_UP macros to avoid code duplication.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2025-06-24 20:15:20 +02:00
Igor Opaniuk
ec418a144f spdx: add missing license identifiers
Add missing SPDX license identifiers to source files.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2025-06-24 20:15:20 +02:00
Igor Opaniuk
adf906c646 ux: address checkpatch issues
CHECK: Macro argument reuse 'x' - possible side-effects?
+#define MIN(x, y) ((x) < (y) ? (x) : (y))

CHECK: Macro argument reuse 'y' - possible side-effects?
+#define MIN(x, y) ((x) < (y) ? (x) : (y))

CHECK: line length of 167 exceeds 120 columns
+static const char * const progress_hashes = "########################################################################################################################";

CHECK: line length of 167 exceeds 120 columns
+static const char * const progress_dashes = "------------------------------------------------------------------------------------------------------------------------";

WARNING: please, no spaces at the start of a line
+    CONSOLE_SCREEN_BUFFER_INFO csbi;$

WARNING: please, no spaces at the start of a line
+    HANDLE stdoutHandle = GetStdHandle(STD_OUTPUT_HANDLE);$

WARNING: please, no spaces at the start of a line
+    if (GetConsoleScreenBufferInfo(stdoutHandle, &csbi)) {$

WARNING: suspect code indent for conditional statements (4, 16)
+    if (GetConsoleScreenBufferInfo(stdoutHandle, &csbi)) {
+		columns = csbi.srWindow.Right - csbi.srWindow.Left + 1;

WARNING: please, no spaces at the start of a line
+    }$

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2025-06-24 20:15:15 +02:00
Igor Opaniuk
cdcdc51a3d checkpatch: address all obvious issues
Address all obvious coding style issues caught by checkpatch.pl tool.
sha2.c and sha2.h were kept as there are.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2025-06-21 21:32:25 +02:00
Julien Vanier
b3dccab6a6 Add Windows compatibility
Make build compatible with Windows using MSYS2 MINGW64 compiler. Add a small compatibility file for functions that don't exist in MINGW64.

Signed-off-by: Julien Vanier <jvanier@gmail.com>
2025-05-02 19:00:09 -04:00
Bjorn Andersson
8c32a74086 ux: Introduce progress indicator
Not providing any user feedback during flashing is not very user
friendly, in particular when, in some situations, it can take minutes to
flash very large files.

Introduce a progress bar for the flashing and patching steps to provide
such feedback to the user, when stdout is determined to be a terminal of
sufficient size (i.e. tools programmatically invoking qdl should see no
difference).

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2024-12-20 11:18:34 -06:00
Bjorn Andersson
0e08e852bf ux: Introduce user experience wrappers
Rather than sprinkling the user experience decisions across the
implementation with prints to stdout, stderr, conditional checks for
qdl_debug etc, consolidate these into a single set of ux wrappers.

Transition all callers of printf() and fprintf() to these new wrappers,
without changing the level of content of the printouts.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
2024-12-20 11:18:34 -06:00