diff mbox

[U-Boot,3/5] Add 'Wait for JTAG user' if booted in JTAG mode

Message ID 1421841318-3014-4-git-send-email-gruss@tss-engineering.com
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Graeme Russ Jan. 21, 2015, 11:55 a.m. UTC
When booting in JTAG mode, there is no way to use soft break-points, and
no way of knowing when SPL has finished executing (so the user can issue
a 'halt' command to load u-boot.bin for example)

Add a debug output and simple loop to stop execution at the completion of
the SPL initialisation as a pseudo break-point when booting in JTAG mode

Signed-off-by: Graeme Russ <gruss@tss-engineering.com>
---

 arch/arm/cpu/arm926ejs/mxs/spl_boot.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Stefan Roese Jan. 21, 2015, 3:35 p.m. UTC | #1
On 21.01.2015 12:55, Graeme Russ wrote:
> When booting in JTAG mode, there is no way to use soft break-points, and
> no way of knowing when SPL has finished executing (so the user can issue
> a 'halt' command to load u-boot.bin for example)
>
> Add a debug output and simple loop to stop execution at the completion of
> the SPL initialisation as a pseudo break-point when booting in JTAG mode
>
> Signed-off-by: Graeme Russ <gruss@tss-engineering.com>
> ---
>
>   arch/arm/cpu/arm926ejs/mxs/spl_boot.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
> index 2a5f817..7bfc623 100644
> --- a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
> +++ b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
> @@ -157,6 +157,12 @@ void mxs_common_spl_init(const uint32_t arg, const uint32_t *resptr,
>   	data->boot_mode_idx = bootmode;
>
>   	mxs_power_wait_pswitch();
> +
> +

Nitpicking, but please don't add 2 empty lines.

> +	if (mxs_boot_modes[data->boot_mode_idx].boot_pads == 0x06) {

Would it be possible to add a macro here instead of using this fixed 0x06?

> +		debug("SPL: Waiting for JTAG user\n");
> +		asm volatile ("x: b x");
> +	}

Thanks.
Stefan
diff mbox

Patch

diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
index 2a5f817..7bfc623 100644
--- a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
+++ b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
@@ -157,6 +157,12 @@  void mxs_common_spl_init(const uint32_t arg, const uint32_t *resptr,
 	data->boot_mode_idx = bootmode;
 
 	mxs_power_wait_pswitch();
+
+
+	if (mxs_boot_modes[data->boot_mode_idx].boot_pads == 0x06) {
+		debug("SPL: Waiting for JTAG user\n");
+		asm volatile ("x: b x");
+	}
 }
 
 /* Support aparatus */