Re: [PATCH v3 1/7] Imported files for driver: bcm283x_dwcotg

2016-09-04 Thread Deval Shah
On Fri, Sep 2, 2016 at 1:38 PM, Pavel Pisa <ppisa4li...@pikron.com> wrote:

> Hello Deval,
>
> I cannot comment much libbsd changes because I have little
> experience there, but I am curious if you have some results
> from testing on real hardware.
>
> Is USB bus correctly enumerated?
> Is ETHERNET chip found?
>

Yes to these two questions. I am attaching a boot-log of "init01" test,
tested on Raspberry Pi 1/B+.
It is detecting all the USB devices and shows the name of them in the boot
log. Also you can see it also fetches MAC address of the ethernet device.

Can you send ping or other communication works?
>
>
There is a little issue here. USB and other BSD initializations run through
separate threads. And BSD initializes first and then USB in this case. So
the examples here will give you errors as they won't be able to get any
interface.
https://lists.rtems.org/pipermail/devel/2016-August/015756.html
Me and Alan are trying to figure out a way to modify the testsuits and make
them event triggered.

If all is yes, what is throughput measured by ping flood
> for exmaple
>
>   ping -f -s 1400 -q 192.168.x.x
>
> and then on TCP layer.
>
> Have you documented the last state and instructions
> to reproduce the work. By the way, have you tested
> on RPi1 or Rpi2.
>
>
I haven't completed documenting. I am moving out currently. So as soon as I
get time I will finish that and edit the wiki page of my project. Mostly
after a couple of weeks I will be able to start contributing again. My
apologis for that.

Hardware used here is RPi 1/B+.

Best wishes,
>
>   Pavel
>
> PS: I have managed to start the second core on RPi2
> by RTEMS SMP support. But then the systems freezes.
> So there are some IPI or other problems.
>
>
Deval Shah

-- 
Deval Shah
Graduate Student,
B.E. (Hons.) Electrical and Electronics Engineering
BITS Pilani Hyderabad Campus <http://www.bits-pilani.ac.in/hyderabad/>

Github Profile <https://github.com/deval-maker>
ᐧ
ᐧ


init1_boot_log
Description: Binary data
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH v3 7/7] USB and ethernet controller: Update to FreeBSD trunk 2016-08-23 FreeBSD trunk, 2016-08-23, 9fe7c416e6abb28b1398fd3e5687099846800cfd.

2016-08-31 Thread Deval Shah
---
 freebsd/sys/dev/usb/net/usb_ethernet.c | 6 +-
 libbsd.txt | 6 +++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/freebsd/sys/dev/usb/net/usb_ethernet.c 
b/freebsd/sys/dev/usb/net/usb_ethernet.c
index de923e9..6497385 100644
--- a/freebsd/sys/dev/usb/net/usb_ethernet.c
+++ b/freebsd/sys/dev/usb/net/usb_ethernet.c
@@ -655,5 +655,9 @@ uether_rxflush(struct usb_ether *ue)
}
 }
 
-DECLARE_MODULE(uether, uether_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
+/*
+ * USB net drivers are run by DRIVER_MODULE() thus SI_SUB_DRIVERS,
+ * SI_ORDER_MIDDLE.  Run uether after that.
+ */
+DECLARE_MODULE(uether, uether_mod, SI_SUB_DRIVERS, SI_ORDER_ANY);
 MODULE_VERSION(uether, 1);
diff --git a/libbsd.txt b/libbsd.txt
index 121acfa..fc3fa5e 100644
--- a/libbsd.txt
+++ b/libbsd.txt
@@ -768,9 +768,9 @@ detail and debug level information from the command.
 . sys/dev/dwc/*, trunk, 2015-03-26, cfc3df2b8f708ce8494d9d556e3472a5c8c21b8a
 . sys/dev/usb/*, trunk, 2015-10-30, 968dafb4fcf133cb8beb6fa3c558fecd7dc00ef0
 . *, stable/9, 2015-04-08, 99a648a912e81e29d9c4c159cbbe263462f2d719
-. sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c, trunk, 2016-05-26, 
a7019c8505c0592f2e80ac63be139075d8977c4e
-. sys/dev/usb/controller/dwc_otg_fdt.*, trunk, 2016-05-26, 
a7019c8505c0592f2e80ac63be139075d8977c4e
-. sys/dev/usb/net/*, trunk, 2016-05-26, 
a7019c8505c0592f2e80ac63be139075d8977c4e
+. sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c, trunk, 2016-08-23, 
9fe7c416e6abb28b1398fd3e5687099846800cfd
+. sys/dev/usb/controller/dwc_otg_fdt.*, trunk, 2016-08-23, 
9fe7c416e6abb28b1398fd3e5687099846800cfd
+. sys/dev/usb/net/*, trunk, 2016-08-23, 
9fe7c416e6abb28b1398fd3e5687099846800cfd
 
 == How to import code from FreeBSD
 
-- 
2.7.4

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


[PATCH v3 4/7] Imported files for driver usb_ethernet for Raspberry Pi.

2016-08-31 Thread Deval Shah
---
 freebsd/sys/dev/usb/net/if_smsc.c  | 1863 
 freebsd/sys/dev/usb/net/if_smscreg.h   |  277 +
 freebsd/sys/dev/usb/net/usb_ethernet.c |  647 +++
 freebsd/sys/dev/usb/net/usb_ethernet.h |  127 +++
 libbsd.py  |8 +-
 libbsd.txt |1 +
 libbsd_waf.py  |2 +
 7 files changed, 2922 insertions(+), 3 deletions(-)
 create mode 100644 freebsd/sys/dev/usb/net/if_smsc.c
 create mode 100644 freebsd/sys/dev/usb/net/if_smscreg.h
 create mode 100644 freebsd/sys/dev/usb/net/usb_ethernet.c
 create mode 100644 freebsd/sys/dev/usb/net/usb_ethernet.h

diff --git a/freebsd/sys/dev/usb/net/if_smsc.c 
b/freebsd/sys/dev/usb/net/if_smsc.c
new file mode 100644
index 000..3bdd35a
--- /dev/null
+++ b/freebsd/sys/dev/usb/net/if_smsc.c
@@ -0,0 +1,1863 @@
+#include 
+
+/*-
+ * Copyright (c) 2012
+ * Ben Gray .
+ * All rights reserved.
+ *
+ * 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 AUTHOR ``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 AUTHOR 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$");
+
+/*
+ * SMSC LAN9xxx devices (http://www.smsc.com/)
+ * 
+ * The LAN9500 & LAN9500A devices are stand-alone USB to Ethernet chips that
+ * support USB 2.0 and 10/100 Mbps Ethernet.
+ *
+ * The LAN951x devices are an integrated USB hub and USB to Ethernet adapter.
+ * The driver only covers the Ethernet part, the standard USB hub driver
+ * supports the hub part.
+ *
+ * This driver is closely modelled on the Linux driver written and copyrighted
+ * by SMSC.
+ *
+ *
+ *
+ *
+ * H/W TCP & UDP Checksum Offloading
+ * -
+ * The chip supports both tx and rx offloading of UDP & TCP checksums, this
+ * feature can be dynamically enabled/disabled.  
+ *
+ * RX checksuming is performed across bytes after the IPv4 header to the end of
+ * the Ethernet frame, this means if the frame is padded with non-zero values
+ * the H/W checksum will be incorrect, however the rx code compensates for 
this.
+ *
+ * TX checksuming is more complicated, the device requires a special header to
+ * be prefixed onto the start of the frame which indicates the start and end
+ * positions of the UDP or TCP frame.  This requires the driver to manually
+ * go through the packet data and decode the headers prior to sending.
+ * On Linux they generally provide cues to the location of the csum and the
+ * area to calculate it over, on FreeBSD we seem to have to do it all 
ourselves,
+ * hence this is not as optimal and therefore h/w tX checksum is currently not
+ * implemented.
+ *
+ */
+#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 
+
+#ifdef FDT
+#include 
+#include 
+#include 
+#endif
+
+#include 
+#include 
+#include 
+#include 
+
+#defineUSB_DEBUG_VAR smsc_debug
+#include 
+#include 
+
+#include 
+
+#include 
+
+#ifdef USB_DEBUG
+static int smsc_debug = 0;
+
+SYSCTL_NODE(_hw_usb, OID_AUTO, smsc, CTLFLAG_RW, 0, "USB smsc");
+SYSCTL_INT(_hw_usb_smsc, OID_AUTO, debug, CTLFLAG_RWTUN, _debug, 0,
+"Debug level");
+#endif
+
+/*
+ * Various supported device vendors/products.
+ */
+static const struct usb_device_id smsc_devs[] = {
+#defineSMSC_DEV(p,i) { USB_VPI(USB_VENDOR_SMC2, USB_PRODUCT_SMC2_##p, 
i) }
+   SMSC_DEV(LAN89530_ETH, 0),
+   SMSC_DEV(LAN9500_ETH, 0),
+   SMSC_DEV(LAN9500_ETH_2, 0),
+   SMSC_DEV(LAN9500A_ETH, 0),
+   SMSC_DEV(LAN9500A_ETH_2, 0),
+   SMSC_DEV(LAN9505_ETH, 0),
+   SMSC_DEV(LAN9505A_ETH, 0),
+   SMSC_DEV(LAN9514_ETH, 0),
+   SMSC_DEV(LAN9514_ETH_2, 

[PATCH v3 6/7] Added Ethernet support for Raspberry Pi.

2016-08-31 Thread Deval Shah
---
 rtemsbsd/include/bsp/nexus-devices.h | 2 ++
 testsuite/include/rtems/bsd/test/network-config.h.in | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/rtemsbsd/include/bsp/nexus-devices.h 
b/rtemsbsd/include/bsp/nexus-devices.h
index ce9d45c..7ba3541 100644
--- a/rtemsbsd/include/bsp/nexus-devices.h
+++ b/rtemsbsd/include/bsp/nexus-devices.h
@@ -90,6 +90,8 @@ RTEMS_BSD_DRIVER_BCM283X_DWCOTG(BCM2835_USB_BASE,
BCM2835_IRQ_ID_USB);
 RTEMS_BSD_DRIVER_USB;
 RTEMS_BSD_DRIVER_USB_MASS;
+RTEMS_BSD_DRIVER_SMSC;
+RTEMS_BSD_DRIVER_UKPHY;
 
 #elif defined(LIBBSP_POWERPC_QORIQ_BSP_H)
 
diff --git a/testsuite/include/rtems/bsd/test/network-config.h.in 
b/testsuite/include/rtems/bsd/test/network-config.h.in
index 34c48b4..d74248d 100644
--- a/testsuite/include/rtems/bsd/test/network-config.h.in
+++ b/testsuite/include/rtems/bsd/test/network-config.h.in
@@ -42,6 +42,8 @@
   #define NET_CFG_INTERFACE_0 "cgem0"
 #elif defined(LIBBSP_M68K_GENMCF548X_BSP_H)
   #define NET_CFG_INTERFACE_0 "fec0"
+#elif defined(LIBBSP_ARM_RASPBERRYPI_BSP_H)
+  #define NET_CFG_INTERFACE_0 "ue0"
 #else
   #define NET_CFG_INTERFACE_0 "lo0"
 #endif
-- 
2.7.4

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


[PATCH v3 1/7] Imported files for driver: bcm283x_dwcotg

2016-08-31 Thread Deval Shah
---
 freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c | 100 ++
 freebsd/sys/dev/usb/controller/dwc_otg_fdt.c   | 222 +
 freebsd/sys/dev/usb/controller/dwc_otg_fdt.h   |  39 
 libbsd.py  |   3 +
 libbsd.txt |   2 +
 libbsd_waf.py  |   4 +-
 6 files changed, 369 insertions(+), 1 deletion(-)
 create mode 100644 freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
 create mode 100644 freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
 create mode 100644 freebsd/sys/dev/usb/controller/dwc_otg_fdt.h

diff --git a/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c 
b/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
new file mode 100644
index 000..1ab4d08
--- /dev/null
+++ b/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
@@ -0,0 +1,100 @@
+#include 
+
+/*
+ * Copyright 2015 Andrew Turner.
+ * All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+static device_probe_t bcm283x_dwc_otg_probe;
+static device_attach_t bcm283x_dwc_otg_attach;
+
+static int
+bcm283x_dwc_otg_probe(device_t dev)
+{
+
+   if (!ofw_bus_status_okay(dev))
+   return (ENXIO);
+
+   if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-usb"))
+   return (ENXIO);
+
+   device_set_desc(dev, "DWC OTG 2.0 integrated USB controller (bcm283x)");
+
+   return (BUS_PROBE_VENDOR);
+}
+
+static int
+bcm283x_dwc_otg_attach(device_t dev)
+{
+   int err;
+
+   err = bcm2835_mbox_set_power_state(BCM2835_MBOX_POWER_ID_USB_HCD, TRUE);
+   if (err)
+   device_printf(dev, "failed to set power state, err=%d\n", err);
+
+   return (dwc_otg_attach(dev));
+}
+
+static device_method_t bcm283x_dwc_otg_methods[] = {
+   /* bus interface */
+   DEVMETHOD(device_probe, bcm283x_dwc_otg_probe),
+   DEVMETHOD(device_attach, bcm283x_dwc_otg_attach),
+
+   DEVMETHOD_END
+};
+
+static devclass_t bcm283x_dwc_otg_devclass;
+
+DEFINE_CLASS_1(bcm283x_dwcotg, bcm283x_dwc_otg_driver, bcm283x_dwc_otg_methods,
+sizeof(struct dwc_otg_fdt_softc), dwc_otg_driver);
+DRIVER_MODULE(bcm283x_dwcotg, simplebus, bcm283x_dwc_otg_driver,
+bcm283x_dwc_otg_devclass, 0, 0);
+MODULE_DEPEND(bcm283x_dwcotg, usb, 1, 1, 1);
diff --git a/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c 
b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
new file mode 100644
index 000..2b7a715
--- /dev/null
+++ b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
@@ -0,0 +1,222 @@
+#include 
+
+/*-
+ * Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, 

[PATCH v3 3/7] Added USB roothub support for Raspberry Pi.

2016-08-31 Thread Deval Shah
---
 rtemsbsd/include/bsp/nexus-devices.h | 9 +
 testsuite/usb01/usb-sysinit.h| 2 ++
 2 files changed, 11 insertions(+)

diff --git a/rtemsbsd/include/bsp/nexus-devices.h 
b/rtemsbsd/include/bsp/nexus-devices.h
index 45beb30..ce9d45c 100644
--- a/rtemsbsd/include/bsp/nexus-devices.h
+++ b/rtemsbsd/include/bsp/nexus-devices.h
@@ -82,6 +82,15 @@ RTEMS_BSD_DRIVER_PCI_EM;
 RTEMS_BSD_DRIVER_PCI_RE;
 RTEMS_BSD_DRIVER_REPHY;
 
+#elif defined(LIBBSP_ARM_RASPBERRYPI_BSP_H)
+
+#include 
+
+RTEMS_BSD_DRIVER_BCM283X_DWCOTG(BCM2835_USB_BASE, 
+   BCM2835_IRQ_ID_USB);
+RTEMS_BSD_DRIVER_USB;
+RTEMS_BSD_DRIVER_USB_MASS;
+
 #elif defined(LIBBSP_POWERPC_QORIQ_BSP_H)
 
 #if !QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
diff --git a/testsuite/usb01/usb-sysinit.h b/testsuite/usb01/usb-sysinit.h
index c22bcf2..a26dc53 100644
--- a/testsuite/usb01/usb-sysinit.h
+++ b/testsuite/usb01/usb-sysinit.h
@@ -30,6 +30,8 @@
#define NEED_USB_OHCI
 #elif defined(__GEN83xx_BSP_h) || defined(LIBBSP_POWERPC_QORIQ_BSP_H)
#define NEED_USB_EHCI
+#elif defined(LIBBSP_ARM_RASPBERRYPI_BSP_H)
+   #define NEED_USB_OTG
 #endif
 
 SYSINIT_NEED_USB_CORE;
-- 
2.7.4

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


Re: [PATCH v2 1/6] Imported files for driver: bcm283x_dwcotg

2016-08-31 Thread Deval Shah
Okay. Understood. I will update and prepare a patch.
ᐧ

On Mon, Aug 29, 2016 at 12:26 PM, Christian Mauderer <
christian.maude...@embedded-brains.de> wrote:

> Am 27.08.2016 um 13:16 schrieb Deval Shah:
> >
> >
> > On Tue, Aug 23, 2016 at 7:08 PM, Sebastian Huber
> > <sebastian.hu...@embedded-brains.de
> > <mailto:sebastian.hu...@embedded-brains.de>> wrote:
> >
> > I updated the MMC support to use the FreeBSD trunk, 2016-08-23,
> > 9fe7c416e6abb28b1398fd3e5687099846800cfd. It would be great if you
> > can use this version as well as a baseline for your work.
> >
> >
> > Is it okay if I provide a new patch (not resend in the previous ones)
> > updating the code ?
> >
> >
> > On 22/08/16 10:37, Deval Shah wrote:
> >
> >
> >
> > On Mon, Aug 22, 2016 at 11:25 AM, Sebastian Huber
> > <sebastian.hu...@embedded-brains.de
> > <mailto:sebastian.hu...@embedded-brains.de>
> > <mailto:sebastian.hu...@embedded-brains.de
> > <mailto:sebastian.hu...@embedded-brains.de>>> wrote:
> > [...]
> >
> > If you think the guidelines could be more clear, need an
> > explanation or examples, then we should address this first.
> >
> >
> > I could use some examples on the last rule " Do not disable
> > option header includes via guards.  Instead, add an empty option
> > header, e.g. `rtemsbsd/include/rtems/bsd/local/opt_xyz.h`.  In
> > general, provide empty header files and do not guard includes. "
> >
> >
> > Ok, I updated the libbsd.txt.
> >
> > I have a small doubt
> > here. https://git.rtems.org/rtems-libbsd/tree/libbsd.txt#n654
> >
> > Do I have to provide all the headers which I want to ignore, with an
> > empty file as mentioned or only the ones which are transformed by the
> > import script ?
> >
> > For example includes like these.  "#include "
> >
>
> Hello Deval,
>
> Sebastian is currently on vacation so he might need some time to answer.
> I'll try to give some hints but I'm far from being as familiar with
> libbsd as Sebastian is, so he (or some others) might have another opinion.
>
> Regarding the header: Currently mainly the option headers are empty. If
> you do a
>
>find -size 0 -name "*.h"
>
> (or some other search for empty files) in the libbsd directory, the
> empty headers are option headers and some machine dependent files.
>
> So if you ask me, it should be OK to disable the mentioned
> ofw_bus_subr.h especially because you disabled ofw in the whole file.
>
> On the other hand an option header that you should add as an empty file
> would be opt_platform.h in your patch 5/6.
>
> Kind regards
>
> Christian
> --
> 
> embedded brains GmbH
> Christian Mauderer
> Dornierstr. 4
> D-82178 Puchheim
> Germany
> email: christian.maude...@embedded-brains.de
> Phone: +49-89-18 94 741 - 18
> Fax:   +49-89-18 94 741 - 08
> PGP: Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>



-- 
Deval Shah
Graduate Student,
B.E. (Hons.) Electrical and Electronics Engineering
BITS Pilani Hyderabad Campus <http://www.bits-pilani.ac.in/hyderabad/>

Github Profile <https://github.com/deval-maker>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH v2 1/6] Imported files for driver: bcm283x_dwcotg

2016-08-27 Thread Deval Shah
On Tue, Aug 23, 2016 at 7:08 PM, Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> I updated the MMC support to use the FreeBSD trunk, 2016-08-23,
> 9fe7c416e6abb28b1398fd3e5687099846800cfd. It would be great if you can
> use this version as well as a baseline for your work.
>
>
Is it okay if I provide a new patch (not resend in the previous ones)
updating the code ?


> On 22/08/16 10:37, Deval Shah wrote:
>
>>
>>
>> On Mon, Aug 22, 2016 at 11:25 AM, Sebastian Huber <
>> sebastian.hu...@embedded-brains.de <mailto:sebastian.huber@embedd
>> ed-brains.de>> wrote:
>> [...]
>>
>> If you think the guidelines could be more clear, need an
>> explanation or examples, then we should address this first.
>>
>>
>> I could use some examples on the last rule " Do not disable option header
>> includes via guards.  Instead, add an empty option header, e.g.
>> `rtemsbsd/include/rtems/bsd/local/opt_xyz.h`.  In general, provide empty
>> header files and do not guard includes. "
>>
>
> Ok, I updated the libbsd.txt.
>
> I have a small doubt here.
https://git.rtems.org/rtems-libbsd/tree/libbsd.txt#n654

Do I have to provide all the headers which I want to ignore, with an empty
file as mentioned or only the ones which are transformed by the import
script ?

For example includes like these.  "#include "

>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail  : sebastian.hu...@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
>


-- 
Deval Shah
Graduate Student,
B.E. (Hons.) Electrical and Electronics Engineering
BITS Pilani Hyderabad Campus <http://www.bits-pilani.ac.in/hyderabad/>

Github Profile <https://github.com/deval-maker>
ᐧ
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH v2 1/6] Imported files for driver: bcm283x_dwcotg

2016-08-22 Thread Deval Shah
On Mon, Aug 22, 2016 at 11:25 AM, Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> Sorry, for being so pedantic, but it will be probably me who updates the
> libbsd with about 800 files to next FreeBSD versions. Please go through
> your complete patch series again and fix all places that don't follow the
> guidelines and my mail comments. It looks better now, but there are still
> some spots left.
>

I totally understand. I would work on the patches till they become perfect
and mergable to the master. Its just that I could not find the mistakes.
Maybe I am still getting trained for finding them. You can always point
that out to me and I would definately correct them. At the end pushing the
clean, understandable and usable code is my goal, too.


> If you think the guidelines could be more clear, need an explanation or
> examples, then we should address this first.


I could use some examples on the last rule " Do not disable option header
includes via guards.  Instead, add an empty option header, e.g.
`rtemsbsd/include/rtems/bsd/local/opt_xyz.h`.  In general, provide empty
header files and do not guard includes. "


>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail  : sebastian.hu...@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
>


-- 
Deval Shah
Graduate Student,
B.E. (Hons.) Electrical and Electronics Engineering
BITS Pilani Hyderabad Campus <http://www.bits-pilani.ac.in/hyderabad/>

Github Profile <https://github.com/deval-maker>
ᐧ
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH v2 6/6] Added Ethernet support for Raspberry Pi.

2016-08-19 Thread Deval Shah
---
 rtemsbsd/include/bsp/nexus-devices.h | 2 ++
 testsuite/include/rtems/bsd/test/network-config.h.in | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/rtemsbsd/include/bsp/nexus-devices.h 
b/rtemsbsd/include/bsp/nexus-devices.h
index ce9d45c..7ba3541 100644
--- a/rtemsbsd/include/bsp/nexus-devices.h
+++ b/rtemsbsd/include/bsp/nexus-devices.h
@@ -90,6 +90,8 @@ RTEMS_BSD_DRIVER_BCM283X_DWCOTG(BCM2835_USB_BASE,
BCM2835_IRQ_ID_USB);
 RTEMS_BSD_DRIVER_USB;
 RTEMS_BSD_DRIVER_USB_MASS;
+RTEMS_BSD_DRIVER_SMSC;
+RTEMS_BSD_DRIVER_UKPHY;
 
 #elif defined(LIBBSP_POWERPC_QORIQ_BSP_H)
 
diff --git a/testsuite/include/rtems/bsd/test/network-config.h.in 
b/testsuite/include/rtems/bsd/test/network-config.h.in
index 34c48b4..d74248d 100644
--- a/testsuite/include/rtems/bsd/test/network-config.h.in
+++ b/testsuite/include/rtems/bsd/test/network-config.h.in
@@ -42,6 +42,8 @@
   #define NET_CFG_INTERFACE_0 "cgem0"
 #elif defined(LIBBSP_M68K_GENMCF548X_BSP_H)
   #define NET_CFG_INTERFACE_0 "fec0"
+#elif defined(LIBBSP_ARM_RASPBERRYPI_BSP_H)
+  #define NET_CFG_INTERFACE_0 "ue0"
 #else
   #define NET_CFG_INTERFACE_0 "lo0"
 #endif
-- 
2.7.4

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


[PATCH v2 5/6] Ported driver usb_ethernet(smsc) to RTEMS. USB DMA related functions commented out, since DMA support for raspberry is underdevelopment.

2016-08-19 Thread Deval Shah
---
 freebsd/sys/dev/usb/net/if_smsc.c  | 34 ++
 freebsd/sys/dev/usb/net/if_smscreg.h   |  1 +
 freebsd/sys/dev/usb/net/usb_ethernet.c | 12 +
 freebsd/sys/sys/sysctl.h   |  1 +
 rtemsbsd/include/machine/rtems-bsd-nexus-bus.h | 18 ++
 5 files changed, 66 insertions(+)

diff --git a/freebsd/sys/dev/usb/net/if_smsc.c 
b/freebsd/sys/dev/usb/net/if_smsc.c
index 3bdd35a..a55d4e7 100644
--- a/freebsd/sys/dev/usb/net/if_smsc.c
+++ b/freebsd/sys/dev/usb/net/if_smsc.c
@@ -91,7 +91,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifndef __rtems__
 #include 
+#endif /* __rtems__ */
 
 #ifdef FDT
 #include 
