#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>
#include <asm/iopin_8260.h>
#endif
+#if defined(CONFIG_8xx) || defined(CONFIG_8260)
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
static void
unimplemented ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
#if defined(CONFIG_8xx)
printf (" MCR = %08x\n", memctl->memc_mcr);
#elif defined(CONFIG_8260)
- printf ("\n");
+ putc ('\n');
#endif
printf ("MAMR = %08x MBMR = %08x",
memctl->memc_mamr, memctl->memc_mbmr);
int
do_iopset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
-#if defined(CONFIG_8260)
uint rcode = 0;
+ iopin_t iopin;
static uint port = 0;
static uint pin = 0;
static uint value = 0;
- static enum { DIR, PAR, SOR, ODR, DAT } cmd = DAT;
- iopin_t iopin;
+ static enum {
+ DIR,
+ PAR,
+ SOR,
+ ODR,
+ DAT,
+#if defined(CONFIG_8xx)
+ INT
+#endif
+ } cmd = DAT;
if (argc != 5) {
- printf ("iopset PORT PIN CMD VALUE\n");
+ puts ("iopset PORT PIN CMD VALUE\n");
return 1;
}
port = argv[1][0] - 'A';
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;
if (rcode == 0) {
iopin.port = port;
iopin.pin = pin;
+ iopin.flag = 0;
switch (cmd) {
case DIR:
if (value)
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
uint div16 = (val & CPM_BRG_DIV16) != 0;
#if defined(CONFIG_8xx)
- DECLARE_GLOBAL_DATA_PTR;
ulong clock = gd->cpu_clk;
#elif defined(CONFIG_8260)
- DECLARE_GLOBAL_DATA_PTR;
ulong clock = gd->brg_clk;
#endif
printf ("I2CER = %02x I2CMR = %02x\n", i2c->i2c_i2cer, i2c->i2c_i2cmr);
if (iip == NULL)
- printf ("i2c parameter ram not allocated\n");
+ puts ("i2c parameter ram not allocated\n");
else {
printf ("RBASE = %08x TBASE = %08x\n",
iip->iic_rbase, iip->iic_tbase);
/***************************************************/
-cmd_tbl_t U_BOOT_CMD(SIUINFO) = MK_CMD_ENTRY(
- "siuinfo", 1, 1, do_siuinfo,
+U_BOOT_CMD(
+ siuinfo, 1, 1, do_siuinfo,
"siuinfo - print System Interface Unit (SIU) registers\n",
NULL
);
-cmd_tbl_t U_BOOT_CMD(MEMCINFO) = MK_CMD_ENTRY(
- "memcinfo", 1, 1, do_memcinfo,
+U_BOOT_CMD(
+ memcinfo, 1, 1, do_memcinfo,
"memcinfo- print Memory Controller registers\n",
NULL
);
-cmd_tbl_t U_BOOT_CMD(SITINFO) = MK_CMD_ENTRY(
- "sitinfo", 1, 1, do_sitinfo,
+U_BOOT_CMD(
+ sitinfo, 1, 1, do_sitinfo,
"sitinfo - print System Integration Timers (SIT) registers\n",
NULL
);
#ifdef CONFIG_8260
-cmd_tbl_t U_BOOT_CMD(ICINFO) = MK_CMD_ENTRY(
- "icinfo", 1, 1, do_icinfo,
+U_BOOT_CMD(
+ icinfo, 1, 1, do_icinfo,
"icinfo - print Interrupt Controller registers\n",
NULL
);
#endif
-cmd_tbl_t U_BOOT_CMD(CARINFO) = MK_CMD_ENTRY(
- "carinfo", 1, 1, do_carinfo,
+U_BOOT_CMD(
+ carinfo, 1, 1, do_carinfo,
"carinfo - print Clocks and Reset registers\n",
NULL
);
-cmd_tbl_t U_BOOT_CMD(IOPINFO) = MK_CMD_ENTRY(
- "iopinfo", 1, 1, do_iopinfo,
+U_BOOT_CMD(
+ iopinfo, 1, 1, do_iopinfo,
"iopinfo - print I/O Port registers\n",
NULL
);
-cmd_tbl_t U_BOOT_CMD(IOPSET) = MK_CMD_ENTRY(
- "iopset", 5, 0, do_iopset,
- "iopset - set I/O Port registers\n",
+U_BOOT_CMD(
+ iopset, 5, 0, do_iopset,
+ "iopset - set I/O Port registers\n",
"PORT PIN CMD VALUE\nPORT: A-D, PIN: 0-31, CMD: [dat|dir|odr|sor], VALUE: 0|1"
);
-cmd_tbl_t U_BOOT_CMD(DMAINFO) = MK_CMD_ENTRY(
- "dmainfo", 1, 1, do_dmainfo,
+U_BOOT_CMD(
+ dmainfo, 1, 1, do_dmainfo,
"dmainfo - print SDMA/IDMA registers\n",
NULL
);
-cmd_tbl_t U_BOOT_CMD(FCCINFO) = MK_CMD_ENTRY(
- "fccinfo", 1, 1, do_fccinfo,
+U_BOOT_CMD(
+ fccinfo, 1, 1, do_fccinfo,
"fccinfo - print FCC registers\n",
NULL
);
-cmd_tbl_t U_BOOT_CMD(BRGINFO) = MK_CMD_ENTRY(
- "brginfo", 1, 1, do_brginfo,
+U_BOOT_CMD(
+ brginfo, 1, 1, do_brginfo,
"brginfo - print Baud Rate Generator (BRG) registers\n",
NULL
);
-cmd_tbl_t U_BOOT_CMD(I2CINFO) = MK_CMD_ENTRY(
- "i2cinfo", 1, 1, do_i2cinfo,
+U_BOOT_CMD(
+ i2cinfo, 1, 1, do_i2cinfo,
"i2cinfo - print I2C registers\n",
NULL
);
-cmd_tbl_t U_BOOT_CMD(SCCINFO) = MK_CMD_ENTRY(
- "sccinfo", 1, 1, do_sccinfo,
+U_BOOT_CMD(
+ sccinfo, 1, 1, do_sccinfo,
"sccinfo - print SCC registers\n",
NULL
);
-cmd_tbl_t U_BOOT_CMD(SMCINFO) = MK_CMD_ENTRY(
- "smcinfo", 1, 1, do_smcinfo,
+U_BOOT_CMD(
+ smcinfo, 1, 1, do_smcinfo,
"smcinfo - print SMC registers\n",
NULL
);
-cmd_tbl_t U_BOOT_CMD(SPIINFO) = MK_CMD_ENTRY(
- "spiinfo", 1, 1, do_spiinfo,
+U_BOOT_CMD(
+ spiinfo, 1, 1, do_spiinfo,
"spiinfo - print Serial Peripheral Interface (SPI) registers\n",
NULL
);
-cmd_tbl_t U_BOOT_CMD(MUXINFO) = MK_CMD_ENTRY(
- "muxinfo", 1, 1, do_muxinfo,
+U_BOOT_CMD(
+ muxinfo, 1, 1, do_muxinfo,
"muxinfo - print CPM Multiplexing registers\n",
NULL
);
-cmd_tbl_t U_BOOT_CMD(SIINFO) = MK_CMD_ENTRY(
- "siinfo", 1, 1, do_siinfo,
+U_BOOT_CMD(
+ siinfo, 1, 1, do_siinfo,
"siinfo - print Serial Interface (SI) registers\n",
NULL
);
-cmd_tbl_t U_BOOT_CMD(MCCINFO) = MK_CMD_ENTRY(
- "mccinfo", 1, 1, do_mccinfo,
+U_BOOT_CMD(
+ mccinfo, 1, 1, do_mccinfo,
"mccinfo - print MCC registers\n",
NULL
);