mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: "Hans Christian Lønstad" <hcl@datarespons.no>,
	"Marco Felsch" <m.felsch@pengutronix.de>,
	"Lucas Stach" <lst@pengutronix.de>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: imx8 - gpc: Support IMX8 Lite
Date: Fri, 14 Apr 2023 09:59:14 +0200	[thread overview]
Message-ID: <e597040b-7c6e-0c65-878b-c47c768b242e@pengutronix.de> (raw)
In-Reply-To: <D9091FED-AF96-4414-AF7D-0A0CB9F3A3FD@datarespons.no>

Hello Hans.

On 14.04.23 09:47, Hans Christian Lønstad wrote:
> After applying NXP kernel 6.1 branch (6.1-1.0-x-imx) I can confirm a fix is needed in kernel as well.
> In order to avoid specific DT for i.MX8MP Lite, the probe function in soc/imx/imx8m-blk-ctrl.c should consult fuse settings and skip the pm_genpd_init for functions not available.
> 
> I believe this should be properly handled as the Lite version is more applicable (and cost effective) for a broad range of applications.

The consensus is that this is the job of the device tree. i.MX8MPL users need
to either use a DT which omits the nodes in question or the bootloader needs
to patch these nodes away. The feature controller supports patching the kernel
DT, so what's missing is adding i.MX8MP Lite support to it.

Cheers,
Ahmad

