Add iopset command on mpc8xx

Patch by Daniel Eisenhut, 25 Mar 2005
This commit is contained in:
Wolfgang Denk
2005-09-26 00:44:15 +02:00
parent a912733e9b
commit e6f222815c
3 changed files with 413 additions and 6 deletions

View File

@@ -34,6 +34,7 @@
#if defined(CONFIG_8xx)
#include <asm/8xx_immap.h>
#include <commproc.h>
#include <asm/iopin_8xx.h>
#elif defined(CONFIG_8260)
#include <asm/immap_8260.h>
#include <asm/cpm_8260.h>
@@ -316,12 +317,11 @@ do_iopinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int
do_iopset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
#if defined(CONFIG_8260)
uint rcode = 0;
static uint port = 0;
static uint pin = 0;
static uint value = 0;
static enum { DIR, PAR, SOR, ODR, DAT } cmd = DAT;
static enum { DIR, PAR, SOR, ODR, DAT, INT } cmd = DAT;
iopin_t iopin;
if (argc != 5) {
@@ -356,6 +356,11 @@ do_iopset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
case 's':
cmd = SOR;
break;
#if defined(CONFIG_8xx)
case 'i':
cmd = INT;
break;
#endif
default:
printf ("iopset: unknown command %s\n", argv[3]);
rcode = 1;
@@ -400,14 +405,18 @@ do_iopset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
else
iopin_set_low (&iopin);
break;
#if defined(CONFIG_8xx)
case INT:
if (value)
iopin_set_falledge (&iopin);
else
iopin_set_anyedge (&iopin);
break;
#endif
}
}
return rcode;
#else
unimplemented (cmdtp, flag, argc, argv);
return 0;
#endif
}
int