I am sorry that I couldn't find this answer in this site or web. I have an ARM SoC(Host) which needs to communicate with the peripheral having ARM Micro controller using UART. Linux runs on top of ARM SoC. Below are my questions.
From host side, If I want to write or read data, I understand that we have to do:- (The below steps are from "Serial Programming Guide for POSIX Operating Systems" : Michael R. Sweet) fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY); fcntl(fd, F_SETFL, FNDELAY); Raw mode other things are there which I understand
Below are the things which I don't understand:- 1.1 Do I also need to Configure the serial port of the host in the user space? Such as Setting baud rate, Character size, Parity checking, Hardware flow control etc or this will be handled by the linux driver. I am not sure where it should be handled, user space or driver space or U-Boot. 1.2 Also, I want to know where the SoC's ARM UART registers related things will be coded, is it in U-Boot or somewhere else? In AVR, we usually directly access the registers.
Now, the ARM controller peripheral is from a vendor. Do we need to write driver for it or the vendor will provide it and we have to integrate it. If yes, please explain it at a very high level that how we should integrate it. Presence of code in U-Boot, Driver space.
One more thing, I understand that the code that we use to drive the peripherals is called driver code and is present in linux kernel space of the host. What is the name of the code for accessing SoCs(Host) UART registers or any other register on SoC? where is it present? U-Boot, Driver space or somewhere else.
I understand that the experts who are answering this question would have gained this knowledge from some documents, reading code and doing things practically. It would be great if I can get pointers to all the three but even if I get the reference documents alone I will be happy.