diff options
author | Roman Yeryomin <roman@advem.lv> | 2013-08-16 11:44:04 +0300 |
---|---|---|
committer | Roman Yeryomin <roman@advem.lv> | 2013-08-16 11:44:04 +0300 |
commit | dee99ab0143122146ab7713cfe171790bc796dd3 (patch) | |
tree | 907ad856f6ceae17a70dd1df004a1adee8a1b2fd /target/linux/realtek/image/lzma-loader/src/board.c | |
parent | 4ed5985ada0f0420d69d7d959ecc3c9c8515efa0 (diff) |
Get rid of rtkload. Use OpenWrt lzma-loader (with kernel_entry hack). Use mgbin for unified tftp image generation.
Signed-off-by: Roman Yeryomin <roman@advem.lv>
Diffstat (limited to 'target/linux/realtek/image/lzma-loader/src/board.c')
-rw-r--r-- | target/linux/realtek/image/lzma-loader/src/board.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/target/linux/realtek/image/lzma-loader/src/board.c b/target/linux/realtek/image/lzma-loader/src/board.c new file mode 100644 index 000000000..0533abace --- /dev/null +++ b/target/linux/realtek/image/lzma-loader/src/board.c @@ -0,0 +1,45 @@ +/* + * LZMA compressed kernel loader for Realtek 819X + * + * Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include <stddef.h> + + +#define UART_THR 0xb8002000 +#define UART_LSR 0xb8002014 + +#define REG32(reg) (*(volatile unsigned int *)((unsigned int)reg)) + + +void serial_outc(char c) +{ + int i=0; + + while (1) + { + i++; + if (i >=0x6000) + break; + + if (REG32(UART_LSR) & 0x20000000) + break; + } + REG32(UART_THR) = (c << 24); +} + + +void board_putc(int ch) +{ + serial_outc(ch); +} + +void board_init(void) +{ + +} |