[PATCH] ARM: boards: Add support for phyBOARD-Segin i.MX 93
Sascha Hauer
s.hauer at pengutronix.de
Tue Mar 11 01:49:50 PDT 2025
On Wed, Mar 05, 2025 at 03:02:25PM +0100, Bastian Krause wrote:
> Hi Jonas,
>
> On 3/4/25 5:24 PM, Jonas Rebmann wrote:
> > This patch adds support for the phyBOARD-Segin i.MX 93 and the phyCORE
> > i.MX 93 SoM it is based upon.
> >
> > Note that support is only provided for the standard configuration
> > featuring 1GB RAM as testing was only possible on that variant and only
> > the single-configuration lpddr4_timing.c as initially committed to
> > u-boot in 7c1f8ce3956 worked.
> >
> > The 1GB configuration from later revisions results in a freeze during
> > dram setup.
> >
> > The following functionality has been tested:
> > - barebox starts via imxusbloader, tftp and emmc
> > - both ethertnet interfaces work
> > - barebox_update to emmc
> > - boot kernel via network
> > - USB OTG
> > - USB mass storage on USB Host Port
> > - reset
> >
> > Signed-off-by: Jonas Rebmann <jre at pengutronix.de>
> > ---
> > arch/arm/boards/Makefile | 1 +
> > arch/arm/boards/phytec-phycore-imx93/Makefile | 2 +
> > arch/arm/boards/phytec-phycore-imx93/board.c | 56 +
> > arch/arm/boards/phytec-phycore-imx93/lowlevel.c | 60 +
> > .../boards/phytec-phycore-imx93/lpddr4_timing.c | 1546 ++++++++++++++++++++
> > arch/arm/configs/imx_v8_defconfig | 1 +
> > arch/arm/configs/multi_v8_defconfig | 1 +
> > arch/arm/dts/Makefile | 1 +
> > arch/arm/dts/imx93-phyboard-segin-downstream.dtsi | 269 ++++
> > arch/arm/dts/imx93-phyboard-segin.dts | 28 +
> > arch/arm/mach-imx/Kconfig | 9 +
> > images/Makefile.imx | 4 +
> > 12 files changed, 1978 insertions(+)
> >
> > diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
> > index c6104d04329774655712db5aaf6df671fd74142e..1e67b304f1855df2c32305638c3d9029ed0994c6 100644
> > --- a/arch/arm/boards/Makefile
> > +++ b/arch/arm/boards/Makefile
> > @@ -78,6 +78,7 @@ obj-$(CONFIG_MACH_PCM038) += phytec-phycore-imx27/
> > obj-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += phytec-som-am335x/
> > obj-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += phytec-som-imx6/
> > obj-$(CONFIG_MACH_PHYTEC_PHYCORE_IMX7) += phytec-phycore-imx7/
> > +obj-$(CONFIG_MACH_PHYTEC_PHYCORE_IMX93) += phytec-phycore-imx93/
> > obj-$(CONFIG_MACH_PHYTEC_PHYCORE_STM32MP1) += phytec-phycore-stm32mp1/
> > obj-$(CONFIG_MACH_PHYTEC_SOM_IMX8MM) += phytec-som-imx8mm/
> > obj-$(CONFIG_MACH_PHYTEC_SOM_IMX8MQ) += phytec-som-imx8mq/
> > diff --git a/arch/arm/boards/phytec-phycore-imx93/Makefile b/arch/arm/boards/phytec-phycore-imx93/Makefile
> > new file mode 100644
> > index 0000000000000000000000000000000000000000..ae29bb9249e62cb649e21e580559383fa9d18386
> > --- /dev/null
> > +++ b/arch/arm/boards/phytec-phycore-imx93/Makefile
> > @@ -0,0 +1,2 @@
> > +lwl-y += lowlevel.o lpddr4_timing.o
> > +obj-y += board.o
> > diff --git a/arch/arm/boards/phytec-phycore-imx93/board.c b/arch/arm/boards/phytec-phycore-imx93/board.c
> > new file mode 100644
> > index 0000000000000000000000000000000000000000..149248ca654624826d0e8f6fe0f1f42c2747e248
> > --- /dev/null
> > +++ b/arch/arm/boards/phytec-phycore-imx93/board.c
> > @@ -0,0 +1,56 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +
> > +#define pr_fmt(fmt) "phyCORE imx93: " fmt
> > +
> > +#include <common.h>
> > +#include <init.h>
> > +#include <linux/kernel.h>
> > +#include <environment.h>
> > +#include <mfd/pca9450.h>
> > +#include <deep-probe.h>
> > +#include <mach/imx/bbu.h>
> > +#include <linux/pinctrl/consumer.h>
> > +
> > +static void phycore_imx93_init_pmic(struct regmap *map)
> > +{
> > + /* set WDOG_B_CFG to cold reset */
> > + regmap_write(map, PCA9450_RESET_CTRL, 0xA1);
> > +}
> > +
> > +static int phycore_imx93_probe(struct device *dev)
> > +{
> > + struct device_node *np;
> > +
> > + pca9450_register_init_callback(phycore_imx93_init_pmic);
> > +
> > + /*
> > + * The phy on the EQOS has its MDIO lines connected to the FEC. The phy
> > + * registers can only be successfully read when the EQOS pinctrl setup
> > + * has been done. The phys on the FEC MDIO bus are probed during the
> > + * FEC driver probe, so do the EQOS pinctrl setup here to make sure it's
> > + * done before the FEC probes.
> > + */
> > + np = of_find_compatible_node(dev->of_node, NULL, "nxp,imx93-dwmac-eqos");
> > + BUG_ON(!np);
> > + of_pinctrl_select_state_default(np);
> > +
> > + imx9_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc0", 0);
> > +
> > + return 0;
> > +}
> > +
> > +static const struct of_device_id phycore_imx93_of_match[] = {
> > + {
> > + .compatible = "phytec,imx93-phyboard-segin",
> > + },
> > + { /* sentinel */ },
> > +};
> > +
> > +static struct driver phycore_imx93_board_driver = {
> > + .name = "board-phycore_imx93",
> > + .probe = phycore_imx93_probe,
> > + .of_compatible = phycore_imx93_of_match,
> > +};
> > +coredevice_platform_driver(phycore_imx93_board_driver);
> > +
> > +BAREBOX_DEEP_PROBE_ENABLE(phycore_imx93_of_match);
> > diff --git a/arch/arm/boards/phytec-phycore-imx93/lowlevel.c b/arch/arm/boards/phytec-phycore-imx93/lowlevel.c
> > new file mode 100644
> > index 0000000000000000000000000000000000000000..7678d2f2633ea07e532684f999b62ddecc2b79dc
> > --- /dev/null
> > +++ b/arch/arm/boards/phytec-phycore-imx93/lowlevel.c
> > @@ -0,0 +1,60 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +
> > +#include <common.h>
> > +#include <debug_ll.h>
> > +#include <mach/imx/debug_ll.h>
> > +#include <mach/imx/generic.h>
> > +#include <mach/imx/xload.h>
> > +#include <asm/barebox-arm.h>
> > +#include <soc/imx9/ddr.h>
> > +#include <mach/imx/atf.h>
> > +#include <mach/imx/xload.h>
> > +#include <mach/imx/romapi.h>
>
> This shouldn't be needed.
Dropped a few includes while applying.
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 |
More information about the barebox
mailing list