Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rk3576 Downstream U-Boot
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas Frattaroli
Rk3576 Downstream U-Boot
Commits
5cc69084
Commit
5cc69084
authored
15 years ago
by
Grzegorz Bernacki
Committed by
Wolfgang Denk
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
digsy_mtc: Add mtc state command.
Signed-off-by:
Grzegorz Bernacki
<
gjb@semihalf.com
>
parent
71665528
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
board/digsy_mtc/cmd_mtc.c
+30
-0
30 additions, 0 deletions
board/digsy_mtc/cmd_mtc.c
board/digsy_mtc/cmd_mtc.h
+1
-0
1 addition, 0 deletions
board/digsy_mtc/cmd_mtc.h
with
31 additions
and
0 deletions
board/digsy_mtc/cmd_mtc.c
+
30
−
0
View file @
5cc69084
...
...
@@ -246,6 +246,34 @@ static int do_mtc_version(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return
err
;
}
static
int
do_mtc_state
(
cmd_tbl_t
*
cmdtp
,
int
flag
,
int
argc
,
char
*
argv
[])
{
tx_msp_cmd
pcmd
;
rx_msp_cmd
prx
;
int
err
=
0
;
memset
(
&
pcmd
,
0
,
sizeof
(
pcmd
));
memset
(
&
prx
,
0
,
sizeof
(
prx
));
pcmd
.
cmd
=
CMD_WD_WDSTATE
;
pcmd
.
cmd_val2
=
1
;
mtc_calculate_checksum
(
&
pcmd
);
err
=
spi_xfer
(
NULL
,
MTC_TRANSFER_SIZE
,
&
pcmd
,
&
prx
,
SPI_XFER_BEGIN
|
SPI_XFER_END
);
if
(
!
err
)
{
printf
(
"State %02Xh
\n
"
,
prx
.
state
);
printf
(
"Input %02Xh
\n
"
,
prx
.
input
);
printf
(
"UserWD %02Xh
\n
"
,
prx
.
ack2
);
printf
(
"Sys WD %02Xh
\n
"
,
prx
.
ack3
);
printf
(
"WD Timout %02Xh
\n
"
,
prx
.
ack0
);
printf
(
"eSysState %02Xh
\n
"
,
prx
.
ack1
);
}
return
err
;
}
static
int
do_mtc_help
(
cmd_tbl_t
*
cmdtp
,
int
flag
,
int
argc
,
char
*
argv
[]);
cmd_tbl_t
cmd_mtc_sub
[]
=
{
...
...
@@ -267,6 +295,8 @@ cmd_tbl_t cmd_mtc_sub[] = {
U_BOOT_CMD_MKENT
(
digout
,
2
,
1
,
do_mtc_digout
,
"sets digital outputs"
,
"<on|off> <on|off>- set state of digital output 1 and 2
\n
"
),
U_BOOT_CMD_MKENT
(
state
,
0
,
1
,
do_mtc_state
,
"displays state
\n
"
,
""
),
U_BOOT_CMD_MKENT
(
help
,
4
,
1
,
do_mtc_help
,
"get help"
,
"[command] - get help for command
\n
"
),
};
...
...
This diff is collapsed.
Click to expand it.
board/digsy_mtc/cmd_mtc.h
+
1
−
0
View file @
5cc69084
...
...
@@ -27,6 +27,7 @@
#define CMD_MTC_H
#define CMD_WD_PARA 0x02
#define CMD_WD_WDSTATE 0x04
#define CMD_FW_VERSION 0x10
#define CMD_GET_VIM 0x30
#define CMD_SET_LED 0x40
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment