This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

MBX860 super I/O chip


Hi,
I'm programmin a MBX860 starter-kit and are using eCos as OS. I try to
figure out more about the super I/O chip, 37C672, because I want to use
serial port 2. Right now my problems are that I can't reach registers in
QSPAN so I can configure it or check the default values. I use the
following code...

#include <cyg/kernel/kapi.h>
#include <cyg/hal/quicc/ppc8xx.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>


typedef struct port{
 volatile unsigned long adr1;
 volatile unsigned long adr2;
 volatile unsigned long adr3;
 volatile unsigned long adr4;
 volatile unsigned long adr5;
 volatile unsigned long adr6;
 volatile unsigned long adr7;
 volatile unsigned long adr8;

} PORT;

typedef struct QspanReg{
 volatile unsigned long adr1;
 volatile unsigned long adr2;
 volatile unsigned long adr3;
 volatile unsigned long adr4;
 volatile unsigned long adr5;
 volatile unsigned long adr6;
 volatile unsigned long adr7;
 volatile unsigned long adr8;
} QSPANREG;


PORT               *port2;
QSPANREG    *qspan;
EPPC               *IMMR;      /* IMMR base pointer */
EPPC                *eppc;      /* EPPC base pointer */

volatile unsigned long *qspanPCI_CLASS; //base cs6 + 0x008
volatile unsigned long value;

void cyg_user_start(void)
{
 printf("enters cyg_user_start() \n");
 eppc=eppc_base();
 port2=(PORT*) 0x800002f8;
 qspan=(QSPANREG*) 0xfa210000;
 qspanPCI_CLASS=(volatile unsigned long*) 0xfa210000;

 value= *qspanPCI_CLASS;

/* port2->adr1=0x1000;
 port2->adr4=0x80;
 port2->adr1=0x03; //Baud 38400
 port2->adr2=0x00; // Set Baud rate - Divisor Latch High Byte
 port2->adr4=0x03; //8/N/1
 port2->adr3=0xC7; //FIFO control register
 port2->adr5=0x0B; //Turn on DTR, RTS, and OUT2
 port2->adr1=0x61; //send 'a' */

 printf("Reached end of cyg_user_start ");
}

When I try to reach the qspan registers with the pointer to the struct
QSPANREG my debugger says that every register in the struct just
contains 0. This doesn't match the values that should be there after
power up. When I'm trying to reach the qspan registers with the pointer
qspanPCI_CLASS and trying to put the register value in the variable
value the debugger tells me "Program received signal SIGSEGV,
Segmentation fault".
The adresses to this pheripheral is outside of the ram. But how will I
reach them????? What shall I change in the configuration of eCos. The
default settings using the template for mbx860 board is for an
entry-level board and it has no 37C672 I/O device.....

/Daniel Lind



I would like to reach the contents of the QSPAN registers that is
contained in the memory-bank CS6 (Chip-select)




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]