Re: Raspberrypi3: Mini UART driver

2019-12-28 Thread Christian Mauderer
On 28/12/2019 07:12, Niteesh wrote: > > > On Sat, 28 Dec, 2019, 3:51 AM Christian Mauderer, > wrote: > > On 27/12/2019 19:06, Niteesh wrote: > > Is there something else that I could work on? I am interested in > taking > > part  > > GSOC of 2020.

Re: Raspberrypi3: Mini UART driver

2019-12-27 Thread Niteesh
On Sat, 28 Dec, 2019, 3:51 AM Christian Mauderer, wrote: > On 27/12/2019 19:06, Niteesh wrote: > > Is there something else that I could work on? I am interested in taking > > part > > GSOC of 2020. And I want to learn as much as possible. > > Do you search tasks specific to raspberry or general

Re: Raspberrypi3: Mini UART driver

2019-12-27 Thread Christian Mauderer
On 27/12/2019 19:06, Niteesh wrote: > Is there something else that I could work on? I am interested in taking > part  > GSOC of 2020. And I want to learn as much as possible. Do you search tasks specific to raspberry or general ones? Do you search something for GSoC or just to warm up? > > On

Re: Raspberrypi3: Mini UART driver

2019-12-27 Thread Christian Mauderer
On 27/12/2019 12:20, Niteesh wrote: > I have sent the patch. I also sent a documentation update for the > quick-start section > a few months ago. But no one took a look at it. Can you have a look at it? I'll try to have a look at it soon. > >

Re: Raspberrypi3: Mini UART driver

2019-12-27 Thread Niteesh
I have sent the patch. I also sent a documentation update for the quick-start section a few months ago. But no one took a look at it. Can you have a look at it? https://www.mail-archive.com/devel@rtems.org/msg20965.html ___ devel mailing list

Re: Raspberrypi3: Mini UART driver

2019-12-27 Thread Christian Mauderer
On 27/12/2019 11:03, Niteesh wrote: > I tried building it. I basically ran make in previously create rpi2 BSP > folder. > I did get some compile-time error, but I have fixed them. Now I get > an*undefined reference to `arm_pl011_write_polled'* > How to include the arm_pl011.c file? You have to

Re: Raspberrypi3: Mini UART driver

2019-12-27 Thread Christian Mauderer
On 27/12/2019 10:42, Niteesh wrote: > On Fri, Dec 27, 2019 at 2:53 PM Christian Mauderer > wrote: > > Hello Niteesh, > > let me repeat two important questions: > > - How do you plan to test the changes? Simulator is OK for me but > untested is not

Re: Raspberrypi3: Mini UART driver

2019-12-27 Thread Christian Mauderer
On 27/12/2019 09:35, Niteesh wrote: > Does the device's initialization happen in the first_open function for > the new interface? Because the old legacy driver > call's the initialization function directly. Depending on what you do during initialization you can do it there. But you have to clean

Re: Raspberrypi3: Mini UART driver

2019-12-27 Thread Christian Mauderer
On 27/12/2019 09:30, Niteesh wrote: > On Fri, Dec 27, 2019 at 1:59 AM Christian Mauderer > wrote: > > On 25/12/2019 15:32, Niteesh wrote: > > What about the framebuffer it still uses minor and major's? > > I'm not entirely sure but I don't think that it is

Re: Raspberrypi3: Mini UART driver

2019-12-27 Thread Christian Mauderer
Hello Niteesh, let me repeat two important questions: - How do you plan to test the changes? Simulator is OK for me but untested is not OK. - Isn't it possible to just use the driver from bsps/arm/shared/serial/arm-pl011.c and remove the BSP specific completely? On 27/12/2019 06:29, Niteesh

Re: Raspberrypi3: Mini UART driver

2019-12-27 Thread Niteesh
Does the device's initialization happen in the first_open function for the new interface? Because the old legacy driver call's the initialization function directly. On Fri, Dec 27, 2019 at 2:00 PM Niteesh wrote: > On Fri, Dec 27, 2019 at 1:59 AM Christian Mauderer > wrote: > >> On 25/12/2019

Re: Raspberrypi3: Mini UART driver

2019-12-27 Thread Niteesh
On Fri, Dec 27, 2019 at 1:59 AM Christian Mauderer wrote: > On 25/12/2019 15:32, Niteesh wrote: > > What about the framebuffer it still uses minor and major's? > > I'm not entirely sure but I don't think that it is a problem to mix > legacy and new style drivers. I want to create

Re: Raspberrypi3: Mini UART driver

2019-12-26 Thread Niteesh
On Fri, Dec 27, 2019 at 1:58 AM Christian Mauderer wrote: > Hello Niteesh, > > sorry for not answering earlier. During this time of the year you have > to expect some delays on the mailing list due to public holydays and > vacations. That's okay, I understand. > > On 25/12/2019 10:50, Niteesh

Re: Raspberrypi3: Mini UART driver

2019-12-26 Thread Christian Mauderer
On 25/12/2019 15:32, Niteesh wrote: > What about the framebuffer it still uses minor and major's? I'm not entirely sure but I don't think that it is a problem to mix legacy and new style drivers. > > On Wed, Dec 25, 2019 at 3:20 PM Niteesh > wrote: > > Just to

Re: Raspberrypi3: Mini UART driver

2019-12-26 Thread Christian Mauderer
Hello Niteesh, sorry for not answering earlier. During this time of the year you have to expect some delays on the mailing list due to public holydays and vacations. On 25/12/2019 10:50, Niteesh wrote: > Just to make sure I am going in the right track. > I moved the uart register definitions to

Re: Raspberrypi3: Mini UART driver

2019-12-25 Thread Niteesh
What about the framebuffer it still uses minor and major's? On Wed, Dec 25, 2019 at 3:20 PM Niteesh wrote: > Just to make sure I am going in the right track. > I moved the uart register definitions to bsp/usart.h into a struct of > uint32_t called usart0_regs > here is git diff of usart.c after

Re: Raspberrypi3: Mini UART driver

2019-12-25 Thread Niteesh
Just to make sure I am going in the right track. I moved the uart register definitions to bsp/usart.h into a struct of uint32_t called usart0_regs here is git diff of usart.c after changing it to the latest console interface. diff --git a/bsps/arm/raspberrypi/console/usart.c

Re: Raspberrypi3: Mini UART driver

2019-12-24 Thread Joel Sherrill
On Tue, Dec 24, 2019, 12:19 PM Niteesh wrote: > And also the register definitions are in raspberrpi.h file should I move > them to usart.h. > Sounds right if you mean bsp/usart.h I have a doubt we have a register field in device_context > typedef struct { > > rtems_termios_device_context base;

Re: Raspberrypi3: Mini UART driver

2019-12-24 Thread Joel Sherrill
On Tue, Dec 24, 2019, 12:07 PM Niteesh wrote: > How to handle different serial devices? In other BSPs the uart devices are > the same, so > they were able to put it under a single array? But here we have 2 uarts > and a FB? > The PC has a similar mix. The minor device number should get you into

Re: Raspberrypi3: Mini UART driver

2019-12-24 Thread Niteesh
I figured the register part, it is setting itself through the FDT. On Tue, Dec 24, 2019 at 11:49 PM Niteesh wrote: > And also the register definitions are in raspberrpi.h file should I move > them to usart.h. > I have a doubt we have a register field in device_context > typedef struct { > >

Re: Raspberrypi3: Mini UART driver

2019-12-24 Thread Niteesh
And also the register definitions are in raspberrpi.h file should I move them to usart.h. I have a doubt we have a register field in device_context typedef struct { rtems_termios_device_context base; const char *device_name; volatile some_chip_registers *regs; } my_driver_context; How does

Re: Raspberrypi3: Mini UART driver

2019-12-24 Thread Niteesh
How to handle different serial devices? In other BSPs the uart devices are the same, so they were able to put it under a single array? But here we have 2 uarts and a FB? On Tue, Dec 24, 2019 at 8:18 PM Christian Mauderer wrote: > On 24/12/2019 12:06, Niteesh wrote: > > The current raspi

Re: Raspberrypi3: Mini UART driver

2019-12-24 Thread Christian Mauderer
On 24/12/2019 12:06, Niteesh wrote: > The current raspi console section is like this: > The bsp_console_select in console_select.c is responsible for selecting > between uart and the framebuffer. It does so > by setting the Console_port_minor. > The console_config is responsible for output_char

Re: Raspberrypi3: Mini UART driver

2019-12-24 Thread Niteesh
The current raspi console section is like this: The bsp_console_select in console_select.c is responsible for selecting between uart and the framebuffer. It does so by setting the Console_port_minor. The console_config is responsible for output_char function. And other files are driver code. If

Re: Raspberrypi3: Mini UART driver

2019-12-24 Thread Niteesh
Thank you so much, for such a detailed answer. Now things make really good sense to me, going through the code now is just a breeze. But I still have one question for the newer driver interface is console_initialize the function which RTEMS calls while initializing the console? Which means I can't

Re: Raspberrypi3: Mini UART driver

2019-12-23 Thread Christian Mauderer
Hello Niteesh, quite a lot of questions. I'll try to answer them. Note that it has been some time since I had a detailed look at that code so if something I tell seems odd please don't hesitate to question it. Please note that in RTEMS their are more or less two "levels" of support for a serial

Re: Raspberrypi3: Mini UART driver

2019-12-23 Thread Niteesh
And finally, how does printf work? It is a macro? In that case, how does any write to a console work? On Tue, Dec 24, 2019 at 12:18 AM Niteesh wrote: > Is the correct port minor number set during the initialization? What is > the application want's to > access some other port? > > On Tue, Dec

Re: Raspberrypi3: Mini UART driver

2019-12-23 Thread Niteesh
Is the correct port minor number set during the initialization? What is the application want's to access some other port? On Tue, Dec 24, 2019 at 12:16 AM Niteesh wrote: > I would like to clarify my doubts regarding the console driver. I went > through the documentation > for the console driver

Re: Raspberrypi3: Mini UART driver

2019-12-23 Thread Niteesh
I would like to clarify my doubts regarding the console driver. I went through the documentation for the console driver https://docs.rtems.org/branches/master/bsp-howto/console.html#introduction. But it is quite different from how some BSPs initialize. Correct me if I am wrong The console_tbl

Re: Raspberrypi3: Mini UART driver

2019-12-22 Thread Christian Mauderer
On 22/12/2019 19:45, Joel Sherrill wrote: > > > On Sun, Dec 22, 2019, 12:29 PM Niteesh > wrote: > > On Sun, Dec 22, 2019 at 8:44 PM Christian Mauderer > mailto:l...@c-mauderer.de>> wrote: > > Hello Niteesh, > > thanks for doing that work. >

Re: Raspberrypi3: Mini UART driver

2019-12-22 Thread Joel Sherrill
On Sun, Dec 22, 2019, 12:29 PM Niteesh wrote: > On Sun, Dec 22, 2019 at 8:44 PM Christian Mauderer > wrote: > >> Hello Niteesh, >> >> thanks for doing that work. >> >> On 22/12/2019 12:10, Niteesh wrote: >> > The rpi1 and rpi2 use the PL011 UART, whereas, with RPI's equipped with >> >

Re: Raspberrypi3: Mini UART driver

2019-12-22 Thread Niteesh
On Sun, Dec 22, 2019 at 8:44 PM Christian Mauderer wrote: > Hello Niteesh, > > thanks for doing that work. > > On 22/12/2019 12:10, Niteesh wrote: > > The rpi1 and rpi2 use the PL011 UART, whereas, with RPI's equipped with > > wireless/Bluetooth module, the PL011 is connected to the Bluetooth >

Re: Raspberrypi3: Mini UART driver

2019-12-22 Thread Christian Mauderer
Hello Niteesh, thanks for doing that work. On 22/12/2019 12:10, Niteesh wrote: > The rpi1 and rpi2 use the PL011 UART, whereas, with RPI's equipped with > wireless/Bluetooth module, the PL011 is connected to the Bluetooth > module, and the mini UART is used as the primary UART. In my opinion it

Raspberrypi3: Mini UART driver

2019-12-22 Thread Niteesh
The rpi1 and rpi2 use the PL011 UART, whereas, with RPI's equipped with wireless/Bluetooth module, the PL011 is connected to the Bluetooth module, and the mini UART is used as the primary UART. https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf But from the above doc