Re: [PATCH v3] bsp/aarch64: Add new Raspberry Pi 4B BSP

2022-10-05 Thread Alan Cudmore
The merged BSP works for me, and I have the cFS bundle (
https://github.com/nasa/cfs) running on my Pi4.
What is the best way to support the ethernet, rtems-libbsd? It looks like
FreeBSD supports the Pi4 ethernet device. Any pointers to how libbsd
integration works for a RTEMS BSP?

On Wed, Oct 5, 2022 at 12:55 AM Noor Aman  wrote:

> I have sent the documentations earlier, Although reviews are required.
> I'll reply to that patch to bring it up on the devel.
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH v3] bsp/aarch64: Add new Raspberry Pi 4B BSP

2022-10-04 Thread Noor Aman
I have sent the documentations earlier, Although reviews are required. I'll
reply to that patch to bring it up on the devel.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH v3] bsp/aarch64: Add new Raspberry Pi 4B BSP

2022-10-04 Thread Joel Sherrill
On Tue, Oct 4, 2022 at 5:03 PM Joel Sherrill  wrote:

>
>
> On Tue, Oct 4, 2022 at 4:38 PM Alan Cudmore 
> wrote:
>
>> It builds without error and boots for me!
>> I ran my RTEMS Kernel Image and tried out some task demos, whetstone,
>> dhrystone, created a RAM disk, etc.
>> Next will be a core Flight System (cFS) run.
>> This is going to be a very useful board to have RTEMS + SMP + Libbsd on,
>> especially when people can buy them again.
>> Thanks!
>> Alan
>>
>>
>> RTEMS Kernel Image Booting
>> *** RTEMS Info ***
>> 6.0.0.cc43dc3e22b21ddf902b7748fb27f16c9aee3719
>>  BSP Ticks Per Second = 100
>> *** End RTEMS info ***
>>
>> Populating Root file system from TAR file.
>> Setting up filesystems.
>> Initializing Local Commands.
>> Adding Target specific commands
>> Running /shell-init.
>>
>> 1: mkdir ram
>> 2: mkrfs /dev/rda
>> 3: mount -t rfs /dev/rda /ram
>> mounted /dev/rda -> /ram
>> 4: hello
>>   __  
>>/ __ \/_  __/ /  \/  / ___/
>>   / /_/ / / / / __/ / /\_/ /\__ \
>>  / _, _/ / / / /___/ /  / /___/ /
>> /_/ \_| /_/ /_/_/  /_///
>>
>> Hello RTEMS!
>> Create your own command here!
>> Starting shell
>>
>> RTEMS Shell on /dev/console. Use 'help' to list commands.
>> shell0 [/] #
>>
>
> Wow! I'm always impressed by how many RTEMS capabilities are
> available in a basic BSP.
>
> All it needs now is a network driver.  :)
>
> I'll merge this .
>

Well I couldn't stand to wait until morning to merge this. I just
pushed it. Please check that it is OK.

Are there any documentation patches?

--joel

> --joel
>
>>
>>
>> On Tue, Oct 4, 2022 at 2:40 PM Joel Sherrill  wrote:
>>
>>> Once Alan says it's OK, I will merge this.
>>>
>>> Great work! Please make sure code, docs, tester configuration, etc gets
>>> merged.
>>>
>>> On Tue, Oct 4, 2022 at 1:18 PM Kinsey Moore 
>>> wrote:
>>>
 I think all of the issues with this patch have been addressed; this
 looks good to me.

 Great work, Noor!

 Kinsey

 On Tue, Oct 4, 2022 at 11:12 AM Noor Aman 
 wrote:

> hey all,
> I've fixed the warning and edited the commit message to be more
> specific and to be in 80 words char limit.
>
> Thanks,
> Noor
>
> On Tue, 4 Oct 2022 at 16:08, Mohd Noor Aman 
> wrote:
>
>> This patch adds new Raspberry pi 4B AArch64 BSP to the RTEMS Family.
>> Currently
>> only LP64 ABI is supported. ILP32 is not supported. RAM starts from
>> 0x8 in
>> 64Bit kernel mode and MMU from 0x0. All Raspberrypi Pi 4B models and
>> Raspberry
>> Pi 400 are supported. All the IRQs are similiar to the older
>> Raspberry pi 2 ARM
>> BSP.
>>
>> Raspberry Pi 4B has 2 types of UARTs. Only PL011 serial is supported
>> currently.
>> Mini-UART is not supported. Mini-UART is default UART on the board so
>> it needs
>> to be disabled by adding "dtoverlay=disable-bt" to the config.txt. No
>> support
>> for additional 4 PL011-UARTs on the board.
>>
>> The raspberrypi.h includes many of the address required for the future
>> development of the RPi 4B BSP. This includes peripherals, ARM Timer,
>> VideoCore
>> Timer, Watchdog, Mailbox, AUX, FIQs and IRQs.
>> ---
>>  bsps/aarch64/raspberrypi/console/console.c|  69 +++
>>  bsps/aarch64/raspberrypi/include/bsp.h|  76 +++
>>  bsps/aarch64/raspberrypi/include/bsp/irq.h| 109 
>>  .../raspberrypi/include/bsp/raspberrypi.h | 471
>> ++
>>  bsps/aarch64/raspberrypi/include/tm27.h   |  46 ++
>>  bsps/aarch64/raspberrypi/start/bspstart.c |  49 ++
>>  .../aarch64/raspberrypi/start/bspstarthooks.c |  53 ++
>>  bsps/aarch64/raspberrypi/start/bspstartmmu.c  |  84 
>>  spec/build/bsps/aarch64/raspberrypi/abi.yml   |  21 +
>>  .../aarch64/raspberrypi/bspraspberrypi4.yml   |  81 +++
>>  .../bsps/aarch64/raspberrypi/linkercmds.yml   |  76 +++
>>  11 files changed, 1135 insertions(+)
>>  create mode 100644 bsps/aarch64/raspberrypi/console/console.c
>>  create mode 100644 bsps/aarch64/raspberrypi/include/bsp.h
>>  create mode 100644 bsps/aarch64/raspberrypi/include/bsp/irq.h
>>  create mode 100644 bsps/aarch64/raspberrypi/include/bsp/raspberrypi.h
>>  create mode 100644 bsps/aarch64/raspberrypi/include/tm27.h
>>  create mode 100644 bsps/aarch64/raspberrypi/start/bspstart.c
>>  create mode 100644 bsps/aarch64/raspberrypi/start/bspstarthooks.c
>>  create mode 100644 bsps/aarch64/raspberrypi/start/bspstartmmu.c
>>  create mode 100644 spec/build/bsps/aarch64/raspberrypi/abi.yml
>>  create mode 100644
>> spec/build/bsps/aarch64/raspberrypi/bspraspberrypi4.yml
>>  create mode 100644 spec/build/bsps/aarch64/raspberrypi/linkercmds.yml
>>
>> diff --git a/bsps/aarch64/raspberrypi/console/console.c
>> b/bsps/aarch64/raspberrypi/console/console.c
>> new file mode 100644
>> 

Re: [PATCH v3] bsp/aarch64: Add new Raspberry Pi 4B BSP

2022-10-04 Thread Joel Sherrill
On Tue, Oct 4, 2022 at 4:38 PM Alan Cudmore  wrote:

> It builds without error and boots for me!
> I ran my RTEMS Kernel Image and tried out some task demos, whetstone,
> dhrystone, created a RAM disk, etc.
> Next will be a core Flight System (cFS) run.
> This is going to be a very useful board to have RTEMS + SMP + Libbsd on,
> especially when people can buy them again.
> Thanks!
> Alan
>
>
> RTEMS Kernel Image Booting
> *** RTEMS Info ***
> 6.0.0.cc43dc3e22b21ddf902b7748fb27f16c9aee3719
>  BSP Ticks Per Second = 100
> *** End RTEMS info ***
>
> Populating Root file system from TAR file.
> Setting up filesystems.
> Initializing Local Commands.
> Adding Target specific commands
> Running /shell-init.
>
> 1: mkdir ram
> 2: mkrfs /dev/rda
> 3: mount -t rfs /dev/rda /ram
> mounted /dev/rda -> /ram
> 4: hello
>   __  
>/ __ \/_  __/ /  \/  / ___/
>   / /_/ / / / / __/ / /\_/ /\__ \
>  / _, _/ / / / /___/ /  / /___/ /
> /_/ \_| /_/ /_/_/  /_///
>
> Hello RTEMS!
> Create your own command here!
> Starting shell
>
> RTEMS Shell on /dev/console. Use 'help' to list commands.
> shell0 [/] #
>

Wow! I'm always impressed by how many RTEMS capabilities are
available in a basic BSP.

All it needs now is a network driver.  :)

I'll merge this .

--joel

>
>
> On Tue, Oct 4, 2022 at 2:40 PM Joel Sherrill  wrote:
>
>> Once Alan says it's OK, I will merge this.
>>
>> Great work! Please make sure code, docs, tester configuration, etc gets
>> merged.
>>
>> On Tue, Oct 4, 2022 at 1:18 PM Kinsey Moore 
>> wrote:
>>
>>> I think all of the issues with this patch have been addressed; this
>>> looks good to me.
>>>
>>> Great work, Noor!
>>>
>>> Kinsey
>>>
>>> On Tue, Oct 4, 2022 at 11:12 AM Noor Aman 
>>> wrote:
>>>
 hey all,
 I've fixed the warning and edited the commit message to be more
 specific and to be in 80 words char limit.

 Thanks,
 Noor

 On Tue, 4 Oct 2022 at 16:08, Mohd Noor Aman 
 wrote:

> This patch adds new Raspberry pi 4B AArch64 BSP to the RTEMS Family.
> Currently
> only LP64 ABI is supported. ILP32 is not supported. RAM starts from
> 0x8 in
> 64Bit kernel mode and MMU from 0x0. All Raspberrypi Pi 4B models and
> Raspberry
> Pi 400 are supported. All the IRQs are similiar to the older Raspberry
> pi 2 ARM
> BSP.
>
> Raspberry Pi 4B has 2 types of UARTs. Only PL011 serial is supported
> currently.
> Mini-UART is not supported. Mini-UART is default UART on the board so
> it needs
> to be disabled by adding "dtoverlay=disable-bt" to the config.txt. No
> support
> for additional 4 PL011-UARTs on the board.
>
> The raspberrypi.h includes many of the address required for the future
> development of the RPi 4B BSP. This includes peripherals, ARM Timer,
> VideoCore
> Timer, Watchdog, Mailbox, AUX, FIQs and IRQs.
> ---
>  bsps/aarch64/raspberrypi/console/console.c|  69 +++
>  bsps/aarch64/raspberrypi/include/bsp.h|  76 +++
>  bsps/aarch64/raspberrypi/include/bsp/irq.h| 109 
>  .../raspberrypi/include/bsp/raspberrypi.h | 471 ++
>  bsps/aarch64/raspberrypi/include/tm27.h   |  46 ++
>  bsps/aarch64/raspberrypi/start/bspstart.c |  49 ++
>  .../aarch64/raspberrypi/start/bspstarthooks.c |  53 ++
>  bsps/aarch64/raspberrypi/start/bspstartmmu.c  |  84 
>  spec/build/bsps/aarch64/raspberrypi/abi.yml   |  21 +
>  .../aarch64/raspberrypi/bspraspberrypi4.yml   |  81 +++
>  .../bsps/aarch64/raspberrypi/linkercmds.yml   |  76 +++
>  11 files changed, 1135 insertions(+)
>  create mode 100644 bsps/aarch64/raspberrypi/console/console.c
>  create mode 100644 bsps/aarch64/raspberrypi/include/bsp.h
>  create mode 100644 bsps/aarch64/raspberrypi/include/bsp/irq.h
>  create mode 100644 bsps/aarch64/raspberrypi/include/bsp/raspberrypi.h
>  create mode 100644 bsps/aarch64/raspberrypi/include/tm27.h
>  create mode 100644 bsps/aarch64/raspberrypi/start/bspstart.c
>  create mode 100644 bsps/aarch64/raspberrypi/start/bspstarthooks.c
>  create mode 100644 bsps/aarch64/raspberrypi/start/bspstartmmu.c
>  create mode 100644 spec/build/bsps/aarch64/raspberrypi/abi.yml
>  create mode 100644
> spec/build/bsps/aarch64/raspberrypi/bspraspberrypi4.yml
>  create mode 100644 spec/build/bsps/aarch64/raspberrypi/linkercmds.yml
>
> diff --git a/bsps/aarch64/raspberrypi/console/console.c
> b/bsps/aarch64/raspberrypi/console/console.c
> new file mode 100644
> index 00..73bb0036ff
> --- /dev/null
> +++ b/bsps/aarch64/raspberrypi/console/console.c
> @@ -0,0 +1,69 @@
> +/* SPDX-License-Identifier: BSD-2-Clause */
> +
> +/**
> + * @file
> + *
> + * @ingroup RTEMSBSPsAArch64Raspberrypi4
> + *
> + * @brief Console Configuration
> + */
> +
> +/*
> + * 

Re: [PATCH v3] bsp/aarch64: Add new Raspberry Pi 4B BSP

2022-10-04 Thread Alan Cudmore
It builds without error and boots for me!
I ran my RTEMS Kernel Image and tried out some task demos, whetstone,
dhrystone, created a RAM disk, etc.
Next will be a core Flight System (cFS) run.
This is going to be a very useful board to have RTEMS + SMP + Libbsd on,
especially when people can buy them again.
Thanks!
Alan


RTEMS Kernel Image Booting
*** RTEMS Info ***
6.0.0.cc43dc3e22b21ddf902b7748fb27f16c9aee3719
 BSP Ticks Per Second = 100
*** End RTEMS info ***

Populating Root file system from TAR file.
Setting up filesystems.
Initializing Local Commands.
Adding Target specific commands
Running /shell-init.

1: mkdir ram
2: mkrfs /dev/rda
3: mount -t rfs /dev/rda /ram
mounted /dev/rda -> /ram
4: hello
  __  
   / __ \/_  __/ /  \/  / ___/
  / /_/ / / / / __/ / /\_/ /\__ \
 / _, _/ / / / /___/ /  / /___/ /
/_/ \_| /_/ /_/_/  /_///

Hello RTEMS!
Create your own command here!
Starting shell

RTEMS Shell on /dev/console. Use 'help' to list commands.
shell0 [/] #


On Tue, Oct 4, 2022 at 2:40 PM Joel Sherrill  wrote:

> Once Alan says it's OK, I will merge this.
>
> Great work! Please make sure code, docs, tester configuration, etc gets
> merged.
>
> On Tue, Oct 4, 2022 at 1:18 PM Kinsey Moore 
> wrote:
>
>> I think all of the issues with this patch have been addressed; this looks
>> good to me.
>>
>> Great work, Noor!
>>
>> Kinsey
>>
>> On Tue, Oct 4, 2022 at 11:12 AM Noor Aman  wrote:
>>
>>> hey all,
>>> I've fixed the warning and edited the commit message to be more specific
>>> and to be in 80 words char limit.
>>>
>>> Thanks,
>>> Noor
>>>
>>> On Tue, 4 Oct 2022 at 16:08, Mohd Noor Aman 
>>> wrote:
>>>
 This patch adds new Raspberry pi 4B AArch64 BSP to the RTEMS Family.
 Currently
 only LP64 ABI is supported. ILP32 is not supported. RAM starts from
 0x8 in
 64Bit kernel mode and MMU from 0x0. All Raspberrypi Pi 4B models and
 Raspberry
 Pi 400 are supported. All the IRQs are similiar to the older Raspberry
 pi 2 ARM
 BSP.

 Raspberry Pi 4B has 2 types of UARTs. Only PL011 serial is supported
 currently.
 Mini-UART is not supported. Mini-UART is default UART on the board so
 it needs
 to be disabled by adding "dtoverlay=disable-bt" to the config.txt. No
 support
 for additional 4 PL011-UARTs on the board.

 The raspberrypi.h includes many of the address required for the future
 development of the RPi 4B BSP. This includes peripherals, ARM Timer,
 VideoCore
 Timer, Watchdog, Mailbox, AUX, FIQs and IRQs.
 ---
  bsps/aarch64/raspberrypi/console/console.c|  69 +++
  bsps/aarch64/raspberrypi/include/bsp.h|  76 +++
  bsps/aarch64/raspberrypi/include/bsp/irq.h| 109 
  .../raspberrypi/include/bsp/raspberrypi.h | 471 ++
  bsps/aarch64/raspberrypi/include/tm27.h   |  46 ++
  bsps/aarch64/raspberrypi/start/bspstart.c |  49 ++
  .../aarch64/raspberrypi/start/bspstarthooks.c |  53 ++
  bsps/aarch64/raspberrypi/start/bspstartmmu.c  |  84 
  spec/build/bsps/aarch64/raspberrypi/abi.yml   |  21 +
  .../aarch64/raspberrypi/bspraspberrypi4.yml   |  81 +++
  .../bsps/aarch64/raspberrypi/linkercmds.yml   |  76 +++
  11 files changed, 1135 insertions(+)
  create mode 100644 bsps/aarch64/raspberrypi/console/console.c
  create mode 100644 bsps/aarch64/raspberrypi/include/bsp.h
  create mode 100644 bsps/aarch64/raspberrypi/include/bsp/irq.h
  create mode 100644 bsps/aarch64/raspberrypi/include/bsp/raspberrypi.h
  create mode 100644 bsps/aarch64/raspberrypi/include/tm27.h
  create mode 100644 bsps/aarch64/raspberrypi/start/bspstart.c
  create mode 100644 bsps/aarch64/raspberrypi/start/bspstarthooks.c
  create mode 100644 bsps/aarch64/raspberrypi/start/bspstartmmu.c
  create mode 100644 spec/build/bsps/aarch64/raspberrypi/abi.yml
  create mode 100644
 spec/build/bsps/aarch64/raspberrypi/bspraspberrypi4.yml
  create mode 100644 spec/build/bsps/aarch64/raspberrypi/linkercmds.yml

 diff --git a/bsps/aarch64/raspberrypi/console/console.c
 b/bsps/aarch64/raspberrypi/console/console.c
 new file mode 100644
 index 00..73bb0036ff
 --- /dev/null
 +++ b/bsps/aarch64/raspberrypi/console/console.c
 @@ -0,0 +1,69 @@
 +/* SPDX-License-Identifier: BSD-2-Clause */
 +
 +/**
 + * @file
 + *
 + * @ingroup RTEMSBSPsAArch64Raspberrypi4
 + *
 + * @brief Console Configuration
 + */
 +
 +/*
 + * Copyright (C) 2022 Mohd Noor Aman
 + *
 + *
 + * 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. 

Re: [PATCH v3] bsp/aarch64: Add new Raspberry Pi 4B BSP

2022-10-04 Thread Chris Johns
On 5/10/2022 5:39 am, Joel Sherrill wrote:
> Once Alan says it's OK, I will merge this.
> 
> Great work! Please make sure code, docs, tester configuration, etc gets 
> merged.

Looks great, well done for all the hard work.

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


Re: [PATCH v3] bsp/aarch64: Add new Raspberry Pi 4B BSP

2022-10-04 Thread Joel Sherrill
Once Alan says it's OK, I will merge this.

Great work! Please make sure code, docs, tester configuration, etc gets
merged.

On Tue, Oct 4, 2022 at 1:18 PM Kinsey Moore 
wrote:

> I think all of the issues with this patch have been addressed; this looks
> good to me.
>
> Great work, Noor!
>
> Kinsey
>
> On Tue, Oct 4, 2022 at 11:12 AM Noor Aman  wrote:
>
>> hey all,
>> I've fixed the warning and edited the commit message to be more specific
>> and to be in 80 words char limit.
>>
>> Thanks,
>> Noor
>>
>> On Tue, 4 Oct 2022 at 16:08, Mohd Noor Aman 
>> wrote:
>>
>>> This patch adds new Raspberry pi 4B AArch64 BSP to the RTEMS Family.
>>> Currently
>>> only LP64 ABI is supported. ILP32 is not supported. RAM starts from
>>> 0x8 in
>>> 64Bit kernel mode and MMU from 0x0. All Raspberrypi Pi 4B models and
>>> Raspberry
>>> Pi 400 are supported. All the IRQs are similiar to the older Raspberry
>>> pi 2 ARM
>>> BSP.
>>>
>>> Raspberry Pi 4B has 2 types of UARTs. Only PL011 serial is supported
>>> currently.
>>> Mini-UART is not supported. Mini-UART is default UART on the board so it
>>> needs
>>> to be disabled by adding "dtoverlay=disable-bt" to the config.txt. No
>>> support
>>> for additional 4 PL011-UARTs on the board.
>>>
>>> The raspberrypi.h includes many of the address required for the future
>>> development of the RPi 4B BSP. This includes peripherals, ARM Timer,
>>> VideoCore
>>> Timer, Watchdog, Mailbox, AUX, FIQs and IRQs.
>>> ---
>>>  bsps/aarch64/raspberrypi/console/console.c|  69 +++
>>>  bsps/aarch64/raspberrypi/include/bsp.h|  76 +++
>>>  bsps/aarch64/raspberrypi/include/bsp/irq.h| 109 
>>>  .../raspberrypi/include/bsp/raspberrypi.h | 471 ++
>>>  bsps/aarch64/raspberrypi/include/tm27.h   |  46 ++
>>>  bsps/aarch64/raspberrypi/start/bspstart.c |  49 ++
>>>  .../aarch64/raspberrypi/start/bspstarthooks.c |  53 ++
>>>  bsps/aarch64/raspberrypi/start/bspstartmmu.c  |  84 
>>>  spec/build/bsps/aarch64/raspberrypi/abi.yml   |  21 +
>>>  .../aarch64/raspberrypi/bspraspberrypi4.yml   |  81 +++
>>>  .../bsps/aarch64/raspberrypi/linkercmds.yml   |  76 +++
>>>  11 files changed, 1135 insertions(+)
>>>  create mode 100644 bsps/aarch64/raspberrypi/console/console.c
>>>  create mode 100644 bsps/aarch64/raspberrypi/include/bsp.h
>>>  create mode 100644 bsps/aarch64/raspberrypi/include/bsp/irq.h
>>>  create mode 100644 bsps/aarch64/raspberrypi/include/bsp/raspberrypi.h
>>>  create mode 100644 bsps/aarch64/raspberrypi/include/tm27.h
>>>  create mode 100644 bsps/aarch64/raspberrypi/start/bspstart.c
>>>  create mode 100644 bsps/aarch64/raspberrypi/start/bspstarthooks.c
>>>  create mode 100644 bsps/aarch64/raspberrypi/start/bspstartmmu.c
>>>  create mode 100644 spec/build/bsps/aarch64/raspberrypi/abi.yml
>>>  create mode 100644
>>> spec/build/bsps/aarch64/raspberrypi/bspraspberrypi4.yml
>>>  create mode 100644 spec/build/bsps/aarch64/raspberrypi/linkercmds.yml
>>>
>>> diff --git a/bsps/aarch64/raspberrypi/console/console.c
>>> b/bsps/aarch64/raspberrypi/console/console.c
>>> new file mode 100644
>>> index 00..73bb0036ff
>>> --- /dev/null
>>> +++ b/bsps/aarch64/raspberrypi/console/console.c
>>> @@ -0,0 +1,69 @@
>>> +/* SPDX-License-Identifier: BSD-2-Clause */
>>> +
>>> +/**
>>> + * @file
>>> + *
>>> + * @ingroup RTEMSBSPsAArch64Raspberrypi4
>>> + *
>>> + * @brief Console Configuration
>>> + */
>>> +
>>> +/*
>>> + * Copyright (C) 2022 Mohd Noor Aman
>>> + *
>>> + *
>>> + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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 
>>> +
>>> +#include 
>>> +#include 
>>> +#include 

Re: [PATCH v3] bsp/aarch64: Add new Raspberry Pi 4B BSP

2022-10-04 Thread Kinsey Moore
I think all of the issues with this patch have been addressed; this looks
good to me.

Great work, Noor!

Kinsey

On Tue, Oct 4, 2022 at 11:12 AM Noor Aman  wrote:

> hey all,
> I've fixed the warning and edited the commit message to be more specific
> and to be in 80 words char limit.
>
> Thanks,
> Noor
>
> On Tue, 4 Oct 2022 at 16:08, Mohd Noor Aman 
> wrote:
>
>> This patch adds new Raspberry pi 4B AArch64 BSP to the RTEMS Family.
>> Currently
>> only LP64 ABI is supported. ILP32 is not supported. RAM starts from
>> 0x8 in
>> 64Bit kernel mode and MMU from 0x0. All Raspberrypi Pi 4B models and
>> Raspberry
>> Pi 400 are supported. All the IRQs are similiar to the older Raspberry pi
>> 2 ARM
>> BSP.
>>
>> Raspberry Pi 4B has 2 types of UARTs. Only PL011 serial is supported
>> currently.
>> Mini-UART is not supported. Mini-UART is default UART on the board so it
>> needs
>> to be disabled by adding "dtoverlay=disable-bt" to the config.txt. No
>> support
>> for additional 4 PL011-UARTs on the board.
>>
>> The raspberrypi.h includes many of the address required for the future
>> development of the RPi 4B BSP. This includes peripherals, ARM Timer,
>> VideoCore
>> Timer, Watchdog, Mailbox, AUX, FIQs and IRQs.
>> ---
>>  bsps/aarch64/raspberrypi/console/console.c|  69 +++
>>  bsps/aarch64/raspberrypi/include/bsp.h|  76 +++
>>  bsps/aarch64/raspberrypi/include/bsp/irq.h| 109 
>>  .../raspberrypi/include/bsp/raspberrypi.h | 471 ++
>>  bsps/aarch64/raspberrypi/include/tm27.h   |  46 ++
>>  bsps/aarch64/raspberrypi/start/bspstart.c |  49 ++
>>  .../aarch64/raspberrypi/start/bspstarthooks.c |  53 ++
>>  bsps/aarch64/raspberrypi/start/bspstartmmu.c  |  84 
>>  spec/build/bsps/aarch64/raspberrypi/abi.yml   |  21 +
>>  .../aarch64/raspberrypi/bspraspberrypi4.yml   |  81 +++
>>  .../bsps/aarch64/raspberrypi/linkercmds.yml   |  76 +++
>>  11 files changed, 1135 insertions(+)
>>  create mode 100644 bsps/aarch64/raspberrypi/console/console.c
>>  create mode 100644 bsps/aarch64/raspberrypi/include/bsp.h
>>  create mode 100644 bsps/aarch64/raspberrypi/include/bsp/irq.h
>>  create mode 100644 bsps/aarch64/raspberrypi/include/bsp/raspberrypi.h
>>  create mode 100644 bsps/aarch64/raspberrypi/include/tm27.h
>>  create mode 100644 bsps/aarch64/raspberrypi/start/bspstart.c
>>  create mode 100644 bsps/aarch64/raspberrypi/start/bspstarthooks.c
>>  create mode 100644 bsps/aarch64/raspberrypi/start/bspstartmmu.c
>>  create mode 100644 spec/build/bsps/aarch64/raspberrypi/abi.yml
>>  create mode 100644
>> spec/build/bsps/aarch64/raspberrypi/bspraspberrypi4.yml
>>  create mode 100644 spec/build/bsps/aarch64/raspberrypi/linkercmds.yml
>>
>> diff --git a/bsps/aarch64/raspberrypi/console/console.c
>> b/bsps/aarch64/raspberrypi/console/console.c
>> new file mode 100644
>> index 00..73bb0036ff
>> --- /dev/null
>> +++ b/bsps/aarch64/raspberrypi/console/console.c
>> @@ -0,0 +1,69 @@
>> +/* SPDX-License-Identifier: BSD-2-Clause */
>> +
>> +/**
>> + * @file
>> + *
>> + * @ingroup RTEMSBSPsAArch64Raspberrypi4
>> + *
>> + * @brief Console Configuration
>> + */
>> +
>> +/*
>> + * Copyright (C) 2022 Mohd Noor Aman
>> + *
>> + *
>> + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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 
>> +
>> +#include 
>> +#include 
>> +#include 
>> +
>> +#include 
>> +
>> +arm_pl011_context raspberrypi_4_context = {
>> +  .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("PL011"),
>> +  .regs = (volatile pl011 *) BSP_RPI4_PL011_BASE,
>> +  .initial_baud = 115200
>> +};
>> +
>> +const console_device console_device_table[] = {
>> +  {
>> +

Re: [PATCH v3] bsp/aarch64: Add new Raspberry Pi 4B BSP

2022-10-04 Thread Noor Aman
hey all,
I've fixed the warning and edited the commit message to be more specific
and to be in 80 words char limit.

Thanks,
Noor

On Tue, 4 Oct 2022 at 16:08, Mohd Noor Aman  wrote:

> This patch adds new Raspberry pi 4B AArch64 BSP to the RTEMS Family.
> Currently
> only LP64 ABI is supported. ILP32 is not supported. RAM starts from
> 0x8 in
> 64Bit kernel mode and MMU from 0x0. All Raspberrypi Pi 4B models and
> Raspberry
> Pi 400 are supported. All the IRQs are similiar to the older Raspberry pi
> 2 ARM
> BSP.
>
> Raspberry Pi 4B has 2 types of UARTs. Only PL011 serial is supported
> currently.
> Mini-UART is not supported. Mini-UART is default UART on the board so it
> needs
> to be disabled by adding "dtoverlay=disable-bt" to the config.txt. No
> support
> for additional 4 PL011-UARTs on the board.
>
> The raspberrypi.h includes many of the address required for the future
> development of the RPi 4B BSP. This includes peripherals, ARM Timer,
> VideoCore
> Timer, Watchdog, Mailbox, AUX, FIQs and IRQs.
> ---
>  bsps/aarch64/raspberrypi/console/console.c|  69 +++
>  bsps/aarch64/raspberrypi/include/bsp.h|  76 +++
>  bsps/aarch64/raspberrypi/include/bsp/irq.h| 109 
>  .../raspberrypi/include/bsp/raspberrypi.h | 471 ++
>  bsps/aarch64/raspberrypi/include/tm27.h   |  46 ++
>  bsps/aarch64/raspberrypi/start/bspstart.c |  49 ++
>  .../aarch64/raspberrypi/start/bspstarthooks.c |  53 ++
>  bsps/aarch64/raspberrypi/start/bspstartmmu.c  |  84 
>  spec/build/bsps/aarch64/raspberrypi/abi.yml   |  21 +
>  .../aarch64/raspberrypi/bspraspberrypi4.yml   |  81 +++
>  .../bsps/aarch64/raspberrypi/linkercmds.yml   |  76 +++
>  11 files changed, 1135 insertions(+)
>  create mode 100644 bsps/aarch64/raspberrypi/console/console.c
>  create mode 100644 bsps/aarch64/raspberrypi/include/bsp.h
>  create mode 100644 bsps/aarch64/raspberrypi/include/bsp/irq.h
>  create mode 100644 bsps/aarch64/raspberrypi/include/bsp/raspberrypi.h
>  create mode 100644 bsps/aarch64/raspberrypi/include/tm27.h
>  create mode 100644 bsps/aarch64/raspberrypi/start/bspstart.c
>  create mode 100644 bsps/aarch64/raspberrypi/start/bspstarthooks.c
>  create mode 100644 bsps/aarch64/raspberrypi/start/bspstartmmu.c
>  create mode 100644 spec/build/bsps/aarch64/raspberrypi/abi.yml
>  create mode 100644 spec/build/bsps/aarch64/raspberrypi/bspraspberrypi4.yml
>  create mode 100644 spec/build/bsps/aarch64/raspberrypi/linkercmds.yml
>
> diff --git a/bsps/aarch64/raspberrypi/console/console.c
> b/bsps/aarch64/raspberrypi/console/console.c
> new file mode 100644
> index 00..73bb0036ff
> --- /dev/null
> +++ b/bsps/aarch64/raspberrypi/console/console.c
> @@ -0,0 +1,69 @@
> +/* SPDX-License-Identifier: BSD-2-Clause */
> +
> +/**
> + * @file
> + *
> + * @ingroup RTEMSBSPsAArch64Raspberrypi4
> + *
> + * @brief Console Configuration
> + */
> +
> +/*
> + * Copyright (C) 2022 Mohd Noor Aman
> + *
> + *
> + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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 
> +
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +arm_pl011_context raspberrypi_4_context = {
> +  .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("PL011"),
> +  .regs = (volatile pl011 *) BSP_RPI4_PL011_BASE,
> +  .initial_baud = 115200
> +};
> +
> +const console_device console_device_table[] = {
> +  {
> +.device_file = "/dev/ttyS0",
> +.probe = console_device_probe_default,
> +.handler = _pl011_fns,
> +.context = _4_context.base
> +  }
> +};
> +
> +const size_t console_device_count =
> RTEMS_ARRAY_SIZE(console_device_table);
> +
> +static void output_char( char c )
> +{
> +  

[PATCH v3] bsp/aarch64: Add new Raspberry Pi 4B BSP

2022-10-04 Thread Mohd Noor Aman
This patch adds new Raspberry pi 4B AArch64 BSP to the RTEMS Family. Currently
only LP64 ABI is supported. ILP32 is not supported. RAM starts from 0x8 in
64Bit kernel mode and MMU from 0x0. All Raspberrypi Pi 4B models and Raspberry
Pi 400 are supported. All the IRQs are similiar to the older Raspberry pi 2 ARM
BSP.

Raspberry Pi 4B has 2 types of UARTs. Only PL011 serial is supported currently.
Mini-UART is not supported. Mini-UART is default UART on the board so it needs
to be disabled by adding "dtoverlay=disable-bt" to the config.txt. No support
for additional 4 PL011-UARTs on the board.

The raspberrypi.h includes many of the address required for the future
development of the RPi 4B BSP. This includes peripherals, ARM Timer, VideoCore
Timer, Watchdog, Mailbox, AUX, FIQs and IRQs.
---
 bsps/aarch64/raspberrypi/console/console.c|  69 +++
 bsps/aarch64/raspberrypi/include/bsp.h|  76 +++
 bsps/aarch64/raspberrypi/include/bsp/irq.h| 109 
 .../raspberrypi/include/bsp/raspberrypi.h | 471 ++
 bsps/aarch64/raspberrypi/include/tm27.h   |  46 ++
 bsps/aarch64/raspberrypi/start/bspstart.c |  49 ++
 .../aarch64/raspberrypi/start/bspstarthooks.c |  53 ++
 bsps/aarch64/raspberrypi/start/bspstartmmu.c  |  84 
 spec/build/bsps/aarch64/raspberrypi/abi.yml   |  21 +
 .../aarch64/raspberrypi/bspraspberrypi4.yml   |  81 +++
 .../bsps/aarch64/raspberrypi/linkercmds.yml   |  76 +++
 11 files changed, 1135 insertions(+)
 create mode 100644 bsps/aarch64/raspberrypi/console/console.c
 create mode 100644 bsps/aarch64/raspberrypi/include/bsp.h
 create mode 100644 bsps/aarch64/raspberrypi/include/bsp/irq.h
 create mode 100644 bsps/aarch64/raspberrypi/include/bsp/raspberrypi.h
 create mode 100644 bsps/aarch64/raspberrypi/include/tm27.h
 create mode 100644 bsps/aarch64/raspberrypi/start/bspstart.c
 create mode 100644 bsps/aarch64/raspberrypi/start/bspstarthooks.c
 create mode 100644 bsps/aarch64/raspberrypi/start/bspstartmmu.c
 create mode 100644 spec/build/bsps/aarch64/raspberrypi/abi.yml
 create mode 100644 spec/build/bsps/aarch64/raspberrypi/bspraspberrypi4.yml
 create mode 100644 spec/build/bsps/aarch64/raspberrypi/linkercmds.yml

diff --git a/bsps/aarch64/raspberrypi/console/console.c 
b/bsps/aarch64/raspberrypi/console/console.c
new file mode 100644
index 00..73bb0036ff
--- /dev/null
+++ b/bsps/aarch64/raspberrypi/console/console.c
@@ -0,0 +1,69 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSBSPsAArch64Raspberrypi4
+ *
+ * @brief Console Configuration
+ */
+
+/*
+ * Copyright (C) 2022 Mohd Noor Aman
+ *
+ *
+ * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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 
+
+#include 
+#include 
+#include 
+
+#include 
+
+arm_pl011_context raspberrypi_4_context = {
+  .base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("PL011"),
+  .regs = (volatile pl011 *) BSP_RPI4_PL011_BASE,
+  .initial_baud = 115200
+};
+
+const console_device console_device_table[] = {
+  {
+.device_file = "/dev/ttyS0",
+.probe = console_device_probe_default,
+.handler = _pl011_fns,
+.context = _4_context.base
+  }
+};
+
+const size_t console_device_count = RTEMS_ARRAY_SIZE(console_device_table);
+
+static void output_char( char c )
+{
+  arm_pl011_write_polled(_4_context.base, c);
+}
+
+BSP_output_char_function_type BSP_output_char = output_char;
+
+BSP_polling_getchar_function_type BSP_poll_char = NULL;
diff --git a/bsps/aarch64/raspberrypi/include/bsp.h 
b/bsps/aarch64/raspberrypi/include/bsp.h
new file mode 100644
index 00..4fa81edd40
--- /dev/null
+++ b/bsps/aarch64/raspberrypi/include/bsp.h
@@ -0,0 +1,76 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ *