From nobody Thu Nov 14 17:56:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1708305837; cv=none; d=zohomail.com; s=zohoarc; b=F35TTNDXcWU9KODfnBOOQPDOh2bR8jwRNHqqQTouGkP4IOGoE86egZy6spyCinxMIa4nQWc06Mw6fdttGll+zynMfER3FAsDAsnmz+KF91e0yX9wfoUTnkORKZsXEeUZFporydJCYLKuuCafGzukl7AhCq8mPgQDcXLo8p1SA8k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708305837; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=A0Jk5tssg+pczQf+sURfDosRQjtzzg5NlLkdIkk5IGA=; b=Rx27eZGP+Tnlbflo/oaRFYre7X+ciqn8460aPYjzdRDgYqQGkmYaJ37QaphjrT9lJTIxRyHcduAm7j/UoYorZUvUYxBm2k6zy6/BmZzdDzmGrgFihZ0NdAAxoqCJmtdOmJS4RCIeZvUj4CDVsPlP4C+VW88lX5m5DFRVJmeo1CQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1708305837666779.381324305283; Sun, 18 Feb 2024 17:23:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rbsJH-0004Kt-Rk; Sun, 18 Feb 2024 20:19:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbsIT-0003NN-Mg; Sun, 18 Feb 2024 20:18:21 -0500 Received: from mail-yw1-x1129.google.com ([2607:f8b0:4864:20::1129]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rbsIR-0004Ih-7n; Sun, 18 Feb 2024 20:18:16 -0500 Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-6084165494eso663847b3.1; Sun, 18 Feb 2024 17:18:14 -0800 (PST) Received: from localhost.localdomain ([201.203.117.224]) by smtp.gmail.com with ESMTPSA id m12-20020a819e0c000000b00607ff905ed3sm1204704ywj.58.2024.02.18.17.18.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 17:18:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708305494; x=1708910294; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A0Jk5tssg+pczQf+sURfDosRQjtzzg5NlLkdIkk5IGA=; b=DiKyCqgxMwryyHVjebsQnq7bVRB599B0OlV+mC3dYmIWYoL3mpsNKchbL4o51lJNei vsbzDFlVDvHXDogqI8mYDav6VkJZ44APe2OsdmT+Uf3tUmlF/3mRiPGJBa3lLdhZhnJA 2EcV+zqbwbfSsVzajCs8woQDjr189Vu140QdKilBzy3UQ9ysjTcnFPEmbdI5xAs/Cv0G hGcbJFVKJR+zQCgU73bVtpXrg23B4caM7iwY7dFRYrai9z942BW0OSpVkfein64ziKl5 7oIZV2Umzad63ocMvtYp5V4BPM3X80nHWhYryoy5wmATVM6u/8qYBNeKdPnZdE/NgW5D 6LaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708305494; x=1708910294; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A0Jk5tssg+pczQf+sURfDosRQjtzzg5NlLkdIkk5IGA=; b=Cfxq4kX+2HCPK7KQNRFgdBDGICCz5C5wJ7tqjGGN6cioDuMx/aCbfsG0XuyMTmc6sG DM0R1JxM4wejpxnb87hoMtGbiYogKYqv9NvsmS0+FeO+t5VVfEeDUcObt1qxCl1WJYsd Yz2eSoRPmvoub6W3eJ9KypSIMCZVgj+O5ayy1w6lXprxNG9d7XYnr9CE/8zT30jgPRTb dMQ84ZCXK8Ref1p2BewygyirWYaT+xsBnkjbxP499i0oRi6y69/Su/+PwfJ7FhhoXMDA TKRjPDTZ1DFLNapbfxrUN/a7zbTwaWQy8KAuUuGaMDbyKnqZ7ft2/HshBPjcYzgbiKWd zSVQ== X-Gm-Message-State: AOJu0YyxWjpAGstitIlXMC72bAfTehpjbVuYYqhZSYXg2/46xpkB4fE3 pK0hw5NoJjnEsLG015Qrqgx6O2xan6gRW8BO4h2m9hENdgEzU2MDUFDFc0xGgVo= X-Google-Smtp-Source: AGHT+IHYtoBj/483SakpYc1IKNfJzRdwddyhRBSusaP9TpBXPvKW7qXO0FmVRaHZaMYwARBN9+e6Jw== X-Received: by 2002:a81:b049:0:b0:607:db04:1591 with SMTP id x9-20020a81b049000000b00607db041591mr9815938ywk.14.1708305493668; Sun, 18 Feb 2024 17:18:13 -0800 (PST) From: Sergey Kambalin X-Google-Original-From: Sergey Kambalin To: qemu-arm@nongnu.org Cc: qemu-devel@nongnu.org, Sergey Kambalin Subject: [PATCH v5 24/41] Add GENET register access macros Date: Sun, 18 Feb 2024 19:17:22 -0600 Message-Id: <20240219011739.2316619-25-sergey.kambalin@auriga.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240219011739.2316619-1-sergey.kambalin@auriga.com> References: <20240219011739.2316619-1-sergey.kambalin@auriga.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1129; envelope-from=serg.oker@gmail.com; helo=mail-yw1-x1129.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, UPPERCASE_50_75=0.008 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1708305839353100005 Content-Type: text/plain; charset="utf-8" Signed-off-by: Sergey Kambalin --- include/hw/net/bcm2838_genet.h | 76 ++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/include/hw/net/bcm2838_genet.h b/include/hw/net/bcm2838_genet.h index 94c2f3ebca..e7a76cda81 100644 --- a/include/hw/net/bcm2838_genet.h +++ b/include/hw/net/bcm2838_genet.h @@ -22,9 +22,85 @@ OBJECT_DECLARE_SIMPLE_TYPE(BCM2838GenetState, BCM2838_GE= NET) #define BCM2838_GENET_DMA_RING_CNT 17 #define BCM2838_GENET_DMA_RING_DEFAULT (BCM2838_GENET_DMA_RING_CNT - 1) =20 +#define BCM2838_GENET_HFB_FILTER_REGS offsetof(BCM2838GenetRegs, hfb) +#define BCM2838_GENET_HFB_FILTER_REG(reg) (BCM2838_GENET_HFB_FILTER_REGS \ + + offsetof(BCM2838GenetRegsHfb,= reg)) #define BCM2838_GENET_HFB_FILTER_CNT 48 #define BCM2838_GENET_HFB_FILTER_SIZE 128 =20 +#define BCM2838_GENET_INTRL0_REG(reg) (offsetof(BCM2838GenetRegs, intrl0= ) \ + + offsetof(BCM2838GenetRegsIntrl0,= reg)) +#define BCM2838_GENET_INTRL0_SET BCM2838_GENET_INTRL0_REG(set) +#define BCM2838_GENET_INTRL0_CLEAR BCM2838_GENET_INTRL0_REG(clear) +#define BCM2838_GENET_INTRL0_MASK_SET BCM2838_GENET_INTRL0_REG(mask_set) +#define BCM2838_GENET_INTRL0_MASK_CLEAR BCM2838_GENET_INTRL0_REG(mask_clea= r) + +#define BCM2838_GENET_INTRL1_REG(reg) (offsetof(BCM2838GenetRegs, intrl1= ) \ + + offsetof(BCM2838GenetRegsIntrl1,= reg)) +#define BCM2838_GENET_INTRL1_SET BCM2838_GENET_INTRL1_REG(set) +#define BCM2838_GENET_INTRL1_CLEAR BCM2838_GENET_INTRL1_REG(clear) +#define BCM2838_GENET_INTRL1_MASK_SET BCM2838_GENET_INTRL1_REG(mask_set) +#define BCM2838_GENET_INTRL1_MASK_CLEAR BCM2838_GENET_INTRL1_REG(mask_clea= r) + +#define BCM2838_GENET_UMAC_REG(reg) (offsetof(BCM2838GenetRegs, umac) \ + + offsetof(BCM2838GenetRegsUmac, = reg)) +#define BCM2838_GENET_UMAC_CMD BCM2838_GENET_UMAC_REG(cmd) +#define BCM2838_GENET_UMAC_MAC0 BCM2838_GENET_UMAC_REG(mac0) +#define BCM2838_GENET_UMAC_MAC1 BCM2838_GENET_UMAC_REG(mac1) +#define BCM2838_GENET_UMAC_MDIO_CMD BCM2838_GENET_UMAC_REG(mdio_cmd) + +#define BCM2838_GENET_TDMA_REGS offsetof(BCM2838GenetRegs, tdma) +#define BCM2838_GENET_TDMA_REG(reg) (BCM2838_GENET_TDMA_REGS \ + + offsetof(BCM2838GenetRegsTdma, = reg)) +#define BCM2838_GENET_TDMA_RINGS BCM2838_GENET_TDMA_REG(rings) +#define BCM2838_GENET_TDMA_RING_CFG BCM2838_GENET_TDMA_REG(ring_cfg) +#define BCM2838_GENET_TDMA_CTRL BCM2838_GENET_TDMA_REG(ctrl) + +#define BCM2838_GENET_RDMA_REGS offsetof(BCM2838GenetRegs, rdma) +#define BCM2838_GENET_RDMA_REG(reg) (BCM2838_GENET_RDMA_REGS \ + + offsetof(BCM2838GenetRegsRdma, = reg)) +#define BCM2838_GENET_RDMA_RINGS BCM2838_GENET_RDMA_REG(rings) +#define BCM2838_GENET_RDMA_RING_CFG BCM2838_GENET_RDMA_REG(ring_cfg) +#define BCM2838_GENET_RDMA_CTRL BCM2838_GENET_RDMA_REG(ctrl) + +#define BCM2838_GENET_TRING_REG(reg) offsetof(BCM2838GenetTdmaRing, reg) +#define BCM2838_GENET_TRING_WRITE_PTR BCM2838_GENET_TRING_REG(write_ptr) +#define BCM2838_GENET_TRING_WRITE_PTR_HI BCM2838_GENET_TRING_REG(write_ptr= _hi) +#define BCM2838_GENET_TRING_PROD_INDEX BCM2838_GENET_TRING_REG(prod_index) +#define BCM2838_GENET_TRING_CONS_INDEX BCM2838_GENET_TRING_REG(cons_index) +#define BCM2838_GENET_TRING_RING_BUF_SIZE BCM2838_GENET_TRING_REG(ring_buf= _size) +#define BCM2838_GENET_TRING_RING_START_ADDR BCM2838_GENET_TRING_REG(start_= addr) +#define BCM2838_GENET_TRING_RING_START_ADDR_HI BCM2838_GENET_TRING_REG(sta= rt_addr_hi) +#define BCM2838_GENET_TRING_RING_END_ADDR BCM2838_GENET_TRING_REG(end_addr) +#define BCM2838_GENET_TRING_RING_END_ADDR_HI BCM2838_GENET_TRING_REG(end_a= ddr_hi) +#define BCM2838_GENET_TRING_RING_MBUF_DONE_TRESH BCM2838_GENET_TRING_REG(m= buf_done_tresh) +#define BCM2838_GENET_TRING_RING_FLOW_PERIOD BCM2838_GENET_TRING_REG(flow_= period) +#define BCM2838_GENET_TRING_RING_READ_PTR BCM2838_GENET_TRING_REG(read_ptr) +#define BCM2838_GENET_TRING_RING_READ_PTR_HI BCM2838_GENET_TRING_REG(read_= ptr_hi) + +#define BCM2838_GENET_RRING_REG(reg) offsetof(BCM2838GenetRdmaRing, reg) +#define BCM2838_GENET_RRING_WRITE_PTR BCM2838_GENET_RRING_REG(write_ptr) +#define BCM2838_GENET_RRING_WRITE_PTR_HI BCM2838_GENET_RRING_REG(write_ptr= _hi) +#define BCM2838_GENET_RRING_PROD_INDEX BCM2838_GENET_RRING_REG(prod_index) +#define BCM2838_GENET_RRING_CONS_INDEX BCM2838_GENET_RRING_REG(cons_index) +#define BCM2838_GENET_RRING_RING_BUF_SIZE BCM2838_GENET_RRING_REG(ring_buf= _size) +#define BCM2838_GENET_RRING_RING_START_ADDR BCM2838_GENET_RRING_REG(start_= addr) +#define BCM2838_GENET_RRING_RING_START_ADDR_HI BCM2838_GENET_RRING_REG(sta= rt_addr_hi) +#define BCM2838_GENET_RRING_RING_END_ADDR BCM2838_GENET_RRING_REG(end_addr) +#define BCM2838_GENET_RRING_RING_END_ADDR_HI BCM2838_GENET_RRING_REG(end_a= ddr_hi) +#define BCM2838_GENET_RRING_RING_MBUF_DONE_TRESH BCM2838_GENET_RRING_REG(m= buf_done_tresh) +#define BCM2838_GENET_RRING_RING_XON_XOFF_TRESH BCM2838_GENET_RRING_REG(xo= n_xoff_tresh) +#define BCM2838_GENET_RRING_RING_READ_PTR BCM2838_GENET_RRING_REG(read_ptr) +#define BCM2838_GENET_RRING_RING_READ_PTR_HI BCM2838_GENET_RRING_REG(read_= ptr_hi) + + +#define BCM2838_GENET_PHY_REG(reg) (offsetof(BCM2838GenetPhyRegs, reg= ) / 2) +#define BCM2838_GENET_PHY_BMCR BCM2838_GENET_PHY_REG(bmcr) +#define BCM2838_GENET_PHY_AUX_CTL BCM2838_GENET_PHY_REG(aux_ctl) +#define BCM2838_GENET_PHY_SHD BCM2838_GENET_PHY_REG(shd) +#define BCM2838_GENET_EXP_DATA BCM2838_GENET_PHY_REG(exp_data) +#define BCM2838_GENET_EXP_SEL BCM2838_GENET_PHY_REG(exp_ctrl) + #define BCM2838_GENET_PHY_AUX_CTL_MISC 0x7 #define BCM2838_GENET_PHY_AUX_CTL_REGS_SIZE 8 =20 --=20 2.34.1