aleix's blog

16C950 UART 9-bit and custom baud rates support for Linux

21 February 2010 9:06 am (c | linux)

Last friday I found myself patching the Linux kernel sources to be able to add custom baud rates support for 16C950 UART cards. I needed to communicate, via a serial port, with one of the devices built by the hardware guys at work. Unfortunately, a non-standard baud rate and 9-bits were needed.

The Sealevel Ultra COMM+422 PCI card we are using is already provided with a patch that adds 9-bit support. However, I was not able to found how to change the baud rate to a non-standard one.

Following the 9-bit patch approach, I added extra requests to ioctl in order to modify the 16C950 registers needed to achieve custom baud rates. Here is the list of added extra ioctl requests (also the 9-bit ones) with the necessary parameters and updated/accessed 16C950 registers:

Request Parameters 16C950 registers Description
TIOC9BITGET out: integer NMR Get current 9-bit status
TIOC9BITSET NMR Enable 9-bit support
TIOC9BITCLR NMR Disable 9-bit support
TIOCPRESCALERGET out: integer EFR, MCR Get prescaler status
TIOCDIVLATCHGET out: integer LCR, DLL/DLM Get divisor latch register
TIOCDIVLATCHSET in: integer LCR, DLL/DLM Set divisor latch register
TIOCSAMPLINGCLKGET out: integer TCR Get sampling clock
TIOCSAMPLINGCLKSET in: integer TCR Set sampling clock
TIOCPRESCALERCLKGET out: integer CPR Get prescaler clock
TIOCPRESCALERCLKSET in: integer CPR Set prescaler clock

I'm not sure if this is the best way to do it, but it works. So, if you need 9-bit and custom baud rates support, apply one the following patches to the kernel (I have aslo updated the Sealevel patch for older and newer kernels than the one provided):

9-bit 2.6.24 2.6.26 2.6.31 2.6.32
9-bit and baud rate 2.6.24 2.6.26 2.6.31 2.6.32

I am not responsible for any damage that these patches can cause to your hardware. No warranty is provided, so use them at your own risk.

38 responses

  1. Jack William says:

    Nice one for reading.

  2. best resume ever written says:

    Linux work same as the way windows work in our computers and laptops. But mostly people use window because it's easy to install and easy to use.

  3. IP-address says:

    The great solution! Thanks for sharing

  4. lauren ebsary says:

    Probably nonetheless windows on a new machine. However according to custom essay writing service UK even they need to charge a fortune earlier than they even communicate to you after a couple pf months. At which point mac are higher. However linux has loads of loose boards managing any issues you've got with every distribution.

  5. Harvey Mac says:

    This is very useful and something we will take on board with my driveways company

  6. Buy Coursework Assignment Help says:

    This A Good Way To Appreciate The Teacher As They Put Their Efforts To Train Students. UK Dissertation Writers Appreciates The Teachers.

  7. Kanada Vizesi says:

    Kanada Vizesi

  8. Almanya Vizesi says:

    Almanya Vizesi

  9. Write my Essay for me Online says:

    this is a with a terrific degree lighting fixtures up article. I moreover agree with your publish name and you're genuinely well mild up your standpoint. I'm staggeringly exuberant to see this publish. A dedication of thankfulness is all together for share with us. keep it up and proportion the extra most associated publish.

    first-rate paintings!

  10. Essay Service says:

    This a great way to realize The trainer As They put Their Efforts To educate students. united kingdom Dissertation Writers Appreciates the lecturers.

  11. Essay Help Online UK says:

    That is a with a remarkable diploma lighting fixtures up article. I moreover consider your publish name and you are actually nicely slight up your point of view. i'm staggeringly exuberant to peer this post. A willpower of thankfulness is all collectively for proportion with us. preserve it up and proportion the extra most associated publish.

  12. UK Best Essays says:

    That is a with an astounding recognition lighting apparatuses up article. I, in addition, consider your distribute name and you are very slight up your perspective. i'm staggeringly rich to peer this post. A self-control of appreciation is all by and large for extent with us. save it up and extent the additional most related distribute.

  13. corporate car service says:

    I'd ride in one of those taxis....not. Can't wait for the sand to swallow up that shit hole middle east when oil dependence eventually goes away.

  14. Do my Essay Now says:

    The help portrayed beneath is 24x7 and accessible in English. Unless shrouded in the open source innovation bolster scope that takes after, the client should work with our Linux accomplices or programming sellers straightforwardly for situations that are not upheld by Microsoft. For instance: application advancement, investigating custom applications, and custom code. Also, Microsoft Support won't offer help with the plan, design, or organization of uses or arrangements on Azure.

  15. Best Essay Help says:

    Linux charge line. This is the shell – a charge procedure that enables you to control the PC through orders wrote into a content interface. This is the thing that, at one time, frightened individuals off from Linux the most (accepting they needed to take in an apparently antiquated summon line structure to influence Linux to work). This is not true anymore. With present day work area Linux, there is no compelling reason to ever touch the order line.

  16. Essay Help says:

    Linux is very. It's in your telephones, in your autos, in your fridges, your Roku gadgets. It runs the majority of the Internet, the supercomputers making logical leaps forward, and the world\'s stock trades. Be that as it may, before Linux turned into the stage to run work areas, servers, and installed frameworks over the globe, it was (and still is) a standout amongst the most solid, secure, and straightforward working frameworks accessible.

  17. Adam says:

    Thanks for the update. Regards from,

  18. Zend Framework Assignment Help says:

    Hi Buddy, Your Blog' S Design Is Simple And Clean And I Like It. Your Blog Posts About Online Writing Help Are Superb. Please Keep Them Coming. Greets!

  19. Capacitance Electrical Project says:

    Such A Nice Post, Keep Up The Fantastic Work

  20. free robux says:

    Hey friends lets come on and check out this game free roblox with free robux generator. It gives the bestever experience to the gamer as it has a lot of things to discover and many sources and resourses in it.

  21. see page says:

    This is really interesting to read about

  22. go bowling alley says:

    good info. great work.

  23. irfan says:

    nice info. great work.

  24. irfan says:

    nice post. good effort on your part. plz keep posting.

  25. Programming Language Assignment Help Online says:

    Hi buddy, your blog' s design is simple and clean and i like it. Your blog posts about Online Dissertation Help are superb. Please keep them coming. Greets!!

  26. Help With Mechanical Engineering Assignment says:

    I personally like your post, you have shared good article. It will help me in great deal.

  27. C Sharp Project Online Help says:

    Science Channel’s are giving a complete knowledge to its viewers about every thing students write done dissertation on this subjects and show its importance.

  28. Jake4 says:

    Very interesting information here you have.

  29. Marketing Research Paper says:

    If you are in need of marketing research paper assistance then come at Students Assignment Help and get all your queries resolved. Our writers our masters and Ph.D. level expert and work 24x7 for students assistance.

  30. Project on Programming says:

    Good way of telling, good post to take facts regarding my presentation subject matter, which i am going to deliver in my college

  31. Take My Mechanical Homework says:

    John arnold is an academic writer of the Dissertation-Guidance. Who writes quality academic papers for students to help them in accomplishing their goals.

  32. Help With Python Homework says:

    Really i appreciate the effort you made to share the knowledge. This is really a great stuff for sharing. Keep it up . Thanks for sharing.

  33. Do My Online Exam says:

    This Is Really Great Work. Thank You For Sharing Such A Good And Useful Information Here In The Blog For Students.

  34. Semi precious stones says:

    thanks for sharing such a nice information i really appreciate your work in this and looking for more such good posts in the future thank you

  35. PhD dissertation writing services says:

    This is some great information for the students. This article is very helpful for the people who are looking forward to get information on this issue. I am in love with your blog already. Love it.

  36. Assignment Help Online says:

    Students could often find it tough to write their academic tasks. It could lead to them not getting desired grades in the academics. Opting for our Assignment Help Online could be ideal for such students and they can get a complete assignment solution from us.

  37. Do My Online DataBase says:

    Hi Buddy, Your Blog' S Design Is Simple And Clean And I Like It. Your Blog Posts About Online Writing Help Are Superb. Please Keep Them Coming. Greets!

  38. Carla Warner says:

    Literacy is the first key to improve yourself other than you have to read such information that will help to improve your skill just like Is Browser Hijacker a Virus? This is also interesting topic to improve your tech knowledge.

Leave a Reply