1 // SPDX-License-Identifier: GPL-2.0+
4 * lixinde <lixinde@phytium.com.cn>
5 * weichangzheng <weichangzheng@phytium.com.cn>
11 #include <asm/armv8/mmu.h>
13 #include <linux/arm-smccc.h>
16 #include <asm/u-boot.h>
19 DECLARE_GLOBAL_DATA_PTR;
23 debug("Phytium ddr init\n");
27 gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE, 0x7b000000);
30 debug("PBF relocate done\n");
42 struct arm_smccc_res res;
44 debug("run in reset cpu\n");
45 arm_smccc_smc(0x84000009, 0, 0, 0, 0, 0, 0, 0, &res);
47 panic("reset cpu error, %lx\n", res.a0);
50 int mach_cpu_init(void)
56 int board_early_init_f(void)
62 static struct mm_region pomelo_mem_map[] = {
67 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
76 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
85 struct mm_region *mem_map = pomelo_mem_map;
87 int __asm_flush_l3_dcache(void)
91 for (i = 0; i < HNF_COUNT; i++)
92 writeq(HNF_PSTATE_SFONLY, HNF_PSTATE_REQ + i * HNF_STRIDE);
93 for (i = 0; i < HNF_COUNT; i++) {
95 pstate = readq(HNF_PSTATE_STAT + i * HNF_STRIDE);
96 } while ((pstate & 0xf) != (HNF_PSTATE_SFONLY << 2));
99 for (i = 0; i < HNF_COUNT; i++)
100 writeq(HNF_PSTATE_FULL, HNF_PSTATE_REQ + i * HNF_STRIDE);
105 int last_stage_init(void)
112 ret = scsi_scan(true);
114 printf("scsi scan failed\n");
115 return CMD_RET_FAILURE;