分析解決android系統啓動慢的一次經歷

1.系統慢,分爲啓動慢、app運行慢及其它原因。
2.DDR頻率不正常,系統慢,
3.這裏主要分析系統啓動慢
4.直接上修改記錄吧
  這裏爲emmc的研究爲主
  emmc的位數  bus_width
  emmc的傳速速率

    np = host->parent->of_node;

#if 0 
    /* "bus-width" is translated to MMC_CAP_*_BIT_DATA flags */
    if (of_property_read_u32(np, "bus-width", &bus_width) < 0) {
        dev_dbg(host->parent,
            "\"bus-width\" property is missing, assuming 1 bit.\n");
        bus_width = 1;
    }

    switch (bus_width) {
    case 8:
        host->caps |= MMC_CAP_8_BIT_DATA;
        /* Hosts capable of 8-bit transfers can also do 4 bits */
    case 4:
        host->caps |= MMC_CAP_4_BIT_DATA;
        break;
    case 1:
        break;
    default:
        dev_err(host->parent,
            "Invalid \"bus-width\" value %u!\n", bus_width);
        return -EINVAL;
    }
#endif

    bus_width = stt_exparam_data.mSDDataBit;

            /* Hosts capable of 8-bit transfers can also do 4 bits */
        case 1:
            host->caps |= MMC_CAP_4_BIT_DATA;
            break;
        case 0:
            break;
        default:
            dev_err(host->parent,
                "Invalid \"bus-width\" value %u!\n", bus_width);
            return -EINVAL;
        }   
        
    }else   
    {
        /* "bus-width" is translated to MMC_CAP_*_BIT_DATA flags */
            if (of_property_read_u32(np, "bus-width", &bus_width) < 0) {
                        dev_dbg(host->parent,
                                            "\"bus-width\" property is missing, assuming 1 bit.\n");
                                bus_width = 1;
                                    }
                                    
                switch (bus_width) {
                        case 8:
                                host->caps |= MMC_CAP_8_BIT_DATA;
                                /* Hosts capable of 8-bit transfers can also do 4 bits */
                        case 4:
                                host->caps |= MMC_CAP_4_BIT_DATA;
                                break;
                        case 1:
                                break;
                        default:
                                dev_err(host->parent,"Invalid \"bus-width\" value %u!\n", bus_width);
                                return -EINVAL;
                }
    }
 

    /* f_max is obtained from the optional "max-frequency" property */
    of_property_read_u32(np, "max-frequency", &host->f_max);
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章