@@ -996,7 +998,9 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_error_t 
error)
/* The frame header is always aligned on a 4 byte 
boundary */
off = ((off + 0x3) & ~0x3);
 
+#ifndef __rtems__
usbd_copy_out(pc, off, , sizeof(rxhdr));
+#endif /* __rtems__ */
off += (sizeof(rxhdr) + ETHER_ALIGN);
rxhdr = le32toh(rxhdr);

@@ -1008,9 +1012,17 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, 
usb_error_t error)

if (rxhdr & SMSC_RX_STAT_ERROR) {
smsc_dbg_printf(sc, "rx error (hdr 0x%08x)\n", 
rxhdr);
+#ifndef __rtems__
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
+#else /* __rtems__ */
+   ifp->if_ierrors++;
+#endif /* __rtems__ */
if (rxhdr & SMSC_RX_STAT_COLLISION)
+#ifndef __rtems__
if_inc_counter(ifp, 
IFCOUNTER_COLLISIONS, 1);
+#else /* __rtems__ */
+   sc->ifp->if_collisions += 1;
+#endif /* __rtems__ */
} else {
 
/* Check if the ethernet frame is too big or 
too small */
@@ -1021,12 +1033,18 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, 
usb_error_t error)
m = uether_newbuf();
if (m == NULL) {
smsc_warn_printf(sc, "failed to create 
new mbuf\n");
+#ifndef __rtems__
if_inc_counter(ifp, IFCOUNTER_IQDROPS, 
1);
+#else /* __rtems__ */
+   ifp->if_iqdrops++;
+#endif /* __rtems__ */
goto tr_setup;
}
+#ifndef __rtems__

usbd_copy_out(pc, off, mtod(m, uint8_t *), 
pktlen);
 
+#endif /* __rtems__ */
/* Check if RX TCP/UDP checksumming is being 
offloaded */
if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) {
 
@@ -1061,9 +1079,11 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, 
usb_error_t error)
/* Copy the TCP/UDP 
checksum from the last 2 bytes
 * of the transfer and 
put in the csum_data field.
 */
+#ifndef __rtems__
usbd_copy_out(pc, (off 
+ pktlen),
  
>m_pkthdr.csum_data, 2);
 
+#endif /* __rtems__ */
/* The data is copied 
in network order, but the
 * csum algorithm in 
the kernel expects it to be
 * in host network 
order.
@@ -1165,19 +1185,29 @@ tr_setup:
txhdr = SMSC_TX_CTRL_0_BUF_SIZE(m->m_pkthdr.len) | 
SMSC_TX_CTRL_0_FIRST_SEG | 
SMSC_TX_CTRL_0_LAST_SEG;
txhdr = htole32(txhdr);
+#ifndef __rtems__
usbd_copy_in(pc, 0, , sizeof(txhdr));

+#endif /* __rtems__ */
txhdr = SMSC_TX_CTRL_1_PKT_LENGTH(m->m_pkthdr.len);
txhdr = htole32(txhdr);
+#ifndef __rtems__
usbd_copy_in(pc, 4, , sizeof(txhdr));

+#endif /* __rtems__ */
frm_len += 8;
 
/* Next copy in the actual packet */
+#ifndef __rtems__
usbd_m_copy_in(pc, frm_len, m, 0, m->m_pkthdr.len);
+#endif /* __rtems__ */
frm_len += m->m_pkthdr.len;
 
+#ifndef __rtems__
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
+#else /* __rtems__ */
+   sc->ifp->if_opackets++;
+#endif /* __rtems__ */
 
