jornada 568 port

Mikhael Skvortsov kawks at ya.ru
Wed Sep 12 03:15:45 PDT 2007


Oliver,

quick tryout of the 16550 didn't give any results (nothing is transmitted
at all). But this driver is definitely compatible with the sa11x0 usart,
so I'll try it in detail later.

However, I found some typos in uart_dev_sa1110.c which caused error:

Index: uart_dev_sa1110.c
===================================================================
RCS file: /home/ncvs/src/sys/arm/sa11x0/uart_dev_sa1110.c,v
retrieving revision 1.8
diff -u -r1.8 uart_dev_sa1110.c
--- uart_dev_sa1110.c   2 Apr 2007 22:00:21 -0000       1.8
+++ uart_dev_sa1110.c   12 Sep 2007 10:12:39 -0000
@@ -97,7 +97,7 @@
 static void
 sa1110_putc(struct uart_bas *bas, int c)
 {
-       while (!uart_getreg(bas, SACOM_SR1) & SR1_TNF);
+       while (!(uart_getreg(bas, SACOM_SR1) & SR1_TNF));
        uart_setreg(bas, SACOM_DR, c);
 }

@@ -186,7 +186,7 @@
        uart_setreg(&sc->sc_bas, SACOM_CR3, uart_getreg(&sc->sc_bas, SACOM_CR3)
            | CR3_TIE);
        for (i = 0; i < sc->sc_txdatasz; i++) {
-               while (!uart_getreg(&sc->sc_bas, SACOM_SR1) & SR1_TNF);
+               while (!(uart_getreg(&sc->sc_bas, SACOM_SR1) & SR1_TNF));

                uart_setreg(&sc->sc_bas, SACOM_DR, sc->sc_txbuf[i]);
                uart_barrier(&sc->sc_bas);

--
Regards, Mikhael

> 
> On Wed, Sep 12, 2007 at 12:42:34AM +0400, Mikhael Skvortsov wrote:
> > I'm trying to port FreeBSD to HP Jornada 568 PDA (http://en.wikipedia.org/wiki/Jornada_560_series). Boot process freezes almost just after enabling MMU: while sending something to UART
> > 
> >         cpufunc_control(0x337f, 0x107d);
> >         arm_vector_init(ARM_VECTORS_LOW, ARM_VEC_ALL);
> > +       printf("MMU, I-cache, D-cache, WB enabled.\n");
> > 
> > minicom receives only first nine chars plus a random one, i. e. "MMU, I-cae".
> > What can make this happening? I'm stuck without any ability to debug code.
> > 
> > --
> > Regards, Mikhael
> 
> Hi Mikhael,
> 
> Your problem is likely related to the fact the sa11x0 serial driver is
> poorly written. The standard 16550 driver should work fine, however.
> Could you try the (untested, because I can't anymore) attached patch, which
> just switches the driver, to see if it makes a difference ?
> 
> Thanks,
> 
> Olivier
> 
> Index: arm/sa11x0/files.sa11x0
> ===================================================================
> RCS file: /cognet/ncvs/src/sys/arm/sa11x0/files.sa11x0,v
> retrieving revision 1.2
> diff -u -p -r1.2 files.sa11x0
> --- arm/sa11x0/files.sa11x0    14 May 2004 13:26:52 -0000    1.2
> +++ arm/sa11x0/files.sa11x0    11 Sep 2007 23:37:49 -0000
> @@ -7,5 +7,5 @@ arm/sa11x0/sa11x0_io_asm.S     optional    sai
>  arm/sa11x0/sa11x0_irq.S        optional    saip
>  arm/sa11x0/sa11x0_irqhandler.c     optional    saip
>  arm/sa11x0/uart_cpu_sa1110.c     optional    uart saip
> -arm/sa11x0/uart_dev_sa1110.c    optional    uart saip
>  arm/sa11x0/uart_bus_sa1110.c    optional    uart saip
> +dev/uart/uart_dev_ns8250.c    optional    uart
> Index: arm/sa11x0/uart_bus_sa1110.c
> ===================================================================
> RCS file: /cognet/ncvs/src/sys/arm/sa11x0/uart_bus_sa1110.c,v
> retrieving revision 1.3
> diff -u -p -r1.3 uart_bus_sa1110.c
> --- arm/sa11x0/uart_bus_sa1110.c    5 Jan 2005 21:58:48 -0000    1.3
> +++ arm/sa11x0/uart_bus_sa1110.c    11 Sep 2007 23:36:50 -0000
> @@ -70,7 +70,7 @@ uart_sa1110_probe(device_t dev)
>  
>      sc = device_get_softc(dev);
> 
> sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs);
> -    sc->sc_class = &uart_sa1110_class;
> +    sc->sc_class = &uart_ns8250_class;
>      bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas));
>      return(uart_bus_probe(dev, 0, 0, 0, 0));
>      return (0);
> Index: arm/sa11x0/uart_cpu_sa1110.c
> ===================================================================
> RCS file: /cognet/ncvs/src/sys/arm/sa11x0/uart_cpu_sa1110.c,v
> retrieving revision 1.7
> diff -u -p -r1.7 uart_cpu_sa1110.c
> --- arm/sa11x0/uart_cpu_sa1110.c    2 Apr 2007 22:00:21 -0000    1.7
> +++ arm/sa11x0/uart_cpu_sa1110.c    11 Sep 2007 23:27:08 -0000
> @@ -56,7 +56,7 @@ int
>  uart_cpu_getdev(int devtype, struct uart_devinfo *di)
>  {
>  
> -    di->ops = uart_getops(&uart_sa1110_class);
> +    di->ops = uart_getops(&uart_ns8250_class);
> 
> di->bas.chan = 0;
>      di->bas.bst = &sa11x0_bs_tag;
>      di->bas.bsh = sa1110_uart_vaddr;
> 
> 


More information about the freebsd-arm mailing list