2 #include <android_recovery.h>
3 #include "../drivers/mmc/card_sdio.h"
4 #include "asm/arch/sci_types.h"
5 #include "normal_mode.h"
9 int get_recovery_message(struct recovery_message *out)
11 block_dev_desc_t *p_block_dev = NULL;
12 disk_partition_t info;
14 p_block_dev = get_dev("mmc", 1);
15 if(NULL == p_block_dev){
18 if (!get_partition_info_by_name(p_block_dev, L"misc", &info)) {
19 if(TRUE != Emmc_Read(PARTITION_USER, info.start, size/EMMC_SECTOR_SIZE, (void *)buf)){
20 debugf("function: %s emcc read error\n", __FUNCTION__);
25 memcpy(out, buf, sizeof(*out));
29 int set_recovery_message(const struct recovery_message *in)
31 block_dev_desc_t *p_block_dev = NULL;
32 disk_partition_t info;
34 p_block_dev = get_dev("mmc", 1);
35 if(NULL == p_block_dev){
38 if (!get_partition_info_by_name(p_block_dev, L"misc", &info)) {
39 memset(buf, 0, sizeof(buf));
40 if(TRUE != Emmc_Read(PARTITION_USER, info.start, size/EMMC_SECTOR_SIZE, (void *)buf)){
41 debugf("function: %s emcc read error\n", __FUNCTION__);
44 memcpy((void *)buf, in, sizeof(*in));
45 if(TRUE != Emmc_Write(PARTITION_USER, info.start, size/EMMC_SECTOR_SIZE, (void *)buf)){
46 debugf("function: %s emcc write error\n", __FUNCTION__);