Commit db8ea84b authored by Guilherme Sanches's avatar Guilherme Sanches Committed by Luca Giordano

Changes to try solve the makefile.inc problem. rtems48i is being

compiled by sparc-rtems5-gcc when it can only be compiled by the
sparc-rtems4.11-gcc at the most.

refs #129490

 Changes to be committed:
	new file:   examples/iop_can/config.xml
	new file:   examples/iop_can/iop.xml
	renamed:    examples/iop_example/iop/iop_config.c -> examples/iop_can/iop/iop_config.c
	renamed:    examples/iop_example/iop/iop_logical_device_0.c -> examples/iop_can/iop/iop_logical_device_0.c
	renamed:    examples/iop_example/iop/iop_physical_device_0.c -> examples/iop_can/iop/iop_physical_device_0.c
	renamed:    examples/iop_example/iop/iop_ports.c -> examples/iop_can/iop/iop_ports.c
	new file:   examples/iop_can/queuing/queuing.c
	new file:   examples/iop_can/sampling/sampling.c
	new file:   libs/libiop/can_support.c
	new file:   libs/libiop/can_tasks.c
	new file:   libs/libiop/drivers/occan/include/grlib.h
	new file:   libs/libiop/drivers/occan/include/iop_occan.h
	new file:   libs/libiop/drivers/occan/include/occan_msg_queue.h
	new file:   libs/libiop/drivers/occan/iop_occan.c
	new file:   libs/libiop/drivers/occan/occan_msg_queue.c
	modified:   libs/libiop/eth_tasks.c
	new file:   libs/libiop/include/can_support.h
	modified:   libs/libiop/include/iop.h
	modified:   libs/libiop/include/iop_headers.h
	modified:   pmk/core/ports.c
	modified:   pos/rtems48i/edilib/Makefile.hc
	modified:   pos/rtems48i/rtems48i/c/src/lib/libbsp/sparc/shared/amba/ambapp.c
	modified:   pos/rtems48i/rtems48i/c/src/lib/libbsp/sparc/shared/include/ambapp.h
	modified:   pos/rtems5/rtems5/c/src/lib/libbsp/sparc/shared/amba/ambapp.c
	modified:   tools/configurator/air/pos/rtems48i/rtems48i_makefile.mako
	modified:   tools/configurator/air/pos/rtems48i/rtems48i_partition_makefile.mako
	modified:   tools/configurator/air/targets/sparc/leon3/config.py
	modified:   tools/configurator/air/targets/sparc/leon4/config.py
	modified:   tools/configurator/parsers/iop/definitions.py
	modified:   tools/configurator/parsers/iop/devices.py
	modified:   tools/configurator/parsers/iop/gaisler_devices.py
	modified:   tools/configurator/parsers/iop/parser.py
	modified:   tools/configurator/parsers/iop/ti_devices.py
	modified:   tools/configurator/templates/air_configuration/air_makefile.mako
	modified:   tools/configurator/templates/app_configuration/iop/include/iop_templates.mako
	modified:   tools/configurator/templates/app_configuration/iop/iop_grspw.mako
	modified:   tools/configurator/templates/app_configuration/iop/iop_logical_device.mako
	new file:   tools/configurator/templates/app_configuration/iop/iop_occan.mako
	modified:   tools/configurator/templates/include/makefile.mako
	modified:   tools/configurator/tools/configure_air.py
	modified:   ../utils/jenkins/aftercommitbuild.sh
