Separating amba-pl011 device driver from linux kernel
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Separating amba-pl011 device driver from linux kernel
Is it possible to separate amba-pl011 device driver from linux kernel and move the driver to run on a separate standalone system/processor?
How should I do that in a clean way?
Moving it out is possible, but requires nearly the same time than writing the thing from scratch in user space.
Thanks, Mara.
May I know why you say it takes the same time to writing from scratch in user space. Is that the 2nd option I can try out?
Do you have any idea how to move the driver out from kernel? I found the code are referencing each other heavily and I don't know from where I should start with it.
Can you please give me some idea by using amba-pl011 as an example?
First, take all functions that use writew() and readw(). They talk to the hardware. If you're moving the code to userspace, you need something that will allow you to read/write to device memory space. You can make a small driver for that. Then change all the calls to writew/readw to the right calls to that driver. Already that will take much time. Then you need to remove all the other things that do not compile: write your own handling of scatter-gather buffers (sg_* functions), handle interrupts, start and stop the device.
I really do not understand why you want it in userspace. Could you explain?
Thanks a lot, Mara.
Actually I don't plan to move it to user space, but it could be an option for me if my initial idea cannot work out.
I am thinking to move a certain driver, such as uart(amba-pl011) to run on another cpu, separated from the cpu that runs the Linux kernel.
Currently we have the monolithic kernel running on a cpu. I would like to dedicate another cpu to take care of a certain device, but the kernel that runs on the separated cpu is still the master to that device (driver). In order to achieve this, I need to take out the uart driver from kernel and make it a standalone code running on the second cpu. There will be some communication methods applied to the inter-cpu and user still sees the uart device under the Linux system.
I have no idea how should I separate the uart driver to make it an independent code, while still preserve its compatible with Linux kernel.
Thanks for explanation. When you move the driver to other OS (have you looked into the licensing issues?), it will stop beeing compatible with Linux. You'll have to use another interrupt, DMA and memory management subsystems. It may be functionally fine, however, if you have all the functions you need in that other OS.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.