mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Johannes Zink <j.zink@pengutronix.de>
To: Sascha Hauer <sha@pengutronix.de>
Cc: barebox@lists.infradead.org, patchwork-jzi@pengutronix.de,
	Juergen Borleis <j.borleis@pengutronix.de>
Subject: Re: [PATCH] ARM: i.MX8MP: add Koenig+Bauer Alphajet board
Date: Thu, 1 Jun 2023 10:41:38 +0200	[thread overview]
Message-ID: <b810f8d1-97e4-9e26-0516-2575f9991fef@pengutronix.de> (raw)
In-Reply-To: <20230601082825.GL18491@pengutronix.de>

Hi Sascha,

thanks for your feedback.

On 6/1/23 10:28, Sascha Hauer wrote:
> On Thu, Jun 01, 2023 at 09:40:29AM +0200, Johannes Zink wrote:
>> Add basic support for Koenig+Bauer Alphajet, based on a Congatec QMX8MP
>> SoM with a i.MX8MP SoC in the Industrial Temperature Grade 4GB Variant,
>> no inline ECC used.
>>
>> Co-Developed-by: Juergen Borleis <j.borleis@pengutronix.de>
>> Signed-off-by: Juergen Borleis <j.borleis@pengutronix.de>
>> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
>> ---
>> Koenig+Bauer Alphajet is based on the Congatec QMX8MP, which is an
>> i.MX8MP based SoC. Building barebox for this target requires the usual
>> bl31 and lpddr4 training data in /firmware as described in [1].
>>
>> The Congatec SoM is strapped and fused to boot from QSPI NOR flash,
>> which can easily be updated using the registered barebox update handler.
>>
>> [1] https://www.barebox.org/doc/latest/boards/imx/nxp-imx8mp-evk.html
>>
>> Best regards
>> Johannes
>> ---
>> Bootlog:
>>
>> barebox 2023.05.0-00196-g24e000914af6-dirty #151 Thu Jun 1 09:36:02 CEST
>> 2023
>>
>> Board: Koenig+Bauer Alphajet
>> deep-probe: supported due to kb,alphajet
>> detected i.MX8MP revision 1.1
>> i.MX8MP unique ID: 3a13efb20002aaff
>> netconsole: registered as netconsole-1
>> psci psci.of: detected version 1.1
>> imx-esdhc 30b40000.mmc@30b40000.of: registered as mmc0
>> mmc0: detected SD card version 2.0
>> mmc0: registered mmc0
>> imx-esdhc 30b60000.mmc@30b60000.of: registered as mmc2
>> mmc2: detected MMC card version 5.1
>> mmc2: registered mmc2.boot0
>> mmc2: registered mmc2.boot1
>> mmc2: registered mmc2
>> mdio_bus: miibus0: probed
>> xHCI xHCI0: USB XHCI 1.10
>> state: New state registered 'state'
>> state: Using bucket 0@0x00000000
>> malloc space: 0xbfcfbe80 -> 0xffcfbe7f (size 1 GiB)
>> found force-builtin environment, using defaultenv
>>
>> Hit m for menu or any to stop autoboot:    3
>> barebox@Koenig+Bauer Alphajet:/
>>
>> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
>> ---
>>   arch/arm/boards/Makefile                           |    1 +
>>   arch/arm/boards/kb-imx8mp-alphajet/Makefile        |    4 +
>>   arch/arm/boards/kb-imx8mp-alphajet/board.c         |   60 +
>>   .../flash-header-imx8mp-cgtqx8p.imxcfg             |   10 +
>>   arch/arm/boards/kb-imx8mp-alphajet/lowlevel.c      |  127 ++
>>   arch/arm/boards/kb-imx8mp-alphajet/lpddr4-timing.c | 1832 ++++++++++++++++++++
>>   arch/arm/dts/Makefile                              |    1 +
>>   arch/arm/dts/imx8mp-cgtqx8p.dtsi                   | 1060 +++++++++++
>>   arch/arm/dts/imx8mp-koenigbauer-alphajet.dts       |  180 ++
>>   arch/arm/mach-imx/Kconfig                          |   10 +
>>   images/Makefile.imx                                |    5 +
>>   11 files changed, 3290 insertions(+)
>>
>> diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
>> index 2877debad535..67b2fc07a395 100644
>> --- a/arch/arm/boards/Makefile
>> +++ b/arch/arm/boards/Makefile
>> @@ -81,6 +81,7 @@ obj-$(CONFIG_MACH_NXP_IMX8MQ_EVK)		+= nxp-imx8mq-evk/
>>   obj-$(CONFIG_MACH_NXP_IMX8MM_EVK)		+= nxp-imx8mm-evk/
>>   obj-$(CONFIG_MACH_NXP_IMX8MN_EVK)		+= nxp-imx8mn-evk/
>>   obj-$(CONFIG_MACH_NXP_IMX8MP_EVK)		+= nxp-imx8mp-evk/
>> +obj-$(CONFIG_MACH_KB_ALPHAJET)			+= kb-imx8mp-alphajet/
>>   obj-$(CONFIG_MACH_TQ_MBA8MPXL)			+= tqma8mpxl/
>>   obj-$(CONFIG_MACH_OMAP343xSDP)			+= omap343xdsp/
>>   obj-$(CONFIG_MACH_OMAP3EVM)			+= omap3evm/
>> diff --git a/arch/arm/boards/kb-imx8mp-alphajet/Makefile b/arch/arm/boards/kb-imx8mp-alphajet/Makefile
>> new file mode 100644
>> index 000000000000..b3ae72be3e3b
>> --- /dev/null
>> +++ b/arch/arm/boards/kb-imx8mp-alphajet/Makefile
>> @@ -0,0 +1,4 @@
>> +# SPDX-License-Identifier:      GPL-2.0+
>> +
>> +obj-y += board.o
>> +lwl-y += lowlevel.o lpddr4-timing.o
>> diff --git a/arch/arm/boards/kb-imx8mp-alphajet/board.c b/arch/arm/boards/kb-imx8mp-alphajet/board.c
>> new file mode 100644
>> index 000000000000..78cc60e2c3b1
>> --- /dev/null
>> +++ b/arch/arm/boards/kb-imx8mp-alphajet/board.c
>> @@ -0,0 +1,60 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +// SPDX-FileCopyrightText: 2023 Juergen Borleis, Pengutronix
>> +// SPDX-FileCopyrightText: 2023 Johannes Zink, Pengutronix
>> +
>> +#include <asm/memory.h>
>> +#include <bootsource.h>
>> +#include <common.h>
>> +#include <deep-probe.h>
>> +#include <init.h>
>> +#include <linux/phy.h>
>> +#include <linux/sizes.h>
>> +#include <mach/imx/bbu.h>
>> +#include <mach/imx/generic.h>
>> +#include <mach/imx/iomux-mx8mp.h>
>> +#include <gpio.h>
>> +#include <envfs.h>
>> +
>> +#define EQOS_PWR_PIN IMX_GPIO_NR(1, 5) /* ENET_PWREN# */
>> +static void setup_ethernet_phy(void)
>> +{
>> +	u32 val;
>> +
>> +	of_device_ensure_probed_by_alias("gpio0");
>> +
>> +	if (gpio_direction_output(EQOS_PWR_PIN, 0))
>> +	{
>> +		pr_err("eqos phy power: failed to request pin\n");
>> +		return;
>> +	}
> 
> Should this be a fixed regulator in dt?
> 

Phy regulator handling in linux is broken for the mx8 eqos, as the 
phy-regulators are not handed down properly, which is why I cannot add it in 
the linux upstream dts (dts upstreaming is still to be done...).

I decided to use a hog there. As Marco gave me a hint that hogs are currently 
somewhat broken in barebox, I opted for setting the pin manually in the board code.

Johannes

> Sascha
> 
> 

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




  parent reply	other threads:[~2023-06-01  8:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01  7:40 Johannes Zink
2023-06-01  7:53 ` Marco Felsch
2023-06-01  8:28 ` Sascha Hauer
2023-06-01  8:40   ` Marco Felsch
2023-06-01  8:41   ` Johannes Zink [this message]
2023-06-01  8:50     ` Ahmad Fatoum
2023-06-01  8:49 ` Ahmad Fatoum
2023-06-01  9:08   ` Johannes Zink
2023-06-01  9:14     ` Ahmad Fatoum
2023-06-01  9:20       ` Johannes Zink

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=b810f8d1-97e4-9e26-0516-2575f9991fef@pengutronix.de \
    --to=j.zink@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=j.borleis@pengutronix.de \
    --cc=patchwork-jzi@pengutronix.de \
    --cc=sha@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