• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ simple_map_init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中simple_map_init函数的典型用法代码示例。如果您正苦于以下问题:C++ simple_map_init函数的具体用法?C++ simple_map_init怎么用?C++ simple_map_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了simple_map_init函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: init_soleng_maps

static int __init init_soleng_maps(void)
{
	int nr_parts = 0;

	/* First probe at offset 0 */
	soleng_flash_map.phys = 0;
	soleng_flash_map.virt = (void __iomem *)P2SEGADDR(0);
	soleng_eprom_map.phys = 0x01000000;
	soleng_eprom_map.virt = (void __iomem *)P1SEGADDR(0x01000000);
	simple_map_init(&soleng_eprom_map);
	simple_map_init(&soleng_flash_map);

	printk(KERN_NOTICE "Probing for flash chips at 0x00000000:\n");
	flash_mtd = do_map_probe("cfi_probe", &soleng_flash_map);
	if (!flash_mtd) {
		/* Not there. Try swapping */
		printk(KERN_NOTICE "Probing for flash chips at 0x01000000:\n");
		soleng_flash_map.phys = 0x01000000;
		soleng_flash_map.virt = P2SEGADDR(0x01000000);
		soleng_eprom_map.phys = 0;
		soleng_eprom_map.virt = P1SEGADDR(0);
		flash_mtd = do_map_probe("cfi_probe", &soleng_flash_map);
		if (!flash_mtd) {
			/* Eep. */
			printk(KERN_NOTICE "Flash chips not detected at either possible location.\n");
			return -ENXIO;
		}
	}
	printk(KERN_NOTICE "Solution Engine: Flash at 0x%08lx, EPROM at 0x%08lx\n",
	       soleng_flash_map.phys & 0x1fffffff,
	       soleng_eprom_map.phys & 0x1fffffff);
	flash_mtd->owner = THIS_MODULE;

	eprom_mtd = do_map_probe("map_rom", &soleng_eprom_map);
	if (eprom_mtd) {
		eprom_mtd->owner = THIS_MODULE;
		add_mtd_device(eprom_mtd);
	}

	nr_parts = parse_mtd_partitions(flash_mtd, probes, &parsed_parts, 0);

#ifdef CONFIG_MTD_SUPERH_RESERVE
	if (nr_parts <= 0) {
		printk(KERN_NOTICE "Using configured partition at 0x%08x.\n",
		       CONFIG_MTD_SUPERH_RESERVE);
		parsed_parts = superh_se_partitions;
		nr_parts = sizeof(superh_se_partitions)/sizeof(*parsed_parts);
	}
#endif /* CONFIG_MTD_SUPERH_RESERVE */

	if (nr_parts > 0)
		add_mtd_partitions(flash_mtd, parsed_parts, nr_parts);
	else
		add_mtd_device(flash_mtd);

	return 0;
}
开发者ID:mahyarmd,项目名称:unifi-gpl,代码行数:57,代码来源:solutionengine.c


示例2: h720x_mtd_init

/*
 * Initialize FLASH support
 */
static int __init h720x_mtd_init(void)
{

	char	*part_type = NULL;

	h720x_map.virt = ioremap(h720x_map.phys, h720x_map.size);

	if (!h720x_map.virt) {
		printk(KERN_ERR "H720x-MTD: ioremap failed\n");
		return -EIO;
	}

	simple_map_init(&h720x_map);

	// Probe for flash bankwidth 4
	printk (KERN_INFO "H720x-MTD probing 32bit FLASH\n");
	mymtd = do_map_probe("cfi_probe", &h720x_map);
	if (!mymtd) {
		printk (KERN_INFO "H720x-MTD probing 16bit FLASH\n");
	    // Probe for bankwidth 2
	    h720x_map.bankwidth = 2;
	    mymtd = do_map_probe("cfi_probe", &h720x_map);
	}

	if (mymtd) {
		mymtd->owner = THIS_MODULE;

<<<<<<< HEAD
		nr_mtd_parts = parse_mtd_partitions(mymtd, probes, &mtd_parts, 0);
		if (nr_mtd_parts > 0)
			part_type = "command line";
=======
开发者ID:Core2idiot,项目名称:Kernel-Samsung-3.0...-,代码行数:35,代码来源:h720x-flash.c


示例3: init_beech_mtd

static int __init
init_beech_mtd(void)
{
	int err;

	printk("%s: 0x%08x at 0x%08x\n", NAME, SIZE, PADDR);

	beech_mtd_map.virt = ioremap(PADDR, SIZE);

	if (!beech_mtd_map.virt) {
		printk("%s: failed to ioremap 0x%x\n", NAME, PADDR);
		return -EIO;
	}

	simple_map_init(&beech_mtd_map);

	printk("%s: probing %d-bit flash bus\n", NAME, BUSWIDTH * 8);
	beech_mtd = do_map_probe("cfi_probe", &beech_mtd_map);

	if (!beech_mtd) {
		iounmap(beech_mtd_map.virt);
		return -ENXIO;
	}

	beech_mtd->owner = THIS_MODULE;

	err = add_mtd_partitions(beech_mtd, beech_partitions, 2);
	if (err) {
		printk("%s: add_mtd_partitions failed\n", NAME);
		iounmap(beech_mtd_map.virt);
	}

	return err;
}
开发者ID:StephenMacras,项目名称:dsl-n55u-bender,代码行数:34,代码来源:beech-mtd.c


示例4: init_dbox2_flash

static int __init init_dbox2_flash(void)
{
;
	dbox2_flash_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE);

	if (!dbox2_flash_map.virt) {
;
		return -EIO;
	}
	simple_map_init(&dbox2_flash_map);

	// Probe for dual Intel 28F320 or dual AMD
	mymtd = do_map_probe("cfi_probe", &dbox2_flash_map);
	if (!mymtd) {
	    // Probe for single Intel 28F640
	    dbox2_flash_map.bankwidth = 2;

	    mymtd = do_map_probe("cfi_probe", &dbox2_flash_map);
	}

	if (mymtd) {
		mymtd->owner = THIS_MODULE;

                /* Create MTD devices for each partition. */
		mtd_device_register(mymtd, partition_info, NUM_PARTITIONS);

		return 0;
	}

	iounmap((void *)dbox2_flash_map.virt);
	return -ENXIO;
}
开发者ID:rrowicki,项目名称:Chrono_Kernel-1,代码行数:32,代码来源:dbox2-flash.c


示例5: init_flagadm

int __init init_flagadm(void)
{	
	printk(KERN_NOTICE "COBRA5272 flash device: %x at %x\n",
			FLASH_SIZE, FLASH_PHYS_ADDR);
	
	flagadm_map.phys = FLASH_PHYS_ADDR;
	flagadm_map.virt = ioremap(FLASH_PHYS_ADDR,
					FLASH_SIZE);

	if (!flagadm_map.virt) {
		printk("Failed to ioremap\n");
		return -EIO;
	}

	simple_map_init(&flagadm_map);

	mymtd = do_map_probe("cfi_probe", &flagadm_map);
	if (mymtd) {
		mymtd->owner = THIS_MODULE;
		add_mtd_partitions(mymtd, flagadm_parts, PARTITION_COUNT);
		printk(KERN_NOTICE "COBRA5272 flash device initialized\n");
		return 0;
	}

	iounmap((void *)flagadm_map.virt);
	return -ENXIO;
}
开发者ID:Voskrese,项目名称:mipsonqemu,代码行数:27,代码来源:cobra5272.c


示例6: init_opb_mtd

static int __init init_opb_mtd(void) {

	map_bank.virt = ioremap(map_bank.phys, map_bank.size);
	if (!map_bank.virt) {
		printk("OPB Flash: failed to ioremap\n");
		return -EIO;
	}

	simple_map_init(&map_bank);
		
	mtd_bank = do_map_probe("cfi_probe", &map_bank);
	if (!mtd_bank) {
		printk("OPB Flash: failed to find a mapping\n");
		iounmap(map_bank.virt);
		map_bank.virt = 0;
		return -ENXIO;
	}

	mtd_bank->owner = THIS_MODULE;

	printk("Registering a %ldMB OPB Flash at 0x%lX\n",
	       map_bank.size >> 20, map_bank.phys);

	add_mtd_device(mtd_bank);

	return 0;
}
开发者ID:kennethlyn,项目名称:enclustra_zynq_linux,代码行数:27,代码来源:xilinx-opb-flash.c


示例7: init_ts5500_map

static int __init init_ts5500_map(void)
{
	int rc = 0;

	ts5500_map.virt = ioremap_nocache(ts5500_map.phys, ts5500_map.size);

	if (!ts5500_map.virt) {
		printk(KERN_ERR "Failed to ioremap_nocache\n");
		rc = -EIO;
		goto err2;
	}

	simple_map_init(&ts5500_map);

	mymtd = do_map_probe("jedec_probe", &ts5500_map);
	if (!mymtd)
		mymtd = do_map_probe("map_rom", &ts5500_map);

	if (!mymtd) {
		rc = -ENXIO;
		goto err1;
	}

	mymtd->owner = THIS_MODULE;
	add_mtd_partitions(mymtd, ts5500_partitions, NUM_PARTITIONS);

	return 0;

err1:
	map_destroy(mymtd);
	iounmap(ts5500_map.virt);
err2:

	return rc;
}
开发者ID:GodFox,项目名称:magx_kernel_xpixl,代码行数:35,代码来源:ts5500_flash.c


示例8: init_netsc520

static int __init init_netsc520(void)
{
	printk(KERN_NOTICE "NetSc520 flash device: 0x%lx at 0x%lx\n", netsc520_map.size, netsc520_map.phys);
	netsc520_map.virt = (unsigned long)ioremap_nocache(netsc520_map.phys, netsc520_map.size);

	if (!netsc520_map.virt) {
		printk("Failed to ioremap_nocache\n");
		return -EIO;
	}

	simple_map_init(&netsc520_map);

	mymtd = do_map_probe("cfi_probe", &netsc520_map);
	if(!mymtd)
		mymtd = do_map_probe("map_ram", &netsc520_map);
	if(!mymtd)
		mymtd = do_map_probe("map_rom", &netsc520_map);

	if (!mymtd) {
		iounmap((void *)netsc520_map.virt);
		return -ENXIO;
	}
		
	mymtd->owner = THIS_MODULE;
	add_mtd_partitions( mymtd, partition_info, NUM_PARTITIONS );
	return 0;
}
开发者ID:SimonKagstrom,项目名称:mci500h-linux-2.4.27,代码行数:27,代码来源:netsc520.c


示例9: flash_init

/**
 * Module/ driver initialization.
 *
 * Returns Zero on success
 */
static int __init flash_init(void)
{
	/*
	 * Read the bootbus region 0 setup to determine the base
	 * address of the flash.
	 */
	union cvmx_mio_boot_reg_cfgx region_cfg;
	region_cfg.u64 = cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(0));
	if (region_cfg.s.en) {
		/*
		 * The bootloader always takes the flash and sets its
		 * address so the entire flash fits below
		 * 0x1fc00000. This way the flash aliases to
		 * 0x1fc00000 for booting. Software can access the
		 * full flash at the true address, while core boot can
		 * access 4MB.
		 */
		/* Use this name so old part lines work */
		flash_map.name = "phys_mapped_flash";
		flash_map.phys = region_cfg.s.base << 16;
		flash_map.size = 0x1fc00000 - flash_map.phys;
		flash_map.bankwidth = 1;
		flash_map.virt = ioremap(flash_map.phys, flash_map.size);
		pr_notice("Bootbus flash: Setting flash for %luMB flash at "
			  "0x%08llx\n", flash_map.size >> 20, flash_map.phys);
		simple_map_init(&flash_map);
		mymtd = do_map_probe("cfi_probe", &flash_map);
		if (mymtd) {
			mymtd->owner = THIS_MODULE;
			mtd_device_parse_register(mymtd, part_probe_types,
						  NULL, NULL, 0);
		} else {
			pr_err("Failed to register MTD device for flash\n");
		}
	}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:40,代码来源:flash_setup.c


示例10: init_rpxlite

static int __init init_rpxlite(void)
{
#ifdef CONFIG_DEBUG_PRINTK
	printk(KERN_NOTICE "RPX Lite or CLLF flash device: %x at %x\n", WINDOW_SIZE*4, WINDOW_ADDR);
#else
	;
#endif
	rpxlite_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE * 4);

	if (!rpxlite_map.virt) {
#ifdef CONFIG_DEBUG_PRINTK
		printk("Failed to ioremap\n");
#else
		;
#endif
		return -EIO;
	}
	simple_map_init(&rpxlite_map);
	mymtd = do_map_probe("cfi_probe", &rpxlite_map);
	if (mymtd) {
		mymtd->owner = THIS_MODULE;
		mtd_device_register(mymtd, NULL, 0);
		return 0;
	}

	iounmap((void *)rpxlite_map.virt);
	return -ENXIO;
}
开发者ID:Epirex,项目名称:Chrono_Kernel-1,代码行数:28,代码来源:rpxlite.c


