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


C++ IOMEM函数代码示例

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


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

示例1: s3c_serial_probe

static int s3c_serial_probe(struct device_d *dev)
{
	struct resource *iores;
	struct s3c_uart *priv;
	struct console_device *cdev;

	priv = xzalloc(sizeof(struct s3c_uart));
	cdev = &priv->cdev;
	iores = dev_request_mem_resource(dev, 0);
	if (IS_ERR(iores))
		return PTR_ERR(iores);
	priv->regs = IOMEM(iores->start);
	dev->priv = priv;
	cdev->dev = dev;
	cdev->tstc = s3c_serial_tstc;
	cdev->putc = s3c_serial_putc;
	cdev->getc = s3c_serial_getc;
	cdev->flush = s3c_serial_flush;
	cdev->setbrg = s3c_serial_setbaudrate;

	s3c_serial_init_port(cdev);

	/* Enable UART */
	console_register(cdev);

	return 0;
}
开发者ID:MinimumLaw,项目名称:ravion-barebox,代码行数:27,代码来源:serial_s3c.c

示例2: mt_devapc_clear_emi_violation

int mt_devapc_clear_emi_violation(void)
{
    if ((readl(IOMEM(DEVAPC0_D0_VIO_STA_3)) & ABORT_EMI) != 0) {
        mt_reg_sync_writel(ABORT_EMI, DEVAPC0_D0_VIO_STA_3);
    }
    return 0;
}
开发者ID:ramgar,项目名称:mt6577-kernel-3.10.65,代码行数:7,代码来源:devapc.c

示例3: ERR_PTR

static struct syscon *of_syscon_register(struct device_node *np)
{
	int ret;
	struct syscon *syscon;
	struct resource res;

	if (!of_device_is_compatible(np, "syscon"))
		return ERR_PTR(-EINVAL);

	syscon = xzalloc(sizeof(*syscon));

	if (of_address_to_resource(np, 0, &res)) {
		ret = -ENOMEM;
		goto err_map;
	}

	syscon->base = IOMEM(res.start);
	syscon->np   = np;

	list_add_tail(&syscon->list, &syscon_list);

	syscon->regmap = regmap_init(NULL,
				     &syscon_regmap_bus,
				     syscon,
				     &syscon_regmap_config);
	return syscon;

err_map:
	kfree(syscon);
	return ERR_PTR(ret);
}
开发者ID:masahir0y,项目名称:barebox-yamada,代码行数:31,代码来源:syscon.c

示例4: get_ddr_type

int get_ddr_type(void)
{
  unsigned int value;
  
  value = DRAMC_READ(DRAMC_LPDDR2);
  if((value>>28) & 0x1) //check LPDDR2_EN
  {
    return LPDDR2;
  }  
  
  value = DRAMC_READ(DRAMC_ACTIM1);
  if((value>>28) & 0x1) //check LPDDR3_EN
  {
       
	value = readl(IOMEM(EMI_CONA));       
	if (value & 0x01)   //support 2 channel
	{
	    return DUAL_LPDDR3_1600;
	}
	else
	{
	    return LPDDR3_1866;
	}	
  }  
  
  return mDDR;  
}
开发者ID:Jlsmily,项目名称:android_kernel_meilan2,代码行数:27,代码来源:emi_bwl.c

示例5: kzm_init

static void __init kzm_init(void)
{
	regulator_register_always_on(2, "fixed-1.8V", fixed1v8_power_consumers,
				     ARRAY_SIZE(fixed1v8_power_consumers), 1800000);
	regulator_register_fixed(3, dummy_supplies, ARRAY_SIZE(dummy_supplies));

	pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map));

	sh73a0_pinmux_init();

	/* SMSC */
	gpio_request_one(224, GPIOF_IN, NULL); /* IRQ3 */

	/* LCDC */
	gpio_request_one(222, GPIOF_OUT_INIT_HIGH, NULL); /* LCDCDON */
	gpio_request_one(226, GPIOF_OUT_INIT_HIGH, NULL); /* SC */

	/* Touchscreen */
	gpio_request_one(223, GPIOF_IN, NULL); /* IRQ8 */

#ifdef CONFIG_CACHE_L2X0
	/* Early BRESP enable, Shared attribute override enable, 64K*8way */
	l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
#endif

	i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices));
	i2c_register_board_info(1, i2c1_devices, ARRAY_SIZE(i2c1_devices));
	i2c_register_board_info(3, i2c3_devices, ARRAY_SIZE(i2c3_devices));

	sh73a0_add_standard_devices();
	platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));

	sh73a0_pm_init();
}
开发者ID:Emerson3074,项目名称:linux,代码行数:34,代码来源:board-kzm9g.c

示例6: hawaii_timer_init

void __init hawaii_timer_init(void)
{
	struct gp_timer_setup gpt_setup;

	/*
	 * IMPORTANT:
	 * If we have to use slave-timer as system timer, two modifications are required
	 * 1) modify the name of timer as, gpt_setup.name = "slave-timer";
	 * 2) By default when the clock manager comes up it disables most of
	 *    the clock. So if we switch to slave-timer we should prevent the
	 *    clock manager from doing this. So, modify plat-kona/include/mach/clock.h
	 *
	 * By default aon-timer as system timer the following is the config
	 * #define BCM2165x_CLK_TIMERS_FLAGS     (TYPE_PERI_CLK | SW_GATE | DISABLE_ON_INIT)
	 * #define BCM2165x_CLK_HUB_TIMER_FLAGS  (TYPE_PERI_CLK | SW_GATE)
	 *
	 * change it as follows to use slave timer as system timer
	 *
	 * #define BCM2165x_CLK_TIMERS_FLAGS     (TYPE_PERI_CLK | SW_GATE)
	 * #define BCM2165x_CLK_HUB_TIMER_FLAGS  (TYPE_PERI_CLK | SW_GATE | DISABLE_ON_INIT)
	 */
	gpt_setup.name = "aon-timer";
	gpt_setup.ch_num = 3;
	gpt_setup.rate = CLOCK_TICK_RATE;

	/* Call the init function of timer module */
	gp_timer_init(&gpt_setup);
	profile_timer_init(IOMEM(KONA_PROFTMR_VA));
}
开发者ID:ASAZING,项目名称:Android-Kernel-Gt-s7390l,代码行数:29,代码来源:hawaii.c

示例7: imx6_mmu_init

static int imx6_mmu_init(void)
{
    void __iomem *l2x0_base = IOMEM(0x00a02000);
    u32 val;

    if (!cpu_is_mx6())
        return 0;

    /* Configure the L2 PREFETCH and POWER registers */
    val = readl(l2x0_base + L310_PREFETCH_CTRL);
    val |= 0x70800000;

    /*
     * The L2 cache controller(PL310) version on the i.MX6D/Q is r3p1-50rel0
     * The L2 cache controller(PL310) version on the i.MX6DL/SOLO/SL is r3p2
     * But according to ARM PL310 errata: 752271
     * ID: 752271: Double linefill feature can cause data corruption
     * Fault Status: Present in: r3p0, r3p1, r3p1-50rel0. Fixed in r3p2
     * Workaround: The only workaround to this erratum is to disable the
     * double linefill feature. This is the default behavior.
     */
    if (cpu_is_mx6q())
        val &= ~(1 << 30 | 1 << 23);

    writel(val, l2x0_base + L310_PREFETCH_CTRL);

    l2x0_init(l2x0_base, 0x0, ~0UL);

    return 0;
}
开发者ID:jcobham,项目名称:barebox,代码行数:30,代码来源:imx6.c

示例8: eva_init

/*
 * board init
 */
static void __init eva_init(void)
{

	r8a7740_clock_init(MD_CK0 | MD_CK2);
	eva_clock_init();

	pinctrl_register_mappings(eva_pinctrl_map, ARRAY_SIZE(eva_pinctrl_map));
	r8a7740_pinmux_init();

	r8a7740_meram_workaround();

	/*
	 * Touchscreen
	 * TODO: Move reset GPIO over to .dts when we can reference it
	 */
	gpio_request_one(166, GPIOF_OUT_INIT_HIGH, NULL); /* TP_RST_B */

#ifdef CONFIG_CACHE_L2X0
	/* Early BRESP enable, Shared attribute override enable, 32K*8way */
	l2x0_init(IOMEM(0xf0002000), 0x40440000, 0x82000fff);
#endif

	r8a7740_add_standard_devices_dt();
	r8a7740_pm_init();
}
开发者ID:1youhun1,项目名称:linux,代码行数:28,代码来源:board-armadillo800eva-reference.c

示例9: glantank_power_off

static void glantank_power_off(void)
{
	__raw_writeb(0x01, IOMEM(0xfe8d0004));

	while (1)
		;
}
开发者ID:03199618,项目名称:linux,代码行数:7,代码来源:glantank.c

示例10: kona_timer_get_counter

static void
kona_timer_get_counter(void *timer_base, uint32_t *msw, uint32_t *lsw)
{
	void __iomem *base = IOMEM(timer_base);
	int loop_limit = 4;

	/*
	 * Read 64-bit free running counter
	 * 1. Read hi-word
	 * 2. Read low-word
	 * 3. Read hi-word again
	 * 4.1
	 *      if new hi-word is not equal to previously read hi-word, then
	 *      start from #1
	 * 4.2
	 *      if new hi-word is equal to previously read hi-word then stop.
	 */

	while (--loop_limit) {
		*msw = readl(base + KONA_GPTIMER_STCHI_OFFSET);
		*lsw = readl(base + KONA_GPTIMER_STCLO_OFFSET);
		if (*msw == readl(base + KONA_GPTIMER_STCHI_OFFSET))
			break;
	}
	if (!loop_limit) {
		pr_err("bcm_kona_timer: getting counter failed.\n");
		pr_err(" Timer will be impacted\n");
	}

	return;
}
开发者ID:212006949,项目名称:linux,代码行数:31,代码来源:bcm_kona_timer.c

示例11: imx7_init

int imx7_init(void)
{
	const char *cputypestr;
	void __iomem *src = IOMEM(MX7_SRC_BASE_ADDR);

	imx7_init_lowlevel();

	imx7_init_csu();

	imx7_boot_save_loc();

	psci_set_ops(&imx7_psci_ops);

	switch (imx7_cpu_type()) {
	case IMX7_CPUTYPE_IMX7D:
		cputypestr = "i.MX7d";
		break;
	case IMX7_CPUTYPE_IMX7S:
		cputypestr = "i.MX7s";
		break;
	default:
		cputypestr = "unknown i.MX7";
		break;
	}

	imx_set_silicon_revision(cputypestr, imx7_cpu_revision());
	imx_set_reset_reason(src + IMX7_SRC_SRSR, imx7_reset_reasons);

	return 0;
}
开发者ID:frantony,项目名称:barebox,代码行数:30,代码来源:imx7.c

示例12: kota2_init

static void __init kota2_init(void)
{
	regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers,
				     ARRAY_SIZE(fixed1v8_power_consumers), 1800000);
	regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers,
				     ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
	regulator_register_fixed(2, dummy_supplies, ARRAY_SIZE(dummy_supplies));

	pinctrl_register_mappings(kota2_pinctrl_map,
				  ARRAY_SIZE(kota2_pinctrl_map));
	sh73a0_pinmux_init();

	/* SMSC911X */
	gpio_request_one(144, GPIOF_IN, NULL); /* PINTA2 */
	gpio_request_one(145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */

	/* MMCIF */
	gpio_request_one(208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */

#ifdef CONFIG_CACHE_L2X0
	/* Early BRESP enable, Shared attribute override enable, 64K*8way */
	l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
#endif
	sh73a0_add_standard_devices();
	platform_add_devices(kota2_devices, ARRAY_SIZE(kota2_devices));
}
开发者ID:0x000000FF,项目名称:Linux4Edison,代码行数:26,代码来源:board-kota2.c

示例13: MET_BM_Enable

void MET_BM_Enable(const unsigned int enable)
{
	const unsigned int value = readl(IOMEM(ADDR_EMI+EMI_BMEN));

	mt_reg_sync_writel((value & ~(BUS_MON_PAUSE | BUS_MON_EN)) |
			   (enable ? BUS_MON_EN : 0), ADDR_EMI+EMI_BMEN);
}
开发者ID:Scorpio92,项目名称:mediatek,代码行数:7,代码来源:mt_emi_bm.c

示例14: board_eth_init

static int board_eth_init(void)
{
	void __iomem *gur = IOMEM(MPC85xx_GUTS_ADDR);
	struct ge_product_data product;
	int st;

	/* Toggle eth0 reset pin */
	gpio_set_value(4, 0);
	udelay(5);
	gpio_set_value(4, 1);

	/* Disable eTSEC3 */
	out_be32(gur + MPC85xx_DEVDISR_OFFSET,
		 in_be32(gur + MPC85xx_DEVDISR_OFFSET) &
		 ~MPC85xx_DEVDISR_TSEC3);

	st = ge_get_product_data(&product);
	if (((product.v2.mac.count > 0) && (product.v2.mac.count <= MAX_MAC))
	    && (st == 0))
		eth_register_ethaddr(0, (const char *)&product.v2.mac.mac[0]);

	fsl_eth_init(1, &gfar_info[0]);

	return 0;
}
开发者ID:cherojeong,项目名称:barebox,代码行数:25,代码来源:da923rc.c

示例15: wakeup_secondary

static void __init wakeup_secondary(void)
{
#if defined(CHIPREG_BOOT_2ND_ADDR_OFFSET)
	void __iomem *chipRegBase;

	chipRegBase = IOMEM(KONA_CHIPREG_VA);

	/* Chip-it FPGA has problems writing to this address hence
	 * workaround */
#ifdef CONFIG_MACH_HAWAII_FPGA
	writel((virt_to_phys(kona_secondary_startup) & (~0x3))|0x1, chipRegBase + 0x1C4);
#else
	writel((virt_to_phys(kona_secondary_startup) & (~0x3))|0x1, chipRegBase + CHIPREG_BOOT_2ND_ADDR_OFFSET);
#endif

	smp_wmb();

	/*
	 * Send a 'sev' to wake the secondary core from WFE.
	 * Drain the outstanding writes to memory
	 */
	dsb_sev();
	
	mb();
#endif
}
开发者ID:ASAZING,项目名称:Android-Kernel-Gt-s7390l,代码行数:26,代码来源:platsmp.c


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