All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 01/22] tools: imx8m_image: align spl bin image size
Date: Mon, 12 Aug 2019 00:11:18 +0200	[thread overview]
Message-ID: <20190812001118.025ff953@jawa> (raw)
In-Reply-To: <20190809043014.32510-2-peng.fan@nxp.com>

Hi Peng,

> Align spl bin image size to 4 byte aligned, because we need
> to pad ddr firmware in the end of spl bin. However when enable
> SPL OF, the spl dtb will be padded to u-boot-nodtb.bin, then
> u-boot-spl.bin size might not be 4 bytes aligned.
> 
> ddr_load_train_firmware in drivers/ddr/imx/imx8m/helper.c 

I've poked around and there is a U-Boot commit:
e3963c0943042afcb38d99041a8dc3d55f092f5f

Which adds:
"drivers: ddr: introduce DDR driver for i.MX8M"

Is there any documentation on how to use it (any ./doc/ entry)?

I guess that this code (from helper.c) helps with setting DDR4
controller properly.

However, patch 22/22 in this series - which adds EVK imx8m board
- doesn't use this function, but it has hardcoded long table of magic
numbers to setup DDR controller.

I guess that those magic numbers are created from running this code?

If yes - would it be possible to train/setup the DDR4 controller in SPL
as it is done on i.MX6Q? Or at least provide a detailed documentation
on how to use it?

