devregs - tool to display and modify a device's registers at runtime

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

devregs - tool to display and modify a device's registers at runtime

devregs - tool to display and modify a device's registers at runtime

DEVREGS - Is a tool to display and modify a device's registers at runtime.

Under Linux, you can access registers, or any area of physical memory through the /dev/mem pseudo-device and the wonders of the mmap system call. To use it, you open the /dev/mem device, mmap the page in which a register is located, then use the pointer returned to read and/or write the data. Boundary Devices, developed a tool known as " devregs  " that allows you to put a little structure around this facility. It allows you to give names to particular physical memory areas and to describe the bits within a register in the text file /etc/devregs.dat.

How to read from register :

To read one or more registers, use devregs with a single parameter that’s either an address or a register name.


Ex : $  devregs 0x73f88000

:0x73f88000    =0x803dffaf


If a register address matches a register in /etc/devregs.dat, you’ll see the register name:


Ex : $ devregs 0x73f88000

GPIO2_DR:0x73f88000    =0x803dffaf


If used with a register name, any bitfields defined will be shown:


Ex: devregs UART1_UFCR

UART1_UFCR: 0x73fc0090   =0x0801

UART1_UFCR:0x73fc0090    =0x0801

      TXTL                      10-15     =0x2

      RFDIV                    7 - 9      =0x0

      DCEDTE                 6 - 6     = 0x0

      RXTL                       0 - 5     = 0x1

How to write to register :

Ex : $ devregs GPIO2_GDIR

GPIO2_GDIR:0x73f88004    =0x0002c0a4


Ex: $ devregs GPIO2_GDIR 0x2c0a0

GPIO2_GDIR:0x73f88004    =0x0002c0a4

GPIO2_GDIR:0x73f88004 == 0x0002c0a4...0x0002c0a0


Ex: $ devregs GPIO2_GDIR

GPIO2_GDIR:0x73f88004    =0x0002c0a0

For more detailed information please go through the following below links :

http://boundarydevices.com/i-mx5x-device-register-access/

http://boundarydevices.com/configuring-i-mx6-machines-different-screens-nitrogen6x-sabre-lite/

%3CLINGO-SUB%20id%3D%22lingo-sub-1107121%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Edevregs%20-%20tool%20to%20display%20and%20modify%20a%20device's%20registers%20at%20runtime%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1107121%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%22%3EDEVREGS%20-%20Is%20a%20tool%20to%20display%20and%20modify%20a%20device's%20registers%20at%20runtime.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%20font-size%3A%2016px%3B%22%3EUnder%20Linux%2C%20you%20can%20access%20registers%2C%20or%20any%20area%20of%20physical%20memory%20through%20the%20%2Fdev%2Fmem%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%20font-size%3A%2016px%3B%22%3E%20pseudo-device%20and%20the%20wonders%20of%20the%20mmap%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%20font-size%3A%2016px%3B%22%3Esystem%20call.%20To%20use%20it%2C%20you%20open%20the%20%2Fdev%2Fmem%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%20font-size%3A%2016px%3B%22%3Edevice%2C%20mmap%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%20font-size%3A%2016px%3B%22%3E%20the%20page%20in%20which%20a%20register%20is%20located%2C%20then%20use%20the%20pointer%20returned%20to%20read%20and%2For%20write%20the%20data.%20Boundary%20Devices%2C%20developed%20a%20tool%20known%20as%20%22%20devregs%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%20font-size%3A%2016px%3B%22%3E%26nbsp%3B%20%22%20that%20allows%20you%20to%20put%20a%20little%20structure%20around%20this%20facility.%20It%20allows%20you%20to%20give%20names%20to%20particular%20physical%20memory%20areas%20and%20to%20describe%20the%20bits%20within%20a%20register%20in%20the%20text%20file%20%2Fetc%2Fdevregs.dat.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%22%3E%3CSTRONG%3EHow%20to%20read%20from%20register%20%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%20font-size%3A%2016px%3B%22%3ETo%20read%20one%20or%20more%20registers%2C%20use%20devregs%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%20font-size%3A%2016px%3B%22%3E%20with%20a%20single%20parameter%20that%E2%80%99s%20either%20an%20address%20or%20a%20register%20name.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%20font-size%3A%2016px%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%20font-size%3A%2016px%3B%22%3EEx%20%3A%20%24%26nbsp%3B%20devregs%200x73f88000%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-size%3A%2016px%3B%20font-family%3A%20Consolas%2C%20'Bitstream%20Vera%20Sans%20Mono'%2C%20'Courier%20New'%2C%20Courier%2C%20monospace%3B%22%3E%3A0x73f88000%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D0x803dffaf%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-size%3A%2016px%3B%20font-family%3A%20Consolas%2C%20'Bitstream%20Vera%20Sans%20Mono'%2C%20'Courier%20New'%2C%20Courier%2C%20monospace%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-size%3A%2016px%3B%20font-family%3A%20Consolas%2C%20'Bitstream%20Vera%20Sans%20Mono'%2C%20'Courier%20New'%2C%20Courier%2C%20monospace%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%20font-size%3A%2016px%3B%22%3EIf%20a%20register%20address%20matches%20a%20register%20in%20%3C%2FSPAN%3E%3CCODE%20style%3D%22color%3A%20%23555555%3B%22%3E%2Fetc%2Fdevregs.dat%3C%2FCODE%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%20font-size%3A%2016px%3B%22%3E%2C%20you%E2%80%99ll%20see%20the%20register%20name%3A%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-size%3A%2016px%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-size%3A%2016px%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%22%3EEx%20%3A%20%24%20devregs%20%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%20font-size%3A%2016px%3B%22%3E0x73f88000%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-size%3A%2016px%3B%20font-family%3A%20Consolas%2C%20'Bitstream%20Vera%20Sans%20Mono'%2C%20'Courier%20New'%2C%20Courier%2C%20monospace%3B%22%3EGPIO2_DR%3A0x73f88000%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D0x803dffaf%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-size%3A%2016px%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-size%3A%2016px%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%22%3EIf%20used%20with%20a%20register%20name%2C%20any%20bitfields%20defined%20will%20be%20shown%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-size%3A%2016px%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-size%3A%2016px%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%22%3EEx%3A%20devregs%20UART1_UFCR%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-size%3A%2016px%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23555555%3B%20font-family%3A%20Georgia%2C%20'Times%20New%20Roman'%2C%20Times%2C%20serif%3B%20font-size%3A%2016px%3B%22%3EUART1_UFCR%3A%200%3C%2FSPAN%3Ex73fc0090%26nbsp%3B%26nbsp%3B%20%3D0x0801%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CCODE%20class%3D%22shell%20plain%22%20style%3D%22font-size%3A%201em%20!important%3B%20margin%3A%200%20!important%3B%20padding%3A%200%20!important%3B%20font-family%3A%20Consolas%2C%20'Bitstream%20Vera%20Sans%20Mono'%2C%20'Courier%20New'%2C%20Courier%2C%20monospace%20!important%3B%20color%3A%20black%20!important%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%22%3EUART1_UFCR%3A0x73fc0090%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D0x0801%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20TXTL%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%2010-15%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D0x2%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20RFDIV%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%207%20-%209%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D0x0%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20DCEDTE%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%206%20-%206%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D%200x0%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20RXTL%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%200%20-%205%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D%200x1%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSTRONG%20style%3D%22font-size%3A%2016px%3B%22%3EHow%20to%20write%20to%20register%20%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%22%3EEx%20%3A%20%24%20devregs%20GPIO2_GDIR%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%22%3EGPIO2_GDIR%3A0x73f88004%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D0x0002c0a4%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%22%3EEx%3A%20%24%20devregs%20GPIO2_GDIR%200x2c0a0%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%22%3EGPIO2_GDIR%3A0x73f88004%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D0x0002c0a4%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%22%3EGPIO2_GDIR%3A0x73f88004%20%3D%3D%200x0002c0a4...0x0002c0a0%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%22%3EEx%3A%20%24%20devregs%20GPIO2_GDIR%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%22%3EGPIO2_GDIR%3A0x73f88004%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D0x0002c0a0%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%22%3EFor%20more%20detailed%20information%20please%20go%20through%20the%20following%20below%20links%20%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%22%3E%3CA%20href%3D%22http%3A%2F%2Fboundarydevices.com%2Fi-mx5x-device-register-access%2F%22%20title%3D%22http%3A%2F%2Fboundarydevices.com%2Fi-mx5x-device-register-access%2F%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehttp%3A%2F%2Fboundarydevices.com%2Fi-mx5x-device-register-access%2F%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2012pt%3B%22%3E%3CA%20href%3D%22http%3A%2F%2Fboundarydevices.com%2Fconfiguring-i-mx6-machines-different-screens-nitrogen6x-sabre-lite%2F%22%20title%3D%22http%3A%2F%2Fboundarydevices.com%2Fconfiguring-i-mx6-machines-different-screens-nitrogen6x-sabre-lite%2F%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehttp%3A%2F%2Fboundarydevices.com%2Fconfiguring-i-mx6-machines-different-screens-nitrogen6x-sabre-lite%2F%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎10-15-2013 10:57 PM
Updated by: