2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2017-06-01 10:01:31 +00:00
|
|
|
/*
|
|
|
|
* (C)Copyright 2016 Rockchip Electronics Co., Ltd
|
|
|
|
* Authors: Andy Yan <andy.yan@rock-chips.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2020-05-10 17:40:02 +00:00
|
|
|
#include <init.h>
|
2020-02-19 01:46:06 +00:00
|
|
|
#include <syscon.h>
|
2017-06-01 10:01:31 +00:00
|
|
|
#include <asm/io.h>
|
2020-02-19 01:46:06 +00:00
|
|
|
#include <asm/arch-rockchip/clock.h>
|
2019-03-28 03:01:23 +00:00
|
|
|
#include <asm/arch-rockchip/grf_rv1108.h>
|
|
|
|
#include <asm/arch-rockchip/hardware.h>
|
2017-06-01 10:01:31 +00:00
|
|
|
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
2020-04-13 01:38:30 +00:00
|
|
|
int board_early_init_f(void)
|
2017-06-01 10:01:31 +00:00
|
|
|
{
|
|
|
|
struct rv1108_grf *grf;
|
2018-01-13 05:53:57 +00:00
|
|
|
enum {
|
|
|
|
GPIO3C3_SHIFT = 6,
|
|
|
|
GPIO3C3_MASK = 3 << GPIO3C3_SHIFT,
|
|
|
|
|
|
|
|
GPIO3C2_SHIFT = 4,
|
|
|
|
GPIO3C2_MASK = 3 << GPIO3C2_SHIFT,
|
|
|
|
|
|
|
|
GPIO2D2_SHIFT = 4,
|
|
|
|
GPIO2D2_MASK = 3 << GPIO2D2_SHIFT,
|
|
|
|
GPIO2D2_GPIO = 0,
|
|
|
|
GPIO2D2_UART2_SOUT_M0,
|
|
|
|
|
|
|
|
GPIO2D1_SHIFT = 2,
|
|
|
|
GPIO2D1_MASK = 3 << GPIO2D1_SHIFT,
|
|
|
|
GPIO2D1_GPIO = 0,
|
|
|
|
GPIO2D1_UART2_SIN_M0,
|
|
|
|
};
|
2017-06-01 10:01:31 +00:00
|
|
|
|
2020-02-19 01:46:06 +00:00
|
|
|
grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
|
2017-06-01 10:01:31 +00:00
|
|
|
|
|
|
|
/*evb board use UART2 m0 for debug*/
|
|
|
|
rk_clrsetreg(&grf->gpio2d_iomux,
|
|
|
|
GPIO2D2_MASK | GPIO2D1_MASK,
|
|
|
|
GPIO2D2_UART2_SOUT_M0 << GPIO2D2_SHIFT |
|
|
|
|
GPIO2D1_UART2_SIN_M0 << GPIO2D1_SHIFT);
|
|
|
|
rk_clrreg(&grf->gpio3c_iomux, GPIO3C3_MASK | GPIO3C2_MASK);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int dram_init(void)
|
|
|
|
{
|
|
|
|
gd->ram_size = 0x8000000;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|