Re: How do we know what priority of the Init task is?

2021-02-22 Thread Heinz Junkes
I would have a similar question ;-)

What is the priority of the POSIX_Init - Task (as Posix-Prio)?
Danke Heinz

> On 23. Feb 2021, at 06:43, Richi Dubey  wrote:
> 
> Hi,
> 
> Just confirming, The initial priority is 1, and when converted to 
> _RTEMS_Priority_To_core, it becomes 2 (because of the append indicator added 
> by default map priority). Right?
> 
> On Tue, Nov 17, 2020 at 11:19 PM Richi Dubey  wrote:
> Awesome, thanks! 
> 
> On Tue, Nov 17, 2020 at 9:53 PM Joel Sherrill  wrote:
> 
> 
> On Tue, Nov 17, 2020, 9:50 AM Richi Dubey  wrote:
> Hi,
> 
> Sometimes the priority of the Init task is not mentioned in the source code 
> of the test suites of the headers files included in it (ex. see tm24). Can 
> someone please let me know how we can understand what the priority of the 
> Init task is? Is there a constant value for Init's priority when it's not 
> explicitly mentioned?
> 
> Yes. It defaults to 1. This is defaulted in one of the confdef subfiles now 
> and documented in the configuring a system chapter if the Classic API Guide 
> 
> Thanks,
> Richi.
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel



smime.p7s
Description: S/MIME cryptographic signature
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: How do we know what priority of the Init task is?

2021-02-22 Thread Richi Dubey
Hi,

Just confirming, The initial priority is 1, and when converted
to _RTEMS_Priority_To_core, it becomes 2 (because of the append indicator
added by default map priority). Right?

On Tue, Nov 17, 2020 at 11:19 PM Richi Dubey  wrote:

> Awesome, thanks!
>
> On Tue, Nov 17, 2020 at 9:53 PM Joel Sherrill  wrote:
>
>>
>>
>> On Tue, Nov 17, 2020, 9:50 AM Richi Dubey  wrote:
>>
>>> Hi,
>>>
>>> Sometimes the priority of the Init task is not mentioned in the source
>>> code of the test suites of the headers files included in it (ex. see
>>> tm24 ).
>>> Can someone please let me know how we can understand what the priority of
>>> the Init task is? Is there a constant value for Init's priority when it's
>>> not explicitly mentioned?
>>>
>>
>> Yes. It defaults to 1. This is defaulted in one of the confdef subfiles
>> now and documented in the configuring a system chapter if the Classic API
>> Guide
>>
>>>
>>> Thanks,
>>> Richi.
>>> ___
>>> devel mailing list
>>> devel@rtems.org
>>> http://lists.rtems.org/mailman/listinfo/devel
>>
>>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH v3 0/1] Resubmission of patch previously submitted Sept 2020

2021-02-22 Thread Chris Johns
Hi James,

Thanks for the patch. It is close. Could I ask if all the source files from you
please be updated to the latest template with the 2-clause BSD license? It will
say us having to include them in the sweep when we get to that task. I see a mix
in the files provided.

Thanks
Chris

On 21/2/21 8:29 pm, James Fitzsimons wrote:
> This patch adds driver support for the eQEP (enhanced Quadrature Encoder 
> Pulse)
> module within each of the PWMSS units in the AM335x. The eQEP module is used 
> for
> hardware decoding of rotrary encoders, motor encoders etc.
> 
> Because the PWMSS module includes several components some of the existing 
> code in
> the pwm driver could be reused. To make this common I have added a pwmss.h 
> header
> and moved some of the pwmss specific defines and enum to this file. The 
> pwmss.c
> file contains a refactored (simplified) version of the clock configuration
> method that was previously in the pwm.c file. The pwmss_module_clk_config will
> now be shared by both the pwm and eqep drivers (and eventually the ecap 
> driver if
> that is ever added).
> 
> The approach taken with the qep.h header was to move some of the qep specific
> defines from the am335x.h header to this file. They are specific to the qep
> function and would likely never be referenced by anything other than this 
> driver.
> Doing this keeps these definitions with the driver code and reduces clutter in
> am335x.h header.
> 
> The driver supports two primary modes of operation. A polled mode (which is 
> the
> default mode), and an interrupt event driven mode.
> 
> This patch includes the following revisions after feedback from Chris Johns:
>  - improved documentation
>  - addition of void* user argument to interrupt callback
>  - addition of position value arg to interrupt callback
> 
> James Fitzsimons (1):
>   Adding QEP driver support to BeagleBoneBlack BSP
> 
>  bsps/arm/beagle/headers.am  |   2 +
>  bsps/arm/beagle/include/bsp/bbb-pwm.h   |  11 -
>  bsps/arm/beagle/include/bsp/pwmss.h |  54 +++
>  bsps/arm/beagle/include/bsp/qep.h   | 382 
>  bsps/arm/beagle/pwm/pwm.c   |  60 +---
>  bsps/arm/beagle/pwmss/pwmss.c   |  64 
>  bsps/arm/beagle/qep/qep.c   | 445 
>  c/src/lib/libbsp/arm/beagle/Makefile.am |   6 +
>  spec/build/bsps/arm/beagle/obj.yml  |   5 +-
>  9 files changed, 959 insertions(+), 70 deletions(-)
>  create mode 100644 bsps/arm/beagle/include/bsp/pwmss.h
>  create mode 100644 bsps/arm/beagle/include/bsp/qep.h
>  create mode 100644 bsps/arm/beagle/pwmss/pwmss.c
>  create mode 100644 bsps/arm/beagle/qep/qep.c
> 
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH v3 0/1] Resubmission of patch previously submitted Sept 2020

2021-02-22 Thread James Fitzsimons
Thanks Christian,

That's much appreciated.

Cheers,
James

On Tue, 23 Feb 2021 at 08:01, Christian Mauderer  wrote:

> Hello James,
>
> thanks for the patch and sorry that it get lost on the first submission.
>
> The patch compiles fine and it doesn't seem to change interfaces a lot.
> So I would say it is OK. I'll give it two or three more days of review
> before pushing it.
>
> Please remind me again in a week in case I forget to push it.
>
> Best regards
>
> Christian
>
> On 21/02/2021 10:29, James Fitzsimons wrote:
> > This patch adds driver support for the eQEP (enhanced Quadrature Encoder
> Pulse)
> > module within each of the PWMSS units in the AM335x. The eQEP module is
> used for
> > hardware decoding of rotrary encoders, motor encoders etc.
> >
> > Because the PWMSS module includes several components some of the
> existing code in
> > the pwm driver could be reused. To make this common I have added a
> pwmss.h header
> > and moved some of the pwmss specific defines and enum to this file. The
> pwmss.c
> > file contains a refactored (simplified) version of the clock
> configuration
> > method that was previously in the pwm.c file. The
> pwmss_module_clk_config will
> > now be shared by both the pwm and eqep drivers (and eventually the ecap
> driver if
> > that is ever added).
> >
> > The approach taken with the qep.h header was to move some of the qep
> specific
> > defines from the am335x.h header to this file. They are specific to the
> qep
> > function and would likely never be referenced by anything other than
> this driver.
> > Doing this keeps these definitions with the driver code and reduces
> clutter in
> > am335x.h header.
> >
> > The driver supports two primary modes of operation. A polled mode (which
> is the
> > default mode), and an interrupt event driven mode.
> >
> > This patch includes the following revisions after feedback from Chris
> Johns:
> >   - improved documentation
> >   - addition of void* user argument to interrupt callback
> >   - addition of position value arg to interrupt callback
> >
> > James Fitzsimons (1):
> >Adding QEP driver support to BeagleBoneBlack BSP
> >
> >   bsps/arm/beagle/headers.am  |   2 +
> >   bsps/arm/beagle/include/bsp/bbb-pwm.h   |  11 -
> >   bsps/arm/beagle/include/bsp/pwmss.h |  54 +++
> >   bsps/arm/beagle/include/bsp/qep.h   | 382 
> >   bsps/arm/beagle/pwm/pwm.c   |  60 +---
> >   bsps/arm/beagle/pwmss/pwmss.c   |  64 
> >   bsps/arm/beagle/qep/qep.c   | 445 
> >   c/src/lib/libbsp/arm/beagle/Makefile.am |   6 +
> >   spec/build/bsps/arm/beagle/obj.yml  |   5 +-
> >   9 files changed, 959 insertions(+), 70 deletions(-)
> >   create mode 100644 bsps/arm/beagle/include/bsp/pwmss.h
> >   create mode 100644 bsps/arm/beagle/include/bsp/qep.h
> >   create mode 100644 bsps/arm/beagle/pwmss/pwmss.c
> >   create mode 100644 bsps/arm/beagle/qep/qep.c
> >
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH v3 0/1] Resubmission of patch previously submitted Sept 2020

2021-02-22 Thread Christian Mauderer

Hello James,

thanks for the patch and sorry that it get lost on the first submission.

The patch compiles fine and it doesn't seem to change interfaces a lot. 
So I would say it is OK. I'll give it two or three more days of review 
before pushing it.


Please remind me again in a week in case I forget to push it.

Best regards

Christian

On 21/02/2021 10:29, James Fitzsimons wrote:

This patch adds driver support for the eQEP (enhanced Quadrature Encoder Pulse)
module within each of the PWMSS units in the AM335x. The eQEP module is used for
hardware decoding of rotrary encoders, motor encoders etc.

Because the PWMSS module includes several components some of the existing code 
in
the pwm driver could be reused. To make this common I have added a pwmss.h 
header
and moved some of the pwmss specific defines and enum to this file. The pwmss.c
file contains a refactored (simplified) version of the clock configuration
method that was previously in the pwm.c file. The pwmss_module_clk_config will
now be shared by both the pwm and eqep drivers (and eventually the ecap driver 
if
that is ever added).

