Yann Gautier | 5380b0d | 2018-10-15 09:36:04 +0200 | [diff] [blame] | 1 | /* |
Yann Gautier | c14205d | 2019-05-10 16:01:34 +0200 | [diff] [blame] | 2 | * Copyright (c) 2017-2021, STMicroelectronics - All Rights Reserved |
Yann Gautier | 5380b0d | 2018-10-15 09:36:04 +0200 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef STM32_SDMMC2_H |
| 8 | #define STM32_SDMMC2_H |
| 9 | |
Yann Gautier | 5380b0d | 2018-10-15 09:36:04 +0200 | [diff] [blame] | 10 | #include <stdbool.h> |
| 11 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 12 | #include <drivers/mmc.h> |
Yann Gautier | c14205d | 2019-05-10 16:01:34 +0200 | [diff] [blame] | 13 | #include <drivers/st/regulator.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 14 | |
Yann Gautier | 5380b0d | 2018-10-15 09:36:04 +0200 | [diff] [blame] | 15 | struct 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 Gautier | 3194afe | 2019-05-28 11:54:50 +0200 | [diff] [blame] | 26 | unsigned int max_freq; |
Yann Gautier | 5380b0d | 2018-10-15 09:36:04 +0200 | [diff] [blame] | 27 | bool use_dma; |
Yann Gautier | c14205d | 2019-05-10 16:01:34 +0200 | [diff] [blame] | 28 | struct rdev *vmmc_regu; |
Yann Gautier | 5380b0d | 2018-10-15 09:36:04 +0200 | [diff] [blame] | 29 | }; |
| 30 | |
| 31 | unsigned long long stm32_sdmmc2_mmc_get_device_size(void); |
| 32 | int stm32_sdmmc2_mmc_init(struct stm32_sdmmc2_params *params); |
| 33 | bool plat_sdmmc2_use_dma(unsigned int instance, unsigned int memory); |
| 34 | |
| 35 | #endif /* STM32_SDMMC2_H */ |