parent 2da58ef9
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ARINC_653_Module xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ModuleName="iop_example">
<!-- Partition 2 -->
<Partition PartitionIdentifier="2" PartitionName="iop"
Criticality="LEVEL_A" EntryPoint="empty" SystemPartition="false">
<Sampling_Port Name="iop_sender"
Direction="SOURCE" MaxMessageSize="8" RefreshRateSeconds="1.0"/>
<Sampling_Port Name="iop_receiver"
Direction="DESTINATION" MaxMessageSize="8" RefreshRateSeconds="1.0"/>
<PartitionConfiguration Personality="RTEMS" IOP="iop.xml" Cores="1">
<Libs>LIBAIR; LIBIOP; LIBPRINTF</Libs>
<Devices></Devices>
<Cache>CODE; DATA</Cache>
<Memory Size="0x400000" />
<Permissions>
CACHE_CONTROL; SET_TOD; SET_PARTITION_MODE;
</Permissions>
</PartitionConfiguration>
</Partition>
<!-- Partition 1 -->
<Partition PartitionIdentifier="1" PartitionName="partition1"
Criticality="LEVEL_A" EntryPoint="entry_func" SystemPartition="false">
<Sampling_Port Name="partition_receiver"
Direction="DESTINATION" MaxMessageSize="8" RefreshRateSeconds="1.0"/>
<Sampling_Port Name="partition_sender"
Direction="SOURCE" MaxMessageSize="8" RefreshRateSeconds="1.0"/>
<PartitionConfiguration Personality="RTEMS" Cores="1">
<Libs>LIBAIR; IMASPEX; LIBPRINTF</Libs>
<Devices></Devices>
<Cache>CODE; DATA</Cache>
<Memory Size="0x400000" />
<Permissions>
CACHE_CONTROL; GLOBAL_TIME; SET_TOD; SET_PARTITION_MODE;
</Permissions>
</PartitionConfiguration>
</Partition>
<!-- Schedule 1 -->
<Module_Schedule ScheduleIdentifier="1" ScheduleName="schedule"
InitialModuleSchedule="true" MajorFrameSeconds="1.0">
<Partition_Schedule PartitionIdentifier="1" PartitionName="partition1"
PeriodDurationSeconds="0.5" PeriodSeconds="1.0">
<Window_Schedule WindowIdentifier="1" PartitionPeriodStart="true"
WindowDurationSeconds="0.5" WindowStartSeconds="0.0"/>
</Partition_Schedule>
<Partition_Schedule PartitionIdentifier="2" PartitionName="iop"
PeriodDurationSeconds="0.5" PeriodSeconds="1.0">
<Window_Schedule WindowIdentifier="3" PartitionPeriodStart="true"
WindowDurationSeconds="0.5" WindowStartSeconds="0.5"/>
</Partition_Schedule>
</Module_Schedule>
<!-- Connection table -->
<Connection_Table>
<Channel ChannelIdentifier="1" ChannelName="MessageIn">
<Source>
<Standard_Partition PartitionIdentifier="1" PartitionName="partition1"
PortName="partition_sender"/>
</Source>
<Destination>
<Standard_Partition PartitionIdentifier="2" PartitionName="iop"
PortName="iop_receiver"/>
</Destination>
</Channel>
<Channel ChannelIdentifier="2" ChannelName="MessageOut">
<Source>
<Standard_Partition PartitionIdentifier="2" PartitionName="iop"
PortName="iop_sender"/>
</Source>
<Destination>
<Standard_Partition PartitionIdentifier="1" PartitionName="partition1"
PortName="partition_receiver"/>
</Destination>
</Channel>
</Connection_Table>
<!-- Module configuration -->
<AIR_Configuration TicksPerSecond="1000" RequiredCores="1"/>
</ARINC_653_Module>
<?xml version="1.0" encoding="UTF-8"?>
<IOPartition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="iop.xsd" version="1.0" date="2017-11-20" name="iop_example" request_number="64" time_to_live="5">
<RemotePorts>
<Port Name="iop_receiver" LogicalDeviceId="1"/>
<Port Name="iop_sender" />
</RemotePorts>
<LogicalDevices>
<Device Id="1" Name="PARSERVER" Extended="1" RTR="0" />
</LogicalDevices>
<PhysicalDevices>
<Device Id="1" Device="CAN0" CanID ="2" Speed="250" TXD="32" RXD="32" InternalQueue="8" SingleMode="true" Code="f:f:f:f" Mask="f:f:f:f">
<PhysicalRoute Id="1" PortId="iop_sender">
<CanHeader Extended="true" RTR="true" CanID="1"/>
</PhysicalRoute>
<LogicalRoute Id="2" LogicalDeviceId="1">
<CanHeader Extended="false" RTR="false" CanID="1"/>
</LogicalRoute>
</Device>
</PhysicalDevices>
<ModuleSchedules>
<Schedule ScheduleIdentifier="1">
<DevicesConfiguration>
<Device DeviceId="1" Device="CAN0" Reads="5"/>
</DevicesConfiguration>
<RoutesConfiguration>
<Route RouteId="1" Active="true"/>
<Route RouteId="2" Active="true"/>
</RoutesConfiguration>
</Schedule>
</ModuleSchedules>
</IOPartition>
......@@ -33,16 +33,12 @@ static iop_logical_device_t *logical_device_list[1] = \
static iop_wrapper_t requests_storage[1024];
<<<<<<< HEAD
=======
/**
* @brief IOP buffers
*/
>>>>>>> 0a924f0799a09d9f4e65b65a2d2cda1647614e32
static iop_buffer_t iop_buffers[1024];
static uint8_t iop_buffers_storage[1024 * IOP_BUFFER_SIZE];
/**
* @brief IOP application configurations
*/
......@@ -51,18 +47,18 @@ iop_configuration_t usr_configuration = {
.wrappers = requests_storage,
.iop_buffers = iop_buffers,
.iop_buffers_storage = iop_buffers_storage,
.wrappers_count = 1024,
.wrappers_count = 1024,
.physical_devices = {
.length = 1,
.elements = physical_device_list
},
.logical_devices = {
.length = 1,
.logical_devices = {
.length = 2,
.elements = logical_device_list
},
.remote_ports = {
.length = 2,
.length = 3,
.elements = remote_ports
}
};
......
#include <iop.h>
/**
* @brief IOP remote ports
*/
extern iop_port_t remote_ports[2];
/**
* @brief Logical devices
*/
extern iop_logical_device_t logical_device_0;
/**
* @brief Physical devices
*/
extern iop_physical_device_t physical_device_0;
/**
* @brief Physical devices list
*/
static iop_physical_device_t *physical_device_list[1] = \
{
&physical_device_0,
};
/**
<<<<<<< HEAD:air/examples/iop_example/iop/iop_config.c
* @brief Logical devices list
=======
* @brief Logical devices list
>>>>>>> fb18a89153... Changes to try solve the makefile.inc problem. rtems48i is being:air/examples/iop_can/iop/iop_config.c
*/
static iop_logical_device_t *logical_device_list[1] = \
{
&logical_device_0,
};
static iop_wrapper_t requests_storage[1024];
<<<<<<< HEAD:air/examples/iop_example/iop/iop_config.c
<<<<<<< HEAD
=======
/**
* @brief IOP buffers
*/
>>>>>>> 0fa1c25905eb153e539430acdbbac264eed8fee2
=======
/**
* @brief IOP buffers
*/
>>>>>>> fb18a89153... Changes to try solve the makefile.inc problem. rtems48i is being:air/examples/iop_can/iop/iop_config.c
static iop_buffer_t iop_buffers[1024];
static uint8_t iop_buffers_storage[1024 * IOP_BUFFER_SIZE];
/**
* @brief IOP application configurations
*/
iop_configuration_t usr_configuration = {
.wrappers = requests_storage,
.iop_buffers = iop_buffers,
.iop_buffers_storage = iop_buffers_storage,
.wrappers_count = 1024,
.physical_devices = {
.length = 1,
.elements = physical_device_list
},
.logical_devices = {
.length = 2,
.elements = logical_device_list
},
.remote_ports = {
.length = 3,
.elements = remote_ports
}
};
#include <iop.h>
/**
* @brief Physical devices
*/
extern iop_physical_device_t physical_device_0;
/**
* @brief Routes Headers
*/
static iop_header_t route_header[1] = \
{
{
.can_header = {
.extended = 0,
.rtr = 0,
.sshot = 0,
.id = 2
}
}
};
/**
* @brief Routes Scheduling
*/
static uint32_t route_schedule_0[1] = \
{ 1 };
/**
* @brief Routes Configuration
*/
static iop_logical_route_t logical_routes[1] = \
{
{
.schedule = route_schedule_0,
.header = &route_header[0],
.device = &physical_device_0
}
};
/**
* @brief Logical Device configuration
*/
iop_logical_device_t logical_device_0= \
{
.routes = {
.length = 1,
.elements = logical_routes
},
};
#include <iop.h>
/**
* @brief Physical devices
*/
extern iop_physical_device_t physical_device_0;
/**
* @brief Routes Headers
*/
static iop_header_t route_header[1] = \
{
<<<<<<< HEAD:air/examples/iop_example/iop/iop_logical_device_0.c
{
.eth_header = {
.dst_ip = { 192,168,0,2},
.dst_mac = { 0x68,0x05,0xca,0x1f,0x39,0xaf},
.dst_port = HTONS(13000),
.src_port = HTONS(13000)
}
}
=======
{
.can_header = {
.extended = 0,
.rtr = 0,
.sshot = 0,
.id = 2
}
}
>>>>>>> fb18a89153... Changes to try solve the makefile.inc problem. rtems48i is being:air/examples/iop_can/iop/iop_logical_device_0.c
};
/**
* @brief Routes Scheduling
*/
static uint32_t route_schedule_0[1] = \
{ 1 };
/**
* @brief Routes Configuration
*/
static iop_logical_route_t logical_routes[1] = \
{
{
.schedule = route_schedule_0,
.header = &route_header[0],
.device = &physical_device_0
}
};
/**
* @brief Logical Device configuration
*/
iop_logical_device_t logical_device_0= \
{
.routes = {
.length = 1,
.elements = logical_routes
},
};
......@@ -13,8 +13,8 @@ static iop_header_t route_header[1] = \
{
{
.eth_header = {
.dst_ip = { 192,168,0,2},
.dst_mac = { 0x68,0x05,0xca,0x1f,0x39,0xaf},
.dst_ip = { 192,168,0,3},
.dst_mac = { 0x00,0x50,0xbf,0x50,0x07,0x0d},
.dst_port = HTONS(13000),
.src_port = HTONS(13000)
}
......
#include <iop.h>
/**
* @brief Physical devices
*/
extern iop_physical_device_t physical_device_0;
/**
* @brief Routes Headers
*/
static iop_header_t route_header[1] = \
{
{
.eth_header = {
<<<<<<< HEAD
.dst_ip = { 192,168,0,3},
.dst_mac = { 0x00,0x50,0xbf,0x50,0x07,0x0d},
=======
.dst_ip = { 192,168,0,2},
.dst_mac = { 0x68,0x05,0xca,0x1f,0x39,0xaf},
>>>>>>> 0fa1c25905eb153e539430acdbbac264eed8fee2
.dst_port = HTONS(13000),
.src_port = HTONS(13000)
}
}
};
/**
* @brief Routes Scheduling
*/
static uint32_t route_schedule_0[1] = \
{ 1 };
/**
* @brief Routes Configuration
*/
static iop_logical_route_t logical_routes[1] = \
{
{
.schedule = route_schedule_0,
.header = &route_header[0],
.device = &physical_device_0
}
};
/**
* @brief Logical Device configuration
*/
iop_logical_device_t logical_device_0 = \
{
.routes = {
.length = 1,
.elements = logical_routes
},
};
#include <iop.h>
/**
* @brief Physical devices
*/
extern iop_physical_device_t physical_device_0;
/**
* @brief Routes Headers
*/
static iop_header_t route_header[1] = \
{
{
.can_header = {
.extended = 0,
.rtr = 0,
.sshot = 0,
.id = 2
}
}
};
/**
* @brief Routes Scheduling
*/
static uint32_t route_schedule_0[1] = \
{ 1 };
/**
* @brief Routes Configuration
*/
static iop_logical_route_t logical_routes[1] = \
{
{
.schedule = route_schedule_0,
.header = &route_header[0],
.device = &physical_device_0
}
};
/**
* @brief Logical Device configuration
*/
iop_logical_device_t logical_device_0= \
{
.routes = {
.length = 1,
.elements = logical_routes
},
};
/*
* ============================================================================
* This file was generated by the GMV's Configurator Tool and is part of an I/O
* partition configuration.
* File Purpose: IO Partition user configuration. Contains the configuration
* options for Ethernet's GRSPW devices.
* ============================================================================
*/
#include <iop.h>
#include <IOPgrspw.h>
#include <spw_support.h>
>>>>>>> 0a924f0799a09d9f4e65b65a2d2cda1647614e32
/*
* ============================================================================
* File Purpose: IO Partition user configuration. Contains the configuration
* options for CAN devices.
* ============================================================================
*/
#include <iop.h>
#include <iop_occan.h>
#include <can_support.h>
/**
* @brief IOP remote ports
*/
extern iop_port_t remote_ports[2];
<<<<<<< HEAD
/**
* @brief IOP buffers
*/
static iop_buffer_t iop_buffers[64];
static uint8_t iop_buffers_storage[64 * IOP_BUFFER_SIZE];
......@@ -29,123 +28,78 @@ static iop_buffer_t *tx_iop_buffer[32];
*/
static iop_buffer_t *rx_iop_buffer[32];
/**
* @brief Allocation of for the internal message queue
* to be used by the occan driver
*/
static CANMsg rx_msg_fifo[32];
static CANMsg tx_msg_fifo[32];
/**
* @brief RX and TX descriptor table
* @warning this should be 2048, but we need 3072 to ensure the 0x400 alignment
*/
static uint8_t descriptor_table[3072];
//static uint8_t descriptor_table[3072];
/** @brief GRETH control structure*/
static greth_softc_t greth_driver = \
static occan_priv occan_driver = \
{
.iop_buffers = iop_buffers,
.speed = 250000, // TODO maybe use a enum in the future
.filter = {
.single_mode = 0,
.code = {0, 0, 0, 0},
.mask = {0, 0, 0, 0},
},
.iop_buffers = iop_buffers,
.iop_buffers_storage = iop_buffers_storage,
.rx_fifo = {
.cnt = 0,
.ovcnt = 0,
.next = 0,
.last = 0,
.max = 32,
.fifo = rx_msg_fifo,
},
.tx_fifo = {
.cnt = 0,
.ovcnt = 0,
.next = 0,
.last = 0,
.max = 32,
.fifo = tx_msg_fifo,
},
/** @note descriptor table address are split and aligned at the runtime */
.txdesc = descriptor_table,
.rxdesc = descriptor_table,
// .txdesc = descriptor_table,
// .rxdesc = descriptor_table,
.tx_iop_buffer = tx_iop_buffer,
.rx_iop_buffer = rx_iop_buffer
};
/** @brief GRETH driver configuration */
static iop_eth_device_t device_configuration = \
static iop_can_device_t device_configuration = \
{
/* device configuration */
.dev = {
.driver = (void *)&greth_driver,
.init = greth_initialize,
.open = greth_open,
.read = greth_read,
.write = greth_write,
.close = greth_close,
.driver = (void *)&occan_driver,
.init = occan_initialize,
.open = occan_open,
.read = occan_read,
.write = occan_write,
.close = occan_close,
},
/* ethernet configuration */
.ip = { 192, 168, 0, 17 },
.mac = { 0x00, 0x50, 0xC2, 0x75, 0xa0, 0x60 },
.rx_count = 32,
.tx_count = 32
.dev_name ="/dev/occan0",
// .count = 0,
// .flags = 0,
// .bytes_moved = 0,
};
=======
/**
* @brief IOP buffers
*/
static iop_buffer_t iop_buffers[96];
static uint8_t iop_buffers_storage[96 * IOP_BUFFER_SIZE];
/**
* @brief TX descriptor to IOP buffer mapping
*/
static iop_buffer_t *tx_iop_buffer[32];
/**
* @brief RX descriptor to IOP buffer mappin