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

LC15: make board detection work even without DRAM

zero variables (.bss) go to DRAM, non-zero (.data) go to SRAM in MLO.
parent 3bdf57ab
......@@ -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");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment