#include <command.h>
#include <cros_ec.h>
#include <dm.h>
+#include <flash.h>
+#include <log.h>
#include <dm/device-internal.h>
#include <dm/uclass-internal.h>
* @param argv List of remaining parameters
* @return flash region (EC_FLASH_REGION_...) or -1 on error
*/
-static int cros_ec_decode_region(int argc, char * const argv[])
+static int cros_ec_decode_region(int argc, char *const argv[])
{
if (argc > 0) {
if (0 == strcmp(*argv, "rw"))
- return EC_FLASH_REGION_RW;
+ return EC_FLASH_REGION_ACTIVE;
else if (0 == strcmp(*argv, "ro"))
return EC_FLASH_REGION_RO;
* (negative EC_RES_...)
*/
static int do_read_write(struct udevice *dev, int is_write, int argc,
- char * const argv[])
+ char *const argv[])
{
uint32_t offset, size = -1U, region_size;
unsigned long addr;
return 0;
}
-static int do_cros_ec(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_cros_ec(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
struct udevice *dev;
const char *cmd;
}
printf("rows = %u\n", info.rows);
printf("cols = %u\n", info.cols);
- printf("switches = %#x\n", info.switches);
} else if (0 == strcmp("curimage", cmd)) {
enum ec_current_image image;
struct ec_response_vboot_hash hash;
int i;
- if (cros_ec_read_hash(dev, &hash)) {
+ if (cros_ec_read_hash(dev, EC_VBOOT_HASH_OFFSET_ACTIVE, &hash)) {
debug("%s: Could not read KBC hash\n", __func__);
return 1;
}
region = cros_ec_decode_region(argc - 2, argv + 2);
if (region == EC_FLASH_REGION_RO)
cmd = EC_REBOOT_JUMP_RO;
- else if (region == EC_FLASH_REGION_RW)
+ else if (region == EC_FLASH_REGION_ACTIVE)
cmd = EC_REBOOT_JUMP_RW;
else
return CMD_RET_USAGE;