On Tue, Aug 11, 2020 at 4:14 PM Brendan Dolan-Gavitt <
moo...@gmail.com> wrote:
>
> Hi,
>
> I've been trying to get JTAG working on the Beaglebone classic. It works using the 2012 Angstrom distribution [1], but not on the newer Debian-based distributions. I eventually managed to track this down to the fact the kernel sets the lowest two bits of the CM_WKUP_DEBUGSS_CLKCTRL [2] register (located at 0x44e00414) to 0, which powers off the debug hardware on the AM335x.
>
> I was able to get JTAG working again by writing a small kernel module that sets the register to the value it has when the board is reset (though I *think* it would be sufficient to just set the last two bits to 0b10):
>
> void __iomem *io = ioremap(0x44e00000, SZ_4K);
> iowrite32(0x52580002, io + 0x414);
> iounmap(io);
>
> My question is: is there any way to stop the Linux kernel from disabling JTAG automatically on startup? I know it happens sometime during the boot process (if I stop during U-Boot, JTAG works and the CM_WKUP_DEBUGSS_CLKCTRL has its default value), but I can't figure out what to change in the DTB or the kernel source to prevent this.