From nobody Fri Jun 14 15:40:39 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 4W13QM0gDtz5P4BC for ; Fri, 14 Jun 2024 15:40:43 +0000 (UTC) (envelope-from jsihv@gmx.com) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.gmx.net", Issuer "Telekom Security ServerID OV Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W13QK6lsHz4mKv for ; Fri, 14 Jun 2024 15:40:41 +0000 (UTC) (envelope-from jsihv@gmx.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmx.com header.s=s31663417 header.b=KX3lwT4o; dmarc=pass (policy=quarantine) header.from=gmx.com; spf=pass (mx1.freebsd.org: domain of jsihv@gmx.com designates 212.227.15.18 as permitted sender) smtp.mailfrom=jsihv@gmx.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.com; s=s31663417; t=1718379640; x=1718984440; i=jsihv@gmx.com; bh=q+Hlq+pAQyujw9WSERGxWqQo/06RLpNPFnFLPn9kSFI=; h=X-UI-Sender-Class:MIME-Version:Message-ID:From:To:Subject: Content-Type:Date:In-Reply-To:References:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=KX3lwT4oXm8E/h4nGePILrVRDTkIfuuEkl3jNt4wPJN41lapL0DO+4W7mUg7Du3N 901m/Pz91BmQpavdc6ze1r5qt8/XyGa4qtdV4fjmgPiGEpYCC6Tyhg1RcaMoZoUAW 3aT6Ib8TyWFop4NgIbES2AUHCRa2rR06lKJFEC8zw6H/Cu2BL+R6+k8Aa4WxPCXgh +lRYCaVxGcaLigSW13ydkmGJIzz8zIknwxpelBVhzCKaM8e7ymw8fpQFwTan12+DS 28Uegmeykz2yVw/VGpncO1iBg0Dm/ZrIi8umsk7bGBHfqWl38LWPcT4xryNO7D+jl aZn38avm3Xnn5+56Hw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [84.248.222.67] ([84.248.222.67]) by web-mail.gmx.net (3c-app-mailcom-bs01.server.lan [172.19.170.58]) (via HTTP); Fri, 14 Jun 2024 17:40:39 +0200 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 Message-ID: From: JMT Sihvola To: freebsd-riscv@freebsd.org Subject: Re: JH7110 dwc MAC support Content-Type: text/plain; charset=UTF-8 Date: Fri, 14 Jun 2024 17:40:39 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <7E28ED97-DD4B-40AA-91FB-DB3982042265@mit.edu> References: <7E28ED97-DD4B-40AA-91FB-DB3982042265@mit.edu> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:h9mjFqRJVET0uPmH9HRvGPUpOZDISbZ2mwOCup2BTA8420Z8L7IeUZiNTljWFFNBv5c4c KC9h44t1pIh1ZL/gHuJD7Oy0Glqh8x9vcQP5OVTk76Qd1J5HsG0GEbnPx7MvzWuTccSI9+MXkaiT DQwL8CS6Wdm0isQWc1b3dIloRZfvYW2bDm84uZTZA4Zi74lVIfLFwaIvOP13QDPmE3jFBDbeUqHG CVO+LIEe0yB8ljFNPIZi5CUN7GrZ/U3Wjgsrtqe8JjWQdXUN8B6phUFKF8QlZO6k3PsHpuXt5z0h n4= X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:G8smQafthGI=;DomVVesSqRHf6Nxvn85g3LjyLkK geSulOUVKTLjkOgafOr88vurL1JYSJHFecBJVbnpquIeopSlLvcrwGgudQa3sk6XEwPV3SGvk aQA5K91smNRR7Eq6Fmb+4I/ike21p58hYC8LF0zEJjfQo4JWbpinxTgw0prrEOAcSDNcZEUUc mGsr49ZdLemOUI+hx+6dnB4/8DlhlKF4Ohp4s42lXfISa0xAT45WMdpc0Mpyk56aqYsvWDXvD UDxZXqJFPBGBB79sYVWUGZg8TKgTBOryGa9FCWQptpME+Bgkk6KLLlLThQBlJdwMoo+G+b4E6 s/hCAbOuUjVJ7+r4tYOuCCc53705+mxbSxpWf/Dtbe9fJQzejb6R2DmrOjNz7ZqAiFdGeC5jl YFTL/AesFywiHzcsVxSFzOwbhuFKrxoR/2V8LAD3PC8uP4erEbbW+zOz+IyOTqudips75mf6z qzfgtBuom07DLyV1+Ch3kkIzn/zUXW5wLPyR0CIfyLkd7+n4Pfp2B80/32S0KR3g+SEbwMof9 fEKgMhs1zPKBZrx3cIZYtUL0fXvvsWmQRCbdc0qb/QAF1Q9qXnJHSdZ1qA8Il/tr1ZK2VpaOw HSAvi8HqZAQ1VlBkNXTygdVROLvte6aEywqiZ9yKrPRdXEWDCRTdmlOe8bZs/PYB5OlHBNyrd sRxDElhhJo/jyt1K7ixh6rJ9+PrvMskTXQaYJwUsWGSemDBSQMRPUWTkSOWShxg= X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.58 / 15.00]; DWL_DNSWL_LOW(-1.00)[gmx.com:dkim]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.88)[-0.883]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[gmx.com,quarantine]; R_SPF_ALLOW(-0.20)[+a:mout.gmx.net]; R_DKIM_ALLOW(-0.20)[gmx.com:s=s31663417]; RWL_MAILSPIKE_VERYGOOD(-0.20)[212.227.15.18:from]; ONCE_RECEIVED(0.10)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[212.227.15.18:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; HAS_X_PRIO_THREE(0.00)[3]; MISSING_XM_UA(0.00)[]; FREEMAIL_FROM(0.00)[gmx.com]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmx.com:+]; MLMMJ_DEST(0.00)[freebsd-riscv@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; FREEMAIL_ENVFROM(0.00)[gmx.com] X-Rspamd-Queue-Id: 4W13QK6lsHz4mKv > Sent: Friday, June 14, 2024 at 6:06 PM > From: "John F Carr" > To: "freebsd-riscv@freebsd.org" > Subject: JH7110 dwc MAC support > > 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". 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. 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 caused by a bug outside of these drivers. It has been difficult to track it down but I keep working on with the issue. 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). 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. JH7110 clocks required by Ethernet are available in FreeBSD repository. GPIO & MMC have been submitted. USB & pinctrl are being worked on. -jari sihvola