From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 11:23:29 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06B24F3F; Sun, 15 Feb 2015 11:23:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 CCD75C11; Sun, 15 Feb 2015 11:23:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1FBNS5T080601; Sun, 15 Feb 2015 11:23:28 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1FBNSiM080600; Sun, 15 Feb 2015 11:23:28 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201502151123.t1FBNSiM080600@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 15 Feb 2015 11:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278797 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2015 11:23:29 -0000 Author: andrew Date: Sun Feb 15 11:23:27 2015 New Revision: 278797 URL: https://svnweb.freebsd.org/changeset/base/278797 Log: Add the structures needed to get/set the power state. These can be used when, for example, we boot without U-Boot and wish to enable USB, or to suspend an unneeded device. MFC after: 1 week Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Sun Feb 15 08:52:09 2015 (r278796) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Sun Feb 15 11:23:27 2015 (r278797) @@ -52,6 +52,53 @@ struct bcm2835_mbox_tag_hdr { uint32_t val_len; }; +#define BCM2835_MBOX_POWER_ID_EMMC 0x00000000 +#define BCM2835_MBOX_POWER_ID_UART0 0x00000001 +#define BCM2835_MBOX_POWER_ID_UART1 0x00000002 +#define BCM2835_MBOX_POWER_ID_USB_HCD 0x00000003 +#define BCM2835_MBOX_POWER_ID_I2C0 0x00000004 +#define BCM2835_MBOX_POWER_ID_I2C1 0x00000005 +#define BCM2835_MBOX_POWER_ID_I2C2 0x00000006 +#define BCM2835_MBOX_POWER_ID_SPI 0x00000007 +#define BCM2835_MBOX_POWER_ID_CCP2TX 0x00000008 + +#define BCM2835_MBOX_POWER_ON (1 << 0) +#define BCM2835_MBOX_POWER_WAIT (1 << 1) + +#define BCM2835_MBOX_TAG_GET_POWER_STATE 0x00020001 +#define BCM2835_MBOX_TAG_SET_POWER_STATE 0x00028001 + +struct msg_get_power_state { + struct bcm2835_mbox_hdr hdr; + struct bcm2835_mbox_tag_hdr tag_hdr; + union { + struct { + uint32_t device_id; + } req; + struct { + uint32_t device_id; + uint32_t state; + } resp; + } body; + uint32_t end_tag; +}; + +struct msg_set_power_state { + struct bcm2835_mbox_hdr hdr; + struct bcm2835_mbox_tag_hdr tag_hdr; + union { + struct { + uint32_t device_id; + uint32_t state; + } req; + struct { + uint32_t device_id; + uint32_t state; + } resp; + } body; + uint32_t end_tag; +}; + #define BCM2835_MBOX_CLOCK_ID_EMMC 0x00000001 #define BCM2835_MBOX_CLOCK_ID_UART 0x00000002 #define BCM2835_MBOX_CLOCK_ID_ARM 0x00000003