Add support for SoM rev 1.5 to mx6cuboxi

This commit is contained in:
Peter Robinson 2018-03-04 13:39:54 +00:00
parent d61be86375
commit f59d42b013
3 changed files with 109 additions and 244 deletions

View File

@ -1,240 +0,0 @@
From f349c5dc5ca2af90e026135b807668444ff23d84 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Mon, 6 Mar 2017 09:28:37 +0000
Subject: [PATCH 1/2] Initial Hummingboard 2 support
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
board/solidrun/mx6cuboxi/mx6cuboxi.c | 118 +++++++++++++++++++++++++++--------
1 file changed, 92 insertions(+), 26 deletions(-)
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c
index 285588d..5b187ff 100644
--- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
+++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
@@ -37,6 +37,15 @@
DECLARE_GLOBAL_DATA_PTR;
+enum {
+ CUBOX,
+ HB1,
+ HB2,
+ HB2r15,
+};
+
+static int board_type;
+
#define UART_PAD_CTRL (PAD_CTL_PUS_100K_UP | \
PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \
PAD_CTL_SRE_FAST | PAD_CTL_HYS)
@@ -48,6 +57,9 @@ DECLARE_GLOBAL_DATA_PTR;
#define ENET_PAD_CTRL (PAD_CTL_PUS_100K_UP | \
PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS)
+#define ENET_PAD_CTRL_OD (PAD_CTL_PUS_100K_UP | \
+ PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS | PAD_CTL_ODE)
+
#define ENET_PAD_CTRL_PD (PAD_CTL_PUS_100K_DOWN | \
PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS)
@@ -79,8 +91,11 @@ static iomux_v3_cfg_t const usdhc2_pads[] = {
static iomux_v3_cfg_t const hb_cbi_sense[] = {
/* These pins are for sensing if it is a CuBox-i or a HummingBoard */
- IOMUX_PADS(PAD_KEY_ROW1__GPIO4_IO09 | MUX_PAD_CTRL(UART_PAD_CTRL)),
- IOMUX_PADS(PAD_EIM_DA4__GPIO3_IO04 | MUX_PAD_CTRL(UART_PAD_CTRL)),
+ IOMUX_PADS(PAD_KEY_ROW1__GPIO4_IO09 | MUX_PAD_CTRL(UART_PAD_CTRL)),
+ IOMUX_PADS(PAD_EIM_DA4__GPIO3_IO04 | MUX_PAD_CTRL(UART_PAD_CTRL)),
+ IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | MUX_PAD_CTRL(UART_PAD_CTRL)),
+ IOMUX_PADS(PAD_CSI0_DAT14__GPIO6_IO00 | MUX_PAD_CTRL(UART_PAD_CTRL)),
+ IOMUX_PADS(PAD_CSI0_DAT18__GPIO6_IO04 | MUX_PAD_CTRL(UART_PAD_CTRL)),
};
static iomux_v3_cfg_t const usb_pads[] = {
@@ -92,8 +107,9 @@ static void setup_iomux_uart(void)
SETUP_IOMUX_PADS(uart1_pads);
}
-static struct fsl_esdhc_cfg usdhc_cfg[1] = {
+static struct fsl_esdhc_cfg usdhc_cfg[2] = {
{USDHC2_BASE_ADDR},
+ {USDHC3_BASE_ADDR},
};
int board_mmc_getcd(struct mmc *mmc)
@@ -103,16 +119,40 @@ int board_mmc_getcd(struct mmc *mmc)
int board_mmc_init(bd_t *bis)
{
- SETUP_IOMUX_PADS(usdhc2_pads);
- usdhc_cfg[0].esdhc_base = USDHC2_BASE_ADDR;
- usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
- gd->arch.sdhc_clk = usdhc_cfg[0].sdhc_clk;
+ int ret;
+ u32 index = 0;
+
+ for (index = 0; index < CONFIG_SYS_FSL_USDHC_NUM; ++index) {
+ switch (index) {
+ case 0:
+ SETUP_IOMUX_PADS(usdhc2_pads);
+ usdhc_cfg[0].esdhc_base = USDHC2_BASE_ADDR;
+ usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
+ gd->arch.sdhc_clk = usdhc_cfg[0].sdhc_clk;
+ break;
+ case 1:
+ SETUP_IOMUX_PADS(usdhc3_pads);
+ usdhc_cfg[1].esdhc_base = USDHC3_BASE_ADDR;
+ usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
+ gd->arch.sdhc_clk = usdhc_cfg[1].sdhc_clk;
+ break;
+ default:
+ printf("Warning: you configured more USDHC controllers"
+ "(%d) then supported by the board (%d)\n",
+ index + 1, CONFIG_SYS_FSL_USDHC_NUM);
+ return -EINVAL;
+ }
- return fsl_esdhc_initialize(bis, &usdhc_cfg[0]);
+ ret = fsl_esdhc_initialize(bis, &usdhc_cfg[index]);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
}
static iomux_v3_cfg_t const enet_pads[] = {
- IOMUX_PADS(PAD_ENET_MDIO__ENET_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL)),
+ IOMUX_PADS(PAD_ENET_MDIO__ENET_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL_OD)),
IOMUX_PADS(PAD_ENET_MDC__ENET_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL)),
/* AR8035 reset */
IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | MUX_PAD_CTRL(ENET_PAD_CTRL_PD)),
@@ -328,41 +368,62 @@ int board_init(void)
return 0;
}
-static bool is_hummingboard(void)
+static int is_hummingboard(void)
{
- int val1, val2;
+ int val1, val2, val3, val4, val5;
SETUP_IOMUX_PADS(hb_cbi_sense);
gpio_direction_input(IMX_GPIO_NR(4, 9));
gpio_direction_input(IMX_GPIO_NR(3, 4));
+ gpio_direction_input(IMX_GPIO_NR(2, 8));
+ gpio_direction_input(IMX_GPIO_NR(6, 0));
+ gpio_direction_input(IMX_GPIO_NR(6, 4));
val1 = gpio_get_value(IMX_GPIO_NR(4, 9));
val2 = gpio_get_value(IMX_GPIO_NR(3, 4));
+ val3 = gpio_get_value(IMX_GPIO_NR(2, 8));
+ val4 = gpio_get_value(IMX_GPIO_NR(6, 0));
+ val5 = gpio_get_value(IMX_GPIO_NR(6, 4));
/*
* Machine selection -
- * Machine val1, val2
- * -------------------------
- * HB rev 3.x x 0
- * CBi 0 1
- * HB 1 1
+ * Machine val1, val2, val3
+ * -------------------------------
+ * HB2 x x 0
+ * HB rev 3.x x 0 x
+ * CBi 0 1 x
+ * HB 1 1 x
*/
- if (val2 == 0)
- return true;
- else if (val1 == 0)
- return false;
- else
- return true;
+ if (val3 == 0) {
+ board_type = HB2;
+ } else if (val2 == 0) {
+ board_type = HB1;
+ } else if (val1 == 0) {
+ board_type = CUBOX;
+ } else {
+ board_type = HB1;
+ }
+
+ if (val4 == 1 && val5 == 0)
+ board_type = HB2r15;
+
+ return board_type;
+
}
int checkboard(void)
{
- if (is_hummingboard())
+ switch (board_type) {
+ case HB2:
+ case HB2r15:
+ puts("Board: MX6 Hummingboard 2\n");
+ case HB1:
puts("Board: MX6 Hummingboard\n");
- else
+ case CUBOX:
puts("Board: MX6 Cubox-i\n");
+ }
return 0;
}
@@ -370,10 +431,15 @@ int checkboard(void)
int board_late_init(void)
{
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
- if (is_hummingboard())
+ switch (board_type) {
+ case HB2:
+ case HB2r15:
+ setenv("board_name", "HUMMINGBOARD2");
+ case HB1:
setenv("board_name", "HUMMINGBOARD");
- else
+ case CUBOX:
setenv("board_name", "CUBOXI");
+ }
if (is_mx6dq())
setenv("board_rev", "MX6Q");
--
2.9.3
From 039d4ce71df224d36f857519cc7a7f56568a75c3 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Mon, 6 Mar 2017 11:26:21 +0000
Subject: [PATCH 2/2] drop mmc init for the moment
---
board/solidrun/mx6cuboxi/mx6cuboxi.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c
index 5b187ff..50dcc09 100644
--- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
+++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
@@ -130,12 +130,6 @@ int board_mmc_init(bd_t *bis)
usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
gd->arch.sdhc_clk = usdhc_cfg[0].sdhc_clk;
break;
- case 1:
- SETUP_IOMUX_PADS(usdhc3_pads);
- usdhc_cfg[1].esdhc_base = USDHC3_BASE_ADDR;
- usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
- gd->arch.sdhc_clk = usdhc_cfg[1].sdhc_clk;
- break;
default:
printf("Warning: you configured more USDHC controllers"
"(%d) then supported by the board (%d)\n",
--
2.9.3

View File

@ -0,0 +1,104 @@
From 6f617cf4eeb14eceecfac499c723753ab1dded54 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Sun, 4 Mar 2018 13:27:10 +0000
Subject: [PATCH] mx6cuboxi: add support for detecting Revision 1.5 SoMs
Solid Run have a rev 1.5 SoM with different a different WiFi/BT module and some
other changes. Their downstream commit 99e18b7f14 adds support for detecting
this new SoM revision. This adds that support and sets up the new
device tree naming that landed in the linux 4.16 kernel.
Tested on a Hummingboard2 Gate.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
board/solidrun/mx6cuboxi/mx6cuboxi.c | 30 +++++++++++++++++++++++++++---
include/configs/mx6cuboxi.h | 12 ++++++------
2 files changed, 33 insertions(+), 9 deletions(-)
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c
index ee9e4f7c01..bea6275b78 100644
--- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
+++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
@@ -79,9 +79,11 @@ static iomux_v3_cfg_t const usdhc2_pads[] = {
};
static iomux_v3_cfg_t const hb_cbi_sense[] = {
- /* These pins are for sensing if it is a CuBox-i or a HummingBoard */
- IOMUX_PADS(PAD_KEY_ROW1__GPIO4_IO09 | MUX_PAD_CTRL(UART_PAD_CTRL)),
- IOMUX_PADS(PAD_EIM_DA4__GPIO3_IO04 | MUX_PAD_CTRL(UART_PAD_CTRL)),
+ /* These pins are for sensing if it is a CuBox-i, HummingBoard(2) and SoM rev */
+ IOMUX_PADS(PAD_KEY_ROW1__GPIO4_IO09 | MUX_PAD_CTRL(UART_PAD_CTRL)),
+ IOMUX_PADS(PAD_EIM_DA4__GPIO3_IO04 | MUX_PAD_CTRL(UART_PAD_CTRL)),
+ IOMUX_PADS(PAD_CSI0_DAT14__GPIO6_IO00 | MUX_PAD_CTRL(UART_PAD_CTRL)),
+ IOMUX_PADS(PAD_CSI0_DAT18__GPIO6_IO04 | MUX_PAD_CTRL(UART_PAD_CTRL)),
};
static iomux_v3_cfg_t const usb_pads[] = {
@@ -390,6 +392,25 @@ static bool is_hummingboard2(void)
return false;
}
+static bool is_som_rev15(void)
+{
+ int val1;
+ int val2;
+
+ SETUP_IOMUX_PADS(hb_cbi_sense);
+
+ gpio_direction_input(IMX_GPIO_NR(6, 0));
+ gpio_direction_input(IMX_GPIO_NR(6, 4));
+
+ val1 = gpio_get_value(IMX_GPIO_NR(6, 0));
+ val2 = gpio_get_value(IMX_GPIO_NR(6, 4));
+
+ if (val1 == 1 && val2 == 0)
+ return true;
+ else
+ return false;
+}
+
int checkboard(void)
{
if (is_hummingboard2())
@@ -412,6 +433,9 @@ int board_late_init(void)
else
env_set("board_name", "CUBOXI");
+ if (is_som_rev15())
+ env_set("som_rev", "-som-v15");
+
if (is_mx6dq())
env_set("board_rev", "MX6Q");
else
diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h
index 0e1d18cad8..076fd2c40e 100644
--- a/include/configs/mx6cuboxi.h
+++ b/include/configs/mx6cuboxi.h
@@ -104,17 +104,17 @@
"fi\0" \
"findfdt="\
"if test $board_name = HUMMINGBOARD2 && test $board_rev = MX6Q ; then " \
- "setenv fdtfile imx6q-hummingboard2.dtb; fi; " \
+ "setenv fdtfile imx6q-hummingboard2${som_rev}.dtb; fi; " \
"if test $board_name = HUMMINGBOARD2 && test $board_rev = MX6DL ; then " \
- "setenv fdtfile imx6dl-hummingboard2.dtb; fi; " \
+ "setenv fdtfile imx6dl-hummingboard2${som_rev}.dtb; fi; " \
"if test $board_name = HUMMINGBOARD && test $board_rev = MX6Q ; then " \
- "setenv fdtfile imx6q-hummingboard.dtb; fi; " \
+ "setenv fdtfile imx6q-hummingboard${som_rev}.dtb; fi; " \
"if test $board_name = HUMMINGBOARD && test $board_rev = MX6DL ; then " \
- "setenv fdtfile imx6dl-hummingboard.dtb; fi; " \
+ "setenv fdtfile imx6dl-hummingboard${som_rev}.dtb; fi; " \
"if test $board_name = CUBOXI && test $board_rev = MX6Q ; then " \
- "setenv fdtfile imx6q-cubox-i.dtb; fi; " \
+ "setenv fdtfile imx6q-cubox-i${som_rev}.dtb; fi; " \
"if test $board_name = CUBOXI && test $board_rev = MX6DL ; then " \
- "setenv fdtfile imx6dl-cubox-i.dtb; fi; " \
+ "setenv fdtfile imx6dl-cubox-i${som_rev}.dtb; fi; " \
"if test $fdtfile = undefined; then " \
"echo WARNING: Could not determine dtb to use; fi; \0" \
BOOTENV
--
2.14.3

View File

@ -2,7 +2,7 @@
Name: uboot-tools Name: uboot-tools
Version: 2018.03 Version: 2018.03
Release: 0.7%{?candidate:.%{candidate}}%{?dist} Release: 0.8%{?candidate:.%{candidate}}%{?dist}
Summary: U-Boot utilities Summary: U-Boot utilities
License: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+ License: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+
URL: http://www.denx.de/wiki/U-Boot URL: http://www.denx.de/wiki/U-Boot
@ -24,16 +24,14 @@ Patch4: Add-fix-for-Pine64-gigabit-throughput-issues.patch
Patch5: imx-spl-Partially-revert-spl-eMMC-SD-Provide.patch Patch5: imx-spl-Partially-revert-spl-eMMC-SD-Provide.patch
Patch6: rk33xx-make_fit_atf-fix.patch Patch6: rk33xx-make_fit_atf-fix.patch
Patch7: rk33xx-enable-make-itb.patch Patch7: rk33xx-enable-make-itb.patch
Patch8: mx6cuboxi-add-support-for-detecting-Revision-1.5-SoM.patch
# Board fixes and enablement # Board fixes and enablement
#Patch10: db-generic-fixes.patch #Patch10: db-generic-fixes.patch
#Patch11: db410c-fixes.patch #Patch11: db410c-fixes.patch
#Patch12: db820c-support.patch #Patch12: db820c-support.patch
#Patch13: dragonboard-fixes.patch #Patch13: dragonboard-fixes.patch
#Patch14: Rpi-Add-support-for-second-sd-host-controller.patch
#Patch15: RPi-Properly-handle-dynamic-serial-configuration.patch
# Patch14: mvebu-enable-generic-distro-boot-config.patch # Patch14: mvebu-enable-generic-distro-boot-config.patch
# Patch15: mx6-Initial-Hummingboard-2-support.patch
BuildRequires: bc BuildRequires: bc
BuildRequires: dtc BuildRequires: dtc
@ -292,6 +290,9 @@ cp -p board/warp7/README builds/docs/README.warp7
%endif %endif
%changelog %changelog
* Sun Mar 4 2018 Peter Robinson <pbrobinson@fedoraproject.org> 2018.03-0.8.rc3
- Add support for SoM rev 1.5 to mx6cuboxi
* Sun Feb 25 2018 Peter Robinson <pbrobinson@fedoraproject.org> 2018.03-0.7.rc3 * Sun Feb 25 2018 Peter Robinson <pbrobinson@fedoraproject.org> 2018.03-0.7.rc3
- Build 64 bit Rockchips FIT images with ARM Trusted Firmware - Build 64 bit Rockchips FIT images with ARM Trusted Firmware