示例11: init_ts5500_map

static int __init init_ts5500_map(void)
{
	int rc = 0;

	ts5500_map.virt = ioremap_nocache(ts5500_map.phys, ts5500_map.size);

	if (!ts5500_map.virt) {
;
		rc = -EIO;
		goto err2;
	}

	simple_map_init(&ts5500_map);

	mymtd = do_map_probe("jedec_probe", &ts5500_map);
	if (!mymtd)
		mymtd = do_map_probe("map_rom", &ts5500_map);

	if (!mymtd) {
		rc = -ENXIO;
		goto err1;
	}

	mymtd->owner = THIS_MODULE;
	mtd_device_register(mymtd, ts5500_partitions, NUM_PARTITIONS);

	return 0;

err1:
	iounmap(ts5500_map.virt);
err2:
	return rc;
}
开发者ID:rrowicki,项目名称:Chrono_Kernel-1,代码行数:33,代码来源:ts5500_flash.c


示例12: init_dbox2_flash

int __init init_dbox2_flash(void)
{
       	printk(KERN_NOTICE "D-Box 2 flash driver (size->0x%X mem->0x%X)\n", WINDOW_SIZE, WINDOW_ADDR);
	dbox2_flash_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);

	if (!dbox2_flash_map.virt) {
		printk("Failed to ioremap\n");
		return -EIO;
	}
	simple_map_init(&dbox2_flash_map);

	// Probe for dual Intel 28F320 or dual AMD
	mymtd = do_map_probe("cfi_probe", &dbox2_flash_map);
	if (!mymtd) {
	    // Probe for single Intel 28F640
	    dbox2_flash_map.buswidth = 2;
	
	    mymtd = do_map_probe("cfi_probe", &dbox2_flash_map);
	}
	    
	if (mymtd) {
		mymtd->owner = THIS_MODULE;

                /* Create MTD devices for each partition. */
	        add_mtd_partitions(mymtd, partition_info, NUM_PARTITIONS);
		
		return 0;
	}

	iounmap((void *)dbox2_flash_map.virt);
	return -ENXIO;
}
开发者ID:ChakaZulu,项目名称:tuxbox_cdk,代码行数:32,代码来源:dbox2-flash.c


