blob: c83f62509aef1d90e9390ced02121db14a7bca97 [file] [log] [blame]
Yann Gautier5380b0d2018-10-15 09:36:04 +02001/*
Yann Gautierc14205d2019-05-10 16:01:34 +02002 * Copyright (c) 2017-2021, STMicroelectronics - All Rights Reserved
Yann Gautier5380b0d2018-10-15 09:36:04 +02003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef STM32_SDMMC2_H
8#define STM32_SDMMC2_H
9
Yann Gautier5380b0d2018-10-15 09:36:04 +020010#include <stdbool.h>
11
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000012#include <drivers/mmc.h>
Yann Gautierc14205d2019-05-10 16:01:34 +020013#include <drivers/st/regulator.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000014
Yann Gautier5380b0d2018-10-15 09:36:04 +020015struct stm32_sdmmc2_params {
16 uintptr_t reg_base;
17 unsigned int clk_rate;
18 unsigned int bus_width;
19 unsigned int flags;
20 struct mmc_device_info *device_info;
21 unsigned int pin_ckin;
22 unsigned int negedge;
23 unsigned int dirpol;
24 unsigned int clock_id;
25 unsigned int reset_id;
Yann Gautier3194afe2019-05-28 11:54:50 +020026 unsigned int max_freq;
Yann Gautier5380b0d2018-10-15 09:36:04 +020027 bool use_dma;
Yann Gautierc14205d2019-05-10 16:01:34 +020028 struct rdev *vmmc_regu;
Yann Gautier5380b0d2018-10-15 09:36:04 +020029};
30
31unsigned long long stm32_sdmmc2_mmc_get_device_size(void);
32int stm32_sdmmc2_mmc_init(struct stm32_sdmmc2_params *params);
33bool plat_sdmmc2_use_dma(unsigned int instance, unsigned int memory);
34
35#endif /* STM32_SDMMC2_H */