diff options
author | ian <ian@FreeBSD.org> | 2014-05-14 19:18:58 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2014-05-14 19:18:58 +0000 |
commit | 057c7452877929463827f58db062e6c8a7e70e1e (patch) | |
tree | 4d7e5652ad495e1d8b2080c968e1eaf2b8f0ffba /sys/dev/uart | |
parent | 21fbbde45943109155a62d78963119afc7f3f290 (diff) | |
download | FreeBSD-src-057c7452877929463827f58db062e6c8a7e70e1e.zip FreeBSD-src-057c7452877929463827f58db062e6c8a7e70e1e.tar.gz |
MFC r257738, r259202, r258410, r260288, r260292, r260294, r260320, r260323,
r260326, r260327, r260331, r260333, r260340, r260371, r260372, r260373,
r260374, r260375
Add common bus_space tag definition shared for most supported ARMv6/v7 SoCs.
Correct license statements to reflect the fact that these files were all
derived from sys/arm/mv/bus_space.c.
In pmap_unmapdev(), remember the size, and use that as an argument to
kva_free(), or we'd end up always passing it a size of 0
In pmap_mapdev(), first check whether a static mapping exists,
Convert TI static device mapping to use the new arm_devmap_add_entry(),
Use the common armv6 fdt_bus_tag defintion for tegra instead of a local copy.
Eliminate use of fdt_immr_addr(), it's not needed for tegra
Convert lpc from using fdt_immr style to arm_devmap_add_entry() to make
static device mappings.
Retire machine/fdt.h as a header used by MI code, as its function is now
obsolete. This involves the following pieces:
- Remove it entirely on PowerPC, where it is not used by MD code either
- Remove all references to machine/fdt.h in non-architecture-specific code
(aside from uart_cpu_fdt.c, shared by ARM and MIPS, and so is somewhat
non-arch-specific).
- Fix code relying on header pollution from machine/fdt.h includes
- Legacy fdtbus.c (still used on x86 FDT systems) now passes resource
requests to its parent (nexus). This allows x86 FDT devices to allocate
both memory and IO requests and removes the last notionally MI use of
fdtbus_bs_tag.
- On those architectures that retain a machine/fdt.h, unused bits like
FDT_MAP_IRQ and FDT_INTR_MAX have been removed.
Add #include <machine/fdt.h> to a few files that used to get it via pollution
Enable the mv cesa security/crypto device by providing the required property
in the dts source, and adding the right devices to the kernel config.
Remove dev/fdt/fdt_pci.c, which was code specific to Marvell ARM SoCs,
related to setting up static device mappings. Since it was only used by
arm/mv/mv_pci.c, it's now just static functions within that file, plus
one public function that gets called only from arm/mv/mv_machdep.c.
Switch RPi to using arm_devmap_add_entry() to set up static device mapping.
Allow 'no static device mappings' to potentially work.
Don't try to find a static mapping before calling pmap_mapdev(), that logic
is now part of pmap_mapdev() and doesn't need to be duplicated here.
Switch a10 to using arm_devmap_add_entry() to set up static device mapping.
Diffstat (limited to 'sys/dev/uart')
-rw-r--r-- | sys/dev/uart/uart_bus_fdt.c | 1 | ||||
-rw-r--r-- | sys/dev/uart/uart_dev_lpc.c | 21 |
2 files changed, 11 insertions, 11 deletions
diff --git a/sys/dev/uart/uart_bus_fdt.c b/sys/dev/uart/uart_bus_fdt.c index 39a6a1c..5a0ebd7 100644 --- a/sys/dev/uart/uart_bus_fdt.c +++ b/sys/dev/uart/uart_bus_fdt.c @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include <sys/module.h> #include <machine/bus.h> -#include <machine/fdt.h> #include <dev/fdt/fdt_common.h> #include <dev/ofw/ofw_bus.h> diff --git a/sys/dev/uart/uart_dev_lpc.c b/sys/dev/uart/uart_dev_lpc.c index ba87a17..08cebc9 100644 --- a/sys/dev/uart/uart_dev_lpc.c +++ b/sys/dev/uart/uart_dev_lpc.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include <sys/bus.h> #include <sys/conf.h> #include <machine/bus.h> +#include <machine/fdt.h> #include <dev/uart/uart.h> #include <dev/uart/uart_cpu.h> @@ -43,16 +44,13 @@ __FBSDID("$FreeBSD$"); #include "uart_if.h" #define DEFAULT_RCLK (13 * 1000 * 1000) -#define LPC_UART_NO(_bas) (((_bas->bsh) - LPC_UART_BASE) >> 15) -#define lpc_ns8250_get_auxreg(_bas, _reg) \ - bus_space_read_4((_bas)->bst, LPC_UART_CONTROL_BASE, _reg) -#define lpc_ns8250_set_auxreg(_bas, _reg, _val) \ - bus_space_write_4((_bas)->bst, LPC_UART_CONTROL_BASE, _reg, _val); +static bus_space_handle_t bsh_clkpwr; + #define lpc_ns8250_get_clkreg(_bas, _reg) \ - bus_space_read_4((_bas)->bst, LPC_CLKPWR_BASE, (_reg)) + bus_space_read_4(fdtbus_bs_tag, bsh_clkpwr, (_reg)) #define lpc_ns8250_set_clkreg(_bas, _reg, _val) \ - bus_space_write_4((_bas)->bst, LPC_CLKPWR_BASE, (_reg), (_val)) + bus_space_write_4(fdtbus_bs_tag, bsh_clkpwr, (_reg), (_val)) /* * Clear pending interrupts. THRE is cleared by reading IIR. Data @@ -293,9 +291,12 @@ lpc_ns8250_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, u_long clkmode; /* Enable UART clock */ - clkmode = lpc_ns8250_get_auxreg(bas, LPC_UART_CLKMODE); - lpc_ns8250_set_auxreg(bas, LPC_UART_CLKMODE, - clkmode | LPC_UART_CLKMODE_UART5(1)); + bus_space_map(fdtbus_bs_tag, LPC_CLKPWR_PHYS_BASE, LPC_CLKPWR_SIZE, 0, + &bsh_clkpwr); + clkmode = lpc_ns8250_get_clkreg(bas, LPC_UART_CLKMODE); + lpc_ns8250_set_clkreg(bas, LPC_UART_CLKMODE, clkmode | + LPC_UART_CLKMODE_UART5(1)); + #if 0 /* Work around H/W bug */ uart_setreg(bas, REG_DATA, 0x00); |