2017-04-14 11:35:00 +03:00
|
|
|
/*
|
|
|
|
* Faraday FTGMAC100 Gigabit Ethernet
|
|
|
|
*
|
|
|
|
* Copyright (C) 2016-2017, IBM Corporation.
|
|
|
|
*
|
|
|
|
* This code is licensed under the GPL version 2 or later. See the
|
|
|
|
* COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FTGMAC100_H
|
|
|
|
#define FTGMAC100_H
|
2020-09-03 23:43:22 +03:00
|
|
|
#include "qom/object.h"
|
2017-04-14 11:35:00 +03:00
|
|
|
|
|
|
|
#define TYPE_FTGMAC100 "ftgmac100"
|
2020-09-03 23:43:22 +03:00
|
|
|
typedef struct FTGMAC100State FTGMAC100State;
|
2017-04-14 11:35:00 +03:00
|
|
|
#define FTGMAC100(obj) OBJECT_CHECK(FTGMAC100State, (obj), TYPE_FTGMAC100)
|
|
|
|
|
|
|
|
#include "hw/sysbus.h"
|
|
|
|
#include "net/net.h"
|
|
|
|
|
2018-06-08 15:15:32 +03:00
|
|
|
/*
|
|
|
|
* Max frame size for the receiving buffer
|
|
|
|
*/
|
|
|
|
#define FTGMAC100_MAX_FRAME_SIZE 9220
|
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct FTGMAC100State {
|
2017-04-14 11:35:00 +03:00
|
|
|
/*< private >*/
|
|
|
|
SysBusDevice parent_obj;
|
|
|
|
|
|
|
|
/*< public >*/
|
|
|
|
NICState *nic;
|
|
|
|
NICConf conf;
|
|
|
|
qemu_irq irq;
|
|
|
|
MemoryRegion iomem;
|
|
|
|
|
2018-06-08 15:15:32 +03:00
|
|
|
uint8_t frame[FTGMAC100_MAX_FRAME_SIZE];
|
2017-04-14 11:35:00 +03:00
|
|
|
|
|
|
|
uint32_t irq_state;
|
|
|
|
uint32_t isr;
|
|
|
|
uint32_t ier;
|
|
|
|
uint32_t rx_enabled;
|
|
|
|
uint32_t rx_ring;
|
|
|
|
uint32_t rx_descriptor;
|
|
|
|
uint32_t tx_ring;
|
|
|
|
uint32_t tx_descriptor;
|
|
|
|
uint32_t math[2];
|
|
|
|
uint32_t rbsr;
|
|
|
|
uint32_t itc;
|
|
|
|
uint32_t aptcr;
|
|
|
|
uint32_t dblac;
|
|
|
|
uint32_t revr;
|
|
|
|
uint32_t fear1;
|
|
|
|
uint32_t tpafcr;
|
|
|
|
uint32_t maccr;
|
|
|
|
uint32_t phycr;
|
|
|
|
uint32_t phydata;
|
|
|
|
uint32_t fcr;
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t phy_status;
|
|
|
|
uint32_t phy_control;
|
|
|
|
uint32_t phy_advertise;
|
|
|
|
uint32_t phy_int;
|
|
|
|
uint32_t phy_int_mask;
|
2017-04-14 11:35:01 +03:00
|
|
|
|
|
|
|
bool aspeed;
|
|
|
|
uint32_t txdes0_edotr;
|
|
|
|
uint32_t rxdes0_edorr;
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2017-04-14 11:35:00 +03:00
|
|
|
|
2019-09-25 17:32:47 +03:00
|
|
|
#define TYPE_ASPEED_MII "aspeed-mmi"
|
2020-09-03 23:43:22 +03:00
|
|
|
typedef struct AspeedMiiState AspeedMiiState;
|
2019-09-25 17:32:47 +03:00
|
|
|
#define ASPEED_MII(obj) OBJECT_CHECK(AspeedMiiState, (obj), TYPE_ASPEED_MII)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* AST2600 MII controller
|
|
|
|
*/
|
2020-09-03 23:43:22 +03:00
|
|
|
struct AspeedMiiState {
|
2019-09-25 17:32:47 +03:00
|
|
|
/*< private >*/
|
|
|
|
SysBusDevice parent_obj;
|
|
|
|
|
|
|
|
FTGMAC100State *nic;
|
|
|
|
|
|
|
|
MemoryRegion iomem;
|
|
|
|
uint32_t phycr;
|
|
|
|
uint32_t phydata;
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2019-09-25 17:32:47 +03:00
|
|
|
|
2017-04-14 11:35:00 +03:00
|
|
|
#endif
|