uClinux2.6(bf561)的NorFlash驅動實現分析(5) : 驅動載入

來源:互聯網
上載者:User
 

   norflash驅動模組的初始化代碼為:int __init init_ezkit561_flash(void){     printk(KERN_NOTICE "ezkit561 map: mapping %ld MiB flash at 0x%x/n",            EZKIT561_FLASH_SIZE / 0x100000, EZKIT561_FLASH_BASE); // 將物理地址映射到linux的核心空間,在uClinux中,直接返回EZKIT561_FLASH_BASE的值。     ezkit561_map.virt = ioremap(EZKIT561_FLASH_BASE, EZKIT561_FLASH_SIZE);      if (!ezkit561_map.virt) {         printk("init_ezkit561_flash: failed to ioremap/n");         return -EIO;     }    // 填充read, write, copy_from, copy_to幾個函數指標為預設值。     simple_map_init(&ezkit561_map);      ezkit561_mtd = do_map_probe("cfi_probe", &ezkit561_map);     if (ezkit561_mtd) {         ezkit561_mtd->owner = THIS_MODULE;         return add_mtd_partitions(ezkit561_mtd, ezkit561_parts,                        EZKIT561_PART_COUNT);     }      return -ENXIO;}它其實就是檢測系統中的norflash晶片,如果存在此晶片則將這個晶片上的分區添加到系統的mtdblock列表中。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.