Commit 60122c12 authored by yoogx's avatar yoogx

* Integration of GRSPW Packet driver

	For openaadl/ocarina#144
parent 38550276
...@@ -2,13 +2,16 @@ C_FILES = $(srcdir)/producer-consumer.c $(srcdir)/devicesconf.c ...@@ -2,13 +2,16 @@ C_FILES = $(srcdir)/producer-consumer.c $(srcdir)/devicesconf.c
AADL_FILES = $(srcdir)/producer_consumer.aadl $(srcdir)/software.aadl AADL_FILES = $(srcdir)/producer_consumer.aadl $(srcdir)/software.aadl
SCENARIO_FILES = $(srcdir)/scenario.aadl \ SCENARIO_FILES = $(srcdir)/scenario.aadl \
$(srcdir)/scenario_local.aadl \ $(srcdir)/scenario_local.aadl \
$(srcdir)/scenario_loopback.aadl \ $(srcdir)/scenario_loopback.aadl \
$(srcdir)/scenario_rtems.aadl $(srcdir)/scenario_rtems.aadl $(srcdir)/scenario_spw.aadl \
$(srcdir)/scenario_spw2.aadl
include $(srcdir)/../../Makefile.common include $(srcdir)/../../Makefile.common
EXTRA_DIST = $(AADL_FILES) $(SCENARIO_FILES) $(C_FILES) EXTRA_DIST = $(AADL_FILES) $(SCENARIO_FILES) $(C_FILES)
CLEANDIRS = pc_simple_impl pc_simple_local pc_simple_rtems CLEANDIRS = pc_simple_impl pc_simple_local pc_simple_rtems \
pc_simple_loopback pc_simple_loopback_spw pc_simple_impl_spw \
pc_simple_impl_spw2
...@@ -2,15 +2,17 @@ ...@@ -2,15 +2,17 @@
#include <time.h> #include <time.h>
#include <po_hi_time.h> #include <po_hi_time.h>
int produce_data = 0;
void user_produce_spg (int* data) void user_produce_spg (int* data)
{ {
static int produce_data = 42;
#if defined (POSIX) #if defined (POSIX)
struct timespec mytime; struct timespec mytime;
clock_gettime (CLOCK_REALTIME, &mytime); clock_gettime (CLOCK_REALTIME, &mytime);
*data = produce_data; *data = produce_data;
printf ("At time %3lu:%3lu, produce : %d\n", mytime.tv_sec % 3600, mytime.tv_nsec/1000000,produce_data); printf ("At time %3lu:%3lu, produce : %d\n",
mytime.tv_sec % 3600, mytime.tv_nsec / 1000000,
produce_data);
#else #else
*data = produce_data; *data = produce_data;
printf ("Produce %d\n", *data); printf ("Produce %d\n", *data);
......
...@@ -4,7 +4,7 @@ public ...@@ -4,7 +4,7 @@ public
with ocarina_drivers; with ocarina_drivers;
with ocarina_buses; with ocarina_buses;
with ocarina_drivers_grspw_packet; with ocarina_drivers_grspw_packet;
--------------- ---------------
-- Processor -- -- Processor --
--------------- ---------------
...@@ -73,9 +73,11 @@ public ...@@ -73,9 +73,11 @@ public
end PC_Simple; end PC_Simple;
system implementation PC_Simple.Impl system implementation PC_Simple.Impl
-- Producer/Consummer using TCP/IP sockets
subcomponents subcomponents
pr_A : process A.Impl {Deployment::port_number => 4001;}; pr_A : process A.Impl;
pr_B : process B.Impl {Deployment::port_number => 4002;}; pr_B : process B.Impl;
Device_A : device ocarina_drivers::generic_sockets_ip.pohic Device_A : device ocarina_drivers::generic_sockets_ip.pohic
{Source_Text => ("devicesconf.c");}; {Source_Text => ("devicesconf.c");};
Device_B : device ocarina_drivers::generic_sockets_ip.pohic Device_B : device ocarina_drivers::generic_sockets_ip.pohic
...@@ -98,30 +100,86 @@ public ...@@ -98,30 +100,86 @@ public
actual_processor_binding => (reference (CPU_B)) applies to Device_B; actual_processor_binding => (reference (CPU_B)) applies to Device_B;
end PC_Simple.Impl; end PC_Simple.Impl;
system implementation PC_Simple.Loopback system implementation PC_Simple.Impl_Spw
-- Producer/Consummer, refined to LEON/RTEMS POSIX with SpaceWire
-- communications using rasta_spacewire.pohic driver, based on
-- GRSPW IOCTL driver.
-- XXXX check why we cannot extend the previous impl
subcomponents subcomponents
pr_A : process A.Impl {Deployment::port_number => 4001;}; pr_A : process A.Impl;
Device_A : device ocarina_drivers::generic_sockets_ip.pohic Device_A : device ocarina_drivers::rasta_spacewire.pohic
{Source_Text => ("devicesconf.c");}; {Source_Text => ("devicesconf_spw.c");};
pr_B : process B.Impl;
Device_B : device ocarina_drivers::rasta_spacewire.pohic
{Source_Text => ("devicesconf_spw.c");};
CPU_A : processor the_processor.i; CPU_A : processor the_processor.i;
the_bus : bus ocarina_buses::ip.i; CPU_B : processor the_processor.i;
the_bus : bus ocarina_buses::spacewire.generic;
connections connections
bus access the_bus -> Device_A.link; bus access the_bus -> Device_A.link;
bus access the_bus -> Device_B.link;
port pr_A.Alpha -> pr_A.Beta port pr_A.Alpha -> pr_B.Beta
{Actual_Connection_Binding => (reference (the_bus));};
port pr_B.Alpha -> pr_A.Beta
{Actual_Connection_Binding => (reference (the_bus));}; {Actual_Connection_Binding => (reference (the_bus));};
properties properties
Deployment::Execution_Platform => LEON_RTEMS_POSIX applies to CPU_A;
Deployment::Execution_Platform => LEON_RTEMS_POSIX applies to CPU_B;
actual_processor_binding => (reference (CPU_A)) applies to pr_A; actual_processor_binding => (reference (CPU_A)) applies to pr_A;
actual_processor_binding => (reference (CPU_B)) applies to pr_B;
actual_processor_binding => (reference (CPU_A)) applies to Device_A; actual_processor_binding => (reference (CPU_A)) applies to Device_A;
end PC_Simple.Loopback; actual_processor_binding => (reference (CPU_B)) applies to Device_B;
end PC_Simple.Impl_Spw;
system implementation PC_Simple.Impl_Spw2
-- Producer/Consummer, refined to LEON/RTEMS POSIX with SpaceWire
-- communications using rasta_spacewire.pohic driver, based on
-- GRSPW IOCTL driver.
system implementation PC_Simple.Loopback_Spw
subcomponents subcomponents
pr_A : process A.Impl {Deployment::port_number => 4001;}; pr_A : process A.Impl;
Device_A : device ocarina_drivers::rasta_spacewire.grspw_pohic Device_A : device ocarina_drivers::rasta_spacewire.grspw_pohic
{Source_Text => ("devicesconf.c");}; {Source_Text => ("devicesconf_spw.c");};
pr_B : process B.Impl;
Device_B : device ocarina_drivers::rasta_spacewire.grspw_pohic
{Source_Text => ("devicesconf_spw.c");};
CPU_A : processor the_processor.i; CPU_A : processor the_processor.i;
CPU_B : processor the_processor.i;
the_bus : bus ocarina_buses::spacewire.generic; the_bus : bus ocarina_buses::spacewire.generic;
connections
bus access the_bus -> Device_A.link;
bus access the_bus -> Device_B.link;
port pr_A.Alpha -> pr_B.Beta
{Actual_Connection_Binding => (reference (the_bus));};
port pr_B.Alpha -> pr_A.Beta
{Actual_Connection_Binding => (reference (the_bus));};
properties
Deployment::Execution_Platform => LEON_RTEMS_POSIX applies to CPU_A;
Deployment::Execution_Platform => LEON_RTEMS_POSIX applies to CPU_B;
actual_processor_binding => (reference (CPU_A)) applies to pr_A;
actual_processor_binding => (reference (CPU_B)) applies to pr_B;
actual_processor_binding => (reference (CPU_A)) applies to Device_A;
actual_processor_binding => (reference (CPU_B)) applies to Device_B;
end PC_Simple.Impl_Spw2;
system implementation PC_Simple.Loopback
-- Variant of Producer/Consummer using TCP/IP sockets in loopback mode
subcomponents
pr_A : process A.Impl {Deployment::port_number => 4001;};
Device_A : device ocarina_drivers::generic_sockets_ip.pohic
{Source_Text => ("devicesconf.c");};
CPU_A : processor the_processor.i;
the_bus : bus ocarina_buses::ip.i;
connections connections
bus access the_bus -> Device_A.link; bus access the_bus -> Device_A.link;
...@@ -130,6 +188,21 @@ public ...@@ -130,6 +188,21 @@ public
properties properties
actual_processor_binding => (reference (CPU_A)) applies to pr_A; actual_processor_binding => (reference (CPU_A)) applies to pr_A;
actual_processor_binding => (reference (CPU_A)) applies to Device_A; actual_processor_binding => (reference (CPU_A)) applies to Device_A;
end PC_Simple.Loopback;
system implementation PC_Simple.Loopback_Spw extends PC_Simple.Loopback
-- Loopback variant using SpaceWire
--
-- Note; does not work properly, as we cannot perform loopback
-- with rasta_spacewire.pohic driver. Used only to test proper
-- sending.
subcomponents
Device_A : refined to device ocarina_drivers::rasta_spacewire.pohic
{Source_Text => ("devicesconf_spw.c");};
the_bus : refined to bus ocarina_buses::spacewire.generic;
properties
Deployment::Execution_Platform => LEON_RTEMS_POSIX applies to CPU_A;
end PC_Simple.Loopback_Spw; end PC_Simple.Loopback_Spw;
system implementation PC_Simple.local system implementation PC_Simple.local
...@@ -149,7 +222,7 @@ public ...@@ -149,7 +222,7 @@ public
system implementation PC_Simple.RTEMS system implementation PC_Simple.RTEMS
extends PC_Simple.local extends PC_Simple.local
properties properties
Deployment::Execution_platform => LEON_RTEMS applies to CPU_A ; Deployment::Execution_platform => LEON_RTEMS_POSIX applies to CPU_A ;
end PC_Simple.RTEMS; end PC_Simple.RTEMS;
end Producer::Consumer; end Producer::Consumer;
...@@ -11,7 +11,7 @@ properties ...@@ -11,7 +11,7 @@ properties
"pr_b", "pr_b.ref"); "pr_b", "pr_b.ref");
Ocarina_Config::AADL_Files => Ocarina_Config::AADL_Files =>
("producer_consumer.aadl", "software.aadl", ("producer_consumer.aadl", "software.aadl",
"devices.aadl", "buses", "base_types", "exarm-ni-6071e-analog.aadl", "grspw.aadl", "rasta-serial.aadl", "sockets-rtems-ne2000.aadl", "exarm-ni-6071e-digital.aadl", "gruart.aadl", "rasta-spacewire.aadl", "tcp_protocol.aadl", "generic-keyboard.aadl", "leon-eth.aadl", "scoc3-spacewire.aadl", "udp-exarm.aadl", "generic_bus.aadl", "leon-serial.aadl", "sd-spw-usb.aadl", "generic_native.aadl", "native_uart.aadl", "serial-raw.aadl", "gr_cpci_x4cv.aadl", "rasta-1553.aadl", "sockets-raw.aadl","grspw_packet.aadl"); "devices.aadl", "buses", "base_types", "exarm-ni-6071e-analog.aadl", "grspw.aadl", "rasta-serial.aadl", "sockets-rtems-ne2000.aadl", "exarm-ni-6071e-digital.aadl", "gruart.aadl", "rasta-spacewire.aadl", "tcp_protocol.aadl", "generic-keyboard.aadl", "leon-eth.aadl", "scoc3-spacewire.aadl", "udp-exarm.aadl", "generic_bus.aadl", "leon-serial.aadl", "sd-spw-usb.aadl", "generic_native.aadl", "native_uart.aadl", "serial-raw.aadl", "gr_cpci_x4cv.aadl", "rasta-1553.aadl", "sockets-raw.aadl", "grspw_packet.aadl");
Ocarina_Config::Root_System_Name => "PC_Simple.loopback"; Ocarina_Config::Root_System_Name => "PC_Simple.loopback";
Ocarina_Config::Generator => polyorb_hi_c; Ocarina_Config::Generator => polyorb_hi_c;
Ocarina_Config::Needed_Property_Sets => Ocarina_Config::Needed_Property_Sets =>
......
...@@ -51,7 +51,7 @@ public ...@@ -51,7 +51,7 @@ public
parameter P_Spg.Data_Source -> Data_Source; parameter P_Spg.Data_Source -> Data_Source;
properties properties
Dispatch_Protocol => Periodic; Dispatch_Protocol => Periodic;
Period => 200 ms; Period => 5 sec;
end P.Impl; end P.Impl;
thread Q thread Q
...@@ -68,7 +68,7 @@ public ...@@ -68,7 +68,7 @@ public
parameter Data_Sink -> Q_Spg.Data_Sink; parameter Data_Sink -> Q_Spg.Data_Sink;
properties properties
Dispatch_Protocol => Periodic; Dispatch_Protocol => Periodic;
Period => 100 ms; Period => 5 sec;
end Q.Impl; end Q.Impl;
end Software; end Software;
include $(top_srcdir)/Makefile.common include $(top_srcdir)/Makefile.common
AUTOMAKE_OPTIONS = no-dependencies AUTOMAKE_OPTIONS = no-dependencies
EXTRA_DIST = $(srcdir)/po_hi_driver_linux_serial.h \ EXTRA_DIST = $(srcdir)/po_hi_driver_linux_serial.h \
$(srcdir)/po_hi_driver_leon_serial.h \ $(srcdir)/po_hi_driver_leon_serial.h \
$(srcdir)/po_hi_driver_leon_eth.h \ $(srcdir)/po_hi_driver_leon_eth.h \
$(srcdir)/po_hi_driver_serial_common.h \ $(srcdir)/po_hi_driver_serial_common.h \
$(srcdir)/po_hi_driver_exarm.h \ $(srcdir)/po_hi_driver_exarm.h \
$(srcdir)/po_hi_driver_exarm_ni_6071e_analog.h \ $(srcdir)/po_hi_driver_exarm_ni_6071e_analog.h \
$(srcdir)/po_hi_driver_exarm_ni_6071e_digital.h \ $(srcdir)/po_hi_driver_exarm_ni_6071e_digital.h \
$(srcdir)/po_hi_driver_usbbrick_spacewire.h \ $(srcdir)/po_hi_driver_usbbrick_spacewire.h \
$(srcdir)/po_hi_driver_rasta_spacewire.h \ $(srcdir)/po_hi_driver_rasta_spacewire.h \
$(srcdir)/po_hi_driver_rasta_1553.h \ $(srcdir)/po_hi_driver_rasta_1553.h \
$(srcdir)/po_hi_driver_rasta_1553_brmlib.h \ $(srcdir)/po_hi_driver_rasta_1553_brmlib.h \
$(srcdir)/po_hi_driver_xc4v_fpga.h \ $(srcdir)/po_hi_driver_xc4v_fpga.h \
$(srcdir)/po_hi_driver_rasta_serial.h \ $(srcdir)/po_hi_driver_rasta_serial.h \
$(srcdir)/po_hi_driver_rasta_common.h \ $(srcdir)/po_hi_driver_rasta_common.h \
$(srcdir)/po_hi_driver_sockets.h \ $(srcdir)/po_hi_driver_sockets.h \
$(srcdir)/po_hi_driver_keyboard.h \ $(srcdir)/po_hi_driver_keyboard.h \
$(srcdir)/po_hi_rtems_utils.h $(srcdir)/po_hi_rtems_utils.h $(srcdir)/grspw_api.h \
$(srcdir)/grspw_pkt_lib.h \
$(srcdir)/po_hi_driver_drvmgr_common.h
CLEANFILES = *~ CLEANFILES = *~
SUBDIRS=configuration SUBDIRS=configuration
hsrc = ${shell $(CYGPATH_U) '$(OCARINA_RUNTIME)/polyorb-hi-c/include/drivers'} hsrc = ${shell $(CYGPATH_U) '$(OCARINA_RUNTIME)/polyorb-hi-c/include/drivers'}
hsrc2 = ${shell $(CYGPATH_U) '$(OCARINA_RUNTIME)/polyorb-hi-c/include'}
install-data-local: install-data-local:
$(INSTALL) -d $(DESTDIR)$(hsrc) $(INSTALL) -d $(DESTDIR)$(hsrc)
for f in $(EXTRA_DIST); do \ for f in $(EXTRA_DIST); do \
$(INSTALL) -m 444 $$f $(DESTDIR)$(hsrc) ; \ $(INSTALL) -m 444 $$f $(DESTDIR)$(hsrc) ; \
done done
$(INSTALL) -d $(DESTDIR)$(hsrc2)
for f in $(EXTRA_DIST); do \
$(INSTALL) -m 444 $$f $(DESTDIR)$(hsrc2) ; \
done
uninstall-local: uninstall-local:
rm -rf $(DESTDIR)$(hsrc) rm -rf $(DESTDIR)$(hsrc)
rm -rf $(DESTDIR)$(hsrc2)
#ifndef __GRSPW_API_H__
#define __GRSPW_API_H__
/* This unit provides a high-level set of help functions for the new
* GRSPW packet driver. See RCC 1.3 Chapter 18 documentation for
* details.
*
* Note: this implementation relies on elements from the grspw-test
* sample program provided in RCC 1.3rc4 by Cobham Gaisler, and the
* grspw_pkt_lib auxiliary library.
*/
#include <drvmgr/drvmgr_confdefs.h>
#include <bsp/grspw_pkt.h>
#include <bsp/grspw_router.h>
#include <stddef.h>
#include "grspw_pkt_lib.h"
#include <po_hi_messages.h>
#define DEVS_MAX 32 /** Maximum number of devices supported */
#define PKT_SIZE __PO_HI_MESSAGES_MAX_SIZE /** Size of the packets exchanged */
/** Structure representing a GRPSW device */
struct grspw_device {
/* GRSPW Device layout - must be the same as 'struct grspw_dev' */
void *dh;
/* Array of DMA Channels */
void *dma[4];
int index;
/* Structure to describe the GRSPW hardware capabilities */
struct grspw_hw_sup hwsup;
/* Test structures */
struct grspw_config cfg;
int run;
/* RX and TX lists of packet buffers */
struct grspw_list rx_list, tx_list, tx_buf_list,rx_buf_list;
int rx_list_cnt, tx_list_cnt, tx_buf_list_cnt, rx_buf_list_cnt;
};
/** Array listing all GRSPW devices */
static struct grspw_device devs[DEVS_MAX];
/** AUXILIARY INITIALIZATION FUNCTION :
* Initializing the devices.
*
* Application thread
* TDRX. SpaceWire DMA RX task. Handles reception of SpaceWire
* packets on all SpaceWire devices.
* TDTX. SpaceWire DMA RX task. Handles transmission of SpaceWire
* packets on all SpaceWire devices.
* Then Semaphores : dma_sync_rx and dma_sync tx.
* Then the reception and transmission tasks are started.
*/
void grspw_api_init(void);
/** Function that close and clean the idx GRSPW-device.
* All dma channels need to be closed before closing the device.
* Error messages are returned whether the dma isn't closed correctly
* Or if it's the case for the device.
* Used in test_app.
*/
void dev_cleanup(int idx);
/** SpaceWire Routing table entry */
struct route_entry {
unsigned char dstadr[16];
/* 0 terminates array */
};
/** Function following a sending process:
* A packet is taking at the head of the tx_buf_list.
* Its data content is extracted from the "message" parameter.
* Its header is initialized according to the content of the p_route parameter.
* Its length is initalized thanks to the message_size parameter.
* The pkt is then added to the tx_list (to be sent).
* The dma_sem semaphore is used so that the tasks don't overlap.
* The dma_sync_tx is used so that the task isn't periodic but is triggered
* only when something is about to be sent.
* The function is called in the test_app Task, used with the sending command (x command).
*/
size_t grspw_sending
(int device,
struct route_entry * p_route,
void *message, int message_size);
/** Function following a receiving process:
* A packet is taking at the head of the tx_buf_list (of the specified device).
* Its data content is extracted from the "message" parameter.
* Its header is initialized according to the content of the p_route parameter.
* Its length is initalized thanks to the message_size parameter.
* The pkt is then added to the tx_list (to be sent).
* The dma_sem semaphore is used so that the tasks don't overlap.
* The dma_sync_rx is used so that the task isn't periodic but is triggered
* only when something is about to be received.
* The function is called in the test_app Task, used qith the receiving command (r command).
*/
size_t grspw_receiving(int device,void *message);
#endif /*__GRSPW_API_H__ */
/* GRSPW Packet driver Library helper functions */
#ifndef __GRSPW_PKT_LIB_H__
#define __GRSPW_PKT_LIB_H__
#include <bsp/grspw_pkt.h>
/* GRSPW Device handles and DMA handles */
struct grspw_dev {
void *dh;
void *dma[4];
int index;
struct grspw_hw_sup hwsup;
};
/* Driver configuration options described in memory */
struct grspw_config {
struct grspw_addr_config adrcfg;
int rmap_cfg;
unsigned char rmap_dstkey;
int tc_cfg;
void (*tc_isr_callback)(void *data, int tc);
void *tc_isr_arg;
/* Mask of which DMA Channels to enable. Most often only
* one DMA Channel is available, then set this to 1.
*
* By enabling a DMA Channel, the DMA Channels will be
* able to receive SpaceWire packets after SpaceWire buffers
* has been prepared for it, and transmitt SpaceWire packets
* when the user request transmission of a SpaceWire packet.
*/
unsigned int enable_chan_mask;
/* Per Channel Configuration */
struct grspw_dma_config chan[4];
/* SpW Interrupt configuration */
struct spwpkt_ic_config iccfg;
};
/* Statisics and diagnostics gathered by driver */
struct grspw_stats {
/* Statistics for the Core */
struct grspw_core_stats stats;
/* Per DMA channel statistics */
struct grspw_dma_stats chan[4];
};
/* Current state of configuration and link */
struct grspw_link_state {
int link_ctrl; /* Link Configuration */
unsigned char clkdiv_start; /* Clock Division during startup (not
* in state run) */
unsigned char clkdiv_run; /* Clock Division in run-state */
spw_link_state_t link_state; /* State (Error-Reset, Error-wait...) */
int port_cfg; /* Port Configuration */
int port_active; /* Currently active port */
};
/* Read the current driver configuration to memory */
void grspw_config_read(struct grspw_dev *dev, struct grspw_config *cfg);
/* Read the current link state from hardware */
void grspw_link_state_get(struct grspw_dev *dev, struct grspw_link_state *state);
/* Print the link state on the stdout */
void grspw_linkstate_print(struct grspw_link_state *ls);
/* Print hardware configuration from memory onto stdout */
void grspw_cfg_print(struct grspw_hw_sup *hw, struct grspw_config *cfg);
/* Copy current driver statistics to memory */
void grspw_stats_get(struct grspw_dev *dev, struct grspw_stats *stats);
/* Print GRSPW driver statistics from memory description onto stdout */
void grspw_stats_print(struct grspw_dev *dev, struct grspw_stats *stats);
/* Configure Core and DMA Channels, RMAP and TimeCode setup */
int grspw_cfg_set(struct grspw_dev *dev, struct grspw_config *cfg);
/* Start DMA operation on all open DMA channels */
int grspw_start(struct grspw_dev *dev);
/* Stop all DMA activity on all DMA channels */
void grspw_stop(struct grspw_dev *dev);
#endif /* __GRSPW_PKT_LIB_H__ */
#ifndef __PO_HI_DRIVER_DRVMGR_COMMON__
#define __PO_HI_DRIVER_DRVMGR_COMMON__
/** Initializes RTEMS drvmgr sub-system
*
* This is necessary prior using any drivers using this manager.
*
* Note: applies mostly to SPARC-based bsps, e.g. leon3, gr740, n2x, ..
*/
void __po_hi_c_driver_drvmgr_init (void);
#endif
...@@ -23,11 +23,9 @@ ...@@ -23,11 +23,9 @@
#endif #endif
#endif #endif
/* /******************************************************************************/
* Configure RTEMS executive. /* Configure RTEMS/POSIX executive. */
* We have to define the number of tasks inside the executive,
* we deduce it from generated statements.
*/
#if defined(RTEMS_POSIX) #if defined(RTEMS_POSIX)
#include <rtems.h> #include <rtems.h>
...@@ -40,37 +38,32 @@ ...@@ -40,37 +38,32 @@
#include <drvmgr/ambapp_bus.h> #include <drvmgr/ambapp_bus.h>
#endif #endif
#define CONFIGURE_INIT
#include <bsp.h> #include <bsp.h>
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
// #define CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER
#define CONFIGURE_MAXIMUM_DRIVERS 10
#define CONFIGURE_MAXIMUM_POSIX_TIMERS 40
#define CONFIGURE_MAXIMUM_TIMERS 40
#define CONFIGURE_EXECUTIVE_RAM_SIZE (512*1024)
#define CONFIGURE_MAXIMUM_SEMAPHORES 20
#define CONFIGURE_MAXIMUM_TASKS __PO_HI_NB_TASKS + 2
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20
#define CONFIGURE_MAXIMUM_TASKS 20
#define CONFIGURE_MAXIMUM_POSIX_THREADS __PO_HI_NB_TASKS + 10 #define CONFIGURE_MAXIMUM_POSIX_THREADS __PO_HI_NB_TASKS + 10
#ifdef __PO_HI_NB_PORTS #define CONFIGURE_MAXIMUM_SEMAPHORES 20 // IRQ layer needs one semaphore
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES __PO_HI_NB_TASKS + 10 + __PO_HI_NB_PORTS #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 20
#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES __PO_HI_NB_TASKS + 10 + __PO_HI_NB_PORTS #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32
#else #define CONFIGURE_MAXIMUM_DRIVERS 32
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES __PO_HI_NB_TASKS + 10 + __PO_HI_NB_PORTS #define CONFIGURE_MAXIMUM_PERIODS 1
#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES __PO_HI_NB_TASKS + 10 + __PO_HI_NB_PORTS
#endif
void *POSIX_Init (void); #define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_POSIX_INIT_THREAD_TABLE #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT
#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM #define CONFIGURE_EXTRA_TASK_STACKS (40 * RTEMS_MINIMUM_STACK_SIZE)
#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE (40 * RTEMS_MINIMUM_STACK_SIZE)
#define CONFIGURE_INIT #define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(2)
/*****************************************************************************/ /*****************************************************************************/
/* Driver Manager configuration for RTEMS 4.12 and onwards */ /* Driver Manager configuration for RTEMS 5 */
/* Important note: some RTEMS CONFIGURE macros above must be completed /* Important note: some RTEMS CONFIGURE macros above must be completed
* with specific driver configuration, otherwise some features will * with specific driver configuration, otherwise some features will
...@@ -82,6 +75,9 @@ void *POSIX_Init (void); ...@@ -82,6 +75,9 @@ void *POSIX_Init (void);
#ifdef __PO_HI_NEED_DRIVER_ETH_LEON #ifdef __PO_HI_NEED_DRIVER_ETH_LEON
#define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRETH /* GRETH Driver enabled*/ #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRETH /* GRETH Driver enabled*/
#else
#undef ENABLE_NETWORK
#undef ENABLE_NETWORK_SMC_LEON3
#endif #endif
#ifdef __PO_HI_NEED_DRIVER_SPACEWIRE_RASTA #ifdef __PO_HI_NEED_DRIVER_SPACEWIRE_RASTA
...@@ -102,14 +98,27 @@ void *POSIX_Init (void); ...@@ -102,14 +98,27 @@ void *POSIX_Init (void);
#endif #endif
#endif #endif
#endif /*GRLEON3 && RTEMS412*/ void *POSIX_Init (void);
#define CONFIGURE_DRIVER_AMBAPP_GAISLER_SPW_ROUTER /* SpaceWire Router */
#define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW2 /* SpaceWire Packet driver */
#endif /*GRLEON3 && RTEMS412*/
#include <rtems/confdefs.h> #include <rtems/confdefs.h>
#include <drvmgr/drvmgr_confdefs.h> #include <drvmgr/drvmgr_confdefs.h>
/* config.c is directly provided by RCC1.3 and initialized drivers per
* drvmgr convention for RASTA (LEON3), N2X and GR740 boards
*/
#undef ENABLE_NETWORK