OpenWrt – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 /*
2 * Arch specific code for mt7621 based boards, based on code for Ralink boards
3 *
4 * Copyright (C) 2018 Tobias Schramm <tobleminer@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
9 */
10  
11 #include <stddef.h>
12 #include <stdint.h>
13 #include "config.h"
14  
15 #define READREG(r) *(volatile uint32_t *)(r)
16 #define WRITEREG(r,v) *(volatile uint32_t *)(r) = v
17  
18 #define KSEG1ADDR(_x) (((_x) & 0x1fffffff) | 0xa0000000)
19  
20 #define UART_BASE 0xBE000C00
21  
22 #define UART_TBR_OFFSET 0x00
23 #define UART_LSR_OFFSET 0x14
24  
25 #define UART_LSR_TEMT (1 << 6)
26  
27 #define UART_READ(r) READREG(UART_BASE + (r))
28 #define UART_WRITE(r,v) WRITEREG(UART_BASE + (r), (v))
29  
30 void board_putc(int ch)
31 {
32 while (((UART_READ(UART_LSR_OFFSET)) & UART_LSR_TEMT) == 0);
33 UART_WRITE(UART_TBR_OFFSET, ch);
34 while (((UART_READ(UART_LSR_OFFSET)) & UART_LSR_TEMT) == 0);
35 }
36  
37 void board_init(void)
38 {
39 }