From owner-freebsd-arm@freebsd.org Tue May 19 20:58:10 2020 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9AB832F4C4D for ; Tue, 19 May 2020 20:58:10 +0000 (UTC) (envelope-from greg@unrelenting.technology) Received: from out0.migadu.com (out0.migadu.com [IPv6:2001:41d0:2:267::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49RSrx2wzsz47RP for ; Tue, 19 May 2020 20:58:08 +0000 (UTC) (envelope-from greg@unrelenting.technology) MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unrelenting.technology; s=default; t=1589921879; 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=nDZNxH9BJJT37LUSPctcIlOz4VHtO07Yl+DiHfFsfwI=; b=R2LuXbKEi0KsniR1Rlrpbhd9rJZjNIEf9jlkRuz2o8xYU2EWeRRyyXxjsdsaEJN9um+gmG 03ZafG72ubpYm2Euioibav5J/Ym/2E1CNhFIj0anzfpA4JFh8uXoCLxOpjZHumjjc+cTSu 4ak7aQfeBOvIFSrheginObvHwBv6VOc= Date: Tue, 19 May 2020 20:57:59 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: greg@unrelenting.technology Message-ID: <86119565e5927716a9feebabcb611871@unrelenting.technology> Subject: Re: FreeBSD on Layerscape/QorIQ LX2160X To: "Dan Kotowski" Cc: "Marcin Wojtas" , "freebsd-arm" In-Reply-To: References: <0012917d629a48e9fcd8589f4f002e1b@unrelenting.technology> <947c2f9bfaad823a2b104b8741502b40@unrelenting.technology> <3e81db774e0fc1a3c2251c89b7629e1b@unrelenting.technology> X-Spam-Score: -0.10 X-Rspamd-Queue-Id: 49RSrx2wzsz47RP X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=unrelenting.technology header.s=default header.b=R2LuXbKE; dmarc=pass (policy=none) header.from=unrelenting.technology; spf=pass (mx1.freebsd.org: domain of greg@unrelenting.technology designates 2001:41d0:2:267:: as permitted sender) smtp.mailfrom=greg@unrelenting.technology X-Spamd-Result: default: False [-2.84 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.948]; R_DKIM_ALLOW(-0.20)[unrelenting.technology:s=default]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2001:41d0:2:267::]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[unrelenting.technology:+]; DMARC_POLICY_ALLOW(-0.50)[unrelenting.technology,none]; FROM_NO_DN(0.00)[]; NEURAL_HAM_SHORT(-0.89)[-0.894]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16276, ipnet:2001:41d0::/32, country:FR]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 20:58:10 -0000 May 19, 2020 11:36 PM, "Dan Kotowski" wr= ote:=0A=0A>> Looking at NetBSD code, we might need to implement support f= or the custom NXP0016 config device:=0A>> =0A>> https://github.com/NetBSD= /src/commit/1a0fb037e62e4e3472966e33588957919b5e3a97=0A>> =0A>> I'll have= time to attempt a blind port of that code next week :D=0A>> =0A>> There = is a way to get any stock OS (even Windows!) to work with this PCIe contr= oller,=0A>> but it involves awful hacks and legacy interrupts, unacceptab= le stuff:=0A>> https://twitter.com/linux4kix/status/1260946442346205184= =0A>> =0A>> so you'll have to wait for now.=0A> =0A> I've waited this man= y months to finally get this far, another week is no problem :D=0A> =0A> = Would you be able to share any patches and kernconfs you're working from = so I have a frame of=0A> reference? My own dev skills are certainly nowhe= re near yours, but I'd like to at least read=0A> through the code you've = applied to get us this far and maybe even learn something new along the= =0A> way.=0A=0AMost of what got you "far" is upgrading the firmware to th= e latest dev versions! :)=0A=0AI have linked to the SDHCI commit on my gi= thub, from there you can just navigate to all commits:=0Ahttps://github.c= om/myfreeweb/freebsd/commits/master=0A=0AOnly SDHCI and I2C are relevant,= everything else is general stuff in my fork,=0Athere's some optimization= s pulled from phabricator, cleanup, minimal modular amd64 config,=0APixel= book devices, various other WIPs and unmerged patches, etc.=0A=0AThe chan= ges relevant to ARM64 in general are:=0Ahttps://reviews.freebsd.org/D2442= 3=0Ahttps://reviews.freebsd.org/D21017=0Ahttps://reviews.freebsd.org/D209= 74=0Ahttps://reviews.freebsd.org/D20835=0A=0AAnd what's not on github is = this (for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D246552):=0A= =0A--- i/sys/arm64/arm64/machdep.c=0A+++ w/sys/arm64/arm64/machdep.c=0A@@= -1007,9 +1007,14 @@ bus_probe(void)=0A has_fdt =3D (OF_peer(0) != =3D 0);=0A #endif=0A #ifdef DEV_ACPI=0A- has_acpi =3D (acpi_find_ta= ble(ACPI_SIG_SPCR) !=3D 0);=0A+ has_acpi =3D true; // (acpi_find_ta= ble(ACPI_SIG_DSDT) !=3D 0);=0A #endif=0A=0A+ for (int i =3D 0; i < = 4; i++) {=0A+ printf("spcr %lu\n", acpi_find_table(ACPI_SIG_SPCR));= =0A+ printf("dsdt %lu\n", acpi_find_table(ACPI_SIG_DSDT));=0A+ = }=0A+=0A env =3D kern_getenv("kern.cfg.order");=0A if (en= v !=3D NULL) {=0A order =3D env;=0A=0Abut I'm not sure whe= ther it's necessary on your machine (please test without again!)=0Aand it= 's odd that I haven't seen these printfs in your logs..