diff mbox series

[U-Boot,19/26] configs: mx6sabresd: Add SPL FIT and DM support

Message ID 1547823182-6756-20-git-send-email-abel.vesa@nxp.com
State Changes Requested
Delegated to: Stefano Babic
Headers show
Series mx6sabre: Add DM and SPL FIT support | expand

Commit Message

Abel Vesa Jan. 18, 2019, 2:53 p.m. UTC
Enable all the necessary configs for SPL DM and FIT support for
mx6sabresd.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
---
 configs/mx6sabresd_defconfig | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

Comments

Fabio Estevam Jan. 18, 2019, 3:16 p.m. UTC | #1
Hi Abel,

On Fri, Jan 18, 2019 at 12:59 PM Abel Vesa <abel.vesa@nxp.com> wrote:

> +CONFIG_OF_CONTROL=y
> +CONFIG_SPL_OF_CONTROL=y
> +CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabresd"

Does this mean that only imx6q-sabresd variant is supported after this
series is applied?

We still need to support imx6dl/imx6qp sabresd in the same binary as
we currently do today.
Abel Vesa Jan. 18, 2019, 3:26 p.m. UTC | #2
On 19-01-18 13:16:07, Fabio Estevam wrote:
> Hi Abel,
> 
> On Fri, Jan 18, 2019 at 12:59 PM Abel Vesa <abel.vesa@nxp.com> wrote:
> 
> > +CONFIG_OF_CONTROL=y
> > +CONFIG_SPL_OF_CONTROL=y
> > +CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabresd"
> 
> Does this mean that only imx6q-sabresd variant is supported after this
> series is applied?
> 
> We still need to support imx6dl/imx6qp sabresd in the same binary as
> we currently do today.

Hmmm, so all the dtbs get built, trouble is we need to specify which dtb gets
used by SPL. This is why the DEFAULT_DEVICE_TREE gets set.

A solution to do what you're asking is to have a dtb in SPL that works for
all socs (dl/qp/q) for each board (sabreauto/sabresd). I'm afraid it might
get too big to fit in sram. I'll give it a try tomorrow.

As for the u-boot proper, in order to have one u-boot.itb file that works
on all socs we need to support MULTI_FIT in u-boot proper and make u-boot
chose from the fit table the right dtb. I'll try to do that for the next
version of this patchset. I'll keep you up to date with the development.
Tom Rini Jan. 18, 2019, 3:30 p.m. UTC | #3
On Fri, Jan 18, 2019 at 03:26:42PM +0000, Abel Vesa wrote:
> On 19-01-18 13:16:07, Fabio Estevam wrote:
> > Hi Abel,
> > 
> > On Fri, Jan 18, 2019 at 12:59 PM Abel Vesa <abel.vesa@nxp.com> wrote:
> > 
> > > +CONFIG_OF_CONTROL=y
> > > +CONFIG_SPL_OF_CONTROL=y
> > > +CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabresd"
> > 
> > Does this mean that only imx6q-sabresd variant is supported after this
> > series is applied?
> > 
> > We still need to support imx6dl/imx6qp sabresd in the same binary as
> > we currently do today.
> 
> Hmmm, so all the dtbs get built, trouble is we need to specify which dtb gets
> used by SPL. This is why the DEFAULT_DEVICE_TREE gets set.
> 
> A solution to do what you're asking is to have a dtb in SPL that works for
> all socs (dl/qp/q) for each board (sabreauto/sabresd). I'm afraid it might
> get too big to fit in sram. I'll give it a try tomorrow.
> 
> As for the u-boot proper, in order to have one u-boot.itb file that works
> on all socs we need to support MULTI_FIT in u-boot proper and make u-boot
> chose from the fit table the right dtb. I'll try to do that for the next
> version of this patchset. I'll keep you up to date with the development.

