mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	Jonas Rebmann <jre@pengutronix.de>
Cc: BAREBOX <barebox@lists.infradead.org>
Subject: Re: [PATCH] ARM: boards: Add support for todarex colibri imx6 on iris
Date: Mon, 16 Dec 2024 09:55:47 +0100	[thread overview]
Message-ID: <452ed951-8693-4742-aa4f-a0df124c9a3b@pengutronix.de> (raw)
In-Reply-To: <Z1_iXdYw8Hpx9uZ6@pengutronix.de>

Hello Sascha,

On 16.12.24 09:18, Sascha Hauer wrote:
> Hi Jonas,
> 
> On Fri, Dec 13, 2024 at 03:06:59PM +0100, Jonas Rebmann wrote:
>> +static void eth_init(void)
>> +{
>> +        void __iomem *iomux = (void *)MX6_IOMUXC_BASE_ADDR;
> 
> IOMEM() instead of casting to void *.
> 
>> +ENTRY_FUNCTION(start_imx6dl_colibri_iris, r0, r1, r2)
>> +{
>> +	void *fdt;
>> +
>> +	imx6_cpu_lowlevel_init();
>> +
>> +	if (IS_ENABLED(CONFIG_DEBUG_LL)) {
>> +		setup_uart();
>> +	}
>> +
>> +	fdt = __dtb_z_imx6dl_colibri_iris_start + get_runtime_offset();
>> +	barebox_arm_entry(0x10000000, SZ_512M, fdt);
>> +}
> 
> Rather do a:
> 
> 	relocate_to_current_adr();
> 	setup_c();
> 
> Then jump to a noinline function to continue startup.
> 
> Additionally to setting up the UART for _ll access you can do
> a
> 
> 	pbl_set_putc(imx_uart_putc, uart1base);
> 
> The advantage is that you no longer have to enable CONFIG_DEBUG_LL to
> get early console output, but only CONFIG_PBL_CONSOLE.
> 
> You can do the UART setup unconditionally, no need to hide that behind
> CONFIG_DEBUG_LL.

By using the DCD table, the benefit of the console so early is greatly
reduced, that's why I told Jonas that DEBUG_LL would be enough.

> 
>> +
>> +ENTRY_FUNCTION(start_imx6s_colibri_iris, r0, r1, r2)
>> +{
>> +	void *fdt;
>> +
>> +	imx6_cpu_lowlevel_init();
>> +
>> +	if (IS_ENABLED(CONFIG_DEBUG_LL)) {
>> +		setup_uart();
>> +	}
>> +
>> +	fdt = __dtb_z_imx6dl_colibri_iris_start + get_runtime_offset();
>> +	barebox_arm_entry(0x10000000, SZ_256M, fdt);
>> +}
> 
> You should be able to call imx6q_barebox_entry() instead here. This
> will read the amount of DRAM back from the controller. No need to
> distinguish between both board anymore and you can merge both images
> into one.

The images have different DCD tables, so combining the entry point
won't work. You can't have different imxcfg files for a single entry point.

Cheers,
Ahmad

> 
> Sascha
> 


-- 
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-16  9:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-13 14:06 Jonas Rebmann
2024-12-16  8:18 ` Sascha Hauer
2024-12-16  8:55   ` Ahmad Fatoum [this message]
2024-12-16  9:34     ` Sascha Hauer
2024-12-16  9:36       ` Ahmad Fatoum

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=452ed951-8693-4742-aa4f-a0df124c9a3b@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jre@pengutronix.de \
    --cc=s.hauer@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox