From nobody Mon Nov 23 15:56:19 2026
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 4jY9W60zfsz70xr1
	for <freebsd-arm@mlmmj.nyi.freebsd.org>; Mon, 23 Nov 2026 15:54:58 +0000 (UTC)
	(envelope-from naegounai@mailfa.com)
Received: from mc.mailfa.com (mc.mailfa.com [194.62.17.204])
	(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)
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 4jY9W44cyvz4txN
	for <freebsd-arm@FreeBSD.org>; Mon, 23 Nov 2026 15:54:56 +0000 (UTC)
	(envelope-from naegounai@mailfa.com)
Authentication-Results: mx1.freebsd.org;
	dkim=pass header.d=mailfa.com header.s=dkim header.b=Vt6ZDUBz;
	spf=pass (mx1.freebsd.org: domain of naegounai@mailfa.com designates 194.62.17.204 as permitted sender) smtp.mailfrom=naegounai@mailfa.com;
	dmarc=pass (policy=quarantine) header.from=mailfa.com
Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 11AA8140A23
	for <freebsd-arm@FreeBSD.org>; Mon, 23 Nov 2026 19:24:41 +0330 (+0330)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailfa.com; s=dkim;
	t=1795449286; h=from:subject:date:message-id:to:mime-version:content-type:
	 content-transfer-encoding:in-reply-to:references;
	bh=MrPeEWpl3I/DPJ0m4FLviIWoMAqXeN/KpgVSZPntlz8=;
	b=Vt6ZDUBz5HSY0mW74kx3Ypll85bsh3IajV1AVheC9rFKlyMtlwfP98x1qAmmq4Gc7IeZXM
	OdAvKQxXrn3AFKq70hvKeUxBcbkjyBKjMWGojw68leWVndjNp9QGovXQDrxWh+nUWkJDR/
	8+0gyPOu8YfuwkkhWf6qR87cu7+FRbKSMU4Hxpxu6NK6cmmiVzC/17NXEwloDZd1Id2Xe5
	EquH2+FMC0Lwh5O8hDh+lLubJ92KMZaFdo+6fH4grdx8bKezkiAcMpYr86nwORxsEH2aTX
	29GHjfVcWoGiuG8olrLUp7mrM6DT2oh/ECe9Jg9uPO95/NBuyVJT6hGTy5gwZg==
