From owner-svn-src-head@freebsd.org Sun Jan 21 21:27:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC0DAEBC6FD; Sun, 21 Jan 2018 21:27:42 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9758D7D3D6; Sun, 21 Jan 2018 21:27:42 +0000 (UTC) (envelope-from phk@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 D6BF0111D7; Sun, 21 Jan 2018 21:27:41 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0LLRfvu049233; Sun, 21 Jan 2018 21:27:41 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0LLRfR0049230; Sun, 21 Jan 2018 21:27:41 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201801212127.w0LLRfR0049230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Sun, 21 Jan 2018 21:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328223 - in head/sys: arm/broadcom/bcm2835 modules modules/bcm283x_pwm modules/rpi_pwm X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: in head/sys: arm/broadcom/bcm2835 modules modules/bcm283x_pwm modules/rpi_pwm X-SVN-Commit-Revision: 328223 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.25 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: Sun, 21 Jan 2018 21:27:42 -0000 Author: phk Date: Sun Jan 21 21:27:41 2018 New Revision: 328223 URL: https://svnweb.freebsd.org/changeset/base/328223 Log: Rename rpi_pwm to bcm283x_pwm, and build it on armv[67] and arm64. Truncate ratio if period is lowered. Tested on Rpi2 and Rpi3. Rpi3 requires DTB->DTS->edit->DTB hack Added: head/sys/modules/bcm283x_pwm/ - copied from r328222, head/sys/modules/rpi_pwm/ Deleted: head/sys/modules/rpi_pwm/ Modified: head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c head/sys/modules/Makefile head/sys/modules/bcm283x_pwm/Makefile Modified: head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Sun Jan 21 21:09:08 2018 (r328222) +++ head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c Sun Jan 21 21:27:41 2018 (r328223) @@ -160,6 +160,8 @@ bcm_pwm_reconf(struct bcm_pwm_softc *sc) /* Config PWM */ W_RNG(sc, sc->period); + if (sc->ratio > sc->period) + sc->ratio = sc->period; W_DAT(sc, sc->ratio); /* Start PWM */ Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Jan 21 21:09:08 2018 (r328222) +++ head/sys/modules/Makefile Sun Jan 21 21:27:41 2018 (r328223) @@ -60,6 +60,7 @@ SUBDIR= \ ${_autofs} \ ${_auxio} \ ${_bce} \ + ${_bcm283x_pwm} \ bfe \ bge \ bhnd \ @@ -804,6 +805,10 @@ _cloudabi32= cloudabi32 _cloudabi64= cloudabi64 .endif +.endif + +.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64" +_bcm283x_pwm= bcm283x_pwm .endif .if ${MACHINE_ARCH:Marmv[67]*} != "" Modified: head/sys/modules/bcm283x_pwm/Makefile ============================================================================== --- head/sys/modules/rpi_pwm/Makefile Sun Jan 21 21:09:08 2018 (r328222) +++ head/sys/modules/bcm283x_pwm/Makefile Sun Jan 21 21:27:41 2018 (r328223) @@ -2,7 +2,7 @@ .PATH: ${SRCTOP}/sys/arm/broadcom/bcm2835/ -KMOD= rpi_pwm +KMOD= bcm283x_pwm SRCS= bcm2835_pwm.c SRCS+= bus_if.h device_if.h ofw_bus_if.h