Marek Vasut | 06485cf | 2018-04-08 15:22:58 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2018 Marek Vasut <marek.vasut@gmail.com> |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <clk.h> |
| 9 | #include <fdtdec.h> |
| 10 | #include <mmc.h> |
| 11 | #include <dm.h> |
| 12 | #include <linux/compat.h> |
| 13 | #include <linux/dma-direction.h> |
| 14 | #include <linux/io.h> |
| 15 | #include <linux/sizes.h> |
| 16 | #include <power/regulator.h> |
| 17 | #include <asm/unaligned.h> |
| 18 | |
| 19 | #include "matsushita-common.h" |
| 20 | |
| 21 | static const struct dm_mmc_ops renesas_sdhi_ops = { |
| 22 | .send_cmd = matsu_sd_send_cmd, |
| 23 | .set_ios = matsu_sd_set_ios, |
| 24 | .get_cd = matsu_sd_get_cd, |
| 25 | }; |
| 26 | |
| 27 | static const struct udevice_id renesas_sdhi_match[] = { |
| 28 | { .compatible = "renesas,sdhi-r8a7790", .data = 0 }, |
| 29 | { .compatible = "renesas,sdhi-r8a7791", .data = 0 }, |
| 30 | { .compatible = "renesas,sdhi-r8a7792", .data = 0 }, |
| 31 | { .compatible = "renesas,sdhi-r8a7793", .data = 0 }, |
| 32 | { .compatible = "renesas,sdhi-r8a7794", .data = 0 }, |
| 33 | { .compatible = "renesas,sdhi-r8a7795", .data = MATSU_SD_CAP_64BIT }, |
| 34 | { .compatible = "renesas,sdhi-r8a7796", .data = MATSU_SD_CAP_64BIT }, |
| 35 | { .compatible = "renesas,sdhi-r8a77965", .data = MATSU_SD_CAP_64BIT }, |
| 36 | { .compatible = "renesas,sdhi-r8a77970", .data = MATSU_SD_CAP_64BIT }, |
| 37 | { .compatible = "renesas,sdhi-r8a77995", .data = MATSU_SD_CAP_64BIT }, |
| 38 | { /* sentinel */ } |
| 39 | }; |
| 40 | |
| 41 | U_BOOT_DRIVER(renesas_sdhi) = { |
| 42 | .name = "renesas-sdhi", |
| 43 | .id = UCLASS_MMC, |
| 44 | .of_match = renesas_sdhi_match, |
| 45 | .bind = matsu_sd_bind, |
| 46 | .probe = matsu_sd_probe, |
| 47 | .priv_auto_alloc_size = sizeof(struct matsu_sd_priv), |
| 48 | .platdata_auto_alloc_size = sizeof(struct matsu_sd_plat), |
| 49 | .ops = &renesas_sdhi_ops, |
| 50 | }; |