if_xae: Port to RTEMS

This commit is contained in:
Alex White
2022-02-06 21:12:31 -06:00
committed by Joel Sherrill
parent ee4fb53241
commit 40b9c6ce63
11 changed files with 310 additions and 1 deletions

View File

@@ -277,6 +277,14 @@ RTEMS_BSD_DRIVER_PC_LEGACY;
RTEMS_BSD_DRIVER_PCI_DC;
RTEMS_BSD_DRIVER_UKPHY;
#endif /* LIBBSP_POWERPC_MOTOROLA_POWERPC_BSP_H */
#elif defined(LIBBSP_MICROBLAZE_FPGA_BSP_H)
RTEMS_BSD_DEFINE_NEXUS_DEVICE(ofwbus, 0, 0, NULL);
SYSINIT_DRIVER_REFERENCE(simplebus, ofwbus);
SYSINIT_DRIVER_REFERENCE(xae, simplebus);
SYSINIT_DRIVER_REFERENCE(axidma, simplebus);
RTEMS_BSD_DRIVER_E1000PHY;
#endif /* LIBBSP_MICROBLAZE_FPGA_BSP_H */
#endif

View File

@@ -0,0 +1,144 @@
/*
* This file is produced automatically.
* Do not modify anything in here by hand.
*
* Created from source file
* xdma_if.m
* with
* makeobjops.awk
*
* See the source file for legal information
*/
#ifndef _xdma_if_h_
#define _xdma_if_h_
/** @brief Unique descriptor for the XDMA_CHANNEL_REQUEST() method */
extern struct kobjop_desc xdma_channel_request_desc;
/** @brief A function implementing the XDMA_CHANNEL_REQUEST() method */
typedef int xdma_channel_request_t(device_t dev, struct xdma_channel *xchan,
struct xdma_request *req);
static __inline int XDMA_CHANNEL_REQUEST(device_t dev,
struct xdma_channel *xchan,
struct xdma_request *req)
{
kobjop_t _m;
int rc;
KOBJOPLOOKUP(((kobj_t)dev)->ops,xdma_channel_request);
rc = ((xdma_channel_request_t *) _m)(dev, xchan, req);
return (rc);
}
/** @brief Unique descriptor for the XDMA_CHANNEL_PREP_SG() method */
extern struct kobjop_desc xdma_channel_prep_sg_desc;
/** @brief A function implementing the XDMA_CHANNEL_PREP_SG() method */
typedef int xdma_channel_prep_sg_t(device_t dev, struct xdma_channel *xchan);
static __inline int XDMA_CHANNEL_PREP_SG(device_t dev,
struct xdma_channel *xchan)
{
kobjop_t _m;
int rc;
KOBJOPLOOKUP(((kobj_t)dev)->ops,xdma_channel_prep_sg);
rc = ((xdma_channel_prep_sg_t *) _m)(dev, xchan);
return (rc);
}
/** @brief Unique descriptor for the XDMA_CHANNEL_CAPACITY() method */
extern struct kobjop_desc xdma_channel_capacity_desc;
/** @brief A function implementing the XDMA_CHANNEL_CAPACITY() method */
typedef int xdma_channel_capacity_t(device_t dev, struct xdma_channel *xchan,
uint32_t *capacity);
static __inline int XDMA_CHANNEL_CAPACITY(device_t dev,
struct xdma_channel *xchan,
uint32_t *capacity)
{
kobjop_t _m;
int rc;
KOBJOPLOOKUP(((kobj_t)dev)->ops,xdma_channel_capacity);
rc = ((xdma_channel_capacity_t *) _m)(dev, xchan, capacity);
return (rc);
}
/** @brief Unique descriptor for the XDMA_CHANNEL_SUBMIT_SG() method */
extern struct kobjop_desc xdma_channel_submit_sg_desc;
/** @brief A function implementing the XDMA_CHANNEL_SUBMIT_SG() method */
typedef int xdma_channel_submit_sg_t(device_t dev, struct xdma_channel *xchan,
struct xdma_sglist *sg, uint32_t sg_n);
static __inline int XDMA_CHANNEL_SUBMIT_SG(device_t dev,
struct xdma_channel *xchan,
struct xdma_sglist *sg,
uint32_t sg_n)
{
kobjop_t _m;
int rc;
KOBJOPLOOKUP(((kobj_t)dev)->ops,xdma_channel_submit_sg);
rc = ((xdma_channel_submit_sg_t *) _m)(dev, xchan, sg, sg_n);
return (rc);
}
/** @brief Unique descriptor for the XDMA_OFW_MD_DATA() method */
extern struct kobjop_desc xdma_ofw_md_data_desc;
/** @brief A function implementing the XDMA_OFW_MD_DATA() method */
typedef int xdma_ofw_md_data_t(device_t dev, pcell_t *cells, int ncells,
void **data);
static __inline int XDMA_OFW_MD_DATA(device_t dev, pcell_t *cells, int ncells,
void **data)
{
kobjop_t _m;
int rc;
KOBJOPLOOKUP(((kobj_t)dev)->ops,xdma_ofw_md_data);
rc = ((xdma_ofw_md_data_t *) _m)(dev, cells, ncells, data);
return (rc);
}
/** @brief Unique descriptor for the XDMA_CHANNEL_ALLOC() method */
extern struct kobjop_desc xdma_channel_alloc_desc;
/** @brief A function implementing the XDMA_CHANNEL_ALLOC() method */
typedef int xdma_channel_alloc_t(device_t dev, struct xdma_channel *xchan);
static __inline int XDMA_CHANNEL_ALLOC(device_t dev, struct xdma_channel *xchan)
{
kobjop_t _m;
int rc;
KOBJOPLOOKUP(((kobj_t)dev)->ops,xdma_channel_alloc);
rc = ((xdma_channel_alloc_t *) _m)(dev, xchan);
return (rc);
}
/** @brief Unique descriptor for the XDMA_CHANNEL_FREE() method */
extern struct kobjop_desc xdma_channel_free_desc;
/** @brief A function implementing the XDMA_CHANNEL_FREE() method */
typedef int xdma_channel_free_t(device_t dev, struct xdma_channel *xchan);
static __inline int XDMA_CHANNEL_FREE(device_t dev, struct xdma_channel *xchan)
{
kobjop_t _m;
int rc;
KOBJOPLOOKUP(((kobj_t)dev)->ops,xdma_channel_free);
rc = ((xdma_channel_free_t *) _m)(dev, xchan);
return (rc);
}
/** @brief Unique descriptor for the XDMA_CHANNEL_CONTROL() method */
extern struct kobjop_desc xdma_channel_control_desc;
/** @brief A function implementing the XDMA_CHANNEL_CONTROL() method */
typedef int xdma_channel_control_t(device_t dev, struct xdma_channel *xchan,
int cmd);
static __inline int XDMA_CHANNEL_CONTROL(device_t dev,
struct xdma_channel *xchan, int cmd)
{
kobjop_t _m;
int rc;
KOBJOPLOOKUP(((kobj_t)dev)->ops,xdma_channel_control);
rc = ((xdma_channel_control_t *) _m)(dev, xchan, cmd);
return (rc);
}
#endif /* _xdma_if_h_ */

