Jim Liu | 147c000 | 2022-09-27 16:45:15 +0800 | [diff] [blame^] | 1 | // 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 | |
| 11 | DECLARE_GLOBAL_DATA_PTR; |
| 12 | |
| 13 | int board_init(void) |
| 14 | { |
| 15 | return 0; |
| 16 | } |
| 17 | |
| 18 | int 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 | } |