Skip to contentSkip to conversation

cmd: cros_ec: Move crosec commands to cmd subdirectory

PATCH New Moritz Fischer 2 participants 3 messages Oct 3, 2016 – Oct 4, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd: cros_ec: Move crosec commands to cmd subdirectory

Move crosec commands from drivers/misc/cros_ec.c to cmd/cros_ec.c

Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Bin Meng <[email protected]>
Cc Miao Yan <[email protected]>
Cc Masahiro Yamada <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Nishanth Menon <[email protected]>
Cc u-boot at lists.denx.de
---
 cmd/Kconfig            |  12 ++
 cmd/Makefile           |   1 +
 cmd/cros_ec.c          | 366 +++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/misc/cros_ec.c | 348 ----------------------------------------------
 include/cros_ec.h      |  11 ++
 5 files changed, 390 insertions(+), 348 deletions(-)
 create mode 100644 cmd/cros_ec.c
cmd/Kconfig +12 -0
index 86554ea..141281f 100644
@@ -677,6 +677,18 @@ config CMD_TPM_TEST
 
 endmenu
 
+menu "Firmware commands"
+config CMD_CROS_EC
+	bool "Enable crosec command"
+	depends on CROS_EC
+	help
+	  Enable command-line access to the Chrome OS EC (Embedded
+	  Controller). This provides the 'crosec' command which has
+	  a number of sub-commands for performing EC tasks such as
+	  updating its flash, accessing a small saved context area
+	  and talking to the I2C bus behind the EC (if there is one).
+endmenu
+
 menu "Filesystem commands"
 config CMD_EXT2
 	bool "ext2 command support"
cmd/Makefile +1 -0
index 81b98ee..9c9a9d1 100644
@@ -128,6 +128,7 @@ obj-$(CONFIG_CMD_TRACE) += trace.o
 obj-$(CONFIG_HUSH_PARSER) += test.o
 obj-$(CONFIG_CMD_TPM) += tpm.o
 obj-$(CONFIG_CMD_TPM_TEST) += tpm_test.o
+obj-$(CONFIG_CMD_CROS_EC) += cros_ec.o
 obj-$(CONFIG_CMD_TSI148) += tsi148.o
 obj-$(CONFIG_CMD_UBI) += ubi.o
 obj-$(CONFIG_CMD_UBIFS) += ubifs.o
cmd/cros_ec.c new file +366 -0

366 lines not on this page · raw message

drivers/misc/cros_ec.c +0 -348

354 lines not on this page · raw message

include/cros_ec.h +11 -0
index 30b1908..ec7517c 100644
@@ -281,6 +281,17 @@ int cros_ec_flash_read(struct cros_ec_dev *dev, uint8_t *data, uint32_t offset,
 		    uint32_t size);
 
 /**
+ * Read back flash parameters
+ *
+ * This function reads back parameters of the flash as reported by the EC
+ *
+ * @param dev  Pointer to device
+ * @param info Pointer to output flash info struct
+ */
+int cros_ec_read_flashinfo(struct cros_ec_dev *dev,
+			  struct ec_response_flash_info *info);
+
+/**
  * Write data to the flash
  *
  * Write an arbitrary amount of data to the EC flash, by repeatedly writing
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 cmd: cros_ec: Move crosec commands to cmd subdirectory

Hi Moritz,

Quoted 14 lines · Moritz Fischer

Move crosec commands from drivers/misc/cros_ec.c to cmd/cros_ec.c

Cc Simon Glass <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Bin Meng <[email protected]>
Cc Miao Yan <[email protected]>
Cc Masahiro Yamada <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Nishanth Menon <[email protected]>
Cc u-boot at lists.denx.de
Quoted 8 lines
---
 cmd/Kconfig            |  12 ++
 cmd/Makefile           |   1 +
 cmd/cros_ec.c          | 366 +++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/misc/cros_ec.c | 348 ----------------------------------------------
 include/cros_ec.h      |  11 ++
 5 files changed, 390 insertions(+), 348 deletions(-)
 create mode 100644 cmd/cros_ec.c

But please see below.

cmd/Kconfig config CMD_TPM_TEST · line 683

Quoted 13 lines
cmd/Kconfig +4 -0
index 86554ea..141281f 100644
@@ -677,6 +677,18 @@ config CMD_TPM_TEST
 
 endmenu
 
+menu "Firmware commands"
+config CMD_CROS_EC
+       bool "Enable crosec command"
+       depends on CROS_EC

Can this be enabled by default if CROS_EC is enabled? At present I think your change will disable it.

e.g.

default y

Quoted 8 lines
cmd/Kconfig +8 -0
+       help
+         Enable command-line access to the Chrome OS EC (Embedded
+         Controller). This provides the 'crosec' command which has
+         a number of sub-commands for performing EC tasks such as
+         updating its flash, accessing a small saved context area
+         and talking to the I2C bus behind the EC (if there is one).
+endmenu
+
#2 lore raw

PATCH 1/1 cmd: cros_ec: Move crosec commands to cmd subdirectory

Hi Simon,

Quoted 7 lines · Simon Glass

cmd/Kconfig config CMD_TPM_TEST · line 683

Quoted 4 lines
cmd/Kconfig +4 -0
+menu "Firmware commands"
+config CMD_CROS_EC
+       bool "Enable crosec command"
+       depends on CROS_EC

Can this be enabled by default if CROS_EC is enabled? At present I think your change will disable it.

Will send a v2 in a bit. Thanks for the review

Moritz