mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-16 14:08:45 +00:00
ARM: imx: novena: Convert block devices to DM
Enable DM block, DM MMC and DM SATA support on iMX6Q Novena convert board code to match the DM support. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Vagrant Cascadian <vagrant@debian.org>
This commit is contained in:
parent
c4e93f6aa6
commit
6b98b94ce2
4 changed files with 12 additions and 63 deletions
|
@ -61,6 +61,11 @@
|
|||
reg = <0x10000000 0>;
|
||||
};
|
||||
|
||||
aliases {
|
||||
mmc0 = &usdhc3;
|
||||
mmc1 = &usdhc2;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = &uart2;
|
||||
};
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dm.h>
|
||||
#include <dm/device-internal.h>
|
||||
#include <ahci.h>
|
||||
#include <linux/errno.h>
|
||||
#include <asm/gpio.h>
|
||||
#include <asm/io.h>
|
||||
|
@ -20,6 +23,7 @@
|
|||
#include <asm/mach-imx/mxc_i2c.h>
|
||||
#include <asm/mach-imx/sata.h>
|
||||
#include <asm/mach-imx/video.h>
|
||||
#include <dwc_ahsata.h>
|
||||
#include <environment.h>
|
||||
#include <fsl_esdhc.h>
|
||||
#include <i2c.h>
|
||||
|
@ -101,60 +105,6 @@ int drv_keyboard_init(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* SDHC
|
||||
*/
|
||||
#ifdef CONFIG_FSL_ESDHC
|
||||
static struct fsl_esdhc_cfg usdhc_cfg[] = {
|
||||
{ USDHC3_BASE_ADDR, 0, 4 }, /* Micro SD */
|
||||
{ USDHC2_BASE_ADDR, 0, 4 }, /* Big SD */
|
||||
};
|
||||
|
||||
int board_mmc_getcd(struct mmc *mmc)
|
||||
{
|
||||
struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
|
||||
|
||||
/* There is no CD for a microSD card, assume always present. */
|
||||
if (cfg->esdhc_base == USDHC3_BASE_ADDR)
|
||||
return 1;
|
||||
else
|
||||
return !gpio_get_value(NOVENA_SD_CD);
|
||||
}
|
||||
|
||||
int board_mmc_getwp(struct mmc *mmc)
|
||||
{
|
||||
struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
|
||||
|
||||
/* There is no WP for a microSD card, assume always read-write. */
|
||||
if (cfg->esdhc_base == USDHC3_BASE_ADDR)
|
||||
return 0;
|
||||
else
|
||||
return gpio_get_value(NOVENA_SD_WP);
|
||||
}
|
||||
|
||||
|
||||
int board_mmc_init(bd_t *bis)
|
||||
{
|
||||
s32 status = 0;
|
||||
int index;
|
||||
|
||||
usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
|
||||
usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
|
||||
|
||||
/* Big SD write-protect and card-detect */
|
||||
gpio_direction_input(NOVENA_SD_WP);
|
||||
gpio_direction_input(NOVENA_SD_CD);
|
||||
|
||||
for (index = 0; index < ARRAY_SIZE(usdhc_cfg); index++) {
|
||||
status = fsl_esdhc_initialize(bis, &usdhc_cfg[index]);
|
||||
if (status)
|
||||
return status;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
int board_early_init_f(void)
|
||||
{
|
||||
#if defined(CONFIG_VIDEO_IPUV3)
|
||||
|
@ -169,10 +119,6 @@ int board_init(void)
|
|||
/* address of boot parameters */
|
||||
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
|
||||
|
||||
#ifdef CONFIG_SATA
|
||||
setup_sata();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ CONFIG_SPL=y
|
|||
CONFIG_SPL_FS_FAT=y
|
||||
CONFIG_SPL_LIBDISK_SUPPORT=y
|
||||
CONFIG_CMD_HDMIDETECT=y
|
||||
CONFIG_AHCI=y
|
||||
CONFIG_DISTRO_DEFAULTS=y
|
||||
# CONFIG_SYS_MALLOC_F is not set
|
||||
CONFIG_FIT=y
|
||||
|
@ -48,6 +49,7 @@ CONFIG_ENV_IS_IN_MMC=y
|
|||
CONFIG_DM=y
|
||||
CONFIG_DWC_AHSATA=y
|
||||
CONFIG_DM_GPIO=y
|
||||
CONFIG_DM_MMC=y
|
||||
CONFIG_FSL_ESDHC=y
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PHY_MICREL=y
|
||||
|
@ -56,6 +58,7 @@ CONFIG_MII=y
|
|||
CONFIG_PCI=y
|
||||
CONFIG_PINCTRL=y
|
||||
CONFIG_PINCTRL_IMX6=y
|
||||
CONFIG_DM_SCSI=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_KEYBOARD=y
|
||||
CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
|
||||
|
|
|
@ -102,12 +102,7 @@
|
|||
#define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08
|
||||
|
||||
/* SATA Configs */
|
||||
#ifdef CONFIG_CMD_SATA
|
||||
#define CONFIG_SYS_SATA_MAX_DEVICE 1
|
||||
#define CONFIG_DWC_AHSATA_PORT_ID 0
|
||||
#define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR
|
||||
#define CONFIG_LBA48
|
||||
#endif
|
||||
|
||||
/* UART */
|
||||
#define CONFIG_MXC_UART
|
||||
|
|
Loading…
Add table
Reference in a new issue