> use 4 bytes
> aligned address to load ddr firmware, so we need make sure
> u-boot-spl.bin is 4 bytes aligned, in this patch we use dd
> to create a new file named u-boot-spl-pad.bin, then pad ddr firmware.
> 
> If SPL OF not enabled, this patch not hurt, because `_end` already
> is 4 bytes aligned.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  tools/imx8m_image.sh | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/imx8m_image.sh b/tools/imx8m_image.sh
> index ec0881a128..08a6a48180 100755
> --- a/tools/imx8m_image.sh
> +++ b/tools/imx8m_image.sh
> @@ -35,8 +35,9 @@ if [ $post_process = 1 ]; then
>  		objcopy -I binary -O binary --pad-to 0x8000
> --gap-fill=0x0 $srctree/lpddr4_pmu_train_2d_imem.bin
> lpddr4_pmu_train_2d_imem_pad.bin cat lpddr4_pmu_train_1d_imem_pad.bin
> lpddr4_pmu_train_1d_dmem_pad.bin > lpddr4_pmu_train_1d_fw.bin cat
> lpddr4_pmu_train_2d_imem_pad.bin
> $srctree/lpddr4_pmu_train_2d_dmem.bin > lpddr4_pmu_train_2d_fw.bin
> -		cat spl/u-boot-spl.bin lpddr4_pmu_train_1d_fw.bin
> lpddr4_pmu_train_2d_fw.bin > spl/u-boot-spl-ddr.bin
> -		rm -f lpddr4_pmu_train_1d_fw.bin
> lpddr4_pmu_train_2d_fw.bin lpddr4_pmu_train_1d_imem_pad.bin
> lpddr4_pmu_train_1d_dmem_pad.bin lpddr4_pmu_train_2d_imem_pad.bin
> +		dd if=spl/u-boot-spl.bin of=spl/u-boot-spl-pad.bin
> bs=4 conv=sync
> +		cat spl/u-boot-spl-pad.bin
> lpddr4_pmu_train_1d_fw.bin lpddr4_pmu_train_2d_fw.bin >
> spl/u-boot-spl-ddr.bin
> +		rm -f lpddr4_pmu_train_1d_fw.bin
> lpddr4_pmu_train_2d_fw.bin lpddr4_pmu_train_1d_imem_pad.bin
> lpddr4_pmu_train_1d_dmem_pad.bin lpddr4_pmu_train_2d_imem_pad.bin
> spl/u-boot-spl-pad.bin fi fi 



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190812/47021532/attachment.sig>

  reply	other threads:[~2019-08-11 22:11 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-09  4:14 [U-Boot] [PATCH 00/22] i.MX8MM support Peng Fan
2019-08-09  4:14 ` [U-Boot] [PATCH 01/22] tools: imx8m_image: align spl bin image size Peng Fan
2019-08-11 22:11   ` Lukasz Majewski [this message]
2019-08-13  8:53     ` Peng Fan
2019-08-14  7:21   ` Schrempf Frieder
2019-08-14  8:29     ` Peng Fan
2019-08-09  4:14 ` [U-Boot] [PATCH 02/22] ddr: imx8m: fix ddr firmware location when enable SPL OF Peng Fan
2019-08-14  7:35   ` Schrempf Frieder
2019-08-14  7:59     ` Peng Fan
2019-08-14  8:04       ` Schrempf Frieder
2019-08-09  4:14 ` [U-Boot] [PATCH 03/22] imx8m: add image cfg for i.MX8MM lpddr4 Peng Fan
2019-08-14  7:59   ` Schrempf Frieder
2019-08-14  8:08     ` Peng Fan
2019-08-09  4:14 ` [U-Boot] [PATCH 04/22] imx: add IMX8MQ kconfig entry Peng Fan
2019-08-09  4:14 ` [U-Boot] [PATCH 05/22] imx: add IMX8MM " Peng Fan
2019-08-09  4:14 ` [U-Boot] [PATCH 06/22] imx: imx8mm: add clock bindings header Peng Fan
2019-08-09  4:15 ` [U-Boot] [PATCH 07/22] imx: add i.MX8MM cpu type Peng Fan
2019-08-09  4:15 ` [U-Boot] [PATCH 08/22] imx: spl: add spl_board_boot_device for i.MX8MM Peng Fan
2019-08-09  4:15 ` [U-Boot] [PATCH 09/22] imx8m: update imx-regs " Peng Fan
2019-08-14 15:03   ` Schrempf Frieder
2019-08-15  1:01     ` Peng Fan
2019-08-26 14:08       ` Schrempf Frieder
2019-08-09  4:15 ` [U-Boot] [PATCH 10/22] imx: add get_cpu_rev support " Peng Fan
2019-08-09  4:15 ` [U-Boot] [PATCH 11/22] imx8m: add pin header " Peng Fan
2019-08-11 21:56   ` Lukasz Majewski
2019-08-13  8:43     ` Peng Fan
2019-08-09  4:15 ` [U-Boot] [PATCH 12/22] imx: add i.MX8MM PE property Peng Fan
2019-08-09  4:15 ` [U-Boot] [PATCH 13/22] imx8m: Fix MMU table issue for OPTEE memory Peng Fan
2019-08-11 21:59   ` Lukasz Majewski
2019-08-13  8:46     ` Peng Fan
2019-08-09  4:15 ` [U-Boot] [PATCH 14/22] imx8m: set BYPASS ID SWAP to avoid AXI bus errors Peng Fan
2019-08-09  4:15 ` [U-Boot] [PATCH 15/22] imx8m: Configure trustzone region 0 for non-secure access Peng Fan
2019-08-09  4:15 ` [U-Boot] [PATCH 16/22] imx8m: soc: enable SCTR clock before timer init Peng Fan
2019-08-09  4:15 ` [U-Boot] [PATCH 17/22] imx8m: rename clock to clock_imx8mq Peng Fan
2019-08-11 22:01   ` Lukasz Majewski
2019-08-13  8:48     ` Peng Fan
2019-08-09  4:15 ` [U-Boot] [PATCH 18/22] imx8m: restructure clock.h Peng Fan
2019-08-11 22:02   ` Lukasz Majewski
2019-08-13  8:49     ` Peng Fan
2019-08-09  4:15 ` [U-Boot] [PATCH 19/22] imx8m: add clk support for i.MX8MM Peng Fan
2019-08-09  4:15 ` [U-Boot] [PATCH 20/22] arm: dts: import i.MX8MM dtsi Peng Fan
2019-08-14 10:21   ` Schrempf Frieder
2019-08-15  1:11     ` Peng Fan
2019-08-09  4:15 ` [U-Boot] [PATCH 21/22] arm: dts: add i.MX8MM pin func Peng Fan
2019-08-09  4:15 ` [U-Boot] [PATCH 22/22] imx: Add i.MX8MM EVK board support Peng Fan
2019-08-10 13:06   ` Lukasz Majewski
2019-08-14 16:32   ` Schrempf Frieder
2019-08-15  0:57     ` Peng Fan
2019-08-26 15:20       ` Schrempf Frieder
2019-08-27  1:09         ` Peng Fan
2019-08-27  3:25           ` Peng Fan
2019-08-14 16:34 ` [U-Boot] [PATCH 00/22] i.MX8MM support Schrempf Frieder
2019-08-15  0:58   ` 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=20190812001118.025ff953@jawa \
    --to=lukma@denx.de \
    --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.