mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Rouven Czerwinski <r.czerwinski@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2 2/2] ARM: imx: Add Support for Webasto ccbv2
Date: Fri, 09 Oct 2020 09:43:26 +0200	[thread overview]
Message-ID: <aae25d119986b106a1abca156a110d7425c58d83.camel@pengutronix.de> (raw)
In-Reply-To: <20201009071432.GV11648@pengutronix.de>

On Fri, 2020-10-09 at 09:14 +0200, Sascha Hauer wrote:
> On Wed, Oct 07, 2020 at 03:07:58PM +0200, Rouven Czerwinski wrote:
> > +device_initcall(ccbv2_device_init);
> > +
> > +static int ccbv2_apply_overlay(void)
> > +{
> > +	struct device_node *overlay;
> > +	struct fdt_header *fdt;
> > +	int ret;
> > +
> > +	if(!IS_ENABLED(CONFIG_FIRMWARE_CCBV2_OPTEE)
> > +	   || !of_machine_is_compatible("webasto,imx6ul-ccbv2"))
> > +		return 0;
> > +
> > +	fdt = (void*)OPTEE_OVERLAY_LOCATION;
> > +	overlay = of_unflatten_dtb(fdt);
> > +
> > +	if (IS_ERR(overlay))
> > +		return PTR_ERR(overlay);
> > +
> > +	ret = of_register_overlay(overlay);
> > +	if (ret) {
> > +		printf("cannot apply oftree overlay: %s\n", strerror(-
> > ret));
> > +		goto err;
> > +	}
> > +
> > +	return 0;
> > +err:
> > +	of_delete_node(overlay);
> > +	return ret;
> > +}
> > +device_initcall(ccbv2_apply_overlay);
> 
> No need for two initcalls, please combine into one. Also, you could try
> Oleksijs new way of registering board code as a driver, see 5e1fc532538.

Right, will do.

> > +static void configure_uart(void)
> > +{
> > +	void __iomem *iomuxbase = (void *)MX6_IOMUXC_BASE_ADDR;
> > +
> > +	imx6_ungate_all_peripherals();
> > +
> > +	imx_setup_pad(iomuxbase, MX6_PAD_LCD_DATA16__UART7_DCE_TX);
> > +	imx_setup_pad(iomuxbase, MX6_PAD_LCD_DATA17__UART7_DCE_RX);
> > +
> > +	imx6_uart_setup((void *)MX6_UART7_BASE_ADDR);
> > +
> > +	if (IS_ENABLED(CONFIG_DEBUG_LL))
> > +		putc_ll('>');
> 
> No need to put that in a IS_ENABLED(CONFIG_DEBUG_LL), without it
> putc_ll() is a no-op anyway.

Great, will fix.

> > diff --git a/firmware/Kconfig b/firmware/Kconfig
> > index 97b7b3c2ee..c2ff51b911 100644
> > --- a/firmware/Kconfig
> > +++ b/firmware/Kconfig
> > @@ -16,4 +16,9 @@ config FIRMWARE_IMX8MP_ATF
> >  config FIRMWARE_IMX8MQ_ATF
> >          bool
> >  
> > +config FIRMWARE_CCBV2_OPTEE
> > +	bool
> > +	depends on MACH_WEBASTO_CCBV2 && PBL_OPTEE
> > +	default y
> 
> This makes the firmware mandatory for compiling this board, right? Can
> we make this optional so that we can enable the board in
> imx_v7_defconfig?

The firmware is only mandatory if OP-TEE early loading is enabled,
which AFAIK isn't the case for the defconfig, so we should be fine
there.
I'll add it to the defconfig.

Regards,
Rouven


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2020-10-09  7:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-07 13:07 [PATCH v2 1/2] ARM: i.MX6UL: add iomux header for i.MX6UL Rouven Czerwinski
2020-10-07 13:07 ` [PATCH v2 2/2] ARM: imx: Add Support for Webasto ccbv2 Rouven Czerwinski
2020-10-09  7:14   ` Sascha Hauer
2020-10-09  7:43     ` Rouven Czerwinski [this message]
2020-10-10 14:03   ` Roland Hieber
2020-10-09  7:15 ` [PATCH v2 1/2] ARM: i.MX6UL: add iomux header for i.MX6UL 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=aae25d119986b106a1abca156a110d7425c58d83.camel@pengutronix.de \
    --to=r.czerwinski@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --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