1. 28 4月, 2020 2 次提交
    • R
      tools: fw_env: use erasesize from MEMGETINFO ioctl · e282c422
      Rasmus Villemoes 提交于
      We have a board with several revisions. The older ones use a nor flash
      with 64k erase size, while the newer have a flash with 4k sectors. The
      environment size is 8k.
      
      Currently, we have to put a column containing 0x10000 (64k) in
      fw_env.config in order for it to work on the older boards. But that
      ends up wasting quite a lot of time on the newer boards that could
      just erase the 8k occupied by the environment - strace says the 64k
      erase takes 0.405 seconds. With this patch, as expected, that's about
      an 8-fold better, at 0.043 seconds.
      
      Having different fw_env.config files for the different revisions is
      highly impractical, and the correct information is already available
      right at our fingertips. So use the erasesize returned by the
      MEMGETINFO ioctl when the fourth and fifth columns (sector size and
      #sectors, respectively) are absent or contain 0, a case where the
      logic previously used to use the environment size as erase size (and
      consequently computed ENVSECTORS(dev) as 1).
      
      As I'm only testing this on a NOR flash, I'm only changing the logic
      for that case, though I think it should be possible for the other
      types as well.
      Signed-off-by: NRasmus Villemoes <rasmus.villemoes@prevas.dk>
      e282c422
    • E
      CMD: random: fix return code · 5f2c4e01
      Eugeniy Paltsev 提交于
      As of today 'random' command return 1 (CMD_RET_FAILURE) in case
      of successful execution and 0 (CMD_RET_SUCCESS) in case of bad
      arguments. Fix that.
      
      NOTE: we remove printing usage information from command body
      so it won't print twice.
      Signed-off-by: NEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      5f2c4e01
  2. 27 4月, 2020 3 次提交
  3. 25 4月, 2020 35 次提交