Commit f02d28c6 authored by notaz's avatar notaz Committed by H. Nikolaus Schaller
Browse files

LC15: make board detection work even without DRAM

zero variables (.bss) go to DRAM, non-zero (.data) go to SRAM in MLO.
parent 3bdf57ab
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -68,8 +68,10 @@ static const int versions[]={

static int get_board_version(void)
{ /* read get board version from resistors */
	static int vers;
	if (!vers) {
	/* careful with static variables:
	 * zero vars go to DRAM, which may be not initialized yet in MLO! */
	static int vers = -1;
	if (vers == -1) {
		gpio_request(32, "R32");	/* version resistors */
		gpio_request(33, "R33");
		gpio_direction_input(32);