1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2013 Broadcom Corporation.
10 #include <asm/mach-types.h>
13 #include <asm/kona-common/kona_sdhci.h>
14 #include <asm/kona-common/clk.h>
15 #include <asm/arch/sysmap.h>
18 #include <usb/dwc2_udc.h>
21 #define SECWATCHDOG_SDOGCR_OFFSET 0x00000000
22 #define SECWATCHDOG_SDOGCR_EN_SHIFT 27
23 #define SECWATCHDOG_SDOGCR_SRSTEN_SHIFT 26
24 #define SECWATCHDOG_SDOGCR_CLKS_SHIFT 20
25 #define SECWATCHDOG_SDOGCR_LD_SHIFT 0
27 #ifndef CONFIG_USB_SERIALNO
28 #define CONFIG_USB_SERIALNO "1234567890"
31 DECLARE_GLOBAL_DATA_PTR;
34 * board_init - early hardware init
38 printf("Relocation Offset is: %08lx\n", gd->reloc_off);
40 /* adress of boot parameters */
41 gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
49 * misc_init_r - miscellaneous platform dependent initializations
57 * dram_init - sets uboots idea of sdram size
61 gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
62 CONFIG_SYS_SDRAM_SIZE);
66 /* This is called after dram_init() so use get_ram_size result */
67 int dram_init_banksize(void)
69 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
70 gd->bd->bi_dram[0].size = gd->ram_size;
75 #ifdef CONFIG_MMC_SDHCI_KONA
77 * mmc_init - Initializes mmc
79 int board_mmc_init(bd_t *bis)
83 /* Register eMMC - SDIO2 */
84 ret = kona_sdhci_init(1, 400000, 0);
88 /* Register SD Card - SDIO4 kona_mmc_init assumes 0 based index */
89 ret = kona_sdhci_init(3, 400000, 0);
94 #ifdef CONFIG_USB_GADGET
95 static struct dwc2_plat_otg_data bcm_otg_data = {
96 .regs_otg = HSOTG_BASE_ADDR
99 int board_usb_init(int index, enum usb_init_type init)
101 debug("%s: performing dwc2_udc_probe\n", __func__);
102 return dwc2_udc_probe(&bcm_otg_data);
105 int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
107 debug("%s\n", __func__);
108 if (!env_get("serial#"))
109 g_dnl_set_serialnumber(CONFIG_USB_SERIALNO);
113 int g_dnl_get_board_bcd_device_number(int gcnum)
115 debug("%s\n", __func__);
119 int board_usb_cleanup(int index, enum usb_init_type init)
121 debug("%s\n", __func__);