From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Michael Hanselmann <linux-kernel@hansmi.ch>
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>,
linux-kernel@killerfox.forkbomb.ch
Subject: Re: [PATCH] More SMU commands
Date: Mon, 08 Jan 2007 12:12:10 +1100 [thread overview]
Message-ID: <1168218731.22458.109.camel@localhost.localdomain> (raw)
In-Reply-To: <20070106024242.GA18395@hansmi.ch>
> +#define SMU_CMD_POWER_EVENTS_COMMAND 0x8f
> +
> +/*
> + * Enables file server mode
> + *
> + * Meaning or use is unknown. Maybe this allows the machine to power up after
> + * AC loss.
Meaning and use are known :-) This defines events related to powering or
waking the machine up :-)
> + * Parameters:
> + * 2: always 0x00, meaning unknown
> + * 3: always 0x02, meaning unknown
Paremeters depend on the subcommand.
> + * Returns:
> + * 2 bytes
> + */
> +#define SMU_CMD_POWER_EVENTS_SET_FILESERVER_MODE 0x01
Look at the corresponding PMU commands.
/* PMU PMU_POWER_EVENTS commands */
enum {
PMU_PWR_GET_POWERUP_EVENTS = 0x00,
PMU_PWR_SET_POWERUP_EVENTS = 0x01,
PMU_PWR_CLR_POWERUP_EVENTS = 0x02,
PMU_PWR_GET_WAKEUP_EVENTS = 0x03,
PMU_PWR_SET_WAKEUP_EVENTS = 0x04,
PMU_PWR_CLR_WAKEUP_EVENTS = 0x05,
};
(There might be others above 5 but that's the one I know about, they are
the same on the SMU).
The "POWERUP" events define events that can powerup the machine when
shut down. The "WAKEUP" events define events that can wake up the
machine when sleeping.
Both sets of commands are made of 3 base commands: GET, SET abd CLR. The
events are a 16 bits bit mask though from my experience, only the first
8 bits is ever used. GET reads the current mask afaik (though it might
not always work, I had issues in the past). SET enabled some events, CLR
disables some events.
The bit values for the events themselves aren't completly known, but
they seem to follow the same convention as the PMU, which is
/* Power events wakeup bits */
enum {
PMU_PWR_WAKEUP_KEY = 0x01, /* Wake on key press */
PMU_PWR_WAKEUP_AC_INSERT = 0x02, /* Wake on AC adapter plug */
PMU_PWR_WAKEUP_AC_CHANGE = 0x04,
PMU_PWR_WAKEUP_LID_OPEN = 0x08,
PMU_PWR_WAKEUP_RING = 0x10,
};
So for example, a CLR with 0xff 0xff will clear all events. Then, a SET with
0x02 0x00 will enable "AC INSERT" event.
The way to enable file server mode is to enable POWERUP on the AC_INSERT
event.
Ben.
next prev parent reply other threads:[~2007-01-08 1:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-24 13:05 [PATCH] More SMU commands Michael Hanselmann
2006-12-25 21:33 ` Benjamin Herrenschmidt
2007-01-05 0:10 ` Michael Hanselmann
2007-01-06 2:42 ` Michael Hanselmann
2007-01-08 1:12 ` Benjamin Herrenschmidt [this message]
2007-01-14 22:53 ` Michael Hanselmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1168218731.22458.109.camel@localhost.localdomain \
--to=benh@kernel.crashing.org \
--cc=linux-kernel@hansmi.ch \
--cc=linux-kernel@killerfox.forkbomb.ch \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).