From owner-freebsd-arm@freebsd.org Sun Dec 1 11:07:40 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 045591C74B2 for ; Sun, 1 Dec 2019 11:07:40 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vtr.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Qlp24brHz3DTD; Sun, 1 Dec 2019 11:07:38 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp239-208.static.internode.on.net [59.167.239.208]) by vtr.rulingia.com (8.15.2/8.15.2) with ESMTPS id xB1B7M5x041631 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 1 Dec 2019 22:07:28 +1100 (AEDT) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id xB1B7Glb042720 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 1 Dec 2019 22:07:16 +1100 (AEDT) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id xB1B7GJb042719; Sun, 1 Dec 2019 22:07:16 +1100 (AEDT) (envelope-from peter) Date: Sun, 1 Dec 2019 22:07:16 +1100 From: Peter Jeremy To: Michal Meloun Cc: freebsd-arm@freebsd.org Subject: rk_tsadc breaks (my) Rock64 Message-ID: <20191201110716.GA41224@server.rulingia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 47Qlp24brHz3DTD X-Spamd-Bar: ------- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of peter@rulingia.com designates 2001:19f0:5801:ebe:5400:1ff:fe53:30fd as permitted sender) smtp.mailfrom=peter@rulingia.com X-Spamd-Result: default: False [-7.65 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[rulingia.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; SH_EMAIL_DBL_DONT_QUERY_IPS(0.00)[0.0.0.5,0.0.0.6,0.0.0.8]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-3.25)[ip: (-9.60), ipnet: 2001:19f0:5800::/38(-4.81), asn: 20473(-1.80), country: US(-0.05)]; RCPT_COUNT_TWO(0.00)[2]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:20473, ipnet:2001:19f0:5800::/38, country:US]; RCVD_TLS_ALL(0.00)[]; SH_EMAIL_ZRD(0.00)[0.0.0.5,0.0.0.8,0.0.0.6] 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: Sun, 01 Dec 2019 11:07:40 -0000 --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable r355173 added code to read the Rockchip temperature sensors. Unfortunately, this breaks on my Rock64. I've tried to understand what's going wrong but haven't managed to make much headway. It looks like there some configurati= on missing from syscon that tsadc needs but I'm not sure what (and I don't rea= lly understand what syscon is doing). I'd appreciate any insights. Relevant extract from the dmesg: simple_mfd0: mem 0xff450000-0xff45fff= f on ofwbus0 =2E.. rk_tsadc0: mem 0xff250000-0xff2500ff irq 22 = on ofwbus0 rk_tsadc0: nclocks=3D1, nparents=3D-1 rk_tsadc0: Set clk_tsadc to 50000 panic: data abort with spinlock held cpuid =3D 0 time =3D 1 KDB: stack backtrace: =2E.. data_abort() at do_el1h_sync+0x144 pc =3D 0xffff00000053f590 lr =3D 0xffff00000053e8c8 sp =3D 0xffff000000010530 fp =3D 0xffff000000010560 do_el1h_sync() at handle_el1h_sync+0x78 pc =3D 0xffff00000053e8c8 lr =3D 0xffff000000525078 sp =3D 0xffff000000010570 fp =3D 0xffff000000010680 handle_el1h_sync() at simple_mfd_syscon_write_4+0x60 pc =3D 0xffff000000525078 lr =3D 0xffff0000000fb028 sp =3D 0xffff000000010690 fp =3D 0xffff000000010740 simple_mfd_syscon_write_4() at tsadc_attach+0x44c pc =3D 0xffff0000000fb028 lr =3D 0xffff000000553b58 sp =3D 0xffff000000010750 fp =3D 0xffff0000000107c0 tsadc_attach() at device_attach+0x3e0 pc =3D 0xffff000000553b58 lr =3D 0xffff00000028ad1c sp =3D 0xffff0000000107d0 fp =3D 0xffff000000010830 device_attach() at bus_generic_new_pass+0x12c pc =3D 0xffff00000028ad1c lr =3D 0xffff00000028cb58 sp =3D 0xffff000000010840 fp =3D 0xffff000000010870 =2E.. Stopped at generic_bs_w_4: undefined b8226823 Relevant extract from FDT: syscon@ff100000 { compatible =3D "rockchip,rk3328-grf", "syscon", "simple-mfd= "; reg =3D <0x0 0xff100000 0x0 0x1000>; #address-cells =3D <0x1>; #size-cells =3D <0x1>; phandle =3D <0x13>; io-domains { compatible =3D "rockchip,rk3328-io-voltage-domain"; status =3D "okay"; vccio1-supply =3D <0x20>; vccio2-supply =3D <0x22>; vccio3-supply =3D <0x20>; vccio4-supply =3D <0x21>; vccio5-supply =3D <0x20>; vccio6-supply =3D <0x20>; pmuio-supply =3D <0x20>; phandle =3D <0x14>; }; grf-gpio { compatible =3D "rockchip,rk3328-grf-gpio"; gpio-controller; #gpio-cells =3D <0x2>; phandle =3D <0x15>; }; power-controller { compatible =3D "rockchip,rk3328-power-controller"; #power-domain-cells =3D <0x1>; #address-cells =3D <0x1>; #size-cells =3D <0x0>; phandle =3D <0x16>; pd_hevc@6 { reg =3D <0x6>; }; pd_video@5 { reg =3D <0x5>; }; pd_vpu@8 { reg =3D <0x8>; }; }; reboot-mode { compatible =3D "syscon-reboot-mode"; offset =3D <0x5c8>; mode-normal =3D <0x5242c300>; mode-recovery =3D <0x5242c303>; mode-bootloader =3D <0x5242c309>; mode-loader =3D <0x5242c301>; }; }; =2E.. tsadc@ff250000 { compatible =3D "rockchip,rk3328-tsadc"; reg =3D <0x0 0xff250000 0x0 0x100>; interrupts =3D <0x0 0x3a 0x4>; assigned-clocks =3D <0x46 0x24>; assigned-clock-rates =3D <0xc350>; clocks =3D <0x46 0x24 0x46 0xd5>; clock-names =3D "tsadc", "apb_pclk"; pinctrl-names =3D "init", "default", "sleep"; pinctrl-0 =3D <0x7c>; pinctrl-1 =3D <0x7d>; pinctrl-2 =3D <0x7c>; resets =3D <0x46 0x42>; reset-names =3D "tsadc-apb"; rockchip,grf =3D <0x13>; rockchip,hw-tshut-temp =3D <0x186a0>; #thermal-sensor-cells =3D <0x1>; status =3D "okay"; rockchip,hw-tshut-mode =3D <0x0>; rockchip,hw-tshut-polarity =3D <0x0>; phandle =3D <0x30>; }; --=20 Peter Jeremy --GvXjxJ+pjyke8COw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAl3jnt5fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzQLiBAAnajr+fJOKvnn7+fVFIcrowWQDDFQzrVeJ5TEp68Obl7p+wykfg6mNC2Q a8eW2UwUfam4XKJQY28gAApFTqa2dyYDUOesyKmaFq9SYpo9TVw3bfEGIUa+kg8R mdnG4GG9WaXT94wZyQ6d23KYmRXJV6eR9q7cQ8FmKS6i6crlCbP/m1T2PMbueol3 oaiGY0dYdn9AySPOsshzL+7MW7p4iM3M5b7QgkSxbNbuI61JrCIxYvADtrnif87F bZlOm5ZmG2Q3H3KzDMD+jsgwajgItVrbTYXh8i5VYIGK2Z6OvbiBtqwsq/CI1g69 TgcwxB+NV88stt60qcsYjvshg/G6BF5DjgEkVyrglOeylrhSxSx44V+uUkWok1Bb u+cFKgWxEOeRG9N5XCjV8ZGfe149w7SrwgY9u0nyKLGOQ7rvYM7ZAktx3TUnewme uLifXbRp3EFqO2vwlcAOYoV6bRjBzhB1Ru4fstwz4pbkfGq//aV88odry3keWHnR njqkHxRs0GyoOY/Xr3CUs1ac7NuuLg+FLR+VD3rZR3lwRLAw8eNZkS4mHUThYr8u 5MNJTlYvDFblM1miMGhXsmTgQLqtCpxepOGtNmrwpUzUWsLp0CP9kkLC9oQOn1/p jBo1uupEGmcdzl2zP594pMxF59GoG2JjJPVYuzUcBCWVMi953ao= =J54v -----END PGP SIGNATURE----- --GvXjxJ+pjyke8COw--