+// SPDX-License-Identifier: GPL-2.0+
/*
* (C) Copyright 2004, Psyent Corporation <www.psyent.com>
* Scott McNutt <smcnutt@psyent.com>
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <serial.h>
#include <asm/io.h>
-DECLARE_GLOBAL_DATA_PTR;
-
/* status register */
#define ALTERA_UART_TMT BIT(5) /* tx empty */
#define ALTERA_UART_TRDY BIT(6) /* tx ready */
{
struct altera_uart_platdata *plat = dev_get_platdata(dev);
- plat->regs = ioremap(dev_get_addr(dev),
- sizeof(struct altera_uart_regs));
- plat->uartclk = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
- "clock-frequency", 0);
+ plat->regs = map_physmem(devfdt_get_addr(dev),
+ sizeof(struct altera_uart_regs),
+ MAP_NOCACHE);
+ plat->uartclk = dev_read_u32_default(dev, "clock-frequency", 0);
return 0;
}
.platdata_auto_alloc_size = sizeof(struct altera_uart_platdata),
.probe = altera_uart_probe,
.ops = &altera_uart_ops,
- .flags = DM_FLAG_PRE_RELOC,
};
#ifdef CONFIG_DEBUG_UART_ALTERA_UART
#include <debug_uart.h>
-void debug_uart_init(void)
+static inline void _debug_uart_init(void)
{
struct altera_uart_regs *regs = (void *)CONFIG_DEBUG_UART_BASE;
u32 div;