Re: [PATCH rtems-net-legacy] powerpc/beatnik: Add mv643xx_eth.c driver from RTEMS 5

2023-07-19 Thread Vijay Kumar Banerjee
On Wed, Jul 19, 2023 at 7:56 PM Vijay Kumar Banerjee  wrote:
>
> On Wed, Jul 19, 2023 at 7:50 PM Chris Johns  wrote:
> >
> > On 20/7/2023 10:18 am, Vijay Kumar Banerjee wrote:
> > > On Wed, Jul 19, 2023 at 6:39 PM Chris Johns  wrote:
> > >>
> > >> Excellent.
> > >>
> > >> Could you please update the hash in the RSB for the net legacy package?
> > >>
Updating net legacy version and waf version:

https://lists.rtems.org/pipermail/devel/2023-July/075839.html


> > > Thanks for mentioning it! While trying to build from RSB, I realized
> > > two important changes I need from rtems build:
> > > 1. Removing networking check, put a patch for it just now:
> > > https://lists.rtems.org/pipermail/devel/2023-July/075830.html
> >
> > I saw that.
> >
> > > 2. Building the ping and telnetd02 requires posix. For this, should be
> > > conditionally build these two tests only when RTEMS_POSIX_API is true?
> >
> > Which part of POSIX is needed? I ask because I think the POSIX option is 
> > only
> > controlling signals and maybe something else,
> Signals only, yes.
>
> > I cannot remember what the list
> > is. What happens if you remove the check?
>
> ```
> /home/vijay/development/rtems/6/lib/gcc/powerpc-rtems6/10.3.1/../../../../powerpc-rtems6/bin/ld:
> ./libnetworking.a(main_ping.c.3.o): in function `main_ping':
> /home/vijay/development/rtems-net-legacy/build/powerpc-rtems6-beatnik/../../libmisc/main_ping.c:684:
> undefined reference to `alarm'
> /home/vijay/development/rtems/6/lib/gcc/powerpc-rtems6/10.3.1/../../../../powerpc-rtems6/bin/ld:
> /home/vijay/development/rtems-net-legacy/build/powerpc-rtems6-beatnik/../../libmisc/main_ping.c:987:
> undefined reference to `sigaction'
> /home/vijay/development/rtems/6/lib/gcc/powerpc-rtems6/10.3.1/../../../../powerpc-rtems6/bin/ld:
> /home/vijay/development/rtems-net-legacy/build/powerpc-rtems6-beatnik/../../libmisc/main_ping.c:1000:
> undefined reference to `sigaction'
> /home/vijay/development/rtems/6/lib/gcc/powerpc-rtems6/10.3.1/../../../../powerpc-rtems6/bin/ld:
> ./libnetworking.a(main_ping.c.3.o): in function `g_finish':
> /home/vijay/development/rtems-net-legacy/build/powerpc-rtems6-beatnik/../../libmisc/main_ping.c:1620:
> undefined reference to `signal'
> /home/vijay/development/rtems/6/lib/gcc/powerpc-rtems6/10.3.1/../../../../powerpc-rtems6/bin/ld:
> /home/vijay/development/rtems-net-legacy/build/powerpc-rtems6-beatnik/../../libmisc/main_ping.c:1621:
> undefined reference to `signal'
> collect2: error: ld returned 1 exit status
>
> ```
>
>
> >
>
>
> > Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH rtems-net-legacy] powerpc/beatnik: Add mv643xx_eth.c driver from RTEMS 5

2023-07-19 Thread Vijay Kumar Banerjee
On Wed, Jul 19, 2023 at 7:50 PM Chris Johns  wrote:
>
> On 20/7/2023 10:18 am, Vijay Kumar Banerjee wrote:
> > On Wed, Jul 19, 2023 at 6:39 PM Chris Johns  wrote:
> >>
> >> Excellent.
> >>
> >> Could you please update the hash in the RSB for the net legacy package?
> >>
> > Thanks for mentioning it! While trying to build from RSB, I realized
> > two important changes I need from rtems build:
> > 1. Removing networking check, put a patch for it just now:
> > https://lists.rtems.org/pipermail/devel/2023-July/075830.html
>
> I saw that.
>
> > 2. Building the ping and telnetd02 requires posix. For this, should be
> > conditionally build these two tests only when RTEMS_POSIX_API is true?
>
> Which part of POSIX is needed? I ask because I think the POSIX option is only
> controlling signals and maybe something else,
Signals only, yes.

> I cannot remember what the list
> is. What happens if you remove the check?

```
/home/vijay/development/rtems/6/lib/gcc/powerpc-rtems6/10.3.1/../../../../powerpc-rtems6/bin/ld:
./libnetworking.a(main_ping.c.3.o): in function `main_ping':
/home/vijay/development/rtems-net-legacy/build/powerpc-rtems6-beatnik/../../libmisc/main_ping.c:684:
undefined reference to `alarm'
/home/vijay/development/rtems/6/lib/gcc/powerpc-rtems6/10.3.1/../../../../powerpc-rtems6/bin/ld:
/home/vijay/development/rtems-net-legacy/build/powerpc-rtems6-beatnik/../../libmisc/main_ping.c:987:
undefined reference to `sigaction'
/home/vijay/development/rtems/6/lib/gcc/powerpc-rtems6/10.3.1/../../../../powerpc-rtems6/bin/ld:
/home/vijay/development/rtems-net-legacy/build/powerpc-rtems6-beatnik/../../libmisc/main_ping.c:1000:
undefined reference to `sigaction'
/home/vijay/development/rtems/6/lib/gcc/powerpc-rtems6/10.3.1/../../../../powerpc-rtems6/bin/ld:
./libnetworking.a(main_ping.c.3.o): in function `g_finish':
/home/vijay/development/rtems-net-legacy/build/powerpc-rtems6-beatnik/../../libmisc/main_ping.c:1620:
undefined reference to `signal'
/home/vijay/development/rtems/6/lib/gcc/powerpc-rtems6/10.3.1/../../../../powerpc-rtems6/bin/ld:
/home/vijay/development/rtems-net-legacy/build/powerpc-rtems6-beatnik/../../libmisc/main_ping.c:1621:
undefined reference to `signal'
collect2: error: ld returned 1 exit status

```


