You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
mmc: sdhci-xenon: Add Marvell Xenon SDHC core functionality
Add Xenon eMMC/SD/SDIO host controller core functionality. Add Xenon specific initialization process. Add Xenon specific mmc_host_ops APIs. Add Xenon specific register definitions. Add CONFIG_MMC_SDHCI_XENON support in drivers/mmc/host/Kconfig. Marvell Xenon SDHC conforms to SD Physical Layer Specification Version 3.01 and is designed according to the guidelines provided in the SD Host Controller Standard Specification Version 3.00. Signed-off-by: Hu Ziji <huziji@marvell.com> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
@@ -853,3 +853,11 @@ config MMC_SDHCI_BRCMSTB
|
||||
Broadcom STB SoCs.
|
||||
|
||||
If unsure, say Y.
|
||||
|
||||
config MMC_SDHCI_XENON
|
||||
tristate "Marvell Xenon eMMC/SD/SDIO SDHCI driver"
|
||||
depends on MMC_SDHCI_PLTFM
|
||||
help
|
||||
This selects Marvell Xenon eMMC/SD/SDIO SDHCI.
|
||||
If you have a controller with this interface, say Y or M here.
|
||||
If unsure, say N.
|
||||
|
||||
@@ -86,3 +86,6 @@ obj-$(CONFIG_MMC_SDHCI_BRCMSTB) += sdhci-brcmstb.o
|
||||
ifeq ($(CONFIG_CB710_DEBUG),y)
|
||||
CFLAGS-cb710-mmc += -DDEBUG
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_MMC_SDHCI_XENON) += sdhci-xenon-driver.o
|
||||
sdhci-xenon-driver-y += sdhci-xenon.o
|
||||
|
||||
541
drivers/mmc/host/sdhci-xenon.c
Normal file
541
drivers/mmc/host/sdhci-xenon.c
Normal file
File diff suppressed because it is too large
Load Diff
60
drivers/mmc/host/sdhci-xenon.h
Normal file
60
drivers/mmc/host/sdhci-xenon.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Marvell, All Rights Reserved.
|
||||
*
|
||||
* Author: Hu Ziji <huziji@marvell.com>
|
||||
* Date: 2016-8-24
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation version 2.
|
||||
*/
|
||||
#ifndef SDHCI_XENON_H_
|
||||
#define SDHCI_XENON_H_
|
||||
|
||||
/* Register Offset of Xenon SDHC self-defined register */
|
||||
#define XENON_SYS_CFG_INFO 0x0104
|
||||
#define XENON_SLOT_TYPE_SDIO_SHIFT 24
|
||||
#define XENON_NR_SUPPORTED_SLOT_MASK 0x7
|
||||
|
||||
#define XENON_SYS_OP_CTRL 0x0108
|
||||
#define XENON_AUTO_CLKGATE_DISABLE_MASK BIT(20)
|
||||
#define XENON_SDCLK_IDLEOFF_ENABLE_SHIFT 8
|
||||
#define XENON_SLOT_ENABLE_SHIFT 0
|
||||
|
||||
#define XENON_SYS_EXT_OP_CTRL 0x010C
|
||||
#define XENON_MASK_CMD_CONFLICT_ERR BIT(8)
|
||||
|
||||
#define XENON_SLOT_RETUNING_REQ_CTRL 0x0144
|
||||
/* retuning compatible */
|
||||
#define XENON_RETUNING_COMPATIBLE 0x1
|
||||
|
||||
/* Tuning Parameter */
|
||||
#define XENON_TMR_RETUN_NO_PRESENT 0xF
|
||||
#define XENON_DEF_TUNING_COUNT 0x9
|
||||
|
||||
#define XENON_DEFAULT_SDCLK_FREQ 400000
|
||||
|
||||
/* Xenon specific Mode Select value */
|
||||
#define XENON_CTRL_HS200 0x5
|
||||
#define XENON_CTRL_HS400 0x6
|
||||
|
||||
struct xenon_priv {
|
||||
unsigned char tuning_count;
|
||||
/* idx of SDHC */
|
||||
u8 sdhc_id;
|
||||
|
||||
/*
|
||||
* eMMC/SD/SDIO require different register settings.
|
||||
* Xenon driver has to recognize card type
|
||||
* before mmc_host->card is not available.
|
||||
* This field records the card type during init.
|
||||
* It is updated in xenon_init_card().
|
||||
*
|
||||
* It is only valid during initialization after it is updated.
|
||||
* Do not access this variable in normal transfers after
|
||||
* initialization completes.
|
||||
*/
|
||||
unsigned int init_card_type;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user