1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-24 16:10:11 +00:00

Get the fdt uart driver working on arm64, there is no machine/fdt.h, and

the default shift should be 2 for the SoCs we support.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Andrew Turner 2015-04-07 15:12:03 +00:00
parent 079419ddc2
commit be3b046ce8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=281204
2 changed files with 13 additions and 1 deletions

View File

@ -83,10 +83,16 @@ uart_fdt_get_clock(phandle_t node, pcell_t *cell)
int
uart_fdt_get_shift(phandle_t node, pcell_t *cell)
{
#ifdef __aarch64__
#define DEFAULT_SHIFT 2
#else
#define DEFAULT_SHIFT 0
#endif
if ((OF_getencprop(node, "reg-shift", cell, sizeof(*cell))) <= 0)
*cell = 0;
*cell = DEFAULT_SHIFT;
return (0);
#undef DEFAULT_SHIFT
}
static uintptr_t

View File

@ -42,7 +42,9 @@ __FBSDID("$FreeBSD$");
#include <vm/pmap.h>
#include <machine/bus.h>
#ifndef __aarch64__
#include <machine/fdt.h>
#endif
#include <dev/fdt/fdt_common.h>
#include <dev/ofw/ofw_bus.h>
@ -52,6 +54,10 @@ __FBSDID("$FreeBSD$");
#include <dev/uart/uart_cpu.h>
#include <dev/uart/uart_cpu_fdt.h>
#ifdef __aarch64__
extern bus_space_tag_t fdtbus_bs_tag;
#endif
/*
* UART console routines.
*/