From e6f222815c118c1249c763705c49867004727c5b Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Mon, 26 Sep 2005 00:44:15 +0200 Subject: Add iopset command on mpc8xx Patch by Daniel Eisenhut, 25 Mar 2005 --- common/cmd_immap.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'common') diff --git a/common/cmd_immap.c b/common/cmd_immap.c index abf5590..9db5f2c 100644 --- a/common/cmd_immap.c +++ b/common/cmd_immap.c @@ -34,6 +34,7 @@ #if defined(CONFIG_8xx) #include #include +#include #elif defined(CONFIG_8260) #include #include @@ -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 -- cgit v1.1