Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-spi
[oweals/u-boot.git] / drivers / serial / altera_uart.c
index 75c035285e71959a9b8bdda2efae024171670d73..436cf2331df952cc92e0ca0e9486ab96f0401f42 100644 (file)
@@ -1,8 +1,7 @@
+// 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>
@@ -11,8 +10,6 @@
 #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 */
@@ -92,8 +89,7 @@ static int altera_uart_ofdata_to_platdata(struct udevice *dev)
        plat->regs = map_physmem(devfdt_get_addr(dev),
                                 sizeof(struct altera_uart_regs),
                                 MAP_NOCACHE);
-       plat->uartclk = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
-               "clock-frequency", 0);
+       plat->uartclk = dev_read_u32_default(dev, "clock-frequency", 0);
 
        return 0;
 }
@@ -118,7 +114,6 @@ U_BOOT_DRIVER(altera_uart) = {
        .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