示例13: pb1xxx_mtd_init

int __init pb1xxx_mtd_init(void)
{
	struct mtd_partition *parts;
	int nb_parts = 0;
	char *part_type;
	
	/*
	 * Static partition definition selection
	 */
	part_type = "static";
	parts = pb1xxx_partitions;
	nb_parts = ARRAY_SIZE(pb1xxx_partitions);

	/*
	 * Now let's probe for the actual flash.  Do it here since
	 * specific machine settings might have been set above.
	 */
	printk(KERN_NOTICE "Pb1xxx flash: probing %d-bit flash bus\n", 
			BUSWIDTH*8);
	pb1xxx_mtd_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);

	simple_map_init(&pb1xxx_mtd_map);

	pb1xxx_mtd = do_map_probe("cfi_probe", &pb1xxx_mtd_map);
	if (!pb1xxx_mtd) return -ENXIO;
	pb1xxx_mtd->owner = THIS_MODULE;

	add_mtd_partitions(pb1xxx_mtd, parts, nb_parts);
	return 0;
}
开发者ID:GodFox,项目名称:magx_kernel_xpixl,代码行数:30,代码来源:pb1xxx-flash.c


示例14: h720x_mtd_init

static int __init h720x_mtd_init(void)
{
	h720x_map.virt = ioremap(h720x_map.phys, h720x_map.size);

	if (!h720x_map.virt) {
		printk(KERN_ERR "H720x-MTD: ioremap failed\n");
		return -EIO;
	}

	simple_map_init(&h720x_map);

	//                            
	printk (KERN_INFO "H720x-MTD probing 32bit FLASH\n");
	mymtd = do_map_probe("cfi_probe", &h720x_map);
	if (!mymtd) {
		printk (KERN_INFO "H720x-MTD probing 16bit FLASH\n");
	    //                      
	    h720x_map.bankwidth = 2;
	    mymtd = do_map_probe("cfi_probe", &h720x_map);
	}

	if (mymtd) {
		mymtd->owner = THIS_MODULE;

		mtd_device_parse_register(mymtd, NULL, NULL,
					  h720x_partitions, NUM_PARTITIONS);
		return 0;
	}

	iounmap((void *)h720x_map.virt);
	return -ENXIO;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:32,代码来源:h720x-flash.c


示例15: mtx1_mtd_init

int __init mtx1_mtd_init(void)
{
	int ret = -ENXIO;

	simple_map_init(&mtx1_map);

	mtx1_map.virt = ioremap(mtx1_map.phys, mtx1_map.size);
	if (!mtx1_map.virt)
		return -EIO;

	mtx1_mtd = do_map_probe("cfi_probe", &mtx1_map);
	if (!mtx1_mtd)
		goto err;

	mtx1_mtd->owner = THIS_MODULE;

	ret = add_mtd_partitions(mtx1_mtd, mtx1_partitions,
			ARRAY_SIZE(mtx1_partitions));
	if (ret)
		goto err;

	return 0;

err:
       iounmap(mtx1_map.virt);
       return ret;
}
开发者ID:WiseMan787,项目名称:ralink_sdk,代码行数:27,代码来源:mtx-1_flash.c


示例16: init_str8100_mtd

static int __init init_str8100_mtd(void)
{
	struct mtd_partition *parts;
	int nb_parts = 0;

	str8100_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE);
	if (!str8100_map.virt) {
		printk("Failed to ioremap\n");
		return -EIO;
	}
	simple_map_init(&str8100_map);

	mymtd = do_map_probe("cfi_probe", &str8100_map);
	if (!mymtd) {
		iounmap((void *)str8100_map.virt);
		return -ENXIO;
	}

	mymtd->owner = THIS_MODULE;
	add_mtd_device(mymtd);

#ifdef CONFIG_MTD_PARTITIONS
	parts = str8100_partitions;
	nb_parts = ARRAY_SIZE(str8100_partitions);
	add_mtd_partitions(mymtd, parts, nb_parts);
#endif

	return 0;
}
开发者ID:mmk622,项目名称:ts_7500_kernel,代码行数:29,代码来源:str8100.c


