2006-03-16 01:52:58 +01:00
|
|
|
/*
|
|
|
|
* dump mmcr of Elan520 uController (incomplete, see 22005b pg23+).
|
|
|
|
*
|
2010-09-26 17:04:14 +02:00
|
|
|
* Copyright 2005 Ronald G. Minnich
|
2010-04-27 08:56:47 +02:00
|
|
|
* Copyright 2006 coresystems GmbH
|
|
|
|
*
|
2010-09-26 17:04:14 +02:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2006-03-16 01:52:58 +01:00
|
|
|
*
|
2010-09-26 17:04:14 +02:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2006-03-16 01:52:58 +01:00
|
|
|
*
|
2010-09-26 17:04:14 +02:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2006-03-16 01:52:58 +01:00
|
|
|
*/
|
|
|
|
|
2010-09-26 17:04:14 +02:00
|
|
|
|
2006-03-16 01:52:58 +01:00
|
|
|
#include <errno.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <getopt.h>
|
2006-03-17 23:35:56 +01:00
|
|
|
#include "../../src/include/cpu/amd/sc520.h"
|
2006-03-16 01:52:58 +01:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
#define val(x,y) (x->y)
|
|
|
|
|
|
|
|
int print_mmcr(struct mmcr *mmcr)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
printf("revid is 0x%x\n\n", val(mmcr, revid));
|
|
|
|
printf("cpucontrol is 0x%x\n\n", val(mmcr, cpucontrol));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("\n");
|
|
|
|
printf("drcctl is 0x%x\n", val(mmcr, memregs.drcctl));
|
|
|
|
printf("drctmctl is 0x%x\n", val(mmcr, memregs.drctmctl));
|
|
|
|
printf("drccfg is 0x%x\n", val(mmcr, memregs.drccfg));
|
2010-04-27 08:56:47 +02:00
|
|
|
printf("bendaddr is 0x%02x%02x%02x%02x\n",
|
2006-03-18 01:10:29 +01:00
|
|
|
val(mmcr, memregs.drcbendadr[3]),
|
2006-03-17 23:35:56 +01:00
|
|
|
val(mmcr, memregs.drcbendadr[2]),
|
2006-03-18 01:10:29 +01:00
|
|
|
val(mmcr, memregs.drcbendadr[1]),
|
|
|
|
val(mmcr, memregs.drcbendadr[0]));
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("eccctl is 0x%x\n", val(mmcr, memregs.eccctl));
|
|
|
|
printf("eccsta is 0x%x\n", val(mmcr, memregs.eccsta));
|
|
|
|
printf("ckbpos is 0x%x\n", val(mmcr, memregs.eccckbpos));
|
|
|
|
printf("cktest is 0x%x\n", val(mmcr, memregs.ecccktest));
|
2012-01-25 13:14:20 +01:00
|
|
|
printf("sbadd is 0x%lx\n", val(mmcr, memregs.eccsbadd));
|
|
|
|
printf("mbadd is 0x%lx\n", val(mmcr, memregs.eccmbadd));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("\n");
|
|
|
|
printf("dbctl is 0x%x\n", val(mmcr, dbctl.dbctl));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("\n");
|
|
|
|
printf("bootcs is 0x%x\n", val(mmcr, romregs.bootcs));
|
|
|
|
printf("romcs1 is 0x%x\n", val(mmcr, romregs.romcs1));
|
|
|
|
printf("romcs2 is 0x%x\n", val(mmcr, romregs.romcs2));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("\n");
|
|
|
|
printf("hbctl is 0x%x\n", val(mmcr, hostbridge.ctl));
|
|
|
|
printf("hbtgtirqctl is 0x%x\n", val(mmcr, hostbridge.tgtirqctl));
|
|
|
|
printf("hbtgtirqsta is 0x%x\n", val(mmcr, hostbridge.tgtirqsta));
|
|
|
|
printf("hbmstirqctl is 0x%x\n", val(mmcr, hostbridge.mstirqctl));
|
|
|
|
printf("hbmstirqsta is 0x%x\n", val(mmcr, hostbridge.mstirqsta));
|
2012-01-25 13:14:20 +01:00
|
|
|
printf("mstintadd is 0x%lx\n", val(mmcr, hostbridge.mstintadd));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("\n");
|
|
|
|
printf("sysarbctl is 0x%x\n", val(mmcr, sysarb.ctl));
|
|
|
|
printf("pciarbsta is 0x%x\n", val(mmcr, sysarb.sta));
|
|
|
|
printf("sysarbmenb is 0x%x\n", val(mmcr, sysarb.menb));
|
2012-01-25 13:14:20 +01:00
|
|
|
printf("arbprictl is 0x%lx\n", val(mmcr, sysarb.prictl));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("\n");
|
|
|
|
printf("adddecctl is 0x%x\n", val(mmcr, sysmap.adddecctl));
|
|
|
|
printf("wpvsta is 0x%x\n", val(mmcr, sysmap.wpvsta));
|
|
|
|
for (i=0; i<16; i++)
|
2012-01-25 13:14:20 +01:00
|
|
|
printf("par %d is 0x%lx\n", i, val(mmcr, sysmap.par[i]));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("\n");
|
|
|
|
printf("gpecho is 0x%x\n", val(mmcr, gpctl.gpecho));
|
|
|
|
printf("gpcsdw is 0x%x\n", val(mmcr, gpctl.gpcsdw));
|
|
|
|
printf("gpcsqual is 0x%x\n", val(mmcr, gpctl.gpcsqual));
|
|
|
|
printf("gpcsrt is 0x%x\n", val(mmcr, gpctl.gpcsrt));
|
|
|
|
printf("gpcspw is 0x%x\n", val(mmcr, gpctl.gpcspw));
|
|
|
|
printf("gpcsoff is 0x%x\n", val(mmcr, gpctl.gpcsoff));
|
|
|
|
printf("gprdw is 0x%x\n", val(mmcr, gpctl.gprdw));
|
|
|
|
printf("gprdoff is 0x%x\n", val(mmcr, gpctl.gprdoff));
|
|
|
|
printf("gpwrw is 0x%x\n", val(mmcr, gpctl.gpwrw));
|
|
|
|
printf("gpwroff is 0x%x\n", val(mmcr, gpctl.gpwroff));
|
|
|
|
printf("gpalew is 0x%x\n", val(mmcr, gpctl.gpalew));
|
|
|
|
printf("gpaleoff is 0x%x\n", val(mmcr, gpctl.gpaleoff));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("\n");
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("piopfs15_0 is 0x%x\n", val(mmcr, pio.pfs15_0));
|
|
|
|
printf("piopfs31_16 is 0x%x\n", val(mmcr, pio.pfs31_16));
|
|
|
|
printf("cspfs is 0x%x\n", val(mmcr, pio.cspfs));
|
|
|
|
printf("clksel is 0x%x\n", val(mmcr, pio.clksel));
|
|
|
|
printf("dsctl is 0x%x\n", val(mmcr, pio.dsctl));
|
|
|
|
printf("piodir15_0 is 0x%x\n", val(mmcr, pio.dir15_0));
|
|
|
|
printf("piodir31_16 is 0x%x\n", val(mmcr, pio.dir31_16));
|
|
|
|
printf("piodata15_0 is 0x%x\n", val(mmcr, pio.data15_0));
|
|
|
|
printf("piodata31_16 is 0x%x\n", val(mmcr, pio.data31_16));
|
|
|
|
printf("pioset15_0 is 0x%x\n", val(mmcr, pio.set15_0));
|
|
|
|
printf("pioset31_16 is 0x%x\n", val(mmcr, pio.set31_16));
|
|
|
|
printf("pioclr15_0 is 0x%x\n", val(mmcr, pio.clr15_0));
|
|
|
|
printf("pioclr31_16 is 0x%x\n", val(mmcr, pio.clr31_16));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("swtmrmilli is 0x%x\n", val(mmcr, swtmr.swtmrmilli));
|
|
|
|
printf("swtmrmicro is 0x%x\n", val(mmcr, swtmr.swtmrmicro));
|
|
|
|
printf("swtmrcfg is 0x%x\n", val(mmcr, swtmr.swtmrcfg));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("status is 0x%x\n", val(mmcr, gptimers.status));
|
|
|
|
printf("pad is 0x%x\n", val(mmcr, gptimers.pad));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("timers[0].ctl is 0x%x\n", val(mmcr, gptimers.timer[0].ctl));
|
|
|
|
printf("timers[0].cnt is 0x%x\n", val(mmcr, gptimers.timer[0].cnt));
|
|
|
|
printf("timers[0].maxcmpa is 0x%x\n", val(mmcr, gptimers.timer[0].maxcmpa));
|
|
|
|
printf("timers[0].maxcmpb is 0x%x\n", val(mmcr, gptimers.timer[0].maxcmpb));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("timers[1].ctl is 0x%x\n", val(mmcr, gptimers.timer[1].ctl));
|
|
|
|
printf("timers[1].cnt is 0x%x\n", val(mmcr, gptimers.timer[1].cnt));
|
|
|
|
printf("timers[1].maxcmpa is 0x%x\n", val(mmcr, gptimers.timer[1].maxcmpa));
|
|
|
|
printf("timers[1].maxcmpb is 0x%x\n", val(mmcr, gptimers.timer[1].maxcmpb));
|
|
|
|
printf("timers[2].ctl is 0x%x\n", val(mmcr, gptimers.ctl2));
|
|
|
|
printf("timers[2].cnt is 0x%x\n", val(mmcr, gptimers.cnt2));
|
|
|
|
printf("timers[2].maxcmpa is 0x%x\n", val(mmcr, gptimers.maxcmpa2));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("ctl is 0x%x\n", val(mmcr, watchdog.ctl));
|
|
|
|
printf("cntll is 0x%x\n", val(mmcr, watchdog.cntll));
|
|
|
|
printf("cntlh is 0x%x\n", val(mmcr, watchdog.cntlh));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("uart 1 ctl is 0x%x\n", val(mmcr, uarts.uart[0].ctl));
|
|
|
|
printf("uart 1 sta is 0x%x\n", val(mmcr, uarts.uart[0].sta));
|
|
|
|
printf("uart 1 fcrshad is 0x%x\n", val(mmcr, uarts.uart[0].fcrshad));
|
|
|
|
printf("uart 2 ctl is 0x%x\n", val(mmcr, uarts.uart[1].ctl));
|
|
|
|
printf("uart 2 sta is 0x%x\n", val(mmcr, uarts.uart[1].sta));
|
|
|
|
printf("uart 2 fcrshad is 0x%x\n", val(mmcr, uarts.uart[1].fcrshad));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("ssi ctl is 0x%x\n", val(mmcr, ssi.ctl));
|
|
|
|
printf("ssi xmit is 0x%x\n", val(mmcr, ssi.xmit));
|
|
|
|
printf("ssi cmd is 0x%x\n", val(mmcr, ssi.cmd));
|
|
|
|
printf("ssi sta is 0x%x\n", val(mmcr, ssi.sta));
|
|
|
|
printf("ssi rcv is 0x%x\n", val(mmcr, ssi.rcv));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("pcicr is 0x%x\n", val(mmcr, pic.pcicr));
|
|
|
|
printf("mpicmode is 0x%x\n", val(mmcr, pic.mpicmode));
|
|
|
|
printf("sl1picmode is 0x%x\n", val(mmcr, pic.sl1picmode));
|
|
|
|
printf("sl2picmode is 0x%x\n", val(mmcr, pic.sl2picmode));
|
|
|
|
printf("swint16_1 is 0x%x\n", val(mmcr, pic.swint16_1));
|
|
|
|
printf("swint22_17 is 0x%x\n", val(mmcr, pic.swint22_17));
|
|
|
|
printf("intpinpol is 0x%x\n", val(mmcr, pic.intpinpol));
|
|
|
|
printf("pichostmap is 0x%x\n", val(mmcr, pic.pichostmap));
|
|
|
|
printf("eccmap is 0x%x\n", val(mmcr, pic.eccmap));
|
|
|
|
printf("gptmr0map is 0x%x\n", val(mmcr, pic.gptmr0map));
|
|
|
|
printf("gptmr1map is 0x%x\n", val(mmcr, pic.gptmr1map));
|
|
|
|
printf("gptmr2map is 0x%x\n", val(mmcr, pic.gptmr2map));
|
|
|
|
printf("pit0map is 0x%x\n", val(mmcr, pic.pit0map));
|
|
|
|
printf("pit1map is 0x%x\n", val(mmcr, pic.pit1map));
|
|
|
|
printf("pit2map is 0x%x\n", val(mmcr, pic.pit2map));
|
|
|
|
printf("uart1map is 0x%x\n", val(mmcr, pic.uart1map));
|
|
|
|
printf("uart2map is 0x%x\n", val(mmcr, pic.uart2map));
|
|
|
|
printf("pciintamap is 0x%x\n", val(mmcr, pic.pciintamap));
|
|
|
|
printf("pciintbmap is 0x%x\n", val(mmcr, pic.pciintbmap));
|
|
|
|
printf("pciintcmap is 0x%x\n", val(mmcr, pic.pciintcmap));
|
|
|
|
printf("pciintdmap is 0x%x\n", val(mmcr, pic.pciintdmap));
|
|
|
|
printf("dmabcintmap is 0x%x\n", val(mmcr, pic.dmabcintmap));
|
|
|
|
printf("ssimap is 0x%x\n", val(mmcr, pic.ssimap));
|
|
|
|
printf("wdtmap is 0x%x\n", val(mmcr, pic.wdtmap));
|
|
|
|
printf("rtcmap is 0x%x\n", val(mmcr, pic.rtcmap));
|
|
|
|
printf("wpvmap is 0x%x\n", val(mmcr, pic.wpvmap));
|
|
|
|
printf("icemap is 0x%x\n", val(mmcr, pic.icemap));
|
|
|
|
printf("ferrmap is 0x%x\n", val(mmcr, pic.ferrmap));
|
|
|
|
printf("gp0imap is 0x%x\n", val(mmcr, pic.gp0imap));
|
|
|
|
printf("gp1imap is 0x%x\n", val(mmcr, pic.gp1imap));
|
|
|
|
printf("gp2imap is 0x%x\n", val(mmcr, pic.gp2imap));
|
|
|
|
printf("gp3imap is 0x%x\n", val(mmcr, pic.gp3imap));
|
|
|
|
printf("gp4imap is 0x%x\n", val(mmcr, pic.gp4imap));
|
|
|
|
printf("gp5imap is 0x%x\n", val(mmcr, pic.gp5imap));
|
|
|
|
printf("gp6imap is 0x%x\n", val(mmcr, pic.gp6imap));
|
|
|
|
printf("gp7imap is 0x%x\n", val(mmcr, pic.gp7imap));
|
|
|
|
printf("gp8imap is 0x%x\n", val(mmcr, pic.gp8imap));
|
|
|
|
printf("gp9imap is 0x%x\n", val(mmcr, pic.gp9imap));
|
|
|
|
printf("gp10imap is 0x%x\n", val(mmcr, pic.gp10imap));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("sysinfo is 0x%x\n", val(mmcr, reset.sysinfo));
|
|
|
|
printf("rescfg is 0x%x\n", val(mmcr, reset.rescfg));
|
|
|
|
printf("ressta is 0x%x\n", val(mmcr, reset.ressta));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
printf("ctl is 0x%x\n", val(mmcr, dmacontrol.ctl));
|
|
|
|
printf("mmio is 0x%x\n", val(mmcr, dmacontrol.mmio));
|
|
|
|
printf("extchanmapa is 0x%x\n", val(mmcr, dmacontrol.extchanmapa));
|
|
|
|
printf("extchanmapb is 0x%x\n", val(mmcr, dmacontrol.extchanmapb));
|
|
|
|
printf("extpg0 is 0x%x\n", val(mmcr, dmacontrol.extpg0));
|
|
|
|
printf("extpg1 is 0x%x\n", val(mmcr, dmacontrol.extpg1));
|
|
|
|
printf("extpg2 is 0x%x\n", val(mmcr, dmacontrol.extpg2));
|
|
|
|
printf("extpg3 is 0x%x\n", val(mmcr, dmacontrol.extpg3));
|
|
|
|
printf("extpg5 is 0x%x\n", val(mmcr, dmacontrol.extpg5));
|
|
|
|
printf("extpg6 is 0x%x\n", val(mmcr, dmacontrol.extpg6));
|
|
|
|
printf("extpg7 is 0x%x\n", val(mmcr, dmacontrol.extpg7));
|
|
|
|
printf("exttc3 is 0x%x\n", val(mmcr, dmacontrol.exttc3));
|
|
|
|
printf("exttc5 is 0x%x\n", val(mmcr, dmacontrol.exttc5));
|
|
|
|
printf("exttc6 is 0x%x\n", val(mmcr, dmacontrol.exttc6));
|
|
|
|
printf("exttc7 is 0x%x\n", val(mmcr, dmacontrol.exttc7));
|
|
|
|
printf("bcctl is 0x%x\n", val(mmcr, dmacontrol.bcctl));
|
|
|
|
printf("bcsta is 0x%x\n", val(mmcr, dmacontrol.bcsta));
|
|
|
|
printf("bsintenb is 0x%x\n", val(mmcr, dmacontrol.bsintenb));
|
|
|
|
printf("bcval is 0x%x\n", val(mmcr, dmacontrol.bcval));
|
|
|
|
printf("nxtaddl3 is 0x%x\n", val(mmcr, dmacontrol.nxtaddl3));
|
|
|
|
printf("nxtaddh3 is 0x%x\n", val(mmcr, dmacontrol.nxtaddh3));
|
|
|
|
printf("nxtaddl5 is 0x%x\n", val(mmcr, dmacontrol.nxtaddl5));
|
|
|
|
printf("nxtaddh5 is 0x%x\n", val(mmcr, dmacontrol.nxtaddh5));
|
|
|
|
printf("nxtaddl6 is 0x%x\n", val(mmcr, dmacontrol.nxtaddl6));
|
|
|
|
printf("nxtaddh6 is 0x%x\n", val(mmcr, dmacontrol.nxtaddh6));
|
|
|
|
printf("nxtaddl7 is 0x%x\n", val(mmcr, dmacontrol.nxtaddl7));
|
|
|
|
printf("nxtaddh7 is 0x%x\n", val(mmcr, dmacontrol.nxtaddh7));
|
|
|
|
printf("nxtttcl3 is 0x%x\n", val(mmcr, dmacontrol.nxtttcl3));
|
|
|
|
printf("nxtttch3 is 0x%x\n", val(mmcr, dmacontrol.nxtttch3));
|
|
|
|
printf("nxtttcl5 is 0x%x\n", val(mmcr, dmacontrol.nxtttcl5));
|
|
|
|
printf("nxtttch5 is 0x%x\n", val(mmcr, dmacontrol.nxtttch5));
|
|
|
|
printf("nxtttcl6 is 0x%x\n", val(mmcr, dmacontrol.nxtttcl6));
|
|
|
|
printf("nxtttch6 is 0x%x\n", val(mmcr, dmacontrol.nxtttch6));
|
|
|
|
printf("nxtttcl7 is 0x%x\n", val(mmcr, dmacontrol.nxtttcl7));
|
|
|
|
printf("nxtttch7 is 0x%x\n", val(mmcr, dmacontrol.nxtttch7));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int map_mmcr(void)
|
2006-03-16 01:52:58 +01:00
|
|
|
{
|
|
|
|
int fd_mem;
|
|
|
|
volatile uint8_t *mmcr;
|
|
|
|
unsigned long size=4096;
|
|
|
|
|
|
|
|
if ((fd_mem = open("/dev/mem", O_RDWR)) < 0) {
|
|
|
|
perror("Can not open /dev/mem");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (getpagesize() > size) {
|
|
|
|
size = getpagesize();
|
|
|
|
}
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-16 01:52:58 +01:00
|
|
|
mmcr = mmap(0, size, PROT_WRITE | PROT_READ, MAP_SHARED,
|
|
|
|
fd_mem, (off_t) (0xFFFEF000));
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-16 01:52:58 +01:00
|
|
|
if (mmcr == MAP_FAILED) {
|
|
|
|
perror("Error MMAP /dev/mem");
|
|
|
|
exit(1);
|
|
|
|
}
|
2010-04-27 08:56:47 +02:00
|
|
|
|
2006-03-17 23:35:56 +01:00
|
|
|
|
|
|
|
print_mmcr((struct mmcr *)mmcr);
|
|
|
|
#if 0
|
|
|
|
|
2006-03-16 01:52:58 +01:00
|
|
|
printf("ElanSC520 uC Rev. ID : %04x\n",*(uint16_t *)mmcr);
|
|
|
|
printf("Am5x86 CPU Control : %04x\n",*(uint16_t *)(mmcr+2));
|
|
|
|
printf("\n");
|
|
|
|
printf("SDRAM Control : %04x\n",*(uint16_t *)(mmcr+0x10));
|
|
|
|
printf("SDRAM Timing Control : %04x\n",*(uint16_t *)(mmcr+0x12));
|
|
|
|
printf("SDRAM Bank Config : %04x\n",*(uint16_t *)(mmcr+0x14));
|
|
|
|
printf("SDRAM Bank 0-3 Ending : %04x\n",*(uint16_t *)(mmcr+0x18));
|
|
|
|
printf("ECC Control : %04x\n",*(uint16_t *)(mmcr+0x20));
|
|
|
|
printf("ECC Status : %04x\n",*(uint16_t *)(mmcr+0x21));
|
|
|
|
printf("ECC Check Bit Position: %04x\n",*(uint16_t *)(mmcr+0x22));
|
|
|
|
printf("ECC Check Code Test : %04x\n",*(uint16_t *)(mmcr+0x23));
|
|
|
|
printf("ECC Single Bit ErrAddr: %04x\n",*(uint16_t *)(mmcr+0x24));
|
|
|
|
printf("ECC Multi Bit ErrAddr : %04x\n",*(uint16_t *)(mmcr+0x28));
|
|
|
|
printf("\n");
|
|
|
|
printf("SDRAM Buffer Control : %04x\n",*(uint16_t *)(mmcr+0x40));
|
|
|
|
printf("\n");
|
|
|
|
printf("BOOTCS Control : %04x\n",*(uint16_t *)(mmcr+0x50));
|
|
|
|
printf("BOOTCS1 Control : %04x\n",*(uint16_t *)(mmcr+0x54));
|
|
|
|
printf("BOOTCS2 Control : %04x\n",*(uint16_t *)(mmcr+0x56));
|
|
|
|
printf("\n");
|
|
|
|
|
|
|
|
printf("Adr Decode Control : %02x\n",*(uint8_t *)(mmcr+0x80));
|
|
|
|
printf("WrProt Violation Stat.: %04x\n",*(uint16_t *)(mmcr+0x82));
|
|
|
|
printf("PAR 0 : %08x\n",*(uint32_t *)(mmcr+0x88));
|
|
|
|
printf("PAR 1 : %08x\n",*(uint32_t *)(mmcr+0x8C));
|
|
|
|
printf("PAR 2 : %08x\n",*(uint32_t *)(mmcr+0x90));
|
|
|
|
printf("PAR 3 : %08x\n",*(uint32_t *)(mmcr+0x94));
|
|
|
|
printf("PAR 4 : %08x\n",*(uint32_t *)(mmcr+0x98));
|
|
|
|
printf("PAR 5 : %08x\n",*(uint32_t *)(mmcr+0x9C));
|
|
|
|
printf("PAR 6 : %08x\n",*(uint32_t *)(mmcr+0xA0));
|
|
|
|
printf("PAR 7 : %08x\n",*(uint32_t *)(mmcr+0xA4));
|
|
|
|
printf("PAR 8 : %08x\n",*(uint32_t *)(mmcr+0xA8));
|
|
|
|
printf("PAR 9 : %08x\n",*(uint32_t *)(mmcr+0xAC));
|
|
|
|
printf("PAR 10 : %08x\n",*(uint32_t *)(mmcr+0xB0));
|
|
|
|
printf("PAR 11 : %08x\n",*(uint32_t *)(mmcr+0xB4));
|
|
|
|
printf("PAR 12 : %08x\n",*(uint32_t *)(mmcr+0xB8));
|
|
|
|
printf("PAR 13 : %08x\n",*(uint32_t *)(mmcr+0xBC));
|
|
|
|
printf("PAR 14 : %08x\n",*(uint32_t *)(mmcr+0xC0));
|
|
|
|
printf("PAR 15 : %08x\n",*(uint32_t *)(mmcr+0xC4));
|
2006-03-17 23:35:56 +01:00
|
|
|
#endif
|
2006-03-16 01:52:58 +01:00
|
|
|
munmap((void *) mmcr, size);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2006-03-17 23:35:56 +01:00
|
|
|
map_mmcr();
|
2006-03-16 01:52:58 +01:00
|
|
|
return 0;
|
|
|
|
}
|