mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Sohaib Mohamed <sohaib.amhmd@gmail.com>
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>,
	barebox@lists.infradead.org, sohaib.radwan@loytec.com
Subject: Re: [PATCH master] ARM: omap: add two smaller MLO defconfigs for AM335x
Date: Mon, 2 Dec 2024 09:03:48 +0100	[thread overview]
Message-ID: <Z01p5PgQEkGLunyX@pengutronix.de> (raw)
In-Reply-To: <y3ggfeytlihua6m5dar7r6qmanmsw4kbqxgxaschrn6mcdwxis@6zdxuzv733s3>

On Sun, Dec 01, 2024 at 11:53:59PM +0100, Sohaib Mohamed wrote:
> Hi,
> 
> On Sun, Dec 01, 2024 at 10:29:59PM +0100, Ahmad Fatoum wrote:
> > The Beaglebone Black remains a popular board and it's not a good look to
> > have it not compile by default due to barebox getting too big.
> >
> > As we keep running into size issues with the MLO defconfig, let's accept
> > that we die bite off more than we could chew and split off the defconfigs
> > into one for SD/MMC and another for NOR/NAND and document that users
> > should prefer those instead.
> >
> > Reported-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
> > Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> > ---
> >  Documentation/boards/am335x.rst    | 28 +++++++++++++++++++++++++---
> >  arch/arm/Makefile                  |  6 ++++++
> >  common/boards/configs/nomci.config |  1 +
> >  common/boards/configs/nomtd.config |  1 +
> >  4 files changed, 33 insertions(+), 3 deletions(-)
> >  create mode 100644 common/boards/configs/nomci.config
> >  create mode 100644 common/boards/configs/nomtd.config
> >
> > diff --git a/Documentation/boards/am335x.rst b/Documentation/boards/am335x.rst
> > index f54611428bb3..ec7322a0acdf 100644
> > --- a/Documentation/boards/am335x.rst
> > +++ b/Documentation/boards/am335x.rst
> > @@ -8,9 +8,15 @@ loader from the same medium.
> >  Building barebox
> >  ----------------
> >
> > -The TI AM335x boards in barebox are covered by the ``am335x_mlo_defconfig``
> > -for the MLO and ``omap_defconfig`` for the regular barebox image. The
> > -resulting images will be placed under ``images/``:
> > +Booting with barebox on the TI AM335x is a two-stage process and unlike
> > +more recently added SoCs, requires building barebox twice, each time
> > +with a different defconfig:
> > +
> > +* ``omap_defconfig`` for the regular (second-stage) barebox image
> > +* For the MLO first-stage, either ``am335x_mlo_sdmmc_defconfig`` for
> > +  SD/eMMC or ``am335x_mlo_rawflash_defconfig`` for raw NOR/NAND.
> > +
> > +The resulting images will be placed under ``images/``:
> >
> >  ::
> >
> > @@ -30,6 +36,22 @@ resulting images will be placed under ``images/``:
> >
> >  Some boards come in different variants, make sure to pick the correct one.
> >
> > +Size Constraints
> > +^^^^^^^^^^^^^^^^
> > +
> > +As the MLO needs to setup DRAM first, it must fit into the 109KiB
> > +of available on-Chip SRAM. Depending on the boards, drivers and general
> > +features enabled by your config, barebox may exceed this size resulting
> > +in an error message during build, e.g.::
> > +
> > +  images/start_am33xx_myirtech_sram.pblb size 111800 > maximum size 111616
> > +
> > +If you run into this issue, consider disabling some unneeded config options
> > +for the MLO via ``make menuconfig`` and try again.
> > +The ``am335x_mlo_sdmmc_defconfig`` and ``am335x_mlo_rawflash_defconfig``
> > +defconfigs do just that by disabling ``CONFIG_MTD`` and ``CONFIG_MCI``,
> > +respectively.
> > +
> >  Starting and updating barebox
> >  -----------------------------
> >
> > diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> > index 6785432c52ca..7138f638651e 100644
> > --- a/arch/arm/Makefile
> > +++ b/arch/arm/Makefile
> > @@ -2,6 +2,12 @@
> >
> >  KBUILD_DEFCONFIG := multi_v8_defconfig
> >
> > +generated_configs += $(patsubst %, %_defconfig, sdmmc rawflash)
> > +am335x_mlo_sdmmc_defconfig:
> > +	$(call merge_into_defconfig,am335x_mlo_defconfig,nomtd)
> > +am335x_mlo_rawflash_defconfig:
> > +	$(call merge_into_defconfig,am335x_mlo_defconfig,nomci)
> > +
> >  KBUILD_CPPFLAGS	+= -D__ARM__ -fno-strict-aliasing
> >  # Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
> >  ifeq ($(CONFIG_CPU_64),y)
> > diff --git a/common/boards/configs/nomci.config b/common/boards/configs/nomci.config
> > new file mode 100644
> > index 000000000000..f541645cccfc
> > --- /dev/null
> > +++ b/common/boards/configs/nomci.config
> > @@ -0,0 +1 @@
> > +# CONFIG_MCI is not set
> > diff --git a/common/boards/configs/nomtd.config b/common/boards/configs/nomtd.config
> > new file mode 100644
> > index 000000000000..f29845573ae6
> > --- /dev/null
> > +++ b/common/boards/configs/nomtd.config
> > @@ -0,0 +1 @@
> > +# CONFIG_MTD is not set
> 
> Is it possible to remove also CONFIG_MACH_MYIRTECH_X335X by default, I
> still get this error:

With Ahamds patch you have to use either am335x_mlo_sdmmc_defconfig
or am335x_mlo_rawflash_defconfig depending on where you are booting
from. Did you use one of them? Even with Ahmads patch the old
am335x_mlo_defconfig is still there and still leads to an image
exceeding the size limit.

Sascha

> 
>   OBJCOPYB images/start_am33xx_myirtech_sram.pblb
>   CHKFILESIZE images/start_am33xx_myirtech_sram.pblb
>   OBJCOPYB images/start_am33xx_phytec_phycore_r2_sram.pblb
> images/start_am33xx_myirtech_sram.pblb size 111856 > maximum size 111616
> make[1]: *** [/home/smalinux/repos/bbb/barebox_standalone/barebox/images/Makefile:82: images/start_am33xx_myirtech_sram.pblb] Error 1
> make[1]: *** Deleting file 'images/start_am33xx_myirtech_sram.pblb'
> make[1]: *** Waiting for unfinished jobs....
>   CHKFILESIZE images/start_am33xx_phytec_phycore_r2_sram.pblb
> make: *** [Makefile:736: images] Error 2
> 
> 
> 
> > --
> > 2.39.5
> >
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



  reply	other threads:[~2024-12-02  8:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-01 21:29 Ahmad Fatoum
2024-12-01 22:53 ` Sohaib Mohamed
2024-12-02  8:03   ` Sascha Hauer [this message]
2024-12-02  8:12     ` Ahmad Fatoum
2024-12-02 11:06 ` Sascha Hauer

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=Z01p5PgQEkGLunyX@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=sohaib.amhmd@gmail.com \
    --cc=sohaib.radwan@loytec.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox