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

C++ IOMEM函数代码示例

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

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



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


示例16: imx7_init_csu

static void imx7_init_csu(void)
{
	void __iomem *csu = IOMEM(MX7_CSU_BASE_ADDR);
	int i = 0;

	for (i = 0; i < CSU_NUM_REGS; i++)
		writel(CSU_INIT_SEC_LEVEL0, csu + i * 4);
}
开发者ID:frantony,项目名称:barebox,代码行数:8,代码来源:imx7.c


示例17: get_dram_type

int get_dram_type(void)
{
    unsigned int value = readl(IOMEM(DRAMC_BASE_ADDR + DRAMC_ACTIM1));

    if((value >> 28) & 0x1)
        return LPDDR3_1600;
    else 
        return LPDDR2_1066; 
开发者ID:nxglabs,项目名称:mt6735-kernel-3.10.61,代码行数:8,代码来源:emi_bwl.c


示例18: mt_devapc_emi_initial

int mt_devapc_emi_initial(void)
{
    /*IO remap*/
    
    struct device_node *node = NULL;
    
    xlog_printk(ANDROID_LOG_ERROR, EMIMPU_TAG  ," AO_ADDRESS %x,  \n",DEVAPC0_AO_BASE);
    xlog_printk(ANDROID_LOG_ERROR, EMIMPU_TAG   ," PD_ADDRESS %x \n",DEVAPC0_PD_BASE);
    
    if( DEVAPC0_AO_BASE == 0 || DEVAPC0_PD_BASE == 0 )
    {
        xlog_printk(ANDROID_LOG_ERROR, EMIMPU_TAG   ," DPAC driver  not initial yet \n");

        node = of_find_compatible_node(NULL, NULL, "mediatek,DEVAPC_AO");

        if(node){
           DEVAPC0_AO_BASE = of_iomap(node, 0);
           xlog_printk(ANDROID_LOG_ERROR, EMIMPU_TAG  ," AO_ADDRESS %x \n",DEVAPC0_AO_BASE );
        } else{
             xlog_printk(ANDROID_LOG_ERROR, EMIMPU_TAG   ," can't find DAPC_AO compatible node \n");
             return -1;
        }

        node = of_find_compatible_node(NULL, NULL, "mediatek,DEVAPC");

        if(node){
           DEVAPC0_PD_BASE = of_iomap(node, 0);
           xlog_printk(ANDROID_LOG_ERROR, EMIMPU_TAG   ," PD_ADDRESS %x \n",DEVAPC0_PD_BASE );
        } else{
             xlog_printk(ANDROID_LOG_ERROR, EMIMPU_TAG   ," can't find DAPC_PD compatible node \n");
             return -1;
        }
    }
    

    mt_reg_sync_writel(readl(IOMEM(DEVAPC0_APC_CON)) & (0xFFFFFFFF ^ (1<<2)), DEVAPC0_APC_CON);
    mt_reg_sync_writel(readl(IOMEM(DEVAPC0_PD_APC_CON)) & (0xFFFFFFFF ^ (1<<2)), DEVAPC0_PD_APC_CON);

    mt_reg_sync_writel(ABORT_EMI, DEVAPC0_D0_VIO_STA_4);
    mt_reg_sync_writel(readl(IOMEM(DEVAPC0_D0_VIO_MASK_4)) & (0xFFFFFFFF ^ (ABORT_EMI)), DEVAPC0_D0_VIO_MASK_4);

    xlog_printk(ANDROID_LOG_ERROR, EMIMPU_TAG   ,"EMI_DAPC Init done \n");

    return 0;
}
开发者ID:Scorpio92,项目名称:mediatek,代码行数:45,代码来源:mt_device_apc.c


示例19: mt_devapc_check_emi_violation

/**************************************************************************
*EXTERN FUNCTION
**************************************************************************/
int mt_devapc_check_emi_violation(void)
{
    if ((readl(IOMEM(DEVAPC0_D0_VIO_STA_3)) & ABORT_EMI) == 0) {
        return -1;
    } else {
        pr_err("EMI violation! It should be cleared by EMI MPU driver later!\n");
        return 0;
    }
}
开发者ID:rock12,项目名称:ALPS.L1.MP6.V2.19_CENON6580_WE_1_L_KERNEL,代码行数:12,代码来源:devapc.c


示例20: setup_uart

static inline void setup_uart(void)
{
	void __iomem *iomux = IOMEM(MX7_IOMUXC_BASE_ADDR);
	void __iomem *ccm   = IOMEM(MX7_CCM_BASE_ADDR);

	writel(CCM_CCGR_SETTINGn_NEEDED(0),
	       ccm + CCM_CCGRn_CLR(CCM_CCGR_UART2));
	writel(CCM_TARGET_ROOTn_ENABLE | UART2_CLK_ROOT__OSC_24M,
	       ccm + CCM_TARGET_ROOTn(UART2_CLK_ROOT));
	writel(CCM_CCGR_SETTINGn_NEEDED(0),
	       ccm + CCM_CCGRn_SET(CCM_CCGR_UART2));

	mx7_setup_pad(iomux, MX7D_PAD_UART2_TX_DATA__UART2_DCE_TX);

	imx7_uart_setup_ll();

	putc_ll('>');
}
开发者ID:MinimumLaw,项目名称:ravion-barebox,代码行数:18,代码来源:lowlevel.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ IOMUX_MODE函数代码示例发布时间:2022-05-30
下一篇:
C++ IOLog函数代码示例发布时间: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