Disabling JTAG Interface on Custom i.MX6Q Hardware

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Disabling JTAG Interface on Custom i.MX6Q Hardware

Jump to solution
741 Views
Divyansh_Rai
Contributor II

Hi NXP Community,

I am attempting to disable the JTAG interface on the i.MX6Q processor. According to the reference manual, the JTAG signals—JTAG_MOD, JTAG_TCK, JTAG_TMS, JTAG_TDI, and JTAG_TDO—do not support pin multiplexing. However, the JTAG_DE_B signal does support muxing and can be configured through the Pad Mux Register at IOMUXC_SW_MUX_CTL_PAD_GPIO16. This is also reflected in the imx6q-pinfunc.h file.

I would like to confirm whether it is possible to disable the JTAG interface by repurposing the JTAG_DE_B pin through pin multiplexing—for example, by switching its MUX mode from ALT7 (JTAG_DE_B) to ALT5 (GPIO7_IO11).

Labels (1)
0 Kudos
Reply
1 Solution
646 Views
Divyansh_Rai
Contributor II

Hi @Rita_Wang,

The issue is resolved now. I am able to write the JTAG Pad Ctrl registers from the u-boot using md/mw command and also I have made those changes in the u-boot source code in the mx6_horizon.c file as below:

writel(0x3060, (void *)0x20E0678);	// JTAG_TMS
writel(0x3060, (void *)0x20E067C);	// JTAG_MOD
writel(0x3060, (void *)0x20E0680);	// JTAG_TRSTB
writel(0x3060, (void *)0x20E0684);	// JTAG_TDI
writel(0x3060, (void *)0x20E0688);	// JTAG_TCK
writel(0x80B1, (void *)0x20E068C);	// JTAG_TDO

Thank you for the support.

View solution in original post

5 Replies
737 Views
Rita_Wang
NXP TechSupport
NXP TechSupport
This method does not disable the JTAG hardware itself—it only prevents it from being enabled via the JTAG_DE_B signal.
For stronger security, consider:
  • Blowing the SJC_DISABLE fuse (irreversible).
  • Leaving JTAG pins unconnected on your board.
  • Using secure boot to prevent unauthorized code execution.
0 Kudos
Reply
719 Views
Divyansh_Rai
Contributor II

Hi @Rita_Wang,

Thank you for your prompt and helpful response.

As disabling JTAG via Secure JTAG (Blowing the SJC_DISABLE fuse) is an irreversible action, I’m exploring a less permanent, software-based approach. My intention is to weaken the electrical drive strength or alter the pad settings of the core JTAG signals to make external access more difficult.

To achieve this, I defined the relevant JTAG pin macros in the imx6q-pinfunc.h header like below:

#define MX6QDL_PAD_JTAG_TMS__JTAG_TMS	  0x000 0x678 0x000 0x0 0x0
#define MX6QDL_PAD_JTAG_MOD__JTAG_MOD	  0x000 0x67C 0x000 0x0 0x0
#define MX6QDL_PAD_JTAG_TRSTB__JTAG_TRSTB 0x000 0x680 0x000 0x0 0x0
#define MX6QDL_PAD_JTAG_TDI__JTAG_TDI	  0x000 0x684 0x000 0x0 0x0
#define MX6QDL_PAD_JTAG_TCK__JTAG_TCK	  0x000 0x688 0x000 0x0 0x0
#define MX6QDL_PAD_JTAG_TDO__JTAG_TDO	  0x000 0x68C 0x000 0x0 0x0

and modified the Pad Control Register settings via the imx6q-horizon.dtsi device tree file like below:

fsl,pins = <
            MX6QDL_PAD_JTAG_TMS__JTAG_TMS      0x00002060
            MX6QDL_PAD_JTAG_MOD__JTAG_MOD      0x00002060
            MX6QDL_PAD_JTAG_TRSTB__JTAG_TRSTB  0x00002060
            MX6QDL_PAD_JTAG_TDI__JTAG_TDI      0x00002060
            MX6QDL_PAD_JTAG_TCK__JTAG_TCK      0x00002060
            MX6QDL_PAD_JTAG_TDO__JTAG_TDO      0x000080B1
        >;

However, after applying these changes, the board fails to boot and hangs at the "Starting kernel ..." log message.

Could you provide any insight into what might be causing this hang? Is it possible that altering pad control settings of non-muxable JTAG pins is interfering with early kernel or SoC initialization?

Thanks again for your guidance.

0 Kudos
Reply
712 Views
Rita_Wang
NXP TechSupport
NXP TechSupport

Could you tell me which version BSP are you using? And how about your JTAG design in your board , can you share the schematic to us? Thanks

0 Kudos
Reply
647 Views
Divyansh_Rai
Contributor II

Hi @Rita_Wang,

The issue is resolved now. I am able to write the JTAG Pad Ctrl registers from the u-boot using md/mw command and also I have made those changes in the u-boot source code in the mx6_horizon.c file as below:

writel(0x3060, (void *)0x20E0678);	// JTAG_TMS
writel(0x3060, (void *)0x20E067C);	// JTAG_MOD
writel(0x3060, (void *)0x20E0680);	// JTAG_TRSTB
writel(0x3060, (void *)0x20E0684);	// JTAG_TDI
writel(0x3060, (void *)0x20E0688);	// JTAG_TCK
writel(0x80B1, (void *)0x20E068C);	// JTAG_TDO

Thank you for the support.

582 Views
Rita_Wang
NXP TechSupport
NXP TechSupport

Dear @Divyansh_Rai ,

Good job! Thanks a lot for your kindly sharing.

Wish you have a nice day

Best Reagrds

Rita

0 Kudos
Reply