ioremap

LINUX KERNEL driver hangs/freeze after handling mapped register

隐身守侯 提交于 2020-01-23 18:37:25
问题 I'm completely new developing in LINUX kernel, and I'm having some problems in a new LINUX driver I'm developing. After I map NXP PWM registers using ioremap()/ioremap_nocache() and then I try to write to the register mappend my system hags/freeze. Could you please help me understanding what it is happening? My Driver is this: #include <linux/device.h> #include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/kthread.h> // for threads #include <linux/fs.h>

reserve system memory, ioremap()?

人走茶凉 提交于 2019-12-08 10:56:30
问题 Is it bad to call ioremap() on system DRAM. I would like to reserve a space in system DRAM that will not be used by any other process. Would this be the way to do it? I know that DRAM is not actually IO memory so I wasn't sure if this was considered bad practice. 回答1: Is it bad to call ioremap() on system DRAM. System memory that is managed by the kernel should not also be remapped using ioremap() . These multiple mappings can cause data corruption on some architectures/processors. Refer to

Why shouldn't I use ioremap on system memory for ARMv6+?

我的梦境 提交于 2019-12-07 18:02:01
问题 I need to reserve a large buffer of physically contiguous RAM from the kernel and be able to gaurantee that the buffer will always use a specific, hard-coded physical address. This buffer should remain reserved for the kernel's entire lifetime. I have written a chardev driver as an interface for accessing this buffer in userspace. My platform is an embedded system with ARMv7 architecture running a 2.6 Linux kernel. Chapter 15 of Linux Device Drivers, Third Edition has the following to say on