public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] MBX860 super I/O chip
@ 2000-10-04  5:36 Daniel Lind
  2000-10-04  5:58 ` Andrew Lunn
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Lind @ 2000-10-04  5:36 UTC (permalink / raw)
  To: ecos-discuss

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)



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] MBX860 super I/O chip
  2000-10-04  5:36 [ECOS] MBX860 super I/O chip Daniel Lind
@ 2000-10-04  5:58 ` Andrew Lunn
  2000-10-05 23:05   ` Daniel Lind
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2000-10-04  5:58 UTC (permalink / raw)
  To: Daniel Lind; +Cc: eCos Disuss

>  port2=(PORT*) 0x800002f8;
>  qspan=(QSPANREG*) 0xfa210000;
>  qspanPCI_CLASS=(volatile unsigned long*) 0xfa210000;
> 
> 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.....

This all sounds like MMU problems. I have a quick look the MBX
code. In packages/hal/powerpc/mbx/current/src/hal_aux.c there is a
memory map table used to configure the MMU. I think you need to add
some more entires to this table.

        Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] MBX860 super I/O chip
  2000-10-04  5:58 ` Andrew Lunn
@ 2000-10-05 23:05   ` Daniel Lind
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Lind @ 2000-10-05 23:05 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Daniel Lind, eCos Disuss

Hi,
I have tried to get more information about this subject in eCos Refernce
Manual. But if you have a pointer to where I can find out more of this in the
documentation of eCos it would be very helpful.

/Daniel

Andrew Lunn wrote:

> >  port2=(PORT*) 0x800002f8;
> >  qspan=(QSPANREG*) 0xfa210000;
> >  qspanPCI_CLASS=(volatile unsigned long*) 0xfa210000;
> >
> > 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.....
>
> This all sounds like MMU problems. I have a quick look the MBX
> code. In packages/hal/powerpc/mbx/current/src/hal_aux.c there is a
> memory map table used to configure the MMU. I think you need to add
> some more entires to this table.
>
>         Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-10-05 23:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-04  5:36 [ECOS] MBX860 super I/O chip Daniel Lind
2000-10-04  5:58 ` Andrew Lunn
2000-10-05 23:05   ` Daniel Lind

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).