blob: 6dca1fc74b92b32c3bd87377347f76c639693700 [file] [log] [blame]
Andy Yanad63aac2017-05-15 17:54:48 +08001/*
2 * Copyright (c) 2017 Andy Yan
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6#include <common.h>
7#include <asm/io.h>
8#include <fdtdec.h>
9#include <asm/arch/clock.h>
10#include <asm/arch/grf_rk3368.h>
11
12DECLARE_GLOBAL_DATA_PTR;
13
14int mach_cpu_init(void)
15{
16 struct rk3368_pmu_grf *pmugrf;
17 int node;
18
19 node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, "rockchip,rk3368-pmugrf");
20 pmugrf = (struct rk3368_pmu_grf *)fdtdec_get_addr(gd->fdt_blob, node, "reg");
21
22 rk_clrsetreg(&pmugrf->gpio0d_iomux,
23 GPIO0D0_MASK | GPIO0D1_MASK |
24 GPIO0D2_MASK | GPIO0D3_MASK,
25 GPIO0D0_GPIO << GPIO0D0_SHIFT |
26 GPIO0D1_GPIO << GPIO0D1_SHIFT |
27 GPIO0D2_UART4_SOUT << GPIO0D2_SHIFT |
28 GPIO0D3_UART4_SIN << GPIO0D3_SHIFT);
29 return 0;
30}
31
32int board_init(void)
33{
34 return 0;
35}