intel/apollolake: Add helper routine for spi reg read
BUG=chrome-os-partner:54563 Change-Id: I56bc6b5292aec676103a436048abee8577edd961 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/15268 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
		@@ -75,4 +75,6 @@
 | 
			
		||||
 */
 | 
			
		||||
int spi_read_status(uint8_t *status);
 | 
			
		||||
 | 
			
		||||
/* Read SPI controller register. */
 | 
			
		||||
uint32_t spi_ctrlr_reg_read(uint16_t reg);
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -70,6 +70,12 @@ static uint32_t _spi_ctrlr_reg_read(struct spi_ctx *ctx, uint16_t reg)
 | 
			
		||||
	return read32((void *)addr);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t spi_ctrlr_reg_read(uint16_t reg)
 | 
			
		||||
{
 | 
			
		||||
	BOILERPLATE_CREATE_CTX(ctx);
 | 
			
		||||
	return _spi_ctrlr_reg_read(ctx, reg);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Write to register in the SPI controller. 'reg' is the register offset. */
 | 
			
		||||
static void _spi_ctrlr_reg_write(struct spi_ctx *ctx, uint16_t reg,
 | 
			
		||||
				 uint32_t val)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user