1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-28 15:33:42 +02:00

5 Commits

Author SHA1 Message Date
Anastasia Klimchuk
4cc7363d25 ene_lpc.c: Untangle successful vs failed init paths
Exit label now serves as failed init path, it does cleanup and
returns 1, so it is renamed into init_err_exit.

Since all error paths return 1, and successful init is separated
from failure, there is no need to have ret variable anymore.

BUG=b:185191942
TEST=builds

Change-Id: Iac295f1353785cd73d7cb2f19e4a8cbb69beb576
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/52685
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-04-29 07:10:47 +00:00
Anastasia Klimchuk
04fff28b46 ene_lpc.c: Extract params check into a function
This allows char *p to become a local variable in check_params,
and it is allocated and freed within check_params function.
Which means init function does not need char *p anymore,
in particular does not need to free it - and this makes cleanup
after failed init easier.

As a good side effect, init function becomes easier to read.

BUG=b:185191942
TEST=builds

Change-Id: I7c3b6dea0edbc7547f0b307a0508c7d2b2a6d370
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/52684
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2021-04-28 15:12:08 +00:00
Anastasia Klimchuk
fbf3479c71 ene_lpc.c: Move register_shutdown to the end of initialisation
A bit more details: since register_shutdown has moved a few lines
below, now ene_enter_flash_mode is called before the shutdown function
is registered. ene_enter_flash_mode can fail (at least in theory,
it has some return 1s), but its return value is not analyzed, so even if
it returns non-0, execution goes further and register_shutdown will
happen anyway.

It is a separate question whether the return value of
ene_enter_flash_mode needs to be analyzed or is it ok to ignore it,
but in this patch I plan to keep the same behaviour, and probably I
will get back to error handling later.

This unlocks API change which plans to move register_shutdown inside
register master API, see https://review.coreboot.org/c/flashrom/+/51761

TEST=builds
BUG=b:185191942

Change-Id: If89a758c91c77486adbac2779449bcd71ab8fc78
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/52406
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2021-04-18 23:14:05 +00:00
Angel Pons
b4a63e9616 ene_lpc.c: Clean up cosmetics
Reflow long lines, drop unnecessary parentheses, add spaces after `if`
and `while` keywords and add braces to a single-statement `else if`
block that follows a multi-statement `if` block.

TEST=Build with `make distclean && make VERSION=none -j` with and
     without this patch, the flashrom executable does not change.

Change-Id: Iaa5277b12fca192c46c11f5e0f375dc43d06bf5c
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/52413
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
2021-04-18 17:07:26 +00:00
Victor Ding
436b4155b1 Add ENE LPC programmer
Initial support of ENE LPC interface keyboard controller.

BUG=b:156140422
BRANCH=none

Signed-off-by: Victor Ding <victording@google.com>
Change-Id: I970afd8c1bd92c159c60e09f22e2f18c0433729d
Reviewed-on: https://review.coreboot.org/c/flashrom/+/44580
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
2020-08-20 10:10:22 +00:00