All of lore.kernel.org
 help / color / mirror / Atom feed
From: peng.fan at nxp.com <peng.fan@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 06/52] ddr: imx8m: fix ddr firmware location when enable SPL OF
Date: Tue,  2 Jul 2019 10:31:20 +0800	[thread overview]
Message-ID: <20190702023206.48995-7-peng.fan@nxp.com> (raw)
In-Reply-To: <20190702023206.48995-1-peng.fan@nxp.com>

From: Peng Fan <peng.fan@nxp.com>

With SPL_OF_SPERATE, the device tree will be padded to
end of the u-boot-spl-nodtb.bin, however we also put
the ddr firmware file to this location, so need to adapt
the code with SPL OF and align to 16bytes to ease copy firmware.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/ddr/imx/imx8m/helper.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/ddr/imx/imx8m/helper.c b/drivers/ddr/imx/imx8m/helper.c
index 61cd4f6db1..3e605353ea 100644
--- a/drivers/ddr/imx/imx8m/helper.c
+++ b/drivers/ddr/imx/imx8m/helper.c
@@ -31,7 +31,17 @@ void ddr_load_train_firmware(enum fw_type type)
 	unsigned long pr_to32, pr_from32;
 	unsigned long fw_offset = type ? IMEM_2D_OFFSET : 0;
 	unsigned long imem_start = (unsigned long)&_end + fw_offset;
-	unsigned long dmem_start = imem_start + IMEM_LEN;
+	unsigned long dmem_start;
+
+#ifdef CONFIG_SPL_OF_CONTROL
+	if (gd->fdt_blob && !fdt_check_header(gd->fdt_blob)) {
+		imem_start = roundup((unsigned long)&_end +
+				     fdt_totalsize(gd->fdt_blob), 4) +
+			fw_offset;
+	}
+#endif
+
+	dmem_start = imem_start + IMEM_LEN;
 
 	pr_from32 = imem_start;
 	pr_to32 = DDR_TRAIN_CODE_BASE_ADDR + 4 * IMEM_OFFSET_ADDR;
-- 
2.16.4

  parent reply	other threads:[~2019-07-02  2:31 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-02  2:31 [U-Boot] [PATCH 00/52] Support i.MX8MM/N peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 01/52] linux: compat: guard PAGE_SIZE peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 02/52] dm: clk: ignore default settings when node not valid peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 03/52] pinctrl: imx: use devfdt_get_addr_size_index peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 04/52] i2c: mxc: add CONFIG_CLK support peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 05/52] tools: imx8m_image: align spl bin image size peng.fan at nxp.com
2019-07-04 15:33   ` Schrempf Frieder
2019-07-05  2:06     ` Peng Fan
2019-07-02  2:31 ` peng.fan at nxp.com [this message]
2019-07-02  2:31 ` [U-Boot] [PATCH 07/52] tools: imx8mimage: fix HDMI/FIT parsing peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 08/52] imx8m: add image cfg for i.MX8MM lpddr4 peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 09/52] imx: add IMX8MQ kconfig entry peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 10/52] imx: add IMX8MM " peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 11/52] imx: imx8mm: add clock bindings header peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 12/52] imx: add i.MX8MM cpu type peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 13/52] imx: spl: add spl_board_boot_device for i.MX8MM peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 14/52] imx8m: update imx-regs " peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 15/52] imx: add get_cpu_rev support " peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 16/52] imx8m: rename clock to clock_imx8mq peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 17/52] imx8m: restructure clock.h peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 18/52] imx8m: add clk support for i.MX8MM peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 19/52] imx8m: soc: probe clk before relocation peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 20/52] imx8m: add pin header for i.MX8MM peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 21/52] imx: add i.MX8MM PE property peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 22/52] imx8m: Fix MMU table issue for OPTEE memory peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 23/52] imx8m: set BYPASS ID SWAP to avoid AXI bus errors peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 24/52] imx8m: Configure trustzone region 0 for non-secure access peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 25/52] imx8m: soc: enable SCTR clock before timer init peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 26/52] serial: Kconfig: make MXC_UART usable for MX7 and IMX8M peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 27/52] clk: imx: add Kconfig entry for i.MX8MM peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 28/52] clk: imx: add i.MX8MM clk driver peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 29/52] imx: add i.MX8MM EVK board support peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 30/52] ddr: imx8m: Fix ddr4 driver build issue peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 31/52] imx8mq: Update the ddrc QoS setting for B1 chip peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 32/52] driver: ddr: Refine the ddr init driver on imx8m peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 33/52] ddr: imx8m: Fix the ddr init hang on imx8mq peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 34/52] imx: add i.MX8MN kconfig entry peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 35/52] imx8mn: support get_cpu_rev peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 36/52] imx8m: add clk support for i.MX8MN peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 37/52] imx8mn: set BYPASS ID SWAP to avoid AXI bus errors peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 38/52] imx: add i.MX8MN PE property peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 39/52] imx8mn: add pin header peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 40/52] imx: spl: use spl_board_boot_device for i.MX8MN peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 41/52] spl: pass args to board_return_to_bootrom peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 42/52] imx: add rom api support peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 43/52] imx: cpu: restrict get_boot_device peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 44/52] imx8mn: add get_boot_device peng.fan at nxp.com
2019-07-02  2:31 ` [U-Boot] [PATCH 45/52] power: pmic: add SPL_DM_PMIC peng.fan at nxp.com
2019-07-02  2:32 ` [U-Boot] [PATCH 46/52] tools: imx8mimage: add ROM VERSION peng.fan at nxp.com
2019-07-02  2:32 ` [U-Boot] [PATCH 47/52] pinctrl: imx8m: support i.MX8MN peng.fan at nxp.com
2019-07-02  2:32 ` [U-Boot] [PATCH 48/52] tools: imx8m_image: support ddr4 firmware peng.fan at nxp.com
2019-07-02  2:32 ` [U-Boot] [PATCH 49/52] clk: imx: add i.MX8MN clk support peng.fan at nxp.com
2019-07-02  2:32 ` [U-Boot] [PATCH 50/52] imx8m: add i.MX8MN ddr4 image cfg file peng.fan at nxp.com
2019-07-02  2:32 ` [U-Boot] [PATCH 51/52] imx: add dtsi for i.MX8MN peng.fan at nxp.com
2019-07-02  2:32 ` [U-Boot] [PATCH 52/52] imx: add i.MX8MN DDR4 board support peng.fan at nxp.com
2019-07-06 22:45 ` [U-Boot] [PATCH 00/52] Support i.MX8MM/N Lukasz Majewski
2019-07-08  1:28   ` Peng Fan
2019-07-08  7:24     ` Lukasz Majewski
2019-07-08  7:47       ` Peng Fan
2019-07-08  8:15         ` Lukasz Majewski
2019-07-08  8:37           ` Peng Fan
2019-07-17  8:37           ` Peng Fan
2019-07-18  7:12             ` Lukasz Majewski
2019-07-22 21:55               ` Lukasz Majewski
2019-07-23  2:39                 ` Peng Fan
2019-07-23  3:16                   ` Peng Fan
2019-07-18 14:34             ` Schrempf Frieder
2019-07-19  1:51               ` Peng Fan
2019-07-08  8:41         ` Schrempf Frieder
2019-07-08  8:53           ` Peng Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190702023206.48995-7-peng.fan@nxp.com \
    --to=peng.fan@nxp.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.