mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 13:22:48 +00:00
Migrate towards using at91_master_clock. Initialize the clocks for
the serial port class when we set the devclass since it is now no-longer a compile time constant. Eliminate the pci include, as it isn't relevant or necessary.
This commit is contained in:
parent
3180286fb2
commit
5999bbbf41
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=187602
@ -38,13 +38,12 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/rman.h>
|
||||
#include <machine/resource.h>
|
||||
|
||||
#include <dev/pci/pcivar.h>
|
||||
|
||||
#include <dev/uart/uart.h>
|
||||
#include <dev/uart/uart_bus.h>
|
||||
#include <dev/uart/uart_cpu.h>
|
||||
|
||||
#include <arm/at91/at91rm92reg.h>
|
||||
#include <arm/at91/at91var.h>
|
||||
|
||||
#include "uart_if.h"
|
||||
|
||||
@ -103,6 +102,8 @@ usart_at91rm92_probe(device_t dev)
|
||||
break;
|
||||
}
|
||||
sc->sc_class = &at91_usart_class;
|
||||
if (sc->sc_class->uc_rclk == 0)
|
||||
sc->sc_class->uc_rclk = at91_master_clock;
|
||||
return (uart_bus_probe(dev, 0, 0, 0, device_get_unit(dev)));
|
||||
}
|
||||
|
||||
|
@ -35,12 +35,16 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/systm.h>
|
||||
#include <sys/bus.h>
|
||||
#include <sys/cons.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <machine/bus.h>
|
||||
|
||||
#include <dev/uart/uart.h>
|
||||
#include <dev/uart/uart_bus.h>
|
||||
#include <dev/uart/uart_cpu.h>
|
||||
|
||||
#include <arm/at91/at91rm92reg.h>
|
||||
#include <arm/at91/at91var.h>
|
||||
|
||||
bus_space_tag_t uart_bus_space_io;
|
||||
bus_space_tag_t uart_bus_space_mem;
|
||||
@ -60,6 +64,8 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di)
|
||||
struct uart_class *class;
|
||||
|
||||
class = &at91_usart_class;
|
||||
if (class->uc_rclk == 0)
|
||||
class->uc_rclk = at91_master_clock;
|
||||
di->ops = uart_getops(class);
|
||||
di->bas.chan = 0;
|
||||
di->bas.bst = &at91_bs_tag;
|
||||
|
@ -45,10 +45,11 @@ __FBSDID("$FreeBSD$");
|
||||
#include <arm/at91/at91rm92reg.h>
|
||||
#include <arm/at91/at91_usartreg.h>
|
||||
#include <arm/at91/at91_pdcreg.h>
|
||||
#include <arm/at91/at91var.h>
|
||||
|
||||
#include "uart_if.h"
|
||||
|
||||
#define DEFAULT_RCLK AT91C_MASTER_CLOCK
|
||||
#define DEFAULT_RCLK at91_master_clock
|
||||
#define USART_BUFFER_SIZE 128
|
||||
|
||||
/*
|
||||
@ -684,6 +685,5 @@ struct uart_class at91_usart_class = {
|
||||
at91_usart_methods,
|
||||
sizeof(struct at91_usart_softc),
|
||||
.uc_ops = &at91_usart_ops,
|
||||
.uc_range = 8,
|
||||
.uc_rclk = DEFAULT_RCLK
|
||||
.uc_range = 8
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user