Date: Mon, 23 Nov 2026 19:26:19 +0330
From: Naegou <naegounai@mailfa.com>
To: freebsd-arm@FreeBSD.org
Subject: Re: power on/enable v3d engine on raspberry pi
Message-ID: <20261123192619.166487a9@genesis>
In-Reply-To: <20261120183413.0f768ce4@genesis>
References: <20261120183413.0f768ce4@genesis>
X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; amd64-portbld-freebsd14.4)
List-Archive: https://lists.freebsd.org/archives/freebsd-arm
List-Id: Porting FreeBSD to ARM processors <freebsd-arm.FreeBSD.org>
List-Post: <mailto:freebsd-arm@FreeBSD.org>
List-Help: <mailto:freebsd-arm+help@FreeBSD.org>
List-Subscribe: <mailto:freebsd-arm+subscribe@FreeBSD.org>
List-Unsubscribe: <mailto:freebsd-arm+unsubscribe@FreeBSD.org>
List-Owner: <mailto:freebsd-arm+owner@FreeBSD.org>
Precedence: list
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Last-TLS-Session-Version: TLSv1.3
X-Rspamd-Queue-Id: 4jY9W44cyvz4txN
X-Spamd-Bar: /
X-Spamd-Result: default: False [-0.50 / 15.00];
	MID_RHS_NOT_FQDN(0.50)[];
	DMARC_POLICY_ALLOW(-0.50)[mailfa.com,quarantine];
	R_DKIM_ALLOW(-0.20)[mailfa.com:s=dkim];
	R_SPF_ALLOW(-0.20)[+mx];
	MIME_GOOD(-0.10)[text/plain];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RCPT_COUNT_ONE(0.00)[1];
	RCVD_COUNT_ONE(0.00)[1];
	ASN(0.00)[asn:57497, ipnet:194.62.17.0/24, country:IR];
	MIME_TRACE(0.00)[0:+];
	MLMMJ_DEST(0.00)[freebsd-arm@FreeBSD.org];
	RCVD_TLS_ALL(0.00)[];
	RECEIVED_HELO_LOCALHOST(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	ARC_NA(0.00)[];
	TO_DN_NONE(0.00)[];
	PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DKIM_TRACE(0.00)[mailfa.com:+]

Update:
This time I removed vc4-fkms-v3d overlay from config.txt, now the
V3D_IDENT0 is correct (= 0x02443356). but v3d disabled on bus:
vc4_v3d0: <BCM2835 VideoCore IV 3D Engine> mem 0x7ec00000-0x7ec00fff
irq 48 disabled on simplebus0

My question is: can I use sysutils/rpi-firmware bootcode.bin and
start.elf and others in FreeBSD system? (I not tried yet)

On Fri, 20 Nov 2026 18:34:13 +0330
Naegou <naegounai@mailfa.com> wrote:

> I compiled my module on freebsd/arm32. at least the register value is
> correct on that!
> It's more like a bug from other drivers/subsystems that ported to
> arm64. The current vchiq drivers wont compile on arm64, because of
> that we haven't sound (but there is a patch to fix the compile
> problem)
> 
> On Fri, 20 Nov 2026 14:44:05 +0330
> Naegou <naegounai@mailfa.com> wrote:
> 
> > Do you think I missed something?
> > I tried the undocumented 0x00030012 mbox tag for enabling the v3d,
> > but nothing changed...
> > On older linux code (that uses rpi_firmware_property) that uses same
> > mbox tag.
> > In bind routine in linux:
> > static int vc4_v3d_bind(struct device *dev, struct device *master,
> > void *data)
> > {
> >         struct platform_device *pdev = to_platform_device(dev);
> >         struct drm_device *drm = dev_get_drvdata(master);
> >         struct vc4_dev *vc4 = to_vc4_dev(drm);
> >         struct vc4_v3d *v3d = NULL;
> >         int ret;
> > 
> >         v3d = devm_kzalloc(&pdev->dev, sizeof(*v3d), GFP_KERNEL);
> >         if (!v3d)
> >                 return -ENOMEM;
> > 
> >         v3d->pdev = pdev;
> > 
> >         v3d->regs = vc4_ioremap_regs(pdev, 0);
> >         if (IS_ERR(v3d->regs))
> >                 return PTR_ERR(v3d->regs);
> > 
> >         vc4->v3d = v3d;
> > 
> >         ret = vc4_v3d_set_power(vc4, true);
> >         if (ret)
> >                 return ret;
> > 
> >         if (V3D_READ(V3D_IDENT0) != V3D_EXPECTED_IDENT0) {
> >                 DRM_ERROR("V3D_IDENT0 read 0x%08x instead of
> > 0x%08x\n", V3D_READ(V3D_IDENT0), V3D_EXPECTED_IDENT0);
> >                 return -EINVAL;
> >         }
> > 	....
> > 	....
> > 	....
> > 
> > As you see vc4_v3d_set_power() is one of the first things to be
> > called.
> >     
> > > It needs to be initialized with a nontrivial and very model
> > > specific proced= ure, setting up clocks and buffers, etc.      
> >     
> > > Read the Linux implementation carefully, and mind the devicetree
> > > setup as t= here is some architectural buffer addressing
> > > flexibility for different mode= s of operation.      
> >     
> > >> Hello!
> > >> I am trying to get V3D engine up on my rpi-2-v1.2 (arm64).
> > >> The driver will attach to v3d register address (0x7ce00000)
> > >> correctly.
> > >> but when I try to read the register values with
> > >> bus_space_read_4(), the value of them is 0xdeadbeef, from what I
> > >> found on a raspberrypi forum post this is because of v3d is not
> > >> yet enabled. I tried to use qpu_enable on that post. but nothing
> > >> changed! Anyone here know what is the problem?      

