summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/zii-imx6q-rdu2/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/boards/zii-imx6q-rdu2/board.c')
-rw-r--r--arch/arm/boards/zii-imx6q-rdu2/board.c53
1 files changed, 25 insertions, 28 deletions
diff --git a/arch/arm/boards/zii-imx6q-rdu2/board.c b/arch/arm/boards/zii-imx6q-rdu2/board.c
index 63367a419a..88912a5108 100644
--- a/arch/arm/boards/zii-imx6q-rdu2/board.c
+++ b/arch/arm/boards/zii-imx6q-rdu2/board.c
@@ -1,17 +1,7 @@
-/*
- * Copyright (C) 2016 Zodiac Inflight Innovation
- * Author: Andrey Smirnov <andrew.smirnov@gmail.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2016 Zodiac Inflight Innovation
+
+/* Author: Andrey Smirnov <andrew.smirnov@gmail.com> */
#include <common.h>
#include <envfs.h>
@@ -19,8 +9,8 @@
#include <gpio.h>
#include <i2c/i2c.h>
#include <init.h>
-#include <mach/bbu.h>
-#include <mach/imx6.h>
+#include <mach/imx/bbu.h>
+#include <mach/imx/imx6.h>
#include <net.h>
#include <linux/nvmem-consumer.h>
#include "../zii-common/pn-fixup.h"
@@ -127,8 +117,11 @@ static int rdu2_devices_init(void)
{
struct i2c_client client;
- if (!of_machine_is_compatible("zii,imx6q-zii-rdu2") &&
- !of_machine_is_compatible("zii,imx6qp-zii-rdu2"))
+ if (of_machine_is_compatible("zii,imx6q-zii-rdu2"))
+ barebox_set_hostname("rdu2");
+ else if (of_machine_is_compatible("zii,imx6qp-zii-rdu2"))
+ barebox_set_hostname("rdu2p");
+ else
return 0;
client.adapter = i2c_get_adapter(1);
@@ -146,13 +139,13 @@ static int rdu2_devices_init(void)
i2c_write_reg(&client, 0x2e, &reg, 1);
}
- barebox_set_hostname("rdu2");
-
imx6_bbu_internal_spi_i2c_register_handler("SPI", "/dev/m25p0.barebox",
BBU_HANDLER_FLAG_DEFAULT);
imx6_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc3", 0);
+ imx6_bbu_internal_mmc_register_handler("SD", "/dev/mmc1", 0);
+ defaultenv_append_directory(defaultenv_zii_common);
defaultenv_append_directory(defaultenv_rdu2);
return 0;
@@ -161,7 +154,7 @@ device_initcall(rdu2_devices_init);
static int rdu2_fixup_egalax_ts(struct device_node *root, void *context)
{
- struct device_node *np;
+ struct device_node *np, *aliases;
/*
* The 32" unit has a EETI eGalax touchscreen instead of the
@@ -180,8 +173,12 @@ static int rdu2_fixup_egalax_ts(struct device_node *root, void *context)
return -ENODEV;
of_device_enable(np);
- of_property_write_u32(np->parent, "clock-frequency", 200000);
+ aliases = of_find_node_by_path_from(root, "/aliases");
+ if (!aliases)
+ return -ENODEV;
+
+ of_property_write_string(aliases, "touchscreen0", np->full_name);
return 0;
}
@@ -202,19 +199,19 @@ static int rdu2_fixup_dsa(struct device_node *root, void *context)
if (!switch_np)
return -ENODEV;
- np = of_find_node_by_name(switch_np, "port@2");
+ np = of_find_node_by_name_address(switch_np, "port@2");
if (!np)
return -ENODEV;
of_delete_node(np);
- np = of_find_node_by_name(root, "i210@0");
+ np = of_find_node_by_name_address(root, "i210@0");
if (!np)
return -ENODEV;
i210_handle = of_node_create_phandle(np);
- np = of_find_node_by_name(switch_np, "port@0");
+ np = of_find_node_by_name_address(switch_np, "port@0");
if (!np)
return -ENODEV;
@@ -268,7 +265,7 @@ static int rdu2_fixup_lvds(struct device_node *root,
/*
* LVDS panels need the correct timings
*/
- np = of_find_node_by_name(root, "panel");
+ np = of_find_node_by_name_address(root, "panel");
if (!np)
return -ENODEV;
@@ -283,7 +280,7 @@ static int rdu2_fixup_lvds(struct device_node *root,
* Delete all mode entries, which aren't suited for the
* current display
*/
- np = of_find_node_by_name(np, "display-timings");
+ np = of_find_node_by_name_address(np, "display-timings");
if (!np)
return -ENODEV;
@@ -308,7 +305,7 @@ static int rdu2_fixup_lvds(struct device_node *root,
if (fixup->type == IT_DUAL_LVDS)
of_set_property(np, "fsl,dual-channel", NULL, 0, 1);
- np = of_find_node_by_name(np, "lvds-channel@0");
+ np = of_find_node_by_name_address(np, "lvds-channel@0");
if (!np)
return -ENODEV;