diff options
author | Wills Wang <wills.wang@live.com> | 2016-03-16 16:59:59 +0800 |
---|---|---|
committer | Daniel Schwierzeck <daniel.schwierzeck@gmail.com> | 2016-05-21 01:25:50 +0200 |
commit | 6a7b52bc8d30090633d098f9e988276beb7a53d5 (patch) | |
tree | 1aaeb4e17dbba7a2602aabb811048e20225cf94e /board/qca/ap121/ap121.c | |
parent | b85dc4607268ffc49af642ab702d44c8b5ef3719 (diff) | |
download | u-boot-imx-6a7b52bc8d30090633d098f9e988276beb7a53d5.zip u-boot-imx-6a7b52bc8d30090633d098f9e988276beb7a53d5.tar.gz u-boot-imx-6a7b52bc8d30090633d098f9e988276beb7a53d5.tar.bz2 |
mips: ath79: add AP121 reference board
This patch add board-level code and base DT for AP121.
Signed-off-by: Wills Wang <wills.wang@live.com>
[updated defconfig, enabled CONFIG_USE_PRIVATE_LIBGCC=y]
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Diffstat (limited to 'board/qca/ap121/ap121.c')
-rw-r--r-- | board/qca/ap121/ap121.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/board/qca/ap121/ap121.c b/board/qca/ap121/ap121.c new file mode 100644 index 0000000..d6c60fe --- /dev/null +++ b/board/qca/ap121/ap121.c @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2015-2016 Wills Wang <wills.wang@live.com> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <asm/io.h> +#include <asm/addrspace.h> +#include <asm/types.h> +#include <mach/ar71xx_regs.h> +#include <mach/ddr.h> +#include <debug_uart.h> + +DECLARE_GLOBAL_DATA_PTR; + +#ifdef CONFIG_DEBUG_UART_BOARD_INIT +void board_debug_uart_init(void) +{ + void __iomem *regs; + u32 val; + + regs = map_physmem(AR71XX_GPIO_BASE, AR71XX_GPIO_SIZE, + MAP_NOCACHE); + + /* + * GPIO9 as input, GPIO10 as output + */ + val = readl(regs + AR71XX_GPIO_REG_OE); + val &= ~AR933X_GPIO(9); + val |= AR933X_GPIO(10); + writel(val, regs + AR71XX_GPIO_REG_OE); + + /* + * Enable UART, GPIO9 as UART_SI, GPIO10 as UART_SO + */ + val = readl(regs + AR71XX_GPIO_REG_FUNC); + val |= AR933X_GPIO_FUNC_UART_EN | AR933X_GPIO_FUNC_RES_TRUE; + writel(val, regs + AR71XX_GPIO_REG_FUNC); +} +#endif + +int board_early_init_f(void) +{ +#ifdef CONFIG_DEBUG_UART + debug_uart_init(); +#endif + ddr_init(); + return 0; +} |