1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2013 Broadcom Corporation.
9 #include <asm/global_data.h>
11 #include <asm/mach-types.h>
14 #include <asm/kona-common/kona_sdhci.h>
15 #include <asm/kona-common/clk.h>
16 #include <asm/arch/sysmap.h>
19 #include <usb/dwc2_udc.h>
22 #define SECWATCHDOG_SDOGCR_OFFSET 0x00000000
23 #define SECWATCHDOG_SDOGCR_EN_SHIFT 27
24 #define SECWATCHDOG_SDOGCR_SRSTEN_SHIFT 26
25 #define SECWATCHDOG_SDOGCR_CLKS_SHIFT 20
26 #define SECWATCHDOG_SDOGCR_LD_SHIFT 0
28 #ifndef CONFIG_USB_SERIALNO
29 #define CONFIG_USB_SERIALNO "1234567890"
32 DECLARE_GLOBAL_DATA_PTR;
35 * board_init - early hardware init
39 printf("Relocation Offset is: %08lx\n", gd->reloc_off);
41 /* adress of boot parameters */
42 gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
50 * misc_init_r - miscellaneous platform dependent initializations
58 * dram_init - sets uboots idea of sdram size
62 gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
63 CONFIG_SYS_SDRAM_SIZE);
67 /* This is called after dram_init() so use get_ram_size result */
68 int dram_init_banksize(void)
70 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
71 gd->bd->bi_dram[0].size = gd->ram_size;
76 #ifdef CONFIG_MMC_SDHCI_KONA
78 * mmc_init - Initializes mmc
80 int board_mmc_init(struct bd_info *bis)
84 /* Register eMMC - SDIO2 */
85 ret = kona_sdhci_init(1, 400000, 0);
89 /* Register SD Card - SDIO4 kona_mmc_init assumes 0 based index */
90 ret = kona_sdhci_init(3, 400000, 0);
95 #ifdef CONFIG_USB_GADGET
96 static struct dwc2_plat_otg_data bcm_otg_data = {
97 .regs_otg = HSOTG_BASE_ADDR
100 int board_usb_init(int index, enum usb_init_type init)
102 debug("%s: performing dwc2_udc_probe\n", __func__);
103 return dwc2_udc_probe(&bcm_otg_data);
106 int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
108 debug("%s\n", __func__);
109 if (!env_get("serial#"))
110 g_dnl_set_serialnumber(CONFIG_USB_SERIALNO);
114 int g_dnl_get_board_bcd_device_number(int gcnum)
116 debug("%s\n", __func__);
120 int board_usb_cleanup(int index, enum usb_init_type init)
122 debug("%s\n", __func__);