[coreboot-gerrit] Change in coreboot[master]: soc/intel/common/block: Add Intel common FAST_SPI code

Barnali Sarkar (Code Review) gerrit at coreboot.org
Tue Apr 25 11:46:03 CEST 2017


Barnali Sarkar has posted comments on this change. ( https://review.coreboot.org/18557 )

Change subject: soc/intel/common/block: Add Intel common FAST_SPI code
......................................................................


Patch Set 30:

(9 comments)

https://review.coreboot.org/#/c/18557/30/src/soc/intel/common/block/fast_spi/fast_spi.c
File src/soc/intel/common/block/fast_spi/fast_spi.c:

PS30, Line 75: -
> space around -
ok


https://review.coreboot.org/#/c/18557/28/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
File src/soc/intel/common/block/fast_spi/fast_spi_flash.c:

PS28, Line 53: uint32_t bar;
             : 
             : 	/* FIXME: use device definition */
             : 	ctx->pci_dev = PCH_DEV_SPI;
             : 
             : 	bar = pci_read_config32(ctx->pci_dev, PCI_BASE_ADDRESS_0);
             : 	ctx->mmio_base = bar & ~PCI_BASE_ADDRESS_MEM_ATTR_MASK;
> If we really wanted we could expose it in the internal header defs.h.
ok, will fix


PS28, Line 101: static size_t fill_xfer_fifo(struct fast_spi_flash_ctx *ctx, const void *data,
              : 			   size_t len)
              : {
              : 	len = min(len, SPIBAR_FDATA_FIFO_SIZE);
              : 
              : 	/* YES! memcpy() works. FDATAn does not require 32-bit accesses. */
              : 	memcpy((void *)(ctx->mmio_base + SPIBAR_FDATA(0)), data, len);
              : 	return len;
              : }
              : 
              : /* Drain FDATAn FIFO after a read transaction populates data. */
              : static size_t drain_xfer_fifo(struct fast_spi_flash_ctx *ctx, void *dest,
              : 				size_t len)
              : {
              : 	len = min(len, SPIBAR_FDATA_FIFO_SIZE);
              : 
              : 	/* YES! memcpy() works. FDATAn does not require 32-bit accesses. */
              : 	
> Right. In that case, we can just skip the min(..) as well.
Thats correct. Will change the functions accordingly.


https://review.coreboot.org/#/c/18557/30/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
File src/soc/intel/common/block/fast_spi/fast_spi_flash.c:

PS30, Line 51: _get_fast_spi_flash_ctx
> It would be better to use consistent naming conventions: _fast_spi_flash_ge
ok


PS30, Line 55: FIXME: use device definition 
> I'm confused about this fixme. What's wrong?
it was an old comment taken forwarded. will remove this comment.


PS30, Line 58: bar
> assert if bar is 0.
ok, will fix


PS30, Line 91: read_fast_spi_flash_sfdp_param
> fast_spi_flash_read_sfdp_param
ok


Line 312: struct spi_flash *spi_flash_programmer_probe(struct spi_slave *dev, int force)
> Furquan will fix this up w/ his patches.
ok


PS30, Line 325: 0x04
> Should this be fixed? :)
will fix


-- 
To view, visit https://review.coreboot.org/18557
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I046e3b30c8efb172851dd17f49565c9ec4cb38cb
Gerrit-PatchSet: 30
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Barnali Sarkar <barnali.sarkar at intel.com>
Gerrit-Reviewer: Aamir Bohra <aamir.bohra at intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin at chromium.org>
Gerrit-Reviewer: Balaji Manigandan <balaji.manigandan at intel.com>
Gerrit-Reviewer: Barnali Sarkar <barnali.sarkar at intel.com>
Gerrit-Reviewer: Furquan Shaikh <furquan at google.com>
Gerrit-Reviewer: Hannah Williams <hannah.williams at intel.com>
Gerrit-Reviewer: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: Pratikkumar Prajapati <pratikkumar.v.prajapati at intel.corp-partner.google.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik at intel.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik at intel.corp-partner.google.com>
Gerrit-Reviewer: Sumeet R Pawnikar <sumeet.r.pawnikar at intel.com>
Gerrit-Reviewer: build bot (Jenkins)
Gerrit-HasComments: Yes



More information about the coreboot-gerrit mailing list