>


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

Re: [PATCH rtems-net-legacy] powerpc/beatnik: Add mv643xx_eth.c driver from RTEMS 5

2023-07-19 Thread Chris Johns
On 20/7/2023 10:18 am, Vijay Kumar Banerjee wrote:
> On Wed, Jul 19, 2023 at 6:39 PM Chris Johns  wrote:
>>
>> Excellent.
>>
>> Could you please update the hash in the RSB for the net legacy package?
>>
> Thanks for mentioning it! While trying to build from RSB, I realized
> two important changes I need from rtems build:
> 1. Removing networking check, put a patch for it just now:
> https://lists.rtems.org/pipermail/devel/2023-July/075830.html

I saw that.

> 2. Building the ping and telnetd02 requires posix. For this, should be
> conditionally build these two tests only when RTEMS_POSIX_API is true?

Which part of POSIX is needed? I ask because I think the POSIX option is only
controlling signals and maybe something else, I cannot remember what the list
is. What happens if you remove the check?

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

[PATCH rtems-net-legacy] powerpc/beatnik: Add mv643xx_eth.c driver from RTEMS 5

2023-07-18 Thread Vijay Kumar Banerjee
---
 bsp_drivers.py|2 +
 bsps/powerpc/beatnik/net/if_mve/mv643xx_eth.c | 3318 +
 2 files changed, 3320 insertions(+)
 create mode 100644 bsps/powerpc/beatnik/net/if_mve/mv643xx_eth.c

