forked from u-boot/u-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
1,704 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# (C) Copyright 2015 UDOO Team | ||
# | ||
# SPDX-License-Identifier: GPL-2.0+ | ||
# | ||
|
||
obj- := __dummy__.o | ||
obj-y := trim.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (C) UDOO Team | ||
* | ||
* Author: Francesco Montefoschi <francesco.monte@gmail.com> | ||
* | ||
* SPDX-License-Identifier: GPL-2.0+ | ||
*/ | ||
|
||
#include <common.h> | ||
|
||
int isspace(char c) | ||
{ | ||
return (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\12'); | ||
} | ||
|
||
char *trim(char *str) | ||
{ | ||
char *end; | ||
|
||
// Trim leading space | ||
while(isspace(*str)) str++; | ||
|
||
if(*str == 0) // All spaces? | ||
return str; | ||
|
||
// Trim trailing space | ||
end = str + strlen(str) - 1; | ||
while(end > str && isspace(*end)) end--; | ||
|
||
// Write new null terminator | ||
*(end+1) = 0; | ||
|
||
return str; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
* Copyright (C) UDOO Team | ||
* | ||
* Author: Francesco Montefoschi <francesco.monte@gmail.com> | ||
* | ||
* SPDX-License-Identifier: GPL-2.0+ | ||
*/ | ||
|
||
int isspace(char c); | ||
char *trim(char *str); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
if TARGET_UDOO_NEO | ||
|
||
config SYS_VENDOR | ||
default "udoo" | ||
|
||
config SYS_BOARD | ||
default "neo" | ||
|
||
config SYS_CONFIG_NAME | ||
default "udoo_neo" | ||
|
||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
UDOO NEO BOARD | ||
M: Francesco Montefoschi <francesco.montefoschi@udoo.org> | ||
S: Maintained | ||
F: board/udoo/neo/ | ||
F: include/configs/udoo_neo.h | ||
F: configs/udoo_neo_defconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# (C) Copyright 2015 UDOO Team | ||
# | ||
# SPDX-License-Identifier: GPL-2.0+ | ||
# | ||
|
||
obj-y := neo.o detectboard.o | ||
obj-$(CONFIG_SPL_BUILD) += spl.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright (C) UDOO Team | ||
* | ||
* Author: Francesco Montefoschi <francesco.monte@gmail.com> | ||
* | ||
* SPDX-License-Identifier: GPL-2.0+ | ||
*/ | ||
|
||
#include <asm/arch/mx6-pins.h> | ||
#include <asm/gpio.h> | ||
#include <asm/imx-common/iomux-v3.h> | ||
#include "detectboard.h" | ||
|
||
#define DIO_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \ | ||
PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \ | ||
PAD_CTL_DSE_34ohm | PAD_CTL_HYS | PAD_CTL_SRE_FAST) | ||
#define DIO_PAD_CFG (MUX_PAD_CTRL(DIO_PAD_CTRL) | MUX_MODE_SION) | ||
|
||
|
||
#define GPIO_R184 IMX_GPIO_NR(4, 13) | ||
#define GPIO_R185 IMX_GPIO_NR(4, 0) | ||
iomux_v3_cfg_t const board_recognition_pads[] = { | ||
MX6_PAD_NAND_READY_B__GPIO4_IO_13 | DIO_PAD_CFG, // Connected to R184 | ||
MX6_PAD_NAND_ALE__GPIO4_IO_0 | DIO_PAD_CFG, // Connected to R185 | ||
}; | ||
|
||
/** | ||
* Detects the board model by checking the R184 and R185 resistors. | ||
* A mounted resistor (0Ohm) connects the GPIO to ground, so the | ||
* GPIO value will be 0. | ||
* | ||
* FULL - Eth, WiFi, motion sensors, 1GB RAM -> R184 not mounted - R185 mounted | ||
* EXTENDED - NO Eth, WiFi, motion sensors, 1GB RAM -> R184 not mounted - R185 not mounted | ||
* BASE - Eth, NO WiFi, NO motion sensors, 512MB RAM -> R184 mounted - R185 mounted | ||
* BASE KS - NO Eth, WiFi, NO motion sensors, 512MB RAM -> R184 mounted - R185 not mounted | ||
*/ | ||
int detect_board(void) | ||
{ | ||
imx_iomux_v3_setup_multiple_pads(board_recognition_pads, | ||
ARRAY_SIZE(board_recognition_pads)); | ||
|
||
gpio_direction_input(GPIO_R184); | ||
gpio_direction_input(GPIO_R185); | ||
|
||
int r184 = gpio_get_value(GPIO_R184); | ||
int r185 = gpio_get_value(GPIO_R185); | ||
|
||
if (r184 == 0 && r185 == 0) { | ||
return UDOO_NEO_TYPE_BASIC; | ||
} | ||
if (r184 == 0 && r185 == 1) { | ||
return UDOO_NEO_TYPE_BASIC_KS; | ||
} | ||
if (r184 == 1 && r185 == 0) { | ||
return UDOO_NEO_TYPE_FULL; | ||
} | ||
if (r184 == 1 && r185 == 1) { | ||
return UDOO_NEO_TYPE_EXTENDED; | ||
} | ||
|
||
return UDOO_NEO_TYPE_FULL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright (C) UDOO Team | ||
* | ||
* Author: Francesco Montefoschi <francesco.monte@gmail.com> | ||
* | ||
* SPDX-License-Identifier: GPL-2.0+ | ||
*/ | ||
|
||
#define UDOO_NEO_TYPE_BASIC 1 | ||
#define UDOO_NEO_TYPE_BASIC_KS 2 | ||
#define UDOO_NEO_TYPE_EXTENDED 3 | ||
#define UDOO_NEO_TYPE_FULL 4 | ||
|
||
int detect_board(void); |
Oops, something went wrong.
877b711
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the M4 loading handled through the device tree now?
877b711
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Device tree disables some devices (on A9) so that can be assigned to M4. U-Boot does not load the M4 firmware anymore, we have found that loading it after Linux booted is more stable.
877b711
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for clarification