> 
> Hans Christian Lønstad
> 
>> 15. mar. 2023 kl. 10:13 skrev Marco Felsch <m.felsch@pengutronix.de>:
>>
>> Hi Hans,
>>
>> the subject should be:
>>
>> soc: imx: gpcv2: add i.MX8MP Lite support
>>
>> On 23-03-15, Hans Christian Lonstad wrote:
>>> IMX8 Lite lacks some functionality and hence the corresponding
>>   ^
>> i.MX8MP Lite
>>
>>> power domains (8, 11, 12, 13).
>>> This results in Barebox error messages and unfortunately a failed
>>> Linux kernel boot.
>>> Add a "Lite" specific table selected using device tree compatible
>>> clause.
>>>
>>> Note that this should probably be related to the feature controller.
>>
>> What did you mean by this note? Also do we need this support within
>> Linux as well?
>>
>>> Signed-off-by: Hans Christian Lonstad <hcl@Datarespons.com>
>>>
>>> diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c
>>> index b662363f79..40998c42c5 100644
>>> --- a/drivers/soc/imx/gpcv2.c
>>> +++ b/drivers/soc/imx/gpcv2.c
>>> @@ -1053,6 +1053,192 @@ static const struct imx_pgc_domain imx8mp_pgc_domains[] = {
>>> 	},
>>> };
>>>
>>> +static const struct imx_pgc_domain imx8mpl_pgc_domains[] = {
>>> +	[IMX8MP_POWER_DOMAIN_MIPI_PHY1] = {
>>> +		.genpd = {
>>> +			.name = "mipi-phy1",
>>> +		},
>>> +		.bits = {
>>> +			.pxx = IMX8MP_MIPI_PHY1_SW_Pxx_REQ,
>>> +			.map = IMX8MP_MIPI_PHY1_A53_DOMAIN,
>>> +		},
>>> +		.pgc = BIT(IMX8MP_PGC_MIPI1),
>>> +	},
>>> +
>>> +	[IMX8MP_POWER_DOMAIN_PCIE_PHY] = {
>>> +		.genpd = {
>>> +			.name = "pcie-phy1",
>>> +		},
>>> +		.bits = {
>>> +			.pxx = IMX8MP_PCIE_PHY_SW_Pxx_REQ,
>>> +			.map = IMX8MP_PCIE_PHY_A53_DOMAIN,
>>> +		},
>>> +		.pgc = BIT(IMX8MP_PGC_PCIE),
>>> +	},
>>> +
>>> +	[IMX8MP_POWER_DOMAIN_USB1_PHY] = {
>>> +		.genpd = {
>>> +			.name = "usb-otg1",
>>> +		},
>>> +		.bits = {
>>> +			.pxx = IMX8MP_USB1_PHY_Pxx_REQ,
>>> +			.map = IMX8MP_USB1_PHY_A53_DOMAIN,
>>> +		},
>>> +		.pgc = BIT(IMX8MP_PGC_USB1),
>>> +	},
>>> +
>>> +	[IMX8MP_POWER_DOMAIN_USB2_PHY] = {
>>> +		.genpd = {
>>> +			.name = "usb-otg2",
>>> +		},
>>> +		.bits = {
>>> +			.pxx = IMX8MP_USB2_PHY_Pxx_REQ,
>>> +			.map = IMX8MP_USB2_PHY_A53_DOMAIN,
>>> +		},
>>> +		.pgc = BIT(IMX8MP_PGC_USB2),
>>> +	},
>>> +
>>> +	[IMX8MP_POWER_DOMAIN_MLMIX] = {
>>> +		.genpd = {
>>> +			.name = "mlmix",
>>> +		},
>>> +		.bits = {
>>> +			.pxx = IMX8MP_MLMIX_Pxx_REQ,
>>> +			.map = IMX8MP_MLMIX_A53_DOMAIN,
>>> +			.hskreq = IMX8MP_MLMIX_PWRDNREQN,
>>> +			.hskack = IMX8MP_MLMIX_PWRDNACKN,
>>> +		},
>>> +		.pgc = BIT(IMX8MP_PGC_MLMIX),
>>> +		.keep_clocks = true,
>>> +	},
>>> +
>>> +	[IMX8MP_POWER_DOMAIN_AUDIOMIX] = {
>>> +		.genpd = {
>>> +			.name = "audiomix",
>>> +		},
>>> +		.bits = {
>>> +			.pxx = IMX8MP_AUDIOMIX_Pxx_REQ,
>>> +			.map = IMX8MP_AUDIOMIX_A53_DOMAIN,
>>> +			.hskreq = IMX8MP_AUDIOMIX_PWRDNREQN,
>>> +			.hskack = IMX8MP_AUDIOMIX_PWRDNACKN,
>>> +		},
>>> +		.pgc = BIT(IMX8MP_PGC_AUDIOMIX),
>>> +		.keep_clocks = true,
>>> +	},
>>> +
>>> +	[IMX8MP_POWER_DOMAIN_GPU2D] = {
>>> +		.genpd = {
>>> +			.name = "gpu2d",
>>> +		},
>>> +		.bits = {
>>> +			.pxx = IMX8MP_GPU_2D_Pxx_REQ,
>>> +			.map = IMX8MP_GPU2D_A53_DOMAIN,
>>> +		},
>>> +		.pgc = BIT(IMX8MP_PGC_GPU2D),
>>> +	},
>>> +
>>> +	[IMX8MP_POWER_DOMAIN_GPUMIX] = {
>>> +		.genpd = {
>>> +			.name = "gpumix",
>>> +		},
>>> +		.bits = {
>>> +			.pxx = IMX8MP_GPU_SHARE_LOGIC_Pxx_REQ,
>>> +			.map = IMX8MP_GPUMIX_A53_DOMAIN,
>>> +			.hskreq = IMX8MP_GPUMIX_PWRDNREQN,
>>> +			.hskack = IMX8MP_GPUMIX_PWRDNACKN,
>>> +		},
>>> +		.pgc = BIT(IMX8MP_PGC_GPUMIX),
>>> +		.keep_clocks = true,
>>> +	},
>>> +
>>> +	[IMX8MP_POWER_DOMAIN_GPU3D] = {
>>> +		.genpd = {
>>> +			.name = "gpu3d",
>>> +		},
>>> +		.bits = {
>>> +			.pxx = IMX8MP_GPU_3D_Pxx_REQ,
>>> +			.map = IMX8MP_GPU3D_A53_DOMAIN,
>>> +		},
>>> +		.pgc = BIT(IMX8MP_PGC_GPU3D),
>>> +	},
>>> +
>>> +	[IMX8MP_POWER_DOMAIN_MEDIAMIX] = {
>>> +		.genpd = {
>>> +			.name = "mediamix",
>>> +		},
>>> +		.bits = {
>>> +			.pxx = IMX8MP_MEDIMIX_Pxx_REQ,
>>> +			.map = IMX8MP_MEDIAMIX_A53_DOMAIN,
>>> +			.hskreq = IMX8MP_MEDIAMIX_PWRDNREQN,
>>> +			.hskack = IMX8MP_MEDIAMIX_PWRDNACKN,
>>> +		},
>>> +		.pgc = BIT(IMX8MP_PGC_MEDIAMIX),
>>> +		.keep_clocks = true,
>>> +	},
>>> +
>>> +	[IMX8MP_POWER_DOMAIN_HDMIMIX] = {
>>> +		.genpd = {
>>> +			.name = "hdmimix",
>>> +		},
>>> +		.bits = {
>>> +			.pxx = IMX8MP_HDMIMIX_Pxx_REQ,
>>> +			.map = IMX8MP_HDMIMIX_A53_DOMAIN,
>>> +			.hskreq = IMX8MP_HDMIMIX_PWRDNREQN,
>>> +			.hskack = IMX8MP_HDMIMIX_PWRDNACKN,
>>> +		},
>>> +		.pgc = BIT(IMX8MP_PGC_HDMIMIX),
>>> +		.keep_clocks = true,
>>> +	},
>>> +
>>> +	[IMX8MP_POWER_DOMAIN_HDMI_PHY] = {
>>> +		.genpd = {
>>> +			.name = "hdmi-phy",
>>> +		},
>>> +		.bits = {
>>> +			.pxx = IMX8MP_HDMI_PHY_Pxx_REQ,
>>> +			.map = IMX8MP_HDMI_PHY_A53_DOMAIN,
>>> +		},
>>> +		.pgc = BIT(IMX8MP_PGC_HDMI),
>>> +	},
>>> +
>>> +	[IMX8MP_POWER_DOMAIN_MIPI_PHY2] = {
>>> +		.genpd = {
>>> +			.name = "mipi-phy2",
>>> +		},
>>> +		.bits = {
>>> +			.pxx = IMX8MP_MIPI_PHY2_Pxx_REQ,
>>> +			.map = IMX8MP_MIPI_PHY2_A53_DOMAIN,
>>> +		},
>>> +		.pgc = BIT(IMX8MP_PGC_MIPI2),
>>> +	},
>>> +
>>> +	[IMX8MP_POWER_DOMAIN_HSIOMIX] = {
>>> +		.genpd = {
>>> +			.name = "hsiomix",
>>> +		},
>>> +		.bits = {
>>> +			.pxx = IMX8MP_HSIOMIX_Pxx_REQ,
>>> +			.map = IMX8MP_HSIOMIX_A53_DOMAIN,
>>> +			.hskreq = IMX8MP_HSIOMIX_PWRDNREQN,
>>> +			.hskack = IMX8MP_HSIOMIX_PWRDNACKN,
>>> +		},
>>> +		.pgc = BIT(IMX8MP_PGC_HSIOMIX),
>>> +		.keep_clocks = true,
>>> +	},
>>> +
>>> +	[IMX8MP_POWER_DOMAIN_MEDIAMIX_ISPDWP] = {
>>> +		.genpd = {
>>> +			.name = "mediamix-isp-dwp",
>>> +		},
>>> +		.bits = {
>>> +			.pxx = IMX8MP_MEDIA_ISP_DWP_Pxx_REQ,
>>> +			.map = IMX8MP_MEDIA_ISPDWP_A53_DOMAIN,
>>> +		},
>>> +		.pgc = BIT(IMX8MP_PGC_MEDIA_ISP_DWP),
>>> +	},
>>> +};
>>> +
>>> +
>>
>> delete one.
>>
>>> static const struct imx_pgc_regs imx8mp_pgc_regs = {
>>> 	.map = IMX8MP_GPC_PGC_CPU_MAPPING,
>>> 	.pup = IMX8MP_GPC_PU_PGC_SW_PUP_REQ,
>>> @@ -1065,6 +1251,12 @@ static const struct imx_pgc_domain_data imx8mp_pgc_domain_data = {
>>> 	.pgc_regs = &imx8mp_pgc_regs,
>>> };
>>>
>>> +static const struct imx_pgc_domain_data imx8mpl_pgc_domain_data = {
>>> +	.domains = imx8mpl_pgc_domains,
>>> +	.domains_num = ARRAY_SIZE(imx8mpl_pgc_domains),
>>> +	.pgc_regs = &imx8mp_pgc_regs,
>>> +};
>>> +
>>> static const struct imx_pgc_domain imx8mn_pgc_domains[] = {
>>> 	[IMX8MN_POWER_DOMAIN_HSIOMIX] = {
>>> 		.genpd = {
>>> @@ -1302,6 +1494,7 @@ static const struct of_device_id imx_gpcv2_dt_ids[] = {
>>> 	{ .compatible = "fsl,imx8mm-gpc", .data = &imx8mm_pgc_domain_data, },
>>> 	{ .compatible = "fsl,imx8mn-gpc", .data = &imx8mn_pgc_domain_data, },
>>> 	{ .compatible = "fsl,imx8mp-gpc", .data = &imx8mp_pgc_domain_data, },
>>> +	{ .compatible = "fsl,imx8mpl-gpc", .data = &imx8mpl_pgc_domain_data, },
>> 				^
>> This compatible is does not exist.
>>
>> Regards,
>>  Marco
>>
>>> 	{ .compatible = "fsl,imx8mq-gpc", .data = &imx8m_pgc_domain_data, },
>>> 	{ }
>>> };
>>>
>>>
> 

-- 
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:[~2023-04-14  8:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15  7:05 Hans Christian Lonstad
2023-03-15  9:13 ` Marco Felsch
2023-03-16 15:09   ` Hans Christian Lønstad
2023-04-14  7:47   ` Hans Christian Lønstad
2023-04-14  7:59     ` Ahmad Fatoum [this message]
2023-03-15  9:22 ` Lucas Stach

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=e597040b-7c6e-0c65-878b-c47c768b242e@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=hcl@datarespons.no \
    --cc=lst@pengutronix.de \
    --cc=m.felsch@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