mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-05 02:51:00 +00:00
45a68fe267
While I moved the options, I also renamed them so that they are all prefixed with MMC_SDHCI_. This commit was created in the following steps. [1] Rename with the following command find . -name .git -prune -o ! -path ./scripts/config_whitelist.txt \ -type f -print | xargs sed -i -e ' s/CONFIG_MMC_SDMA/CONFIG_MMC_SDHCI_SDMA/g s/CONFIG_BCM2835_SDHCI/CONFIG_MMC_SDHCI_BCM2835/g s/CONFIG_KONA_SDHCI/CONFIG_MMC_SDHCI_KONA/g s/CONFIG_MV_SDHCI/CONFIG_MMC_SDHCI_MV/g s/CONFIG_S5P_SDHCI/CONFIG_MMC_SDHCI_S5P/g s/CONFIG_SPEAR_SDHCI/CONFIG_MMC_SDHCI_SPEAR/g ' [2] create the Kconfig entries in drivers/mmc/Kconfig [3] Move the options by the following command tools/moveconfig.py -y MMC_SDHCI_SDMA MMC_SDHCI_BCM2835 \ MMC_SDHCI_KONA MMC_SDHCI_MV MMC_SDHCI_S5P MMC_SDHCI_SPEAR [4] Sort drivers/mmc/Makefile for readability Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
120 lines
2.3 KiB
C
120 lines
2.3 KiB
C
/*
|
|
* Copyright 2013 Broadcom Corporation.
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <asm/io.h>
|
|
#include <asm/mach-types.h>
|
|
#include <mmc.h>
|
|
#include <asm/kona-common/kona_sdhci.h>
|
|
#include <asm/kona-common/clk.h>
|
|
#include <asm/arch/sysmap.h>
|
|
|
|
#include <usb.h>
|
|
#include <usb/dwc2_udc.h>
|
|
#include <g_dnl.h>
|
|
|
|
#define SECWATCHDOG_SDOGCR_OFFSET 0x00000000
|
|
#define SECWATCHDOG_SDOGCR_EN_SHIFT 27
|
|
#define SECWATCHDOG_SDOGCR_SRSTEN_SHIFT 26
|
|
#define SECWATCHDOG_SDOGCR_CLKS_SHIFT 20
|
|
#define SECWATCHDOG_SDOGCR_LD_SHIFT 0
|
|
|
|
#ifndef CONFIG_USB_SERIALNO
|
|
#define CONFIG_USB_SERIALNO "1234567890"
|
|
#endif
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
/*
|
|
* board_init - early hardware init
|
|
*/
|
|
int board_init(void)
|
|
{
|
|
printf("Relocation Offset is: %08lx\n", gd->reloc_off);
|
|
|
|
/* adress of boot parameters */
|
|
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
|
|
|
|
clk_init();
|
|
|
|
return 0;
|
|
}
|
|
|
|
/*
|
|
* misc_init_r - miscellaneous platform dependent initializations
|
|
*/
|
|
int misc_init_r(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
/*
|
|
* dram_init - sets uboots idea of sdram size
|
|
*/
|
|
int dram_init(void)
|
|
{
|
|
gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
|
|
CONFIG_SYS_SDRAM_SIZE);
|
|
return 0;
|
|
}
|
|
|
|
/* This is called after dram_init() so use get_ram_size result */
|
|
void dram_init_banksize(void)
|
|
{
|
|
gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
|
|
gd->bd->bi_dram[0].size = gd->ram_size;
|
|
}
|
|
|
|
#ifdef CONFIG_MMC_SDHCI_KONA
|
|
/*
|
|
* mmc_init - Initializes mmc
|
|
*/
|
|
int board_mmc_init(bd_t *bis)
|
|
{
|
|
int ret = 0;
|
|
|
|
/* Register eMMC - SDIO2 */
|
|
ret = kona_sdhci_init(1, 400000, 0);
|
|
if (ret)
|
|
return ret;
|
|
|
|
/* Register SD Card - SDIO4 kona_mmc_init assumes 0 based index */
|
|
ret = kona_sdhci_init(3, 400000, 0);
|
|
return ret;
|
|
}
|
|
#endif
|
|
|
|
#ifdef CONFIG_USB_GADGET
|
|
static struct dwc2_plat_otg_data bcm_otg_data = {
|
|
.regs_otg = HSOTG_BASE_ADDR
|
|
};
|
|
|
|
int board_usb_init(int index, enum usb_init_type init)
|
|
{
|
|
debug("%s: performing dwc2_udc_probe\n", __func__);
|
|
return dwc2_udc_probe(&bcm_otg_data);
|
|
}
|
|
|
|
int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
|
|
{
|
|
debug("%s\n", __func__);
|
|
if (!getenv("serial#"))
|
|
g_dnl_set_serialnumber(CONFIG_USB_SERIALNO);
|
|
return 0;
|
|
}
|
|
|
|
int g_dnl_get_board_bcd_device_number(int gcnum)
|
|
{
|
|
debug("%s\n", __func__);
|
|
return 1;
|
|
}
|
|
|
|
int board_usb_cleanup(int index, enum usb_init_type init)
|
|
{
|
|
debug("%s\n", __func__);
|
|
return 0;
|
|
}
|
|
#endif
|