Update sunxi MMC patch series, Tegra Nyan patch, SolidRun i.MX6 SoM rev 1.5 patch

This commit is contained in:
Peter Robinson 2018-06-08 04:35:34 +01:00
parent 5eae64808d
commit 177a339959
5 changed files with 557 additions and 191 deletions

View File

@ -1,104 +0,0 @@
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

@ -0,0 +1,371 @@
From patchwork Thu Jun 7 13:17:36 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,
1/2] mx6cuboxi: consolidate board detection and add som revision
checking
X-Patchwork-Submitter: Baruch Siach <baruch@tkos.co.il>
X-Patchwork-Id: 926302
Message-Id: <6b1adde9ae6b6208044619cc0f2b5335f9233326.1528377457.git.baruch@tkos.co.il>
To: Fabio Estevam <fabio.estevam@nxp.com>,
Stefano Babic <sbabic@denx.de>
Cc: u-boot@lists.denx.de, Baruch Siach <baruch@tkos.co.il>
Date: Thu, 7 Jun 2018 16:17:36 +0300
From: Baruch Siach <baruch@tkos.co.il>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
From: Jon Nettleton <jon@solid-run.com>
In order to properly detect the board the checks need to be done
in a specific order. Move these tests back into a single enum
function that will always return the proper the board it is checking.
This also adds the best test we have for detecting the rev 1.5 som,
and it simplifies the device-tree filename building.
Signed-off-by: Jon Nettleton <jon@solid-run.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
---
board/solidrun/mx6cuboxi/mx6cuboxi.c | 136 +++++++++++++++++----------
include/configs/mx6cuboxi.h | 24 ++---
2 files changed, 98 insertions(+), 62 deletions(-)
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c
index 1fb3c69edeb5..1567cf0c91af 100644
--- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
+++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
@@ -57,6 +57,13 @@ DECLARE_GLOBAL_DATA_PTR;
#define ETH_PHY_RESET IMX_GPIO_NR(4, 15)
#define USB_H1_VBUS IMX_GPIO_NR(1, 0)
+enum board_type {
+ CUBOXI = 0x00,
+ HUMMINGBOARD = 0x01,
+ HUMMINGBOARD2 = 0x02,
+ UNKNOWN = 0x03,
+};
+
int dram_init(void)
{
gd->ram_size = imx_ddr_size();
@@ -77,10 +84,17 @@ static iomux_v3_cfg_t const usdhc2_pads[] = {
IOMUX_PADS(PAD_SD2_DAT3__SD2_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
};
-static iomux_v3_cfg_t const hb_cbi_sense[] = {
+static iomux_v3_cfg_t const board_detect[] = {
/* 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_SD4_DAT0__GPIO2_IO08 | MUX_PAD_CTRL(UART_PAD_CTRL)),
+};
+
+static iomux_v3_cfg_t const som_rev_detect[] = {
+ /* These pins are for sensing if it is a CuBox-i or a HummingBoard */
+ 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[] = {
@@ -333,88 +347,110 @@ int board_init(void)
return ret;
}
-static bool is_hummingboard(void)
+static enum board_type board_type(void)
{
- int val1, val2;
+ int val1, val2, val3;
- SETUP_IOMUX_PADS(hb_cbi_sense);
-
- gpio_direction_input(IMX_GPIO_NR(4, 9));
- gpio_direction_input(IMX_GPIO_NR(3, 4));
-
- val1 = gpio_get_value(IMX_GPIO_NR(4, 9));
- val2 = gpio_get_value(IMX_GPIO_NR(3, 4));
+ SETUP_IOMUX_PADS(board_detect);
/*
* Machine selection -
- * Machine val1, val2
- * -------------------------
- * HB2 x x
- * 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;
-}
+ gpio_direction_input(IMX_GPIO_NR(2, 8));
+ val3 = gpio_get_value(IMX_GPIO_NR(2, 8));
-static bool is_hummingboard2(void)
-{
- int val1;
+ if (val3 == 0)
+ return HUMMINGBOARD2;
- SETUP_IOMUX_PADS(hb_cbi_sense);
+ gpio_direction_input(IMX_GPIO_NR(3, 4));
+ val2 = gpio_get_value(IMX_GPIO_NR(3, 4));
- gpio_direction_input(IMX_GPIO_NR(2, 8));
+ if (val2 == 0)
+ return HUMMINGBOARD;
- val1 = gpio_get_value(IMX_GPIO_NR(2, 8));
+ gpio_direction_input(IMX_GPIO_NR(4, 9));
+ val1 = gpio_get_value(IMX_GPIO_NR(4, 9));
- /*
- * Machine selection -
- * Machine val1
- * -------------------
- * HB2 0
- * HB rev 3.x x
- * CBi x
- * HB x
- */
+ if (val1 == 0) {
+ return CUBOXI;
+ } else {
+ return HUMMINGBOARD;
+ }
+}
+
+static bool is_rev_15_som(void)
+{
+ int val1, val2;
+ SETUP_IOMUX_PADS(som_rev_detect);
- if (val1 == 0)
+ 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;
+
+ return false;
}
int checkboard(void)
{
- if (is_hummingboard2())
- puts("Board: MX6 Hummingboard2\n");
- else if (is_hummingboard())
- puts("Board: MX6 Hummingboard\n");
+ switch (board_type()) {
+ case CUBOXI:
+ puts("Board: MX6 Cubox-i");
+ break;
+ case HUMMINGBOARD:
+ puts("Board: MX6 HummingBoard");
+ break;
+ case HUMMINGBOARD2:
+ puts("Board: MX6 HummingBoard2");
+ break;
+ case UNKNOWN:
+ default:
+ puts("Board: Unknown\n");
+ goto out;
+ }
+
+ if (is_rev_15_som())
+ puts(" (som rev 1.5)\n");
else
- puts("Board: MX6 Cubox-i\n");
+ puts("\n");
+out:
return 0;
}
int board_late_init(void)
{
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
- if (is_hummingboard2())
- env_set("board_name", "HUMMINGBOARD2");
- else if (is_hummingboard())
+ switch (board_type()) {
+ case CUBOXI:
+ env_set("board_name", "CUBOXI");
+ break;
+ case HUMMINGBOARD:
env_set("board_name", "HUMMINGBOARD");
- else
+ break;
+ case HUMMINGBOARD2:
+ env_set("board_name", "HUMMINGBOARD2");
+ break;
+ case UNKNOWN:
+ default:
env_set("board_name", "CUBOXI");
+ }
if (is_mx6dq())
env_set("board_rev", "MX6Q");
else
env_set("board_rev", "MX6DL");
+
+ if (is_rev_15_som())
+ env_set("som_rev", "V15");
#endif
return 0;
diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h
index 6e2137769822..803661cfa843 100644
--- a/include/configs/mx6cuboxi.h
+++ b/include/configs/mx6cuboxi.h
@@ -101,18 +101,18 @@
"fi; " \
"fi\0" \
"findfdt="\
- "if test $board_name = HUMMINGBOARD2 && test $board_rev = MX6Q ; then " \
- "setenv fdtfile imx6q-hummingboard2.dtb; fi; " \
- "if test $board_name = HUMMINGBOARD2 && test $board_rev = MX6DL ; then " \
- "setenv fdtfile imx6dl-hummingboard2.dtb; fi; " \
- "if test $board_name = HUMMINGBOARD && test $board_rev = MX6Q ; then " \
- "setenv fdtfile imx6q-hummingboard.dtb; fi; " \
- "if test $board_name = HUMMINGBOARD && test $board_rev = MX6DL ; then " \
- "setenv fdtfile imx6dl-hummingboard.dtb; fi; " \
- "if test $board_name = CUBOXI && test $board_rev = MX6Q ; then " \
- "setenv fdtfile imx6q-cubox-i.dtb; fi; " \
- "if test $board_name = CUBOXI && test $board_rev = MX6DL ; then " \
- "setenv fdtfile imx6dl-cubox-i.dtb; fi; " \
+ "if test $board_rev = MX6Q ; then " \
+ "setenv fdtprefix imx6q; fi; " \
+ "if test $board_rev = MX6DL ; then " \
+ "setenv fdtprefix imx6dl; fi; " \
+ "if test $som_rev = V15 ; then " \
+ "setenv fdtsuffix -som-v15; fi; " \
+ "if test $board_name = HUMMINGBOARD2 ; then " \
+ "setenv fdtfile ${fdtprefix}-hummingboard2${fdtsuffix}.dtb; fi; " \
+ "if test $board_name = HUMMINGBOARD ; then " \
+ "setenv fdtfile ${fdtprefix}-hummingboard${fdtsuffix}.dtb; fi; " \
+ "if test $board_name = CUBOXI ; then " \
+ "setenv fdtfile ${fdtprefix}-cubox-i${fdtsuffix}.dtb; fi; " \
"if test $fdtfile = undefined; then " \
"echo WARNING: Could not determine dtb to use; fi; \0" \
BOOTENV
From patchwork Thu Jun 7 13:17:37 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,2/2] mx6cuboxi: fix 4GB ddr memory detection
X-Patchwork-Submitter: Baruch Siach <baruch@tkos.co.il>
X-Patchwork-Id: 926301
Message-Id: <b26ecc27cd034d1115670e877705b1652bea3277.1528377457.git.baruch@tkos.co.il>
To: Fabio Estevam <fabio.estevam@nxp.com>,
Stefano Babic <sbabic@denx.de>
Cc: u-boot@lists.denx.de, Baruch Siach <baruch@tkos.co.il>,
Rabeeh Khoury <rabeeh@solid-run.com>
Date: Thu, 7 Jun 2018 16:17:37 +0300
From: Baruch Siach <baruch@tkos.co.il>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
From: Jon Nettleton <jon@solid-run.com>
The soms with 4GB ddr have a rowaddr of 16 not 15, this allows
the detection mechanism to properly identify them as 4GB.
However these soms can be populated with whatever amount of
memory the customer requests therefor we need a ram stride test.
We can not use the get_ram_size() function because not all 4GB's
of DDR is addressable on a 32-bit architecture. Therefore instead
we use a memory stride of 128MB's and look for the address that
the memory wraps. This function is used for all som types to
catch most memory configurations.
This is a revised version of Rabeeh Khoury's original code.
Signed-off-by: Jon Nettleton <jon@solid-run.com>
Signed-off-by: Rabeeh Khoury <rabeeh@solid-run.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
---
board/solidrun/mx6cuboxi/mx6cuboxi.c | 46 ++++++++++++++++++++++++++--
1 file changed, 44 insertions(+), 2 deletions(-)
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c
index 1567cf0c91af..38d89f0130bb 100644
--- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
+++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
@@ -64,9 +64,51 @@ enum board_type {
UNKNOWN = 0x03,
};
+#define MEM_STRIDE 0x4000000
+static u32 get_ram_size_stride_test(u32 *base, u32 maxsize)
+{
+ volatile u32 *addr;
+ u32 save[64];
+ u32 cnt;
+ u32 size;
+ int i = 0;
+
+ /* First save the data */
+ for (cnt = 0; cnt < maxsize; cnt += MEM_STRIDE) {
+ addr = (volatile u32 *)((u32)base + cnt); /* pointer arith! */
+ sync ();
+ save[i++] = *addr;
+ sync ();
+ }
+
+ /* First write a signature */
+ * (volatile u32 *)base = 0x12345678;
+ for (size = MEM_STRIDE; size < maxsize; size += MEM_STRIDE) {
+ * (volatile u32 *)((u32)base + size) = size;
+ sync ();
+ if (* (volatile u32 *)((u32)base) == size) { /* We reached the overlapping address */
+ break;
+ }
+ }
+
+ /* Restore the data */
+ for (cnt = (maxsize - MEM_STRIDE); i > 0; cnt -= MEM_STRIDE) {
+ addr = (volatile u32 *)((u32)base + cnt); /* pointer arith! */
+ sync ();
+ *addr = save[i--];
+ sync ();
+ }
+
+ return (size);
+}
+
int dram_init(void)
{
- gd->ram_size = imx_ddr_size();
+ u32 max_size = imx_ddr_size();
+
+ gd->ram_size = get_ram_size_stride_test((u32 *) CONFIG_SYS_SDRAM_BASE,
+ (u32)max_size);
+
return 0;
}
@@ -626,7 +668,7 @@ static struct mx6_ddr3_cfg mem_ddr_4g = {
.density = 4,
.width = 16,
.banks = 8,
- .rowaddr = 15,
+ .rowaddr = 16,
.coladdr = 10,
.pagesz = 2,
.trcd = 1375,

View File

@ -1,86 +1,21 @@
From patchwork Sat Apr 28 21:16:27 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,1/2] sunxi-mmc: use new mode on A64
X-Patchwork-Submitter: Vasily Khoruzhick <anarsoul@gmail.com>
X-Patchwork-Id: 906216
Message-Id: <20180428211628.13753-2-anarsoul@gmail.com>
To: Jagan Teki <jagan@openedev.com>,
Maxime Ripard <maxime.ripard@bootlin.com>,
Albert Aribaud <albert.u.boot@aribaud.net>,
Jaehoon Chung <jh80.chung@samsung.com>, u-boot@lists.denx.de
Date: Sat, 28 Apr 2018 14:16:27 -0700
From: Vasily Khoruzhick <anarsoul@gmail.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
From d25807c04228381ec55b7ee18480345516481e22 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Fri, 8 Jun 2018 04:24:16 +0100
Subject: [PATCH] sunxi: fix eMMC stability issues on A64
That is necessary for using automatic calibration on A64 eMMC.
Signed-off-by: Vasily khoruzhick <anarsoul@gmail.com>
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
arch/arm/mach-sunxi/Kconfig | 1 +
drivers/mmc/sunxi_mmc.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index b868f0e350..774a39f580 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -256,6 +256,7 @@ config MACH_SUN50I
select SUNXI_DE2
select SUNXI_GEN_SUN6I
select SUNXI_HIGH_SRAM
+ select MMC_SUNXI_HAS_NEW_MODE
select SUPPORT_SPL
select SUNXI_DRAM_DW
select SUNXI_DRAM_DW_32BIT
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index df6f32850e..06b0fd491c 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -167,8 +167,12 @@ static int mmc_set_mod_clk(struct sunxi_mmc_priv *priv, unsigned int hz)
if (new_mode) {
#ifdef CONFIG_MMC_SUNXI_HAS_NEW_MODE
+#ifdef CONFIG_MACH_SUN50I
+ val = 0;
+#else
val = CCM_MMC_CTRL_MODE_SEL_NEW;
setbits_le32(&priv->reg->ntsr, SUNXI_MMC_NTSR_MODE_SEL_NEW);
+#endif
#endif
} else {
val = CCM_MMC_CTRL_OCLK_DLY(oclk_dly) |
From patchwork Sat Apr 28 21:16:28 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,2/2] mmc: sunxi: run calibration on A64
X-Patchwork-Submitter: Vasily Khoruzhick <anarsoul@gmail.com>
X-Patchwork-Id: 906217
Message-Id: <20180428211628.13753-3-anarsoul@gmail.com>
To: Jagan Teki <jagan@openedev.com>,
Maxime Ripard <maxime.ripard@bootlin.com>,
Albert Aribaud <albert.u.boot@aribaud.net>,
Jaehoon Chung <jh80.chung@samsung.com>, u-boot@lists.denx.de
Date: Sat, 28 Apr 2018 14:16:28 -0700
From: Vasily Khoruzhick <anarsoul@gmail.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
Along with using new mode it fixes eMMC instability on Pinebook
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
arch/arm/include/asm/arch-sunxi/mmc.h | 6 +++++-
drivers/mmc/sunxi_mmc.c | 6 ++++++
2 files changed, 11 insertions(+), 1 deletion(-)
arch/arm/include/asm/arch-sunxi/mmc.h | 6 +++++-
arch/arm/mach-sunxi/Kconfig | 2 ++
drivers/mmc/Kconfig | 4 ++++
drivers/mmc/sunxi_mmc.c | 13 +++++++++++++
4 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/arch/arm/include/asm/arch-sunxi/mmc.h b/arch/arm/include/asm/arch-sunxi/mmc.h
index 69f737f3bf..8575b393e5 100644
index 1574b8e8fed..d6664a01f21 100644
--- a/arch/arm/include/asm/arch-sunxi/mmc.h
+++ b/arch/arm/include/asm/arch-sunxi/mmc.h
@@ -47,7 +47,9 @@ struct sunxi_mmc {
@@ -46,7 +46,9 @@ struct sunxi_mmc {
u32 cbda; /* 0x94 */
u32 res2[26];
#ifdef CONFIG_SUNXI_GEN_SUN6I
@ -91,7 +26,7 @@ index 69f737f3bf..8575b393e5 100644
#endif
u32 fifo; /* 0x100 / 0x200 FIFO access address */
};
@@ -131,5 +133,7 @@ struct sunxi_mmc {
@@ -130,5 +132,7 @@ struct sunxi_mmc {
#define SUNXI_MMC_COMMON_CLK_GATE (1 << 16)
#define SUNXI_MMC_COMMON_RESET (1 << 18)
@ -99,16 +34,66 @@ index 69f737f3bf..8575b393e5 100644
+
struct mmc *sunxi_mmc_init(int sdc_no);
#endif /* _SUNXI_MMC_H */
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index a3f77230286..6e3d7f6d0a2 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -213,6 +213,7 @@ config MACH_SUN8I_A83T
select PHY_SUN4I_USB
select SUNXI_GEN_SUN6I
select MMC_SUNXI_HAS_NEW_MODE
+ select MMC_SUNXI_HAS_NEW_MODE_SWITCH
select SUPPORT_SPL
config MACH_SUN8I_H3
@@ -265,6 +266,7 @@ config MACH_SUN50I
select SUNXI_DE2
select SUNXI_GEN_SUN6I
select SUNXI_HIGH_SRAM
+ select MMC_SUNXI_HAS_NEW_MODE
select SUPPORT_SPL
select SUNXI_DRAM_DW
select SUNXI_DRAM_DW_32BIT
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index 693b3ceaf00..f8e435a2a25 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -536,6 +536,10 @@ config MMC_SUNXI_HAS_NEW_MODE
bool
depends on MMC_SUNXI
+config MMC_SUNXI_HAS_NEW_MODE_SWITCH
+ bool
+ depends on MMC_SUNXI
+
config GENERIC_ATMEL_MCI
bool "Atmel Multimedia Card Interface support"
depends on DM_MMC && BLK && ARCH_AT91
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index 06b0fd491c..9e7c42c571 100644
index fe6d82c7b4e..624c9071548 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -227,6 +227,12 @@ static int mmc_config_clock(struct sunxi_mmc_priv *priv, struct mmc *mmc)
@@ -166,7 +166,9 @@ static int mmc_set_mod_clk(struct sunxi_mmc_priv *priv, unsigned int hz)
if (new_mode) {
#ifdef CONFIG_MMC_SUNXI_HAS_NEW_MODE
+#ifdef CONFIG_MMC_SUNXI_HAS_NEW_MODE_SWITCH
val = CCM_MMC_CTRL_MODE_SEL_NEW;
+#endif
setbits_le32(&priv->reg->ntsr, SUNXI_MMC_NTSR_MODE_SEL_NEW);
#endif
} else {
@@ -223,6 +225,17 @@ static int mmc_config_clock(struct sunxi_mmc_priv *priv, struct mmc *mmc)
rval &= ~SUNXI_MMC_CLK_DIVIDER_MASK;
writel(rval, &priv->reg->clkcr);
+#ifdef CONFIG_MACH_SUN50I
+ /* Run calibration on A64 */
+ /* A64 needs to run calibration on eMMC controller and we
+ * have to set delay of zero before starting calibration.
+ * Allwinner BSP driver sets a delay only in the case of
+ * using HS400 which is not supported by mainline U-Boot or
+ * Linux at the moment
+ */
+ if (priv->mmc_no == 2)
+ writel(SUNXI_MMC_CAL_DL_SW_EN, &priv->reg->samp_dl);
+#endif
@ -116,3 +101,6 @@ index 06b0fd491c..9e7c42c571 100644
/* Re-enable Clock */
rval |= SUNXI_MMC_CLK_ENABLE;
writel(rval, &priv->reg->clkcr);
--
2.17.1

View File

@ -0,0 +1,108 @@
From b3133b61450e648cdd5f12c9556378c880932494 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Fri, 8 Jun 2018 04:31:10 +0100
Subject: [PATCH] tegra: nyan-big: Update CONFIG_SYS_TEXT to the default in
README.chromium
To build u-boot on a Nyan Big Chromebook the docs outline adjusting the Tegra124
defined CONFIG_SYS_TEXT_BASE but this has since been moved to individual config
files. We should have the default required for u-boot chain loading on the
chromebook as the default CONFIG_SYS_TEXT_BASE and update the docs to remove
this now non required step.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
configs/nyan-big_defconfig | 2 +-
doc/README.chromium | 27 +++++++--------------------
2 files changed, 8 insertions(+), 21 deletions(-)
diff --git a/configs/nyan-big_defconfig b/configs/nyan-big_defconfig
index 8868d1f9e10..3b64c643716 100644
--- a/configs/nyan-big_defconfig
+++ b/configs/nyan-big_defconfig
@@ -1,6 +1,6 @@
CONFIG_ARM=y
CONFIG_TEGRA=y
-CONFIG_SYS_TEXT_BASE=0x80110000
+CONFIG_SYS_TEXT_BASE=0x81000100
CONFIG_DEBUG_UART_BASE=0x70006000
CONFIG_DEBUG_UART_CLOCK=408000000
CONFIG_TEGRA124=y
diff --git a/doc/README.chromium b/doc/README.chromium
index 7bf4d874474..45eaeced2da 100644
--- a/doc/README.chromium
+++ b/doc/README.chromium
@@ -43,26 +43,13 @@ https://git.collabora.com/cgit/user/tomeu/u-boot.git/commit/?h=nyan-big
https://lists.denx.de/pipermail/u-boot/2017-May/289491.html
https://github.com/chromeos-nvidia-androidtv/gnu-linux-on-acer-chromebook-13#copy-data-to-the-sd-card
-1. Patch U-Boot
-
-Open include/configs/tegra124-common.h
-
-Change:
-
-#define CONFIG_SYS_TEXT_BASE 0x80110000
-
-to:
-
-#define CONFIG_SYS_TEXT_BASE 0x81000100
-
-
-2. Build U-Boot
+1. Build U-Boot
mkdir b
make -j8 O=b/nyan-big CROSS_COMPILE=arm-linux-gnueabi- nyan-big_defconfig all
-3. Select a .its file
+2. Select a .its file
Select something from doc/chromium which matches your board, or create your
own.
@@ -72,7 +59,7 @@ used by U-Boot. This is because the Chromebook expects to pass it to the
kernel, and crashes if it is not present.
-4. Build and sign an image
+3. Build and sign an image
./b/nyan-big/tools/mkimage -f doc/chromium/nyan-big.its u-boot-chromium.fit
echo test >dummy.txt
@@ -82,7 +69,7 @@ kernel, and crashes if it is not present.
--bootloader dummy.txt --pack u-boot.kpart
-5. Prepare an SD card
+4. Prepare an SD card
DISK=/dev/sdc # Replace with your actual SD card device
sudo cgpt create $DISK
@@ -91,12 +78,12 @@ kernel, and crashes if it is not present.
sudo gdisk $DISK # Enter command 'w' to write a protective MBR to the disk
-6. Write U-Boot to the SD card
+5. Write U-Boot to the SD card
sudo dd if=u-boot.kpart of=/dev/sdc1; sync
-7. Start it up
+6. Start it up
Reboot the device in dev mode. Make sure that you have USB booting enabled. To
do this, login as root (via Ctrl-Alt-forward_arrow) and type
@@ -115,7 +102,7 @@ mode screen. It should show something like the following on the display:
Tegra124 (Nyan-big) #
-8. Known problems
+7. Known problems
On the serial console the word MMC is chopped at the start of the line:
--
2.17.1

View File

@ -2,7 +2,7 @@
Name: uboot-tools
Version: 2018.07
Release: 0.1%{?candidate:.%{candidate}}%{?dist}
Release: 0.2%{?candidate:.%{candidate}}%{?dist}
Summary: U-Boot utilities
License: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+
URL: http://www.denx.de/wiki/U-Boot
@ -22,13 +22,13 @@ Patch2: uefi-distro-load-FDT-from-any-partition-on-boot-device.patch
Patch3: usb-kbd-fixes.patch
# Board fixes and enablement
Patch11: mx6cuboxi-add-support-for-detecting-Revision-1.5-SoM.patch
Patch10: sunxi-fix-eMMC-stability-issues-on-A64.patch
Patch11: mx6cuboxi-consolidate-board-detection-and-add-som-revision-checking.patch
Patch12: dragonboard-fixes.patch
Patch13: rockchip-make_fit_atf-fix-warning-unit_address_vs_reg.patch
Patch14: tegra186-jetson-tx2-disable-onboard-emmc.patch
Patch15: sunxi-fix-eMMC-stability-issues-on-A64.patch
Patch16: rockchip-make_fit_atf-use-elf-entry-point.patch
#Patch17: tegra-nyan-big-Update-CONFIG_SYS_TEXT-to-the-default.patch
Patch14: rockchip-make_fit_atf-use-elf-entry-point.patch
Patch15: tegra186-jetson-tx2-disable-onboard-emmc.patch
Patch16: tegra-nyan-big-Update-CONFIG_SYS_TEXT-to-the-default.patch
#Patch19: rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch
# Patch99: mvebu-enable-generic-distro-boot-config.patch
@ -293,6 +293,9 @@ cp -p board/warp7/README builds/docs/README.warp7
%endif
%changelog
* Fri Jun 8 2018 Peter Robinson <pbrobinson@fedoraproject.org> 2018.07-0.2-rc1
- Update sunxi MMC patch series, Tegra Nyan patch, SolidRun i.MX6 SoM rev 1.5 patch
* Tue Jun 5 2018 Peter Robinson <pbrobinson@fedoraproject.org> 2018.07-0.1-rc1
- 2018.07 RC1
- Enable Turris Mox, BananaPi m2 Berry, some Libretech boards