Basic IEEE802.11 (WiFi, WLAN) support for RTEMS (libbsd)
Hello, we added a basic IEEE802.11 (WiFi, WLAN) support for RTEMS via libbsd. We only tested a RTL8192 based USB device so far (without encryption). You have to add SYSINIT_MODULE_REFERENCE(wlan_ratectl_none); SYSINIT_MODULE_REFERENCE(wlan_sta); SYSINIT_MODULE_REFERENCE(wlan_amrr); SYSINIT_DRIVER_REFERENCE(rtwn_usb, uhub); SYSINIT_REFERENCE(rtwn_rtl8192cfwT); to the libbsd configuration to test it. This is still work in progress. -- 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
[PATCH] Complete STACK_CHECKER_EXTENSION
Hello guys, I am not sure if that's the correct place to send/discuss fixes, if not just say the word. Remove warnings when using STACK_CHECKER_EXTENSION. Fixes #2889 --- cpukit/libmisc/stackchk/stackchk.h | 1 + 1 file changed, 1 insertion(+) diff --git a/cpukit/libmisc/stackchk/stackchk.h b/cpukit/libmisc/stackchk/stackchk.h index 8ad1733..16fc4f9 100644 --- a/cpukit/libmisc/stackchk/stackchk.h +++ b/cpukit/libmisc/stackchk/stackchk.h @@ -128,6 +128,7 @@ void rtems_stack_checker_switch_extension( 0, /* task_begin */ \ 0, /* task_exitted */ \ 0 /* rtems_stack_checker_fatal_extension */, /* fatal*/ \ + 0, /* terminate*/ \ } #ifdef __cplusplus -- 2889-Complete-STACK_CHECKER_EXTENSION.patch Description: Binary data ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH v4] rtems: Fix _Rate_monotonic_Renew_deadline()
The end of the comment should be "close #2885". I saw that the ticket was closed as well. 2017-01-30 8:16 GMT+01:00 Sebastian Huber < sebastian.hu...@embedded-brains.de>: > Thanks, I checked this in with sp78 renamed to sprmsched02. > > On 27/01/17 23:15, Kuan-Hsun Chen wrote: > >> Prepare a precondition to prevent the potential integer overflow. >> >> Remove one redundant parameter in _Rate_monotonic_Renew_deadline(). >> >> sptests/sp78: Create >> A test case for checking the overflow condition of postponed_jobs >> in rtems_rate_monotonic_period_status. >> >> Close #2885. >> > > -- > 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: [PATCH v4] rtems: Fix _Rate_monotonic_Renew_deadline()
On 30/01/17 14:22, Kuan Hsun Chen wrote: The end of the comment should be "close #2885". I saw that the ticket was closed as well. I closed the ticket manually, since I was not sure if everything was complete. -- 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: [PATCH 2/8] Adding LPC32XX USB OHCI support
It probably does but here is my reasoning for a new file. 1. The latest FREEBSD master has support for the lpc32xx where the 9.2 branch did not. It's easy to port the already existing code (i.e. MAC driver, OHCI, MMC, etc...). 2. The ohci_lpc.c driver was not using FREEBSD's bus resources which was different from other drivers. 3. The logic to probe, attach, detach, suspend, and resume was taken from the ohci_lpc.c driver but used the hardware access functions provided by the latest FREEBSD. Logically the drivers are the same but the lpc_ohci.c driver uses the FREEBSD LPC interface (with the caveat of the "struct usb_otg_transceiver" interface). Ideally the LPC USB OTG I2C code should be moved to an I2C driver. An USB OTG transceiver driver should be created to probe for the ISP1301/STOTG04E devices. However, I did not go to this level. Kevin Kirspel Electrical Engineer - Sr. Staff Idexx Roswell 235 Hembree Park Drive Roswell GA 30076 Tel: (770)-510- ext. 81642 Direct: (770)-688-1642 Fax: (770)-510-4445 -Original Message- From: Sebastian Huber [mailto:sebastian.hu...@embedded-brains.de] Sent: Monday, January 30, 2017 1:49 AM To: Kirspel, Kevin ; devel@rtems.org Subject: Re: [PATCH 2/8] Adding LPC32XX USB OHCI support We already have an rtemsbsd/sys/dev/usb/controller/ohci_lpc.c it used to work with the LPC3200. On 27/01/17 06:32, Kevin Kirspel wrote: > --- > rtemsbsd/sys/dev/usb/controller/lpc_ohci.c | 495 > + > 1 file changed, 495 insertions(+) > create mode 100755 rtemsbsd/sys/dev/usb/controller/lpc_ohci.c -- 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
Documentation: Locking protocols and thread queues
Hello, I would like to update the documentation of the locking protocols (priority ceiling, priority inheritance, OMIP, MrsP) and the thread queues. Since this is API independent I think the Semaphore Manager chapter is the wrong place. Should I add this to the Key Concepts? -- 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: GSoC Mentors / Projects of Interest
Yes that would be much nicer. Maybe we can get potential GSoC Students to do the work ;) On Mon, Jan 30, 2017 at 1:40 AM, Sebastian Huber wrote: > Maybe we should move all this open projects wiki stuff into tickets with > some sort of "GSoC" tag. > > -- > 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
[PATCH 02/10] Adding LPC32XX USB OHCI support
--- rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c | 499 + 1 file changed, 499 insertions(+) create mode 100755 rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c diff --git a/rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c b/rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c new file mode 100755 index 000..dca99c2 --- /dev/null +++ b/rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c @@ -0,0 +1,499 @@ +/*- + * Copyright (c) 2011 Jakub Wojciech Klama + * 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 + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#if defined(LIBBSP_ARM_LPC32XX_BSP_H) + +#ifdef BSP_USB_OTG_TRANSCEIVER_I2C_ADDR +#include +#endif /* BSP_USB_OTG_TRANSCEIVER_I2C_ADDR */ + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#defineI2C_START_BIT (1 << 8) +#defineI2C_STOP_BIT(1 << 9) +#defineI2C_READ0x01 +#defineI2C_WRITE 0x00 +#defineDUMMY_BYTE 0x55 + +#definelpc_otg_read_4(_sc, _reg) \ +bus_space_read_4(_sc->sc_io_tag, _sc->sc_io_hdl, _reg) +#definelpc_otg_write_4(_sc, _reg, _value) \ +bus_space_write_4(_sc->sc_io_tag, _sc->sc_io_hdl, _reg, _value) +#definelpc_otg_wait_write_4(_sc, _wreg, _sreg, _value) \ +do { \ + lpc_otg_write_4(_sc, _wreg, _value);\ + while ((lpc_otg_read_4(_sc, _sreg) & _value) != _value);\ +} while (0); + +static int lpc_ohci_probe(device_t dev); +static int lpc_ohci_attach(device_t dev); +static int lpc_ohci_detach(device_t dev); + +static void lpc_usb_module_enable(device_t dev, struct ohci_softc *); +static void lpc_usb_module_disable(device_t dev, struct ohci_softc *); +static void lpc_usb_pin_config(device_t dev, struct ohci_softc *); +static void lpc_usb_host_clock_enable(device_t dev, struct ohci_softc *); +static void lpc_otg_status_and_control(device_t dev, struct ohci_softc *); +static rtems_interval lpc_usb_timeout_init(void); +static bool lpc_usb_timeout_not_expired(rtems_interval start); +static int lpc_otg_clk_ctrl(device_t dev, struct ohci_softc *sc, uint32_t otg_clk_ctrl); +static int lpc_otg_i2c_wait_for_receive_fifo_not_empty(struct ohci_softc *sc); +static int lpc_otg_i2c_wait_for_transaction_done(struct ohci_softc *sc); +static int lpc_otg_i2c_read(const struct usb_otg_transceiver *self, uint8_t reg_addr, uint8_t *value); +static int lpc_otg_i2c_write(const struct usb_otg_transceiver *self, uint8_t reg_addr, uint8_t value); + +static int +lpc_ohci_probe(device_t dev) +{ + + device_set_desc(dev, "LPC32x0 USB OHCI controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +lpc_ohci_attach(device_t dev) +{ + struct ohci_softc *sc = device_get_softc(dev); + int err; + int eno; + int rid; + int i = 0; + uint32_t usbctrl; + uint32_t otgstatus; + + sc->sc_bus.parent = dev; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = OHCI_MAX_DEVICES; + sc->sc_bus.dma_bits = 32; + + if (usb_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(dev), + &ohci_iterate_hw_softc)) + return (ENOMEM); + + rid = 0; +
[PATCH 04/10] Add support for ordering the initialization of Nexus devices. This can be used to make sure a device is initialized before a dependant device.
--- freebsd/sys/sys/linker_set.h | 6 +- rtemsbsd/include/rtems/bsd/bsd.h | 6 ++ 2 files changed, 11 insertions(+), 1 deletion(-) mode change 100644 => 100755 freebsd/sys/sys/linker_set.h mode change 100644 => 100755 rtemsbsd/include/rtems/bsd/bsd.h diff --git a/freebsd/sys/sys/linker_set.h b/freebsd/sys/sys/linker_set.h old mode 100644 new mode 100755 index 918d724..a310b06 --- a/freebsd/sys/sys/linker_set.h +++ b/freebsd/sys/sys/linker_set.h @@ -77,7 +77,11 @@ #define RTEMS_BSD_DEFINE_SET_ITEM(set, sym, type) \ static type const __set_##set##_sym_##sym \ - __section(".rtemsroset.bsd." __STRING(set) ".content") __used + __section(".rtemsroset.bsd." __STRING(set) ".content.1") __used + +#define RTEMS_BSD_DEFINE_SET_ITEM_ORDERED(set, sym, order, type) \ + static type const __set_##set##_sym_##sym \ + __section(".rtemsroset.bsd." __STRING(set) ".content.0." RTEMS_XSTRING( order )) __used #define __MAKE_SET(set, sym) \ RTEMS_BSD_DEFINE_SET_ITEM(set, sym, const void *) = &sym diff --git a/rtemsbsd/include/rtems/bsd/bsd.h b/rtemsbsd/include/rtems/bsd/bsd.h old mode 100644 new mode 100755 index 0968062..2e89dce --- a/rtemsbsd/include/rtems/bsd/bsd.h +++ b/rtemsbsd/include/rtems/bsd/bsd.h @@ -83,6 +83,12 @@ typedef struct { { #name, unit, (resource_count), (resources), \ &SYSINIT_ENTRY_NAME(name##_nexusmodule) } +#define RTEMS_BSD_DEFINE_NEXUS_DEVICE_ORDERED(name, unit, order, resource_count, resources) \ +extern struct sysinit SYSINIT_ENTRY_NAME(name##_nexusmodule); \ +RTEMS_BSD_DEFINE_SET_ITEM_ORDERED(nexus, name##unit, order, rtems_bsd_device) = \ +{ #name, unit, (resource_count), (resources), \ +&SYSINIT_ENTRY_NAME(name##_nexusmodule) } + rtems_status_code rtems_bsd_initialize(void); /** -- 1.9.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 10/10] Add support for LPC32XX cache
--- rtemsbsd/include/machine/rtems-bsd-cache.h | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) mode change 100644 => 100755 rtemsbsd/include/machine/rtems-bsd-cache.h diff --git a/rtemsbsd/include/machine/rtems-bsd-cache.h b/rtemsbsd/include/machine/rtems-bsd-cache.h old mode 100644 new mode 100755 index b8c4ce7..bd496f9 --- a/rtemsbsd/include/machine/rtems-bsd-cache.h +++ b/rtemsbsd/include/machine/rtems-bsd-cache.h @@ -42,15 +42,12 @@ #include -#if defined(LIBBSP_ARM_LPC24XX_BSP_H) +#if defined(LIBBSP_ARM_LPC24XX_BSP_H) || (defined(LIBBSP_ARM_LPC32XX_BSP_H) && defined(LPC32XX_DISABLE_MMU)) /* No cache */ #elif defined(LIBBSP_ARM_ALTERA_CYCLONE_V_BSP_H) || \ - defined(LIBBSP_ARM_XILINX_ZYNQ_BSP_H) + defined(LIBBSP_ARM_XILINX_ZYNQ_BSP_H) || (defined(LIBBSP_ARM_LPC32XX_BSP_H) && !defined(LPC32XX_DISABLE_MMU)) /* With cache, no coherency support in hardware */ #define CPU_DATA_CACHE_ALIGNMENT 32 -#elif defined(LIBBSP_ARM_LPC32XX_BSP_H) - /* With cache, no coherency support in hardware */ - #include #elif defined(__GEN83xx_BSP_h) /* With cache, coherency support in hardware */ #endif -- 1.9.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 05/10] Adding support for LPC32XX network driver and phy
--- freebsd/sys/arm/lpc/if_lpe.c | 178 + freebsd/sys/arm/lpc/lpc_pwr.c | 8 ++ freebsd/sys/dev/mii/icsphy.c | 3 + rtemsbsd/include/rtems/bsd/local/miidevs.h | 2 + 4 files changed, 191 insertions(+) mode change 100644 => 100755 freebsd/sys/arm/lpc/if_lpe.c mode change 100644 => 100755 freebsd/sys/arm/lpc/lpc_pwr.c mode change 100644 => 100755 freebsd/sys/dev/mii/icsphy.c mode change 100644 => 100755 rtemsbsd/include/rtems/bsd/local/miidevs.h diff --git a/freebsd/sys/arm/lpc/if_lpe.c b/freebsd/sys/arm/lpc/if_lpe.c old mode 100644 new mode 100755 index 76b794f..69e24ae --- a/freebsd/sys/arm/lpc/if_lpe.c +++ b/freebsd/sys/arm/lpc/if_lpe.c @@ -43,7 +43,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifndef __rtems__ #include +#endif /* __rtems__ */ #include #include @@ -55,8 +57,10 @@ __FBSDID("$FreeBSD$"); #include +#ifndef __rtems__ #include #include +#endif /* __rtems__ */ #include #include @@ -66,6 +70,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef __rtems__ +#include +#endif /* __rtems__ */ #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ @@ -80,13 +87,17 @@ struct lpe_dmamap_arg { struct lpe_rxdesc { struct mbuf * lpe_rxdesc_mbuf; +#ifndef __rtems__ bus_dmamap_tlpe_rxdesc_dmamap; +#endif /* __rtems__ */ }; struct lpe_txdesc { int lpe_txdesc_first; struct mbuf * lpe_txdesc_mbuf; +#ifndef __rtems__ bus_dmamap_tlpe_txdesc_dmamap; +#endif /* __rtems__ */ }; struct lpe_chain_data { @@ -122,7 +133,9 @@ struct lpe_ring_data { struct lpe_softc { struct ifnet * lpe_ifp; struct mtx lpe_mtx; +#ifndef __rtems__ phandle_t lpe_ofw; +#endif /* __rtems__ */ device_tlpe_dev; device_tlpe_miibus; uint8_t lpe_enaddr[6]; @@ -192,11 +205,13 @@ static int lpe_probe(device_t dev) { +#ifndef __rtems__ if (!ofw_bus_status_okay(dev)) return (ENXIO); if (!ofw_bus_is_compatible(dev, "lpc,ethernet")) return (ENXIO); +#endif /* __rtems__ */ device_set_desc(dev, "LPC32x0 10/100 Ethernet"); return (BUS_PROBE_DEFAULT); @@ -211,6 +226,7 @@ lpe_attach(device_t dev) uint32_t val; sc->lpe_dev = dev; +#ifndef __rtems__ sc->lpe_ofw = ofw_bus_get_node(dev); i = OF_getprop(sc->lpe_ofw, "local-mac-address", (void *)&sc->lpe_enaddr, 6); @@ -222,6 +238,9 @@ lpe_attach(device_t dev) sc->lpe_enaddr[4] = 0x44; sc->lpe_enaddr[5] = 0x55; } +#else /* __rtems__ */ + rtems_bsd_get_mac_address(device_get_name(sc->lpe_dev), device_get_unit(sc->lpe_dev), &sc->lpe_enaddr); +#endif /* __rtems__ */ mtx_init(&sc->lpe_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); @@ -275,16 +294,33 @@ lpe_attach(device_t dev) } /* Enable Ethernet clock */ +#ifndef __rtems__ lpc_pwr_write(dev, LPC_CLKPWR_MACCLK_CTRL, LPC_CLKPWR_MACCLK_CTRL_REG | LPC_CLKPWR_MACCLK_CTRL_SLAVE | LPC_CLKPWR_MACCLK_CTRL_MASTER | LPC_CLKPWR_MACCLK_CTRL_HDWINF(3)); +#else /* __rtems__ */ +#ifdef LPC32XX_ETHERNET_RMII + lpc_pwr_write(dev, LPC_CLKPWR_MACCLK_CTRL, + LPC_CLKPWR_MACCLK_CTRL_REG | + LPC_CLKPWR_MACCLK_CTRL_SLAVE | + LPC_CLKPWR_MACCLK_CTRL_MASTER | + LPC_CLKPWR_MACCLK_CTRL_HDWINF(3)); +#else + lpc_pwr_write(dev, LPC_CLKPWR_MACCLK_CTRL, + LPC_CLKPWR_MACCLK_CTRL_REG | + LPC_CLKPWR_MACCLK_CTRL_SLAVE | + LPC_CLKPWR_MACCLK_CTRL_MASTER | + LPC_CLKPWR_MACCLK_CTRL_HDWINF(1)); +#endif +#endif /* __rtems__ */ /* Reset chip */ lpe_reset(sc); /* Initialize MII */ +#ifndef __rtems__ val = lpe_read_4(sc, LPE_COMMAND); lpe_write_4(sc, LPE_COMMAND, val | LPE_COMMAND_RMII); @@ -294,6 +330,14 @@ lpe_attach(device_t dev) device_printf(dev, "cannot find PHY\n"); goto fail; } +#else /* __rtems__ */ + if (mii_attach(dev, &sc->lpe_miibus, ifp, lpe_ifmedia_upd, + lpe_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, 0)) { + device_printf(dev, "cannot find PHY\n"); + goto fail; + } +#endif /* __rtems__ */ lpe_dma_alloc(sc); @@ -388,7 +432,9 @@ lpe_miibus_statchg(device_t dev) struct lpe_softc *sc = device_get_softc(dev); struct mii_data *mii = device_get_softc(sc->lpe_miibus); +#ifndef __rtems__ lpe_lock(sc); +#endif /* __rtems__ */ if ((mii->mii_media_status & IFM_ACTIVE) && (mii->mii_media_status & IFM_AVALID)) @@ -396,7 +442,9 @@ lpe_miibus_stat
[PATCH 09/10] Add nexus device entries
--- rtemsbsd/include/bsp/nexus-devices.h | 12 + rtemsbsd/include/machine/rtems-bsd-nexus-bus.h | 75 ++ 2 files changed, 87 insertions(+) mode change 100644 => 100755 rtemsbsd/include/bsp/nexus-devices.h mode change 100644 => 100755 rtemsbsd/include/machine/rtems-bsd-nexus-bus.h diff --git a/rtemsbsd/include/bsp/nexus-devices.h b/rtemsbsd/include/bsp/nexus-devices.h old mode 100644 new mode 100755 index 0b4ec62..b681434 --- a/rtemsbsd/include/bsp/nexus-devices.h +++ b/rtemsbsd/include/bsp/nexus-devices.h @@ -46,6 +46,18 @@ RTEMS_BSD_DRIVER_SMC0(0x4e00, RVPBXA9_IRQ_ETHERNET); +#elif defined(LIBBSP_ARM_LPC32XX_BSP_H) + +#include + +RTEMS_BSD_DRIVER_LPC32XX_PWR; +RTEMS_BSD_DRIVER_LPC32XX_LPE; +RTEMS_BSD_DRIVER_ICSPHY; +RTEMS_BSD_DRIVER_LPC32XX_OHCI; +SYSINIT_DRIVER_REFERENCE(usbus, ohci); +RTEMS_BSD_DRIVER_USB; +RTEMS_BSD_DRIVER_USB_MASS; + #elif defined(LIBBSP_M68K_GENMCF548X_BSP_H) RTEMS_BSD_DRIVER_FEC; diff --git a/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h b/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h old mode 100644 new mode 100755 index a408c17..299221c --- a/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h +++ b/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h @@ -38,6 +38,7 @@ * * Devices: * RTEMS_BSD_DRIVER_XILINX_ZYNQ_SLCR + * RTEMS_BSD_DRIVER_LPC32XX_PWR * * Buses: * RTEMS_BSD_DRIVER_PC_LEGACY @@ -46,6 +47,7 @@ * RTEMS_BSD_DRIVER_DWCOTG0 * RTEMS_BSD_DRIVER_DWCOTG0_BASE_ADDR *RTEMS_BSD_DRIVER_DWCOTG0_IRQ + * RTEMS_BSD_DRIVER_LPC32XX_OHCI * RTEMS_BSD_DRIVER_DWC_MMC * RTEMS_BSD_DRIVER_MMC * RTEMS_BSD_DRIVER_USB @@ -55,6 +57,7 @@ * RTEMS_BSD_DRIVER_SMC0 *RTEMS_BSD_DRIVER_SMC0_BASE_ADDR *RTEMS_BSD_DRIVER_SMC0_IRQ + * RTEMS_BSD_DRIVER_LPC32XX_LPE * RTEMS_BSD_DRIVER_FEC * RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM0 *RTEMS_BSD_DRIVER_CGEM0_IRQ @@ -73,6 +76,7 @@ * * MMI PHY: * RTEMS_BSD_DRIVER_E1000PHY + * RTEMS_BSD_DRIVER_ICSPHY * RTEMS_BSD_DRIVER_REPHY * RTEMS_BSD_DRIVER_MIPHY */ @@ -115,6 +119,23 @@ extern "C" { &zy7_slcr_res[0]) #endif /* RTEMS_BSD_DRIVER_XILINX_ZYNQ_SLCR */ +/* + * LPC32XX Power Control (PWR). + */ +#if !defined(RTEMS_BSD_DRIVER_LPC32XX_PWR) + #define RTEMS_BSD_DRIVER_LPC32XX_PWR\ +static const rtems_bsd_device_resource lpc_pwr0_res[] = { \ + { \ +.type = RTEMS_BSD_RES_MEMORY, \ +.start_request = 0, \ +.start_actual = LPC32XX_BASE_SYSCON \ + } \ +};\ +RTEMS_BSD_DEFINE_NEXUS_DEVICE_ORDERED(pwr, 0, RTEMS_SYSINIT_ORDER_FIRST, \ + RTEMS_ARRAY_SIZE(lpc_pwr0_res), \ + &lpc_pwr0_res[0]) +#endif /* RTEMS_BSD_DRIVER_LPC32XX_PWR */ + /** ** Physical Buses **/ @@ -155,6 +176,31 @@ extern "C" { #endif /* RTEMS_BSD_DRIVER_DWCOTG0 */ /* + * LPC32XX OHCI. + */ +#if !defined(RTEMS_BSD_DRIVER_LPC32XX_OHCI) + #define RTEMS_BSD_DRIVER_LPC32XX_OHCI \ +static const rtems_bsd_device_resource lpc_ohci0_res[] = { \ + { \ +.type = RTEMS_BSD_RES_MEMORY, \ +.start_request = 0, \ +.start_actual = LPC32XX_BASE_USB\ + }, { \ +.type = RTEMS_BSD_RES_MEMORY, \ +.start_request = 0, \ +.start_actual = (unsigned long)(&LPC32XX_I2C_RX)\ + }, { \ +.type = RTEMS_BSD_RES_IRQ, \ +.start_request = 0, \ +.start_actual = LPC32XX_IRQ_USB_HOST\ + } \ +}; \ +RTEMS_BSD_DEFINE_NEXUS_DEVICE(ohci, 0, \ + RTEMS_ARRAY_SIZE(lpc_ohci0_res), \ + &lpc_ohci0_res[0]) +#endif /* RTEMS_BSD_DRIVER_LPC32XX_OHCI */ + +/* * Designware/Synopsys MMC. */ #if !defined(RTEMS_BSD_DRIVER_DWC_MMC) @@ -214,6 +260,27 @@
[PATCH 08/10] Add LPC32XX LPE0 network driver name
--- testsuite/include/rtems/bsd/test/network-config.h.in | 2 ++ 1 file changed, 2 insertions(+) mode change 100644 => 100755 testsuite/include/rtems/bsd/test/network-config.h.in diff --git a/testsuite/include/rtems/bsd/test/network-config.h.in b/testsuite/include/rtems/bsd/test/network-config.h.in old mode 100644 new mode 100755 index c652e74..c20a735 --- 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_LPC32XX_BSP_H) + #define NET_CFG_INTERFACE_0 "lpe0" #else #define NET_CFG_INTERFACE_0 "lo0" #endif -- 1.9.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 01/10] Adding LPC32XX ethernet driver support
--- freebsd/sys/arm/lpc/if_lpe.c| 1234 +++ freebsd/sys/arm/lpc/if_lpereg.h | 208 +++ freebsd/sys/arm/lpc/lpc_pwr.c | 131 + freebsd/sys/arm/lpc/lpcreg.h| 665 + freebsd/sys/arm/lpc/lpcvar.h| 69 +++ 5 files changed, 2307 insertions(+) create mode 100644 freebsd/sys/arm/lpc/if_lpe.c create mode 100644 freebsd/sys/arm/lpc/if_lpereg.h create mode 100644 freebsd/sys/arm/lpc/lpc_pwr.c create mode 100644 freebsd/sys/arm/lpc/lpcreg.h create mode 100644 freebsd/sys/arm/lpc/lpcvar.h diff --git a/freebsd/sys/arm/lpc/if_lpe.c b/freebsd/sys/arm/lpc/if_lpe.c new file mode 100644 index 000..76b794f --- /dev/null +++ b/freebsd/sys/arm/lpc/if_lpe.c @@ -0,0 +1,1234 @@ +#include + +/*- + * Copyright (c) 2011 Jakub Wojciech Klama + * 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 +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#ifdef DEBUG +#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ +printf(fmt,##args); } while (0) +#else +#define debugf(fmt, args...) +#endif + +struct lpe_dmamap_arg { + bus_addr_t lpe_dma_busaddr; +}; + +struct lpe_rxdesc { + struct mbuf * lpe_rxdesc_mbuf; + bus_dmamap_tlpe_rxdesc_dmamap; +}; + +struct lpe_txdesc { + int lpe_txdesc_first; + struct mbuf * lpe_txdesc_mbuf; + bus_dmamap_tlpe_txdesc_dmamap; +}; + +struct lpe_chain_data { + bus_dma_tag_t lpe_parent_tag; + bus_dma_tag_t lpe_tx_ring_tag; + bus_dmamap_tlpe_tx_ring_map; + bus_dma_tag_t lpe_tx_status_tag; + bus_dmamap_tlpe_tx_status_map; + bus_dma_tag_t lpe_tx_buf_tag; + bus_dma_tag_t lpe_rx_ring_tag; + bus_dmamap_tlpe_rx_ring_map; + bus_dma_tag_t lpe_rx_status_tag; + bus_dmamap_tlpe_rx_status_map; + bus_dma_tag_t lpe_rx_buf_tag; + struct lpe_rxdesc lpe_rx_desc[LPE_RXDESC_NUM]; + struct lpe_txdesc lpe_tx_desc[LPE_TXDESC_NUM]; + int lpe_tx_prod; + int lpe_tx_last; + int lpe_tx_used; +}; + +struct lpe_ring_data { + struct lpe_hwdesc * lpe_rx_ring; + struct lpe_hwstatus * lpe_rx_status; + bus_addr_t lpe_rx_ring_phys; + bus_addr_t lpe_rx_status_phys; + struct lpe_hwdesc * lpe_tx_ring; + struct lpe_hwstatus * lpe_tx_status; + bus_addr_t lpe_tx_ring_phys; + bus_addr_t lpe_tx_status_phys; +}; + +struct lpe_softc { + struct ifnet * lpe_ifp; + struct mtx lpe_mtx; + phandle_t lpe_ofw; + device_tlpe_dev; + device_tlpe_miibus; + uint8_t lpe_enaddr[6]; + struct resource * lpe_mem_res; + struct resource * lpe_irq_res; + void * lpe_intrhand; + bus_space_tag_t lpe_bst; + bus_space_handle_t lpe_bsh; +#defineLPE_FLAG_LINK (1 << 0) + uint32_tlpe_flags; + int lpe_watchdog_timer; + st
[PATCH 07/10] Add nexus device entries and upate waf files
--- libbsd_waf.py | 5 - 1 file changed, 4 insertions(+), 1 deletions(-) diff --git a/libbsd_waf.py b/libbsd_waf.py index ecd87af..ef3150b 100644 --- a/libbsd_waf.py +++ b/libbsd_waf.py @@ -722,7 +722,9 @@ def build(bld): source = objs07_source) libbsd_use += ["objs07"] -source = ['freebsd/sys/arm/xilinx/zy7_slcr.c', +source = ['freebsd/sys/arm/lpc/if_lpe.c', + 'freebsd/sys/arm/lpc/lpc_pwr.c', + 'freebsd/sys/arm/xilinx/zy7_slcr.c', 'freebsd/sys/cam/cam.c', 'freebsd/sys/cam/scsi/scsi_all.c', 'freebsd/sys/crypto/blowfish/bf_ecb.c', @@ -1325,6 +1327,7 @@ def build(bld): 'rtemsbsd/sys/dev/usb/controller/dwc_otg_nexus.c', 'rtemsbsd/sys/dev/usb/controller/ehci_mpc83xx.c', 'rtemsbsd/sys/dev/usb/controller/ohci_lpc.c', + 'rtemsbsd/sys/dev/usb/controller/ohci_lpc32xx.c', 'rtemsbsd/sys/dev/usb/controller/usb_otg_transceiver.c', 'rtemsbsd/sys/dev/usb/controller/usb_otg_transceiver_dump.c', 'rtemsbsd/sys/fs/devfs/devfs_devs.c', -- 1.9.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 03/10] Adding LPC32XX Ethernet and USB OHCI files to script
--- libbsd.py | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libbsd.py b/libbsd.py index 7264ac4..43107ee 100755 --- a/libbsd.py +++ b/libbsd.py @@ -148,6 +148,7 @@ def rtems(mm): 'pppd/utils.c', 'sys/dev/usb/controller/ehci_mpc83xx.c', 'sys/dev/usb/controller/ohci_lpc.c', +'sys/dev/usb/controller/ohci_lpc32xx.c', 'sys/dev/usb/controller/dwc_otg_nexus.c', 'sys/dev/usb/controller/usb_otg_transceiver.c', 'sys/dev/usb/controller/usb_otg_transceiver_dump.c', @@ -1083,6 +1084,9 @@ def dev_net(mm): 'sys/dev/dwc/if_dwc.h', 'sys/dev/dwc/if_dwcvar.h', 'sys/arm/xilinx/zy7_slcr.h', +'sys/arm/lpc/if_lpereg.h', +'sys/arm/lpc/lpcreg.h', +'sys/arm/lpc/lpcvar.h', ] ) mod.addKernelSpaceSourceFiles( @@ -1101,6 +1105,8 @@ def dev_net(mm): 'sys/dev/cadence/if_cgem.c', 'sys/dev/dwc/if_dwc.c', 'sys/arm/xilinx/zy7_slcr.c', +'sys/arm/lpc/lpc_pwr.c', +'sys/arm/lpc/if_lpe.c', ], mm.generator['source']() ) -- 1.9.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 06/10] Add support for LPC32XX USB driver
--- freebsd/sys/dev/usb/controller/ohci.h | 2 - rtemsbsd/sys/dev/usb/controller/ohci_lpc.c | 93 +- rtemsbsd/sys/dev/usb/usb_otg_transceiver.h | 1 + 3 files changed, 3 insertions(+), 93 deletions(-) mode change 100644 => 100755 freebsd/sys/dev/usb/controller/ohci.h mode change 100644 => 100755 rtemsbsd/sys/dev/usb/controller/ohci_lpc.c mode change 100644 => 100755 rtemsbsd/sys/dev/usb/usb_otg_transceiver.h diff --git a/freebsd/sys/dev/usb/controller/ohci.h b/freebsd/sys/dev/usb/controller/ohci.h old mode 100644 new mode 100755 index d020d99..a650ce1 --- a/freebsd/sys/dev/usb/controller/ohci.h +++ b/freebsd/sys/dev/usb/controller/ohci.h @@ -234,9 +234,7 @@ typedef struct ohci_softc { struct ohci_ed *sc_bulk_p_last; struct ohci_ed *sc_isoc_p_last; struct ohci_ed *sc_intr_p_last[OHCI_NO_EDS]; -#ifndef __rtems__ void *sc_intr_hdl; -#endif /* __rtems__ */ device_t sc_dev; bus_size_t sc_io_size; bus_space_tag_t sc_io_tag; diff --git a/rtemsbsd/sys/dev/usb/controller/ohci_lpc.c b/rtemsbsd/sys/dev/usb/controller/ohci_lpc.c old mode 100644 new mode 100755 index a0314c5..de5bf2d --- a/rtemsbsd/sys/dev/usb/controller/ohci_lpc.c +++ b/rtemsbsd/sys/dev/usb/controller/ohci_lpc.c @@ -36,12 +36,9 @@ #include -#if defined(LIBBSP_ARM_LPC24XX_BSP_H) || defined(LIBBSP_ARM_LPC32XX_BSP_H) +#if defined(LIBBSP_ARM_LPC24XX_BSP_H) #include - -#ifdef LIBBSP_ARM_LPC24XX_BSP_H - #include #include @@ -101,92 +98,6 @@ static void lpc_otg_status_and_control(void) OTG_STAT_CTRL = 0x3; } -#endif /* LIBBSP_ARM_LPC24XX_BSP_H */ - -#ifdef LIBBSP_ARM_LPC32XX_BSP_H - -#include - -#define LPC_USB_OHCI_BASE LPC32XX_BASE_USB - -#define LPC_USB_I2C_BASE (&LPC32XX_I2C_RX) - -#define LPC_OTG_CLK_CTRL LPC32XX_OTG_CLK_CTRL - -#define LPC_OTG_CLK_STAT LPC32XX_OTG_CLK_STAT - -#define LPC_USB_OHCI_IRQ LPC32XX_IRQ_USB_HOST - -#define USB_CTRL_SLAVE_HCLK_EN (1U << 24) -#define USB_CTRL_I2C_EN (1U << 23) -#define USB_CTRL_DEV_NEED_CLK_EN (1U << 22) -#define USB_CTRL_HOST_NEED_CLK_EN (1U << 21) -#define USB_CTRL_PC_MASK (0x3U << 19) -#define USB_CTRL_PC_PULL_UP (0x0U << 19) -#define USB_CTRL_PC_BUS_KEEPER (0x1U << 19) -#define USB_CTRL_PC_NONE (0x2U << 19) -#define USB_CTRL_PC_PULL_DOWN (0x3U << 19) -#define USB_CTRL_CLKEN2 (1U << 18) -#define USB_CTRL_CLKEN1 (1U << 17) -#define USB_CTRL_POWER_UP (1U << 16) -#define USB_CTRL_BYPASS (1U << 15) -#define USB_CTRL_DIRECT (1U << 14) -#define USB_CTRL_FEEDBACK (1U << 13) -#define USB_CTRL_P_SHIFT 11 -#define USB_CTRL_P_MASK (0x3U << USB_CTRL_P_SHIFT) -#define USB_CTRL_P_1 (0x0U << USB_CTRL_P_SHIFT) -#define USB_CTRL_P_2 (0x1U << USB_CTRL_P_SHIFT) -#define USB_CTRL_P_4 (0x2U << USB_CTRL_P_SHIFT) -#define USB_CTRL_P_8 (0x3U << USB_CTRL_P_SHIFT) -#define USB_CTRL_N_SHIFT 9 -#define USB_CTRL_N_MASK (0x3U << USB_CTRL_N_SHIFT) -#define USB_CTRL_N_1 (0x0U << USB_CTRL_N_SHIFT) -#define USB_CTRL_N_2 (0x1U << USB_CTRL_N_SHIFT) -#define USB_CTRL_N_3 (0x2U << USB_CTRL_N_SHIFT) -#define USB_CTRL_N_4 (0x3U << USB_CTRL_N_SHIFT) -#define USB_CTRL_M_SHIFT 1 -#define USB_CTRL_M_MASK (0xffU << USB_CTRL_M_SHIFT) -#define USB_CTRL_PLL_LOCK (1U << 0) - -static void lpc_usb_module_enable(void) -{ - LPC32XX_USB_DIV = 0xc; - LPC32XX_USB_CTRL = USB_CTRL_SLAVE_HCLK_EN - | USB_CTRL_PC_BUS_KEEPER - | USB_CTRL_CLKEN1 - | USB_CTRL_POWER_UP - | USB_CTRL_P_2 - | USB_CTRL_N_1 - | (191U << USB_CTRL_M_SHIFT); - while ((LPC32XX_USB_CTRL & USB_CTRL_PLL_LOCK) == 0) { - /* Wait */ - } - LPC32XX_USB_CTRL |= USB_CTRL_CLKEN2; -} - -static void lpc_usb_module_disable(void) -{ - LPC32XX_OTG_CLK_CTRL = 0; - LPC32XX_USB_CTRL = USB_CTRL_PC_BUS_KEEPER; -} - -static void lpc_usb_pin_config(void) -{ - /* Nothing to do */ -} - -static void lpc_usb_host_clock_enable(void) -{ - LPC32XX_USB_CTRL |= USB_CTRL_HOST_NEED_CLK_EN; -} - -static void lpc_otg_status_and_control(void) -{ - LPC32XX_OTG_STAT_CTRL = 0x1; -} - -#endif /* LIBBSP_ARM_LPC32XX_BSP_H */ - static rtems_interval lpc_usb_timeout_init(void) { return rtems_clock_get_ticks_since_boot(); @@ -639,4 +550,4 @@ static devclass_t ohci_devclass; DRIVER_MODULE(ohci, nexus, ohci_driver, ohci_devclass, 0, 0); MODULE_DEPEND(ohci, usb, 1, 1, 1); -#endif /* defined(LIBBSP_ARM_LPC24XX_BSP_H) || defined(LIBBSP_ARM_LPC32XX_BSP_H) */ +#endif /* defined(LIBBSP_ARM_LPC24XX_BSP_H) */ diff --git a/rtemsbsd/sys/dev/usb/usb_otg_transceiver.h b/rtemsbsd/sys/dev/usb/usb_otg_transceiver.h old mode 100644 new mode 100755 index 1e6b738..249d6a7 --- a/rtemsbsd/sys/dev/usb/usb_otg_transceiver.h +++ b/rtemsbsd/sys/dev/usb/usb_otg_transceiver.h @@ -88,6 +88,7 @@ struct usb_otg_transceiver { uint16_t vendor_id; uint16_t product_id; uint8_t i2c_addr; + void* softc; }; int usb_otg_transceiver_read( -- 1.9.1 ___
Re: GSoC Mentors / Projects of Interest
I'll be glad to do it. Please guide me as to how to proceed. On Mon, Jan 30, 2017 at 9:38 PM, Gedare Bloom wrote: > Yes that would be much nicer. Maybe we can get potential GSoC Students > to do the work ;) > > On Mon, Jan 30, 2017 at 1:40 AM, Sebastian Huber > wrote: > > Maybe we should move all this open projects wiki stuff into tickets with > > some sort of "GSoC" tag. > > > > -- > > 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 > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: GSoC Mentors / Projects of Interest
On Thu, Jan 26, 2017 at 11:58 AM, Gedare Bloom wrote: > On Thu, Jan 26, 2017 at 12:13 PM, Kuan Hsun Chen > wrote: > > Hello, > > > > Could we invoke a project for https://git.rtems.org/rtems-schedsim/ > again? > > It could be useful to develop/verify scheduling algorithms. > > > > Quote from Joel: > > "I honestly think the best approach is to build a native gcc/newlib > toolset > > and use that so that the C Library differences should be handled without > > too much effort." > > > That will be fine. The projects needs some clear requirements, > definitions, and plan though. We have had many try to use schedsim > with only a few notable successes. > > To expand on why I said that. For most of its history, RTEMS had few direct dependencies on a C Library. The addition of SMP saw the beginning of a tighter integration of newlib and RTEMS. When schedsim was developed, only the affinity and a couple of other things required work arounds with glibc. Now that we are using more from newlib that originated in FreeBSD such as the time structures. Building a native gcc with newlib at least opens the door to having the same .h files. Beyond that, it is logically building the core of RTEMS as a Linux user space application. The "port" is just sufficient to make the RTEMS code think it is context switching something. But project ideas need to be on the wiki. > > Kuan-Hsun > > > > 2017-01-26 16:50 GMT+01:00 Gedare Bloom : > >> > >> Hello Folks, > >> > >> We have submitted our application to participate as an Org in GSoC > >> 2017. So it is once again time to "Freshen up" our projects page [1] > >> with any projects that you might think are of interest and you may be > >> willing to mentor. If you add a new project please use the Open > >> Project Template and link to the new page from a bullet under an > >> existing topical sub-heading. > >> > >> Relatedly, anyone who is keenly interested in mentoring please reach > >> out to me so I remember to invite you! > >> > >> Gedare > >> > >> [1] https://devel.rtems.org/wiki/Developer/OpenProjects > >> ___ > >> devel mailing list > >> devel@rtems.org > >> http://lists.rtems.org/mailman/listinfo/devel > > > > > > > > > > -- > > M.Sc. Kuan-Hsun Chen > > > > TU Dortmund > > Department of Computer Science 12 > > Design Automation of Embedded Systems > > Otto-Hahn-Strasse 16, Room 102 > > > > 44227 Dortmund > > Germany > > > > Phone: +49 231 755 6124 > > Mail: kuan-hsun.c...@tu-dortmund.de > ___ > 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
[PATCH] rtems: Revise tests: sprmsched01 and spedfsched04
Instead of using the target time and console driver, both tests now use assertions and rtems_rate_monotonic_get_status() to verify the count of postponed jobs. The setting of spedfsched04 is slightly changed. Update #2795 --- testsuites/sptests/spedfsched04/Makefile.am | 2 +- testsuites/sptests/spedfsched04/init.c | 89 testsuites/sptests/spedfsched04/spedfsched04.scn | 27 ++- testsuites/sptests/sprmsched01/Makefile.am | 4 +- testsuites/sptests/sprmsched01/init.c| 74 ++-- testsuites/sptests/sprmsched01/sprmsched01.scn | 55 ++- 6 files changed, 97 insertions(+), 154 deletions(-) diff --git a/testsuites/sptests/spedfsched04/Makefile.am b/testsuites/sptests/spedfsched04/Makefile.am index 39f8210..a39519a 100644 --- a/testsuites/sptests/spedfsched04/Makefile.am +++ b/testsuites/sptests/spedfsched04/Makefile.am @@ -1,6 +1,6 @@ rtems_tests_PROGRAMS = spedfsched04 -spedfsched04_SOURCES = init.c +spedfsched04_SOURCES = init.c ../../support/src/spin.c dist_rtems_tests_DATA = spedfsched04.scn dist_rtems_tests_DATA += spedfsched04.doc diff --git a/testsuites/sptests/spedfsched04/init.c b/testsuites/sptests/spedfsched04/init.c index f80883d..8dd93db 100644 --- a/testsuites/sptests/spedfsched04/init.c +++ b/testsuites/sptests/spedfsched04/init.c @@ -1,24 +1,25 @@ /** - * @brief A heuristic example to demonstrate how the postponed jobs are handled. + * @brief A heuristic example to demonstrate how the postponed jobs are handled in EDF. * * Given two tasks with implicit deadline under EDF policy. - * Task 1 has (4, 5) and task 2 has (4, 6), where (execution time, period/deadline). - * For the simplicity, we only execute the first task twice. + * Task 1 has (400, 500) and task 2 has (450, 550), where (required ticks, period/deadline). + * For the simplicity, we only execute the first task three times. * In the original implementation in v4.11, no matter how many periods are * expired, only one job will be released with a shifted deadline assignment. * - * In this example, the first job of task 2 will be blocked by the second job - * of task 1, so that there at least one following job is postponed. - * Due to overhead/delay, the second following job will be postponed as well. + * In this example, task 2 will be blocked by the second and third jobs + * of task 1, so that there are two jobs are postponed. + * Due to the domino effects, the following jobs of task 2 will be postponed until Job 9. * * If the overrun handling is correct, the period of task 2 changes back to - * normal status at time 22. - * Otherwise, the release time of job 3 is no longer periodic. + * normal status at Job 9. + * Otherwise, the release time of job 3 is no longer periodic + * and there is no more postponed jobs. * */ /* - * COPYRIGHT (c) 2016 Kuan-Hsun Chen. + * COPYRIGHT (c) 2016-2017 Kuan-Hsun Chen. * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -30,23 +31,19 @@ #endif #include -#include - -#include -#include - -#include "tmacros.h" +#include +#include "test_support.h" const char rtems_test_name[] = "SPEDFSCHED 4"; -static const uint32_t Periods[] = { 5000, 6000 }; -static const uint32_t Iterations[] = { 4000, 4000 }; +static const uint32_t Periods[] = { 500, 550 }; +static const uint32_t Iterations[] = { 400, 450 }; static const rtems_name Task_name[] = { rtems_build_name( 'T', 'A', '1', ' ' ), rtems_build_name( 'T', 'A', '2', ' ' ) }; static const rtems_task_priority Prio[3] = { 2, 5 }; -static const uint32_t testnumber = 11; /* stop condition */ +static const uint32_t testnumber = 9; /* stop condition */ static uint32_t tsk_counter[] = { 0, 0 }; static rtems_id Task_id[ 2 ]; @@ -58,35 +55,42 @@ static rtems_task Task( rtems_task_argument argument ) { - rtems_status_code status; - rtems_idRM_period; - rtems_idselfid=rtems_task_self(); - uint32_tstart, end, flag=0, index; - rtems_counter_ticks t0; + rtems_status_code status; + rtems_id RM_period; + rtems_id selfid=rtems_task_self(); + rtems_rate_monotonic_period_statusperiod_status; + uint32_t flag=0; - t0 = rtems_counter_nanoseconds_to_ticks( 100 ); //1ms ticks counter - /*create period*/ + /* create period */ status = rtems_rate_monotonic_create( Task_name[ argument ], &RM_period ); directive_failed( status, "rtems_rate_monotonic_create" ); while ( FOREVER ) { status = rtems_rate_monotonic_period( RM_period, Periods[ argument ] ); -if( flag == 0 && status == RTEMS_TIMEOUT ){ - flag = 1; - printf( "RTEMS_TIMEOUT\n" ); -} else if ( flag == 1 && status == RTEMS_SUCCESSFUL ) { - flag = 0; - printf( "RTEMS_SUCCESSFUL\n" ); -} -
Re: GSoC Mentors / Projects of Interest
On Mon, Jan 30, 2017 at 12:25 PM, Tanu Hari Dixit wrote: > I'll be glad to do it. Please guide me as to how to proceed. > We will need to import each existing Open Project description into a new ticket. It would be best to start with one to "try it out". The project title should be the Summary of the ticket, the text of the project page should be converted into the Description of the ticket, type should be Enhancement, Milestone "Indefinite", and put GSoC into the keywords, and we might want to use some other keywords e.g. to define the project type (e.g. one of: testing, ecosystem, kernel, statistics, BSP, API, libbsd, languages, libraries). The owner should be assigned to one of the mentors if indicated, with others in CC if any, or else set blank. > On Mon, Jan 30, 2017 at 9:38 PM, Gedare Bloom wrote: >> >> Yes that would be much nicer. Maybe we can get potential GSoC Students >> to do the work ;) >> >> On Mon, Jan 30, 2017 at 1:40 AM, Sebastian Huber >> wrote: >> > Maybe we should move all this open projects wiki stuff into tickets with >> > some sort of "GSoC" tag. >> > >> > -- >> > 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 > > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH] rtems: Revise tests: sprmsched01 and spedfsched04
Does this fix a deficiency in the current tests? On Mon, Jan 30, 2017 at 1:34 PM, Kuan-Hsun Chen wrote: > Instead of using the target time and console driver, > both tests now use assertions and rtems_rate_monotonic_get_status() to verify > the count of postponed jobs. > The setting of spedfsched04 is slightly changed. > > Update #2795 > --- > testsuites/sptests/spedfsched04/Makefile.am | 2 +- > testsuites/sptests/spedfsched04/init.c | 89 > > testsuites/sptests/spedfsched04/spedfsched04.scn | 27 ++- > testsuites/sptests/sprmsched01/Makefile.am | 4 +- > testsuites/sptests/sprmsched01/init.c| 74 ++-- > testsuites/sptests/sprmsched01/sprmsched01.scn | 55 ++- > 6 files changed, 97 insertions(+), 154 deletions(-) > > diff --git a/testsuites/sptests/spedfsched04/Makefile.am > b/testsuites/sptests/spedfsched04/Makefile.am > index 39f8210..a39519a 100644 > --- a/testsuites/sptests/spedfsched04/Makefile.am > +++ b/testsuites/sptests/spedfsched04/Makefile.am > @@ -1,6 +1,6 @@ > > rtems_tests_PROGRAMS = spedfsched04 > -spedfsched04_SOURCES = init.c > +spedfsched04_SOURCES = init.c ../../support/src/spin.c > > dist_rtems_tests_DATA = spedfsched04.scn > dist_rtems_tests_DATA += spedfsched04.doc > diff --git a/testsuites/sptests/spedfsched04/init.c > b/testsuites/sptests/spedfsched04/init.c > index f80883d..8dd93db 100644 > --- a/testsuites/sptests/spedfsched04/init.c > +++ b/testsuites/sptests/spedfsched04/init.c > @@ -1,24 +1,25 @@ > /** > - * @brief A heuristic example to demonstrate how the postponed jobs are > handled. > + * @brief A heuristic example to demonstrate how the postponed jobs are > handled in EDF. > * > * Given two tasks with implicit deadline under EDF policy. > - * Task 1 has (4, 5) and task 2 has (4, 6), where (execution time, > period/deadline). > - * For the simplicity, we only execute the first task twice. > + * Task 1 has (400, 500) and task 2 has (450, 550), where (required ticks, > period/deadline). > + * For the simplicity, we only execute the first task three times. > * In the original implementation in v4.11, no matter how many periods are > * expired, only one job will be released with a shifted deadline assignment. > * > - * In this example, the first job of task 2 will be blocked by the second job > - * of task 1, so that there at least one following job is postponed. > - * Due to overhead/delay, the second following job will be postponed as well. > + * In this example, task 2 will be blocked by the second and third jobs > + * of task 1, so that there are two jobs are postponed. > + * Due to the domino effects, the following jobs of task 2 will be postponed > until Job 9. > * > * If the overrun handling is correct, the period of task 2 changes back to > - * normal status at time 22. > - * Otherwise, the release time of job 3 is no longer periodic. > + * normal status at Job 9. > + * Otherwise, the release time of job 3 is no longer periodic > + * and there is no more postponed jobs. > * > */ > > /* > - * COPYRIGHT (c) 2016 Kuan-Hsun Chen. > + * COPYRIGHT (c) 2016-2017 Kuan-Hsun Chen. > * > * The license and distribution terms for this file may be > * found in the file LICENSE in this distribution or at > @@ -30,23 +31,19 @@ > #endif > > #include > -#include > - > -#include > -#include > - > -#include "tmacros.h" > +#include > +#include "test_support.h" > > const char rtems_test_name[] = "SPEDFSCHED 4"; > > -static const uint32_t Periods[] = { 5000, 6000 }; > -static const uint32_t Iterations[] = { 4000, 4000 }; > +static const uint32_t Periods[] = { 500, 550 }; > +static const uint32_t Iterations[] = { 400, 450 }; > static const rtems_name Task_name[] = { >rtems_build_name( 'T', 'A', '1', ' ' ), >rtems_build_name( 'T', 'A', '2', ' ' ) > }; > static const rtems_task_priority Prio[3] = { 2, 5 }; > -static const uint32_t testnumber = 11; /* stop condition */ > +static const uint32_t testnumber = 9; /* stop condition */ > > static uint32_t tsk_counter[] = { 0, 0 }; > static rtems_id Task_id[ 2 ]; > @@ -58,35 +55,42 @@ static rtems_task Task( >rtems_task_argument argument > ) > { > - rtems_status_code status; > - rtems_idRM_period; > - rtems_idselfid=rtems_task_self(); > - uint32_tstart, end, flag=0, index; > - rtems_counter_ticks t0; > + rtems_status_code status; > + rtems_id RM_period; > + rtems_id selfid=rtems_task_self(); > + rtems_rate_monotonic_period_statusperiod_status; > + uint32_t flag=0; > > - t0 = rtems_counter_nanoseconds_to_ticks( 100 ); //1ms ticks counter > - /*create period*/ > + /* create period */ >status = rtems_rate_monotonic_create( Task_name[ argument ], &RM_period ); >directive_failed( status, "rtems_rate_monotonic_create" ); > >
Re: Documentation: Locking protocols and thread queues
On Mon, Jan 30, 2017 at 7:47 AM, Sebastian Huber < sebastian.hu...@embedded-brains.de> wrote: > Hello, > > I would like to update the documentation of the locking protocols > (priority ceiling, priority inheritance, OMIP, MrsP) and the thread queues. > Since this is API independent I think the Semaphore Manager chapter is the > wrong place. Should I add this to the Key Concepts? > > That seems like the best spot we have now. --joel > -- > 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 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: GSoC Mentors / Projects of Interest
On Mon, Jan 30, 2017 at 5:13 PM, Gedare Bloom wrote: > On Mon, Jan 30, 2017 at 12:25 PM, Tanu Hari Dixit > wrote: > > I'll be glad to do it. Please guide me as to how to proceed. > > > We will need to import each existing Open Project description into a > new ticket. It would be best to start with one to "try it out". The > project title should be the Summary of the ticket, the text of the > project page should be converted into the Description of the ticket, > type should be Enhancement, Milestone "Indefinite", and put GSoC into > the keywords, and we might want to use some other keywords e.g. to > define the project type (e.g. one of: testing, ecosystem, kernel, > statistics, BSP, API, libbsd, languages, libraries). The owner should > be assigned to one of the mentors if indicated, with others in CC if > any, or else set blank. > > I agree it would be nice to get all the Open Project ideas as tickets and off the Wiki. Some of the ideas are likely no longer interesting/valid at this point and could just be deleted. FWIW I also want to move some of the Wiki content into Sphinx documents. I think being able to release them with RTEMS branches and use git for revision control. --joel > > On Mon, Jan 30, 2017 at 9:38 PM, Gedare Bloom wrote: > >> > >> Yes that would be much nicer. Maybe we can get potential GSoC Students > >> to do the work ;) > >> > >> On Mon, Jan 30, 2017 at 1:40 AM, Sebastian Huber > >> wrote: > >> > Maybe we should move all this open projects wiki stuff into tickets > with > >> > some sort of "GSoC" tag. > >> > > >> > -- > >> > 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 > > > > > ___ > devel mailing list > devel@rtems.org > http://lists.rtems.org/mailman/listinfo/devel > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH] rtems: Revise tests: sprmsched01 and spedfsched04
By taking Sebastian's suggestions, I revise both tests. Now the tests are independent to the target time and console driver. Before I use time unit as second and the results rely on the absolute time. Now I use rtems_test_spin_for_ticks() and downscale the timeunit from second to 100ms. Both tests only check if the overrun handling is correct or not by using rtems_rate_monotonic_get_status() to check the count of postponed jobs. If they are correct, all the assertions are passed. 2017-01-31 0:15 GMT+01:00 Gedare Bloom : > Does this fix a deficiency in the current tests? > > On Mon, Jan 30, 2017 at 1:34 PM, Kuan-Hsun Chen wrote: > > Instead of using the target time and console driver, > > both tests now use assertions and rtems_rate_monotonic_get_status() to > verify the count of postponed jobs. > > The setting of spedfsched04 is slightly changed. > > > > Update #2795 > > --- > > testsuites/sptests/spedfsched04/Makefile.am | 2 +- > > testsuites/sptests/spedfsched04/init.c | 89 > > > testsuites/sptests/spedfsched04/spedfsched04.scn | 27 ++- > > testsuites/sptests/sprmsched01/Makefile.am | 4 +- > > testsuites/sptests/sprmsched01/init.c| 74 > ++-- > > testsuites/sptests/sprmsched01/sprmsched01.scn | 55 ++- > > 6 files changed, 97 insertions(+), 154 deletions(-) > > > > diff --git a/testsuites/sptests/spedfsched04/Makefile.am > b/testsuites/sptests/spedfsched04/Makefile.am > > index 39f8210..a39519a 100644 > > --- a/testsuites/sptests/spedfsched04/Makefile.am > > +++ b/testsuites/sptests/spedfsched04/Makefile.am > > @@ -1,6 +1,6 @@ > > > > rtems_tests_PROGRAMS = spedfsched04 > > -spedfsched04_SOURCES = init.c > > +spedfsched04_SOURCES = init.c ../../support/src/spin.c > > > > dist_rtems_tests_DATA = spedfsched04.scn > > dist_rtems_tests_DATA += spedfsched04.doc > > diff --git a/testsuites/sptests/spedfsched04/init.c > b/testsuites/sptests/spedfsched04/init.c > > index f80883d..8dd93db 100644 > > --- a/testsuites/sptests/spedfsched04/init.c > > +++ b/testsuites/sptests/spedfsched04/init.c > > @@ -1,24 +1,25 @@ > > /** > > - * @brief A heuristic example to demonstrate how the postponed jobs are > handled. > > + * @brief A heuristic example to demonstrate how the postponed jobs are > handled in EDF. > > * > > * Given two tasks with implicit deadline under EDF policy. > > - * Task 1 has (4, 5) and task 2 has (4, 6), where (execution time, > period/deadline). > > - * For the simplicity, we only execute the first task twice. > > + * Task 1 has (400, 500) and task 2 has (450, 550), where (required > ticks, period/deadline). > > + * For the simplicity, we only execute the first task three times. > > * In the original implementation in v4.11, no matter how many periods > are > > * expired, only one job will be released with a shifted deadline > assignment. > > * > > - * In this example, the first job of task 2 will be blocked by the > second job > > - * of task 1, so that there at least one following job is postponed. > > - * Due to overhead/delay, the second following job will be postponed as > well. > > + * In this example, task 2 will be blocked by the second and third jobs > > + * of task 1, so that there are two jobs are postponed. > > + * Due to the domino effects, the following jobs of task 2 will be > postponed until Job 9. > > * > > * If the overrun handling is correct, the period of task 2 changes > back to > > - * normal status at time 22. > > - * Otherwise, the release time of job 3 is no longer periodic. > > + * normal status at Job 9. > > + * Otherwise, the release time of job 3 is no longer periodic > > + * and there is no more postponed jobs. > > * > > */ > > > > /* > > - * COPYRIGHT (c) 2016 Kuan-Hsun Chen. > > + * COPYRIGHT (c) 2016-2017 Kuan-Hsun Chen. > > * > > * The license and distribution terms for this file may be > > * found in the file LICENSE in this distribution or at > > @@ -30,23 +31,19 @@ > > #endif > > > > #include > > -#include > > - > > -#include > > -#include > > - > > -#include "tmacros.h" > > +#include > > +#include "test_support.h" > > > > const char rtems_test_name[] = "SPEDFSCHED 4"; > > > > -static const uint32_t Periods[] = { 5000, 6000 }; > > -static const uint32_t Iterations[] = { 4000, 4000 }; > > +static const uint32_t Periods[] = { 500, 550 }; > > +static const uint32_t Iterations[] = { 400, 450 }; > > static const rtems_name Task_name[] = { > >rtems_build_name( 'T', 'A', '1', ' ' ), > >rtems_build_name( 'T', 'A', '2', ' ' ) > > }; > > static const rtems_task_priority Prio[3] = { 2, 5 }; > > -static const uint32_t testnumber = 11; /* stop condition */ > > +static const uint32_t testnumber = 9; /* stop condition */ > > > > static uint32_t tsk_counter[] = { 0, 0 }; > > static rtems_id Task_id[ 2 ]; > > @@ -58,35 +55,42 @@ static rtems_task Task( > >rtems_task_argument argument > > ) > > { > > - rtems_status_cod
Re: [PATCH] rtems: Revise tests: sprmsched01 and spedfsched04
On 30/01/17 19:34, Kuan-Hsun Chen wrote: Instead of using the target time and console driver, both tests now use assertions and rtems_rate_monotonic_get_status() to verify the count of postponed jobs. The setting of spedfsched04 is slightly changed. Update #2795 I checked in a slightly modified version, e.g. no white space at the end of a line. Thanks for your contribution, I think now everything is in place. -- 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