Merge commit 'u-boot/master' into for-1.3.1
[oweals/u-boot.git] / cpu / bf533 / serial.c
index eb552056a48b9718a1be49f8d29c9c7608a61ac1..8ac6e3ff64e328ed681bb44ea3e1da10397a1454 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * U-boot - serial.c Serial driver for BF533
  *
- * Copyright (c) 2005 blackfin.uclinux.org
+ * Copyright (c) 2005-2007 Analog Devices Inc.
  *
  * This file is based on
  * bf533_serial.c: Serial driver for BlackFin BF533 DSP internal UART.
@@ -38,8 +38,8 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ * MA 02110-1301 USA
  */
 
 #include <common.h>
 #include <asm/bitops.h>
 #include <asm/delay.h>
 #include <asm/uaccess.h>
+#include <asm/io.h>
 #include "bf533_serial.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 unsigned long pll_div_fact;
 
 void calc_baud(void)
@@ -73,7 +76,6 @@ void calc_baud(void)
 void serial_setbrg(void)
 {
        int i;
-       DECLARE_GLOBAL_DATA_PTR;
 
        calc_baud();
 
@@ -84,29 +86,29 @@ void serial_setbrg(void)
 
        /* Enable UART */
        *pUART_GCTL |= UART_GCTL_UCEN;
-       __builtin_bfin_ssync();
+       sync();
 
        /* Set DLAB in LCR to Access DLL and DLH */
        ACCESS_LATCH;
-       __builtin_bfin_ssync();
+       sync();
 
        *pUART_DLL = hw_baud_table[i].dl_low;
-       __builtin_bfin_ssync();
+       sync();
        *pUART_DLH = hw_baud_table[i].dl_high;
-       __builtin_bfin_ssync();
+       sync();
 
        /* Clear DLAB in LCR to Access THR RBR IER */
        ACCESS_PORT_IER;
-       __builtin_bfin_ssync();
+       sync();
 
        /* Enable  ERBFI and ELSI interrupts
         * to poll SIC_ISR register*/
        *pUART_IER = UART_IER_ELSI | UART_IER_ERBFI | UART_IER_ETBEI;
-       __builtin_bfin_ssync();
+       sync();
 
        /* Set LCR to Word Lengh 8-bit word select */
        *pUART_LCR = UART_LCR_WLS8;
-       __builtin_bfin_ssync();
+       sync();
 
        return;
 }