From owner-freebsd-arm@freebsd.org Sun Feb 21 18:13:56 2021 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 766C255D89D; Sun, 21 Feb 2021 18:13:56 +0000 (UTC) (envelope-from info@ohdata.se) Received: from mail01.ohdata.se (46-22-124-5.ip.axbyte.se [46.22.124.5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DkD370yfpz3FRK; Sun, 21 Feb 2021 18:13:54 +0000 (UTC) (envelope-from info@ohdata.se) Received: from localhost (localhost [127.0.0.1]) by mail01.ohdata.se (Postfix) with ESMTP id 506DD5E77; Sun, 21 Feb 2021 19:09:18 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail01.ohdata.se Received: from mail01.ohdata.se ([127.0.0.1]) by localhost (mail01.ohdata.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MP+tv0iSl6WP; Sun, 21 Feb 2021 19:09:17 +0100 (CET) Received: from webmail.ohdata.se (unknown [10.0.38.61]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail01.ohdata.se (Postfix) with ESMTPSA id 689B35E6D; Sun, 21 Feb 2021 19:09:17 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Sun, 21 Feb 2021 19:23:46 +0100 From: Oskar Holmlund To: Kristoff Cc: freebsd-arm@freebsd.org, owner-freebsd-arm@freebsd.org Subject: Re: device-tree on BeagleBone Black (enabling UART) Organization: OH Data In-Reply-To: <629d6766-763b-0120-6bd8-9bcdbc280561@skypro.be> References: <29ee61d3-6eb7-ccf7-3de9-2ecdccdcbb6b@skypro.be> <06f5ba53fac300855b580d127fdfc57466807a9c.camel@freebsd.org> <596e6c178a78a8c5bdb62505f593b3878aae1a1f.camel@freebsd.org> <629d6766-763b-0120-6bd8-9bcdbc280561@skypro.be> Message-ID: X-Sender: info@ohdata.se User-Agent: Roundcube Webmail/1.3.6 X-Rspamd-Queue-Id: 4DkD370yfpz3FRK X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of info@ohdata.se designates 46.22.124.5 as permitted sender) smtp.mailfrom=info@ohdata.se X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[ohdata.se]; RBL_DBL_DONT_QUERY_IPS(0.00)[46.22.124.5:from]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; SPAMHAUS_ZRD(0.00)[46.22.124.5:from:127.0.2.255]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:43853, ipnet:46.22.112.0/20, country:SE]; RCVD_TLS_LAST(0.00)[]; MAILMAN_DEST(0.00)[freebsd-arm,owner-freebsd-arm] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Porting FreeBSD to ARM processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2021 18:13:56 -0000 2021-02-19 00:52 skrev Kristoff: > Hi all, > > (inline comments) > > On 12/02/2021 3:15 a.m., Ian Lepore wrote: >> >>>> The beaglebone has a special pps driver that uses the am335x chip's >>>> timer hardware to measure the pps pulse time with better accuracy >>>> than >>>> the generic gpio-pps driver. To use it, add >>>> >>>> am335x_dmtpps_load=YES >>> At the same time I also wanted to try the pps driver you mention. >>> >>> However, it does not seams to load. >>> >>> I get this: >>> >>> [root@black1 ~]# kldload am335x_dmtpps >>> kldload: can't load am335x_dmtpps: No such file or directory >>> >>> >>> The issue seams to be this: >>> >>> # dmesg >>> (...) >>> KLD am335x_dmtpps.ko: depends on ti_sysc - not available or version >>> mismatch >>> >>> Looking on my system, I seems to have the source of 'to_sysc', but >>> not >>> the .ko. >>> [root@black1 ~]# locate ti_sysc >>> /usr/src/sys/arm/ti/ti_sysc.c >>> /usr/src/sys/arm/ti/ti_sysc.h >>> >>> >>> What is the procedure to compile one single kernel-module? >>> I tried "make ti_sysc", but that failed due to compilation errors >>> >>> >> Hmm, are you using the GENERIC kernel, or a custom kernel, or what? >> The ti_sysc device is a relative newcomer, and we may have neglected >> to >> add it to the GENERIC config. There probably isn't a makefile to >> build >> it as a module. >> >> So the fix for that would be to add 'device ti_sysc' to whatever >> kernel >> config you're using and rebuild the kernel. > > OK, still working on this. > > Still stuck: > UART now works! > PPS does not. > > > Sofar not solution. This is my situation: > > - FreeBSD 12.1: device-tree does not seams to work > - FreeBSD 12.2: for some reason, all "beaglebone" images I find on > https://download.freebsd.org/ftp/snapshots/arm/armv7/ISO-IMAGES/12.2/ > do not boot at all, or -if they boot- have strange issues. (like a > simple reboot taking up 2 hours!) > To get FreeBSD 12.2 to work on BBB you need to revert the devicetree. https://reviews.freebsd.org/D26552 Its probably not worth your time to get 12.2 up n running, spend the time on getting head to compile and run on your device instead. > - FreeBSD 13.0: Now still running an version: > --> the version I do have now is this one: > FreeBSD 13.0-CURRENT #0 f2ea0734875-c254544(main): Thu Nov 19 09:15:27 > UTC 2020 > root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm.armv7/sys/GENERIC > > But that does not contain the "ti_sysc" module. > (as stated earlier) > Its in the kernel for BBB, you dont need to build ti_sysc as a module. If you dont have the ti_sysc you cant start the BBB at all. # kldstat -v | grep ti_sysc > -> I wanted to try a newer version, all "beaglebone" images for 13.0 > seams to have disappeared from the ftp-server > https://download.freebsd.org/ftp/snapshots/arm/armv7/ISO-IMAGES/13.0/ > > (actually, that folder does not even exist any more) > > -> I also tried using the 13.0 kernel with gpiopps module (better then > nothing), sofar without success. > > > > So, I guess, the next step is -as you proposed- to try to compile a new > kernel. > > I have never done this. I have been looking in the handbook how to do > this. > I guess I need to create a 'MYKERNEL' file for the beaglebone. > > Question. Is there a repository of 'MYKERNEL' files for board so I > have a config-file to start from. > I do not know all the kernel-options and hardware-features of the > beaglebone black, it would be nice to have something to start from > that I know actually works! > > > Note: > As proposed, I added the line "device ti_sysc" at the end of the > configuration-file, but I get this error: > > config: Error: device "ti_sysc" is unknown > > I guess that one line in the config-file is not enough? > A workaround for current codebase is to add following to your kernel config (MYKERNEL/GENERIC/whatever you call it) device am335x_dmtpps Recompile and ensure you have modified your loader.conf (in my case hw.am335x_dmtpps.input="P8-9" or issue # kenv hw.am335x_dmtpps.input="P8-9") # dmesg | grep -i pps uart0: PPS capture mode: DCD am335x_dmtpps: configured pin P8-9 as input for timer5 am335x_dmtpps0: mem 0-0x3ff irq 23 on ti_sysc18 am335x_dmtpps0: Using DMTimer5 for PPS device /dev/dmtpps To get am335x_dmtpps to work as a module ti_sysc.c needs to be modified. Append to the end of sys/arm/ti/ti_sysc.c MODULE_VERSION(ti_sysc, 1); # kldload am335x_dmtpps.ko ti_pinmux0: setting internal 2a for timer5 am335x_dmtpps: configured pin P8-9 as input for timer5 am335x_dmtpps0: mem 0-0x3ff irq 23 on ti_sysc18 Timecounter "DMTimer5" frequency 24000000 Hz quality 1000 am335x_dmtpps0: Using DMTimer5 for PPS device /dev/dmtpps > > > (Anycase, I am really learning a lot here) > > >> -- Ian >> > Cheerio! > > Kr. Bonne. > _______________________________________________ > freebsd-arm@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" -- Bästa Hälsningar Oskar Holmlund Tel 070-3220292