blob: 5a97c8cb2642ff896b65096f66f7d8a7f4f35b12 [file] [log] [blame]
mingming lee13e89d72019-11-07 19:28:40 +08001// SPDX-License-Identifier: GPL-2.0
2/*
3 * Configuration for MediaTek MT8518 SoC
4 *
5 * Copyright (C) 2019 MediaTek Inc.
6 * Author: Mingming Lee <mingming.lee@mediatek.com>
7 */
8
9#include <clk.h>
10#include <common.h>
11#include <dm.h>
12#include <fdtdec.h>
13#include <ram.h>
14#include <asm/arch/misc.h>
15#include <asm/armv8/mmu.h>
16#include <asm/sections.h>
17#include <dm/uclass.h>
18#include <dt-bindings/clock/mt8518-clk.h>
19
20DECLARE_GLOBAL_DATA_PTR;
21
22int dram_init(void)
23{
24 int ret;
25
26 ret = fdtdec_setup_memory_banksize();
27 if (ret)
28 return ret;
29
30 return fdtdec_setup_mem_size_base();
31}
32
33int dram_init_banksize(void)
34{
35 gd->bd->bi_dram[0].start = gd->ram_base;
36 gd->bd->bi_dram[0].size = gd->ram_size;
37
38 return 0;
39}
40
41void reset_cpu(ulong addr)
42{
43 psci_system_reset();
44}
45
46int print_cpuinfo(void)
47{
48 printf("CPU: MediaTek MT8518\n");
49 return 0;
50}
51
52static struct mm_region mt8518_mem_map[] = {
53 {
54 /* DDR */
55 .virt = 0x40000000UL,
56 .phys = 0x40000000UL,
57 .size = 0x20000000UL,
58 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_OUTER_SHARE,
59 }, {
60 .virt = 0x00000000UL,
61 .phys = 0x00000000UL,
62 .size = 0x20000000UL,
63 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
64 PTE_BLOCK_NON_SHARE |
65 PTE_BLOCK_PXN | PTE_BLOCK_UXN
66 }, {
67 0,
68 }
69};
70
71struct mm_region *mem_map = mt8518_mem_map;