diff --git a/bsp_drivers.py b/bsp_drivers.py
index e2250aa..5628ff3 100644
--- a/bsp_drivers.py
+++ b/bsp_drivers.py
@@ -79,6 +79,7 @@ include = {
 'bsps/powerpc/beatnik/net',
 'bsps/powerpc/beatnik/net/if_em',
 'bsps/powerpc/beatnik/net/if_gfe',
+'bsps/powerpc/beatnik/net/if_mve',
 'bsps/powerpc/beatnik/net/porting',
 ],
 'powerpc/mpc8260ads': [
@@ -174,6 +175,7 @@ source = {
 'bsps/powerpc/beatnik/net/if_em/if_em_rtems.c',
 'bsps/powerpc/beatnik/net/if_gfe/if_gfe.c',
 'bsps/powerpc/beatnik/net/if_gfe/if_gfe_rtems.c',
+'bsps/powerpc/beatnik/net/if_mve/mv643xx_eth.c',
 'bsps/powerpc/beatnik/net/porting/if_xxx_rtems.c',
 'bsps/powerpc/beatnik/net/support/bsp_attach.c',
 'bsps/powerpc/beatnik/net/support/early_link_status.c',
diff --git a/bsps/powerpc/beatnik/net/if_mve/mv643xx_eth.c 
b/bsps/powerpc/beatnik/net/if_mve/mv643xx_eth.c
new file mode 100644
index 000..85ab038
--- /dev/null
+++ b/bsps/powerpc/beatnik/net/if_mve/mv643xx_eth.c
@@ -0,0 +1,3318 @@
+/* RTEMS driver for the mv643xx gigabit ethernet chip */
+
+/* Acknowledgement:
+ *
+ * Valuable information for developing this driver was obtained
+ * from the linux open-source driver mv643xx_eth.c which was written
+ * by the following people and organizations:
+ *
+ * Matthew Dharm 
+ * rab...@galileo.co.il
+ * PMC-Sierra, Inc., Manish Lachwani
+ * Ralf Baechle 
+ * MontaVista Software, Inc., Dale Farnsworth 
+ * Steven J. Hill /
+ *
+ * Note however, that in spite of the identical name of this file
+ * (and some of the symbols used herein) this file provides a
+ * new implementation and is the original work by the author.
+ */
+
+/* 
+ * Authorship
+ * --
+ * This software (mv643xx ethernet driver for RTEMS) was
+ * created by Till Straumann , 2005-2007,
+ *Stanford Linear Accelerator Center, Stanford University.
+ * 
+ * Acknowledgement of sponsorship
+ * --
+ * The 'mv643xx ethernet driver for RTEMS' was produced by
+ * the Stanford Linear Accelerator Center, Stanford University,
+ *under Contract DE-AC03-76SFO0515 with the Department of Energy.
+ * 
+ * Government disclaimer of liability
+ * --
+ * Neither the United States nor the United States Department of Energy,
+ * nor any of their employees, makes any warranty, express or implied, or
+ * assumes any legal liability or responsibility for the accuracy,
+ * completeness, or usefulness of any data, apparatus, product, or process
+ * disclosed, or represents that its use would not infringe privately owned
+ * rights.
+ * 
+ * Stanford disclaimer of liability
+ * 
+ * Stanford University makes no representations or warranties, express or
+ * implied, nor assumes any liability for the use of this software.
+ * 
+ * Stanford disclaimer of copyright
+ * 
+ * Stanford University, owner of the copyright, hereby disclaims its
+ * copyright and all other rights in this software.  Hence, anyone may
+ * freely use it for any purpose without restriction.  
+ * 
+ * Maintenance of notices
+ * --
+ * In the interest of clarity regarding the origin and status of this
+ * SLAC software, this and all the preceding Stanford University notices
+ * are to remain affixed to any copy or derivative of this software made
+ * or distributed by the recipient and are to be affixed to any copy of
+ * software made or distributed by the recipient that contains a copy or
+ * derivative of this software.
+ * 
+ * -- SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
+ */ 
+
+/*
+ * NOTE: Some register (e.g., the SMI register) are SHARED among the
+ *   three devices. Concurrent access protection is provided by
+ *   the global networking semaphore.
+ *   If other drivers are running on a subset of IFs then proper
+ *   locking of all shared registers must be implemented!
+ *
+ *   Some things I learned about this hardware can be found
+ *   further down...
+ */
+
+#ifndef KERNEL
+#define KERNEL
+#endif
+#ifndef _KERNEL
+#define _KERNEL
+#endif
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Not so nice; would be more elegant not to depend on C library but the
+ * RTEMS-specific ioctl for dumping statistics needs stdio anyways.
+ */
+
+/*#define NDEBUG effectively removes all assertions
+ * If defining NDEBUG, MAKE SURE assert() EXPRESSION HAVE NO SIDE_EFFECTS!!
+ * This driver DOES have side-effects, so DONT DEFINE NDEBUG
+ * Performance-critical assertions are