diff options
author | Marek Vasut <marek.vasut+renesas@gmail.com> | 2018-04-08 16:22:58 +0300 |
---|---|---|
committer | Marek Vasut <marek.vasut+renesas@gmail.com> | 2018-04-12 00:11:56 +0300 |
commit | e94cad93b7f940de0eda446b0cd9a43da7a1e328 (patch) | |
tree | 39a7a3e9fe5d5d00d54c0da45fc59c5b30abc5db /drivers/mmc/renesas-sdhi.c | |
parent | 78bf3f2180cd8d25c27cd6c25c80e2be95d0ccf6 (diff) | |
download | u-boot-e94cad93b7f940de0eda446b0cd9a43da7a1e328.tar.xz |
mmc: uniphier: Split out SoC specific bits from the driver
Factor out common code from the uniphier SD driver, change the prefix
of the functions from uniphier_sd_ to matsu_sd_ and create separate
renesas-sdhi.c driver. Thus far, all the code is still compiled when
CONFIG_UNIPHIER_MMC is selected and there is no functional change.
This patch is a preparation for further split of the SoC specific
parts of the Matsushita SD driver, used both on Uniphier and R-Car.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'drivers/mmc/renesas-sdhi.c')
-rw-r--r-- | drivers/mmc/renesas-sdhi.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/drivers/mmc/renesas-sdhi.c b/drivers/mmc/renesas-sdhi.c new file mode 100644 index 0000000000..9b388b3ab0 --- /dev/null +++ b/drivers/mmc/renesas-sdhi.c @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2018 Marek Vasut <marek.vasut@gmail.com> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <clk.h> +#include <fdtdec.h> +#include <mmc.h> +#include <dm.h> +#include <linux/compat.h> +#include <linux/dma-direction.h> +#include <linux/io.h> +#include <linux/sizes.h> +#include <power/regulator.h> +#include <asm/unaligned.h> + +#include "matsushita-common.h" + +static const struct dm_mmc_ops renesas_sdhi_ops = { + .send_cmd = matsu_sd_send_cmd, + .set_ios = matsu_sd_set_ios, + .get_cd = matsu_sd_get_cd, +}; + +static const struct udevice_id renesas_sdhi_match[] = { + { .compatible = "renesas,sdhi-r8a7790", .data = 0 }, + { .compatible = "renesas,sdhi-r8a7791", .data = 0 }, + { .compatible = "renesas,sdhi-r8a7792", .data = 0 }, + { .compatible = "renesas,sdhi-r8a7793", .data = 0 }, + { .compatible = "renesas,sdhi-r8a7794", .data = 0 }, + { .compatible = "renesas,sdhi-r8a7795", .data = MATSU_SD_CAP_64BIT }, + { .compatible = "renesas,sdhi-r8a7796", .data = MATSU_SD_CAP_64BIT }, + { .compatible = "renesas,sdhi-r8a77965", .data = MATSU_SD_CAP_64BIT }, + { .compatible = "renesas,sdhi-r8a77970", .data = MATSU_SD_CAP_64BIT }, + { .compatible = "renesas,sdhi-r8a77995", .data = MATSU_SD_CAP_64BIT }, + { /* sentinel */ } +}; + +U_BOOT_DRIVER(renesas_sdhi) = { + .name = "renesas-sdhi", + .id = UCLASS_MMC, + .of_match = renesas_sdhi_match, + .bind = matsu_sd_bind, + .probe = matsu_sd_probe, + .priv_auto_alloc_size = sizeof(struct matsu_sd_priv), + .platdata_auto_alloc_size = sizeof(struct matsu_sd_plat), + .ops = &renesas_sdhi_ops, +}; |