调用request_mem_region()失败 [英] call to request_mem_region() fails

查看:993
本文介绍了调用request_mem_region()失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

起始地址0x4806E000(UART4基地址)已经存在于/ proc / iomem中,名称为omap4-uart。

The start address 0x4806E000 (UART4 base address) is already present in /proc/iomem with the name omap4-uart.

如何禁用已分配的内存区域

How to disable the memory regions already allocated ?.

编辑:
即使request_mem_region成功,启动过程中的控制台显示此消息。

Edit : Even though request_mem_region is successful the console during booting shows this messages.

[    0.758514] Serial: 8250/16550 driver, 3 ports, IRQ sharing enabled
[    0.760040] omap_uart.0: ttyO0 at MMIO 0x4806a000 (irq = 104) is a OMAP UART0
[    0.760498] omap_uart.1: ttyO1 at MMIO 0x4806c000 (irq = 105) is a OMAP UART1
[    0.760955] omap_uart.2: ttyO2 at MMIO 0x48020000 (irq = 106) is a OMAP UART2
[    1.778808] console [ttyO2] enabled
[    1.782989] omap_uart omap_uart.3: [UART3]: failure [serial_omap_probe]: -22
[    1.790466] omap_uart: probe of omap_uart.3 failed with error -22

我认为这表示内核仍在尝试配置uart4实例?
编辑2:在软件复位期间,循环进入无限循环

I think it indicates the kernel is still trying to configure the uart4 instance? Edit 2: During software reset the while loop enters into infinite loop

/* Pad Configuration */
    unsigned int pad_value = 0xFFF8FFF8;
    l = ioread32(pad_map);
    l &= pad_value;
    iowrite32(l,pad_map);
    printk(KERN_ALERT "pad configured\n");


    /* Software reset */

       printk(KERN_ALERT "reset check bit = %x\n",((serial_in(UART_OMAP_SYSC))));
       serial_out(UART_OMAP_SYSC,swreset);
       printk(KERN_ALERT "reset check bit = %x\n",((serial_in(UART_OMAP_SYSC))));
       readval = serial_in(UART_OMAP_SYSS);
       while((readval & 0x01)== 0);
       printk(KERN_ALERT "software reset completed\n");


推荐答案

@Dino,

如何禁用已分配的内存区?

How to disable the memory regions already allocated ?.

解决方案:我认为可以禁用内核(menuconfig)的UART驱动程序,构建内核映像并检查/ proc / iomem,我猜UART4相关的实例将被删除。

Solution: what i think is that you can disable UART driver from kernel (menuconfig), build the kernel image and check /proc/iomem, I guess UART4 related instances will be removed.

注意:如果使用设备树概念,则需要禁用UART4节点@ uart4在设备树中。

Note: If using device tree concept then need to disable UART4 node "@uart4" in device tree.

我想使用不同名称的驱动程序代码。这是可能的吗?

I would like to use it in my driver code with different name. Is it possible?

解决方案:在您的LKM内存范围请求中,使用request_mem_region与您的驱动程序名称。

Solution: In your LKM request for the memory range using request_mem_region with your driver name.

BTW:为什么对ioremap的调用不会失败?

BTW: Why the call to ioremap is not failing ?

解决方案:ioremap api不会失败,因为api没有检查ex:驱动程序名称或其他任何支票。

Solution: ioremap api will not fail because api does not have check for ex:"driver name" or any other checks.

这篇关于调用request_mem_region()失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