Enabling JTAG on Beaglebone Classic (White) with newer kernels

61 vistas
Ir al primer mensaje no leído

Brendan Dolan-Gavitt

no leída,
11 ago 2020, 5:13:55 p.m.11/8/20
para BeagleBoard
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.

Thanks,
Brendan

[2] As found in the AM335x TRM: https://www.ti.com/lit/ug/spruh73q/spruh73q.pdf

Robert Nelson

no leída,
11 ago 2020, 5:55:49 p.m.11/8/20
para Beagle Board
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.

Jtag is disabled by default, just un-comment:

https://github.com/beagleboard/BeagleBoard-DeviceTrees/blob/v4.19.x-ti/src/arm/am335x-bone.dts#L9

you'll find your matching device-tree's under /opt/source/dtb*

Regards,

--
Robert Nelson
https://rcn-ee.com/
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos