blob: 571a0751457998ba1d5db342b074b615c86ad5b6 [file] [log] [blame]
Usama Arif9218a112020-08-12 16:12:53 +01001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * (C) Copyright 2020 Arm Limited
4 * Usama Arif <usama.arif@arm.com>
5 */
6
Tom Rinidec7ea02024-05-20 13:35:03 -06007#include <config.h>
Usama Arif9218a112020-08-12 16:12:53 +01008#include <dm.h>
9#include <dm/platform_data/serial_pl01x.h>
Boyan Karatotevf5e18c02024-10-25 18:18:14 +010010#include <env.h>
Usama Arif9218a112020-08-12 16:12:53 +010011#include <asm/armv8/mmu.h>
Simon Glass3ba929a2020-10-30 21:38:53 -060012#include <asm/global_data.h>
Boyan Karatotevf5e18c02024-10-25 18:18:14 +010013#include <asm/system.h>
Usama Arif9218a112020-08-12 16:12:53 +010014
15static struct mm_region total_compute_mem_map[] = {
16 {
17 .virt = 0x0UL,
18 .phys = 0x0UL,
19 .size = 0x80000000UL,
20 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
21 PTE_BLOCK_NON_SHARE |
22 PTE_BLOCK_PXN | PTE_BLOCK_UXN
23 }, {
24 .virt = 0x80000000UL,
25 .phys = 0x80000000UL,
26 .size = 0xff80000000UL,
27 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
28 PTE_BLOCK_INNER_SHARE
29 }, {
30 /* List terminator */
31 0,
32 }
33};
34
35struct mm_region *mem_map = total_compute_mem_map;
36
Boyan Karatotevf5e18c02024-10-25 18:18:14 +010037/*
38 * Push the variable into the .data section so that it
39 * does not get cleared later.
40 */
41unsigned long __section(".data") fw_dtb_pointer;
42
43void *board_fdt_blob_setup(int *err)
44{
45 *err = 0;
46 if (fdt_magic(fw_dtb_pointer) != FDT_MAGIC) {
47 *err = -ENXIO;
48 return NULL;
49 }
50
51 return (void *)fw_dtb_pointer;
52}
53
Usama Arif9218a112020-08-12 16:12:53 +010054int board_init(void)
55{
56 return 0;
57}
58
59int dram_init(void)
60{
Boyan Karatotevf5e18c02024-10-25 18:18:14 +010061 return fdtdec_setup_mem_size_base();
Usama Arif9218a112020-08-12 16:12:53 +010062}
63
64int dram_init_banksize(void)
65{
Boyan Karatotevf5e18c02024-10-25 18:18:14 +010066 return fdtdec_setup_memory_banksize();
Usama Arif9218a112020-08-12 16:12:53 +010067}
68
69/* Nothing to be done here as handled by PSCI interface */
Harald Seiler6f14d5f2020-12-15 16:47:52 +010070void reset_cpu(void)
Usama Arif9218a112020-08-12 16:12:53 +010071{
72}