2 * LZMA compressed kernel loader for Atheros AR7XXX/AR9XXX based boards
4 * Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
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.
13 #include "ar71xx_regs.h"
15 #define READREG(r) *(volatile unsigned int *)(r)
16 #define WRITEREG(r,v) *(volatile unsigned int *)(r) = v
18 #define KSEG1ADDR(_x) (((_x) & 0x1fffffff) | 0xa0000000)
20 #define UART_BASE 0xb8020000
25 #define UART_LSR_THRE 0x20
27 #define UART_READ(r) READREG(UART_BASE + 4 * (r))
28 #define UART_WRITE(r,v) WRITEREG(UART_BASE + 4 * (r), (v))
30 void board_putc(int ch)
32 while (((UART_READ(UART_LSR)) & UART_LSR_THRE) == 0);
33 UART_WRITE(UART_TX, ch);
34 while (((UART_READ(UART_LSR)) & UART_LSR_THRE) == 0);
37 #ifdef CONFIG_BOARD_TL_WR1043ND_V1
38 static void tlwr1043nd_init(void)
40 unsigned int reg = KSEG1ADDR(AR71XX_RESET_BASE);
43 t = READREG(reg + AR913X_RESET_REG_RESET_MODULE);
44 t |= AR71XX_RESET_GE0_PHY;
45 WRITEREG(reg + AR913X_RESET_REG_RESET_MODULE, t);
47 t = READREG(reg + AR913X_RESET_REG_RESET_MODULE);
50 static inline void tlwr1043nd_init(void) {}