Commit 6bd209d9 authored by Alessandro Rubini's avatar Alessandro Rubini

shell: remove "init purge" command

The command is not documented, and it looks like is not useful either
(I understand it has been useful when setting up the init area initially)
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent f18a45d1
......@@ -256,26 +256,6 @@ int8_t eeprom_init_erase(uint8_t i2cif, uint8_t i2c_addr)
return used;
}
int8_t eeprom_init_purge(uint8_t i2cif, uint8_t i2c_addr)
{
uint16_t used = 0xffff, i;
uint16_t pattern = 0xff;
if (eeprom_read(i2cif, i2c_addr, EE_BASE_INIT, (uint8_t *) & used,
sizeof(used)) != sizeof(used))
return EE_RET_I2CERR;
if (used == 0xffff)
used = 0;
for (i = 0; i < used; ++i)
eeprom_write(i2cif, i2c_addr, EE_BASE_INIT + sizeof(used) + i,
(uint8_t *) & pattern, 1);
used = 0xffff;
eeprom_write(i2cif, i2c_addr, EE_BASE_INIT, (uint8_t *) & used, 2);
return used;
}
/*
* Appends a new shell command at the end of boot script
*/
......
......@@ -45,6 +45,5 @@ int8_t eeprom_init_readcmd(uint8_t i2cif, uint8_t i2c_addr, uint8_t *buf,
int32_t eeprom_get_sfp(uint8_t i2cif, uint8_t i2c_addr, struct s_sfpinfo * sfp,
uint8_t add, uint8_t pos);
int8_t eeprom_init_purge(uint8_t i2cif, uint8_t i2c_addr);
#endif
......@@ -24,8 +24,6 @@ static int cmd_init(const char *args[])
if (args[0] && !strcasecmp(args[0], "erase")) {
if (eeprom_init_erase(WRPC_FMC_I2C, FMC_EEPROM_ADR) < 0)
mprintf("Could not erase init script\n");
} else if (args[0] && !strcasecmp(args[0], "purge")) {
eeprom_init_purge(WRPC_FMC_I2C, FMC_EEPROM_ADR);
} else if (args[1] && !strcasecmp(args[0], "add")) {
if (eeprom_init_add(WRPC_FMC_I2C, FMC_EEPROM_ADR, args) < 0)
mprintf("Could not add the command\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment