From nobody Fri Jun 14 19:11:14 2024 X-Original-To: freebsd-riscv@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4W185K6j89z5PLwJ for ; Fri, 14 Jun 2024 19:11:17 +0000 (UTC) (envelope-from jfc@mit.edu) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20717.outbound.protection.outlook.com [IPv6:2a01:111:f403:2414::717]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W185K2Cgxz4Lgr for ; Fri, 14 Jun 2024 19:11:17 +0000 (UTC) (envelope-from jfc@mit.edu) Authentication-Results: mx1.freebsd.org; none ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m4y0sqMJq+kO+PYvxmajMjR/jwo1yGtUW/RR3Ggd/+jo0pStWgd7D6c1ykW8psBUgqlkRC05zTgsAs+wNOVbTzegTeDz1pZgQR7WMfqre+BqPUSEUUnfa/zYcNk3CPtwN9KlmlhF/PBpUHIDwt6J7AtKnhTLZCNeDQ6PnTWNK0ndjSiSpz+1dMxvx7DOdDVHBn4CG1+Doe5z8T9y5mYwyNH07rt7zN6+X3fP8fRqKxBOIauY6KOcGAnsZdwrmD9YdVI0EHyDPBnfcQGKzwQ5i1TMu1C2/0gK+9Ja3ylHxf+WvvomnEgs5qp2CzSJL2uKWgLqGu1YPmG6t+5HW+ZA2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=f2cwk8Fze2PSANhj+irOWBGFFtmSUVTBpaTLBTwMhZ0=; b=SJFu51owKQNGKaNOUeor9yS1bb+Ucj7+k4nLQ5P871pG53EgzZe9uJ4yIcPW6NNOKpv8yACw77ZVhM8snIHyoktVM/vXagYmrVMAiWei6EoLSM7YiuYb3jDAP7C1/MrHp66KohLMP+pSiH4ghbXT7pgSxRVO0nMWc3ghzYAG5H+nzL+FWbJ6DOsyw+AIHou3ijt7r9G73J459swx1ErTgJY5xTktTQh6Dd5PfzlsnFbFBmuHG6JtKNPR5LJoarsesr3mzaSbbDup1N9cV5RBYZQUt3ZYdWef3VM9rB7m0ZsVwkKdIb7PPjK9E0wMAgfAvIy7Yu0M4gzLVxBbtJhrDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mit.edu; dmarc=pass action=none header.from=mit.edu; dkim=pass header.d=mit.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f2cwk8Fze2PSANhj+irOWBGFFtmSUVTBpaTLBTwMhZ0=; b=hOditowYtrqpCyuk05sQIiLRj4FXuCRQEmtV8iY6ta435NymBtKfRqPTG/qAZyI2+q1RskRDvETDRkuwZEDrlnEaSIr/YOLjUQ8RS/5jydusUuoLFVCXbTW8b1X76GGD3nzMt6ptnt9Ft0iE7Df8X67fUQ+9MIZCwdB13C/l+U0= Received: from SA3PR01MB8450.prod.exchangelabs.com (2603:10b6:806:382::17) by BL3PR01MB7180.prod.exchangelabs.com (2603:10b6:208:347::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.25; Fri, 14 Jun 2024 19:11:14 +0000 Received: from SA3PR01MB8450.prod.exchangelabs.com ([fe80::bb39:d8c:f575:6b9d]) by SA3PR01MB8450.prod.exchangelabs.com ([fe80::bb39:d8c:f575:6b9d%5]) with mapi id 15.20.7677.024; Fri, 14 Jun 2024 19:11:14 +0000 From: John F Carr To: JMT Sihvola CC: "freebsd-riscv@freebsd.org" Subject: Re: JH7110 dwc MAC support Thread-Topic: JH7110 dwc MAC support Thread-Index: AQHavmxklaE67+/slUqx6/WUYdjI/bHHZZGAgAA6ygA= Date: Fri, 14 Jun 2024 19:11:14 +0000 Message-ID: References: <7E28ED97-DD4B-40AA-91FB-DB3982042265@mit.edu> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SA3PR01MB8450:EE_|BL3PR01MB7180:EE_ x-ms-office365-filtering-correlation-id: 26f23870-b628-4563-0bc5-08dc8ca5c2d3 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230037|1800799021|366013|376011|38070700015; x-microsoft-antispam-message-info: =?us-ascii?Q?U2BnYSjzcGYC5167zZQysctTQD/eTb9X3j3uejMwB/GgsGnIS/31hPqImqSn?= =?us-ascii?Q?CHNrduJZurKAb7GkNoph56RUMnpUqZV0t/huAVos08k8z/opeLfGPPPac2D5?= =?us-ascii?Q?llandGUKbUwHCS9VUdoplq9RGRZY69hd4AcA9Ae7wm6jBLS+P9LNYW91B4JB?= =?us-ascii?Q?ASVgxw1oZlx0a52fyVM5SW+eDJyRitLi2EU9LKg4C3mE2+ixPcO62hoGIRwr?= =?us-ascii?Q?xhVpxmkHyfl/OS1utLKWR6OVu/03tzS5QvrbRTQspaliRzyWiTIHa2gSN9P6?= =?us-ascii?Q?f71tjIXZb/GmX7jvup5B+DSwHKaoo/PgLJg4uDFMMc39vZqlE8qNihT5h8VL?= =?us-ascii?Q?V9j8P1xFmfi5cAog/p2DDekjd08PRxvMWFab9AkMHtxfMIu/s6PbzR20erDW?= =?us-ascii?Q?ynghvDzFV+fOPRwOVEuAD63vU0ppQ4A5bb68KwntG4PBPh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fdpMZZYmnVWmiP8pISZgoIss9fwykG8g9Unb+?= =?us-ascii?Q?GgD0vBo=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA3PR01MB8450.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230037)(1800799021)(366013)(376011)(38070700015);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Md5q7comp8mRmkiH1sJytoPwFArxjjsVPMDkIr6BSBdx13N5qVO2AA55YuKK?= =?us-ascii?Q?a0MHCcmeIZVB3bO63X4wS0BSbBgfvnbdimfhYzhYTPZ5SSq5bSyNnU6KpspK?= =?us-ascii?Q?3sW/84uDyRBcq5MouIQS4tVtjlHBPCB9EIN/tCMoKvgRD/T6sv6OE42m7vZC?= =?us-ascii?Q?+GIfaOQGQxdYKD468AaPcGEaSDpB/jcuwsYhDqDwzVoLxlJK9xbDSzBroqs6?= =?us-ascii?Q?1NcvEzJmd32JJu+AZQLcWrdsWnSXlDiisd0G/hAyNPhS/BGZXhwCln4McPIP?= =?us-ascii?Q?mB1ZYXOnePqlLVCg3qsqls5LGBawQ1qZQvAuL3gqUX0slMEJFOu021MSC5Cj?= =?us-ascii?Q?Qw0qEnA4TrRVmj+twrAG73mGnwHf5i4w1M3hYGr2itXIj6U9dTe1f4J+dUEJ?= =?us-ascii?Q?yewI0KzfAzEHQqxRUDcb3bxc1CDLj/H/1fJWa04unOc38FhYiUrKl20dP4J4?= =?us-ascii?Q?ZlPy5wVKX3ALUR7vsEGScVmO9tgw0GWgQrjO+73YTJCbcx68o/ZFIU/mnvEy?= =?us-ascii?Q?VNraSfCdtdu/1MusJ3d8bF3aUsr92DOE4GR3qgQq7QdTzDNOrEhlHXX6UzX0?= =?us-ascii?Q?P0UdOx9pWYt5LeWKUACFAklP9aQPaqfVLnpbih7WaHfHLYkTl/rjFvi99Ze1?= =?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B7f+4Ko8vTm/4jhyq?= =?us-ascii?Q?WYORWzuXk0BbtJSxkRuf+AWF2ZZH1vFM1x/VseEt7CBRU/v8pkGR+NS2re9H?= =?us-ascii?Q?y+SKRTt13aEGVBPFaLNJ0wtBW18gWnywKN2gsx08m85E?= Content-Type: text/plain; charset="us-ascii" Content-ID: <75DF5562D709CC4E93BE7FF89D4E4A8A@prod.exchangelabs.com> Content-Transfer-Encoding: quoted-printable List-Id: FreeBSD on the RISC-V instruction set architecture List-Archive: https://lists.freebsd.org/archives/freebsd-riscv List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-riscv@freebsd.org Sender: owner-freebsd-riscv@FreeBSD.org MIME-Version: 1.0 X-OriginatorOrg: mit.edu X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA3PR01MB8450.prod.exchangelabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26f23870-b628-4563-0bc5-08dc8ca5c2d3 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jun 2024 19:11:14.5818 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 64afd9ba-0ecf-4acf-bc36-935f6235ba8b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: p3JRa2J5ZaOu98Nt0U1lhnT4LLYgEW07sQnzy94L1N0wE6cF61tVZ1LXq9/Ni3B2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR01MB7180 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8075, ipnet:2a01:111:f000::/36, country:US] X-Rspamd-Queue-Id: 4W185K2Cgxz4Lgr > On Jun 14, 2024, at 11:40, JMT Sihvola wrote: >=20 >=20 >=20 >> Sent: Friday, June 14, 2024 at 6:06 PM >> From: "John F Carr" >> To: "freebsd-riscv@freebsd.org" >> Subject: JH7110 dwc MAC support >>=20 >> Has anybody gotten the ethernet driver working on this chip? >> It's a DesignWare MAC according to the device tree so if_dwc.c >> should be the starting point. The driver does not work >> simply by changing the "compatible" string. It can't find >> the PHY because all the register reads come back 0. The >> only documentation I can find is the Linux driver source code. >> I can try updating register offsets and command bit patterns >> to match what the Linux driver does with "snps,dwmac-5.20". >=20 > JH7110 uses dwmac version 5.2. FreeBSD has codes for 4.x (which is > almost similar) in sys/dev/eqos. JH7110 also uses Motorcomm's > Ethernet-phy version 8531 which currently isn't supported. >=20 > I have updated those codes to get network working on JH7110 but > I have not yet submitted them because there is a problem which prevents > changing the Ethernet port on fly. It's possible that this problem is cau= sed > by a bug outside of these drivers. It has been difficult to track it down > but I keep working on with the issue. >=20 > I have those updated driver codes in my personal github: > https://github.com/jsihvola/freebsd-src/ > See the last commit (otherwise this repository is not up-to-date). >=20 > So if you can live with the port switching issue, those codes > should make it possible to get JH7110 online. Also, eqos driver > has some shortcomings, making network speed slower than what it could be. >=20 > JH7110 clocks required by Ethernet are available in FreeBSD repository. > GPIO & MMC have been submitted. USB & pinctrl are being worked on. >=20 > -jari sihvola >=20 >=20 Thanks. I tried putting your driver on the main (15-CURRENT) branch. It attaches but does not seem to put anything on the wire. I will try building your 14-based branch next. Is it correct to see a total of four PHYs in the dmesg output below? eqos0: mem 0x16030000-0x1603f= fff irq 62,63,64 on simplebus0 eqos0: DesignWare EQOS ver 0x52 (0x41) eqos0: hw features 1a2173f7 09845904 01000000 00000000 eqos0: Ethernet address f2:00:25:43:09:d6 eqos0: TX ring @ 0x41ede000, RX ring @ 0x42fdf000 miibus0: on eqos0 mcommphy0: PHY 0 on miibus0 mcommphy0: OUI 0xc82b5e, model 0x0011, rev. 11 mcommphy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT= -FDX, 1000baseT-FDX-master, auto mcommphy1: PHY 1 on miibus0 mcommphy1: OUI 0xc82b5e, model 0x0011, rev. 11 mcommphy1: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT= -FDX, 1000baseT-FDX-master, auto eqos0: bpf attached eqos0: Ethernet address: f2:00:25:43:09:d6 eqos1: mem 0x16040000-0x1604f= fff irq 65,66,67 on simplebus0 eqos1: DesignWare EQOS ver 0x52 (0x41) eqos1: hw features 1a2173f7 09845904 01000000 00000000 eqos1: Ethernet address f2:00:6a:9e:95:8b eqos1: TX ring @ 0x42fe5000, RX ring @ 0x439e7000 miibus1: on eqos1 mcommphy2: PHY 0 on miibus1 mcommphy2: OUI 0xc82b5e, model 0x0011, rev. 11 mcommphy2: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT= -FDX, 1000baseT-FDX-master, auto mcommphy3: PHY 1 on miibus1 mcommphy3: OUI 0xc82b5e, model 0x0011, rev. 11 mcommphy3: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT= -FDX, 1000baseT-FDX-master, auto eqos1: bpf attached eqos1: Ethernet address: f2:00:6a:9e:95:8b