drivers/spi: support cmd opcode deduction for spi_crop_chunk()

spi_crop_chunk() currently supports deducting the command length
when determining maximum payload size in a transaction. Add support
for deducting just the opcode part of the command by replacing
deduct_cmd_len field to generic flags field. The two enums supported
drive the logic within spi_crop_chunk():
  SPI_CNTRLR_DEDUCT_CMD_LEN
  SPI_CNTRLR_DEDUCT_OPCODE_LEN

All existing users of deduct_cmd_len were converted to using the
flags field.

BUG=b:65485690

Change-Id: I771fba684f0ed76ffdc8573aa10f775070edc691
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/23491
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Justin TerAvest <teravest@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Aaron Durbin
2018-01-29 11:30:17 -07:00
parent 3c0d7cfb94
commit 1fcc9f3125
7 changed files with 27 additions and 9 deletions

View File

@ -290,7 +290,6 @@ BOOT_STATE_INIT_ENTRY(BS_DEV_INIT, BS_ON_ENTRY, spi_init_cb, NULL);
const struct spi_ctrlr spi_driver = {
.xfer = xfer,
.max_xfer_size = 64,
.deduct_cmd_len = false,
};
const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {