blob: 53941b5f5f2887cffc52cb09ed55f8d3a38351a8 [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 Riniabb9a042024-05-18 20:20:43 -06007#include <common.h>
Usama Arif9218a112020-08-12 16:12:53 +01008#include <dm.h>
9#include <dm/platform_data/serial_pl01x.h>
10#include <asm/armv8/mmu.h>
Simon Glass3ba929a2020-10-30 21:38:53 -060011#include <asm/global_data.h>
Usama Arif9218a112020-08-12 16:12:53 +010012
Simon Glassb75b15b2020-12-03 16:55:23 -070013static const struct pl01x_serial_plat serial_plat = {
Usama Arif9218a112020-08-12 16:12:53 +010014 .base = UART0_BASE,
15 .type = TYPE_PL011,
Tom Rini5c896ae2022-12-04 10:13:30 -050016 .clock = CFG_PL011_CLOCK,
Usama Arif9218a112020-08-12 16:12:53 +010017};
18
Simon Glass1d8364a2020-12-28 20:34:54 -070019U_BOOT_DRVINFO(total_compute_serials) = {
Usama Arif9218a112020-08-12 16:12:53 +010020 .name = "serial_pl01x",
Simon Glassb75b15b2020-12-03 16:55:23 -070021 .plat = &serial_plat,
Usama Arif9218a112020-08-12 16:12:53 +010022};
23
24static struct mm_region total_compute_mem_map[] = {
25 {
26 .virt = 0x0UL,
27 .phys = 0x0UL,
28 .size = 0x80000000UL,
29 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
30 PTE_BLOCK_NON_SHARE |
31 PTE_BLOCK_PXN | PTE_BLOCK_UXN
32 }, {
33 .virt = 0x80000000UL,
34 .phys = 0x80000000UL,
35 .size = 0xff80000000UL,
36 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
37 PTE_BLOCK_INNER_SHARE
38 }, {
39 /* List terminator */
40 0,
41 }
42};
43
44struct mm_region *mem_map = total_compute_mem_map;
45
46int board_init(void)
47{
48 return 0;
49}
50
51int dram_init(void)
52{
53 gd->ram_size = PHYS_SDRAM_1_SIZE;
54 return 0;
55}
56
57int dram_init_banksize(void)
58{
59 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
60 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
61
Usama Arif3e44c082021-10-12 13:43:16 +010062 gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
63 gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
64
Usama Arif9218a112020-08-12 16:12:53 +010065 return 0;
66}
67
68/* Nothing to be done here as handled by PSCI interface */
Harald Seiler6f14d5f2020-12-15 16:47:52 +010069void reset_cpu(void)
Usama Arif9218a112020-08-12 16:12:53 +010070{
71}