1*dd99eef5SAlexander Shiyan/* 2*dd99eef5SAlexander Shiyan * Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru> 3*dd99eef5SAlexander Shiyan * 4*dd99eef5SAlexander Shiyan * This program is free software; you can redistribute it and/or modify 5*dd99eef5SAlexander Shiyan * it under the terms of the GNU General Public License as published by 6*dd99eef5SAlexander Shiyan * the Free Software Foundation; either version 2 of the License, or 7*dd99eef5SAlexander Shiyan * (at your option) any later version. 8*dd99eef5SAlexander Shiyan */ 9*dd99eef5SAlexander Shiyan 10*dd99eef5SAlexander Shiyan#ifndef CONFIG_DEBUG_CLPS711X_UART2 11*dd99eef5SAlexander Shiyan#define CLPS711X_UART_PADDR (0x80000000 + 0x0000) 12*dd99eef5SAlexander Shiyan#define CLPS711X_UART_VADDR (0xfeff0000 + 0x0000) 13*dd99eef5SAlexander Shiyan#else 14*dd99eef5SAlexander Shiyan#define CLPS711X_UART_PADDR (0x80000000 + 0x1000) 15*dd99eef5SAlexander Shiyan#define CLPS711X_UART_VADDR (0xfeff0000 + 0x1000) 16*dd99eef5SAlexander Shiyan#endif 17*dd99eef5SAlexander Shiyan 18*dd99eef5SAlexander Shiyan#define SYSFLG (0x0140) 19*dd99eef5SAlexander Shiyan#define SYSFLG_UBUSY (1 << 11) 20*dd99eef5SAlexander Shiyan#define UARTDR (0x0480) 21*dd99eef5SAlexander Shiyan 22*dd99eef5SAlexander Shiyan .macro addruart, rp, rv, tmp 23*dd99eef5SAlexander Shiyan ldr \rv, =CLPS711X_UART_VADDR 24*dd99eef5SAlexander Shiyan ldr \rp, =CLPS711X_UART_PADDR 25*dd99eef5SAlexander Shiyan .endm 26*dd99eef5SAlexander Shiyan 27*dd99eef5SAlexander Shiyan .macro waituart,rd,rx 28*dd99eef5SAlexander Shiyan .endm 29*dd99eef5SAlexander Shiyan 30*dd99eef5SAlexander Shiyan .macro senduart,rd,rx 31*dd99eef5SAlexander Shiyan str \rd, [\rx, #UARTDR] 32*dd99eef5SAlexander Shiyan .endm 33*dd99eef5SAlexander Shiyan 34*dd99eef5SAlexander Shiyan .macro busyuart,rd,rx 35*dd99eef5SAlexander Shiyan1001: ldr \rd, [\rx, #SYSFLG] 36*dd99eef5SAlexander Shiyan tst \rd, #SYSFLG_UBUSY 37*dd99eef5SAlexander Shiyan bne 1001b 38*dd99eef5SAlexander Shiyan .endm 39