]> git.sur5r.net Git - u-boot/blobdiff - drivers/serial/altera_jtag_uart.c
serial: sh: Enable clock if available
[u-boot] / drivers / serial / altera_jtag_uart.c
index 39d4a4e933cd73a42d41484a00c5300ce1361a5b..4a6e60f87efe81c3d474aa1b88c0bbdb1e1cce2a 100644 (file)
@@ -8,9 +8,20 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
-#include <asm/io.h>
-#include <linux/compiler.h>
 #include <serial.h>
+#include <asm/io.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* data register */
+#define ALTERA_JTAG_RVALID     BIT(15) /* Read valid */
+
+/* control register */
+#define ALTERA_JTAG_AC         BIT(10) /* activity indicator */
+#define ALTERA_JTAG_RRDY       BIT(12) /* read available */
+#define ALTERA_JTAG_WSPACE(d)  ((d) >> 16)     /* Write space avail */
+/* Write fifo size. FIXME: this should be extracted with sopc2dts */
+#define ALTERA_JTAG_WRITE_DEPTH        64
 
 struct altera_jtaguart_regs {
        u32     data;                   /* Data register */
@@ -21,18 +32,6 @@ struct altera_jtaguart_platdata {
        struct altera_jtaguart_regs *regs;
 };
 
-/* data register */
-#define ALTERA_JTAG_RVALID     (1<<15)         /* Read valid */
-
-/* control register */
-#define ALTERA_JTAG_AC         (1 << 10)       /* activity indicator */
-#define ALTERA_JTAG_RRDY       (1 << 12)       /* read available */
-#define ALTERA_JTAG_WSPACE(d)  ((d)>>16)       /* Write space avail */
-/* Write fifo size. FIXME: this should be extracted with sopc2dts */
-#define ALTERA_JTAG_WRITE_DEPTH        64
-
-DECLARE_GLOBAL_DATA_PTR;
-
 static int altera_jtaguart_setbrg(struct udevice *dev, int baudrate)
 {
        return 0;
@@ -98,8 +97,9 @@ static int altera_jtaguart_ofdata_to_platdata(struct udevice *dev)
 {
        struct altera_jtaguart_platdata *plat = dev_get_platdata(dev);
 
-       plat->regs = ioremap(dev_get_addr(dev),
-               sizeof(struct altera_jtaguart_regs));
+       plat->regs = map_physmem(devfdt_get_addr(dev),
+                                sizeof(struct altera_jtaguart_regs),
+                                MAP_NOCACHE);
 
        return 0;
 }
@@ -112,8 +112,8 @@ static const struct dm_serial_ops altera_jtaguart_ops = {
 };
 
 static const struct udevice_id altera_jtaguart_ids[] = {
-       { .compatible = "altr,juart-1.0", },
-       { }
+       { .compatible = "altr,juart-1.0" },
+       {}
 };
 
 U_BOOT_DRIVER(altera_jtaguart) = {
@@ -131,7 +131,7 @@ U_BOOT_DRIVER(altera_jtaguart) = {
 
 #include <debug_uart.h>
 
-void debug_uart_init(void)
+static inline void _debug_uart_init(void)
 {
 }