[PATCH 05/12] fsl/fman: Add the FMan MAC FLIB headers
From: Igal Liberman igal.liber...@freescale.com The FMan MAC FLib provides basic API used by the drivers to configure and control the FMan MAC hardware. Signed-off-by: Igal Liberman igal.liber...@freescale.com --- .../net/ethernet/freescale/fman/flib/fsl_enet.h| 275 +++ .../ethernet/freescale/fman/flib/fsl_fman_dtsec.h | 791 .../freescale/fman/flib/fsl_fman_dtsec_mii_acc.h | 103 +++ .../ethernet/freescale/fman/flib/fsl_fman_memac.h | 453 +++ .../freescale/fman/flib/fsl_fman_memac_mii_acc.h | 76 ++ .../ethernet/freescale/fman/flib/fsl_fman_tgec.h | 409 ++ 6 files changed, 2107 insertions(+) create mode 100644 drivers/net/ethernet/freescale/fman/flib/fsl_enet.h create mode 100644 drivers/net/ethernet/freescale/fman/flib/fsl_fman_dtsec.h create mode 100644 drivers/net/ethernet/freescale/fman/flib/fsl_fman_dtsec_mii_acc.h create mode 100644 drivers/net/ethernet/freescale/fman/flib/fsl_fman_memac.h create mode 100644 drivers/net/ethernet/freescale/fman/flib/fsl_fman_memac_mii_acc.h create mode 100644 drivers/net/ethernet/freescale/fman/flib/fsl_fman_tgec.h diff --git a/drivers/net/ethernet/freescale/fman/flib/fsl_enet.h b/drivers/net/ethernet/freescale/fman/flib/fsl_enet.h new file mode 100644 index 000..78e7d04 --- /dev/null +++ b/drivers/net/ethernet/freescale/fman/flib/fsl_enet.h @@ -0,0 +1,275 @@ +/* + * Copyright 2008 - 2015 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License (GPL) as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``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 Freescale Semiconductor 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. + */ + +#ifndef __FSL_ENET_H +#define __FSL_ENET_H + +/*Ethernet MAC-PHY Interface */ + +enum enet_interface { + E_ENET_IF_MII = 0x0001, /* MII interface */ + E_ENET_IF_RMII = 0x0002, /* RMII interface */ + E_ENET_IF_SMII = 0x0003, /* SMII interface */ + E_ENET_IF_GMII = 0x0004, /* GMII interface */ + E_ENET_IF_RGMII = 0x0005, /* RGMII interface */ + E_ENET_IF_TBI = 0x0006, /* TBI interface */ + E_ENET_IF_RTBI = 0x0007, /* RTBI interface */ + E_ENET_IF_SGMII = 0x0008, /* SGMII interface */ + E_ENET_IF_XGMII = 0x0009, /* XGMII interface */ + E_ENET_IF_QSGMII = 0x000a,/* QSGMII interface */ + E_ENET_IF_XFI = 0x000b/* XFI interface */ +}; + +/* Ethernet Speed (nominal data rate) */ +enum enet_speed { + E_ENET_SPEED_10 = 10, /* 10 Mbps */ + E_ENET_SPEED_100 = 100, /* 100 Mbps */ + E_ENET_SPEED_1000 = 1000, /* 1000 Mbps = 1 Gbps */ + E_ENET_SPEED_1 = 1 /* 1 Mbps = 10 Gbps */ +}; + +enum mac_type { + E_MAC_DTSEC, + E_MAC_TGEC, + E_MAC_MEMAC +}; + +/* Enum for inter-module interrupts registration */ +enum fman_event_modules { + E_FMAN_MOD_PRS, /* Parser event */ + E_FMAN_MOD_KG,/* Keygen event */ + E_FMAN_MOD_PLCR, /* Policer event */ + E_FMAN_MOD_10G_MAC, /* 10G MAC event */ + E_FMAN_MOD_1G_MAC,/* 1G MAC event */ + E_FMAN_MOD_TMR, /* Timer event */ + E_FMAN_MOD_FMAN_CTRL, /* FMAN Controller Timer event */ +
[PATCH 05/12] fsl/fman: Add the FMan MAC FLIB headers
From: Igal Liberman igal.liber...@freescale.com The FMan MAC FLib provides basic API used by the drivers to configure and control the FMan MAC hardware. Signed-off-by: Igal Liberman igal.liber...@freescale.com --- .../net/ethernet/freescale/fman/flib/fsl_enet.h| 275 +++ .../ethernet/freescale/fman/flib/fsl_fman_dtsec.h | 791 + .../freescale/fman/flib/fsl_fman_dtsec_mii_acc.h | 103 +++ .../ethernet/freescale/fman/flib/fsl_fman_memac.h | 453 .../freescale/fman/flib/fsl_fman_memac_mii_acc.h | 76 ++ .../ethernet/freescale/fman/flib/fsl_fman_tgec.h | 409 +++ 6 files changed, 2107 insertions(+) create mode 100644 drivers/net/ethernet/freescale/fman/flib/fsl_enet.h create mode 100644 drivers/net/ethernet/freescale/fman/flib/fsl_fman_dtsec.h create mode 100644 drivers/net/ethernet/freescale/fman/flib/fsl_fman_dtsec_mii_acc.h create mode 100644 drivers/net/ethernet/freescale/fman/flib/fsl_fman_memac.h create mode 100644 drivers/net/ethernet/freescale/fman/flib/fsl_fman_memac_mii_acc.h create mode 100644 drivers/net/ethernet/freescale/fman/flib/fsl_fman_tgec.h diff --git a/drivers/net/ethernet/freescale/fman/flib/fsl_enet.h b/drivers/net/ethernet/freescale/fman/flib/fsl_enet.h new file mode 100644 index 000..78e7d04 --- /dev/null +++ b/drivers/net/ethernet/freescale/fman/flib/fsl_enet.h @@ -0,0 +1,275 @@ +/* + * Copyright 2008 - 2015 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License (GPL) as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``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 Freescale Semiconductor 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. + */ + +#ifndef __FSL_ENET_H +#define __FSL_ENET_H + +/*Ethernet MAC-PHY Interface */ + +enum enet_interface { + E_ENET_IF_MII = 0x0001, /* MII interface */ + E_ENET_IF_RMII = 0x0002, /* RMII interface */ + E_ENET_IF_SMII = 0x0003, /* SMII interface */ + E_ENET_IF_GMII = 0x0004, /* GMII interface */ + E_ENET_IF_RGMII = 0x0005, /* RGMII interface */ + E_ENET_IF_TBI = 0x0006, /* TBI interface */ + E_ENET_IF_RTBI = 0x0007, /* RTBI interface */ + E_ENET_IF_SGMII = 0x0008, /* SGMII interface */ + E_ENET_IF_XGMII = 0x0009, /* XGMII interface */ + E_ENET_IF_QSGMII = 0x000a,/* QSGMII interface */ + E_ENET_IF_XFI = 0x000b/* XFI interface */ +}; + +/* Ethernet Speed (nominal data rate) */ +enum enet_speed { + E_ENET_SPEED_10 = 10, /* 10 Mbps */ + E_ENET_SPEED_100 = 100, /* 100 Mbps */ + E_ENET_SPEED_1000 = 1000, /* 1000 Mbps = 1 Gbps */ + E_ENET_SPEED_1 = 1 /* 1 Mbps = 10 Gbps */ +}; + +enum mac_type { + E_MAC_DTSEC, + E_MAC_TGEC, + E_MAC_MEMAC +}; + +/* Enum for inter-module interrupts registration */ +enum fman_event_modules { + E_FMAN_MOD_PRS, /* Parser event */ + E_FMAN_MOD_KG,/* Keygen event */ + E_FMAN_MOD_PLCR, /* Policer event */ + E_FMAN_MOD_10G_MAC, /* 10G MAC event */ + E_FMAN_MOD_1G_MAC,/* 1G MAC event */ + E_FMAN_MOD_TMR, /* Timer event */ + E_FMAN_MOD_FMAN_CTRL, /* FMAN Controller Timer event */ +