56
rtemsbsd/local/xdma_if.c Normal file
View File

@@ -0,0 +1,56 @@
#include <machine/rtems-bsd-kernel-space.h>
/*
* This file is produced automatically.
* Do not modify anything in here by hand.
*
* Created from source file
* xdma_if.m
* with
* makeobjops.awk
*
* See the source file for legal information
*/
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/kernel.h>
#include <sys/kobj.h>
#include <machine/bus.h>
#include <dev/fdt/fdt_common.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
#include <dev/xdma/xdma.h>
#include <rtems/bsd/local/xdma_if.h>
struct kobjop_desc xdma_channel_request_desc = {
0, { &xdma_channel_request_desc, (kobjop_t)kobj_error_method }
};
struct kobjop_desc xdma_channel_prep_sg_desc = {
0, { &xdma_channel_prep_sg_desc, (kobjop_t)kobj_error_method }
};
struct kobjop_desc xdma_channel_capacity_desc = {
0, { &xdma_channel_capacity_desc, (kobjop_t)kobj_error_method }
};
struct kobjop_desc xdma_channel_submit_sg_desc = {
0, { &xdma_channel_submit_sg_desc, (kobjop_t)kobj_error_method }
};
struct kobjop_desc xdma_ofw_md_data_desc = {
0, { &xdma_ofw_md_data_desc, (kobjop_t)kobj_error_method }
};
struct kobjop_desc xdma_channel_alloc_desc = {
0, { &xdma_channel_alloc_desc, (kobjop_t)kobj_error_method }
};
struct kobjop_desc xdma_channel_free_desc = {
0, { &xdma_channel_free_desc, (kobjop_t)kobj_error_method }
};
struct kobjop_desc xdma_channel_control_desc = {
0, { &xdma_channel_control_desc, (kobjop_t)kobj_error_method }
};