From nobody Sat Oct 28 04:58:48 2023 X-Original-To: freebsd-arm@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 4SHS3v4hrtz4yPpM for ; Sat, 28 Oct 2023 04:58:51 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SHS3v2dDsz3SLD for ; Sat, 28 Oct 2023 04:58:51 +0000 (UTC) (envelope-from manu@bidouilliste.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1698469129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xhaRFRFif6uBt8a1O+wP9JiLirY80n+pk9BJ6dgXJwM=; b=K4/+8WFBusdrsXSg8KpVVM3+PqhDQq2plUaIy8L300gvQvfXzs619AEE1pTmIpmWf/Pf+r r2xK7+oPJuE/Vt1BTqRjd899VVplylubY2EU3S4deeDRASaoEywuhz5I0XG1IBMGA0PycD fNgKFzC9CZrpkxBUV8U9fosz8AxWrsc= Received: from skull.home.blih.net (lfbn-lyo-1-2174-135.w90-66.abo.wanadoo.fr [90.66.97.135]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 946cd9fb (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 28 Oct 2023 04:58:48 +0000 (UTC) Date: Sat, 28 Oct 2023 06:58:48 +0200 From: Emmanuel Vadot To: Jirka Novak Cc: freebsd-arm@freebsd.org Subject: Re: No sound card on Olimex A20 SOM EVB with FreeBSD 12.4 Message-Id: <20231028065848.d3506101a351d8186139a5d0@bidouilliste.com> In-Reply-To: <6cbe8605-eb58-4388-a89f-b6009b8d2df0@netsystem.cz> References: <6cbe8605-eb58-4388-a89f-b6009b8d2df0@netsystem.cz> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd15.0) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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:12876, ipnet:212.83.128.0/19, country:FR] X-Rspamd-Queue-Id: 4SHS3v2dDsz3SLD Hello Jirka, On Fri, 27 Oct 2023 18:19:00 +0200 Jirka Novak wrote: > Hello, > > We made custom device based on Olimex A20 SOM EVB board. I'm > migrating our application from FreeBSD 11.2 to FreeBSD 12.4. Our > application requires sound card and I found that if I install fresh OS, > I'm missing sound card device (/dev/dsp). > Sound card supported by the board has source in > src/sys/arm/allwinner/a10_codec.c and code was not changed for ages and > is part of 11.2, 12.x and 13.x branch. > > I spend hours by checking why I'm missing sound device and I learn > that during boot is printed: > > FreeBSD 11.2: > pcm0: mem 0x1c22c00-0x1c22c3f irq 35 on simplebus0 > pcm0: Mixer "vol": > pcm0: Mixer "line": > pcm0: Mixer "rec": > > FreeBSD 12.4: > pcm0: mem 0x1c22c00-0x1c22c3f irq 46 on simplebus0 > pcm0: cannot find codec clock > > I searched source code of sound card driver and I found: > > if (clk_get_by_ofw_name(dev, 0, "codec", &clk_codec) != 0) { > device_printf(dev, "cannot find codec clock\n"); > goto fail; > } > > so it tries to find "codec" clock. > I expect it should be found/configured based on dtb file and I expect > that dtb was changed between releases. I hope I'm able to extend dtb for > the board. > The issue is that I don't know which codec clock it searches for. I > analyzed boot -v from 11.2 and 12.4 and I'm not able to identify it. > There are several "codec" word in boot log, but I don't know how the > code decide which one is correct/missing just based on word "codec" from > source code. > I went thru dts sources, but I'm not able to identify "codec" neither. > > Can I ask for help to identify which clock shown in 11.2 boot log are > missing in 12.4 boot log? > > Best regards, > > Jirka Novak It seems that we are missing some clocks. We don't support the audio pll and so don't support the codec gate which is the one that the driver is expecting to find. It looks like we've never supported this pll since the switch to the new clock driver (in 2018). Back then a lot of clock were directly found in the DTB but that ship has sailed a long time ago. FreeBSD 11 still have the old clock drivers (and the old DTB) which is why it worked for you. I don't think that anybody have any plan to work on that tbh. -- Emmanuel Vadot