mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-18 02:38:56 +00:00
83d290c56f
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
46 lines
952 B
C
46 lines
952 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (C) 2015-2016 Wills Wang <wills.wang@live.com>
|
|
*/
|
|
|
|
#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 <mach/ath79.h>
|
|
#include <debug_uart.h>
|
|
|
|
#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)
|
|
{
|
|
ddr_init();
|
|
ath79_eth_reset();
|
|
return 0;
|
|
}
|