[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 26/44] Add GENET register structs. Part 4
From: |
Sergey Kambalin |
Subject: |
[PATCH 26/44] Add GENET register structs. Part 4 |
Date: |
Wed, 26 Jul 2023 16:24:54 +0300 |
Signed-off-by: Sergey Kambalin <sergey.kambalin@auriga.com>
---
include/hw/net/bcm2838_genet.h | 40 ++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/include/hw/net/bcm2838_genet.h b/include/hw/net/bcm2838_genet.h
index 4cf70a17d3..4b549ed431 100644
--- a/include/hw/net/bcm2838_genet.h
+++ b/include/hw/net/bcm2838_genet.h
@@ -25,6 +25,15 @@ OBJECT_DECLARE_SIMPLE_TYPE(BCM2838GenetState, BCM2838_GENET)
#define BCM2838_GENET_HFB_FILTER_CNT 48
#define BCM2838_GENET_HFB_FILTER_SIZE 128
+#define BCM2838_GENET_PHY_AUX_CTL_MISC 0x7
+#define BCM2838_GENET_PHY_AUX_CTL_REGS_SIZE 8
+
+#define SIZEOF_FIELD(type, field) sizeof(((type*) 0)->field)
+#define BCM2838_GENET_PHY_EXP_SHD_BLOCKS_CNT \
+ (1u << (8 * SIZEOF_FIELD(BCM2838GenetPhyExpSel, block_id)))
+#define BCM2838_GENET_PHY_EXP_SHD_REGS_CNT \
+ (1u << (8 * SIZEOF_FIELD(BCM2838GenetPhyExpSel, reg_id)))
+
typedef union {
uint32_t value;
struct {
@@ -568,6 +577,34 @@ typedef struct {
uint16_t rdb_data;
} __attribute__((__packed__)) BCM2838GenetPhyRegs;
+typedef struct {
+ uint16_t reserved_0_2[3];
+ uint16_t clk_ctl;
+ uint16_t scr2;
+ uint16_t scr3;
+ uint16_t reserved_6_9[4];
+ uint16_t apd;
+ uint16_t rgmii_mode;
+ uint16_t reserved_12;
+ uint16_t leds1;
+ uint16_t reserved_14_18[5];
+ uint16_t _100fx_ctrl;
+ uint16_t ssd;
+ uint16_t reserved_21_30[10];
+ uint16_t mode;
+} __attribute__((__packed__)) BCM2838GenetPhyShdRegs;
+
+typedef struct {
+ uint16_t auxctl;
+ uint16_t reserved_1_6[BCM2838_GENET_PHY_AUX_CTL_REGS_SIZE - 2];
+ uint16_t misc;
+} __attribute__((__packed__)) BCM2838GenetPhyAuxShdRegs;
+
+typedef struct {
+ uint16_t regs[BCM2838_GENET_PHY_EXP_SHD_BLOCKS_CNT]
+ [BCM2838_GENET_PHY_EXP_SHD_REGS_CNT];
+} __attribute__((__packed__)) BCM2838GenetPhyExpShdRegs;
+
struct BCM2838GenetState {
/*< private >*/
SysBusDevice parent_obj;
@@ -579,6 +616,9 @@ struct BCM2838GenetState {
BCM2838GenetRegs regs;
BCM2838GenetPhyRegs phy_regs;
+ BCM2838GenetPhyShdRegs phy_shd_regs;
+ BCM2838GenetPhyAuxShdRegs phy_aux_ctl_shd_regs;
+ BCM2838GenetPhyExpShdRegs phy_exp_shd_regs;
qemu_irq irq_default;
qemu_irq irq_prio;
--
2.34.1
- [PATCH 10/44] Add BCM2838 checkpoint support, (continued)
- [PATCH 10/44] Add BCM2838 checkpoint support, Sergey Kambalin, 2023/07/26
- [PATCH 14/44] Add BCM2838 PCIE Root Complex, Sergey Kambalin, 2023/07/26
- [PATCH 15/44] Add BCM2838 PCIE host, Sergey Kambalin, 2023/07/26
- [PATCH 21/44] Add clock_isp stub, Sergey Kambalin, 2023/07/26
- [PATCH 24/44] Add GENET register structs. Part 2, Sergey Kambalin, 2023/07/26
- [PATCH 09/44] Add GPIO and SD to BCM2838 periph, Sergey Kambalin, 2023/07/26
- [PATCH 11/44] Introduce Raspberry PI 4 machine, Sergey Kambalin, 2023/07/26
- [PATCH 29/44] Impl GENET MDIO, Sergey Kambalin, 2023/07/26
- [PATCH 35/44] Add mailbox test stub, Sergey Kambalin, 2023/07/26
- [PATCH 38/44] Add mailbox tests tags. Part 2, Sergey Kambalin, 2023/07/26
- [PATCH 26/44] Add GENET register structs. Part 4,
Sergey Kambalin <=
- [PATCH 19/44] Add RNG200 timer, Sergey Kambalin, 2023/07/26
- [PATCH 28/44] Impl GENET register ops., Sergey Kambalin, 2023/07/26
- [PATCH 32/44] Enable BCM2838 GENET controller, Sergey Kambalin, 2023/07/26
- [PATCH 31/44] Impl GENET RX path, Sergey Kambalin, 2023/07/26
- [PATCH 33/44] Connect RNG200, PCIE and GENET to GIC, Sergey Kambalin, 2023/07/26
- [PATCH 37/44] Add mailbox tests tags. Part 1, Sergey Kambalin, 2023/07/26
- [PATCH 36/44] Add mailbox test constants, Sergey Kambalin, 2023/07/26
- [PATCH 39/44] Add mailbox tests tags. Part 3, Sergey Kambalin, 2023/07/26
- [PATCH 40/44] Add mailbox property tests. Part 1, Sergey Kambalin, 2023/07/26
- [PATCH 41/44] Add mailbox property tests. Part 2, Sergey Kambalin, 2023/07/26