From owner-freebsd-arm@freebsd.org Fri Aug 19 06:13:20 2016 Return-Path: Delivered-To: freebsd-arm@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 AC525BBF004 for ; Fri, 19 Aug 2016 06:13:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (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 92B701CE8 for ; Fri, 19 Aug 2016 06:13:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J6DKwu099912 for ; Fri, 19 Aug 2016 06:13:20 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-arm@FreeBSD.org Subject: [Bug 211979] On Raspberry Pi, GPIO output pins retain state on halt Date: Fri, 19 Aug 2016 06:13:20 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: arm X-Bugzilla-Version: 11.0-RC1 X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: bobf@mrp3.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-arm@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform bug_file_loc op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2016 06:13:20 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211979 Bug ID: 211979 Summary: On Raspberry Pi, GPIO output pins retain state on halt Product: Base System Version: 11.0-RC1 Hardware: arm URL: http://mrp3.com OS: Any Status: New Severity: Affects Some People Priority: --- Component: arm Assignee: freebsd-arm@FreeBSD.org Reporter: bobf@mrp3.com Running FreeBSD 11.0 RC1 on a Raspbery Pi model 1 'B' When the Raspberry Pi shuts down, the pins that were selected as outputs ap= pear to retain their former state, rather than being disabled (or converted to inputs) on shutdown. This makes it difficult for a particular add-on board (the ATX-Raspi) to detect that the system has halted. As an example, the ATX-Raspi board configures one GPIO as an input, and ano= ther as an output, setting the output level to a '1' state when the helper script starts. When the script detects a shutdown or reboot condition, it executes the appropriate command on the Raspberry Pi to either shut down or reboot. This web site explains how the board works: http://hackaday.com/2013/05/19/atx-raspi-is-a-smart-power-source-for-raspbe= rry-pi/ On system halt, however, the GPIO output pin is still configured as an outp= ut with a high level. So the system never powers off, since the ATX Raspi boa= rd thinks it's still shutting down. To demonstrate it was doing this, I force= d a reboot by pressing a key on the serial console. The reboot apparently did a reset all of the GPIO pins, causing the external board to 'detect' a power down, and it then shut down the power within a few seconds [as it is suppos= ed to do]. Unfortunately this workaround isn't acceptable. This board was originally designed to work with a Linux operating system running on the Raspberry Pi. The only problem here appears to be that the = GPIO pins are not reset on halt. It may be possible to make this a kernel option that could be programmed via the /boot configuration files, in case resetti= ng them on halt would have any kind of negative impact. Since the Raspberry Pi has no ATX or ACPI interface available to shut down = the power programatically, an external board like the ATX Raspi needs some way = to easily determine that it is 'safe' to power off the Raspberry Pi. Resetting all of the GPIO pins (or making all of them input pins) on halt would make = this work. --=20 You are receiving this mail because: You are the assignee for the bug.=