On Tuesday, May 24, 2011 5:52:32 pm N.J. Mann wrote:
> In message <[email protected]>,
>       John Baldwin ([email protected]) wrote:
> [snip]
> > 
> > Ah, uart_puc_probe() always uses the 'uart_ns8250_class' uart driver which
> > is defined in uart_dev_ns8250.c.  ns8250_bus_probe() is what you want to
> > instrument I think.
> 
> ns8250_bus_probe() is called twice for each of the working devices as
> follows:
> 
> UART2:
> ------
> ns8250_bus_probe:: entry
> ns8250_probe::uart_getreg REG_IIR = 1
> ns8250_probe::uart_getreg REG_MCR = 0
> ns8250_bus_probe:: exit
> ...
> ns8250_bus_probe:: entry
> ns8250_probe::uart_getreg REG_IIR = 193
> ns8250_probe::uart_getreg REG_MCR = 8
> ns8250_bus_probe:: exit
> 
> UART3
> -----
> ns8250_bus_probe:: entry
> ns8250_probe::uart_getreg REG_IIR = 1
> ns8250_probe::uart_getreg REG_MCR = 0
> ns8250_bus_probe:: exit
> ...
> ns8250_bus_probe:: entry
> ns8250_probe::uart_getreg REG_IIR = 193
> ns8250_probe::uart_getreg REG_MCR = 8
> ns8250_bus_probe:: exit
> 
> For the two devices that fail, ns8250_bus_probe() fails on the first
> call:
> 
> UART4
> -----
> ns8250_bus_probe:: entry
> ns8250_probe::uart_getreg REG_IIR = 1
> ns8250_probe::uart_getreg REG_MCR = 64
> ns8250_bus_probe::ns8250_probe returned 6
> 
> UART5
> -----
> ns8250_bus_probe:: entry
> ns8250_probe::uart_getreg REG_IIR = 1
> ns8250_probe::uart_getreg REG_MCR = 64
> ns8250_bus_probe::ns8250_probe returned 6
> 
> The value returned for the read of REG_MCR is 64, or 0x40, which causes
> the premature exit:
> 
> static int
> ns8250_probe(struct uart_bas *bas)
> {
>       u_char val;
> 
>       /* Check known 0 bits that don't depend on DLAB. */
>       val = uart_getreg(bas, REG_IIR);
>       if (val & 0x30)
>               return (ENXIO);
>       val = uart_getreg(bas, REG_MCR);
>       if (val & 0xe0)
>               return (ENXIO);
> 
>       return (0);
> }
> 
> Do you need to know the contents of 'bas'?

This goes beyond my level of knowledge.  I've cc'd Marcel (author of uart) who 
can hopefully help with this more.

-- 
John Baldwin
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hardware
To unsubscribe, send any mail to "[email protected]"

Reply via email to