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

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.

> +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.

> 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?

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 |

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

  reply	other threads:[~2020-10-09  7:14 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 [this message]
2020-10-09  7:43     ` Rouven Czerwinski
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=20201009071432.GV11648@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=r.czerwinski@pengutronix.de \
    --subject='Re: [PATCH v2 2/2] ARM: imx: Add Support for Webasto ccbv2' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox