Commit Graph

12 Commits

Author SHA1 Message Date
Vadim Bendebury
692f462c91 cli: add ability to read/write memory of different bus width
This adds an optional extra parameter to the 'rw' command. When the
first argument is .b or .s, the access size becomes 8 pr 16 bits
respectively.

BRANCH=none
BUG=none
TEST=on the EC console:
> rw  0x10000
read 0x10000 = 0x00000000
> rw .b 0x10000 0x55
write 0x10000 = 0x55
> rw  0x10000
read 0x10000 = 0x00000055
> rw .b 0x10000
read 0x10000 = 0x55
> rw .s 0x10002
read 0x10002 = 0x0000
> rw .s 0x10002 0x1234
write 0x10002 = 0x1234
> rw 0x10000
read 0x10000 = 0x12340055
>  rw .b 0x10000
read 0x10000 = 0x55
>  rw .b 0x10001
read 0x10001 = 0x00
> rw .b 0x10002
read 0x10002 = 0x34
> rw .b 0x10003
read 0x10003 = 0x12
> rw .s 0x10000
read 0x10000 = 0x0055
> rw .s 0x10002
read 0x10002 = 0x1234
> rw . 0x10002
Parameter 1 invalid
Usage: rw addr [.{b|s}] [value]
>

Change-Id: Iad1a4b3e297253ffdbf13afeede8ade9451eb11a
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/268897
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2015-05-02 03:39:37 +00:00
Bill Richardson
86340a75d2 cleanup: Poke the watchdog when dumping lots of memory
If you use the "md" command to display lots of memory, it can
cause the watchdog to trip. This just pokes it every now and then
to be sure it's happy.

BUG=none
BRANCH=none
TEST=manual

Print a lot, see that it doesn't timeout:

  md 0 0x4000

Change-Id: Ic4e2746c07f4fbdf922e87ea3efbe90b88ae08c9
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/251011
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-02-20 00:07:08 +00:00
Sheng-Liang Song
c1e0b0e114 cr50: Replaced ww with md EC cli
Supported memory commands are: rw and md.
 - rw: for read/write a word
 - md: for memory display

Usage: rw addr [value]
Usage: md addr [num of words (4B)]

BRANCH=none
BUG=none
TEST="make BOARD=cr50" and "md 0 100"

> md 0 100
[00000000] : 00018000 0000011d 00000101 00000101
[00000010] : 00000101 00000101 00000101 00000101
...

Signed-off-by: Sheng-Liang Song <ssl@chromium.org>
Change-Id: I1de8c690cca006ec3aae42d4e6bd0ba30f7c3238
Reviewed-on: https://chromium-review.googlesource.com/231398
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2014-12-04 04:02:45 +00:00
Bill Richardson
e28b6184b1 tweak: Allow "rw" command to read AND write memory.
It's really annoying to have to type two different commands. If I
want to read a location and then write it and then read it back
(which often happens when poking at hardware), then this:

  rw 0x40570008
  rw 0x40570008 14
  rw 0x40570008

is much easier to enter than this:

  rw 0x40570008
  ww 0x40570008 14
  rw 0x40570008

The "ww" command is still there, if you're really attached to it.

BUG=none
BRANCH=none
TEST=manual

Tried the example above. It worked.

Change-Id: I2302ed60df3dd3ec2224afa7c32d997bd2468ec1
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/229660
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-11-14 22:47:13 +00:00
Vic Yang
5007bbc009 Use uintptr_t when converting integer from/to pointer
Perviously we use uint32_t for this, but this doesn't compile for 64-bit
environment (and likely doesn't for 16-bit either.) Use uintptr_t so that
we don't get size mismatch errors.

BUG=chrome-os-partner:19257
TEST=Run host emulated tests
BRANCH=None

Change-Id: I3cd66a745fa171c41a5f142514284ec106586acb
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50358
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-05-07 20:59:53 -07:00
Randall Spangler
e158bd5422 Clean up a few modules in common/
Just code cleanup; no functional changes

BUG=chrome-os-partner:15579
BRANCH=none
TEST=build link and snow

Change-Id: Ib62f805777994b39cd9f47a721f52529bb9399c5
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36573
Reviewed-by: Simon Glass <sjg@chromium.org>
2012-10-26 09:49:38 -07:00
Randall Spangler
e704c712ad Better help for console commands
Additional help messages and usage are gated by
CONFIG_CONSOLE_CMDHELP, so we can turn it on if there's space (adds
about 3KB to image size) and turn it off when there isn't.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST=manual

1) help
2) help list
3) help gpioset
4) gpioset -> wrong number of params
5) gpioset fred 0 -> param1 bad
6) gpioset cpu_prochot fred -> param2 bad

Change-Id: Ibe99f37212020f763ebe65a068e6aa83a809a370
2012-05-25 13:34:06 -07:00
Randall Spangler
eac46a9194 More debug command cleanup to save space
(saves another 1.5KB)

BUG=none
TEST=(run the commands)

Change-Id: Id3ca58528fa68a4cec606edf2b98b9af38ac228f
Signed-off-by: Randall Spangler <rspangler@chromium.org>
2012-05-21 10:21:10 -07:00
Randall Spangler
470916fb0f Use console output instead of uart output for console commands
This completes console output cleanup.  The remaining calls to
uart_puts() and uart_printf() actually need to be that way.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:7464
TEST=manual

Change-Id: Ib1d6d370d30429017b3d11994894fece75fab6ea
2012-04-24 18:34:46 -07:00
Vincent Palatin
1008124533 Remove useless header includes
Preparatory work to introduce a second SoC : 2nd series 2/4

Avoid introducing platform specific dependencies in common files where
they are not necessary.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=None
TEST=build for BDS and Link

Change-Id: If2ccd022e4956425222b55a5a48ca7522857e7f0
2012-01-26 01:32:30 +00:00
Vincent Palatin
c21f07e58e register console commands at compile-time
Instead of using a runtime callback to register the console commands,
put them in a special linker section. So we can do a macro to "register"
them during the build.

It saves 684 bytes and a few microseconds at startup.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=None
TEST=run a few commands from the BDS command line.

Change-Id: Id33ea210b9035bf76ed720373c74c5dd24ccd1b1
2012-01-24 00:50:08 +00:00
Louis Yung-Chieh Lo
6396911897 Initial sources import 2/3
source files mainly done by Louis.

Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>

Change-Id: I93fa38126e208cf3e525828b37bb407099686c6e
2011-12-07 19:10:02 +00:00