Age | Commit message (Collapse) | Author | Files | Lines |
|
Add the missing ABI documentation for the already available debugfs
entries: console_log, panicinfo and pdinfo.
Signed-off-by: Enric Balletbo i Serra <[email protected]>
|
|
kernel-doc comments have a prescribed format. To be _particularly_
correct we should also capitalise the brief description and terminate
it with a period.
Signed-off-by: Enric Balletbo i Serra <[email protected]>
|
|
The new debugfs entry 'uptime' is being made available to userspace so that
a userspace daemon can synchronize EC logs with host time.
Signed-off-by: Tim Wawrzynczak <[email protected]>
[rework based on Tim's first approach]
Signed-off-by: Enric Balletbo i Serra <[email protected]>
Tested-by: Tim Wawrzynczak <[email protected]>
|
|
Immutable branch between MFD and chrome-platform for driver changes to
allow picking patches that depends on the cros_ec_commands.h file
update.
Signed-off-by: Enric Balletbo i Serra <[email protected]>
|
|
Improve I2S API.
Rename ec_response_codec_gain into ec_codec_i2s_gain,
update caller accordlingly.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Add commands for test and management.
Add command space for future development.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Add API to store SKU, Cros board information in EC flash memory.
Add API to store security data in EC.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Add command to retrieve signature of image stored in the RW memory
slot(s).
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Add API for fingerprint sensor presented by embedded controller.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Add API to control touchpad presented by Embedded Controller.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Allow EC to talk to other ECs that are not presented to the host.
Neeed when EC are present in detachable keyboard.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Prevent direct i2c access to device behind EC when not in development mode.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Add API to update battery firmware.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Add support for controlling hibernation of the Embedded Controller.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Add command to allow keyboard testing in factory.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Improve API for USB Powe delivery and power management.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Improve API to retrieve temperature information.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Add support for fingerprint sensors managed by embedded controller.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Improve API between EC and Host to report events.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Add new command for batched mode, add support for more sensors.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Introduce a new transport procotol between EC and host.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Improve API to verify EC image signature.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
New API split commands, improve EC command latency.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Add API for fan control.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Added for supporting larger embedded controller flash.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Empty structure size is different between C and C++.
To prevent clang warning when compiling this include file in C++
programs, remove empty structures.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Move near the end of file.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Add more fields and improve API when EC presents data through ACPI
memory space.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Replace (1 << ...) with BIT().
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
This change is required for compilation of embedded controller firmware
to work properly (See CONFIG_HOSTCMD_SECTION_SORTED).
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
To reduce code and improve performance of the embedded controller
firmware, pragma __aligned(2) or __aligned(4) are used when alignment to
16 or 32 bit boundary is expected.
Define all ec_align to packed when compiling kernel.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Fix comments syntax and spelling errors.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Defined out build macro used when compiling embedded controller
firmware.
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Update to SPDX-License-Identifier, GPL-2.0
Signed-off-by: Gwendal Grignou <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Benson Leung <[email protected]>
Reviewed-by: Fabien Lahoudere <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
Fix sparse warning:
drivers/platform/chrome/cros_ec_debugfs.c:256:30: warning: symbol 'cros_ec_console_log_fops' was not declared. Should it be static?
drivers/platform/chrome/cros_ec_debugfs.c:265:30: warning: symbol 'cros_ec_pdinfo_fops' was not declared. Should it be static?
drivers/platform/chrome/cros_ec_lightbar.c:550:24: warning: symbol 'cros_ec_lightbar_attr_group' was not declared. Should it be static?
drivers/platform/chrome/cros_ec_sysfs.c:338:24: warning: symbol 'cros_ec_attr_group' was not declared. Should it be static?
drivers/platform/chrome/cros_ec_vbc.c:104:24: warning: symbol 'cros_ec_vbc_attr_group' was not declared. Should it be static?
drivers/platform/chrome/cros_ec_lpc.c:408:25: warning: symbol 'cros_ec_lpc_pm_ops' was not declared. Should it be static?
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: YueHaibing <[email protected]>
Reviewed-by: Benson Leung <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
|
|
Add the ability to extract version information from the EC.
Example Output:
$ cd /sys/bus/platform/devices/GOOG000C:00
$ tail build_date build_revision version model_number
==> build_date <==
04/25/19
==> build_revision <==
d2592cae0
==> version <==
00.00.14
==> model_number <==
08B6
Signed-off-by: Raul E Rangel <[email protected]>
Reviewed-by: Nick Crews <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
|
|
The Wilco Embedded Controller is able to send telemetry data
which is useful for enterprise applications. A daemon running on
the OS sends a command to the EC via a write() to a char device,
and can read the response with a read(). The write() request is
verified by the driver to ensure that it is performing only one
of the whitelisted commands, and that no extraneous data is
being transmitted to the EC. The response is passed directly
back to the reader with no modification.
The character device will appear as /dev/wilco_telemN, where N
is some small non-negative integer, starting with 0. Only one
process may have the file descriptor open at a time. The calling
userspace program needs to keep the device file descriptor open
between the calls to write() and read() in order to preserve the
response. Up to 32 bytes will be available for reading.
For testing purposes, try requesting the EC's firmware build
date, by sending the WILCO_EC_TELEM_GET_VERSION command with
argument index=3. i.e. write [0x38, 0x00, 0x03]
to the device node. An ASCII string of the build date is
returned.
Signed-off-by: Nick Crews <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
|
|
The Wilco Embedded Controller can create custom events that
are not handled as standard ACPI objects. These events can
contain information about changes in EC controlled features,
such as errors and events in the dock or display. For example,
an event is triggered if the dock is plugged into a display
incorrectly. These events are needed for telemetry and
diagnostics reasons, and for possibly alerting the user.
These events are triggered by the EC with an ACPI Notify(0x90),
and then the BIOS reads the event buffer from EC RAM via an
ACPI method. When the OS receives these events via ACPI,
it passes them along to this driver. The events are put into
a queue which can be read by a userspace daemon via a char device
that implements read() and poll(). The event queue acts as a
circular buffer of size 64, so if there are no userspace consumers
the kernel will not run out of memory. The char device will appear at
/dev/wilco_event{n}, where n is some small non-negative integer,
starting from 0. Standard ACPI events such as the battery getting
plugged/unplugged can also come through this path, but they are
dealt with via other paths, and are ignored here.
To test, you can tail the binary data with
$ cat /dev/wilco_event0 | hexdump -ve '1/1 "%x\n"'
and then create an event by plugging/unplugging the battery.
Signed-off-by: Nick Crews <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
|
|
All currently known ECs in the wild are very sensitive to timing.
Specifically the ECs are known to drop a transfer if more than 8 ms
passes from the assertion of the chip select until the transfer
finishes.
Let's use the new feature introduced in the patch (spi: Allow SPI
devices to request the pumping thread be realtime") to request the SPI
pumping thread be realtime. This means that if we get shunted off to
the SPI thread for whatever reason we won't get downgraded to low
priority.
NOTES:
- We still need to keep ourselves as high priority since the SPI core
doesn't guarantee that all transfers end up on the pumping thread
(in fact, it tries pretty hard to do them in the calling context).
- If future Chrome OS ECs ever fix themselves to be less sensitive
then we could consider adding a property (or compatible string) to
not set this property. For now we need it across the board.
Signed-off-by: Douglas Anderson <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
|
|
Immutable branch between spi and chrome-platform for driver changes to
allow setting spi pump to RT priority.
Signed-off-by: Enric Balletbo i Serra <[email protected]>
|
|
Right now the only way to get the SPI pumping thread bumped up to
realtime priority is for the controller to request it. However it may
be that the controller works fine with the normal priority but
communication to a particular SPI device on the bus needs realtime
priority.
Let's add a way for devices to request realtime priority when they set
themselves up.
NOTE: this will just affect the priority of transfers that end up on
the SPI core's pumping thread. In many cases transfers happen in the
context of the caller so if you need realtime priority for all
transfers you should ensure the calling context is also realtime
priority.
Signed-off-by: Douglas Anderson <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Tested-by: Enric Balletbo i Serra <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
In commit 37a186225a0c ("platform/chrome: cros_ec_spi: Transfer
messages at high priority") we moved transfers to a high priority
workqueue. This helped make them much more reliable.
...but, we still saw failures.
We were actually finding ourselves competing for time with dm-crypt
which also scheduled work on HIGHPRI workqueues. While we can
consider reverting the change that made dm-crypt run its work at
HIGHPRI, the argument in commit a1b89132dc4f ("dm crypt: use
WQ_HIGHPRI for the IO and crypt workqueues") is somewhat compelling.
It does make sense for IO to be scheduled at a priority that's higher
than the default user priority. It also turns out that dm-crypt isn't
alone in using high priority like this. loop_prepare_queue() does
something similar for loopback devices.
Looking in more detail, it can be seen that the high priority
workqueue isn't actually that high of a priority. It runs at MIN_NICE
which is _fairly_ high priority but still below all real time
priority.
Should we move cros_ec_spi to real time priority to fix our problems,
or is this just escalating a priority war? I'll argue here that
cros_ec_spi _does_ belong at real time priority. Specifically
cros_ec_spi actually needs to run quickly for correctness. As I
understand this is exactly what real time priority is for.
There currently doesn't appear to be any way to use the standard
workqueue APIs with a real time priority, so we'll switch over to
using using a kthread worker. We'll match the priority that the SPI
core uses when it wants to do things on a realtime thread and just use
"MAX_RT_PRIO - 1".
This commit plus the patch ("platform/chrome: cros_ec_spi: Request the
SPI thread be realtime") are enough to get communications very close
to 100% reliable (the only known problem left is when serial console
is turned on, which isn't something that happens in shipping devices).
Specifically this test case now passes (tested on rk3288-veyron-jerry):
dd if=/dev/zero of=/var/log/foo.txt bs=4M count=512&
while true; do
ectool version > /dev/null;
done
It should be noted that "/var/log" is encrypted (and goes through
dm-crypt) and also passes through a loopback device.
Signed-off-by: Douglas Anderson <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
|
|
This driver implements a slim layer to enable the ChromeOS
EC kernel stack (cros_ec) to communicate with ChromeOS EC
firmware running on the Intel Integrated Sensor Hub (ISH).
The driver registers a ChromeOS EC MFD device to connect
with cros_ec kernel stack (upper layer), and it registers a
client with the ISH Transport Protocol bus (lower layer) to
talk with the ISH firwmare. See description of the ISHTP
protocol at Documentation/hid/intel-ish-hid.txt
Signed-off-by: Rushikesh S Kadam <[email protected]>
Acked-by: Srinivas Pandruvada <[email protected]>
Reviewed-by: Jett Rink <[email protected]>
Tested-by: Jett Rink <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
|
|
The Chrome OS EC driver attaches to devices using the of_match_table
even when ACPI is the underlying firmware. It does this using the
magic PRP0001 ACPI HID, which tells ACPI to go find an OF compatible
string under the hood and match on that.
The cros_ec_spi driver needs to provide the of_match_table regardless
of whether CONFIG_OF is enabled or not, since the table is used by
ACPI for PRP0001 devices.
Signed-off-by: Evan Green <[email protected]>
Reviewed-by: Benson Leung <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
|
|
The 0xF6 command, intended to send and receive 256 byte payloads to
and from the EC, is not needed. The 0xF5 command for 32 byte
payloads is sufficient. This patch removes support for the 0xF6
command and 256 byte payloads.
Signed-off-by: Nick Crews <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
|
|
Boot on AC is a policy which makes the device boot from S5 when AC
power is connected. This is useful for users who want to run their
device headless or with a dock.
Signed-off-by: Nick Crews <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
|
|
A Property is typically a data item that is stored to NVRAM
by the EC. Each of these data items has an index associated
with it, known as the Property ID (PID). Properties may have
variable lengths, up to a max of WILCO_EC_PROPERTY_MAX_SIZE
bytes. Properties can be simple integers, or they may be more
complex binary data.
This patch adds support for getting and setting properties.
This will be useful for setting the charge algorithm and charge
schedules, which all use properties.
Signed-off-by: Nick Crews <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
|
|
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs
Pull UBIFS fixes from Richard Weinberger:
- build errors wrt xattrs
- mismerge which lead to a wrong Kconfig ifdef
- missing endianness conversion
* tag 'upstream-5.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs:
ubifs: Convert xattr inum to host order
ubifs: Use correct config name for encryption
ubifs: Fix build error without CONFIG_UBIFS_FS_XATTR
|
|
Merge yet more updates from Andrew Morton:
"A few final bits:
- large changes to vmalloc, yielding large performance benefits
- tweak the console-flush-on-panic code
- a few fixes"
* emailed patches from Andrew Morton <[email protected]>:
panic: add an option to replay all the printk message in buffer
initramfs: don't free a non-existent initrd
fs/writeback.c: use rcu_barrier() to wait for inflight wb switches going into workqueue when umount
mm/compaction.c: correct zone boundary handling when isolating pages from a pageblock
mm/vmap: add DEBUG_AUGMENT_LOWEST_MATCH_CHECK macro
mm/vmap: add DEBUG_AUGMENT_PROPAGATE_CHECK macro
mm/vmalloc.c: keep track of free blocks for vmap allocation
|