Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Dec 2019 22:07:16 +1100
From:      Peter Jeremy <peter@rulingia.com>
To:        Michal Meloun <mmel@FreeBSD.org>
Cc:        freebsd-arm@freebsd.org
Subject:   rk_tsadc breaks (my) Rock64
Message-ID:  <20191201110716.GA41224@server.rulingia.com>

next in thread | raw e-mail | index | archive | help

--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: <Simple MFD (Multi-Functions Device)> mem 0xff450000-0xff45fff=
f on ofwbus0
=2E..
rk_tsadc0: <RockChip temperature sensors> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20191201110716.GA41224>