]> Git Repo - J-u-boot.git/blobdiff - drivers/serial/serial_pic32.c
Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""
[J-u-boot.git] / drivers / serial / serial_pic32.c
index 0632d26211d6c8c4ff00e06c338970a52a410149..0a03a9a254971291d675dc6b42f84c05f2f1d8ed 100644 (file)
@@ -1,14 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (c) 2015 Paul Thacker <[email protected]>
  *
- * SPDX-License-Identifier:    GPL-2.0+
- *
  */
 #include <common.h>
 #include <clk.h>
 #include <dm.h>
+#include <malloc.h>
 #include <serial.h>
 #include <wait_bit.h>
+#include <asm/global_data.h>
+#include <linux/bitops.h>
 #include <mach/pic32.h>
 #include <dt-bindings/clock/microchip,clock.h>
 
@@ -153,7 +155,6 @@ static int pic32_uart_probe(struct udevice *dev)
        if (ret < 0)
                return ret;
        priv->uartclk = clk_get_rate(&clk);
-       clk_free(&clk);
 
        /* initialize serial */
        return pic32_serial_init(priv->base, priv->uartclk, CONFIG_BAUDRATE);
@@ -177,8 +178,7 @@ U_BOOT_DRIVER(pic32_serial) = {
        .of_match       = pic32_uart_ids,
        .probe          = pic32_uart_probe,
        .ops            = &pic32_uart_ops,
-       .flags          = DM_FLAG_PRE_RELOC,
-       .priv_auto_alloc_size = sizeof(struct pic32_uart_priv),
+       .priv_auto      = sizeof(struct pic32_uart_priv),
 };
 
 #ifdef CONFIG_DEBUG_UART_PIC32
@@ -186,14 +186,14 @@ U_BOOT_DRIVER(pic32_serial) = {
 
 static inline void _debug_uart_init(void)
 {
-       void __iomem *base = (void __iomem *)CONFIG_DEBUG_UART_BASE;
+       void __iomem *base = (void __iomem *)CONFIG_VAL(DEBUG_UART_BASE);
 
        pic32_serial_init(base, CONFIG_DEBUG_UART_CLOCK, CONFIG_BAUDRATE);
 }
 
 static inline void _debug_uart_putc(int ch)
 {
-       writel(ch, CONFIG_DEBUG_UART_BASE + U_TXR);
+       writel(ch, CONFIG_VAL(DEBUG_UART_BASE) + U_TXR);
 }
 
 DEBUG_UART_FUNCS
This page took 0.02532 seconds and 4 git commands to generate.