/* If there's a BPF listener, bounce a 

[PATCH v2 1/6] Imported files for driver: bcm283x_dwcotg

2016-08-19 Thread Deval Shah
---
 freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c | 100 ++
 freebsd/sys/dev/usb/controller/dwc_otg_fdt.c   | 222 +
 freebsd/sys/dev/usb/controller/dwc_otg_fdt.h   |  39 
 libbsd.py  |   3 +
 libbsd.txt |   2 +
 libbsd_waf.py  |   4 +-
 6 files changed, 369 insertions(+), 1 deletion(-)
 create mode 100644 freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
 create mode 100644 freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
 create mode 100644 freebsd/sys/dev/usb/controller/dwc_otg_fdt.h

diff --git a/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c 
b/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
new file mode 100644
index 000..1ab4d08
--- /dev/null
+++ b/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
@@ -0,0 +1,100 @@
+#include 
+
+/*
+ * Copyright 2015 Andrew Turner.
+ * All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+static device_probe_t bcm283x_dwc_otg_probe;
+static device_attach_t bcm283x_dwc_otg_attach;
+
+static int
+bcm283x_dwc_otg_probe(device_t dev)
+{
+
+   if (!ofw_bus_status_okay(dev))
+   return (ENXIO);
+
+   if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-usb"))
+   return (ENXIO);
+
+   device_set_desc(dev, "DWC OTG 2.0 integrated USB controller (bcm283x)");
+
+   return (BUS_PROBE_VENDOR);
+}
+
+static int
+bcm283x_dwc_otg_attach(device_t dev)
+{
+   int err;
+
+   err = bcm2835_mbox_set_power_state(BCM2835_MBOX_POWER_ID_USB_HCD, TRUE);
+   if (err)
+   device_printf(dev, "failed to set power state, err=%d\n", err);
+
+   return (dwc_otg_attach(dev));
+}
+
+static device_method_t bcm283x_dwc_otg_methods[] = {
+   /* bus interface */
+   DEVMETHOD(device_probe, bcm283x_dwc_otg_probe),
+   DEVMETHOD(device_attach, bcm283x_dwc_otg_attach),
+
+   DEVMETHOD_END
+};
+
+static devclass_t bcm283x_dwc_otg_devclass;
+
+DEFINE_CLASS_1(bcm283x_dwcotg, bcm283x_dwc_otg_driver, bcm283x_dwc_otg_methods,
+sizeof(struct dwc_otg_fdt_softc), dwc_otg_driver);
+DRIVER_MODULE(bcm283x_dwcotg, simplebus, bcm283x_dwc_otg_driver,
+bcm283x_dwc_otg_devclass, 0, 0);
+MODULE_DEPEND(bcm283x_dwcotg, usb, 1, 1, 1);
diff --git a/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c 
b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
new file mode 100644
index 000..2b7a715
--- /dev/null
+++ b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
@@ -0,0 +1,222 @@
+#include 
+
+/*-
+ * Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, 

[PATCH v2 4/6] Imported files for driver usb_ethernet for Raspberry Pi.

2016-08-19 Thread Deval Shah
---
 freebsd/sys/dev/usb/net/if_smsc.c  | 1863 
 freebsd/sys/dev/usb/net/if_smscreg.h   |  277 +
 freebsd/sys/dev/usb/net/usb_ethernet.c |  647 +++
 freebsd/sys/dev/usb/net/usb_ethernet.h |  127 +++
 libbsd.py  |8 +-
 libbsd.txt |1 +
 libbsd_waf.py  |2 +
 7 files changed, 2922 insertions(+), 3 deletions(-)
 create mode 100644 freebsd/sys/dev/usb/net/if_smsc.c
 create mode 100644 freebsd/sys/dev/usb/net/if_smscreg.h
 create mode 100644 freebsd/sys/dev/usb/net/usb_ethernet.c
 create mode 100644 freebsd/sys/dev/usb/net/usb_ethernet.h

diff --git a/freebsd/sys/dev/usb/net/if_smsc.c 
b/freebsd/sys/dev/usb/net/if_smsc.c
new file mode 100644
index 000..3bdd35a
--- /dev/null
+++ b/freebsd/sys/dev/usb/net/if_smsc.c
@@ -0,0 +1,1863 @@
+#include 
+
+/*-
+ * Copyright (c) 2012
+ * Ben Gray .
+ * All rights reserved.
+ *
+ * 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 AUTHOR ``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 AUTHOR 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$");
+
+/*
+ * SMSC LAN9xxx devices (http://www.smsc.com/)
+ * 
+ * The LAN9500 & LAN9500A devices are stand-alone USB to Ethernet chips that
+ * support USB 2.0 and 10/100 Mbps Ethernet.
+ *
+ * The LAN951x devices are an integrated USB hub and USB to Ethernet adapter.
+ * The driver only covers the Ethernet part, the standard USB hub driver
+ * supports the hub part.
+ *
+ * This driver is closely modelled on the Linux driver written and copyrighted
+ * by SMSC.
+ *
+ *
+ *
+ *
+ * H/W TCP & UDP Checksum Offloading
+ * -
+ * The chip supports both tx and rx offloading of UDP & TCP checksums, this
+ * feature can be dynamically enabled/disabled.  
+ *
+ * RX checksuming is performed across bytes after the IPv4 header to the end of
+ * the Ethernet frame, this means if the frame is padded with non-zero values
+ * the H/W checksum will be incorrect, however the rx code compensates for 
this.
+ *
+ * TX checksuming is more complicated, the device requires a special header to
+ * be prefixed onto the start of the frame which indicates the start and end
+ * positions of the UDP or TCP frame.  This requires the driver to manually
+ * go through the packet data and decode the headers prior to sending.
+ * On Linux they generally provide cues to the location of the csum and the
+ * area to calculate it over, on FreeBSD we seem to have to do it all 
ourselves,
+ * hence this is not as optimal and therefore h/w tX checksum is currently not
+ * implemented.
+ *
+ */
+#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 
+
+#ifdef FDT
+#include 
+#include 
+#include 
+#endif
+
+#include 
+#include 
+#include 
+#include 
+
+#defineUSB_DEBUG_VAR smsc_debug
+#include 
+#include 
+
+#include 
+
+#include 
+
+#ifdef USB_DEBUG
+static int smsc_debug = 0;
+
+SYSCTL_NODE(_hw_usb, OID_AUTO, smsc, CTLFLAG_RW, 0, "USB smsc");
+SYSCTL_INT(_hw_usb_smsc, OID_AUTO, debug, CTLFLAG_RWTUN, _debug, 0,
+"Debug level");
+#endif
+
+/*
+ * Various supported device vendors/products.
+ */
+static const struct usb_device_id smsc_devs[] = {
+#defineSMSC_DEV(p,i) { USB_VPI(USB_VENDOR_SMC2, USB_PRODUCT_SMC2_##p, 
i) }
+   SMSC_DEV(LAN89530_ETH, 0),
+   SMSC_DEV(LAN9500_ETH, 0),
+   SMSC_DEV(LAN9500_ETH_2, 0),
+   SMSC_DEV(LAN9500A_ETH, 0),
+   SMSC_DEV(LAN9500A_ETH_2, 0),
+   SMSC_DEV(LAN9505_ETH, 0),
+   SMSC_DEV(LAN9505A_ETH, 0),
+   SMSC_DEV(LAN9514_ETH, 0),
+   SMSC_DEV(LAN9514_ETH_2, 

[PATCH v2 3/6] Added USB roothub support for Raspberry Pi.

2016-08-19 Thread Deval Shah
---
 rtemsbsd/include/bsp/nexus-devices.h | 9 +
 testsuite/usb01/usb-sysinit.h| 2 ++
 2 files changed, 11 insertions(+)

diff --git a/rtemsbsd/include/bsp/nexus-devices.h 
b/rtemsbsd/include/bsp/nexus-devices.h
index 45beb30..ce9d45c 100644
--- a/rtemsbsd/include/bsp/nexus-devices.h
+++ b/rtemsbsd/include/bsp/nexus-devices.h
@@ -82,6 +82,15 @@ RTEMS_BSD_DRIVER_PCI_EM;
 RTEMS_BSD_DRIVER_PCI_RE;
 RTEMS_BSD_DRIVER_REPHY;
 
+#elif defined(LIBBSP_ARM_RASPBERRYPI_BSP_H)
+
+#include 
+
+RTEMS_BSD_DRIVER_BCM283X_DWCOTG(BCM2835_USB_BASE, 
+   BCM2835_IRQ_ID_USB);
+RTEMS_BSD_DRIVER_USB;
+RTEMS_BSD_DRIVER_USB_MASS;
+
 #elif defined(LIBBSP_POWERPC_QORIQ_BSP_H)
 
 #if !QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
diff --git a/testsuite/usb01/usb-sysinit.h b/testsuite/usb01/usb-sysinit.h
index c22bcf2..a26dc53 100644
--- a/testsuite/usb01/usb-sysinit.h
+++ b/testsuite/usb01/usb-sysinit.h
@@ -30,6 +30,8 @@
#define NEED_USB_OHCI
 #elif defined(__GEN83xx_BSP_h) || defined(LIBBSP_POWERPC_QORIQ_BSP_H)
#define NEED_USB_EHCI
+#elif defined(LIBBSP_ARM_RASPBERRYPI_BSP_H)
+   #define NEED_USB_OTG
 #endif
 
 SYSINIT_NEED_USB_CORE;
-- 
2.7.4

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


[PATCH v2 2/6] Ported driver bcm283x_dwcotg to RTEMS.

2016-08-19 Thread Deval Shah
---
 freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c | 24 +
 freebsd/sys/dev/usb/controller/dwc_otg_fdt.c   | 10 
 libbsd.txt | 30 ++
 rtemsbsd/include/machine/rtems-bsd-nexus-bus.h | 22 
 rtemsbsd/include/machine/rtems-bsd-sysinit.h   |  3 +++
 testsuite/usb01/usb-sysinit.h  |  4 +++
 6 files changed, 93 insertions(+)

diff --git a/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c 
b/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
index 1ab4d08..de73b57 100644
--- a/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
+++ b/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
@@ -37,7 +37,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifndef __rtems__
 #include 
+#endif
 
 #include 
 #include 
@@ -51,7 +53,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifndef __rtems__
 #include 
+#else /* __rtems__ */
+#include 
+#include 
+#endif /* __rtems__ */
 
 static device_probe_t bcm283x_dwc_otg_probe;
 static device_attach_t bcm283x_dwc_otg_attach;
@@ -60,11 +67,13 @@ static int
 bcm283x_dwc_otg_probe(device_t dev)
 {
 
+#ifndef __rtems__
if (!ofw_bus_status_okay(dev))
return (ENXIO);
 
if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-usb"))
return (ENXIO);
+#endif /* __rtems__ */
 
device_set_desc(dev, "DWC OTG 2.0 integrated USB controller (bcm283x)");
 
@@ -76,9 +85,19 @@ bcm283x_dwc_otg_attach(device_t dev)
 {
int err;
 
+#ifndef __rtems__
err = bcm2835_mbox_set_power_state(BCM2835_MBOX_POWER_ID_USB_HCD, TRUE);
if (err)
device_printf(dev, "failed to set power state, err=%d\n", err);
+#else /* __rtems__ */
+   bcm2835_set_power_state_entries power_state_usb;
+   power_state_usb.dev_id = bcm2835_mailbox_power_udid_usb_hcd;
+   power_state_usb.state = BCM2835_MAILBOX_SET_POWER_STATE_REQ_ON;
+   err = bcm2835_mailbox_set_power_state(_state_usb);
+   if (err) 
+   device_printf(dev, "failed to set power state, err=%d\n", err);
+
+#endif /* __rtems__ */
 
return (dwc_otg_attach(dev));
 }
@@ -95,6 +114,11 @@ static devclass_t bcm283x_dwc_otg_devclass;
 
 DEFINE_CLASS_1(bcm283x_dwcotg, bcm283x_dwc_otg_driver, bcm283x_dwc_otg_methods,
 sizeof(struct dwc_otg_fdt_softc), dwc_otg_driver);
+#ifndef __rtems__
 DRIVER_MODULE(bcm283x_dwcotg, simplebus, bcm283x_dwc_otg_driver,
 bcm283x_dwc_otg_devclass, 0, 0);
+#else /* __rtems__ */
+DRIVER_MODULE(bcm283x_dwcotg, nexus, bcm283x_dwc_otg_driver,
+   bcm283x_dwc_otg_devclass, 0, 0);
+#endif /* __rtems__ */
 MODULE_DEPEND(bcm283x_dwcotg, usb, 1, 1, 1);
diff --git a/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c 
b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
index 2b7a715..81d5078 100644
--- a/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
+++ b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
@@ -39,9 +39,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifndef __rtems__
 #include 
 #include 
 #include 
+#endif /* __rtems__ */
 
 #include 
 #include 
@@ -64,11 +66,13 @@ static int
 dwc_otg_probe(device_t dev)
 {
 
+#ifndef __rtems__
if (!ofw_bus_status_okay(dev))
return (ENXIO);
 
if (!ofw_bus_is_compatible(dev, "synopsys,designware-hs-otg2"))
return (ENXIO);
+#endif /* __rtems__ */
 
device_set_desc(dev, "DWC OTG 2.0 integrated USB controller");
 
@@ -89,6 +93,7 @@ dwc_otg_attach(device_t dev)
sc->sc_otg.sc_bus.devices_max = DWC_OTG_MAX_DEVICES;
sc->sc_otg.sc_bus.dma_bits = 32;
 
+#ifndef __rtems__
/* get USB mode, if any */
if (OF_getprop(ofw_bus_get_node(dev), "dr_mode",
_mode, sizeof(usb_mode)) > 0) {
@@ -105,6 +110,7 @@ dwc_otg_attach(device_t dev)
usb_mode);
}
}
+#endif /* __rtems__ */
 
/* get all DMA memory */
if (usb_bus_mem_alloc_all(>sc_otg.sc_bus,
@@ -218,5 +224,9 @@ driver_t dwc_otg_driver = {
 
 static devclass_t dwc_otg_devclass;
 
+#ifndef __rtems__
 DRIVER_MODULE(dwcotg, simplebus, dwc_otg_driver, dwc_otg_devclass, 0, 0);
+#else /* __rtems__ */
+DRIVER_MODULE(dwcotg, nexus, dwc_otg_driver, dwc_otg_devclass, 0, 0);
+#endif /* __rtems__ */
 MODULE_DEPEND(dwcotg, usb, 1, 1, 1);
diff --git a/libbsd.txt b/libbsd.txt
index d18f77b..80566e1 100644
--- a/libbsd.txt
+++ b/libbsd.txt
@@ -625,6 +625,36 @@ include a `__rtems__` in the guards to make searches easy, 
so use
 * `#else /* __rtems__ */`, and
 * `#endif /* __rtems__ */`.
 
+The guards must start at the begin of the line.  Examples for wrong guards:
+
+---
+static void
+guards_must_start_at_the_begin_of_the_line(int j)
+{
+
+   #ifdef __rtems__
+   return (j + 1);
+   #else /* __rtems__ */
+   return (j + 2);
+   #endif /* __rtems__ */
+}
+
+static void

[PATCH v2 2/6] Ported driver bcm283x_dwcotg to RTEMS.

2016-08-19 Thread Deval Shah
---
 freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c | 24 +
 freebsd/sys/dev/usb/controller/dwc_otg_fdt.c   | 10 
 libbsd.txt | 30 ++
 rtemsbsd/include/machine/rtems-bsd-nexus-bus.h | 22 
 rtemsbsd/include/machine/rtems-bsd-sysinit.h   |  3 +++
 testsuite/usb01/usb-sysinit.h  |  4 +++
 6 files changed, 93 insertions(+)

diff --git a/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c 
b/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
index 1ab4d08..de73b57 100644
--- a/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
+++ b/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
@@ -37,7 +37,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifndef __rtems__
 #include 
+#endif
 
 #include 
 #include 
@@ -51,7 +53,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifndef __rtems__
 #include 
+#else /* __rtems__ */
+#include 
+#include 
+#endif /* __rtems__ */
 
 static device_probe_t bcm283x_dwc_otg_probe;
 static device_attach_t bcm283x_dwc_otg_attach;
@@ -60,11 +67,13 @@ static int
 bcm283x_dwc_otg_probe(device_t dev)
 {
 
+#ifndef __rtems__
if (!ofw_bus_status_okay(dev))
return (ENXIO);
 
if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-usb"))
return (ENXIO);
+#endif /* __rtems__ */
 
device_set_desc(dev, "DWC OTG 2.0 integrated USB controller (bcm283x)");
 
@@ -76,9 +85,19 @@ bcm283x_dwc_otg_attach(device_t dev)
 {
int err;
 
+#ifndef __rtems__
err = bcm2835_mbox_set_power_state(BCM2835_MBOX_POWER_ID_USB_HCD, TRUE);
if (err)
device_printf(dev, "failed to set power state, err=%d\n", err);
+#else /* __rtems__ */
+   bcm2835_set_power_state_entries power_state_usb;
+   power_state_usb.dev_id = bcm2835_mailbox_power_udid_usb_hcd;
+   power_state_usb.state = BCM2835_MAILBOX_SET_POWER_STATE_REQ_ON;
+   err = bcm2835_mailbox_set_power_state(_state_usb);
+   if (err) 
+   device_printf(dev, "failed to set power state, err=%d\n", err);
+
+#endif /* __rtems__ */
 
return (dwc_otg_attach(dev));
 }
@@ -95,6 +114,11 @@ static devclass_t bcm283x_dwc_otg_devclass;
 
 DEFINE_CLASS_1(bcm283x_dwcotg, bcm283x_dwc_otg_driver, bcm283x_dwc_otg_methods,
 sizeof(struct dwc_otg_fdt_softc), dwc_otg_driver);
+#ifndef __rtems__
 DRIVER_MODULE(bcm283x_dwcotg, simplebus, bcm283x_dwc_otg_driver,
 bcm283x_dwc_otg_devclass, 0, 0);
+#else /* __rtems__ */
+DRIVER_MODULE(bcm283x_dwcotg, nexus, bcm283x_dwc_otg_driver,
+   bcm283x_dwc_otg_devclass, 0, 0);
+#endif /* __rtems__ */
 MODULE_DEPEND(bcm283x_dwcotg, usb, 1, 1, 1);
diff --git a/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c 
b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
index 2b7a715..81d5078 100644
--- a/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
+++ b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
@@ -39,9 +39,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifndef __rtems__
 #include 
 #include 
 #include 
+#endif /* __rtems__ */
 
 #include 
 #include 
@@ -64,11 +66,13 @@ static int
 dwc_otg_probe(device_t dev)
 {
 
+#ifndef __rtems__
if (!ofw_bus_status_okay(dev))
return (ENXIO);
 
if (!ofw_bus_is_compatible(dev, "synopsys,designware-hs-otg2"))
return (ENXIO);
+#endif /* __rtems__ */
 
device_set_desc(dev, "DWC OTG 2.0 integrated USB controller");
 
@@ -89,6 +93,7 @@ dwc_otg_attach(device_t dev)
sc->sc_otg.sc_bus.devices_max = DWC_OTG_MAX_DEVICES;
sc->sc_otg.sc_bus.dma_bits = 32;
 
+#ifndef __rtems__
/* get USB mode, if any */
if (OF_getprop(ofw_bus_get_node(dev), "dr_mode",
_mode, sizeof(usb_mode)) > 0) {
@@ -105,6 +110,7 @@ dwc_otg_attach(device_t dev)
usb_mode);
}
}
+#endif /* __rtems__ */
 
/* get all DMA memory */
if (usb_bus_mem_alloc_all(>sc_otg.sc_bus,
@@ -218,5 +224,9 @@ driver_t dwc_otg_driver = {
 
 static devclass_t dwc_otg_devclass;
 
+#ifndef __rtems__
 DRIVER_MODULE(dwcotg, simplebus, dwc_otg_driver, dwc_otg_devclass, 0, 0);
+#else /* __rtems__ */
+DRIVER_MODULE(dwcotg, nexus, dwc_otg_driver, dwc_otg_devclass, 0, 0);
+#endif /* __rtems__ */
 MODULE_DEPEND(dwcotg, usb, 1, 1, 1);
diff --git a/libbsd.txt b/libbsd.txt
index d18f77b..80566e1 100644
--- a/libbsd.txt
+++ b/libbsd.txt
@@ -625,6 +625,36 @@ include a `__rtems__` in the guards to make searches easy, 
so use
 * `#else /* __rtems__ */`, and
 * `#endif /* __rtems__ */`.
 
+The guards must start at the begin of the line.  Examples for wrong guards:
+
+---
+static void
+guards_must_start_at_the_begin_of_the_line(int j)
+{
+
+   #ifdef __rtems__
+   return (j + 1);
+   #else /* __rtems__ */
+   return (j + 2);
+   #endif /* __rtems__ */
+}
+
+static void

[PATCH v2 1/6] Imported files for driver: bcm283x_dwcotg

2016-08-19 Thread Deval Shah
---
 freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c | 100 ++
 freebsd/sys/dev/usb/controller/dwc_otg_fdt.c   | 222 +
 freebsd/sys/dev/usb/controller/dwc_otg_fdt.h   |  39 
 libbsd.py  |   3 +
 libbsd.txt |   2 +
 libbsd_waf.py  |   4 +-
 6 files changed, 369 insertions(+), 1 deletion(-)
 create mode 100644 freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
 create mode 100644 freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
 create mode 100644 freebsd/sys/dev/usb/controller/dwc_otg_fdt.h

diff --git a/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c 
b/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
new file mode 100644
index 000..1ab4d08
--- /dev/null
+++ b/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
@@ -0,0 +1,100 @@
+#include 
+
+/*
+ * Copyright 2015 Andrew Turner.
+ * All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+static device_probe_t bcm283x_dwc_otg_probe;
+static device_attach_t bcm283x_dwc_otg_attach;
+
+static int
+bcm283x_dwc_otg_probe(device_t dev)
+{
+
+   if (!ofw_bus_status_okay(dev))
+   return (ENXIO);
+
+   if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-usb"))
+   return (ENXIO);
+
+   device_set_desc(dev, "DWC OTG 2.0 integrated USB controller (bcm283x)");
+
+   return (BUS_PROBE_VENDOR);
+}
+
+static int
+bcm283x_dwc_otg_attach(device_t dev)
+{
+   int err;
+
+   err = bcm2835_mbox_set_power_state(BCM2835_MBOX_POWER_ID_USB_HCD, TRUE);
+   if (err)
+   device_printf(dev, "failed to set power state, err=%d\n", err);
+
+   return (dwc_otg_attach(dev));
+}
+
+static device_method_t bcm283x_dwc_otg_methods[] = {
+   /* bus interface */
+   DEVMETHOD(device_probe, bcm283x_dwc_otg_probe),
+   DEVMETHOD(device_attach, bcm283x_dwc_otg_attach),
+
+   DEVMETHOD_END
+};
+
+static devclass_t bcm283x_dwc_otg_devclass;
+
+DEFINE_CLASS_1(bcm283x_dwcotg, bcm283x_dwc_otg_driver, bcm283x_dwc_otg_methods,
+sizeof(struct dwc_otg_fdt_softc), dwc_otg_driver);
+DRIVER_MODULE(bcm283x_dwcotg, simplebus, bcm283x_dwc_otg_driver,
+bcm283x_dwc_otg_devclass, 0, 0);
+MODULE_DEPEND(bcm283x_dwcotg, usb, 1, 1, 1);
diff --git a/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c 
b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
new file mode 100644
index 000..2b7a715
--- /dev/null
+++ b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
@@ -0,0 +1,222 @@
+#include 
+
+/*-
+ * Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, 

[PATCH v2 3/6] Added USB roothub support for Raspberry Pi.

2016-08-19 Thread Deval Shah
---
 rtemsbsd/include/bsp/nexus-devices.h | 9 +
 testsuite/usb01/usb-sysinit.h| 2 ++
 2 files changed, 11 insertions(+)

diff --git a/rtemsbsd/include/bsp/nexus-devices.h 
b/rtemsbsd/include/bsp/nexus-devices.h
index 45beb30..ce9d45c 100644
--- a/rtemsbsd/include/bsp/nexus-devices.h
+++ b/rtemsbsd/include/bsp/nexus-devices.h
@@ -82,6 +82,15 @@ RTEMS_BSD_DRIVER_PCI_EM;
 RTEMS_BSD_DRIVER_PCI_RE;
 RTEMS_BSD_DRIVER_REPHY;
 
+#elif defined(LIBBSP_ARM_RASPBERRYPI_BSP_H)
+
+#include 
+
+RTEMS_BSD_DRIVER_BCM283X_DWCOTG(BCM2835_USB_BASE, 
+   BCM2835_IRQ_ID_USB);
+RTEMS_BSD_DRIVER_USB;
+RTEMS_BSD_DRIVER_USB_MASS;
+
 #elif defined(LIBBSP_POWERPC_QORIQ_BSP_H)
 
 #if !QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
diff --git a/testsuite/usb01/usb-sysinit.h b/testsuite/usb01/usb-sysinit.h
index c22bcf2..a26dc53 100644
--- a/testsuite/usb01/usb-sysinit.h
+++ b/testsuite/usb01/usb-sysinit.h
@@ -30,6 +30,8 @@
#define NEED_USB_OHCI
 #elif defined(__GEN83xx_BSP_h) || defined(LIBBSP_POWERPC_QORIQ_BSP_H)
#define NEED_USB_EHCI
+#elif defined(LIBBSP_ARM_RASPBERRYPI_BSP_H)
+   #define NEED_USB_OTG
 #endif
 
 SYSINIT_NEED_USB_CORE;
-- 
2.7.4

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


Re: [PATCH 4/4] Added ethernet support for Raspberry Pi. USB DMA related functions commented out, since DMA support for raspberry is underdevelopment.

2016-08-19 Thread Deval Shah
On Fri, Aug 19, 2016 at 2:51 PM, Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> I updated the rules to modify FreeBSD code. Please follow them. In
> particular we have:
>
> "Add nothing (even blank lines) before or after the |__rtems__| guards.
> Always include a |__rtems__| in the guards"
>

Actually in some places while adding the |__rtems__| guards, some blank
lines were getting deleted. So the first rule was beig violated. "Only add
lines.  If your patch contains lines starting with a '-', then this is
wrong."

I will correct the other mistakes. i.e. adding the guards at the begining
of the line and including /* __rtems__ */ in the guards.


> Please don't merge changes for a particular BSP and generic changes into
> one commit.


I will correct that.

Any other thing which I should keep in mind before submitting the final
patches ?

Also, do I have to send all the patches again ? or just the ones which I
will add now.

>
>
> On 19/08/16 10:46, Deval Shah wrote:
>
>> ---
>>   freebsd/sys/dev/usb/net/if_smsc.c  | 44
>> ++
>>   freebsd/sys/dev/usb/net/if_smscreg.h   |  1 +
>>   freebsd/sys/dev/usb/net/usb_ethernet.c | 17 +
>>   freebsd/sys/sys/sysctl.h   |  1 +
>>   rtemsbsd/include/bsp/nexus-devices.h   |  2 +
>>   rtemsbsd/include/machine/rtems-bsd-nexus-bus.h | 18 +
>>   .../include/rtems/bsd/test/network-config.h.in |  2 +
>>   7 files changed, 85 insertions(+)
>>
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail  : sebastian.hu...@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
>


-- 
Deval Shah
Graduate Student,
B.E. (Hons.) Electrical and Electronics Engineering
BITS Pilani Hyderabad Campus <http://www.bits-pilani.ac.in/hyderabad/>

Github Profile <https://github.com/deval-maker>
ᐧ
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH 4/4] Added ethernet support for Raspberry Pi. USB DMA related functions commented out, since DMA support for raspberry is underdevelopment.

2016-08-19 Thread Deval Shah
---
 freebsd/sys/dev/usb/net/if_smsc.c  | 44 ++
 freebsd/sys/dev/usb/net/if_smscreg.h   |  1 +
 freebsd/sys/dev/usb/net/usb_ethernet.c | 17 +
 freebsd/sys/sys/sysctl.h   |  1 +
 rtemsbsd/include/bsp/nexus-devices.h   |  2 +
 rtemsbsd/include/machine/rtems-bsd-nexus-bus.h | 18 +
 .../include/rtems/bsd/test/network-config.h.in |  2 +
 7 files changed, 85 insertions(+)

diff --git a/freebsd/sys/dev/usb/net/if_smsc.c 
b/freebsd/sys/dev/usb/net/if_smsc.c
index 3bdd35a..bdae5eb 100644
--- a/freebsd/sys/dev/usb/net/if_smsc.c
+++ b/freebsd/sys/dev/usb/net/if_smsc.c
@@ -91,7 +91,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifndef __rtems__
 #include 
+#endif
 
 #ifdef FDT
 #include 
@@ -996,7 +998,9 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_error_t 
error)
/* The frame header is always aligned on a 4 byte 
boundary */
off = ((off + 0x3) & ~0x3);
 
+   #ifndef __rtems__
usbd_copy_out(pc, off, , sizeof(rxhdr));
+   #endif
off += (sizeof(rxhdr) + ETHER_ALIGN);
rxhdr = le32toh(rxhdr);

@@ -1008,9 +1012,21 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, 
usb_error_t error)

if (rxhdr & SMSC_RX_STAT_ERROR) {
smsc_dbg_printf(sc, "rx error (hdr 0x%08x)\n", 
rxhdr);
+
+   #ifndef __rtems__
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
+   #else /* __rtems__ */
+   ifp->if_ierrors++;
+   #endif /* __rtems__ */
+
if (rxhdr & SMSC_RX_STAT_COLLISION)
+
+   #ifndef __rtems__
if_inc_counter(ifp, 
IFCOUNTER_COLLISIONS, 1);
+   #else /* __rtems__ */
+   sc->ifp->if_collisions += 1;
+   #endif /* __rtems__ */
+
} else {
 
/* Check if the ethernet frame is too big or 
too small */
@@ -1021,12 +1037,20 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, 
usb_error_t error)
m = uether_newbuf();
if (m == NULL) {
smsc_warn_printf(sc, "failed to create 
new mbuf\n");
+
+   #ifndef __rtems__
if_inc_counter(ifp, IFCOUNTER_IQDROPS, 
1);
+   #else /* __rtems__ */
+   ifp->if_iqdrops++;
+   #endif /* __rtems__ */
+
goto tr_setup;
}
+   #ifndef __rtems__

usbd_copy_out(pc, off, mtod(m, uint8_t *), 
pktlen);
 
+   #endif
/* Check if RX TCP/UDP checksumming is being 
offloaded */
if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) {
 
@@ -1061,9 +1085,11 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, 
usb_error_t error)
/* Copy the TCP/UDP 
checksum from the last 2 bytes
 * of the transfer and 
put in the csum_data field.
 */
+   #ifndef __rtems__
usbd_copy_out(pc, (off 
+ pktlen),
  
>m_pkthdr.csum_data, 2);
 
+   #endif
/* The data is copied 
in network order, but the
 * csum algorithm in 
the kernel expects it to be
 * in host network 
order.
@@ -1165,19 +1191,31 @@ tr_setup:
txhdr = SMSC_TX_CTRL_0_BUF_SIZE(m->m_pkthdr.len) | 
SMSC_TX_CTRL_0_FIRST_SEG | 
SMSC_TX_CTRL_0_LAST_SEG;
txhdr = htole32(txhdr);
+   #ifndef __rtems__
usbd_copy_in(pc, 0, , sizeof(txhdr));

+   #endif
+
txhdr = SMSC_TX_CTRL_1_PKT_LENGTH(m->m_pkthdr.len);
txhdr = 

[PATCH 3/4] Imported files for driver usb_ethernet for Raspberry Pi.

2016-08-19 Thread Deval Shah
---
 freebsd/sys/dev/usb/net/if_smsc.c  | 1863 
 freebsd/sys/dev/usb/net/if_smscreg.h   |  277 +
 freebsd/sys/dev/usb/net/usb_ethernet.c |  647 +++
 freebsd/sys/dev/usb/net/usb_ethernet.h |  127 +++
 libbsd.py  |8 +-
 libbsd.txt |1 +
 libbsd_waf.py  |2 +
 7 files changed, 2922 insertions(+), 3 deletions(-)
 create mode 100644 freebsd/sys/dev/usb/net/if_smsc.c
 create mode 100644 freebsd/sys/dev/usb/net/if_smscreg.h
 create mode 100644 freebsd/sys/dev/usb/net/usb_ethernet.c
 create mode 100644 freebsd/sys/dev/usb/net/usb_ethernet.h

diff --git a/freebsd/sys/dev/usb/net/if_smsc.c 
b/freebsd/sys/dev/usb/net/if_smsc.c
new file mode 100644
index 000..3bdd35a
--- /dev/null
+++ b/freebsd/sys/dev/usb/net/if_smsc.c
@@ -0,0 +1,1863 @@
+#include 
+
+/*-
+ * Copyright (c) 2012
+ * Ben Gray .
+ * All rights reserved.
+ *
+ * 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 AUTHOR ``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 AUTHOR 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$");
+
+/*
+ * SMSC LAN9xxx devices (http://www.smsc.com/)
+ * 
+ * The LAN9500 & LAN9500A devices are stand-alone USB to Ethernet chips that
+ * support USB 2.0 and 10/100 Mbps Ethernet.
+ *
+ * The LAN951x devices are an integrated USB hub and USB to Ethernet adapter.
+ * The driver only covers the Ethernet part, the standard USB hub driver
+ * supports the hub part.
+ *
+ * This driver is closely modelled on the Linux driver written and copyrighted
+ * by SMSC.
+ *
+ *
+ *
+ *
+ * H/W TCP & UDP Checksum Offloading
+ * -
+ * The chip supports both tx and rx offloading of UDP & TCP checksums, this
+ * feature can be dynamically enabled/disabled.  
+ *
+ * RX checksuming is performed across bytes after the IPv4 header to the end of
+ * the Ethernet frame, this means if the frame is padded with non-zero values
+ * the H/W checksum will be incorrect, however the rx code compensates for 
this.
+ *
+ * TX checksuming is more complicated, the device requires a special header to
+ * be prefixed onto the start of the frame which indicates the start and end
+ * positions of the UDP or TCP frame.  This requires the driver to manually
+ * go through the packet data and decode the headers prior to sending.
+ * On Linux they generally provide cues to the location of the csum and the
+ * area to calculate it over, on FreeBSD we seem to have to do it all 
ourselves,
+ * hence this is not as optimal and therefore h/w tX checksum is currently not
+ * implemented.
+ *
+ */
+#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 
+
+#ifdef FDT
+#include 
+#include 
+#include 
+#endif
+
+#include 
+#include 
+#include 
+#include 
+
+#defineUSB_DEBUG_VAR smsc_debug
+#include 
+#include 
+
+#include 
+
+#include 
+
+#ifdef USB_DEBUG
+static int smsc_debug = 0;
+
+SYSCTL_NODE(_hw_usb, OID_AUTO, smsc, CTLFLAG_RW, 0, "USB smsc");
+SYSCTL_INT(_hw_usb_smsc, OID_AUTO, debug, CTLFLAG_RWTUN, _debug, 0,
+"Debug level");
+#endif
+
+/*
+ * Various supported device vendors/products.
+ */
+static const struct usb_device_id smsc_devs[] = {
+#defineSMSC_DEV(p,i) { USB_VPI(USB_VENDOR_SMC2, USB_PRODUCT_SMC2_##p, 
i) }
+   SMSC_DEV(LAN89530_ETH, 0),
+   SMSC_DEV(LAN9500_ETH, 0),
+   SMSC_DEV(LAN9500_ETH_2, 0),
+   SMSC_DEV(LAN9500A_ETH, 0),
+   SMSC_DEV(LAN9500A_ETH_2, 0),
+   SMSC_DEV(LAN9505_ETH, 0),
+   SMSC_DEV(LAN9505A_ETH, 0),
+   SMSC_DEV(LAN9514_ETH, 0),
+   SMSC_DEV(LAN9514_ETH_2, 

[PATCH 2/4] Added USB roothub support for Raspberry Pi.

2016-08-19 Thread Deval Shah
---
 freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c | 27 ++
 freebsd/sys/dev/usb/controller/dwc_otg_fdt.c   | 10 
 rtemsbsd/include/bsp/nexus-devices.h   |  9 
 rtemsbsd/include/machine/rtems-bsd-nexus-bus.h | 22 ++
 rtemsbsd/include/machine/rtems-bsd-sysinit.h   |  3 +++
 testsuite/usb01/usb-sysinit.h  |  6 +
 6 files changed, 77 insertions(+)

diff --git a/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c 
b/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
index 1ab4d08..d57f691 100644
--- a/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
+++ b/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
@@ -37,7 +37,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifndef __rtems__
 #include 
+#endif
 
 #include 
 #include 
@@ -51,7 +53,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifndef __rtems__
 #include 
+#else
+#include 
+#include 
+#endif
 
 static device_probe_t bcm283x_dwc_otg_probe;
 static device_attach_t bcm283x_dwc_otg_attach;
@@ -60,12 +67,15 @@ static int
 bcm283x_dwc_otg_probe(device_t dev)
 {
 
+   #ifndef __rtems__
+
if (!ofw_bus_status_okay(dev))
return (ENXIO);
 
if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-usb"))
return (ENXIO);
 
+   #endif
device_set_desc(dev, "DWC OTG 2.0 integrated USB controller (bcm283x)");
 
return (BUS_PROBE_VENDOR);
@@ -76,9 +86,21 @@ bcm283x_dwc_otg_attach(device_t dev)
 {
int err;
 
+   #ifndef __rtems__
+
err = bcm2835_mbox_set_power_state(BCM2835_MBOX_POWER_ID_USB_HCD, TRUE);
if (err)
device_printf(dev, "failed to set power state, err=%d\n", err);
+   #else
+
+   bcm2835_set_power_state_entries power_state_usb;
+   power_state_usb.dev_id = bcm2835_mailbox_power_udid_usb_hcd;
+   power_state_usb.state = BCM2835_MAILBOX_SET_POWER_STATE_REQ_ON;
+   err = bcm2835_mailbox_set_power_state(_state_usb);
+   if (err) 
+   device_printf(dev, "failed to set power state, err=%d\n", err);
+
+   #endif
 
return (dwc_otg_attach(dev));
 }
@@ -95,6 +117,11 @@ static devclass_t bcm283x_dwc_otg_devclass;
 
 DEFINE_CLASS_1(bcm283x_dwcotg, bcm283x_dwc_otg_driver, bcm283x_dwc_otg_methods,
 sizeof(struct dwc_otg_fdt_softc), dwc_otg_driver);
+#ifndef __rtems__
 DRIVER_MODULE(bcm283x_dwcotg, simplebus, bcm283x_dwc_otg_driver,
 bcm283x_dwc_otg_devclass, 0, 0);
+#else
+DRIVER_MODULE(bcm283x_dwcotg, nexus, bcm283x_dwc_otg_driver,
+   bcm283x_dwc_otg_devclass, 0, 0);
+#endif
 MODULE_DEPEND(bcm283x_dwcotg, usb, 1, 1, 1);
diff --git a/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c 
b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
index 2b7a715..d400d52 100644
--- a/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
+++ b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
@@ -39,9 +39,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifndef __rtems__
 #include 
 #include 
 #include 
+#endif
 
 #include 
 #include 
@@ -64,11 +66,13 @@ static int
 dwc_otg_probe(device_t dev)
 {
 
+   #ifndef __rtems__
if (!ofw_bus_status_okay(dev))
return (ENXIO);
 
if (!ofw_bus_is_compatible(dev, "synopsys,designware-hs-otg2"))
return (ENXIO);
+   #endif
 
device_set_desc(dev, "DWC OTG 2.0 integrated USB controller");
 
@@ -89,6 +93,7 @@ dwc_otg_attach(device_t dev)
sc->sc_otg.sc_bus.devices_max = DWC_OTG_MAX_DEVICES;
sc->sc_otg.sc_bus.dma_bits = 32;
 
+   #ifndef __rtems__
/* get USB mode, if any */
if (OF_getprop(ofw_bus_get_node(dev), "dr_mode",
_mode, sizeof(usb_mode)) > 0) {
@@ -105,6 +110,7 @@ dwc_otg_attach(device_t dev)
usb_mode);
}
}
+   #endif
 
/* get all DMA memory */
if (usb_bus_mem_alloc_all(>sc_otg.sc_bus,
@@ -218,5 +224,9 @@ driver_t dwc_otg_driver = {
 
 static devclass_t dwc_otg_devclass;
 
+#ifndef __rtems__
 DRIVER_MODULE(dwcotg, simplebus, dwc_otg_driver, dwc_otg_devclass, 0, 0);
+#else /* __rtems__ */
+DRIVER_MODULE(dwcotg, nexus, dwc_otg_driver, dwc_otg_devclass, 0, 0);
+#endif /* __rtems__ */
 MODULE_DEPEND(dwcotg, usb, 1, 1, 1);
diff --git a/rtemsbsd/include/bsp/nexus-devices.h 
b/rtemsbsd/include/bsp/nexus-devices.h
index 45beb30..ce9d45c 100644
--- a/rtemsbsd/include/bsp/nexus-devices.h
+++ b/rtemsbsd/include/bsp/nexus-devices.h
@@ -82,6 +82,15 @@ RTEMS_BSD_DRIVER_PCI_EM;
 RTEMS_BSD_DRIVER_PCI_RE;
 RTEMS_BSD_DRIVER_REPHY;
 
+#elif defined(LIBBSP_ARM_RASPBERRYPI_BSP_H)
+
+#include 
+
+RTEMS_BSD_DRIVER_BCM283X_DWCOTG(BCM2835_USB_BASE, 
+   BCM2835_IRQ_ID_USB);
+RTEMS_BSD_DRIVER_USB;
+RTEMS_BSD_DRIVER_USB_MASS;
+
 #elif defined(LIBBSP_POWERPC_QORIQ_BSP_H)
 
 #if !QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
diff --git a/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h 

[PATCH 1/4] Imported files for driver: bcm283x_dwcotg

2016-08-19 Thread Deval Shah
---
 freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c | 100 ++
 freebsd/sys/dev/usb/controller/dwc_otg_fdt.c   | 222 +
 freebsd/sys/dev/usb/controller/dwc_otg_fdt.h   |  39 
 libbsd.py  |   3 +
 libbsd.txt |   2 +
 libbsd_waf.py  |   4 +-
 6 files changed, 369 insertions(+), 1 deletion(-)
 create mode 100644 freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
 create mode 100644 freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
 create mode 100644 freebsd/sys/dev/usb/controller/dwc_otg_fdt.h

diff --git a/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c 
b/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
new file mode 100644
index 000..1ab4d08
--- /dev/null
+++ b/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
@@ -0,0 +1,100 @@
+#include 
+
+/*
+ * Copyright 2015 Andrew Turner.
+ * All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+static device_probe_t bcm283x_dwc_otg_probe;
+static device_attach_t bcm283x_dwc_otg_attach;
+
+static int
+bcm283x_dwc_otg_probe(device_t dev)
+{
+
+   if (!ofw_bus_status_okay(dev))
+   return (ENXIO);
+
+   if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-usb"))
+   return (ENXIO);
+
+   device_set_desc(dev, "DWC OTG 2.0 integrated USB controller (bcm283x)");
+
+   return (BUS_PROBE_VENDOR);
+}
+
+static int
+bcm283x_dwc_otg_attach(device_t dev)
+{
+   int err;
+
+   err = bcm2835_mbox_set_power_state(BCM2835_MBOX_POWER_ID_USB_HCD, TRUE);
+   if (err)
+   device_printf(dev, "failed to set power state, err=%d\n", err);
+
+   return (dwc_otg_attach(dev));
+}
+
+static device_method_t bcm283x_dwc_otg_methods[] = {
+   /* bus interface */
+   DEVMETHOD(device_probe, bcm283x_dwc_otg_probe),
+   DEVMETHOD(device_attach, bcm283x_dwc_otg_attach),
+
+   DEVMETHOD_END
+};
+
+static devclass_t bcm283x_dwc_otg_devclass;
+
+DEFINE_CLASS_1(bcm283x_dwcotg, bcm283x_dwc_otg_driver, bcm283x_dwc_otg_methods,
+sizeof(struct dwc_otg_fdt_softc), dwc_otg_driver);
+DRIVER_MODULE(bcm283x_dwcotg, simplebus, bcm283x_dwc_otg_driver,
+bcm283x_dwc_otg_devclass, 0, 0);
+MODULE_DEPEND(bcm283x_dwcotg, usb, 1, 1, 1);
diff --git a/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c 
b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
new file mode 100644
index 000..2b7a715
--- /dev/null
+++ b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
@@ -0,0 +1,222 @@
+#include 
+
+/*-
+ * Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, 

Re: [PATCH 01/02] USB driver bcm283x_dwcotg added.

2016-08-10 Thread Deval Shah
I saw the files which you have attached. I found one quick mistake.

In your nexus-devices.h file "RTEMS_BSD_DRIVER_BCM283X_DWCOTG(0x2098,
17);", base and irq used are wrong. I had corrected the irq in my other
commit. They will be 0x3F98 (since you are using Raspberry pi 2) and 9.

It would be easier to use the macros. i.e.
RTEMS_BSD_DRIVER_BCM283X_DWCOTG(BCM2835_USB_BASE, BCM2835_IRQ_ID_USB);


ᐧ

On Wed, Aug 10, 2016 at 1:11 PM, Thomas Kim <thomas73@gmail.com> wrote:

> Dear Deval Shah,
>
> Thank you very much for your reply.
> I checked this again.
> Because there is not your code in currrent git system, I patched your code
> in current libbsd code.
> As I know in current libbsd source tree, your nexus_devices.h should be
> sperated into rtems-bsd-nexus-bus.h. I attached this.
>
> First of all, I completed to test RTEMS testsuites/sample/ticker.exe on
> RPI2 B+ board.
> I am tring to test rtems-libbsd/rtemsbsd/testsuite/usb01.
> also, I try to test two cases in usb01/init.c
> case 1 does not include NEED_USB_EHCI. case 2 include NEED_USB_EHCI.
>
> #if defined(LIBBSP_ARM_LPC24XX_BSP_H) || defined(LIBBSP_ARM_LPC32XX_BSP_H)
>  #define NEED_USB_OHCI
> (CASE1) #elif defined(__GEN83xx_BSP_h) || defined(LIBBSP_POWERPC_QORIQ_
> BSP_H)
> (CASE2) #elif defined(__GEN83xx_BSP_h) || defined(LIBBSP_ARM_
> RASPBERRYPI_BSP_H)
>  #define NEED_USB_EHCI
> #endif
> SYSINIT_NEED_USB_CORE;
> #ifdef NEED_USB_OHCI
>  SYSINIT_NEED_USB_OHCI;
> #endif
> #ifdef NEED_USB_EHCI
>  SYSINIT_NEED_USB_EHCI;
> #endif
>
> also, I added "#define VERBOSE_SYSINIT 1" in init_main.c for checking
> SYS_INIT functional call.
>
> At this time, usb_quirk_init() only is called when I test two cases.
> I attached serial log file, too.
>
> Please let me know my missing point.
>
> Best Regards,
> JunBeom
>
> 2016-08-10 5:31 GMT+09:00 Deval Shah <deval.ma...@gmail.com>:
>
>> Hello Thomas Kim,
>>
>> It is the same code which you downloaded will work for the raspberry pi.
>> You can test the libbsd version of raspberry pi by configuring waf with the
>> following arguments.
>>
>> waf configure --prefix=/opt/rtems/4.12/bsps \
>> --rtems=/opt/rtems/4.12/bsps \
>> --rtems-tools=/opt/rtems/4.12/tools \
>> --rtems-bsps=arm/raspberrypi
>>
>> You can find more at this link. https://git.rtems.org/rt
>> ems-libbsd/tree/README.waf
>>
>> Deval Shah
>>
>> ᐧ
>>
>> On Tue, Aug 9, 2016 at 11:48 AM, Thomas Kim <thomas73@gmail.com>
>> wrote:
>>
>>> Dear Sir,
>>>
>>> I am sorry.
>>>
>>> I want to test this libbsd version for Rasberry Pi.
>>> When I check "git://git.rtems.org/rtems-libbsd.git", there is not any
>>> code for Rasberry pi.
>>>
>>> Please could you let me know git URL for downloading this libbsd version
>>> ?
>>>
>>> Best Regards,
>>> Thomas Kim
>>>
>>> 2016-08-09 14:52 GMT+09:00 Sebastian Huber <
>>> sebastian.hu...@embedded-brains.de>:
>>>
>>>> From which FreeBSD version are these files?
>>>>
>>>> On 05/08/16 18:32, Deval Shah wrote:
>>>>
>>>>> ---
>>>>>   freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c | 127
>>>>> 
>>>>>   freebsd/sys/dev/usb/controller/dwc_otg_fdt.c   | 228
>>>>> +
>>>>>   freebsd/sys/dev/usb/controller/dwc_otg_fdt.h   |  39 
>>>>>   libbsd.py  |   3 +
>>>>>   libbsd_waf.py  |   4 +-
>>>>>   rtemsbsd/include/bsp/nexus-devices.h   |  21 ++
>>>>>   6 files changed, 421 insertions(+), 1 deletion(-)
>>>>>   create mode 100644 freebsd/sys/arm/broadcom/bcm28
>>>>> 35/bcm283x_dwc_fdt.c
>>>>>   create mode 100644 freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
>>>>>   create mode 100644 freebsd/sys/dev/usb/controller/dwc_otg_fdt.h
>>>>>
>>>>
>>>> --
>>>> Sebastian Huber, embedded brains GmbH
>>>>
>>>> Address : Dornierstr. 4, D-82178 Puchheim, Germany
>>>> Phone   : +49 89 189 47 41-16
>>>> Fax : +49 89 189 47 41-09
>>>> E-Mail  : sebastian.hu...@embedded-brains.de
>>>> PGP : Public key available on request.
>>>>
>>>> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>>>>
>>>> ___
>>>> devel mailing list
>>>> devel@rtems.org
>>>> http://lists.rtems.org/mailman/listinfo/devel
>>>>
>>>
>>>
>>
>>
>> --
>> Deval Shah
>> Graduate Student,
>> B.E. (Hons.) Electrical and Electronics Engineering
>> BITS Pilani Hyderabad Campus <http://www.bits-pilani.ac.in/hyderabad/>
>>
>> Github Profile <https://github.com/deval-maker>
>>
>
>


-- 
Deval Shah
Graduate Student,
B.E. (Hons.) Electrical and Electronics Engineering
BITS Pilani Hyderabad Campus <http://www.bits-pilani.ac.in/hyderabad/>

Github Profile <https://github.com/deval-maker>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH 01/02] USB driver bcm283x_dwcotg added.

2016-08-05 Thread Deval Shah
---
 freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c | 127 
 freebsd/sys/dev/usb/controller/dwc_otg_fdt.c   | 228 +
 freebsd/sys/dev/usb/controller/dwc_otg_fdt.h   |  39 
 libbsd.py  |   3 +
 libbsd_waf.py  |   4 +-
 rtemsbsd/include/bsp/nexus-devices.h   |  21 ++
 6 files changed, 421 insertions(+), 1 deletion(-)
 create mode 100644 freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
 create mode 100644 freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
 create mode 100644 freebsd/sys/dev/usb/controller/dwc_otg_fdt.h

diff --git a/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c 
b/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
new file mode 100644
index 000..4c148d4
--- /dev/null
+++ b/freebsd/sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
@@ -0,0 +1,127 @@
+#include 
+
+/*
+ * Copyright 2015 Andrew Turner.
+ * All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifndef __rtems__
+#include 
+#endif
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#ifndef __rtems__
+#include 
+#else
+#include 
+#include 
+#endif
+
+static device_probe_t bcm283x_dwc_otg_probe;
+static device_attach_t bcm283x_dwc_otg_attach;
+
+static int
+bcm283x_dwc_otg_probe(device_t dev)
+{
+
+   #ifndef __rtems__
+
+   if (!ofw_bus_status_okay(dev))
+   return (ENXIO);
+
+   if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-usb"))
+   return (ENXIO);
+   #endif
+   device_set_desc(dev, "DWC OTG 2.0 integrated USB controller (bcm283x)");
+
+   return (BUS_PROBE_VENDOR);
+}
+
+static int
+bcm283x_dwc_otg_attach(device_t dev)
+{
+   int err;
+
+   #ifndef __rtems__
+
+   err = bcm2835_mbox_set_power_state(BCM2835_MBOX_POWER_ID_USB_HCD, TRUE);
+   if (err)
+   device_printf(dev, "failed to set power state, err=%d\n", err);
+   
+   #else
+
+   bcm2835_set_power_state_entries power_state_usb;
+   power_state_usb.dev_id = bcm2835_mailbox_power_udid_usb_hcd;
+   power_state_usb.state = BCM2835_MAILBOX_SET_POWER_STATE_REQ_ON;
+   err = bcm2835_mailbox_set_power_state(_state_usb);
+   if (err) 
+   device_printf(dev, "failed to set power state, err=%d\n", err);
+
+   #endif
+
+   return (dwc_otg_attach(dev));
+}
+
+static device_method_t bcm283x_dwc_otg_methods[] = {
+   /* bus interface */
+   DEVMETHOD(device_probe, bcm283x_dwc_otg_probe),
+   DEVMETHOD(device_attach, bcm283x_dwc_otg_attach),
+
+   DEVMETHOD_END
+};
+
+static devclass_t bcm283x_dwc_otg_devclass;
+
+DEFINE_CLASS_1(bcm283x_dwcotg, bcm283x_dwc_otg_driver, bcm283x_dwc_otg_methods,
+   sizeof(struct dwc_otg_fdt_softc), dwc_otg_driver);
+#ifndef __rtems__
+DRIVER_MODULE(bcm283x_dwcotg, simplebus, bcm283x_dwc_otg_driver,
+   bcm283x_dwc_otg_devclass, 0, 0);
+#else
+DRIVER_MODULE(bcm283x_dwcotg, nexus, bcm283x_dwc_otg_driver,
+   bcm283x_dwc_otg_devclass, 0, 0);
+#endif
+MODULE_DEPEND(bcm283x_dwcotg, usb, 1, 1, 1);
diff --git a/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c 
b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
new file mode 100644
index 000..b06fa0a
--- /dev/null
+++ b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
@@ -0,0 +1,228 @@
+#include 
+
+/*-
+ * Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ 

[PATCH 02/02] Added usb_ehternet controller and configured for Raspberry Pi.

2016-08-05 Thread Deval Shah
---
 freebsd/sys/dev/usb/controller/dwc_otg_fdt.c   |4 +
 freebsd/sys/dev/usb/net/if_cdce.c  | 1583 
 freebsd/sys/dev/usb/net/if_cdcereg.h   |  105 ++
 freebsd/sys/dev/usb/net/if_smsc.c  | 1886 
 freebsd/sys/dev/usb/net/if_smscreg.h   |  278 +++
 freebsd/sys/dev/usb/net/usb_ethernet.c |  659 +++
 freebsd/sys/dev/usb/net/usb_ethernet.h |  127 ++
 freebsd/sys/dev/usb/usb_busdma.c   |4 +-
 freebsd/sys/sys/sysctl.h   |1 +
 libbsd.py  |8 +-
 libbsd_waf.py  |2 +
 rtemsbsd/include/bsp/nexus-devices.h   |   17 +-
 .../include/rtems/bsd/test/network-config.h.in |2 +
 13 files changed, 4669 insertions(+), 7 deletions(-)
 create mode 100644 freebsd/sys/dev/usb/net/if_cdce.c
 create mode 100644 freebsd/sys/dev/usb/net/if_cdcereg.h
 create mode 100644 freebsd/sys/dev/usb/net/if_smsc.c
 create mode 100644 freebsd/sys/dev/usb/net/if_smscreg.h
 create mode 100644 freebsd/sys/dev/usb/net/usb_ethernet.c
 create mode 100644 freebsd/sys/dev/usb/net/usb_ethernet.h

diff --git a/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c 
b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
index b06fa0a..598187b 100644
--- a/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
+++ b/freebsd/sys/dev/usb/controller/dwc_otg_fdt.c
@@ -224,5 +224,9 @@ driver_t dwc_otg_driver = {
 
 static devclass_t dwc_otg_devclass;
 
+#ifndef __rtems__
 DRIVER_MODULE(dwcotg, simplebus, dwc_otg_driver, dwc_otg_devclass, 0, 0);
+#else /* __rtems__ */
+DRIVER_MODULE(dwcotg, nexus, dwc_otg_driver, dwc_otg_devclass, 0, 0);
+#endif /* __rtems__ */
 MODULE_DEPEND(dwcotg, usb, 1, 1, 1);
diff --git a/freebsd/sys/dev/usb/net/if_cdce.c 
b/freebsd/sys/dev/usb/net/if_cdce.c
new file mode 100644
index 000..ecab60e
--- /dev/null
+++ b/freebsd/sys/dev/usb/net/if_cdce.c
@@ -0,0 +1,1583 @@
+#include 
+
+/* $NetBSD: if_cdce.c,v 1.4 2004/10/24 12:50:54 augustss Exp $ */
+
+/*-
+ * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul 
+ * Copyright (c) 2003-2005 Craig Boston
+ * Copyright (c) 2004 Daniel Hartmeier
+ * Copyright (c) 2009 Hans Petter Selasky
+ * All rights reserved.
+ *
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *must display the following acknowledgement:
+ * This product includes software developed by Bill Paul.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Bill Paul 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 Bill Paul, THE VOICES IN HIS HEAD OR
+ * THE 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.
+ */
+
+/*
+ * USB Communication Device Class (Ethernet Networking Control Model)
+ * http://www.usb.org/developers/devclass_docs/usbcdc11.pdf
+ */
+
+/*
+ * USB Network Control Model (NCM)
+ * http://www.usb.org/developers/devclass_docs/NCM10.zip
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#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 
+
+#defineUSB_DEBUG_VAR cdce_debug
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+static device_probe_t cdce_probe;
+static device_attach_t cdce_attach;
+static device_detach_t cdce_detach;
+static device_suspend_t cdce_suspend;
+static device_resume_t cdce_resume;
+static usb_handle_request_t cdce_handle_request;
+

Error in initializing network parameters

2016-08-02 Thread Deval Shah
Hello all,

With the USB and Ethernet working, I started running other tests like
ping01 on raspberry Pi.

I am getting following error while running the PING test.

--
*** LIBBSD PING 1 TEST ***
nexus0: 
bcm283x_dwcotg0:  on nexus0
usbus0 on bcm283x_dwcotg0
usbus0: 480Mbps High Speed USB v2.0
uhub0:  on usbus0
ifconfig: interface ue0 does not exist
assertion "exit_code == EX_OK" failed: file
"/home/gadgetman/development/rtems/rtems-libbsd/testsuite/include/rtems/bsd/test/default-network-init.h",
line 125, function: default_network_ifconfig_hwif0
--

In general boot-log, like in init test, after detecting the "uhub0" device
it detects "uhub1" device, which is the usb_ethernet controller. And after
that the Ethernet interface "ue0" exists.

--
*** LIBBSD INIT 1 TEST ***
nexus0: 
bcm283x_dwcotg0:  on nexus0
usbus0 on bcm283x_dwcotg0
usbus0: 480Mbps High Speed USB v2.0
uhub0:  on usbus0
Sleeping to see what happens
uhub0: 1 port with 1 removable, self powered
uhub1:  on
usbus0
uhub1: MTT enabled
uhub1: 5 ports with 4 removable, self powered
smsc0:  on usbus0
smsc0: chip 0xec00, rev. 0002
miibus0:  on smsc0
ukphy0:  PHY 1 on miibus0
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ue0:  on smsc0
ue0: Ethernet address: 5a:ee:60:74:67:92
--

I believe the default-network-init.h tries to access the ethernet interface
before it is created and the problem arises. I tried moving
bsp/nexus-devices.h before rtems/bsd/test/default-network-init.h, but the
problem remains the same. Any pointers ?


Regards,
Deval Shah

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

Errors due to USB_HAVE_UGEN option

2016-07-25 Thread Deval Shah
Hello everyone,
I am trying to add USB mouse to Raspberry Pi, therefore adding related files.
There are some functions which are used by “/dev/usb/input/ums.c” but are not
being compiled due to the switch/macro USB_HAVE_UGEN in the file
rtems-libbsd/rtemsbsd/include/rtems/bsd/local/opt_usb.h.
Error log: 

./libbsd.a(ums.c.16.o): In function `ums_detach': 
/home/gadgetman/development/rtems/rtems-libbsd/build/arm-rtems4.12-raspberrypi/../../freebsd/sys/dev/usb/input/ums.c:683:
undefined reference to `usb_fifo_detach' ./libbsd.a(ums.c.16.o): In function 
`ums_stop_read': 
/home/gadgetman/development/rtems/rtems-libbsd/build/arm-rtems4.12-raspberrypi/../../freebsd/sys/dev/usb/input/ums.c:722:
undefined reference to `usb_fifo_softc' ./libbsd.a(ums.c.16.o): In function 
`ums_start_read': 
/home/gadgetman/development/rtems/rtems-libbsd/build/arm-rtems4.12-raspberrypi/../../freebsd/sys/dev/usb/input/ums.c:697:
undefined reference to `usb_fifo_softc' ./libbsd.a(ums.c.16.o): In function 
`ums_ioctl': 
/home/gadgetman/development/rtems/rtems-libbsd/build/arm-rtems4.12-raspberrypi/../../freebsd/sys/dev/usb/input/ums.c:860:
undefined reference to `usb_fifo_softc' ./libbsd.a(ums.c.16.o): In function 
`ums_reset_buf': 
/home/gadgetman/development/rtems/rtems-libbsd/build/arm-rtems4.12-raspberrypi/../../freebsd/sys/dev/usb/input/ums.c:783:
undefined reference to `usb_fifo_reset' ./libbsd.a(ums.c.16.o): In function 
`ums_close': 
/home/gadgetman/development/rtems/rtems-libbsd/build/arm-rtems4.12-raspberrypi/../../freebsd/sys/dev/usb/input/ums.c:847:
undefined reference to `usb_fifo_softc' 
/home/gadgetman/development/rtems/rtems-libbsd/build/arm-rtems4.12-raspberrypi/../../freebsd/sys/dev/usb/input/ums.c:852:
undefined reference to `usb_fifo_free_buffer' ./libbsd.a(ums.c.16.o): In 
function `ums_open': 
/home/gadgetman/development/rtems/rtems-libbsd/build/arm-rtems4.12-raspberrypi/../../freebsd/sys/dev/usb/input/ums.c:789:
undefined reference to `usb_fifo_softc' 
/home/gadgetman/development/rtems/rtems-libbsd/build/arm-rtems4.12-raspberrypi/../../freebsd/sys/dev/usb/input/ums.c:834:
undefined reference to `usb_fifo_alloc_buffer' ./libbsd.a(ums.c.16.o): In 
function `ums_attach': 
/home/gadgetman/development/rtems/rtems-libbsd/build/arm-rtems4.12-raspberrypi/../../freebsd/sys/dev/usb/input/ums.c:653:
undefined reference to `usb_fifo_attach' ./libbsd.a(ums.c.16.o): In function 
`ums_put_queue': 
/home/gadgetman/development/rtems/rtems-libbsd/build/arm-rtems4.12-raspberrypi/../../freebsd/sys/dev/usb/input/ums.c:771:
undefined reference to `usb_fifo_put_data_linear' ./libbsd.a(ums.c.16.o): In 
function `ums_intr_callback': 
/home/gadgetman/development/rtems/rtems-libbsd/build/arm-rtems4.12-raspberrypi/../../freebsd/sys/dev/usb/input/ums.c:332:
undefined reference to `usb_fifo_put_bytes_max' collect2: error: ld returned 1 
exit status 

 So, what would be the way out here ? Is there any particular reason why “UGEN”
option is not used in our system ?
Thank you in advance.
Deval Shah___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Updates and Problems on "Raspberry Pi USB and Ethernet Support" Project

2016-07-22 Thread Deval Shah
RTEMS: https://github.com/deval-maker/rtems/tree/RPi Libbsd: 
https://github.com/deval-maker/rtems-libbsd/tree/rpi_usb
Deval Shah





On Fri, Jul 22, 2016 5:33 AM, Alan Cudmore alan.cudm...@gmail.com wrote:
Hi Deval, That is great news! Is this in your bsdlib github repository? I would 
like to try it out soon. Thanks, Alan
On Jul 21, 2016, at 12:57 PM, Deval Shah < deval.ma...@gmail.com > wrote:
Hello all,
Good news ! The usb_ethernet controller is working.
Dr. Joel pointed out to check if I am actually getting the interrupt. So I
checked there and found out that there was no entry for USB interrupt. As soon
as I added that entry, everything started working.
Now I am getting the Power in the USB devices when I plug them in also the
Ethernet address. I am adding the init test log below.

---
 *** LIBBSD INIT 1 TEST *** nexus0:  bcm283x_dwcotg0:  on nexus0 usbus0 on 
bcm283x_dwcotg0 usbus0: 480Mbps High Speed USB v2.0 uhub0:  on usbus0 Sleeping to see what happens 
uhub0: 1 port with 1 removable, self powered uhub1:  on
usbus0 uhub1: MTT enabled uhub1: 5 ports with 4 removable, self powered smsc0: 
 on usbus0 smsc0: chip 
0xec00, rev. 0002 miibus0:  on smsc0 ukphy0:  PHY 1 on miibus0 ukphy0: none, 10baseT, 10baseT-FDX, 
100baseTX, 100baseTX-FDX, auto ue0:  on smsc0 ue0: Ethernet 
address: 5a:ee:60:74:67:92 Stack usage by thread ID NAME LOW HIGH CURRENT 
AVAILABLE USED 0x09010001 IDLE 0x133148 - 0x134147 0x1340e0 4080 128 0x0a010001 
UI1 0x134360 - 0x13c35f 0x13bf88 32752 1008 0x0a010002 TIME 0x13cab0 - 0x144aaf 
0x1449f0 32752 332 0x0a010003 IRQS 0x144ab8 - 0x14cab7 0x14c9f8 32752 408 
0x0a010004 _BSD 0x15f3f8 - 0x1673f7 0x167330 32752 352 0x0a010005 _BSD 0x167550 
- 0x16f54f 0x16f488 32752 240 0x0a010006 _BSD 0x172bb0 - 0x17abaf 0x17aaf0 
32752 232 0x0a010007 _BSD 0x17ad50 - 0x182d4f 0x182c88 32752 240 0x0a010008 
_BSD 0x182e10 - 0x18ae0f 0x18ad50 32752 232 0x0a010009 _BSD 0x18afb0 - 0x192faf 
0x192ee8 32752 240 0x0a01000a _BSD 0x1941d0 - 0x19c1cf 0x19c110 32752 232 
0x0a01000b _BSD 0x19c238 - 0x1a4237 0x1a4178 32752 368 0x0a01000c _BSD 0x1a42a0 
- 0x1ac29f 0x1ac1e0 32752 232 0x0a01000d _BSD 0x1ac308 - 0x1b4307 0x1b4248 
32752 1420 0x0a01000e _BSD 0x1b4370 - 0x1bc36f 0x1bc2b0 32752 472 0x0a01000f 
_BSD 0x10 - 0x1e5dcf 0x1e5d10 32752 952 *** END OF TEST LIBBSD INIT 1 *** 
---
I am still not getting the device name attached in the USB port. So I will look
into that now.
I am not starting a new thread for now. (as per the chat in IRC, I told that I
will create another thread to describe the problem.) I will if I get stuck
again.
Thank you for the help.
Deval Shah





On Tue, Jul 19, 2016 1:18 PM, Deval Shah deval.ma...@gmail.com wrote:
Hello everyone,
As per the conversation at IRC I booted the testsuit with turning USB and
ethernet on. Also I ran FreeBSD on my Pi and got the bootup log as suggested by
Alan and Chris. Here are some observations.
1. After turning on USB in u-boot, I was getting power on USB devices atached.
(One of the device I have, has a LED idicator.) But as soon the testsuit
(init01) starts, the power to USB goes off. And didn't start afterwords.
2. I am adding relevant part of the FreeBSD boot log of my Pi. (Lines marked 
with “*” are the ones also coming in my testsuit.)

--
 *bcm283x_dwcotg0:  mem
0x98-0x99 on simplebus0 *usbus0 on bcm283x_dwcotg0 fb0:  on ofwbus0 fbd0 on fb0 VT: initialize with new VT driver 
“fb”. fb0: 656x416(656x416@0,0) 24bpp fb0: fbswap: 1, pitch 1968, base 
0x1eaac000, screen_size 818688 cryptosoft0:  Timecounters tick 
every 10.000 msec *usbus0: 480Mbps High Speed USB v2.0 bcm2835_cpufreq0: ARM 
700MHz, Core 250MHz, SDRAM 400MHz, Turbo OFF ugen0.1:  at usbus0 
*uhub0:  on usbus0 
mmcsd0: 8GB  at mmc0
41.6MHz/4bit/65535-block Trying to mount root from ufs:/dev/ufs/rootfs [rw]... 
warning: no time-of-day clock registered, system time will not be set
accurately *uhub0: 1 port with 1 removable, self powered ugen0.2:  at usbus0 #uhub1:  on
usbus0 #uhub1: MTT enabled Growing root partition to fill device GEOM_PART: 
mmcsd0s2 was automatically resized. Use `gpart commit mmcsd0s2` to save changes 
or `gpart undo mmcsd0s2` to revert
them. mmcsd0s2 resized #uhub1: 5 ports with 4 removable, self powered mmcsd0s2a 
resized super-block backups (for fsck_ffs -b #) at: 2062528, 2578112, 3093696, 
3609280, 4124864, 4640448,ugen0.3: 
at usbus0 smsc0:  on 
usbus0 smsc0: chip 0xec00, rev. 0002 miibus0:  on smsc0 ukphy0: 
 PHY 1 on miibus0 ukphy0: none, 10baseT, 
10baseT-FDX, 100baseTX, 100baseTX-FDX, auto ue0:  on smsc0 ue0: 
Ethernet address: b8:27:eb:06:16:f9 5156032,ugen0.4:  at usbus0 
5671616, 6187200, 6702784, 7218368,ugen0.5:  at usbus0 umass0: 
 on usbus0 umass0: SCSI 
over Bul

Re: Updates and Problems on "Raspberry Pi USB and Ethernet Support" Project

2016-07-19 Thread Deval Shah
Hello everyone,
As per the conversation at IRC I booted the testsuit with turning USB and
ethernet on. Also I ran FreeBSD on my Pi and got the bootup log as suggested by
Alan and Chris. Here are some observations.
1. After turning on USB in u-boot, I was getting power on USB devices atached.
(One of the device I have, has a LED idicator.) But as soon the testsuit
(init01) starts, the power to USB goes off. And didn't start afterwords.
2. I am adding relevant part of the FreeBSD boot log of my Pi. (Lines marked 
with “*” are the ones also coming in my testsuit.)

--
 *bcm283x_dwcotg0:  mem
0x98-0x99 on simplebus0 *usbus0 on bcm283x_dwcotg0 fb0:  on ofwbus0 fbd0 on fb0 VT: initialize with new VT driver 
“fb”. fb0: 656x416(656x416@0,0) 24bpp fb0: fbswap: 1, pitch 1968, base 
0x1eaac000, screen_size 818688 cryptosoft0:  Timecounters tick 
every 10.000 msec *usbus0: 480Mbps High Speed USB v2.0 bcm2835_cpufreq0: ARM 
700MHz, Core 250MHz, SDRAM 400MHz, Turbo OFF ugen0.1:  at usbus0 
*uhub0:  on usbus0 
mmcsd0: 8GB  at mmc0
41.6MHz/4bit/65535-block Trying to mount root from ufs:/dev/ufs/rootfs [rw]... 
warning: no time-of-day clock registered, system time will not be set
accurately *uhub0: 1 port with 1 removable, self powered ugen0.2:  at usbus0 #uhub1:  on
usbus0 #uhub1: MTT enabled Growing root partition to fill device GEOM_PART: 
mmcsd0s2 was automatically resized. Use `gpart commit mmcsd0s2` to save changes 
or `gpart undo mmcsd0s2` to revert
them. mmcsd0s2 resized #uhub1: 5 ports with 4 removable, self powered mmcsd0s2a 
resized super-block backups (for fsck_ffs -b #) at: 2062528, 2578112, 3093696, 
3609280, 4124864, 4640448,ugen0.3: 
at usbus0 smsc0:  on 
usbus0 smsc0: chip 0xec00, rev. 0002 miibus0:  on smsc0 ukphy0: 
 PHY 1 on miibus0 ukphy0: none, 10baseT, 
10baseT-FDX, 100baseTX, 100baseTX-FDX, auto ue0:  on smsc0 ue0: 
Ethernet address: b8:27:eb:06:16:f9 5156032,ugen0.4:  at usbus0 
5671616, 6187200, 6702784, 7218368,ugen0.5:  at usbus0 umass0: 
 on usbus0 umass0: SCSI 
over Bulk-Only; quirks = 0xc100 umass0:0:0: Attached to scbus0 da0 at 
umass-sim0 bus 0 scbus0 target 0 lun 0 da0:  
Removable Direct Access SPC-4 SCSI device da0: Serial Number 
4C530001020307111083 ... 
--

The Lines with “#” are related to the usb_ethernet controller driver. Detection
of the second “uhub” child (uhub1) seems the key thing here. After that smsc,
miibus and ukphy gets initialised. In my test suit I am not getting the “uhub1:”
part. Which have 5 ports with 4 removable, i.e. 1 Ethernet and 4 USB. I double 
checked the USB base adderess and the irq number.
In the line “uhub1: 5 ports with 4 removable, self powered”, does “self powered”
mean that it should be On by default for getting detected ? If that is true, How
can we switch On something in RTEMS ? Also what can switch off the USB, which
was already On by uboot ?
It looks like the “ugen” module finds that device and then gives control to
“uhub” (in the freebsd boot log). But ugen is disabled in RTEMS. Anything in
this direction ?
code link:
https://github.com/deval-maker/rtems-libbsd/commit/91f4c1ef04267c6186e38e23e571e7806016480c.





On Wed, Jul 13, 2016 5:41 AM, Chris Johns chr...@rtems.org wrote:
On 12/07/2016 23:32, Alan Cudmore wrote:

> I'm not sure what I did to get the extra debug messages. When I run the

> usb01 example, I just see:

> nexus0: 

>

> I will have to read up on how the libbsd drivers are used, and what

> needs to be done to set them up in nexus-devices.h

>




I would work backwards from one of the prints you are not seeing.




One way to work out the issue is to directly check the missing prints statements
in the module of code. If you add '--show-commands' to the waf configure command
line the commands used to build the code are printed. If you then change in to
the build directory, cut and paste the command to build the source you are
interested and add '-save-temps' you will get the pre-processed output. Check
the .i file and if there are no print statements you know a define controlling
it is missing. You will then need to track the headers to find it. Once found
add the option to the '--freebsd-options' list.




Note, if you create an error in the source, eg add 'x' anywhere, the build will
stop on the file of interest. This speeds up getting to the command line you are
interested in. Remove the error once you have the command.




> Chris: do you know if it would help to boot FreeBSD on the Pi to see the

> messages and look at what drivers are used?




I tend to try and boot FreeBSD if possible and check the messages and what is
detected match. I am doing this on the Beckhoff PC hardware at the moment.




Chris






Deval Shah Graduate Student, B.E. (Hons.) Electrical and Electronics Engine

Re: Updates and Problems on "Raspberry Pi USB and Ethernet Support" Project

2016-07-11 Thread Deval Shah
I am sorry, I forgot to mention those details.

I have added --freebsd-options=bootverbose,verbose_sysinit,bus_debug for
more log, while configuring waf.

There are two branches currently. RaspberryPi_USB and rpi_usb. Both are
same as far as my added code is concerned. rpi_usb has a different starting
point and not updated while the other one is up to date.

The problem with the RaspberryPi_USB was that due to some other updates in
mainline, I was not getting the device_printfs. So I switched back to the
old repo of mine.

Also, I am surprised how you are getting the device_printfs on my latest
code. https://lists.rtems.org/pipermail/devel/2016-July/015557.html

Regards,
Deval Shah

On Tue, Jul 12, 2016 at 7:05 AM, Alan Cudmore <alan.cudm...@gmail.com>
wrote:

> Hi Deval,
>
> What code do I need to add to try your test?
>
> I am using the items git head kernel, and your rtems-libbsd
> RaspberryPi_USB branch.
> When I run init01 on my Pi Zero, I get the output below.
>
> Alan
>
> *** LIBBSD INIT 1 TEST ***
> nexus0: 
> bcm283x_dwcotg0:  on
> nexus0
> usbus0 on bcm283x_dwcotg0
> usbus0: 480Mbps High Speed USB v2.0
> uhub0:  on usbus0
> Sleeping to see what happens
> uhub0: 1 port with 1 removable, self powered
>
>
>
> On Jul 11, 2016, at 10:37 AM, Deval Shah <deval.ma...@gmail.com> wrote:
>
> Hello all,
>
> I am trying to add usb_ethernet (smsc) driver for raspberry pi for both
> USB and Ethernet support.
> Now I have added the required files. But the USB device is not getting
> power. To get the compilation error-less, I have applied a hack.
>
> if_smsc.c is using the function “usbd_m_copy_in” which is present in the
> file sys/dev/usb/usb_busdma.c. But due to this macro #if USB_HAVE_MBUF the
> function was not getting compiled. So I have commented out the macro and
> let the function compile.
>
> Now ideally I should have used the DMA controller. Here I don't know the
> status of DMA's functions and their usage. Any pointers on that ?
> I believe the problem is secondary for the USB to function. Anyhow the USB
> devices should get the power if the code is added. I suspect there is no
> proper linking between the drivers. (i.e. dwcotg, bcm283x_dwcotg, ushub,
> smsc, uhub, usb.) I would like some insights on how these interact.
>
> I have added following lines in the nexus-devices.h file under
> Raspberry-pi-BSP.
>
> SYSINIT_DRIVER_REFERENCE(bcm283x_dwcotg, nexus);
> SYSINIT_DRIVER_REFERENCE(smsc, uhub);
> SYSINIT_DRIVER_REFERENCE(smsc, uether);
> SYSINIT_DRIVER_REFERENCE(smsc, usb);
> SYSINIT_DRIVER_REFERENCE(smsc, ether);
> SYSINIT_DRIVER_REFERENCE(smsc, miibus);
>
> I am also attaching the log of INIT01 Test.
>
> I need help at this point. I am kind of stuck here.
>
> Thank you in advance.
> Deval Shah
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
>
>


-- 
Deval Shah
Graduate Student,
B.E. (Hons.) Electrical and Electronics Engineering
BITS Pilani Hyderabad Campus <http://www.bits-pilani.ac.in/hyderabad/>

Github Profile <https://github.com/deval-maker>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Updates and Problems on "Raspberry Pi USB and Ethernet Support" Project

2016-07-11 Thread Deval Shah
Hello all,


I am trying to add usb_ethernet (smsc) driver for raspberry pi for both USB
and Ethernet support.

Now I have added the required files. But the USB device is not getting
power. To get the compilation error-less, I have applied a hack.


if_smsc.c is using the function “usbd_m_copy_in” which is present in the
file sys/dev/usb/usb_busdma.c. But due to this macro #if USB_HAVE_MBUF the
function was not getting compiled. So I have commented out the macro and
let the function compile.


Now ideally I should have used the DMA controller. Here I don't know the
status of DMA's functions and their usage. Any pointers on that ?

I believe the problem is secondary for the USB to function. Anyhow the USB
devices should get the power if the code is added. I suspect there is no
proper linking between the drivers. (i.e. dwcotg, bcm283x_dwcotg, ushub,
smsc, uhub, usb.) I would like some insights on how these interact.


I have added following lines in the nexus-devices.h file under
Raspberry-pi-BSP.


SYSINIT_DRIVER_REFERENCE(bcm283x_dwcotg, nexus);

SYSINIT_DRIVER_REFERENCE(smsc, uhub);

SYSINIT_DRIVER_REFERENCE(smsc, uether);

SYSINIT_DRIVER_REFERENCE(smsc, usb);

SYSINIT_DRIVER_REFERENCE(smsc, ether);

SYSINIT_DRIVER_REFERENCE(smsc, miibus);


I am also attaching the log of INIT01 Test.


I need help at this point. I am kind of stuck here.


Thank you in advance.

Deval Shah
*** LIBBSD INIT 1 TEST ***
VERBOSE_SYSINIT: DDB not enabled, symbol lookups disabled.
subsystem 88
   0xa7fb0(0)... done.
subsystem 100
   0x8fd74(0)... done.
   0x1ba34(0)... done.
   0x8de24(0)... done.
subsystem 180
   0x8f1f8(0x112678)... done.
   0x8f1f8(0x112798)... done.
   0x8f1f8(0x112788)... done.
   0x8f1f8(0x1128fc)... done.
   0x8f1f8(0x11292c)... done.
   0x8f1f8(0x1129d0)... done.
   0x8f1f8(0x112a50)... done.
   0x8f1f8(0x112a70)... done.
   0x8f1f8(0x112b6c)... done.
   0x8f1f8(0x112534)... done.
   0x8f1f8(0x112b8c)... done.
   0x8f1f8(0x112bac)... done.
   0x8f1f8(0x1131c0)... done.
   0x8f1f8(0x113380)... done.
   0x8f1f8(0x113350)... done.
   0x8f1f8(0x113340)... done.
   0x8f1f8(0x113330)... done.
   0x8f1f8(0x113534)... done.
   0x8f1f8(0x113554)... done.
   0x8f1f8(0x11387c)... done.
   0x8f1f8(0x113d48)... done.
   0x8f1f8(0x114274)... done.
   0x8f1f8(0x114264)... done.
   0x8f1f8(0x114254)... done.
   0x8f1f8(0x114244)... done.
   0x8f1f8(0x114d44)... done.
   0x8f1f8(0x115b60)... done.
   0x8f1f8(0x115e68)... done.
   0x8f1f8(0x116690)... done.
   0x8f1f8(0x116680)... done.
   0x8f1f8(0x116670)... done.
   0x8f1f8(0x116660)... done.
   0x8f1f8(0x117728)... done.
   0x8f1f8(0x112524)... done.
   0x8f1f8(0x117ac8)... done.
   0x8f1f8(0x11838c)... done.
   0x8f1f8(0x1183ac)... done.
   0x8f1f8(0x1183cc)... done.
   0x8f1f8(0x1183ec)... done.
   0x8f1f8(0x11836c)... done.
   0x8f1f8(0x112514)... done.
   0x8f1f8(0x1186f4)... done.
   0x8f1f8(0x1186e4)... done.
   0x8f1f8(0x11877c)... done.
   0x8f1f8(0x1188ec)... done.
   0x8f1f8(0x118938)... done.
   0x8f1f8(0x1189ac)... done.
   0x8f1f8(0x118a0c)... done.
   0x8f1f8(0x118a5c)... done.
   0x8f1f8(0x118a8c)... done.
   0x8f1f8(0x118c44)... done.
   0x8f1f8(0x118ec4)... done.
   0x8f1f8(0x1191f8)... done.
   0x8f1f8(0x1192c8)... done.
   0x8f1f8(0x119498)... done.
   0x8f1f8(0x1124cc)... done.
   0x8f1f8(0x1194f8)... done.
   0x19188(0)... done.
   0x1a9ac(0)... done.
subsystem 1b0
   0x90368(0x115064)... done.
   0x8f638(0x11892c)... done.
   0x8f638(0x1142e0)... done.
   0x8f638(0x118970)... done.
   0x8f638(0x118360)... done.
   0x90368(0x118994)... done.
   0x8f638(0x112c20)... done.
   0x8f638(0x1166fc)... done.
   0x8f638(0x112c0c)... done.
   0x90844(0x1133f8)... done.
   0x8f638(0x118abc)... done.
   0x8f638(0x118b58)... done.
   0x90368(0x118c84)... done.
   0x8f638(0x113e84)... done.
   0x8f638(0x118cac)... done.
   0x8f638(0x118dbc)... done.
   0x8f638(0x114d74)... done.
   0x8f638(0x11922c)... done.
   0x90368(0x1176dc)... done.
   0x8f638(0x112aa0)... done.
   0x8f638(0x118814)... done.
   0x8f638(0x118830)... done.
   0x8f638(0x118824)... done.
   0x9e73c(0)... done.
   0x1fbc0(0)... done.
   0x9af88(0)... done.
subsystem 1c0
   0x1f0c4(0)... done.
subsystem 200
   0x19d38(0)... done.
   0x9aefc(0)... done.
subsystem 220
   0x98fd8(0)... done.
   0x90c80(0)... done.
subsystem 230
   0x8bd50(0)... done.
subsystem 270
   0x99db0(0)... done.
   0x196c0(0)... done.
subsystem 281
   0x3ce80(0)... done.
   0x1b598(0)... done.
subsystem 300
   0x30940(0)... done.
   0x308bc(0)... done.
   0x19de8(0x1135d4)... done.
   0x35f18(0)... done.
subsystem 310
   0x19de8(0x112830)... make_device:1743: root at no device as unit 0
devclass_find_internal:950: looking for root
devclass_find_internal:960: creating root
devclass_add_device:1672: (null) in devclass root
devclass_alloc_unit:1586: unit 0 in devclass root
devclass_alloc_unit:1645: now: unit 0 in devclass root
devclass_find_internal:950: looking for root
done

Re: Error while adding usb ethernet driver

2016-07-06 Thread Deval Shah
I couldn't find rc.conf file. And I added the following. Is this the
correct place ? Because I am still not getting the debug printfs.

diff --git a/testsuite/include/rtems/bsd/test/default-init.h
b/testsuite/include/rtems/bsd/test/default-init.h
index ab2ab3a..873c01a 100644
--- a/testsuite/include/rtems/bsd/test/default-init.h
+++ b/testsuite/include/rtems/bsd/test/default-init.h
@@ -39,6 +39,7 @@ rtems_task Init(
 {
   rtems_status_code sc;

+  rtems_bsd_setlogpriority("debug");
   puts( "*** " TEST_NAME " TEST ***" );

   /*



On Tue, Jul 5, 2016 at 1:52 PM, Chris Johns <chr...@rtems.org> wrote:

> On 05/07/2016 16:54, Deval Shah wrote:
>
>> 1. I updated the rtems-libbsd to the latest version, and it looks like
>> all the device_printf are closed in one of the update. I am not able to
>> see any log coming from them. Is there any way to switch that on ?
>>
>
> You can either add:
>
>  syslog_priority="debug"
>
> to your rc.conf file or add a call in your init() to:
>
> rtems_bsd_setlogpriority("debug");
>
> The default state of debug is only suitable for developers and not users.
> As a result I have changed the default to suite users. Developers just need
> to enable a suitable priority.
>
> Chris
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Error while adding usb ethernet driver

2016-06-27 Thread Deval Shah
Hello all,

I am trying to add USB-Ethernet driver for Raspberry Pi. I added required
files to libbsd.py and tried to compile.

I am getting the following error which is very strange because the symbols
in this error are already defined in net/if_var.h and the file is included
in usb_ethernet.c.


../../freebsd/sys/dev/usb/net/usb_ethernet.c: In function 'uether_rxmbuf':
../../freebsd/sys/dev/usb/net/usb_ethernet.c:585:22: error:
'IFCOUNTER_IPACKETS' undeclared (first use in this function)
  if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
  ^~
../../freebsd/sys/dev/usb/net/usb_ethernet.c:585:22: note: each undeclared
identifier is reported only once for each function it appears in
../../freebsd/sys/dev/usb/net/usb_ethernet.c: In function 'uether_rxbuf':
../../freebsd/sys/dev/usb/net/usb_ethernet.c:608:23: error:
'IFCOUNTER_IQDROPS' undeclared (first use in this function)
   if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
   ^
../../freebsd/sys/dev/usb/net/usb_ethernet.c:615:22: error:
'IFCOUNTER_IPACKETS' undeclared (first use in this function)
  if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
  ^~

Regards,
Deval Shah
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Code review for Raspberry Pi USB driver

2016-06-26 Thread Deval Shah
Hello Pavel,

I am also not getting the Error now. The issue is resolved. Thanks a lot.

Deval Shah

On Sun, Jun 26, 2016 at 1:12 PM, Mudit Jain <muditjain18011...@gmail.com>
wrote:

> Hi Pavel and Deval,
>
> I don't get the error after Pavel's patch. The issue is resolved.
>
> ---
> nexus0: 
> bcm_dma0:  on nexus0
> sdhci_bcm0:  on nexus0
> Enable the power returns 0
> mmc0:  on sdhci_bcm0
>
> -
>
> Thanks
>
> On Sat, Jun 25, 2016 at 1:41 PM, Pavel Pisa <ppisa4li...@pikron.com>
> wrote:
>
>> Hello Deval Shah,
>>
>> On Saturday 25 of June 2016 07:13:40 Deval Shah wrote:
>> > On Friday 24 June 2016, Pavel Pisa <ppisa4li...@pikron.com> wrote:
>> > > Hello Deval Shah and others,
>> > >
>> > > On Friday 24 of June 2016 10:45:34 Deval Shah wrote:
>> > > > Hello all,
>> > > >
>> > > > I have successfully ported the bcm283x_dwcotg driver for the
>> Raspberry
>> > >
>> > > Pi.
>> > >
>> > > > Changes are shown in the commit >
>> > >
>> > >
>> https://github.com/deval-maker/rtems-libbsd/commit/fd650f7ded413a0d891b53
>> > >95
>> > >
>> > > >abb0c8768d71acc7. I need feedback on the code.
>> > > >
>> > > > Also am getting error in mailbox functions (failed to set power
>> state,
>> > > > err=-2). As far as I know Pavel and Mudit are looking into this
>> > > > problem.
>> > >
>> > > I
>> > >
>> > > > can not move to next part before solving this issue. Please let me
>> know
>> > >
>> > > how
>> > >
>> > > > can I contribute if the problem is not already solved.
>> > >
>> > > I have pushes workaround patch to mainline to ensure that
>> > > your projects are not blocked by mailbox access problem.
>> > > So the problem should be solved for you.
>> > >
>> > > I am currently using latest mainline rtems kernel. And I am still
>> getting
>> >
>> > this error. Any other possible reason?
>>
>> Are you using RPi1 or RPi2?
>>
>> check that next change is applied
>>
>> c/src/lib/libbsp/arm/raspberrypi/misc/vc.c
>>
>>
>> @@ -58,11 +59,22 @@ bcm2835_mailbox_buffer_flush_and_invalidate(void
>> *buf, size_t size)
>>
>>sctlr_val = arm_cp15_get_control();
>>
>> +  RTEMS_COMPILER_MEMORY_BARRIER();
>>arm_cp15_drain_write_buffer();
>>if (sctlr_val & (ARM_CP15_CTRL_C | ARM_CP15_CTRL_M)) {
>> -arm_cp15_drain_write_buffer();
>> +#if 0
>> +/*
>> +These architecture independent RTEMS API functions should be
>> +used there but CPU_DATA_CACHE_ALIGNMENT is not defined
>> +for ARM architecture version used on RPi and functions
>> +are dummy for now and do not provide required synchronization
>> +*/
>>  rtems_cache_flush_multiple_data_lines(buf, size);
>>  rtems_cache_invalidate_multiple_data_lines(buf, size);
>> +#else
>> +/* Flush complete data cache */
>> +arm_cp15_data_cache_clean_and_invalidate();
>> +#endif
>>}
>>  }
>>
>> try to rebuild (and install) whole RTEMS build from scratch
>> to ensure that there is no stale object and report
>> result.
>>
>> You can try to check call of VC firmware from bsp_start_hook_1
>> to check if it works at that phase.
>>
>> See my debug hacks.
>>
>>
>> https://github.com/ppisa/rtems/blob/rtems-rpi-devel/c/src/lib/libbsp/arm/raspberrypi/startup/bspstarthooks.c#L112
>>
>> Best wishes,
>>
>>   Pavel
>>
>>
>>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Code review for Raspberry Pi USB driver

2016-06-26 Thread Deval Shah
Hello all,

I have successfully ported the bcm283x_dwcotg driver for the Raspberry Pi.
Changes are shown in the commit >
https://github.com/deval-maker/rtems-libbsd/commit/fd650f7ded413a0d891b5395abb0c8768d71acc7.
I need feedback on the code.

Also am getting error in mailbox functions (failed to set power state,
err=-2). As far as I know Pavel and Mudit are looking into this problem. I
can not move to next part before solving this issue. Please let me know how
can I contribute if the problem is not already solved.

I am pasting the log for init01 test from rtems-libbsd which I ran on
Raspberry Pi Model 1/B+.

*** LIBBSD INIT 1 TEST ***

nexus0: 

bcm283x_dwcotg0:  on nexus0
bcm283x_dwcotg0: failed to set power state, err=-2
usbus0 on bcm283x_dwcotg0
usbus0: 480Mbps High Speed USB v2.0
uhub0:  on usbus0
Sleeping to see what happens
uhub0: 1 port with 1 removable, self powered
Stack usage by thread
ID  NAMELOW  HIGH CURRENT AVAILABLE USED
0x09010001  IDLE 0x12eae0 - 0x12fadf 0x12fa78  4080128
0x0a010001  UI1  0x12fcf8 - 0x137cf7 0x137920 32752   1008
0x0a010002  TIME 0x138448 - 0x140447 0x140388 32752332
0x0a010003  IRQS 0x140450 - 0x14844f 0x148390 32752308
0x0a010004  _BSD 0x15ac98 - 0x162c97 0x162bd0 32752336
0x0a010005  _BSD 0x162df0 - 0x16adef 0x16ad28 32752240
0x0a010006  _BSD 0x16d3c8 - 0x1753c7 0x175300 32752240
0x0a010007  _BSD 0x175568 - 0x17d567 0x17d4a0 32752240
0x0a010008  _BSD 0x17d628 - 0x185627 0x185568 32752232
0x0a010009  _BSD 0x1856e8 - 0x18d6e7 0x18d628 32752232
0x0a01000a  _BSD 0x18e908 - 0x196907 0x196848 32752232
0x0a01000b  _BSD 0x196970 - 0x19e96f 0x19e8b0 32752232
0x0a01000c  _BSD 0x19e9d8 - 0x1a69d7 0x1a6918 32752232
0x0a01000d  _BSD 0x1a6a40 - 0x1aea3f 0x1ae980 32752880
0x0a01000e  _BSD 0x1aeaa8 - 0x1b6aa7 0x1b69e8 32752232
*** END OF TEST LIBBSD INIT 1 ***


Thank you,
Deval Shah
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Code review for Raspberry Pi USB driver

2016-06-24 Thread Deval Shah
On Friday 24 June 2016, Pavel Pisa <ppisa4li...@pikron.com> wrote:

> Hello Deval Shah and others,
>
> On Friday 24 of June 2016 10:45:34 Deval Shah wrote:
> > Hello all,
> >
> > I have successfully ported the bcm283x_dwcotg driver for the Raspberry
> Pi.
> > Changes are shown in the commit >
> >
> https://github.com/deval-maker/rtems-libbsd/commit/fd650f7ded413a0d891b5395
> >abb0c8768d71acc7. I need feedback on the code.
> >
> > Also am getting error in mailbox functions (failed to set power state,
> > err=-2). As far as I know Pavel and Mudit are looking into this problem.
> I
> > can not move to next part before solving this issue. Please let me know
> how
> > can I contribute if the problem is not already solved.
>
> I have pushes workaround patch to mainline to ensure that
> your projects are not blocked by mailbox access problem.
> So the problem should be solved for you.
>
> I am currently using latest mainline rtems kernel. And I am still getting
this error. Any other possible reason?


> I would work on suggestions/proposal of patches to fix cache
> manager for mainline but testing and acknowledge would require
> help from more people and would take time.
>
> Your peripherals needs probably to access memory through DMA.
> If you use DMA then check if ARM CP15 operations are used
> directly for data synchronization (they work correctly)
> or if you use portable
>
> rtems_cache_flush_multiple_data_lines(buf, size);
> rtems_cache_invalidate_multiple_data_lines(buf, size);
>
> thelater are not working on RPi for now. But I consider these
> after fixing as better choice for long term goal.
>
> Best wishes,
>
>   Pavel
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Errors while building USB DWC OTG driver

2016-06-03 Thread Deval Shah
Also,

I compiled the same build for arm/realview_pbx_a9_qemu. And when I try this
on qemu using this command

#qemu-system-arm -no-reboot -nographic -M realview-pbx-a9 -m 256M -net none
-kernel sleep01.exe
pulseaudio: set_sink_input_volume() failed
pulseaudio: Reason: Invalid argument
pulseaudio: set_sink_input_mute() failed
pulseaudio: Reason: Invalid argument
nexus0: 
#

The test comes out (of the loop ?) abruptly without performing its task.
i.e. sleep01 comes out without starting the slave threads or usb01 comes
out without opening the shell.

Next I did  this "objdump -t usb01.exe | grep bcm" and the output is below.

001be620 l O .rodata 0018 bcm283x_dwcotg_res
002ecc44 l O .rtemsroset 0014 __set_nexus_sym_bcm283x_dwcotg0
 ldf *ABS*  bcm283x_dwc_fdt.c
001013a5 l F .text 0028 bcm283x_dwc_otg_attach
001013cd l F .text 0034 bcm283x_dwc_otg_probe
0030dc64 l O .bss 0004 bcm283x_dwc_otg_devclass
003014c8 l O .data 000c _bcm283x_dwcotg_depend_on_usb
003014d4 l O .data 000c _bcm283x_dwcotg_nexus_depend_on_kernel
00301570 l O .data 000c bcm283x_dwcotg_nexus_mod
003014f0 l O .data 0010 _mod_metadata_md_bcm283x_dwcotg_nexus
00301500 l O .data 0010
_mod_metadata_md_bcm283x_dwcotg_nexus_on_kernel
00301510 l O .data 0010 _mod_metadata_md_bcm283x_dwcotg_on_usb
00301538 l O .data 0018 bcm283x_dwc_otg_methods
00301550 l O .data 0008 bcm283x_dwcotg_baseclasses
00301558 l O .data 0018 bcm283x_dwcotg_nexus_driver_mod
002ecb2c l O .rtemsroset 0004
__set_modmetadata_set_sym__mod_metadata_md_bcm283x_dwcotg_on_usb
002ecb30 l O .rtemsroset 0004
__set_modmetadata_set_sym__mod_metadata_md_bcm283x_dwcotg_nexus
002ecb34 l O .rtemsroset 0004
__set_modmetadata_set_sym__mod_metadata_md_bcm283x_dwcotg_nexus_on_kernel
0030c320 l O .rtemsrwset 0004
__set_sysinit_set_sym__bsd_bcm283x_dwcotg_nexusmodule_sys_init
 ldf *ABS*  bcm2835_mbox.c
001189f9 l F .text 000c bcm2835_mbox_dma_cb
00118a05 l F .text 007a bcm_mbox_write
00118a81 l F .text 008c bcm_mbox_read
00118b0d l F .text 0060 bcm_mbox_intr
00118b6d l F .text 0142 bcm_mbox_attach
00118cb1 l F .text 0034 bcm_mbox_probe
0030ee2c l O .bss 0004 bcm_mbox_devclass
00305c38 l O .data 0018 bcm_mbox_driver
00305c50 l O .data 0028 bcm_mbox_methods
 ldf *ABS*  bcmp.c
001ab165 g F .text 0004 bcmp
00118f31 g F .text 004a bcm2835_mbox_set_power_state
00118ce5 g F .text 024c bcm2835_mbox_property
00301520 g O .data 0018 bcm283x_dwc_otg_driver
003014e0 g O .data 0010 _bsd_bcm283x_dwcotg_nexusmodule_sys_init

This shows that my driver is linked properly with the app testsuit right ?

Now for the debugging what are the methods with qemu? As in how to get step
by step analysis of the running program ?

Thank you,
Deval Shah

On Fri, Jun 3, 2016 at 1:50 PM, Deval Shah <deval.ma...@gmail.com> wrote:

> Hello,
>
> I was going through last years mailing list for debugging the issue. I
> found this https://lists.rtems.org/pipermail/devel/2015-June/011741.html.
> Can someone explain how to get the linker map file ?
>
>
> On Wed, Jun 1, 2016 at 11:01 AM, Sebastian Huber <
> sebastian.hu...@embedded-brains.de> wrote:
>
>> Hello Deval,
>>
>> I would use a hardware debugger or Qemu to tackle this problem.
>>
>> On 31/05/16 19:32, Deval Shah wrote:
>>
>>> Hello,
>>>
>>> I have managed to resolve previous errors and the driver is finally
>>> building. I want to test this on hardware now. I tried running "USB01"
>>> testsuit for this. But I could not see any output on minicom.
>>>
>>> Is there any debug flag/macro which I can turn on in order to get all
>>> the error log? Or any other debug method for raspberry pi hardware ?
>>>
>>
>> --
>> Sebastian Huber, embedded brains GmbH
>>
>> Address : Dornierstr. 4, D-82178 Puchheim, Germany
>> Phone   : +49 89 189 47 41-16
>> Fax : +49 89 189 47 41-09
>> E-Mail  : sebastian.hu...@embedded-brains.de
>> PGP : Public key available on request.
>>
>> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>>
>>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Errors while building USB DWC OTG driver

2016-06-03 Thread Deval Shah
Hello,

I was going through last years mailing list for debugging the issue. I
found this https://lists.rtems.org/pipermail/devel/2015-June/011741.html.
Can someone explain how to get the linker map file ?


On Wed, Jun 1, 2016 at 11:01 AM, Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> Hello Deval,
>
> I would use a hardware debugger or Qemu to tackle this problem.
>
> On 31/05/16 19:32, Deval Shah wrote:
>
>> Hello,
>>
>> I have managed to resolve previous errors and the driver is finally
>> building. I want to test this on hardware now. I tried running "USB01"
>> testsuit for this. But I could not see any output on minicom.
>>
>> Is there any debug flag/macro which I can turn on in order to get all the
>> error log? Or any other debug method for raspberry pi hardware ?
>>
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail  : sebastian.hu...@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: RTEMS on QEMU emulated RPi and RPi2

2016-06-02 Thread Deval Shah
Hello Pavel,

I would like to work on this problem. Can I get some more details and some
literature to go through ?

Thanks,
Deval Shah

On Fri, May 27, 2016 at 1:59 AM, Pavel Pisa <ppisa4li...@pikron.com> wrote:

> Hello all,
>
> it seems that Raspberry Pi QEMU emulation cannot work
> with current RTEMS BSP because it uses BCM2835_TIMER_
>
> as the main clock source, see
>
> rtems/c/src/lib/libbsp/arm/raspberrypi/clock/clockdrv.c
>
> which is mapped to
>
> #define RPI_PERIPHERAL_BASE  0x3F00
> #define BCM2835_TIMER_BASE   (RPI_PERIPHERAL_BASE + 0xB400)
>
> but when I invoke "info mtree" in QEMU monitor console,
> it reports
>
> address-space: memory
>   - (prio 0, RW): system
> -3fff (prio 0, RW): ram
> 3f00-3fff (prio 1, RW): bcm2835-peripherals
>   3f007000-3f007fff (prio 0, RW): bcm2835-dma
>   3f00b200-3f00b3ff (prio 0, RW): bcm2835-ic
>   3f00b800-3f00bbff (prio 0, RW): bcm2835-mbox
>   3f201000-3f201fff (prio 0, RW): pl011
>   3f215000-3f2150ff (prio 0, RW): bcm2835-aux
>   3f30-3f3000ff (prio 0, RW): sdhci
>   3fe05000-3fe050ff (prio 0, RW): bcm2835-dma-chan15
> 4000-40ff (prio 0, RW): bcm2836-control
>
> which means that area 3f00b400-3f00b7ff is unmapped.
> Linux and Windows use local Cortex-A CPU timers most probably on RPi2,
> so actual RTEMS BSP is not compatible with QEMU RPi2 support.
>
> It is not so hared to extend RPi2 QEMU support but it requires
> time.
>
> Best wishes,
>
> Pavel
> ___
> 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: Errors while building USB DWC OTG driver

2016-05-29 Thread Deval Shah
I reverted back to the latest commit of RTEMS. I am getting the same
errors.

On Sun, May 29, 2016 at 11:23 AM, Deval Shah <deval.ma...@gmail.com> wrote:

> I followed the libbsd.txt and added bcm 283x driver from freebsd source.
> Now I am getting new errors. This time drivers got compiled which was
> verified using this command.
> > nm `find build -name '*bcm283x_dwc_fdt*.o'`
>
> The error log is as follows.
>
> In file included from ../../rtemsbsd/rtems/rtems-kernel-muteximpl.c:41:0:
> /home/gadgetman/development/rtems/rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-muteximpl.h:69:5:
> error: unknown type name 'Thread_queue_Context'
>  Thread_queue_Context *queue_context);
>  ^~~~
> /home/gadgetman/development/rtems/rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-muteximpl.h:
> In function 'rtems_bsd_mutex_lock':
> /home/gadgetman/development/rtems/rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-muteximpl.h:74:2:
> error: unknown type name 'Thread_queue_Context'
>   Thread_queue_Context queue_context;
>   ^~~~
> /home/gadgetman/development/rtems/rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-muteximpl.h:79:49:
> error: request for member 'Lock_context' in something not a structure or
> union
>   _Thread_queue_Acquire(>queue, _context.Lock_context);
>  ^
> /home/gadgetman/development/rtems/rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-muteximpl.h:88:50:
> error: request for member 'Lock_context' in something not a structure or
> union
>_Thread_queue_Release(>queue, _context.Lock_context);
>   ^
>
> The log is very big and it is showing that many structures are missing. I
> am unable to figure out why this happened. Because I didn't edit any file
> related to rtems-bsd. Any pointers ?
> Commit for above code changes.
> https://github.com/deval-maker/rtems-libbsd/commit/d90e11ec8e775eed9580e17a6ecaff11fac39931
>
> Thanks,
> Deval Shah
>
>
>
> On Wed, May 25, 2016 7:24 PM, Deval Shah deval.ma...@gmail.com wrote:
>
>>
>> On Wed, May 25, 2016 at 7:12 PM, Sebastian Huber <
>> sebastian.hu...@embedded-brains.de> wrote:
>>
>> On 25/05/16 14:59, Deval Shah wrote:
>>
>>
>> On Wed, May 25, 2016 at 3:07 PM, Sebastian Huber <
>> sebastian.hu...@embedded-brains.de > sebastian.hu...@embedded-brains.de>> wrote:
>>
>> If you get
>>
>> On 25/05/16 10:19, Deval Shah wrote:
>>
>>
>> I got the following result.
>>
>> nm: 'a.out': No such file
>>
>>
>>
>> from
>>
>> nm `find build -name '*bcm283x_dwc_fdt*.o`
>>
>> the this is the first issue you have to resolve. Read the man
>> pages of nm and find to figure out what these commands do.
>>
>> You must have object files for all your driver modules.
>>
>>
>> I understood the problem. Driver for bcm283x is no getting built. Is
>> there any documentation availible for porting a driver to rtems-libbsd ? So
>> that I can verify necessary steps for the code I cherry-picked or if
>> required do the process from scratch.
>>
>>
>> See "How to import code from FreeBSD" in libbsd.txt.
>>
>> Great ! Thanks a lot.
>>
>> Please improve the documentation while you work on this.
>>
>> Surely I will.
>>
>>
>> --
>> Sebastian Huber, embedded brains GmbH
>>
>> Address : Dornierstr. 4, D-82178 Puchheim, Germany
>> Phone   : +49 89 189 47 41-16
>> Fax : +49 89 189 47 41-09
>> E-Mail  : sebastian.hu...@embedded-brains.de
>> PGP : Public key available on request.
>>
>> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>>
>>
>>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Errors while building USB DWC OTG driver

2016-05-28 Thread Deval Shah
I followed the libbsd.txt and added bcm 283x driver from freebsd source. Now I 
am getting new errors. This time drivers got compiled which was verified
using this command. > nm `find build -name '*bcm283x_dwc_fdt*.o'`
The error log is as follows.
In file included from ../../rtemsbsd/rtems/rtems-kernel-muteximpl.c:41:0: 
/home/gadgetman/development/rtems/rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-muteximpl.h:69:5:
error: unknown type name 'Thread_queue_Context' Thread_queue_Context 
*queue_context); ^~~~ 
/home/gadgetman/development/rtems/rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-muteximpl.h:
In function 'rtems_bsd_mutex_lock': 
/home/gadgetman/development/rtems/rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-muteximpl.h:74:2:
error: unknown type name 'Thread_queue_Context' Thread_queue_Context 
queue_context; ^~~~ 
/home/gadgetman/development/rtems/rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-muteximpl.h:79:49:
error: request for member 'Lock_context' in something not a structure or union 
_Thread_queue_Acquire(>queue,  ^ 
/home/gadgetman/development/rtems/rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-muteximpl.h:88:50:
error: request for member 'Lock_context' in something not a structure or union 
_Thread_queue_Release(>queue,  ^
The log is very big and it is showing that many structures are missing. I am
unable to figure out why this happened. Because I didn't edit any file related
to rtems-bsd. Any pointers ? Commit for above code changes.
https://github.com/deval-maker/rtems-libbsd/commit/d90e11ec8e775eed9580e17a6ecaff11fac39931
Thanks, Deval Shah





On Wed, May 25, 2016 7:24 PM, Deval Shah deval.ma...@gmail.com wrote:

On Wed, May 25, 2016 at 7:12 PM, Sebastian Huber < 
sebastian.hu...@embedded-brains.de > wrote:
On 25/05/16 14:59, Deval Shah wrote:

On Wed, May 25, 2016 at 3:07 PM, Sebastian Huber < 
sebastian.hu...@embedded-brains.de > wrote:

If you get

On 25/05/16 10:19, Deval Shah wrote:


I got the following result.

nm: 'a.out': No such file



from

nm `find build -name '*bcm283x_dwc_fdt*.o`

the this is the first issue you have to resolve. Read the man
pages of nm and find to figure out what these commands do.

You must have object files for all your driver modules.


I understood the problem. Driver for bcm283x is no getting built. Is there any
documentation availible for porting a driver to rtems-libbsd ? So that I can
verify necessary steps for the code I cherry-picked or if required do the
process from scratch.

See "How to import code from FreeBSD" in libbsd.txt. Great ! Thanks a lot. 
Please improve the documentation while you work on this. Surely I will.
--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Errors while building USB DWC OTG driver

2016-05-25 Thread Deval Shah
On Wed, May 25, 2016 at 7:12 PM, Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> On 25/05/16 14:59, Deval Shah wrote:
>
>>
>> On Wed, May 25, 2016 at 3:07 PM, Sebastian Huber <
>> sebastian.hu...@embedded-brains.de > sebastian.hu...@embedded-brains.de>> wrote:
>>
>> If you get
>>
>> On 25/05/16 10:19, Deval Shah wrote:
>>
>>
>> I got the following result.
>>
>> nm: 'a.out': No such file
>>
>>
>>
>> from
>>
>> nm `find build -name '*bcm283x_dwc_fdt*.o`
>>
>> the this is the first issue you have to resolve. Read the man
>> pages of nm and find to figure out what these commands do.
>>
>> You must have object files for all your driver modules.
>>
>>
>> I understood the problem. Driver for bcm283x is no getting built. Is
>> there any documentation availible for porting a driver to rtems-libbsd ? So
>> that I can verify necessary steps for the code I cherry-picked or if
>> required do the process from scratch.
>>
>
> See "How to import code from FreeBSD" in libbsd.txt.

Great ! Thanks a lot.

> Please improve the documentation while you work on this.

Surely I will.

>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail  : sebastian.hu...@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Errors while building USB DWC OTG driver

2016-05-25 Thread Deval Shah
On Wed, May 25, 2016 at 3:07 PM, Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> If you get
>
> On 25/05/16 10:19, Deval Shah wrote:
>
>>
>> I got the following result.
>>
>> nm: 'a.out': No such file
>>
>>
>>
> from
>
> nm `find build -name '*bcm283x_dwc_fdt*.o`
>
> the this is the first issue you have to resolve. Read the man pages of nm
> and find to figure out what these commands do.
>
> You must have object files for all your driver modules.
>
>
I understood the problem. Driver for bcm283x is no getting built. Is there
any documentation availible for porting a driver to rtems-libbsd ? So that
I can verify necessary steps for the code I cherry-picked or if required do
the process from scratch.


> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail  : sebastian.hu...@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Errors while building USB DWC OTG driver

2016-05-25 Thread Deval Shah
This might help for debugging.

1. Code on which I am building raspberrypi BSP
https://github.com/deval-maker/rtems-libbsd
2. Testsuits whcih contains #include
 or #include
 are having this redefination error.

On Wed, May 25, 2016 at 1:49 PM, Deval Shah <deval.ma...@gmail.com> wrote:

> I got the following result.
>
> nm: 'a.out': No such file
>
> I searched a bit. And got to know that DWG OTG was already ported to RTEMS
> by this commit
> https://github.com/RTEMS/rtems-libbsd/commit/ba446132d4e9efbc1ffd7f4dc4fbfde7f531b740
> .
>
>
> So when I cherry-picked, somewhere, some devices or resources are getting
> redefined.
>
> Any suggestion on how to proceed ?
>
> On Wed, May 25, 2016 at 1:17 PM, Sebastian Huber <
> sebastian.hu...@embedded-brains.de> wrote:
>
>>
>>
>> On 25/05/16 09:12, Deval Shah wrote:
>>
>>> That is here in this commit
>>> https://github.com/gtament/rtems-libbsd/commit/173af003ef084acd2391269e3dcabb0954053289.
>>>
>>>
>>
>>
>> I don't see an obvious error. What gives an
>>
>> nm `find build -name '*bcm283x_dwc_fdt*.o`
>>
>> ?
>>
>>
>> --
>> Sebastian Huber, embedded brains GmbH
>>
>> Address : Dornierstr. 4, D-82178 Puchheim, Germany
>> Phone   : +49 89 189 47 41-16
>> Fax : +49 89 189 47 41-09
>> E-Mail  : sebastian.hu...@embedded-brains.de
>> PGP : Public key available on request.
>>
>> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>>
>>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Errors while building USB DWC OTG driver

2016-05-25 Thread Deval Shah
I got the following result.

nm: 'a.out': No such file

I searched a bit. And got to know that DWG OTG was already ported to RTEMS
by this commit
https://github.com/RTEMS/rtems-libbsd/commit/ba446132d4e9efbc1ffd7f4dc4fbfde7f531b740
.


So when I cherry-picked, somewhere, some devices or resources are getting
redefined.

Any suggestion on how to proceed ?

On Wed, May 25, 2016 at 1:17 PM, Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

>
>
> On 25/05/16 09:12, Deval Shah wrote:
>
>> That is here in this commit
>> https://github.com/gtament/rtems-libbsd/commit/173af003ef084acd2391269e3dcabb0954053289.
>>
>>
>
>
> I don't see an obvious error. What gives an
>
> nm `find build -name '*bcm283x_dwc_fdt*.o`
>
> ?
>
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail  : sebastian.hu...@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Errors while building USB DWC OTG driver

2016-05-25 Thread Deval Shah
That is here in this commit
https://github.com/gtament/rtems-libbsd/commit/173af003ef084acd2391269e3dcabb0954053289
.

On Wed, May 25, 2016 at 10:58 AM, Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> Hello Deval,
>
> where is this DWC OTG driver code? The driver must have the right
> DRIVER_MODULE() and MODULE_DEPEND() definitions.
>
> On 24/05/16 20:04, Deval Shah wrote:
>
>> Hello,
>>
>> Currently, I am working on porting USB DWC OTG driver on Raspberry Pi.
>> Last year Yurii Shevtsov worked on the same. So, I forked the latest
>> rtems-libbsdand cherry-picked Yurii's commits. While building libbsdusing
>> waf, I got the following error.
>>
>>
>>
>> ---
>> testsuite/arphole/test_main.c.17.o:(.rtemsroset.bsd.nexus.content+0x10):
>> undefined reference to `_bsd_bcm283x_dwcotg_nexusmodule_sys_init'
>> collect2: error: ld returned 1 exit status
>> ...
>>
>> ---
>>
>> This error is observed in all the testsuits which are related to
>> networing. Then according to this wiki
>> https://devel.rtems.org/wiki/GSoC/2015/RaspberryPiUSBSupport, I added
>> following lines to those testsuits.
>>
>> -- #include 
>> -- SYSINIT_NEED_USB_CORE;
>> -- SYSINIT_DRIVER_REFERENCE(bcm283x_dwcotg, nexus);
>>
>> I get the following redefiation error this time.
>>
>> --
>> In file included from
>> /home/gadgetman/development/rtems/rtems-libbsd/testsuite/include/rtems/bsd/test/default-network-init.h:295:0,
>>  from ../../testsuite/arphole/test_main.c:118:
>> /home/gadgetman/development/rtems/rtems-libbsd/rtemsbsd/include/bsp/nexus-devices.h:154:40:
>> error: redefinition of 'bcm283x_dwcotg_res'
>>  static const rtems_bsd_device_resource bcm283x_dwcotg_res[] = {
>>   ^~
>> In file included from ../../testsuite/arphole/test_main.c:57:0:
>> /home/gadgetman/development/rtems/rtems-libbsd/rtemsbsd/include/bsp/nexus-devices.h:154:40:
>> note: previous definition of 'bcm283x_dwcotg_res' was here
>>  static const rtems_bsd_device_resource bcm283x_dwcotg_res[] = {
>>   ^~
>> ...
>>
>> ------
>>
>> Also, looks like the error is only in the testsuits. USB drivers are
>> compiled properly. What is another way to test the port ? Is there any
>> other testsuit available ? Are there any other standard methods to evaluate
>> this ?
>>
>> Thanks in advance,
>> Deval Shah
>>
>>
>>
>> ___
>> devel mailing list
>> devel@rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>>
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail  : sebastian.hu...@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Error while building arm/realview_pbx_a9_qemu BSP

2016-04-14 Thread Deval Shah
On Wed, Apr 6, 2016 at 10:34 PM, Gedare Bloom <ged...@rtems.org> wrote:

> On Wed, Apr 6, 2016 at 10:10 AM, Deval Shah <deval.ma...@gmail.com> wrote:
> >
> >
> > On Wed, Apr 6, 2016 at 7:13 PM, Sebastian Huber
> > <sebastian.hu...@embedded-brains.de> wrote:
> >>
> >>
> >>
> >> On 06/04/16 15:39, Deval Shah wrote:
> >>>
> >>> I am building this using RTEMS 4.12 and latest master branch pulled
> from
> >>> github.
> >>
> >>
> >> I don't know how reliably and fast the github updates are.
> >> Any suggestions about that then ?
> Use git.rtems.org

Yes, this helped. Thank you. Now I am able to build rtems-libbsd for
arm/realview_pbx_a9_qemu BSP.
How can I test it now ?
Is there any other thing to build or explore to get familiarised with the
system before I start GSoC project ?
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Error while building arm/realview_pbx_a9_qemu BSP

2016-04-06 Thread Deval Shah
On Wed, Apr 6, 2016 at 7:13 PM, Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

>
>
> On 06/04/16 15:39, Deval Shah wrote:
>
>> I am building this using RTEMS 4.12 and latest master branch pulled from
>> github.
>>
>
> I don't know how reliably and fast the github updates are.
> Any suggestions about that then ?
>
>>
>> I tried the same thing with RTEMS 4.11 also. I got the similar error.
>> Looks like some files are not getting included/ missing.
>>
>
> For RTEMS 4.11 use the branches for RTEMS and libbsd.

Okay. I will try that.


> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail  : sebastian.hu...@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Error while building arm/realview_pbx_a9_qemu BSP

2016-04-06 Thread Deval Shah
I am building this using RTEMS 4.12 and latest master branch pulled from
github.

I tried the same thing with RTEMS 4.11 also. I got the similar error. Looks
like some files are not getting included/ missing.

On Wed, Apr 6, 2016 at 6:26 PM, Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> Should work now using the latest RTEMS and libbsd master branch.
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail  : sebastian.hu...@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Error while building arm/realview_pbx_a9_qemu BSP

2016-04-05 Thread Deval Shah
Hello,

I am trying to build arm/realview_pbx_a9_qemu with waf. (
https://git.rtems.org/rtems-libbsd/tree/README.waf ) In the last step, it
shows the *following error:*

Build failed
 -> task in 'bsd' failed (exit status 1):

*A part error trace: *

/home/gadgetman/development/rtems/rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-muteximpl.h:
In function 'rtems_bsd_mutex_init':
/home/gadgetman/development/rtems/rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-muteximpl.h:60:38:
error: 'THREAD_QUEUE_DISCIPLINE_PRIORITY' undeclared (first use in this
function)
  _Thread_queue_Initialize(>queue, THREAD_QUEUE_DISCIPLINE_PRIORITY);
  ^~~~

Can anyone help me with this ?

Regards,
Deval Shah
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Participation in GSoC 2016

2016-03-24 Thread Deval Shah
Great ! I will add this to my application. Parallely I was looking for
some other BSP like this. Looks like last year André added support for
SD card by adding the SDHCI and MMC/SD bus drivers from libBSD
successfully 
(https://devel.rtems.org/wiki/GSoC/2015/Final_Report#AndreMarques:RaspberryPiLowLevelPeripheralsandSDCard).
I will build anyone of them (arm/realview_pbx_a9_qemu or SD card) in
my acceptance waiting period and get familiarised with the build
process.

I think from my side my proposal is ready. You can have a look at
that. Kindly suggest if anything alse is missing.

On Thu, Mar 24, 2016 at 7:13 PM, Alan Cudmore <alan.cudm...@gmail.com> wrote:
> The Pi 1/B+ would be a good model to start the USB development with.
>
> I have actually not built the BSD lib myself. But I think this is the place
> to start:
> https://git.rtems.org/rtems-libbsd/tree/libbsd.txt
> https://git.rtems.org/rtems-libbsd/tree/README.waf
> Looks like the arm/realview_pbx_a9_qemu BSP is the one use.
>
> I have run some of the SMP examples on qemu with the
> arm/realview_pbx_a9_qemu_smp BSP and it worked well for me.
>
> Alan
>
>
> On Wed, Mar 23, 2016 at 9:03 AM, Deval Shah <deval.ma...@gmail.com> wrote:
>>
>> On Tue, Mar 22, 2016 at 10:04 PM, Alan Cudmore <alan.cudm...@gmail.com>
>> wrote:
>> > Hi Deval,
>> > Your proposal looks good. I would suggest adding a step where you build
>> > a
>> > known BSP with BSD lib support. It will help you become familiar with
>> > the
>> > development process.
>>
>> Thanks for the suggestion, Alan. I will be adding this to my proposal.
>> Also, which BSP would you recommend that I pick up ? Is there any list
>> of currently added BSPs from which I can choose?
>>
>> > You should also address which Raspberry Pi model you will support. Now
>> > that
>> > there are so many Raspberry Pi models, it might make the project more
>> > complicated:
>> > Original raspberry Pi Model A & A+: a single built in USB port in the
>> > BCM2835 CPU. No ethernet or USB hub.
>> > Raspberry Pi Model B & B+: USB hub and Ethernet in LAN9512 chip.
>> > Raspberry Pi 2 Model B: USB hub and Ethernet in LAN9514 chip.
>> > Raspberry Pi 3 Model B:  I would not worry about this one yet.
>> > Raspberry Pi Zero: A single USB OTG port , no ethernet or USB hub.
>> >
>> > I would pick one of them and get it working before seeing if another
>> > model
>> > could be supported.
>> >
>> > If the Raspberry Pi 1/B+ and 2/B Hubs are functionally the same (
>> > LAN9512
>> > vs. LAN9514 ), this would support the widest range of devices out there.
>> >
>> I was also thinking for that. I have a Raspberry PI 1/B+ and a
>> majority of users have either 1/B+ or 2/B. Probably we can start with
>> 1/B+ and then enable the other models.
>>
>> > If you have time, I would love to see USB support for the BCM2835 on the
>> > Pi
>> > Model A+ and especially the Pi Zero.
>>
>> Sure, I had left some buffer time in my proposal, probably if things
>> goes as per plan that time can be used for USB support for the
>> BCM2835.
>>
>> >
>> > Thanks,
>> > Alan
>> >
>> >
>> > On Tue, Mar 22, 2016 at 8:52 AM, Deval Shah <deval.ma...@gmail.com>
>> > wrote:
>> >>
>> >> Hello,
>> >>
>> >> I have updated my draft proposal and shared on the tracking page. I'm
>> >> sharing it here as well. https://goo.gl/QQiAf6
>> >>
>> >> Sorry, I was busy with my Mid-Semester exams, could not update earlier.
>> >>
>> >> Since this is a draft proposal, it may not be completely polished yet.
>> >> I'd appreciate any comments on it, especially regarding the project
>> >> description
>> >> and timeline.
>> >>
>> >> Thank you.
>> >>
>> >> Regards,
>> >> Deval Shah
>> >>
>> >> On Fri, Mar 11, 2016 at 11:02 PM, Deval Shah <deval.ma...@gmail.com>
>> >> wrote:
>> >> > On Fri, Mar 11, 2016 at 8:33 PM, Gedare Bloom <ged...@gwu.edu> wrote:
>> >> >> On Fri, Mar 11, 2016 at 8:19 AM, Deval Shah <deval.ma...@gmail.com>
>> >> >> wrote:
>> >> >>> Hello everyone!
>> >> >>>
>> >> >>> I went through the links and blogs of the SD card and USB/Ethernet
>> >> >>> project for Raspberry PI. I would like to work 

Re: Participation in GSoC 2016

2016-03-23 Thread Deval Shah
On Tue, Mar 22, 2016 at 10:04 PM, Alan Cudmore <alan.cudm...@gmail.com> wrote:
> Hi Deval,
> Your proposal looks good. I would suggest adding a step where you build a
> known BSP with BSD lib support. It will help you become familiar with the
> development process.

Thanks for the suggestion, Alan. I will be adding this to my proposal.
Also, which BSP would you recommend that I pick up ? Is there any list
of currently added BSPs from which I can choose?

> You should also address which Raspberry Pi model you will support. Now that
> there are so many Raspberry Pi models, it might make the project more
> complicated:
> Original raspberry Pi Model A & A+: a single built in USB port in the
> BCM2835 CPU. No ethernet or USB hub.
> Raspberry Pi Model B & B+: USB hub and Ethernet in LAN9512 chip.
> Raspberry Pi 2 Model B: USB hub and Ethernet in LAN9514 chip.
> Raspberry Pi 3 Model B:  I would not worry about this one yet.
> Raspberry Pi Zero: A single USB OTG port , no ethernet or USB hub.
>
> I would pick one of them and get it working before seeing if another model
> could be supported.
>
> If the Raspberry Pi 1/B+ and 2/B Hubs are functionally the same ( LAN9512
> vs. LAN9514 ), this would support the widest range of devices out there.
>
I was also thinking for that. I have a Raspberry PI 1/B+ and a
majority of users have either 1/B+ or 2/B. Probably we can start with
1/B+ and then enable the other models.

> If you have time, I would love to see USB support for the BCM2835 on the Pi
> Model A+ and especially the Pi Zero.

Sure, I had left some buffer time in my proposal, probably if things
goes as per plan that time can be used for USB support for the
BCM2835.

>
> Thanks,
> Alan
>
>
> On Tue, Mar 22, 2016 at 8:52 AM, Deval Shah <deval.ma...@gmail.com> wrote:
>>
>> Hello,
>>
>> I have updated my draft proposal and shared on the tracking page. I'm
>> sharing it here as well. https://goo.gl/QQiAf6
>>
>> Sorry, I was busy with my Mid-Semester exams, could not update earlier.
>>
>> Since this is a draft proposal, it may not be completely polished yet.
>> I'd appreciate any comments on it, especially regarding the project
>> description
>> and timeline.
>>
>> Thank you.
>>
>> Regards,
>> Deval Shah
>>
>> On Fri, Mar 11, 2016 at 11:02 PM, Deval Shah <deval.ma...@gmail.com>
>> wrote:
>> > On Fri, Mar 11, 2016 at 8:33 PM, Gedare Bloom <ged...@gwu.edu> wrote:
>> >> On Fri, Mar 11, 2016 at 8:19 AM, Deval Shah <deval.ma...@gmail.com>
>> >> wrote:
>> >>> Hello everyone!
>> >>>
>> >>> I went through the links and blogs of the SD card and USB/Ethernet
>> >>> project for Raspberry PI. I would like to work for the USB/Ethernet
>> >>> support project.
>> >>>
>> >>> I have prepared a draft of the timeline as follows:
>> >>>
>> >>> Acceptance Waiting Period:
>> >>> Understanding previous year's GSOC work
>> >>>
>> >>> First Half:
>> >>> completing USB support for RPI
>> >>> Testing USB and add drivers for HIDs like Mouse and Keyboard
>> >>>
>> >>> Second Half:
>> >>> Adding Ethernet Support
>> >>> Testing (ARP, PING, DHCP, FTP, TFTP)
>> >>> Adding support for lwIP (since it is already ported to BBB, this
>> >>> should not take more time)
>> >>>
>> >> Timeline seems good. Is the USB support available from freebsd for the
>> >> libbsd codebase?
>> >
>> > Yes. libbsd has support for USB.
>> > Last year issues were in porting the driver (
>> > http://gtament-rtems.blogspot.in/2015/06/my-progress-report.html ).
>> >
>> >>> If we have wifi support in RTEMS, can support of a USB wifi module be
>> >>> added to the project?
>> >>>
>> >> I haven't seen any one using wifi yet.
>> >>
>> >>> I'd really appreciate any feedback on my deliverables, especially
>> >>> regarding the feasibility of doing it in this time frame. If there is
>> >>> anything I may have missed out or anything else I should consider as a
>> >>> part of this, I'd be really glad if someone could point that out, so
>> >>> as to increase my chances of selection.
>> >>>
>> >>> A quick question: How can I add my name to the tracking list @
>> >>> https://devel.rtems.org/wiki/GSoC/2016 ?
>> >>>
>> >> You need to reg

Re: Participation in GSoC 2016

2016-03-22 Thread Deval Shah
Hello,

I have updated my draft proposal and shared on the tracking page. I'm
sharing it here as well. https://goo.gl/QQiAf6

Sorry, I was busy with my Mid-Semester exams, could not update earlier.

Since this is a draft proposal, it may not be completely polished yet.
I'd appreciate any comments on it, especially regarding the project description
and timeline.

Thank you.

Regards,
Deval Shah

On Fri, Mar 11, 2016 at 11:02 PM, Deval Shah <deval.ma...@gmail.com> wrote:
> On Fri, Mar 11, 2016 at 8:33 PM, Gedare Bloom <ged...@gwu.edu> wrote:
>> On Fri, Mar 11, 2016 at 8:19 AM, Deval Shah <deval.ma...@gmail.com> wrote:
>>> Hello everyone!
>>>
>>> I went through the links and blogs of the SD card and USB/Ethernet
>>> project for Raspberry PI. I would like to work for the USB/Ethernet
>>> support project.
>>>
>>> I have prepared a draft of the timeline as follows:
>>>
>>> Acceptance Waiting Period:
>>> Understanding previous year's GSOC work
>>>
>>> First Half:
>>> completing USB support for RPI
>>> Testing USB and add drivers for HIDs like Mouse and Keyboard
>>>
>>> Second Half:
>>> Adding Ethernet Support
>>> Testing (ARP, PING, DHCP, FTP, TFTP)
>>> Adding support for lwIP (since it is already ported to BBB, this
>>> should not take more time)
>>>
>> Timeline seems good. Is the USB support available from freebsd for the
>> libbsd codebase?
>
> Yes. libbsd has support for USB.
> Last year issues were in porting the driver (
> http://gtament-rtems.blogspot.in/2015/06/my-progress-report.html ).
>
>>> If we have wifi support in RTEMS, can support of a USB wifi module be
>>> added to the project?
>>>
>> I haven't seen any one using wifi yet.
>>
>>> I'd really appreciate any feedback on my deliverables, especially
>>> regarding the feasibility of doing it in this time frame. If there is
>>> anything I may have missed out or anything else I should consider as a
>>> part of this, I'd be really glad if someone could point that out, so
>>> as to increase my chances of selection.
>>>
>>> A quick question: How can I add my name to the tracking list @
>>> https://devel.rtems.org/wiki/GSoC/2016 ?
>>>
>> You need to register an account to edit the page through link at the bottom.
>> Okay, Thank you.
>>> Deval Shah
>>>
>>> On Tue, Mar 1, 2016 at 3:07 AM, André Marques
>>> <andre.lousa.marq...@gmail.com> wrote:
>>>> Hello Jan and Deval,
>>>>
>>>> Às 20:24 de 29-02-2016, Jan Sommer escreveu:
>>>>>
>>>>> Hi,
>>>>>
>>>>> If you take a look here:
>>>>> https://devel.rtems.org/wiki/GSoC/2015#StudentsSummerofCodeTrackingTable 
>>>>> you
>>>>> can find the links to the reports and repositories of the previous GSoC.
>>>>> Yurii Shevtsov was doing the work on the Ethernet/USB part for the pi.
>>>>> Andre Marques worked on the SPI and SD-Card driver.
>>>>
>>>>
>>>> I have updated a bit the Raspberry Open Projects page with the state of the
>>>> low level peripherals project, and provided links to the state of each of
>>>> the other projects (the wiki pages of the students working on them last
>>>> year, which also include their blogs and githubs).
>>>>
>>>> https://devel.rtems.org/wiki/Developer/Projects/Open/ImproveRaspberryPiBSP
>>>>
>>>>  The other 3 raspberry projects I do not know exactly their current state,
>>>> but they already have some work done (just not in the RTEMS tree yet).
>>>>
>>>> It seems that only GPIO, I2C and SPI were merged last year.
>>>>
>>>>> Cheers,
>>>>>
>>>>> Jan
>>>>>
>>>>> Am Tuesday 01 March 2016, 01:15:24 schrieb Deval Shah:
>>>>>>
>>>>>> It looks like there are more useful things in pipeline before raspberry
>>>>>> pi
>>>>>> cam support.
>>>>>>
>>>>>> Can anybody give me pointers/links to refer for porting ethernet support
>>>>>> and SD card support?
>>>>
>>>>
>>>> For the last year efforts on the SD card support you can refer to:
>>>>
>>>> https://devel.rtems.org/wiki/GSoC/2015/RaspberryPi_peripherals_and_SD_card#SDcardsupport
>>>>
>>>>
>>>>>>
>&g

Re: Participation in GSoC 2016

2016-03-11 Thread Deval Shah
On Fri, Mar 11, 2016 at 8:33 PM, Gedare Bloom <ged...@gwu.edu> wrote:
> On Fri, Mar 11, 2016 at 8:19 AM, Deval Shah <deval.ma...@gmail.com> wrote:
>> Hello everyone!
>>
>> I went through the links and blogs of the SD card and USB/Ethernet
>> project for Raspberry PI. I would like to work for the USB/Ethernet
>> support project.
>>
>> I have prepared a draft of the timeline as follows:
>>
>> Acceptance Waiting Period:
>> Understanding previous year's GSOC work
>>
>> First Half:
>> completing USB support for RPI
>> Testing USB and add drivers for HIDs like Mouse and Keyboard
>>
>> Second Half:
>> Adding Ethernet Support
>> Testing (ARP, PING, DHCP, FTP, TFTP)
>> Adding support for lwIP (since it is already ported to BBB, this
>> should not take more time)
>>
> Timeline seems good. Is the USB support available from freebsd for the
> libbsd codebase?

Yes. libbsd has support for USB.
Last year issues were in porting the driver (
http://gtament-rtems.blogspot.in/2015/06/my-progress-report.html ).

>> If we have wifi support in RTEMS, can support of a USB wifi module be
>> added to the project?
>>
> I haven't seen any one using wifi yet.
>
>> I'd really appreciate any feedback on my deliverables, especially
>> regarding the feasibility of doing it in this time frame. If there is
>> anything I may have missed out or anything else I should consider as a
>> part of this, I'd be really glad if someone could point that out, so
>> as to increase my chances of selection.
>>
>> A quick question: How can I add my name to the tracking list @
>> https://devel.rtems.org/wiki/GSoC/2016 ?
>>
> You need to register an account to edit the page through link at the bottom.
> Okay, Thank you.
>> Deval Shah
>>
>> On Tue, Mar 1, 2016 at 3:07 AM, André Marques
>> <andre.lousa.marq...@gmail.com> wrote:
>>> Hello Jan and Deval,
>>>
>>> Às 20:24 de 29-02-2016, Jan Sommer escreveu:
>>>>
>>>> Hi,
>>>>
>>>> If you take a look here:
>>>> https://devel.rtems.org/wiki/GSoC/2015#StudentsSummerofCodeTrackingTable 
>>>> you
>>>> can find the links to the reports and repositories of the previous GSoC.
>>>> Yurii Shevtsov was doing the work on the Ethernet/USB part for the pi.
>>>> Andre Marques worked on the SPI and SD-Card driver.
>>>
>>>
>>> I have updated a bit the Raspberry Open Projects page with the state of the
>>> low level peripherals project, and provided links to the state of each of
>>> the other projects (the wiki pages of the students working on them last
>>> year, which also include their blogs and githubs).
>>>
>>> https://devel.rtems.org/wiki/Developer/Projects/Open/ImproveRaspberryPiBSP
>>>
>>>  The other 3 raspberry projects I do not know exactly their current state,
>>> but they already have some work done (just not in the RTEMS tree yet).
>>>
>>> It seems that only GPIO, I2C and SPI were merged last year.
>>>
>>>> Cheers,
>>>>
>>>> Jan
>>>>
>>>> Am Tuesday 01 March 2016, 01:15:24 schrieb Deval Shah:
>>>>>
>>>>> It looks like there are more useful things in pipeline before raspberry
>>>>> pi
>>>>> cam support.
>>>>>
>>>>> Can anybody give me pointers/links to refer for porting ethernet support
>>>>> and SD card support?
>>>
>>>
>>> For the last year efforts on the SD card support you can refer to:
>>>
>>> https://devel.rtems.org/wiki/GSoC/2015/RaspberryPi_peripherals_and_SD_card#SDcardsupport
>>>
>>>
>>>>>
>>>>> On Thursday 18 February 2016, soja-li...@aries.uberspace.de <
>>>>> soja-li...@aries.uberspace.de> wrote:
>>>>>
>>>>>> Am 2016-02-18 01:26, schrieb Joel Sherrill:
>>>>>>
>>>>>>> On Feb 17, 2016 6:17 PM, "André Marques"
>>>>>>> <andre.lousa.marq...@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>> [...]
>>>>>>
>>>>>>> Was i2c fully delivered for the new driver framework? I don't recall
>>>>>>>>
>>>>>>>> off-hand.
>>>>>>>>
>>>>>>>> Yes the i2c driver for the Pi uses the new (linux-based) i2c
>>>>>>>> framewo

Re: Participation in GSoC 2016

2016-03-11 Thread Deval Shah
Hello everyone!

I went through the links and blogs of the SD card and USB/Ethernet
project for Raspberry PI. I would like to work for the USB/Ethernet
support project.

I have prepared a draft of the timeline as follows:

Acceptance Waiting Period:
Understanding previous year's GSOC work

First Half:
completing USB support for RPI
Testing USB and add drivers for HIDs like Mouse and Keyboard

Second Half:
Adding Ethernet Support
Testing (ARP, PING, DHCP, FTP, TFTP)
Adding support for lwIP (since it is already ported to BBB, this
should not take more time)

If we have wifi support in RTEMS, can support of a USB wifi module be
added to the project?

I'd really appreciate any feedback on my deliverables, especially
regarding the feasibility of doing it in this time frame. If there is
anything I may have missed out or anything else I should consider as a
part of this, I'd be really glad if someone could point that out, so
as to increase my chances of selection.

A quick question: How can I add my name to the tracking list @
https://devel.rtems.org/wiki/GSoC/2016 ?

Deval Shah

On Tue, Mar 1, 2016 at 3:07 AM, André Marques
<andre.lousa.marq...@gmail.com> wrote:
> Hello Jan and Deval,
>
> Às 20:24 de 29-02-2016, Jan Sommer escreveu:
>>
>> Hi,
>>
>> If you take a look here:
>> https://devel.rtems.org/wiki/GSoC/2015#StudentsSummerofCodeTrackingTable you
>> can find the links to the reports and repositories of the previous GSoC.
>> Yurii Shevtsov was doing the work on the Ethernet/USB part for the pi.
>> Andre Marques worked on the SPI and SD-Card driver.
>
>
> I have updated a bit the Raspberry Open Projects page with the state of the
> low level peripherals project, and provided links to the state of each of
> the other projects (the wiki pages of the students working on them last
> year, which also include their blogs and githubs).
>
> https://devel.rtems.org/wiki/Developer/Projects/Open/ImproveRaspberryPiBSP
>
>  The other 3 raspberry projects I do not know exactly their current state,
> but they already have some work done (just not in the RTEMS tree yet).
>
> It seems that only GPIO, I2C and SPI were merged last year.
>
>> Cheers,
>>
>> Jan
>>
>> Am Tuesday 01 March 2016, 01:15:24 schrieb Deval Shah:
>>>
>>> It looks like there are more useful things in pipeline before raspberry
>>> pi
>>> cam support.
>>>
>>> Can anybody give me pointers/links to refer for porting ethernet support
>>> and SD card support?
>
>
> For the last year efforts on the SD card support you can refer to:
>
> https://devel.rtems.org/wiki/GSoC/2015/RaspberryPi_peripherals_and_SD_card#SDcardsupport
>
>
>>>
>>> On Thursday 18 February 2016, soja-li...@aries.uberspace.de <
>>> soja-li...@aries.uberspace.de> wrote:
>>>
>>>> Am 2016-02-18 01:26, schrieb Joel Sherrill:
>>>>
>>>>> On Feb 17, 2016 6:17 PM, "André Marques"
>>>>> <andre.lousa.marq...@gmail.com>
>>>>> wrote:
>>>>>
>>>> [...]
>>>>
>>>>> Was i2c fully delivered for the new driver framework? I don't recall
>>>>>>
>>>>>> off-hand.
>>>>>>
>>>>>> Yes the i2c driver for the Pi uses the new (linux-based) i2c
>>>>>> framework.
>>>>>>
>>>>> 10-bit addressing is untested because I had no compatible slave device.
>>>>>
>>>>>> A detailed report of my last GSOC can be found here:
>>>>>>
>>>>>>
>>>>>>
>>>>>> https://devel.rtems.org/wiki/GSoC/2015/RaspberryPi_peripherals_and_SD_card
>>>>>>
>>>>>> SD card support was started but not completed last year, so it may be
>>>>>>
>>>>> included on a potential Raspberry project. I can help with that if
>>>>> needed.
>>>>>
>>>>> Andres.. Thanks for speaking up. Can you update the project page and
>>>>> link
>>>>> to your blog?
>>>>>
>>>>> What else do you think needs find on the Pi and Pi2?
>>>>>
>>>>>
>>>> Last year there was a GSoC to add ethernet support for the raspberry pi
>>>> via rtems-libbsd, but I think it was never finished.
>>>> Maybe that could be started again?
>>>>
>>>> I haven't researched it yet to know if it is feasible but I am curious
>>>> if
>>>>>
>>>>> the Arduino HW libraries have a clean porting layer which coul

Re: Participation in GSoC 2016

2016-02-29 Thread Deval Shah
It looks like there are more useful things in pipeline before raspberry pi
cam support.

Can anybody give me pointers/links to refer for porting ethernet support
and SD card support?


On Thursday 18 February 2016, soja-li...@aries.uberspace.de <
soja-li...@aries.uberspace.de> wrote:

> Am 2016-02-18 01:26, schrieb Joel Sherrill:
>
>> On Feb 17, 2016 6:17 PM, "André Marques" <andre.lousa.marq...@gmail.com>
>> wrote:
>>
> [...]
>
>> Was i2c fully delivered for the new driver framework? I don't recall
>>>>
>>> off-hand.
>>
>>>
>>>
>>> Yes the i2c driver for the Pi uses the new (linux-based) i2c framework.
>>>
>> 10-bit addressing is untested because I had no compatible slave device.
>>
>>>
>>> A detailed report of my last GSOC can be found here:
>>>
>>>
>>> https://devel.rtems.org/wiki/GSoC/2015/RaspberryPi_peripherals_and_SD_card
>>>
>>> SD card support was started but not completed last year, so it may be
>>>
>> included on a potential Raspberry project. I can help with that if needed.
>>
>> Andres.. Thanks for speaking up. Can you update the project page and link
>> to your blog?
>>
>> What else do you think needs find on the Pi and Pi2?
>>
>>
> Last year there was a GSoC to add ethernet support for the raspberry pi
> via rtems-libbsd, but I think it was never finished.
> Maybe that could be started again?
>
> I haven't researched it yet to know if it is feasible but I am curious if
>> the Arduino HW libraries have a clean porting layer which could provide
>> support for a lot of i2c devices. Is this a wikd goose chase or of
>> potential value?
>>
>>
> Sounds like an interesting idea, but isn't Arduino written in C++?
>
> Best regards,
>
>Jan
>
>
>>> I very much look forward for any pointers on this.
>>>>> I am eager to work for RTEMS organization because I believe my skill
>>>>> set is best suited for this.
>>>>>
>>>>> Thanking you,
>>>>> Deval Shah
>>>>>
>>>>> ___
>>>>> devel mailing list
>>>>> devel@rtems.org
>>>>> http://lists.rtems.org/mailman/listinfo/devel
>>>>>
>>>>
>>>
>>> --André Marques
>>>
>>>
>>> ___
>>> 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
>>
> ___
> 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

Seeking Projects

2015-07-17 Thread Deval Shah
Hello,

I am currently perusing electronics engineering (currently in final year)
from BITS-Pilani University. I love embedded systems and system
programming.
I want to contribute to opensource community and for that I am looking for
projects related to real time embedded systems.

skills: C programming, Computer architecture, bash scripting, Python, basic
understanding of Linux kernel.

In addition I have a Raspberry PI B+ board. So project related to it will
be more helpful for me to practice learn stuff.

Thank you for your help and support.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel