exynos/snow: move SPI GPIO setup to mainboard bootblock code
This moves GPIO setup from chip-specific SPI code to mainboard- specific bootblock code. This makes exynos_spi_open a bit more generic so it can eventually be used for any SPI channel. This also benefits CBFS since the user can set media->context to to any set of SPI registers. Change-Id: I2bcb9de370df0a79353c14b4d021b471ddebfacd Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: http://review.coreboot.org/2347 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
		
				
					committed by
					
						
						Ronald G. Minnich
					
				
			
			
				
	
			
			
			
						parent
						
							0f7b400f2e
						
					
				
				
					commit
					0b153bdda9
				
			@@ -81,20 +81,11 @@ static void exynos_spi_rx_tx(struct exynos_spi *regs, int todo,
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* set up SPI channel */
 | 
				
			||||||
int exynos_spi_open(struct exynos_spi *regs)
 | 
					int exynos_spi_open(struct exynos_spi *regs)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	/* set the spi1 GPIO */
 | 
						/* set the spi1 GPIO */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// TODO Some of these should be done in board's bootblock file.
 | 
					 | 
				
			||||||
	// We should fix-up the mainboard-specific vs. exynos-specific parts in a
 | 
					 | 
				
			||||||
	// follow-up CL.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//	exynos_pinmux_config(PERIPH_ID_SPI1, PINMUX_FLAG_NONE);
 | 
					 | 
				
			||||||
	gpio_cfg_pin(GPIO_A24, 0x2);
 | 
					 | 
				
			||||||
	gpio_cfg_pin(GPIO_A25, 0x2);
 | 
					 | 
				
			||||||
	gpio_cfg_pin(GPIO_A26, 0x2);
 | 
					 | 
				
			||||||
	gpio_cfg_pin(GPIO_A27, 0x2);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/* set pktcnt and enable it */
 | 
						/* set pktcnt and enable it */
 | 
				
			||||||
	writel(4 | SPI_PACKET_CNT_EN, ®s->pkt_cnt);
 | 
						writel(4 | SPI_PACKET_CNT_EN, ®s->pkt_cnt);
 | 
				
			||||||
	/* set FB_CLK_SEL */
 | 
						/* set FB_CLK_SEL */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,6 +30,7 @@
 | 
				
			|||||||
void bootblock_mainboard_init(void);
 | 
					void bootblock_mainboard_init(void);
 | 
				
			||||||
void bootblock_mainboard_init(void)
 | 
					void bootblock_mainboard_init(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						exynos_pinmux_config(PERIPH_ID_SPI1, PINMUX_FLAG_NONE);
 | 
				
			||||||
#if CONFIG_EARLY_CONSOLE
 | 
					#if CONFIG_EARLY_CONSOLE
 | 
				
			||||||
	exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
 | 
						exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
 | 
				
			||||||
	console_init();
 | 
						console_init();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user