From owner-freebsd-arm@freebsd.org Sat Nov 3 20:46:41 2018 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9355710E3B30 for ; Sat, 3 Nov 2018 20:46:41 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2r.ore.mailhop.org (outbound2r.ore.mailhop.org [54.200.129.228]) (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 1714F6A2C1 for ; Sat, 3 Nov 2018 20:46:40 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1541277994; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Tr6FkRr/8xwxdPF7vykgTiDgTcpDbPeQBV2mbBJKL7z4m+SPjiDuEVwIn72k8s2u50I4h1MQkWCQw 8+Npb+2o5hjmCZCGXsULHevufLyBR/QKkkjwCDREyz7EyxqJGkFi1PILamzPl1HaKtT9al1iiY6io3 kUFRLuvLI7S0ag5FKjMNzFu/oL+PFitz0S3ob85yZSiSndFL75mMSzei25L3FV1G4jZ4T6InQ8P/HO Nbfg/fymqUNY6hwsps5f0hgrmgEs24cS//GFhLmemeoZcV+1CECOUABv3msvkBv78Po3VTR/IvwLKi 76atSctCKsyrYXlJm9ibZtA6f4jreXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=ijmhEzbFc1hnWE3F+JuWsrvjszk22oZfHQ8uzYjf7Ls=; b=l6Cn0RaQY3lZXz0VOZjuMX09Euby46BRJksHKpyFUHjsS/QCfzryGxIywxV11T2VIPV1EYdw3Fgeh ilhuGkyWmof8UkEe1wX224tUBkrdZHKtX6k6uiLGzyXnYwy7g++VHvVdKkCzXIDpiXNSUN2PBkqHkL DZhKcyWYxqt76nK+Wm9Z3qUiAtmEJEbxXPSmKR0wHYpLmpbi1huozX5s0Wea9r7RmfF6R92w0Lsin8 xykq70XVARoSIV9R/6KX07MtjnWq1nb7KOCOi0kHzF0do27rjdXC8fnHTg/CAXEKhsLIBH7NkhfRYs Qj1u8VUG7iIN/1H1G4apZANAOo1QGgg== ARC-Authentication-Results: i=1; outbound2.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=ijmhEzbFc1hnWE3F+JuWsrvjszk22oZfHQ8uzYjf7Ls=; b=QdsmDUxSqVSCQc2zr+f0PIzpKlAwnJ3764N+IBDFGWdnw81SXBSS8cRiawPhNM9Q01KN1UAl7aJQT pXjSzU7XT/llnhpGJPMU0OwacjvZYBC7yjTdZ+9SsnvozVBcCkenDOs6L6DIAlnMamVH8/CqVzr9x9 oG6aeMgLGC1JxmBr2iGi4AAzQwBWlnqCM7+E8slslmlPxJwQa93Z4IzLC0K4mKI3nBUFOMp2nQOGUS 5QEa5bcs7ciTtXRXmhT4bJUtmBLyAPdEKjoPi5ATNZ2kQT0Jl77+nRVzBj0wOOeoytNFcw0kniSuNd yDxidZiJfCrTgu3LjBnAkJDe+2vxhpw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 8ab07dd4-dfa9-11e8-a630-335f030b21f2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 8ab07dd4-dfa9-11e8-a630-335f030b21f2; Sat, 03 Nov 2018 20:46:32 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id wA3KkUAq074741; Sat, 3 Nov 2018 14:46:30 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1541277990.52306.4.camel@freebsd.org> Subject: Re: How to add custom dts entries From: Ian Lepore To: ticso@cicely.de, freebsd-arm@freebsd.org Cc: Bernd Walter Date: Sat, 03 Nov 2018 14:46:30 -0600 In-Reply-To: <20181103200709.GB79858@cicely7.cicely.de> References: <20181103200709.GB79858@cicely7.cicely.de> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit 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, 03 Nov 2018 20:46:41 -0000 On Sat, 2018-11-03 at 21:07 +0100, Bernd Walter wrote: > For a raspberry (1B modell) I have the following patches: > [92]cicely7> cat rpi.ds18b20.dts.patch  > Index: boot/fdt/dts/arm/rpi.dts > =================================================================== > --- boot/fdt/dts/arm/rpi.dts    (revision 303469) > +++ boot/fdt/dts/arm/rpi.dts    (working copy) > @@ -340,6 +348,11 @@ >                 }; >         }; >   > +       onewire { > +               compatible = "w1-gpio"; > +               gpios = <&gpio 4 1>; > +       }; > + >         power: regulator { >                 compatible = "broadcom,bcm2835-power-mgr", >                              "broadcom,bcm2708-power-mgr", > [93]cicely7> cat rpi.apa102.dts.patch  > Index: boot/fdt/dts/arm/rpi.dts > =================================================================== > --- boot/fdt/dts/arm/rpi.dts    (revision 303469) > +++ boot/fdt/dts/arm/rpi.dts    (working copy) > @@ -292,6 +292,14 @@ >                                 broadcom,function = "ALT3"; >                         }; >                 }; > + > +               spi0 { > +                       apa102led0 { > +                               compatible = "led,apa102"; > +                               spi-chipselect = <0>; > +                       }; > +               }; > + >                 usb { >                         hub { >                                 compatible = "usb,hub", "usb,device"; > > And to install > cd /usr/src/sys/modules/dtb/rpi > make all install > > Obviously a few things have changed since then. > We don't have overlay support yet, don't we? > > System is: > # uname -a > FreeBSD rpi-b 12.0-BETA3 FreeBSD 12.0-BETA3 r340039 RPI-B  arm > /usr/src is populated and my kernel driver itself build fine: > # ls -la /boot/modules/ > total 20 > drwxr-xr-x   2 root  wheel   512 Nov  3 20:54 . > drwxr-xr-x  10 root  wheel  1024 Nov  3 20:54 .. > -r-xr-xr-x   1 root  wheel  7080 Nov  3 20:54 apa102.ko > -rw-r--r--   1 root  wheel    36 Nov  3 20:54 linker.hints > We do have overlay support now. I don't know much about using it, hopefully those who do will reply with details. There have also been updates to the SPI world. Your apa102led0 fdt node now requires a "spi-max-frequency" property, the value is the bus speed to use when communicating with that device, in Hz (different devices on the same bus can now have different speeds, and there is no concept of a default speed). Also, the chipsel number should be in a reg= property, but we still support spi-chipselect= too for backwards compatibility.  -- Ian