1 // SPDX-License-Identifier: GPL-2.0+
9 #include <asm/armv8/mmu.h>
10 #include <asm/system.h>
12 #include <linux/arm-smccc.h>
13 #include <linux/kernel.h>
17 DECLARE_GLOBAL_DATA_PTR;
22 gd->ram_size = PHYS_SDRAM_1_SIZE;
26 int dram_init_banksize(void)
28 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
29 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
39 void reset_cpu(ulong addr)
41 struct arm_smccc_res res;
43 arm_smccc_smc(0x84000009, 0, 0, 0, 0, 0, 0, 0, &res);
44 debug("reset cpu error, %lx\n", res.a0);
47 static struct mm_region durian_mem_map[] = {
52 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
58 .virt = (u64)PHYS_SDRAM_1,
59 .phys = (u64)PHYS_SDRAM_1,
60 .size = (u64)PHYS_SDRAM_1_SIZE,
61 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
70 struct mm_region *mem_map = durian_mem_map;
72 int print_cpuinfo(void)
74 printf("CPU: Phytium ft2004 %ld MHz\n", gd->cpu_clk);
78 int __asm_flush_l3_dcache(void)
82 for (i = 0; i < HNF_COUNT; i++)
83 writeq(HNF_PSTATE_SFONLY, HNF_PSTATE_REQ + i * HNF_STRIDE);
84 for (i = 0; i < HNF_COUNT; i++) {
86 pstate = readq(HNF_PSTATE_STAT + i * HNF_STRIDE);
87 } while ((pstate & 0xf) != (HNF_PSTATE_SFONLY << 2));
90 for (i = 0; i < HNF_COUNT; i++)
91 writeq(HNF_PSTATE_FULL, HNF_PSTATE_REQ + i * HNF_STRIDE);
96 int last_stage_init(void)
103 ret = scsi_scan(true);
105 printf("scsi scan failed\n");
106 return CMD_RET_FAILURE;