From owner-svn-src-head@freebsd.org Tue Apr 14 19:05:18 2020 Return-Path: Delivered-To: svn-src-head@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 A78DF2C725D; Tue, 14 Apr 2020 19:05:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 491w0t435bz4bR5; Tue, 14 Apr 2020 19:05:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 862EDA32A; Tue, 14 Apr 2020 19:05:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03EJ5I7g020403; Tue, 14 Apr 2020 19:05:18 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03EJ5H5L020399; Tue, 14 Apr 2020 19:05:17 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202004141905.03EJ5H5L020399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 14 Apr 2020 19:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359935 - in head: . sys/arm/allwinner sys/dts/arm/overlays sys/dts/arm64/overlays X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: . sys/arm/allwinner sys/dts/arm/overlays sys/dts/arm64/overlays X-SVN-Commit-Revision: 359935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2020 19:05:18 -0000 Author: manu Date: Tue Apr 14 19:05:17 2020 New Revision: 359935 URL: https://svnweb.freebsd.org/changeset/base/359935 Log: allwinner: aw_thermal: Cope with DTS changes The upstream DTS now include the thermal device node and the SID calibration entry. Update our driver to cope with this change and remove the DTB overlays that aren't needed anymore. MFC after: 2 months X-MFC-With: r359934 Deleted: head/sys/dts/arm/overlays/sun8i-h3-sid.dtso head/sys/dts/arm/overlays/sun8i-h3-ths.dtso head/sys/dts/arm64/overlays/sun50i-a64-sid.dtso head/sys/dts/arm64/overlays/sun50i-a64-ths.dtso head/sys/dts/arm64/overlays/sun50i-h5-sid.dtso head/sys/dts/arm64/overlays/sun50i-h5-ths.dtso Modified: head/UPDATING head/sys/arm/allwinner/aw_sid.c head/sys/arm/allwinner/aw_thermal.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Apr 14 18:57:00 2020 (r359934) +++ head/UPDATING Tue Apr 14 19:05:17 2020 (r359935) @@ -26,6 +26,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20200414: + Upstream DTS from Linux 5.6 was merged and they now have the SID + and THS (Secure ID controller and THermal Sensor) node present. + The DTB overlays have now been removed from the tree for the H3/H5 and + A64 SoCs and the aw_sid and aw_thermal driver have been updated to + deal with upstream DTS. If you are using those overlays you need to + remove them from loader.conf and update the DTBs on the FAT partition. + 20200310: Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have been upgraded to 10.0.0. Please see the 20141231 entry below for Modified: head/sys/arm/allwinner/aw_sid.c ============================================================================== --- head/sys/arm/allwinner/aw_sid.c Tue Apr 14 18:57:00 2020 (r359934) +++ head/sys/arm/allwinner/aw_sid.c Tue Apr 14 19:05:17 2020 (r359935) @@ -100,7 +100,7 @@ static struct aw_sid_efuse a64_efuses[] = { .public = true, }, { - .name = "ths-calib", + .name = "calibration", .desc = "Thermal Sensor Calibration Data", .base = EFUSE_OFFSET, .offset = 0x34, @@ -121,7 +121,7 @@ static struct aw_sid_efuse a83t_efuses[] = { .public = true, }, { - .name = "ths-calib", + .name = "calibration", .desc = "Thermal Sensor Calibration Data", .base = EFUSE_OFFSET, .offset = 0x34, @@ -142,11 +142,11 @@ static struct aw_sid_efuse h3_efuses[] = { .public = true, }, { - .name = "ths-calib", + .name = "calibration", .desc = "Thermal Sensor Calibration Data", .base = EFUSE_OFFSET, .offset = 0x34, - .size = 2, + .size = 4, .id = AW_SID_FUSE_THSSENSOR, .public = false, }, @@ -163,7 +163,7 @@ static struct aw_sid_efuse h5_efuses[] = { .public = true, }, { - .name = "ths-calib", + .name = "calibration", .desc = "Thermal Sensor Calibration Data", .base = EFUSE_OFFSET, .offset = 0x34, @@ -350,8 +350,7 @@ aw_sid_read(device_t dev, uint32_t offset, uint32_t si sc = device_get_softc(dev); for (i = 0; i < sc->sid_conf->nfuses; i++) - if (offset == (sc->sid_conf->efuses[i].base + - sc->sid_conf->efuses[i].offset)) { + if (offset == sc->sid_conf->efuses[i].offset) { fuse_id = sc->sid_conf->efuses[i].id; break; } Modified: head/sys/arm/allwinner/aw_thermal.c ============================================================================== --- head/sys/arm/allwinner/aw_thermal.c Tue Apr 14 18:57:00 2020 (r359934) +++ head/sys/arm/allwinner/aw_thermal.c Tue Apr 14 19:05:17 2020 (r359935) @@ -267,7 +267,7 @@ static const struct aw_thermal_config h3_config = { .thermal_per = H3_THERMAL_PER, .to_temp = h3_to_temp, .to_reg = h3_to_reg, - .calib0_mask = 0xffff, + .calib0_mask = 0xffffffff, }; static int @@ -387,12 +387,12 @@ aw_thermal_init(struct aw_thermal_softc *sc) int error; node = ofw_bus_get_node(sc->dev); - if (nvmem_get_cell_len(node, "ths-calib") > sizeof(calib)) { - device_printf(sc->dev, "ths-calib nvmem cell is too large\n"); + if (nvmem_get_cell_len(node, "calibration") > sizeof(calib)) { + device_printf(sc->dev, "calibration nvmem cell is too large\n"); return (ENXIO); } - error = nvmem_read_cell_by_name(node, "ths-calib", - (void *)&calib, nvmem_get_cell_len(node, "ths-calib")); + error = nvmem_read_cell_by_name(node, "calibration", + (void *)&calib, nvmem_get_cell_len(node, "calibration")); /* Read calibration settings from EFUSE */ if (error != 0) { device_printf(sc->dev, "Cannot read THS efuse\n"); @@ -624,7 +624,7 @@ aw_thermal_attach(device_t dev) return (ENXIO); } - if (clk_get_by_ofw_name(dev, 0, "apb", &sc->clk_apb) == 0) { + if (clk_get_by_ofw_name(dev, 0, "bus", &sc->clk_apb) == 0) { error = clk_enable(sc->clk_apb); if (error != 0) { device_printf(dev, "cannot enable apb clock\n"); @@ -632,7 +632,7 @@ aw_thermal_attach(device_t dev) } } - if (clk_get_by_ofw_name(dev, 0, "ths", &sc->clk_ths) == 0) { + if (clk_get_by_ofw_name(dev, 0, "mod", &sc->clk_ths) == 0) { error = clk_set_freq(sc->clk_ths, sc->conf->clk_rate, 0); if (error != 0) { device_printf(dev, "cannot set ths clock rate\n");