Пример #1
0
/*
 * emi_bwl_mod_init: module init function.
 */
static int __init emi_bwl_mod_init(void)
{
  int ret;    
  
  ret = mtk_mem_bw_ctrl(CON_SCE_NORMAL, ENABLE_CON_SCE);
  if (ret) {
    xlog_printk(ANDROID_LOG_ERROR, "EMI/BWL", "fail to set EMI bandwidth limiter\n");
  }

  /* Register BW ctrl interface */
  ret = platform_driver_register(&mem_bw_ctrl);
  if (ret) {
    xlog_printk(ANDROID_LOG_ERROR, "EMI/BWL", "fail to register EMI_BW_LIMITER driver\n");
  }

  ret = driver_create_file(&mem_bw_ctrl.driver, &driver_attr_concurrency_scenario);
  if (ret) {
    xlog_printk(ANDROID_LOG_ERROR, "EMI/BWL", "fail to create EMI_BW_LIMITER sysfs file\n");
  }

  /* Register DRAM type information interface */
  ret = platform_driver_register(&ddr_type);
  if (ret) {
    xlog_printk(ANDROID_LOG_ERROR, "EMI/BWL", "fail to register DRAM_TYPE driver\n");
  }
  
  ret = driver_create_file(&ddr_type.driver, &driver_attr_ddr_type);
  if (ret) {
    xlog_printk(ANDROID_LOG_ERROR, "EMI/BWL", "fail to create DRAM_TYPE sysfs file\n");
  }
  
  return 0;  
}
Пример #2
0
/*
 * emi_bwl_mod_init: module init function.
 */
static int __init emi_bwl_mod_init(void)
{
    int ret;
    if(get_ddr_type() == 1) //DDR1
    {
        //write overhead value
        writel(0x090B0B10, EMI_CONB);	//read  overhead for 4~1
        writel(0x09090909, EMI_CONC);	//read  overhead for 8~5
        writel(0x0B0E1013, EMI_COND);	//write overhead for 4~1
        writel(0x0909090A, EMI_CONE);   //write overhead for 8~5
    }
    else if(get_ddr_type() == 2) //DDR2
    {
        //write overhead value
        writel(0x0B0B0E17, EMI_CONB);	//read  overhead for 4~1
        writel(0x0B0B0B0B, EMI_CONC);	//read  overhead for 8~5
        writel(0x1012161E, EMI_COND);	//write overhead for 4~1
        writel(0x0B0B0D0E, EMI_CONE);   //write overhead for 8~5
    }
    else if(get_ddr_type() == 3) //DDR3
    {
        writel(0x2B2C2C2E, EMI_CONB);	//read  overhead for 4~1
        writel(0x2627292B, EMI_CONC);	//read  overhead for 8~5
        writel(0x2B2C2C2E, EMI_COND);	//write overhead for 4~1
        writel(0x2627292B, EMI_CONE);       //write overhead for 8~5
    }
    
    //write Filter Priority Encode
#if 0    
    writel(0x00112480, EMI_ARBI);	//distant=0, urgent=1, miss=1, hit=2, limit=4, age=8, ultra=0
#else

#ifdef MTK_DISPLAY_HIGH_RESOLUTION
        writel(0x01812484, EMI_ARBI);  	//degrade ultra-high priority from 8 to 4 when enable MM ultra-high
#else 
        writel(0x01812488, EMI_ARBI);
#endif

#endif

    ret = mtk_mem_bw_ctrl(CON_SCE_NORMAL, ENABLE_CON_SCE);
    if (ret) {
        xlog_printk(ANDROID_LOG_ERROR, "EMI/BWL", "fail to set EMI bandwidth limiter\n");
    }

    ret = platform_driver_register(&mem_bw_ctrl);
    if (ret) {
        xlog_printk(ANDROID_LOG_ERROR, "EMI/BWL", "fail to register EMI_BW_LIMITER driver\n");
    }

    ret = driver_create_file(&mem_bw_ctrl.driver, &driver_attr_concurrency_scenario);
    if (ret) {
        xlog_printk(ANDROID_LOG_ERROR, "EMI/BWL", "fail to create EMI_BW_LIMITER sysfs file\n");
    }

    return 0;
}
Пример #3
0
/*
 * con_sce_store: sysfs con_sce file store function.
 * @driver:
 * @buf:
 * @count:
 * Return the number of write bytes.
 */
static ssize_t con_sce_store(struct device_driver *driver, const char *buf, size_t count)
{
    int i;

    for (i = 0; i < NR_CON_SCE; i++) {
        if (!strncmp(buf, con_sce_str[i], strlen(con_sce_str[i]))) {
            if (!strncmp(buf + strlen(con_sce_str[i]) + 1, EN_CON_SCE_STR, strlen(EN_CON_SCE_STR))) {
                mtk_mem_bw_ctrl(i, ENABLE_CON_SCE);
                printk("concurrency scenario %s ON\n", con_sce_str[i]);
                break;
            } else if (!strncmp(buf + strlen(con_sce_str[i]) + 1, DIS_CON_SCE_STR, strlen(DIS_CON_SCE_STR))) {
                mtk_mem_bw_ctrl(i, DISABLE_CON_SCE);
                printk("concurrency scenario %s OFF\n", con_sce_str[i]);
                break;
            }
        }
    }

    return count;
}