Please note that this isn't the first family to have this problem.
Please see the TI Keystone 2 families and CONFIG_DTB_RESELECT as I would
swear we can go from a "good enough for all" to "correct for what we're
on" DTB in both SPL and U-Boot.  And then yes, you end up compressing
the DTBs too so that we can fit things into limited space.  And if we
still run into problems, which we might well still, lets talk.  And it
might indeed end up making the most sense to make up a "just enough for
SPL for everyone" DTB or set of DTBs too.
Abel Vesa Jan. 28, 2019, 3:31 p.m. UTC | #4
On 19-01-18 10:30:24, Tom Rini wrote:
> On Fri, Jan 18, 2019 at 03:26:42PM +0000, Abel Vesa wrote:
> > On 19-01-18 13:16:07, Fabio Estevam wrote:
> > > Hi Abel,
> > > 
> > > On Fri, Jan 18, 2019 at 12:59 PM Abel Vesa <abel.vesa@nxp.com> wrote:
> > > 
> > > > +CONFIG_OF_CONTROL=y
> > > > +CONFIG_SPL_OF_CONTROL=y
> > > > +CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabresd"
> > > 
> > > Does this mean that only imx6q-sabresd variant is supported after this
> > > series is applied?
> > > 
> > > We still need to support imx6dl/imx6qp sabresd in the same binary as
> > > we currently do today.
> > 
> > Hmmm, so all the dtbs get built, trouble is we need to specify which dtb gets
> > used by SPL. This is why the DEFAULT_DEVICE_TREE gets set.
> > 
> > A solution to do what you're asking is to have a dtb in SPL that works for
> > all socs (dl/qp/q) for each board (sabreauto/sabresd). I'm afraid it might
> > get too big to fit in sram. I'll give it a try tomorrow.
> > 
> > As for the u-boot proper, in order to have one u-boot.itb file that works
> > on all socs we need to support MULTI_FIT in u-boot proper and make u-boot
> > chose from the fit table the right dtb. I'll try to do that for the next
> > version of this patchset. I'll keep you up to date with the development.
> 
> Please note that this isn't the first family to have this problem.
> Please see the TI Keystone 2 families and CONFIG_DTB_RESELECT as I would
> swear we can go from a "good enough for all" to "correct for what we're
> on" DTB in both SPL and U-Boot.  And then yes, you end up compressing
> the DTBs too so that we can fit things into limited space.  And if we
> still run into problems, which we might well still, lets talk.  And it
> might indeed end up making the most sense to make up a "just enough for
> SPL for everyone" DTB or set of DTBs too.
> 

OK, so I finally managed to get the multi dtb support in SPL. Added all 
three dtbs (for 6q, 6qp and 6dl) but the 6dl doesn't wanna boot anymore.
The 6q and 6qp boot up just fine.

The final SPL is 75K so it obviously doesn't fit in the 64K ocram the 6dl
has.

Once I enable the GZIP options (SPL_GZIP and SPL_MULTI_DTB_FIT_GZIP)
I get this:

	u-boot-spl section `.rodata' will not fit in region `.sram'
	region `.sram' overflowed by 12708 bytes


Same thing happens with LZO:

	u-boot-spl section `.data' will not fit in region `.sram'
	region `.sram' overflowed by 1396 bytes

A solution would be to split the q/qp and dl into two separate defconfigs
(and implicitly two different binaries).


Btw, I don't understand why the dtbs (the fit table to be exact) do not
overflow the ocram limit. I mean, I know why, but I believe that is incorrect.
The fit table gets appended at the end so it builds fine. But I guess it should
fail.

Let me know what you guys think.

> -- 
> Tom
diff mbox series

Patch

diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 1857c18..a208425 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -4,17 +4,26 @@  CONFIG_SYS_TEXT_BASE=0x17800000
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_MX6SABRESD=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
 CONFIG_SPL=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
+CONFIG_TPL_SYS_MALLOC_F_LEN=0x400
+CONFIG_FIT=y
+CONFIG_SPL_FIT_PRINT=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_SPL_FIT_SOURCE="arch/arm/mach-imx/mx6/fit_spl.its"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_SUPPORT_RAW_INITRD=y
+CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_FIT_IMAGE_TINY=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
@@ -46,23 +55,30 @@  CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_EFI_PARTITION=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="imx6q-sabresd"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_SPL_DM=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_FASTBOOT_BUF_SIZE=0x10000000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=2
+CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_MII=y
 CONFIG_PCI=y
+CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_USB=y
-CONFIG_USB_STORAGE=y
+CONFIG_DM_USB=y
+# CONFIG_SPL_DM_USB is not set
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
@@ -72,4 +88,3 @@  CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_VIDEO=y
 # CONFIG_VIDEO_SW_CURSOR is not set
-CONFIG_OF_LIBFDT=y