summaryrefslogtreecommitdiff
path: root/board/ge
diff options
context:
space:
mode:
authorRobert Beckett <bob.beckett@collabora.com>2019-11-12 19:15:11 +0000
committerStefano Babic <sbabic@denx.de>2020-01-07 10:26:56 +0100
commit8c26739859c605d803b89f6ae202c6d29d2d2a54 (patch)
tree653e155453c8354c77ca7b3f6cebfd7c689dc1d1 /board/ge
parent010e58d448d5cb184fc53d6bbb87deee3ce5b223 (diff)
board: ge: bx50v3: sync devicetrees from Linux
Copy device trees from linux, keeping them as separate files for each board to ease future sync. Update board code to use generic bx50v3 dt initially, then select the specific dt based on board detection. Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
Diffstat (limited to 'board/ge')
-rw-r--r--board/ge/bx50v3/bx50v3.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c
index 2f6747b70a..5a5f6abb8e 100644
--- a/board/ge/bx50v3/bx50v3.c
+++ b/board/ge/bx50v3/bx50v3.c
@@ -32,12 +32,13 @@
#include <pwm.h>
#include <version.h>
#include <stdlib.h>
+#include <dm/root.h>
#include "../common/ge_common.h"
#include "../common/vpd_reader.h"
#include "../../../drivers/net/e1000.h"
DECLARE_GLOBAL_DATA_PTR;
-static int confidx = 3; /* Default to b850v3. */
+static int confidx; /* Default to generic. */
static struct vpd_cache vpd;
#define NC_PAD_CTRL (PAD_CTL_PUS_100K_UP | \
@@ -553,8 +554,16 @@ int board_init(void)
setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info3);
if (!read_vpd(&vpd, vpd_callback)) {
+ int ret, rescan;
+
vpd.is_read = true;
set_confidx(&vpd);
+
+ ret = fdtdec_resetup(&rescan);
+ if (!ret && rescan) {
+ dm_uninit();
+ dm_init_and_scan(false);
+ }
}
gpio_request(SUS_S3_OUT, "sus_s3_out");
@@ -729,3 +738,26 @@ U_BOOT_CMD(
"enable Bx50 backlight",
""
);
+
+int board_fit_config_name_match(const char *name)
+{
+ if (!vpd.is_read)
+ return strcmp(name, "imx6q-bx50v3");
+
+ switch (vpd.product_id) {
+ case VPD_PRODUCT_B450:
+ return strcmp(name, "imx6q-b450v3");
+ case VPD_PRODUCT_B650:
+ return strcmp(name, "imx6q-b650v3");
+ case VPD_PRODUCT_B850:
+ return strcmp(name, "imx6q-b850v3");
+ default:
+ return -1;
+ }
+}
+
+int embedded_dtb_select(void)
+{
+ vpd.is_read = false;
+ return fdtdec_setup();
+}