The approach taken with the qep.h header was to move some of the qep specific
defines from the am335x.h header to this file. They are specific to the qep
function and would likely never be referenced by anything other than this 
driver.
Doing this keeps these definitions with the driver code and reduces clutter in
am335x.h header.

The driver supports two primary modes of operation. A polled mode (which is the
default mode), and an interrupt event driven mode.

This patch includes the following revisions after feedback from Chris Johns:
  - improved documentation
  - addition of void* user argument to interrupt callback
  - addition of position value arg to interrupt callback

James Fitzsimons (1):
   Adding QEP driver support to BeagleBoneBlack BSP

  bsps/arm/beagle/headers.am  |   2 +
  bsps/arm/beagle/include/bsp/bbb-pwm.h   |  11 -
  bsps/arm/beagle/include/bsp/pwmss.h |  54 +++
  bsps/arm/beagle/include/bsp/qep.h   | 382 
  bsps/arm/beagle/pwm/pwm.c   |  60 +---
  bsps/arm/beagle/pwmss/pwmss.c   |  64 
  bsps/arm/beagle/qep/qep.c   | 445 
  c/src/lib/libbsp/arm/beagle/Makefile.am |   6 +
  spec/build/bsps/arm/beagle/obj.yml  |   5 +-
  9 files changed, 959 insertions(+), 70 deletions(-)
  create mode 100644 bsps/arm/beagle/include/bsp/pwmss.h
  create mode 100644 bsps/arm/beagle/include/bsp/qep.h
  create mode 100644 bsps/arm/beagle/pwmss/pwmss.c
  create mode 100644 bsps/arm/beagle/qep/qep.c


___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH rtems-docs] user/bsps: Mention fixed console baud rate for zynq

2021-02-22 Thread Gedare Bloom
On Mon, Feb 22, 2021 at 6:41 AM  wrote:
>
>
>
> > -Original Message-
> > From: Chris Johns 
> > Sent: Saturday, February 20, 2021 11:57 PM
> > To: Gedare Bloom ; Sommer, Jan
> > 
> > Cc: devel@rtems.org
> > Subject: Re: [PATCH rtems-docs] user/bsps: Mention fixed console baud rate
> > for zynq
> >
> > On 20/2/21 3:59 am, Gedare Bloom wrote:
> > > On Fri, Feb 19, 2021 at 1:21 AM Jan Sommer  wrote:
> > >>
> > >> ---
> > >>  user/bsps/arm/xilinx-zynq.rst | 14 ++
> > >>  1 file changed, 14 insertions(+)
> > >>
> > >> diff --git a/user/bsps/arm/xilinx-zynq.rst
> > >> b/user/bsps/arm/xilinx-zynq.rst index 365c336..dcc0649 100644
> > >> --- a/user/bsps/arm/xilinx-zynq.rst
> > >> +++ b/user/bsps/arm/xilinx-zynq.rst
> > >> @@ -37,6 +37,20 @@ to return the peripheral clock. Normally this is
> > >> half the CPU  clock. This function is declared ``weak`` so you can
> > >> override the  default behaviour by providing it in your application.
> > >>
> > >> +Console
> > >> +---
> > >> +
> > >> +The console driver for the UARTs will always be set to a baud rate
> > >> +of 115200 with 8 bit characters, 1 stop bit and no parity bits
> > >> +during start up.
> > >> +Previous configurations programmed into the hardware by the Xilinx
> > >> +tools or a bootloader will be overwritten.
> > >> +
> > >> +The settings for parity and stop bits can be changes by the user
> > >> +application. The baud rate is hard coded to 115200 and can not be
> > >> +changed.
> > >> +
> > >> +
> > > Only 1 blank line here please. Chris to approve the content, I think
> > > he has the most to say on this topic :)
> >
> > It is OK for master because it is what we have. Joel and I have been
> > discussing the issue of the hardcoded baudrate and the issues it presents. 
> > If
> > we decide something needs to change this documentation can change.
> >
> > The issue is there are 2 UARTs on the zync and if one is used for the 
> > console
> > the fixed rate is fine however if one is used for another purpose not being
> > able to set the baudrate is a bug in RTEMS.
> >
>
> That actually is a use case for us.
> I have taken a closer look at the source and I don't see any reason why the 
> baud rate should hard coded.
> It looks like it is only missing the switch-case for the termios Baud options.
> I will prepare a patch.
>
Can you update this patch to reflect the baud rate selection?

> Best regards,
>
> Jan
>
> > Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 0/1] Enable baud rate selection for zynq uart

2021-02-22 Thread Jan Sommer
v2:
- Use rtems_baud_to_number instead of duplicating baud table

This patch allows to set the baud rate of the zynq-uart using the termios API.
I could change the baud rate successfully on hardware using the termios 
application.

Best regards,

Jan


Jan Sommer (1):
  bsps/shared: Allow setting baud rate for zynq uart

 bsps/shared/dev/serial/zynq-uart.c | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 1/1] bsps/shared: Allow setting baud rate for zynq uart

2021-02-22 Thread Jan Sommer
---
 bsps/shared/dev/serial/zynq-uart.c | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/bsps/shared/dev/serial/zynq-uart.c 
