From owner-freebsd-arm@freebsd.org Sat Dec 28 15:17:38 2019 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 29B8E1EAA0C for ; Sat, 28 Dec 2019 15:17:38 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 47lS4074Vsz4Rgq for ; Sat, 28 Dec 2019 15:17:36 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id de5c14e0; Sat, 28 Dec 2019 16:17:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=B1j+O2EswGqSDLxvidLylnP6Yjw=; b=HtmAkercdmxNARgjKvb67tlD2uCI hRyxga7oORLLOCR57KAcdW2au0DdLcaW2dKit9+g2ro3xmjs6eGHs5gkJp/f/jj1 httdQnpSgrd79FwAtSwucsnPs9ihJW9aosAMLC0tlzohp6zXsKUQZN/yKeTAoP53 pFS4ambUw4U6VMA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=DAapa4dYuvr8QWKDYl5MMZgJc+fyHtU7THd5kyJbOQcWU/3eR0GUMUz1 p+whtaboSECy2RE91j188z/5I6JJygT5XPnPUT2H5Xtcp/JSCrpgXw7W8QBoRfBm 3ACmwmNweQp1BXKrvjNwMT0CcpgxGeyJaY1HHO6GfvFtbartZkE= Received: from skull.home.blih.net (lfbn-idf2-1-1164-130.w90-92.abo.wanadoo.fr [90.92.223.130]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 23ae81bc TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Sat, 28 Dec 2019 16:17:28 +0100 (CET) Date: Sat, 28 Dec 2019 16:17:26 +0100 From: Emmanuel Vadot To: Gary Otten Cc: freebsd-arm@freebsd.org Subject: Re: SPI support for A64-OLinuXino board Allwinner A64 processor Message-Id: <20191228161726.9efb08df5b69eaa0a0ff478f@bidouilliste.com> In-Reply-To: References: X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47lS4074Vsz4Rgq X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mail header.b=HtmAkerc; dmarc=none; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.177.182 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-1.30 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mail]; NEURAL_HAM_MEDIUM(-0.87)[-0.870,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:212.83.177.182/32]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[bidouilliste.com]; NEURAL_HAM_LONG(-0.94)[-0.945,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bidouilliste.com:+]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(0.41)[ip: (-0.55), ipnet: 212.83.160.0/19(2.36), asn: 12876(0.24), country: FR(0.00)]; ASN(0.00)[asn:12876, ipnet:212.83.160.0/19, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2019 15:17:38 -0000 On Wed, 25 Dec 2019 19:12:28 -0500 Gary Otten wrote: > Thanks, I have created the following overlay and tried a variety of other > things but I haven't been able to get spigen0.0 to appear in /dev. > > > > /* $FreeBSD$ */ > /dts-v1/; > /plugin/; > > / { > compatible = "allwinner,sun50i-a64"; > }; > > &{/soc/spi@1c68000} { > > status = "okay"; > > spigen0: spigen0 { > compatible = "freebsd,spigen"; > reg = <0>; > spi-max-frequency = <500000>; > status = "okay"; > }; > > }; > > > > Some diagnostics > > ------------------------------------------------------- > On Boot > > Loading DTB overlays: 'sun50i-a64-spi-spidev' > /boot/dtb/overlays/sun50i-a64-spi-spidev.dtbo size=0x15c > applying DTB overlay '/boot/dtb/overlays/sun50i-a64-spi-spidev.dtbo' > .. > .... > ..... > > Autoloading module: aw_spi.ko > aw_spi0: mem 0x1c68000-0x1c68fff irq 29 on simplebus0 > spibus0: on aw_spi0 > spibus0: at cs 0 mode 0 > > > ------------------------------------------------------- > root@:/boot/dtb/overlays # kldstat > Id Refs Address Size Name > 1 5 0xffff000000000000 144dda8 kernel > 2 1 0xffff000054c00000 41000 aw_spi.ko > > ------------------------------------------------------- > root@:/boot/dtb/overlays # devinfo > .. > ... > aw_spi0 > spibus0 > > ------------------------------------------------------- > root@:/boot/dtb/overlays # devinfo > > .... > ...... > Node 0x2f60: spi@1c68000 > Node 0x309c: spigen0 > _______________________________________________ > 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" Hi Gary, You overlay worked for me on the pine64-lts. Here is what I did : - Use https://github.com/evadot/freebsd/commits/aw_spigen - aw_spi is autoloaded via devmatch - kldload spigen (it's not in GENERIC for arm64, maybe we should add it or do some devmatch magic) - root@pine64-lts:~ # spi -i Device name: /dev/spigen0.0 Device mode: 0 Device speed: 500000 root@pine64-lts:~ # spi -d r -m 0 -C '9F 00' -v -c 2 Binary output of 2 bytes 2 command bytes and 2 data bytes read from SPI device | 0 1 2 3 4 5 6 7 8 9 A B C D E F | | 0 | 00 ef 40 18 | ..@. | Maybe you just forgot to load spigen ? -- Emmanuel Vadot