示例17: init_redwood_flash

static int __init init_redwood_flash(void)
{
	int err;

	printk(KERN_NOTICE "redwood: flash mapping: %x at %x\n",
			WINDOW_SIZE, WINDOW_ADDR);

	redwood_flash_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE);

	if (!redwood_flash_map.virt) {
		printk("init_redwood_flash: failed to ioremap\n");
		return -EIO;
	}
	simple_map_init(&redwood_flash_map);

	redwood_mtd = do_map_probe("cfi_probe",&redwood_flash_map);

	if (redwood_mtd) {
		redwood_mtd->owner = THIS_MODULE;
		err = add_mtd_partitions(redwood_mtd,
				redwood_flash_partitions,
				NUM_REDWOOD_FLASH_PARTITIONS);
		if (err) {
			printk("init_redwood_flash: add_mtd_partitions failed\n");
			iounmap(redwood_flash_map.virt);
		}
		return err;

	}

	iounmap(redwood_flash_map.virt);
	return -ENXIO;
}
开发者ID:Medvedroid,项目名称:OT_903D-kernel-2.6.35.7,代码行数:33,代码来源:redwood.c


示例18: omapflash_probe

static int __init omapflash_probe(struct platform_device *pdev)
{
	int err;
	struct omapflash_info *info;
	struct flash_platform_data *pdata = pdev->dev.platform_data;
	struct resource *res = pdev->resource;
	unsigned long size = res->end - res->start + 1;

	info = kzalloc(sizeof(struct omapflash_info), GFP_KERNEL);
	if (!info)
		return -ENOMEM;

	if (!request_mem_region(res->start, size, "flash")) {
		err = -EBUSY;
		goto out_free_info;
	}

	info->map.virt		= ioremap(res->start, size);
	if (!info->map.virt) {
		err = -ENOMEM;
		goto out_release_mem_region;
	}
	info->map.name		= pdev->dev.bus_id;
	info->map.phys		= res->start;
	info->map.size		= size;
	info->map.bankwidth	= pdata->width;
	info->map.set_vpp	= omap_set_vpp;

	simple_map_init(&info->map);
	info->mtd = do_map_probe(pdata->map_name, &info->map);
	if (!info->mtd) {
		err = -EIO;
		goto out_iounmap;
	}
	info->mtd->owner = THIS_MODULE;

#ifdef CONFIG_MTD_PARTITIONS
	err = parse_mtd_partitions(info->mtd, part_probes, &info->parts, 0);
	if (err > 0)
		add_mtd_partitions(info->mtd, info->parts, err);
	else if (err <= 0 && pdata->parts)
		add_mtd_partitions(info->mtd, pdata->parts, pdata->nr_parts);
	else
#endif
		add_mtd_device(info->mtd);

	platform_set_drvdata(pdev, info);

	return 0;

out_iounmap:
	iounmap(info->map.virt);
out_release_mem_region:
	release_mem_region(res->start, size);
out_free_info:
	kfree(info);

	return err;
}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:59,代码来源:omap_nor.c


