blob: fbae49422c3230f981e168a469b6c41e85f5ff2e [file] [log] [blame]
Sundarajan Srinivasan15516f22013-12-04 17:11:36 -08001/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
Channagoud Kadabi4ed511f2013-03-11 16:10:18 -07002 *
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 Kadabia17fc422013-09-11 12:25:34 -070034#define BOARD_KERNEL_PAGESIZE 2048
Channagoud Kadabi4ed511f2013-03-11 16:10:18 -070035/* Wrapper APIs */
36
37struct mmc_device *get_mmc_device();
38uint32_t mmc_get_psn(void);
39
40uint32_t mmc_read(uint64_t data_addr, uint32_t *out, uint32_t data_len);
41uint32_t mmc_write(uint64_t data_addr, uint32_t data_len, void *in);
42uint32_t mmc_erase_card(uint64_t, uint64_t);
43uint64_t mmc_get_device_capacity(void);
44uint32_t mmc_erase_card(uint64_t addr, uint64_t len);
Channagoud Kadabi96c629e2013-09-10 14:21:30 -070045uint32_t mmc_get_device_blocksize();
Channagoud Kadabia17fc422013-09-11 12:25:34 -070046uint32_t mmc_page_size();
47void mmc_device_sleep();
Sundarajan Srinivasan15516f22013-12-04 17:11:36 -080048void mmc_set_lun(uint8_t lun);
49uint8_t mmc_get_lun(void);
50void mmc_read_partition_table(uint8_t arg);
Channagoud Kadabifaf20f62014-10-21 22:22:37 -070051uint32_t mmc_write_protect(const char *name, int set_clr);
Sridhar Parasuramf2769492015-09-25 18:00:05 -070052int ufs_set_boot_lun(uint32_t boot_lun_id);
53int ufs_get_boot_lun();
Channagoud Kadabi4ed511f2013-03-11 16:10:18 -070054#endif