当前位置: 首页>>代码示例>>C++>>正文


C++ simple_map_init函数代码示例

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


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


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