2 * Copyright 2013 Broadcom Corporation.
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <asm/mach-types.h>
11 #include <asm/kona-common/kona_sdhci.h>
12 #include <asm/kona-common/clk.h>
13 #include <asm/arch/sysmap.h>
15 #define SECWATCHDOG_SDOGCR_OFFSET 0x00000000
16 #define SECWATCHDOG_SDOGCR_EN_SHIFT 27
17 #define SECWATCHDOG_SDOGCR_SRSTEN_SHIFT 26
18 #define SECWATCHDOG_SDOGCR_CLKS_SHIFT 20
19 #define SECWATCHDOG_SDOGCR_LD_SHIFT 0
21 DECLARE_GLOBAL_DATA_PTR;
24 * board_init - early hardware init
28 printf("Relocation Offset is: %08lx\n", gd->reloc_off);
30 /* adress of boot parameters */
31 gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
39 * misc_init_r - miscellaneous platform dependent initializations
43 /* Disable watchdog reset - watchdog unused */
44 writel((0 << SECWATCHDOG_SDOGCR_EN_SHIFT) |
45 (0 << SECWATCHDOG_SDOGCR_SRSTEN_SHIFT) |
46 (4 << SECWATCHDOG_SDOGCR_CLKS_SHIFT) |
47 (0x5a0 << SECWATCHDOG_SDOGCR_LD_SHIFT),
48 (SECWD_BASE_ADDR + SECWATCHDOG_SDOGCR_OFFSET));
54 * dram_init - sets uboots idea of sdram size
58 gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
59 CONFIG_SYS_SDRAM_SIZE);
63 /* This is called after dram_init() so use get_ram_size result */
64 void dram_init_banksize(void)
66 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
67 gd->bd->bi_dram[0].size = gd->ram_size;
70 #ifdef CONFIG_KONA_SDHCI
72 * mmc_init - Initializes mmc
74 int board_mmc_init(bd_t *bis)
78 /* Register eMMC - SDIO2 */
79 ret = kona_sdhci_init(1, 400000, 0);
83 /* Register SD Card - SDIO4 kona_mmc_init assumes 0 based index */
84 ret = kona_sdhci_init(3, 400000, 0);