示例19: dm270_init_flash

static int __init
dm270_init_flash (void)   
{
	struct mtd_partition *parts;
	int nb_parts = 0;
	int parsed_nr_parts = 0;
	const char *part_type;
 
	/*
	 * Static partition definition selection
	 */
	part_type = "static";

 	parts = dm270_partitions;
	nb_parts = ARRAY_SIZE(dm270_partitions);
	dm270_map_flash.virt = phys_to_virt(dm270_map_flash.phys);

	simple_map_init(&dm270_map_flash);
	/*
	 * Now let's probe for the actual flash.  Do it here since
	 * specific machine settings might have been set above.
	 */
	printk(KERN_NOTICE "DM270 flash: probing %d-bit flash bus\n",
		dm270_map_flash.bankwidth*8);
	dm270_flash_mtd = do_map_probe("cfi_probe", &dm270_map_flash);
	if (!dm270_flash_mtd) {
		return -ENXIO;
	}
	dm270_flash_mtd->owner = THIS_MODULE;
 
	/*
	 * Dynamic partition selection stuff (might override the static ones)
	 */
	if (dm270_partition_types[0]) {
		parsed_nr_parts = parse_mtd_partitions(dm270_flash_mtd,
				dm270_partition_types, &parsed_parts,
				CONFIG_FLASH_MEM_BASE);
	}
 	if (parsed_nr_parts > 0) {
		part_type = "dynamic";
		parts = parsed_parts;
		nb_parts = parsed_nr_parts;
	}

	if (nb_parts == 0) {
		printk(KERN_NOTICE "DM270 flash: no partition info available,"
			"registering whole flash at once\n");
		if (add_mtd_device(dm270_flash_mtd)) {
			return -ENXIO;
		}
	} else {
		printk(KERN_NOTICE "Using %s partition definition\n",
			part_type);
		return add_mtd_partitions(dm270_flash_mtd, parts, nb_parts);
	}
	return 0;
}
开发者ID:Voskrese,项目名称:mipsonqemu,代码行数:57,代码来源:dm270-flash.c


示例20: init_sc520cdp

static int __init init_sc520cdp(void)
{
	int i, devices_found = 0;

#ifdef REPROGRAM_PAR
	/* reprogram PAR registers so flash appears at the desired addresses */
	sc520cdp_setup_par();
#endif

	for (i = 0; i < NUM_FLASH_BANKS; i++) {
#ifdef CONFIG_DEBUG_PRINTK
		printk(KERN_NOTICE "SC520 CDP flash device: 0x%Lx at 0x%Lx\n",
			(unsigned long long)sc520cdp_map[i].size,
			(unsigned long long)sc520cdp_map[i].phys);
#else
		;
#endif

		sc520cdp_map[i].virt = ioremap_nocache(sc520cdp_map[i].phys, sc520cdp_map[i].size);

		if (!sc520cdp_map[i].virt) {
#ifdef CONFIG_DEBUG_PRINTK
			printk("Failed to ioremap_nocache\n");
#else
			;
#endif
			return -EIO;
		}

		simple_map_init(&sc520cdp_map[i]);

		mymtd[i] = do_map_probe("cfi_probe", &sc520cdp_map[i]);
		if(!mymtd[i])
			mymtd[i] = do_map_probe("jedec_probe", &sc520cdp_map[i]);
		if(!mymtd[i])
			mymtd[i] = do_map_probe("map_rom", &sc520cdp_map[i]);

		if (mymtd[i]) {
			mymtd[i]->owner = THIS_MODULE;
			++devices_found;
		}
		else {
			iounmap(sc520cdp_map[i].virt);
		}
	}
	if(devices_found >= 2) {
		/* Combine the two flash banks into a single MTD device & register it: */
		merged_mtd = mtd_concat_create(mymtd, 2, "SC520CDP Flash Banks #0 and #1");
		if(merged_mtd)
			mtd_device_register(merged_mtd, NULL, 0);
	}
	if(devices_found == 3) /* register the third (DIL-Flash) device */
		mtd_device_register(mymtd[2], NULL, 0);
	return(devices_found ? 0 : -ENXIO);
}
开发者ID:Epirex,项目名称:Chrono_Kernel-1,代码行数:55,代码来源:sc520cdp.c



注:本文中的simple_map_init函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ simple_mdio_read函数代码示例发布时间:2022-05-30
下一篇:
C++ simple_lock_init函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap