2 * (C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
3 * (C) Copyright 2013 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
5 * (C) Copyright 2007-2011
6 * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
7 * Tom Cubie <tangliang@allwinnertech.com>
9 * Some board init for the Allwinner A10-evb board.
11 * SPDX-License-Identifier: GPL-2.0+
15 #include <asm/arch/clock.h>
16 #include <asm/arch/dram.h>
18 DECLARE_GLOBAL_DATA_PTR;
20 /* add board specific code here */
25 gd->bd->bi_boot_params = (PHYS_SDRAM_0 + 0x100);
27 asm volatile("mrc p15, 0, %0, c0, c1, 1" : "=r"(id_pfr1));
28 debug("id_pfr1: 0x%08x\n", id_pfr1);
29 /* Generic Timer Extension available? */
30 if ((id_pfr1 >> 16) & 0xf) {
31 debug("Setting CNTFRQ\n");
32 /* CNTFRQ == 24 MHz */
33 asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r"(24000000));
41 gd->ram_size = get_ram_size((long *)PHYS_SDRAM_0, PHYS_SDRAM_0_SIZE);
46 #ifdef CONFIG_SPL_BUILD
47 void sunxi_board_init(void)
49 unsigned long ramsize;
52 ramsize = sunxi_dram_init();
53 printf(" %lu MiB\n", ramsize >> 20);