2 * Copyright 2010-2011 Calxeda, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
12 #include <asm/sizes.h>
15 #define HB_SREG_A9_PWR_REQ 0xfff3cf00
16 #define HB_SREG_A9_BOOT_SRC_STAT 0xfff3cf04
17 #define HB_PWR_SUSPEND 0
18 #define HB_PWR_SOFT_RESET 1
19 #define HB_PWR_HARD_RESET 2
20 #define HB_PWR_SHUTDOWN 3
22 DECLARE_GLOBAL_DATA_PTR;
25 * Miscellaneous platform dependent initialisations
34 /* We know all the init functions have been run now */
35 int board_eth_init(bd_t *bis)
39 #ifdef CONFIG_CALXEDA_XGMAC
40 rc += calxedaxgmac_initialize(0, 0xfff50000);
41 rc += calxedaxgmac_initialize(1, 0xfff51000);
51 ahci_init(0xffe08000);
54 boot_choice = readl(HB_SREG_A9_BOOT_SRC_STAT) & 0xff;
55 sprintf(envbuffer, "bootcmd%d", boot_choice);
56 if (getenv(envbuffer)) {
57 sprintf(envbuffer, "run bootcmd%d", boot_choice);
58 setenv("bootcmd", envbuffer);
60 setenv("bootcmd", "");
67 gd->ram_size = SZ_512M;
71 void dram_init_banksize(void)
73 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
74 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
77 void reset_cpu(ulong addr)
79 writel(HB_PWR_HARD_RESET, HB_SREG_A9_PWR_REQ);