b/bsps/shared/dev/serial/zynq-uart.c
index 8f17d3ca65..dd5a6e1cb8 100644
--- a/bsps/shared/dev/serial/zynq-uart.c
+++ b/bsps/shared/dev/serial/zynq-uart.c
@@ -144,14 +144,22 @@ static bool zynq_uart_set_attributes(
 {
   zynq_uart_context *ctx = (zynq_uart_context *) context;
   volatile zynq_uart *regs = ctx->regs;
+  int32_t baud;
   uint32_t brgr = 0;
   uint32_t bauddiv = 0;
   uint32_t mode = 0;
   int rc;
 
-  rc = zynq_cal_baud_rate(115200, , , regs->mode);
-  if (rc != 0)
-return rc;
+  /* 
+   * Determine the baud rate
+   */
+  baud = rtems_termios_baud_to_number(term->c_ospeed);
+
+  if (baud > 0) {
+rc = zynq_cal_baud_rate(baud, , , regs->mode);
+if (rc != 0)
+  return rc;
+  }
 
   /*
* Configure the mode register
-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


RE: [PATCH v1 1/1] bsps/shared: Allow setting baud rate for zynq uart

2021-02-22 Thread Jan.Sommer


> -Original Message-
> From: Sebastian Huber 
> Sent: Monday, February 22, 2021 4:58 PM
> To: Sommer, Jan ; devel@rtems.org
> Subject: Re: [PATCH v1 1/1] bsps/shared: Allow setting baud rate for zynq
> uart
> 
> 
> On 22/02/2021 16:43, Jan Sommer wrote:
> > +  /*
> > +   * Determine the baud rate
> > +   */
> > +  switch (term->c_ospeed) {
> > +case B0:  baud = 0;  break;
> > +case B50: baud = 50; break
> I am pretty sure we already have a function for this.
> 

Ah, you are right. I looked in other serial drivers and copied the table from 
there, but now found the rtems_termios_baud_to_index function.
I will use this one then.

Thanks.

> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.hu...@embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
> 
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH v1 1/1] bsps/shared: Allow setting baud rate for zynq uart

2021-02-22 Thread Sebastian Huber


On 22/02/2021 16:43, Jan Sommer wrote:

+  /*
+   * Determine the baud rate
+   */
+  switch (term->c_ospeed) {
+case B0:  baud = 0;  break;
+case B50: baud = 50; break

I am pretty sure we already have a function for this.

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH v1 0/1] Enable baud rate selection for zynq uart

2021-02-22 Thread Jan Sommer
This patch allows to set the baud rate of the zynq-uart using the
termios API.
I could change the baud rate successfully on hardware using the termios
application.

Best regards,

Jan

Jan Sommer (1):
  bsps/shared: Allow setting baud rate for zynq uart

 bsps/shared/dev/serial/zynq-uart.c | 42 +++---
 1 file changed, 39 insertions(+), 3 deletions(-)

-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v1 1/1] bsps/shared: Allow setting baud rate for zynq uart

2021-02-22 Thread Jan Sommer
---
 bsps/shared/dev/serial/zynq-uart.c | 42 +++---
 1 file changed, 39 insertions(+), 3 deletions(-)

diff --git a/bsps/shared/dev/serial/zynq-uart.c 
b/bsps/shared/dev/serial/zynq-uart.c
index 8f17d3ca65..124f9e032d 100644
--- a/bsps/shared/dev/serial/zynq-uart.c
+++ b/bsps/shared/dev/serial/zynq-uart.c
@@ -144,14 +144,50 @@ static bool zynq_uart_set_attributes(
 {
   zynq_uart_context *ctx = (zynq_uart_context *) context;
   volatile zynq_uart *regs = ctx->regs;
+  int32_t baud;
   uint32_t brgr = 0;
   uint32_t bauddiv = 0;
   uint32_t mode = 0;
   int rc;
 
-  rc = zynq_cal_baud_rate(115200, , , regs->mode);
-  if (rc != 0)
-return rc;
+  /* 
+   * Determine the baud rate
+   */
+  switch (term->c_ospeed) {
+case B0:  baud = 0;  break;
+case B50: baud = 50; break;
+case B75: baud = 75; break;
+case B110:baud = 110;break;
+case B134:baud = 134;break;
+case B150:baud = 150;break;
+case B200:baud = 200;break;
+case B300:baud = 300;break;
+case B600:baud = 600;break;
+case B1200:   baud = 1200;   break;
+case B1800:   baud = 1800;   break;
+case B2400:   baud = 2400;   break;
+case B4800:   baud = 4800;   break;
+case B9600:   baud = 9600;   break;
+case B19200:  baud = 19200;  break;
+case B38400:  baud = 38400;  break;
+case B57600:  baud = 57600;  break;
+case B115200: baud = 115200; break;
+case B230400: baud = 230400; break;
+case B460800: baud = 460800; break;
+case B921600: baud = 921600; break;
+default: baud = -1; break;
+  }
+
+  if (baud < 0) {
+   errno = EINVAL;
+   return -1;
+  }
+
+  if (baud > 0) {
+rc = zynq_cal_baud_rate(baud, , , regs->mode);
+if (rc != 0)
+  return rc;
+  }
 
   /*
* Configure the mode register
-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


RE: [PATCH rtems-docs] user/bsps: Mention fixed console baud rate for zynq

2021-02-22 Thread Jan.Sommer



> -Original Message-
> From: Chris Johns 
> Sent: Saturday, February 20, 2021 11:57 PM
> To: Gedare Bloom ; Sommer, Jan
> 
> Cc: devel@rtems.org
> Subject: Re: [PATCH rtems-docs] user/bsps: Mention fixed console baud rate
> for zynq
> 
> On 20/2/21 3:59 am, Gedare Bloom wrote:
> > On Fri, Feb 19, 2021 at 1:21 AM Jan Sommer  wrote:
> >>
> >> ---
> >>  user/bsps/arm/xilinx-zynq.rst | 14 ++
> >>  1 file changed, 14 insertions(+)
> >>
> >> diff --git a/user/bsps/arm/xilinx-zynq.rst
> >> b/user/bsps/arm/xilinx-zynq.rst index 365c336..dcc0649 100644
> >> --- a/user/bsps/arm/xilinx-zynq.rst
> >> +++ b/user/bsps/arm/xilinx-zynq.rst
> >> @@ -37,6 +37,20 @@ to return the peripheral clock. Normally this is
> >> half the CPU  clock. This function is declared ``weak`` so you can
> >> override the  default behaviour by providing it in your application.
> >>
> >> +Console
> >> +---
> >> +
> >> +The console driver for the UARTs will always be set to a baud rate
> >> +of 115200 with 8 bit characters, 1 stop bit and no parity bits
> >> +during start up.
> >> +Previous configurations programmed into the hardware by the Xilinx
> >> +tools or a bootloader will be overwritten.
> >> +
> >> +The settings for parity and stop bits can be changes by the user
> >> +application. The baud rate is hard coded to 115200 and can not be
> >> +changed.
> >> +
> >> +
> > Only 1 blank line here please. Chris to approve the content, I think
> > he has the most to say on this topic :)
> 
> It is OK for master because it is what we have. Joel and I have been
> discussing the issue of the hardcoded baudrate and the issues it presents. If
> we decide something needs to change this documentation can change.
> 
> The issue is there are 2 UARTs on the zync and if one is used for the console
> the fixed rate is fine however if one is used for another purpose not being
> able to set the baudrate is a bug in RTEMS.
> 

That actually is a use case for us.
I have taken a closer look at the source and I don't see any reason why the 
baud rate should hard coded.
It looks like it is only missing the switch-case for the termios Baud options.
I will prepare a patch.

Best regards,

Jan

> Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 2/2] ehci_pci: Add to build system

2021-02-22 Thread Moyano, Gabriel
---
 libbsd.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libbsd.py b/libbsd.py
index 8bcb779d..28617d21 100644
--- a/libbsd.py
+++ b/libbsd.py
@@ -795,6 +795,7 @@ class dev_usb(builder.Module):
 'sys/dev/usb/usb_ioctl.h',
 'sys/dev/usb/usb_mbuf.h',
 'sys/dev/usb/usb_msctest.h',
+'sys/dev/usb/usb_pci.h',
 'sys/dev/usb/usb_pf.h',
 'sys/dev/usb/usb_process.h',
 'sys/dev/usb/usb_request.h',
@@ -857,6 +858,7 @@ class dev_usb_controller(builder.Module):
 [
 'sys/dev/usb/controller/ohci.c',
 'sys/dev/usb/controller/ehci.c',
+'sys/dev/usb/controller/ehci_pci.c',
 'sys/dev/usb/controller/usb_controller.c',
 'sys/dev/usb/controller/dwc_otg.c',
 'sys/dev/usb/controller/dwc_otg_fdt.c',
-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 0/2] Import ehci_pci into 6-freebsd-12 branch

2021-02-22 Thread Moyano, Gabriel
Import ehci_pci from freebsd-org in 6-freebsd-12.
Solve https://devel.rtems.org/ticket/4264

Moyano, Gabriel (2):
  ehci_pci: Import from freebsd-org
  ehci_pci: Add to build system

 freebsd/sys/dev/usb/controller/ehci_pci.c | 592 ++
 freebsd/sys/dev/usb/usb_pci.h |  43 ++
 libbsd.py |   2 +
 3 files changed, 637 insertions(+)
 create mode 100644 freebsd/sys/dev/usb/controller/ehci_pci.c
 create mode 100644 freebsd/sys/dev/usb/usb_pci.h

-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 1/2] ehci_pci: Import from freebsd-org

2021-02-22 Thread Moyano, Gabriel
---
 freebsd/sys/dev/usb/controller/ehci_pci.c | 592 ++
 freebsd/sys/dev/usb/usb_pci.h |  43 ++
 2 files changed, 635 insertions(+)
 create mode 100644 freebsd/sys/dev/usb/controller/ehci_pci.c
 create mode 100644 freebsd/sys/dev/usb/usb_pci.h

diff --git a/freebsd/sys/dev/usb/controller/ehci_pci.c 
b/freebsd/sys/dev/usb/controller/ehci_pci.c
new file mode 100644
index ..d1320278
--- /dev/null
+++ b/freebsd/sys/dev/usb/controller/ehci_pci.c
@@ -0,0 +1,592 @@
+#include 
+
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-NetBSD
+ *
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Lennart Augustsson (augus...@carlstedt.se) at
+ * Carlstedt Research & Technology.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+/*
+ * USB Enhanced Host Controller Driver, a.k.a. USB 2.0 controller.
+ *
+ * The EHCI 1.0 spec can be found at
+ * http://developer.intel.com/technology/usb/download/ehci-r10.pdf
+ * and the USB 2.0 spec at
+ * http://www.usb.org/developers/docs/usb_20.zip
+ */
+
+/* The low level controller code for EHCI has been split into
+ * PCI probes and EHCI specific code. This was done to facilitate the
+ * sharing of code between *BSD's
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#definePCI_EHCI_VENDORID_ACERLABS  0x10b9
+#definePCI_EHCI_VENDORID_AMD   0x1022
+#definePCI_EHCI_VENDORID_APPLE 0x106b
+#definePCI_EHCI_VENDORID_ATI   0x1002
+#definePCI_EHCI_VENDORID_CMDTECH   0x1095
+#definePCI_EHCI_VENDORID_INTEL 0x8086
+#definePCI_EHCI_VENDORID_NEC   0x1033
+#definePCI_EHCI_VENDORID_OPTI  0x1045
+#definePCI_EHCI_VENDORID_PHILIPS   0x1131
+#definePCI_EHCI_VENDORID_SIS   0x1039
+#definePCI_EHCI_VENDORID_NVIDIA0x12D2
+#definePCI_EHCI_VENDORID_NVIDIA2   0x10DE
+#definePCI_EHCI_VENDORID_VIA   0x1106
+
+static device_probe_t ehci_pci_probe;
+static device_attach_t ehci_pci_attach;
+static device_detach_t ehci_pci_detach;
+static usb_take_controller_t ehci_pci_take_controller;
+
+static const char *
+ehci_pci_match(device_t self)
+{
+   uint32_t device_id = pci_get_devid(self);
+
+   switch (device_id) {
+   case 0x523910b9:
+   return "ALi M5239 USB 2.0 controller";
+
+   case 0x10227463:
+   return "AMD 8111 USB 2.0 controller";
+
+   case 0x20951022:
+   return ("AMD CS5536 (Geode) USB 2.0 controller");
+   case 0x78081022:
+   return ("AMD FCH USB 2.0 controller");
+
+   case 0x43451002:
+   return "ATI SB200 USB 2.0 controller";
+   case 0x43731002:
+   return "ATI SB400 USB 2.0 controller";
+   case 0x43961002:
+   return ("AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller");
+
+   case 0x0f348086:
+   return ("Intel BayTrail USB 2.0 controller");
+   case 0x1c268086:
+   return ("Intel Cougar Point USB 2.0 controller");
+   case 0x1c2d8086:
+   return ("Intel Cougar Point USB 2.0 controller");
+   case 0x1d268086:
+   return ("Intel Patsburg USB 2.0 controller");
+   case 0x1d2d8086:
+   

AW: [PATCH 0/2] Import ehci_pci

2021-02-22 Thread Gabriel.Moyano
Sorry, I have forgotten to mention that this patch is for the master

-Ursprüngliche Nachricht-
Von: Moyano Heredia, Victor Gabriel 
Gesendet: Montag, 22. Februar 2021 11:53
An: devel@rtems.org
Cc: Moyano Heredia, Victor Gabriel 
Betreff: [PATCH 0/2] Import ehci_pci

Import ehci_pci from freebsd-org using freebsd-to-rtems.py

Moyano, Gabriel (2):
  ehci_pci: Import from freebsd-org
  ehci_pci: Add to build system

 freebsd/sys/dev/usb/controller/ehci_pci.c | 593 ++
 freebsd/sys/dev/usb/usb_pci.h |  43 ++
 libbsd.py |   2 +
 3 files changed, 638 insertions(+)
 create mode 100644 freebsd/sys/dev/usb/controller/ehci_pci.c
 create mode 100644 freebsd/sys/dev/usb/usb_pci.h

-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


AW: [PATCH 0/2] ehci_pci - ticket #4263

2021-02-22 Thread Gabriel.Moyano
Sorry, I have forgotten to mention that this patch is for 5-freebsd-12

-Ursprüngliche Nachricht-
Von: Moyano Heredia, Victor Gabriel 
Gesendet: Montag, 22. Februar 2021 11:49
An: devel@rtems.org
Cc: Moyano Heredia, Victor Gabriel 
Betreff: [PATCH 0/2] ehci_pci - ticket #4263

Import ehci_pci from freebsd-org.
Solve https://devel.rtems.org/ticket/4263

Moyano, Gabriel (2):
  ehci_pci: Import from freebsd-org
  ehci_pci: Add to build system

 freebsd/sys/dev/usb/controller/ehci_pci.c | 592 ++
 freebsd/sys/dev/usb/usb_pci.h |  43 ++
 libbsd.py |   2 +
 3 files changed, 637 insertions(+)
 create mode 100644 freebsd/sys/dev/usb/controller/ehci_pci.c
 create mode 100644 freebsd/sys/dev/usb/usb_pci.h

-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 2/2] ehci_pci: Add to build system

2021-02-22 Thread Moyano, Gabriel
---
 libbsd.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libbsd.py b/libbsd.py
index bfe135f0..c745a877 100644
--- a/libbsd.py
+++ b/libbsd.py
@@ -925,6 +925,7 @@ class dev_usb(builder.Module):
 'sys/dev/usb/usb_ioctl.h',
 'sys/dev/usb/usb_mbuf.h',
 'sys/dev/usb/usb_msctest.h',
+'sys/dev/usb/usb_pci.h',
 'sys/dev/usb/usb_pf.h',
 'sys/dev/usb/usb_process.h',
 'sys/dev/usb/usb_request.h',
@@ -987,6 +988,7 @@ class dev_usb_controller(builder.Module):
 [
 'sys/dev/usb/controller/ohci.c',
 'sys/dev/usb/controller/ehci.c',
+'sys/dev/usb/controller/ehci_pci.c',
 'sys/dev/usb/controller/usb_controller.c',
 'sys/dev/usb/controller/dwc_otg.c',
 'sys/dev/usb/controller/dwc_otg_fdt.c',
-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 1/2] ehci_pci: Import from freebsd-org

2021-02-22 Thread Moyano, Gabriel
---
 freebsd/sys/dev/usb/controller/ehci_pci.c | 593 ++
 freebsd/sys/dev/usb/usb_pci.h |  43 ++
 2 files changed, 636 insertions(+)
 create mode 100644 freebsd/sys/dev/usb/controller/ehci_pci.c
 create mode 100644 freebsd/sys/dev/usb/usb_pci.h

diff --git a/freebsd/sys/dev/usb/controller/ehci_pci.c 
b/freebsd/sys/dev/usb/controller/ehci_pci.c
new file mode 100644
index ..58789221
--- /dev/null
+++ b/freebsd/sys/dev/usb/controller/ehci_pci.c
@@ -0,0 +1,593 @@
+#include 
+
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-NetBSD
+ *
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Lennart Augustsson (augus...@carlstedt.se) at
+ * Carlstedt Research & Technology.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+/*
+ * USB Enhanced Host Controller Driver, a.k.a. USB 2.0 controller.
+ *
+ * The EHCI 1.0 spec can be found at
+ * http://developer.intel.com/technology/usb/download/ehci-r10.pdf
+ * and the USB 2.0 spec at
+ * http://www.usb.org/developers/docs/usb_20.zip
+ */
+
+/* The low level controller code for EHCI has been split into
+ * PCI probes and EHCI specific code. This was done to facilitate the
+ * sharing of code between *BSD's
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#definePCI_EHCI_VENDORID_ACERLABS  0x10b9
+#definePCI_EHCI_VENDORID_AMD   0x1022
+#definePCI_EHCI_VENDORID_APPLE 0x106b
+#definePCI_EHCI_VENDORID_ATI   0x1002
+#definePCI_EHCI_VENDORID_CMDTECH   0x1095
+#definePCI_EHCI_VENDORID_INTEL 0x8086
+#definePCI_EHCI_VENDORID_NEC   0x1033
+#definePCI_EHCI_VENDORID_OPTI  0x1045
+#definePCI_EHCI_VENDORID_PHILIPS   0x1131
+#definePCI_EHCI_VENDORID_SIS   0x1039
+#definePCI_EHCI_VENDORID_NVIDIA0x12D2
+#definePCI_EHCI_VENDORID_NVIDIA2   0x10DE
+#definePCI_EHCI_VENDORID_VIA   0x1106
+
+static device_probe_t ehci_pci_probe;
+static device_attach_t ehci_pci_attach;
+static device_detach_t ehci_pci_detach;
+static usb_take_controller_t ehci_pci_take_controller;
+
+static const char *
+ehci_pci_match(device_t self)
+{
+   uint32_t device_id = pci_get_devid(self);
+
+   switch (device_id) {
+   case 0x523910b9:
+   return "ALi M5239 USB 2.0 controller";
+
+   case 0x10227463:
+   return "AMD 8111 USB 2.0 controller";
+
+   case 0x20951022:
+   return ("AMD CS5536 (Geode) USB 2.0 controller");
+   case 0x78081022:
+   return ("AMD FCH USB 2.0 controller");
+
+   case 0x43451002:
+   return "ATI SB200 USB 2.0 controller";
+   case 0x43731002:
+   return "ATI SB400 USB 2.0 controller";
+   case 0x43961002:
+   return ("AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller");
+
+   case 0x0f348086:
+   return ("Intel BayTrail USB 2.0 controller");
+   case 0x1c268086:
+   return ("Intel Cougar Point USB 2.0 controller");
+   case 0x1c2d8086:
+   return ("Intel Cougar Point USB 2.0 controller");
+   case 0x1d268086:
+   return ("Intel Patsburg USB 2.0 controller");
+   case 0x1d2d8086:
+   

[PATCH 0/2] Import ehci_pci

2021-02-22 Thread Moyano, Gabriel
Import ehci_pci from freebsd-org using freebsd-to-rtems.py

Moyano, Gabriel (2):
  ehci_pci: Import from freebsd-org
  ehci_pci: Add to build system

 freebsd/sys/dev/usb/controller/ehci_pci.c | 593 ++
 freebsd/sys/dev/usb/usb_pci.h |  43 ++
 libbsd.py |   2 +
 3 files changed, 638 insertions(+)
 create mode 100644 freebsd/sys/dev/usb/controller/ehci_pci.c
 create mode 100644 freebsd/sys/dev/usb/usb_pci.h

-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 2/2] ehci_pci: Add to build system

2021-02-22 Thread Moyano, Gabriel
---
 libbsd.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libbsd.py b/libbsd.py
index 334a7991..1a053433 100644
--- a/libbsd.py
+++ b/libbsd.py
@@ -785,6 +785,7 @@ class dev_usb(builder.Module):
 'sys/dev/usb/usb_ioctl.h',
 'sys/dev/usb/usb_mbuf.h',
 'sys/dev/usb/usb_msctest.h',
+'sys/dev/usb/usb_pci.h',
 'sys/dev/usb/usb_pf.h',
 'sys/dev/usb/usb_process.h',
 'sys/dev/usb/usb_request.h',
@@ -847,6 +848,7 @@ class dev_usb_controller(builder.Module):
 [
 'sys/dev/usb/controller/ohci.c',
 'sys/dev/usb/controller/ehci.c',
+'sys/dev/usb/controller/ehci_pci.c',
 'sys/dev/usb/controller/usb_controller.c',
 'sys/dev/usb/controller/dwc_otg.c',
 'sys/dev/usb/controller/dwc_otg_fdt.c',
-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 1/2] ehci_pci: Import from freebsd-org

2021-02-22 Thread Moyano, Gabriel
---
 freebsd/sys/dev/usb/controller/ehci_pci.c | 592 ++
 freebsd/sys/dev/usb/usb_pci.h |  43 ++
 2 files changed, 635 insertions(+)
 create mode 100644 freebsd/sys/dev/usb/controller/ehci_pci.c
 create mode 100644 freebsd/sys/dev/usb/usb_pci.h

diff --git a/freebsd/sys/dev/usb/controller/ehci_pci.c 
b/freebsd/sys/dev/usb/controller/ehci_pci.c
new file mode 100644
index ..d1320278
--- /dev/null
+++ b/freebsd/sys/dev/usb/controller/ehci_pci.c
@@ -0,0 +1,592 @@
+#include 
+
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-NetBSD
+ *
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Lennart Augustsson (augus...@carlstedt.se) at
+ * Carlstedt Research & Technology.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+/*
+ * USB Enhanced Host Controller Driver, a.k.a. USB 2.0 controller.
+ *
+ * The EHCI 1.0 spec can be found at
+ * http://developer.intel.com/technology/usb/download/ehci-r10.pdf
+ * and the USB 2.0 spec at
+ * http://www.usb.org/developers/docs/usb_20.zip
+ */
+
+/* The low level controller code for EHCI has been split into
+ * PCI probes and EHCI specific code. This was done to facilitate the
+ * sharing of code between *BSD's
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#definePCI_EHCI_VENDORID_ACERLABS  0x10b9
+#definePCI_EHCI_VENDORID_AMD   0x1022
+#definePCI_EHCI_VENDORID_APPLE 0x106b
+#definePCI_EHCI_VENDORID_ATI   0x1002
+#definePCI_EHCI_VENDORID_CMDTECH   0x1095
+#definePCI_EHCI_VENDORID_INTEL 0x8086
+#definePCI_EHCI_VENDORID_NEC   0x1033
+#definePCI_EHCI_VENDORID_OPTI  0x1045
+#definePCI_EHCI_VENDORID_PHILIPS   0x1131
+#definePCI_EHCI_VENDORID_SIS   0x1039
+#definePCI_EHCI_VENDORID_NVIDIA0x12D2
+#definePCI_EHCI_VENDORID_NVIDIA2   0x10DE
+#definePCI_EHCI_VENDORID_VIA   0x1106
+
+static device_probe_t ehci_pci_probe;
+static device_attach_t ehci_pci_attach;
+static device_detach_t ehci_pci_detach;
+static usb_take_controller_t ehci_pci_take_controller;
+
+static const char *
+ehci_pci_match(device_t self)
+{
+   uint32_t device_id = pci_get_devid(self);
+
+   switch (device_id) {
+   case 0x523910b9:
+   return "ALi M5239 USB 2.0 controller";
+
+   case 0x10227463:
+   return "AMD 8111 USB 2.0 controller";
+
+   case 0x20951022:
+   return ("AMD CS5536 (Geode) USB 2.0 controller");
+   case 0x78081022:
+   return ("AMD FCH USB 2.0 controller");
+
+   case 0x43451002:
+   return "ATI SB200 USB 2.0 controller";
+   case 0x43731002:
+   return "ATI SB400 USB 2.0 controller";
+   case 0x43961002:
+   return ("AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller");
+
+   case 0x0f348086:
+   return ("Intel BayTrail USB 2.0 controller");
+   case 0x1c268086:
+   return ("Intel Cougar Point USB 2.0 controller");
+   case 0x1c2d8086:
+   return ("Intel Cougar Point USB 2.0 controller");
+   case 0x1d268086:
+   return ("Intel Patsburg USB 2.0 controller");
+   case 0x1d2d8086:
+   

[PATCH 0/2] ehci_pci - ticket #4263

2021-02-22 Thread Moyano, Gabriel
Import ehci_pci from freebsd-org.
Solve https://devel.rtems.org/ticket/4263

Moyano, Gabriel (2):
  ehci_pci: Import from freebsd-org
  ehci_pci: Add to build system

 freebsd/sys/dev/usb/controller/ehci_pci.c | 592 ++
 freebsd/sys/dev/usb/usb_pci.h |  43 ++
 libbsd.py |   2 +
 3 files changed, 637 insertions(+)
 create mode 100644 freebsd/sys/dev/usb/controller/ehci_pci.c
 create mode 100644 freebsd/sys/dev/usb/usb_pci.h

-- 
2.17.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH] rtems: Move rtems_task_priority definition

2021-02-22 Thread Sebastian Huber
This type is not only used by Task Manager directives.  This is a
preparation to move the rtems_scheduler_*() directives from
 to a new .
---
 cpukit/include/rtems/rtems/sem.h   |  1 -
 cpukit/include/rtems/rtems/timer.h |  1 -
 cpukit/include/rtems/rtems/types.h | 13 +++--
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/cpukit/include/rtems/rtems/sem.h b/cpukit/include/rtems/rtems/sem.h
index 7e4780cebf..74d0ab45a3 100644
--- a/cpukit/include/rtems/rtems/sem.h
+++ b/cpukit/include/rtems/rtems/sem.h
@@ -58,7 +58,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #ifdef __cplusplus
diff --git a/cpukit/include/rtems/rtems/timer.h 
b/cpukit/include/rtems/rtems/timer.h
index 87f18b3581..4593feecf3 100644
--- a/cpukit/include/rtems/rtems/timer.h
+++ b/cpukit/include/rtems/rtems/timer.h
@@ -59,7 +59,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/cpukit/include/rtems/rtems/types.h 
b/cpukit/include/rtems/rtems/types.h
index a058eedea1..bf656b623e 100644
--- a/cpukit/include/rtems/rtems/types.h
+++ b/cpukit/include/rtems/rtems/types.h
@@ -7,8 +7,8 @@
  */
 
 /*
- * Copyright (C) 2009, 2020 embedded brains GmbH 
(http://www.embedded-brains.de)
- * Copyright (C) 2006, 2008 On-Line Applications Research Corporation (OAR)
+ * Copyright (C) 2009, 2021 embedded brains GmbH 
(http://www.embedded-brains.de)
+ * Copyright (C) 1988, 2017 On-Line Applications Research Corporation (OAR)
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -254,6 +254,15 @@ typedef uint32_t rtems_name;
   typedef MP_packet_Prefix rtems_packet_prefix;
 #endif
 
+/* Generated from spec:/rtems/type/if/priority */
+
+/**
+ * @ingroup RTEMSAPIClassicTypes
+ *
+ * @brief This integer type represents task priorities of the Classic API.
+ */
+typedef uint32_t rtems_task_priority;
+
 /* Generated from spec:/rtems/type/if/time-of-day */
 
 /**
-- 
2.26.2

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 2/6] score: Simplify core barrier

2021-02-22 Thread Sebastian Huber
Use the number of threads which must arrive at the barrier to trip the
automatic release also to indicate if the barrier is a manual release
barrier.
---
 cpukit/include/rtems/score/corebarrier.h | 56 +++-
 cpukit/include/rtems/score/corebarrierimpl.h | 56 +---
 cpukit/rtems/src/barriercreate.c | 29 +-
 cpukit/score/src/corebarrier.c   |  7 ++-
 cpukit/score/src/corebarrierwait.c   | 17 +++---
 5 files changed, 59 insertions(+), 106 deletions(-)

diff --git a/cpukit/include/rtems/score/corebarrier.h 
b/cpukit/include/rtems/score/corebarrier.h
index 60abbd6f8f..7cfaeddca7 100644
--- a/cpukit/include/rtems/score/corebarrier.h
+++ b/cpukit/include/rtems/score/corebarrier.h
@@ -40,50 +40,30 @@ extern "C" {
  */
 
 /**
- *  Flavors of barriers.
- */
-typedef enum {
-  /** This specifies that the barrier will automatically release when
-   *  the user specified number of threads have arrived at the barrier.
-   */
-  CORE_BARRIER_AUTOMATIC_RELEASE,
-  /** This specifies that the user will have to manually release the barrier
-   *  in order to release the waiting threads.
-   */
-  CORE_BARRIER_MANUAL_RELEASE
-}   CORE_barrier_Disciplines;
-
-/**
- *  The following defines the control block used to manage the
- *  attributes of each barrier.
+ * @brief This control block is used to manage a barrier.
  */
 typedef struct {
-  /** This field indicates whether the barrier is automatic or manual.
+  /**
+   * @brief This member is used to manage the set of tasks which are
+   *   blocked waiting for the barrier to be released.
*/
-  CORE_barrier_Disciplines  discipline;
-  /** This element indicates the number of threads which must arrive at the
-   *  barrier to trip the automatic release.
-   */
-  uint32_t  maximum_count;
-}   CORE_barrier_Attributes;
+  Thread_queue_Control Wait_queue;
 
-/**
- *  The following defines the control block used to manage each
- *  barrier.
- */
-typedef struct {
-  /** This field is the Waiting Queue used to manage the set of tasks
-   *  which are blocked waiting for the barrier to be released.
+  /**
+   * @brief This member contains the current number of thread waiting at the
+   *   barrier to be released.
*/
-  Thread_queue_Control Wait_queue;
-  /** This element is the set of attributes which define this instance's
-   *  behavior.
+  uint32_t number_of_waiting_threads;
+
+  /**
+   * @brief This member indicates the number of threads which must arrive at
+   *   the barrier to trip the automatic release.
+   *
+   * Use ::CORE_BARRIER_MANUAL_RELEASE_MAXIMUM_COUNT to indicate a manual
+   * release barrier.
*/
-  CORE_barrier_Attributes  Attributes;
-  /** This element contains the current number of thread waiting for this
-   *  barrier to be released. */
-  uint32_t number_of_waiting_threads;
-}   CORE_barrier_Control;
+  uint32_t maximum_count;
+} CORE_barrier_Control;
 
 /** @} */
 
diff --git a/cpukit/include/rtems/score/corebarrierimpl.h 
b/cpukit/include/rtems/score/corebarrierimpl.h
index 922eb5d28f..86a3e956dc 100644
--- a/cpukit/include/rtems/score/corebarrierimpl.h
+++ b/cpukit/include/rtems/score/corebarrierimpl.h
@@ -33,6 +33,12 @@ extern "C" {
  * @{
  */
 
+/**
+ * @brief This maximum thread count constant indicates that the barrier is a
+ *   manual release barrier.
+ */
+#define CORE_BARRIER_MANUAL_RELEASE_MAXIMUM_COUNT 0
+
 /**
  * @brief These thread queue operations are used for core barriers.
  *
@@ -43,16 +49,18 @@ extern "C" {
 extern const Thread_queue_Operations _CORE_barrier_Thread_queue_operations;
 
 /**
- *  @brief Initializes the core barrier.
+ * @brief Initializes the core barrier.
  *
- *  This routine initializes the barrier based on the parameters passed.
+ * @param[out] the_barrier is the barrier to initialize.
  *
- *  @param[out] the_barrier The barrier to initialize.
- *  @param[out] the_barrier_attributes The attributes which define the 
behavior of this instance.
+ * @param maximum_count is the number of threads which must arrive at the
+ *   barrier to trip the automatic release or
+ *   ::CORE_BARRIER_MANUAL_RELEASE_MAXIMUM_COUNT to indicate a manual release
+ *   barrier.
  */
 void _CORE_barrier_Initialize(
-  CORE_barrier_Control   *the_barrier,
-  CORE_barrier_Attributes*the_barrier_attributes
+  CORE_barrier_Control *the_barrier,
+  uint32_t  maximum_count
 );
 
 /**
@@ -173,42 +181,6 @@ RTEMS_INLINE_ROUTINE void _CORE_barrier_Flush(
   );
 }
 
-/**
- * @brief Checks if the barrier is automatic.
- *
- * This function returns true if the automatic release attribute is
- * enabled in the @a attribute_set and false otherwise.
- *
- * @param the_attribute The attribute set to test.
- *
- * @retval true The automatic release attribute is enabled.
- * @retval false The automatic release attribute is not enabled.
- */
-RTEMS_INLINE_ROUTINE bool _CORE_barrier_Is_automatic(
-  

[PATCH 1/6] score: Remove _Objects_Open()

2021-02-22 Thread Sebastian Huber
Use the type safe _Objects_Open_u32() instead.  Return the object
identifier to enforce a common usage pattern.
---
 cpukit/include/rtems/score/objectimpl.h | 60 +
 cpukit/include/rtems/score/threadimpl.h |  4 +-
 cpukit/rtems/src/barriercreate.c|  9 +---
 cpukit/rtems/src/dpmemcreate.c  |  6 +--
 cpukit/rtems/src/msgqconstruct.c|  6 +--
 cpukit/rtems/src/partcreate.c   |  5 +--
 cpukit/rtems/src/ratemoncreate.c|  6 +--
 cpukit/rtems/src/regioncreate.c |  5 +--
 cpukit/rtems/src/semcreate.c|  6 +--
 cpukit/rtems/src/taskconstruct.c|  2 +-
 cpukit/rtems/src/timercreate.c  |  6 +--
 cpukit/sapi/src/extensioncreate.c   |  6 +--
 cpukit/score/src/mpci.c |  2 +-
 cpukit/score/src/threadcreateidle.c |  2 +-
 cpukit/score/src/threadinitialize.c |  5 +--
 15 files changed, 44 insertions(+), 86 deletions(-)

diff --git a/cpukit/include/rtems/score/objectimpl.h 
b/cpukit/include/rtems/score/objectimpl.h
index 1a0029b3b0..8ba8189976 100644
--- a/cpukit/include/rtems/score/objectimpl.h
+++ b/cpukit/include/rtems/score/objectimpl.h
@@ -738,50 +738,27 @@ RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id(
 }
 
 /**
- * @brief Places the_object control pointer and object name
- *  in the Local Pointer and Local Name Tables, respectively.
+ * @brief Assigns the 32-bit unsigned integer name to the object and places the
+ *   object in the local object table.
  *
- * This method uses Objects_Name for the object name.
+ * @param information is the object information.
  *
- * @param[in, out] information Points to an Object Information Table.
- * @param the_object Pointer to an object.
- * @param name The name of the object to make accessible.
- */
-RTEMS_INLINE_ROUTINE void _Objects_Open(
-  Objects_Information *information,
-  Objects_Control *the_object,
-  Objects_Name name
-)
-{
-  _Assert( information != NULL );
-  _Assert( the_object != NULL );
-
-  the_object->name = name;
-
-  _Objects_Set_local_object(
-information,
-_Objects_Get_index( the_object->id ),
-the_object
-  );
-}
-
-/**
- * @brief Places the_object control pointer and object name
- *  in the Local Pointer and Local Name Tables, respectively.
+ * @param[in, out] the_object is the object to open.
  *
- * This method uses uint32_t for the object name.
+ * @param name is the name of the object to open.
  *
- * @param[in, out] information Points to an Object Information Table.
- * @param the_object Pointer to an object.
- * @param name The name of the object to make accessible.
+ * @return Returns the identifier of the object which is now valid.
  */
-RTEMS_INLINE_ROUTINE void _Objects_Open_u32(
+RTEMS_INLINE_ROUTINE Objects_Id _Objects_Open_u32(
   const Objects_Information *information,
   Objects_Control   *the_object,
   uint32_t   name
 )
 {
+  _Assert( information != NULL );
   _Assert( !_Objects_Has_string_name( information ) );
+  _Assert( the_object != NULL );
+
   the_object->name.name_u32 = name;
 
   _Objects_Set_local_object(
@@ -789,17 +766,19 @@ RTEMS_INLINE_ROUTINE void _Objects_Open_u32(
 _Objects_Get_index( the_object->id ),
 the_object
   );
+
+  return the_object->id;
 }
 
 /**
- * @brief Places the_object control pointer and object name
- *  in the Local Pointer and Local Name Tables, respectively.
+ * @brief Assigns the string name to the object and places the object in the
+ *   local object table.
  *
- * This method uses a String for the object name.
+ * @param information is the object information.
  *
- * @param[in, out] information Points to an Object Information Table.
- * @param the_object Pointer to an object.
- * @param name The name of the object to make accessible.
+ * @param[in, out] the_object is the object to open.
+ *
+ * @param name is the name of the object to open.
  */
 RTEMS_INLINE_ROUTINE void _Objects_Open_string(
   const Objects_Information *information,
@@ -807,7 +786,10 @@ RTEMS_INLINE_ROUTINE void _Objects_Open_string(
   const char*name
 )
 {
+  _Assert( information != NULL );
   _Assert( _Objects_Has_string_name( information ) );
+  _Assert( the_object != NULL );
+
   the_object->name.name_p = name;
 
   _Objects_Set_local_object(
diff --git a/cpukit/include/rtems/score/threadimpl.h 
b/cpukit/include/rtems/score/threadimpl.h
index e9d44526da..0c7df47f36 100644
--- a/cpukit/include/rtems/score/threadimpl.h
+++ b/cpukit/include/rtems/score/threadimpl.h
@@ -164,9 +164,9 @@ typedef struct {
   Thread_CPU_budget_algorithm_callout budget_callout;
 
   /**
-   * @brief Name of the object for the thread.
+   * @brief 32-bit unsigned integer name of the object for the thread.
*/
-  Objects_Name name;
+  uint32_t name;
 
   /**
* @brief The thread's initial ISR level.
diff --git a/cpukit/rtems/src/barriercreate.c b/cpukit/rtems/src/barriercreate.c
index 6e6b294832..99d916d8c7 100644
--- 

[PATCH 4/6] libtest: Add support to seize/surrender objects

2021-02-22 Thread Sebastian Huber
---
 cpukit/include/rtems/test.h|  5 +++
 cpukit/libtest/t-test-rtems-objs.c | 54 ++
 2 files changed, 59 insertions(+)

diff --git a/cpukit/include/rtems/test.h b/cpukit/include/rtems/test.h
index b42bf5f058..10ff665107 100644
--- a/cpukit/include/rtems/test.h
+++ b/cpukit/include/rtems/test.h
@@ -36,6 +36,7 @@
 
 #ifdef __rtems__
 #include 
+#include 
 #endif
 
 #ifdef __cplusplus
@@ -2512,6 +2513,10 @@ typedef enum {
 } T_thread_timer_state;
 
 T_thread_timer_state T_get_thread_timer_state(uint32_t);
+
+void *T_seize_objects(rtems_status_code (*)(void *, uint32_t *), void *);
+
+void T_surrender_objects(void **, rtems_status_code (*)(uint32_t));
 #endif /* __rtems__ */
 
 /**
diff --git a/cpukit/libtest/t-test-rtems-objs.c 
b/cpukit/libtest/t-test-rtems-objs.c
index ad8d153154..6548848c49 100644
--- a/cpukit/libtest/t-test-rtems-objs.c
+++ b/cpukit/libtest/t-test-rtems-objs.c
@@ -410,3 +410,57 @@ T_check_rtems_timers(T_event event, const char *name)
break;
};
 }
+
+void *
+T_seize_objects(rtems_status_code (*create)(void *, uint32_t *), void *arg)
+{
+   void *objects;
+
+   objects = NULL;
+
+   while (true) {
+   rtems_status_code sc;
+   rtems_id id;
+
+   id = 0;
+   sc = (*create)(arg, );
+
+   if (sc == RTEMS_SUCCESSFUL) {
+   const Objects_Information *info;
+   Objects_Control *obj;
+
+   info = _Objects_Get_information_id(id);
+   T_quiet_assert_not_null(info);
+   obj = _Objects_Get_no_protection(id, info);
+   T_quiet_assert_not_null(obj);
+   obj->Node.next = objects;
+   objects = obj;
+   } else {
+   T_quiet_rsc(sc, RTEMS_TOO_MANY);
+   break;
+   }
+   }
+
+   return objects;
+}
+
+void
+T_surrender_objects(void **objects_p, rtems_status_code (*delete)(uint32_t))
+{
+   void *objects;
+
+   objects = *objects_p;
+   *objects_p = NULL;
+
+   while (objects != NULL) {
+   Objects_Control *obj;
+   rtems_status_code sc;
+
+   obj = objects;
+   objects = _Chain_Next(>Node);
+   _Chain_Set_off_chain(>Node);
+
+   sc = (*delete)(obj->id);
+   T_quiet_rsc_success(sc);
+   }
+}
-- 
2.26.2

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 5/6] validation: Add missing barrier create test case

2021-02-22 Thread Sebastian Huber
---
 testsuites/validation/tc-barrier-create.c | 345 ++
 1 file changed, 289 insertions(+), 56 deletions(-)

diff --git a/testsuites/validation/tc-barrier-create.c 
b/testsuites/validation/tc-barrier-create.c
index cc5e9bc758..82f860749d 100644
--- a/testsuites/validation/tc-barrier-create.c
+++ b/testsuites/validation/tc-barrier-create.c
@@ -90,6 +90,12 @@ typedef enum {
   RtemsBarrierReqCreate_Pre_Id_NA
 } RtemsBarrierReqCreate_Pre_Id;
 
+typedef enum {
+  RtemsBarrierReqCreate_Pre_Free_Yes,
+  RtemsBarrierReqCreate_Pre_Free_No,
+  RtemsBarrierReqCreate_Pre_Free_NA
+} RtemsBarrierReqCreate_Pre_Free;
+
 typedef enum {
   RtemsBarrierReqCreate_Post_Status_Ok,
   RtemsBarrierReqCreate_Post_Status_InvName,
@@ -122,6 +128,8 @@ typedef enum {
  * @brief Test context for spec:/rtems/barrier/req/create test case.
  */
 typedef struct {
+  void *seized_objects;
+
   rtems_id worker_id;
 
   rtems_id id_value;
@@ -143,7 +151,7 @@ typedef struct {
   /**
* @brief This member defines the pre-condition states for the next action.
*/
-  size_t pcs[ 4 ];
+  size_t pcs[ 5 ];
 
   /**
* @brief This member indicates if the test action loop is currently
@@ -180,11 +188,18 @@ static const char * const 
RtemsBarrierReqCreate_PreDesc_Id[] = {
   "NA"
 };
 
+static const char * const RtemsBarrierReqCreate_PreDesc_Free[] = {
+  "Yes",
+  "No",
+  "NA"
+};
+
 static const char * const * const RtemsBarrierReqCreate_PreDesc[] = {
   RtemsBarrierReqCreate_PreDesc_Name,
   RtemsBarrierReqCreate_PreDesc_Class,
   RtemsBarrierReqCreate_PreDesc_MaxWait,
   RtemsBarrierReqCreate_PreDesc_Id,
+  RtemsBarrierReqCreate_PreDesc_Free,
   NULL
 };
 
@@ -218,6 +233,16 @@ static void Worker( rtems_task_argument arg )
   }
 }
 
+static rtems_status_code Create( void *arg, uint32_t *id )
+{
+  return rtems_barrier_create(
+rtems_build_name( 'S', 'I', 'Z', 'E' ),
+RTEMS_DEFAULT_ATTRIBUTES,
+0,
+id
+  );
+}
+
 static void RtemsBarrierReqCreate_Pre_Name_Prepare(
   RtemsBarrierReqCreate_Context *ctx,
   RtemsBarrierReqCreate_Pre_Name state
@@ -307,6 +332,27 @@ static void RtemsBarrierReqCreate_Pre_Id_Prepare(
   }
 }
 
+static void RtemsBarrierReqCreate_Pre_Free_Prepare(
+  RtemsBarrierReqCreate_Context *ctx,
+  RtemsBarrierReqCreate_Pre_Free state
+)
+{
+  switch ( state ) {
+case RtemsBarrierReqCreate_Pre_Free_Yes: {
+  /* Nothing to do */
+  break;
+}
+
+case RtemsBarrierReqCreate_Pre_Free_No: {
+  ctx->seized_objects = T_seize_objects( Create, NULL );
+  break;
+}
+
+case RtemsBarrierReqCreate_Pre_Free_NA:
+  break;
+  }
+}
+
 static void RtemsBarrierReqCreate_Post_Status_Check(
   RtemsBarrierReqCreate_Context*ctx,
   RtemsBarrierReqCreate_Post_Status state
@@ -353,7 +399,7 @@ static void RtemsBarrierReqCreate_Post_Name_Check(
 
   switch ( state ) {
 case RtemsBarrierReqCreate_Post_Name_Valid: {
-  id = 0;
+  id = INVALID_ID;
   sc = rtems_barrier_ident( NAME,  );
   T_rsc_success( sc );
   T_eq_u32( id, ctx->id_value );
@@ -506,6 +552,16 @@ static const uint8_t 
RtemsBarrierReqCreate_TransitionMap[][ 4 ] = {
 RtemsBarrierReqCreate_Post_Name_Valid,
 RtemsBarrierReqCreate_Post_Class_Manual,
 RtemsBarrierReqCreate_Post_IdValue_Assigned
+  }, {
+RtemsBarrierReqCreate_Post_Status_TooMany,
+RtemsBarrierReqCreate_Post_Name_Invalid,
+RtemsBarrierReqCreate_Post_Class_NoObj,
+RtemsBarrierReqCreate_Post_IdValue_Unchanged
+  }, {
+RtemsBarrierReqCreate_Post_Status_InvAddr,
+RtemsBarrierReqCreate_Post_Name_Invalid,
+RtemsBarrierReqCreate_Post_Class_NoObj,
+RtemsBarrierReqCreate_Post_IdValue_Unchanged
   }, {
 RtemsBarrierReqCreate_Post_Status_InvAddr,
 RtemsBarrierReqCreate_Post_Name_Invalid,
@@ -516,6 +572,16 @@ static const uint8_t 
RtemsBarrierReqCreate_TransitionMap[][ 4 ] = {
 RtemsBarrierReqCreate_Post_Name_Valid,
 RtemsBarrierReqCreate_Post_Class_Manual,
 RtemsBarrierReqCreate_Post_IdValue_Assigned
+  }, {
+RtemsBarrierReqCreate_Post_Status_TooMany,
+RtemsBarrierReqCreate_Post_Name_Invalid,
+RtemsBarrierReqCreate_Post_Class_NoObj,
+RtemsBarrierReqCreate_Post_IdValue_Unchanged
+  }, {
+RtemsBarrierReqCreate_Post_Status_InvAddr,
+RtemsBarrierReqCreate_Post_Name_Invalid,
+RtemsBarrierReqCreate_Post_Class_NoObj,
+RtemsBarrierReqCreate_Post_IdValue_Unchanged
   }, {
 RtemsBarrierReqCreate_Post_Status_InvAddr,
 RtemsBarrierReqCreate_Post_Name_Invalid,
@@ -526,6 +592,16 @@ static const uint8_t 
RtemsBarrierReqCreate_TransitionMap[][ 4 ] = {
 RtemsBarrierReqCreate_Post_Name_Valid,
 RtemsBarrierReqCreate_Post_Class_Manual,
 RtemsBarrierReqCreate_Post_IdValue_Assigned
+  }, {
+RtemsBarrierReqCreate_Post_Status_TooMany,
+RtemsBarrierReqCreate_Post_Name_Invalid,
+RtemsBarrierReqCreate_Post_Class_NoObj,
+RtemsBarrierReqCreate_Post_IdValue_Unchanged
+  }, {
+RtemsBarrierReqCreate_Post_Status_InvAddr,
+

[PATCH 6/6] validation: Simplify message queue construct tests

2021-02-22 Thread Sebastian Huber
---
 .../validation/tc-message-construct-errors.c  | 142 +++---
 1 file changed, 52 insertions(+), 90 deletions(-)

diff --git a/testsuites/validation/tc-message-construct-errors.c 
b/testsuites/validation/tc-message-construct-errors.c
index 5820855ac4..7fd77fcece 100644
--- a/testsuites/validation/tc-message-construct-errors.c
+++ b/testsuites/validation/tc-message-construct-errors.c
@@ -54,8 +54,6 @@
 
 #include 
 #include 
-#include 
-#include 
 
 #include 
 
@@ -95,10 +93,10 @@ typedef enum {
 } RtemsMessageReqConstructErrors_Pre_MaxSize;
 
 typedef enum {
-  RtemsMessageReqConstructErrors_Pre_Queues_Avail,
-  RtemsMessageReqConstructErrors_Pre_Queues_None,
-  RtemsMessageReqConstructErrors_Pre_Queues_NA
-} RtemsMessageReqConstructErrors_Pre_Queues;
+  RtemsMessageReqConstructErrors_Pre_Free_Yes,
+  RtemsMessageReqConstructErrors_Pre_Free_No,
+  RtemsMessageReqConstructErrors_Pre_Free_NA
+} RtemsMessageReqConstructErrors_Pre_Free;
 
 typedef enum {
   RtemsMessageReqConstructErrors_Pre_Area_Valid,
@@ -135,7 +133,7 @@ typedef struct {
 
   rtems_id id_value;
 
-  Chain_Control message_queues;
+  void *seized_objects;
 
   /**
* @brief This member defines the pre-condition states for the next action.
@@ -178,9 +176,9 @@ static const char * const 
RtemsMessageReqConstructErrors_PreDesc_MaxSize[] = {
   "NA"
 };
 
-static const char * const RtemsMessageReqConstructErrors_PreDesc_Queues[] = {
-  "Avail",
-  "None",
+static const char * const RtemsMessageReqConstructErrors_PreDesc_Free[] = {
+  "Yes",
+  "No",
   "NA"
 };
 
@@ -201,7 +199,7 @@ static const char * const * const 
RtemsMessageReqConstructErrors_PreDesc[] = {
   RtemsMessageReqConstructErrors_PreDesc_Name,
   RtemsMessageReqConstructErrors_PreDesc_MaxPending,
   RtemsMessageReqConstructErrors_PreDesc_MaxSize,
-  RtemsMessageReqConstructErrors_PreDesc_Queues,
+  RtemsMessageReqConstructErrors_PreDesc_Free,
   RtemsMessageReqConstructErrors_PreDesc_Area,
   RtemsMessageReqConstructErrors_PreDesc_AreaSize,
   NULL
@@ -214,11 +212,32 @@ static const char * const * const 
RtemsMessageReqConstructErrors_PreDesc[] = {
 #define MAX_MESSAGE_SIZE 1
 
 static RTEMS_MESSAGE_QUEUE_BUFFER( MAX_MESSAGE_SIZE )
-  exhaust_buffers[ MAX_MESSAGE_QUEUES ][ MAX_PENDING_MESSAGES ];
+  buffers_to_seize[ MAX_MESSAGE_QUEUES ][ MAX_PENDING_MESSAGES ];
 
 static RTEMS_MESSAGE_QUEUE_BUFFER( MAX_MESSAGE_SIZE )
   buffers[ MAX_PENDING_MESSAGES ];
 
+static rtems_status_code Create( void *arg, uint32_t *id )
+{
+  rtems_message_queue_config config;
+  size_t*i;
+
+  i = arg;
+  T_quiet_lt_sz( *i, MAX_MESSAGE_QUEUES );
+
+  memset( , 0, sizeof( config ) );
+  config.name = rtems_build_name( 'S', 'I', 'Z', 'E' );
+  config.maximum_pending_messages = MAX_PENDING_MESSAGES;
+  config.maximum_message_size = MAX_MESSAGE_SIZE;
+  config.storage_size = sizeof( buffers_to_seize[ *i ] );
+  config.storage_area = buffers_to_seize[ *i ];
+  config.attributes = RTEMS_DEFAULT_ATTRIBUTES;
+
+  ++(*i);
+
+  return rtems_message_queue_construct( , id );
+}
+
 static void RtemsMessageReqConstructErrors_Pre_Id_Prepare(
   RtemsMessageReqConstructErrors_Context *ctx,
   RtemsMessageReqConstructErrors_Pre_Id   state
@@ -313,58 +332,26 @@ static void 
RtemsMessageReqConstructErrors_Pre_MaxSize_Prepare(
   }
 }
 
-static void RtemsMessageReqConstructErrors_Pre_Queues_Prepare(
-  RtemsMessageReqConstructErrors_Context   *ctx,
-  RtemsMessageReqConstructErrors_Pre_Queues state
+static void RtemsMessageReqConstructErrors_Pre_Free_Prepare(
+  RtemsMessageReqConstructErrors_Context *ctx,
+  RtemsMessageReqConstructErrors_Pre_Free state
 )
 {
-  rtems_message_queue_config config;
-  size_t i;
+  size_t i;
 
   switch ( state ) {
-case RtemsMessageReqConstructErrors_Pre_Queues_Avail: {
+case RtemsMessageReqConstructErrors_Pre_Free_Yes: {
   /* Nothing to do */
   break;
 }
 
-case RtemsMessageReqConstructErrors_Pre_Queues_None: {
-  memset( , 0, sizeof( config ) );
-  config.name = rtems_build_name( 'M', 'S', 'G', 'Q' );
-  config.maximum_pending_messages = MAX_PENDING_MESSAGES;
-  config.maximum_message_size = MAX_MESSAGE_SIZE;
-  config.storage_size = sizeof( exhaust_buffers[ 0 ] );
-  config.attributes = RTEMS_DEFAULT_ATTRIBUTES;
-
+case RtemsMessageReqConstructErrors_Pre_Free_No: {
   i = 0;
-
-  while ( i < MAX_MESSAGE_QUEUES ) {
-rtems_status_code sc;
-rtems_id  id;
-
-config.storage_area = exhaust_buffers[ i ];
-
-sc = rtems_message_queue_construct( ,  );
-
-if ( sc == RTEMS_SUCCESSFUL ) {
-  Objects_Control   *obj;
-  const Objects_Information *info;
-
-  info = _Objects_Get_information_id( id );
-  T_quiet_assert_not_null( info );
-  obj = _Objects_Get_no_protection( id, info );
-  T_quiet_assert_not_null( obj );
-  _Chain_Append_unprotected( >message_queues, >Node );
- 

[PATCH 0/6] Simplify barrier implementation and create tests

2021-02-22 Thread Sebastian Huber
Sebastian Huber (6):
  score: Remove _Objects_Open()
  score: Simplify core barrier
  score: Remove _CORE_barrier_Do_flush()
  libtest: Add support to seize/surrender objects
  validation: Add missing barrier create test case
  validation: Simplify message queue construct tests

 cpukit/Makefile.am|   1 -
 cpukit/include/rtems/score/corebarrier.h  |  56 +--
 cpukit/include/rtems/score/corebarrierimpl.h  |  79 +---
 cpukit/include/rtems/score/objectimpl.h   |  60 ++-
 cpukit/include/rtems/score/threadimpl.h   |   4 +-
 cpukit/include/rtems/test.h   |   5 +
 cpukit/libtest/t-test-rtems-objs.c|  54 +++
 cpukit/rtems/src/barriercreate.c  |  38 +-
 cpukit/rtems/src/dpmemcreate.c|   6 +-
 cpukit/rtems/src/msgqconstruct.c  |   6 +-
 cpukit/rtems/src/partcreate.c |   5 +-
 cpukit/rtems/src/ratemoncreate.c  |   6 +-
 cpukit/rtems/src/regioncreate.c   |   5 +-
 cpukit/rtems/src/semcreate.c  |   6 +-
 cpukit/rtems/src/taskconstruct.c  |   2 +-
 cpukit/rtems/src/timercreate.c|   6 +-
 cpukit/sapi/src/extensioncreate.c |   6 +-
 cpukit/score/src/corebarrier.c|   7 +-
 cpukit/score/src/corebarrierrelease.c |  37 --
 cpukit/score/src/corebarrierwait.c|  17 +-
 cpukit/score/src/mpci.c   |   2 +-
 cpukit/score/src/threadcreateidle.c   |   2 +-
 cpukit/score/src/threadinitialize.c   |   5 +-
 spec/build/cpukit/librtemscpu.yml |   1 -
 testsuites/validation/tc-barrier-create.c | 345 +++---
 .../validation/tc-message-construct-errors.c  | 142 +++
 26 files changed, 509 insertions(+), 394 deletions(-)
 delete mode 100644 cpukit/score/src/corebarrierrelease.c

-- 
2.26.2

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 3/6] score: Remove _CORE_barrier_Do_flush()

2021-02-22 Thread Sebastian Huber
Call _Thread_queue_Flush_critical() directly.
---
 cpukit/Makefile.am   |  1 -
 cpukit/include/rtems/score/corebarrierimpl.h | 23 
 cpukit/score/src/corebarrierrelease.c| 37 
 spec/build/cpukit/librtemscpu.yml|  1 -
 4 files changed, 6 insertions(+), 56 deletions(-)
 delete mode 100644 cpukit/score/src/corebarrierrelease.c

diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index 14abc8bb6a..a31cd31596 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -833,7 +833,6 @@ librtemscpu_a_SOURCES += score/src/apimutexisowner.c
 librtemscpu_a_SOURCES += score/src/apimutexlock.c
 librtemscpu_a_SOURCES += score/src/apimutexunlock.c
 librtemscpu_a_SOURCES += score/src/corebarrier.c
-librtemscpu_a_SOURCES += score/src/corebarrierrelease.c
 librtemscpu_a_SOURCES += score/src/corebarrierwait.c
 librtemscpu_a_SOURCES += score/src/coremsg.c
 librtemscpu_a_SOURCES += score/src/coremsgbroadcast.c
diff --git a/cpukit/include/rtems/score/corebarrierimpl.h 
b/cpukit/include/rtems/score/corebarrierimpl.h
index 86a3e956dc..4e7f07d8e9 100644
--- a/cpukit/include/rtems/score/corebarrierimpl.h
+++ b/cpukit/include/rtems/score/corebarrierimpl.h
@@ -127,19 +127,6 @@ Status_Control _CORE_barrier_Seize(
   Thread_queue_Context *queue_context
 );
 
-/**
- * @brief Flushes the barrier.
- *
- * @param[in, out] the_barrier The barrier to flush.
- * @param[out] filter The filter for flushing.
- * @param[out] queue_context The thread queue context.
- */
-uint32_t _CORE_barrier_Do_flush(
-  CORE_barrier_Control  *the_barrier,
-  Thread_queue_Flush_filter  filter,
-  Thread_queue_Context  *queue_context
-);
-
 /**
  * @brief Manually releases the barrier.
  *
@@ -156,8 +143,9 @@ RTEMS_INLINE_ROUTINE uint32_t _CORE_barrier_Surrender(
   Thread_queue_Context *queue_context
 )
 {
-  return _CORE_barrier_Do_flush(
-the_barrier,
+  return _Thread_queue_Flush_critical(
+_barrier->Wait_queue.Queue,
+&_CORE_barrier_Thread_queue_operations,
 _Thread_queue_Flush_default_filter,
 queue_context
   );
@@ -174,8 +162,9 @@ RTEMS_INLINE_ROUTINE void _CORE_barrier_Flush(
   Thread_queue_Context *queue_context
 )
 {
-  _CORE_barrier_Do_flush(
-the_barrier,
+  _Thread_queue_Flush_critical(
+_barrier->Wait_queue.Queue,
+&_CORE_barrier_Thread_queue_operations,
 _Thread_queue_Flush_status_object_was_deleted,
 queue_context
   );
diff --git a/cpukit/score/src/corebarrierrelease.c 
b/cpukit/score/src/corebarrierrelease.c
deleted file mode 100644
index 3202171e7f..00
--- a/cpukit/score/src/corebarrierrelease.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * @file
- *
- * @ingroup RTEMSScoreBarrier
- *
- * @brief This source file contains the implementation of
- *   _CORE_barrier_Do_flush().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2006.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include 
-
-uint32_t _CORE_barrier_Do_flush(
-  CORE_barrier_Control  *the_barrier,
-  Thread_queue_Flush_filter  filter,
-  Thread_queue_Context  *queue_context
-)
-{
-  return _Thread_queue_Flush_critical(
-_barrier->Wait_queue.Queue,
-&_CORE_barrier_Thread_queue_operations,
-filter,
-queue_context
-  );
-}
diff --git a/spec/build/cpukit/librtemscpu.yml 
b/spec/build/cpukit/librtemscpu.yml
index 3d1ec086b6..dcdd62a108 100644
--- a/spec/build/cpukit/librtemscpu.yml
+++ b/spec/build/cpukit/librtemscpu.yml
@@ -1371,7 +1371,6 @@ source:
 - cpukit/score/src/condition.c
 - cpukit/score/src/configstackspacesize.c
 - cpukit/score/src/corebarrier.c
-- cpukit/score/src/corebarrierrelease.c
 - cpukit/score/src/corebarrierwait.c
 - cpukit/score/src/coremsgbroadcast.c
 - cpukit/score/src/coremsg.c
-- 
2.26.2

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel