cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
11,141 Views
Registered: ‎10-14-2015

application for enabling/disabling jtag port through devcfg control register

Jump to solution

Hi,

at the end of xapp1175 (secure boot) there is an interesting suggestion about how to enable and disable jtag port at request from a technician on the field. the xapp suggest to use an interrupt routine that, when pressing a push button, it toogles bit 23 in devcfg control register (address 0xf8007000).

on our custom board we don't have buttons, so I am trying to write a linux application that could do the same.

 

my problem is, how can I access xdevcfg control register  from userspace?

 

kernel driver only manages bitstream files loading, if I  access /dev/xdevcfg opening the file or through mmap the board completely reset when I try to read anything.

 

Best regards,

Rocco

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Scholar
Scholar
21,533 Views
Registered: ‎05-28-2013

Hi Rocco,

 

A simple way to access physical registers from userspace is the "devmem" program. It is almost certainly already included. To read the register:

devmem 0xf8007000

To perform a write, where 0x12345678 is the value you want to write:

devmem 0xf8007000 32 0x12345678

If you want to do it from C code, the source code for devmem is easy to incorporate.

 

Note that devmem program is intended for debugging. If you need to write a lot of data, calling it many times is not efficient. But if you just need to poke a register or two, it is very convenient.

View solution in original post

0 Kudos
2 Replies
Highlighted
Scholar
Scholar
21,534 Views
Registered: ‎05-28-2013

Hi Rocco,

 

A simple way to access physical registers from userspace is the "devmem" program. It is almost certainly already included. To read the register:

devmem 0xf8007000

To perform a write, where 0x12345678 is the value you want to write:

devmem 0xf8007000 32 0x12345678

If you want to do it from C code, the source code for devmem is easy to incorporate.

 

Note that devmem program is intended for debugging. If you need to write a lot of data, calling it many times is not efficient. But if you just need to poke a register or two, it is very convenient.

View solution in original post

0 Kudos
Highlighted
Explorer
Explorer
10,976 Views
Registered: ‎10-14-2015

thank you very much!

0 Kudos