Sundarajan Srinivasan | 15516f2 | 2013-12-04 17:11:36 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. |
Channagoud Kadabi | 4ed511f | 2013-03-11 16:10:18 -0700 | [diff] [blame] | 2 | * |
| 3 | * Redistribution and use in source and binary forms, with or without |
| 4 | * modification, are permitted provided that the following conditions are |
| 5 | * met: |
| 6 | * * Redistributions of source code must retain the above copyright |
| 7 | * notice, this list of conditions and the following disclaimer. |
| 8 | * * Redistributions in binary form must reproduce the above |
| 9 | * copyright notice, this list of conditions and the following |
| 10 | * disclaimer in the documentation and/or other materials provided |
| 11 | * with the distribution. |
| 12 | * * Neither the name of The Linux Foundation nor the names of its |
| 13 | * contributors may be used to endorse or promote products derived |
| 14 | * from this software without specific prior written permission. |
| 15 | * |
| 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED |
| 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT |
| 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS |
| 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | */ |
| 28 | |
| 29 | #ifndef __MMC_WRAPPER_H__ |
| 30 | #define __MMC_WRAPPER_H__ |
| 31 | |
| 32 | #include <mmc_sdhci.h> |
| 33 | |
Channagoud Kadabi | a17fc42 | 2013-09-11 12:25:34 -0700 | [diff] [blame] | 34 | #define BOARD_KERNEL_PAGESIZE 2048 |
Channagoud Kadabi | 4ed511f | 2013-03-11 16:10:18 -0700 | [diff] [blame] | 35 | /* Wrapper APIs */ |
| 36 | |
| 37 | struct mmc_device *get_mmc_device(); |
| 38 | uint32_t mmc_get_psn(void); |
| 39 | |
| 40 | uint32_t mmc_read(uint64_t data_addr, uint32_t *out, uint32_t data_len); |
| 41 | uint32_t mmc_write(uint64_t data_addr, uint32_t data_len, void *in); |
| 42 | uint32_t mmc_erase_card(uint64_t, uint64_t); |
| 43 | uint64_t mmc_get_device_capacity(void); |
| 44 | uint32_t mmc_erase_card(uint64_t addr, uint64_t len); |
Channagoud Kadabi | 96c629e | 2013-09-10 14:21:30 -0700 | [diff] [blame] | 45 | uint32_t mmc_get_device_blocksize(); |
Channagoud Kadabi | a17fc42 | 2013-09-11 12:25:34 -0700 | [diff] [blame] | 46 | uint32_t mmc_page_size(); |
| 47 | void mmc_device_sleep(); |
Sundarajan Srinivasan | 15516f2 | 2013-12-04 17:11:36 -0800 | [diff] [blame] | 48 | void mmc_set_lun(uint8_t lun); |
| 49 | uint8_t mmc_get_lun(void); |
| 50 | void mmc_read_partition_table(uint8_t arg); |
Channagoud Kadabi | faf20f6 | 2014-10-21 22:22:37 -0700 | [diff] [blame] | 51 | uint32_t mmc_write_protect(const char *name, int set_clr); |
Sridhar Parasuram | f276949 | 2015-09-25 18:00:05 -0700 | [diff] [blame] | 52 | int ufs_set_boot_lun(uint32_t boot_lun_id); |
| 53 | int ufs_get_boot_lun(); |
Channagoud Kadabi | 4ed511f | 2013-03-11 16:10:18 -0700 | [diff] [blame] | 54 | #endif |