This is the mail archive of the ecos-patches@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]
Other format: [Raw text]

Re: MPC860: quicc_smc_serial_driver change


On Wed, 2004-01-07 at 16:26, nprasad3@gmu.edu wrote:
> > Possibly (I wrote the driver), but probably long since discarded
> > as a useful mode.
> > 
> This mode turns out to be very useful to me. I have only 1 port 
> SCC1 that can be used by the diag interface as well as printf. I 
> used the hal_diag.c from mbx port and it does not work with the 
> interrupt driven driver so when I started with the interrupt driven 
> driver, it would go hang because of the diag_printf.
> > > 
> > > I started with the polling mode driver as I thought it would be 
> > > easy to get it going on my target first. 
> > 
> > What is there to get going?  This is all common 860/QUICC stuff,
> > and there shouldn't need to be any platform specifics required.
> > 
> Anyways I do have the interrupt mode driver working now but only by 
> disabling diags. I have to see how to make the 2 co-exist on one port 
> (probably polling mode driver for debugging).

I don't understand - I've used SCC1 for both serial and diag at the
same time.  I don't have an MBX860, but I do have other QUICC boards.

I just tried this on my Viper/860, using SCC1 as the serial console
and it worked perfectly, mixing diagnostic I/O and large amounts of
serial I/O via the serial driver.  The program and kernel setups
are attached.

I think you must have some other problem, possibly dealing with
interrupts.

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates

Attachment: Make.params
Description: Text document

include Make.params

CFLAGS = ${ECOS_GLOBAL_CFLAGS} -I${PREFIX}/include
LDFLAGS = ${ECOS_GLOBAL_LDFLAGS} -L${PREFIX}/lib -Ttarget.ld
LIBS = ${PREFIX}/lib/libtarget.a ${PREFIX}/lib/libextras.a

all: smc1_test scc1_test sxx_test

smc1_test: smc1_test.o
scc1_test: scc1_test.o
sxx_test: sxx_test.o
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>

#define DEV_NAME "/dev/scc1"

int main(int argc, char *argv[])
{
    FILE *fp;
    int i, j, c;

    diag_printf("*** Via diag channel\n");
    if ((fp = fopen(DEV_NAME, "r+")) == (FILE *)NULL) {
        fprintf(stderr, "Can't open '%s': %s\n", DEV_NAME, strerror(errno));
        exit(1);
    }
    fprintf(fp, "*** Via serial channel\r\n");
    for (i = 0;  i < 10;  i++) {
        for (j = 0;  j < i;  j++) {
            fputc(' ', fp);
        }
        for (c = ' ';  c < 0x7F;  c++) {
            fputc(c, fp);
        }
        fputc('\r', fp);
        fputc('\n', fp);
    }
    sleep(10);
    printf("Done\n");
}

Attachment: ser_test.cfg
Description: Text document


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