blob: cd12ce383452af1dcd241ae9b45dddd35ac63ddd [file] [log] [blame]
Jim Liu147c0002022-09-27 16:45:15 +08001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (c) 2022 Nuvoton Technology Corp.
4 */
5
6#include <common.h>
7#include <dm.h>
8#include <asm/io.h>
9#include <asm/arch/gcr.h>
10
11DECLARE_GLOBAL_DATA_PTR;
12
13int board_init(void)
14{
15 return 0;
16}
17
18int dram_init(void)
19{
20 struct npcm_gcr *gcr = (struct npcm_gcr *)NPCM_GCR_BA;
21
22 /*
23 * Get dram size from bootblock.
24 * The value is stored in scrpad_02 register.
25 */
26 gd->ram_size = readl(&gcr->scrpad_b);
27
28 return 0;
29}