diff options
author | Joel Stanley <joel@jms.id.au> | 2016-11-03 12:31:53 +1030 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2016-11-04 11:08:15 +1030 |
commit | e0209488390f8aca0367446128182d84de8d401b (patch) | |
tree | 9f4cd450552073a60e948af047aefbde533fc62f /op-flasher/flasher_obj.c | |
parent | 7ba4172dadeb928d30f4242199b80791883020d7 (diff) | |
download | talos-skeleton-e0209488390f8aca0367446128182d84de8d401b.tar.gz talos-skeleton-e0209488390f8aca0367446128182d84de8d401b.zip |
flasher: Use BMC_MTD to represent bmc
We were using a boolean to say "yep, we're talking to the BMC flash".
Use the enum that is provided by libflash to do this.
Change-Id: If40ac3ee64c0827693c93c64ea18a0a34ef79a46
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'op-flasher/flasher_obj.c')
-rw-r--r-- | op-flasher/flasher_obj.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/op-flasher/flasher_obj.c b/op-flasher/flasher_obj.c index 984565c..c87b305 100644 --- a/op-flasher/flasher_obj.c +++ b/op-flasher/flasher_obj.c @@ -202,13 +202,13 @@ flash_access_setup_pnor(void) } uint8_t -flash(FlashControl* flash_control,bool bmc_flash, uint32_t address, char* write_file, char* obj_path) +flash(FlashControl* flash_control, enum bmc_access chip, uint32_t address, char* write_file, char* obj_path) { int rc; - printf("flasher: %s, BMC = %d, address = 0x%x\n",write_file,bmc_flash,address); + printf("flasher: %s, BMC = %d, address = 0x%x\n", write_file, chip, address); /* Prepare for access */ - if(bmc_flash) { + if(chip == BMC_MTD) { rc = flash_access_setup_bmc(); if(rc) { return FLASH_SETUP_ERROR; @@ -278,21 +278,21 @@ on_bus_acquired(GDBusConnection *connection, /* Export all objects */ g_dbus_object_manager_server_set_connection(manager, connection); - bool bmc_flash = false; + enum bmc_access chip = PNOR_MTD; uint32_t address = 0; if(strcmp(cmd->argv[1],"bmc")==0) { - bmc_flash = true; + chip = BMC_MTD; } if(strcmp(cmd->argv[1],"bmc_ramdisk")==0) { - bmc_flash = true; + chip = BMC_MTD; address = 0x20300000; } if(strcmp(cmd->argv[1],"bmc_kernel")==0) { - bmc_flash = true; + chip = BMC_MTD; address = 0x20080000; } - int rc = flash(flash_control,bmc_flash,address,cmd->argv[2],cmd->argv[3]); + int rc = flash(flash_control, chip, address, cmd->argv[2], cmd->argv[3]); if(rc) { flash_message(connection,cmd->argv[3],"error","Flash Error"); } else { |