On Wed, Apr 20, 2022 at 12:53:22PM +0300, Alexander Shiyan wrote: > The MYD-AM335X Development Board designed by MYIR is a high-performance > ARM Evaluation Module (EVM) using the MYC-AM335X CPU module as the core > controller board. It is based on up to 1GHz Texas Instruments (TI) > Sitara AM335x family of ARM Cortex-A8 Microprocessors (MPUs) that deliver > high DMIPs at a low cost while also delivering optional 3D graphics > acceleration and key peripherals. > > Signed-off-by: Alexander Shiyan <eagle.alexander923@xxxxxxxxx> > --- > arch/arm/boards/Makefile | 1 + > arch/arm/boards/myirtech-x335x/Makefile | 3 + > arch/arm/boards/myirtech-x335x/board.c | 44 +++++++ > .../defaultenv-myirtech-x335x/boot/nand | 4 + > .../defaultenv-myirtech-x335x/nv/boot.default | 1 + > .../nv/linux.bootargs.console | 1 + > arch/arm/boards/myirtech-x335x/lowlevel.c | 113 ++++++++++++++++++ > arch/arm/configs/am335x_mlo_defconfig | 1 + > .../arm/configs/myirtech_am335x_myd_defconfig | 109 +++++++++++++++++ > arch/arm/dts/Makefile | 1 + > arch/arm/dts/am335x-myirtech-myd.dts | 23 ++++ > arch/arm/mach-omap/Kconfig | 6 + > .../arm/mach-omap/include/mach/am33xx-clock.h | 1 + > .../mach-omap/include/mach/am33xx-silicon.h | 2 + > images/Makefile.am33xx | 8 ++ > 15 files changed, 318 insertions(+) > create mode 100644 arch/arm/boards/myirtech-x335x/Makefile > create mode 100644 arch/arm/boards/myirtech-x335x/board.c > create mode 100644 arch/arm/boards/myirtech-x335x/defaultenv-myirtech-x335x/boot/nand > create mode 100644 arch/arm/boards/myirtech-x335x/defaultenv-myirtech-x335x/nv/boot.default > create mode 100644 arch/arm/boards/myirtech-x335x/defaultenv-myirtech-x335x/nv/linux.bootargs.console > create mode 100644 arch/arm/boards/myirtech-x335x/lowlevel.c > create mode 100644 arch/arm/configs/myirtech_am335x_myd_defconfig > create mode 100644 arch/arm/dts/am335x-myirtech-myd.dts > > diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile > index 75e15cbda4..d303999614 100644 > --- a/arch/arm/boards/Makefile > +++ b/arch/arm/boards/Makefile > @@ -77,6 +77,7 @@ obj-$(CONFIG_MACH_MB7707) += module-mb7707/ > obj-$(CONFIG_MACH_MIOA701) += mioa701/ > obj-$(CONFIG_MACH_MX23EVK) += freescale-mx23-evk/ > obj-$(CONFIG_MACH_MX28EVK) += freescale-mx28-evk/ > +obj-$(CONFIG_MACH_MYIRTECH_X335X) += myirtech-x335x/ > obj-$(CONFIG_MACH_NESO) += guf-neso/ > obj-$(CONFIG_MACH_NETGEAR_RN104) += netgear-rn104/ > obj-$(CONFIG_MACH_NETGEAR_RN2120) += netgear-rn2120/ > diff --git a/arch/arm/boards/myirtech-x335x/Makefile b/arch/arm/boards/myirtech-x335x/Makefile > new file mode 100644 > index 0000000000..05d9fc7bc3 > --- /dev/null > +++ b/arch/arm/boards/myirtech-x335x/Makefile > @@ -0,0 +1,3 @@ > +lwl-y += lowlevel.o > +obj-y += board.o > +bbenv-$(CONFIG_DEFAULT_ENVIRONMENT) += defaultenv-myirtech-x335x > diff --git a/arch/arm/boards/myirtech-x335x/board.c b/arch/arm/boards/myirtech-x335x/board.c > new file mode 100644 > index 0000000000..b5af651254 > --- /dev/null > +++ b/arch/arm/boards/myirtech-x335x/board.c > @@ -0,0 +1,44 @@ > +/* SPDX-License-Identifier: GPL-2.0+ */ > +/* SPDX-FileCopyrightText: Alexander Shiyan <shc_work@xxxxxxx> */ > + > +#include <bootsource.h> > +#include <common.h> > +#include <driver.h> > +#include <envfs.h> > +#include <init.h> > +#include <linux/sizes.h> > +#include <mach/am33xx-generic.h> > + > +static struct omap_barebox_part myir_barebox_part = { > + .nand_offset = SZ_128K, > + .nand_size = SZ_512K, > +}; Isn't this a bit too small? Putting a barebox into 128k seems very ambicous. > + > +static __init int myir_devices_init(void) > +{ > + if (!of_machine_is_compatible("myir,myc-am335x")) > + return 0; > + > + am33xx_register_ethaddr(0, 0); > + am33xx_register_ethaddr(1, 1); > + > + switch (bootsource_get()) { > + case BOOTSOURCE_MMC: > + omap_set_bootmmc_devname("mmc0"); > + break; > + case BOOTSOURCE_NAND: > + omap_set_barebox_part(&myir_barebox_part); > + break; > + default: > + break; > + } > + > + if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT)) > + defaultenv_append_directory(defaultenv_myirtech_x335x); > + > + if (IS_ENABLED(CONFIG_SHELL_NONE)) > + return am33xx_of_register_bootdevice(); > + > + return 0; > +} > +coredevice_initcall(myir_devices_init); > diff --git a/arch/arm/boards/myirtech-x335x/defaultenv-myirtech-x335x/boot/nand b/arch/arm/boards/myirtech-x335x/defaultenv-myirtech-x335x/boot/nand > new file mode 100644 > index 0000000000..aca093eebb > --- /dev/null > +++ b/arch/arm/boards/myirtech-x335x/defaultenv-myirtech-x335x/boot/nand > @@ -0,0 +1,4 @@ > +#!/bin/sh > + > +global.bootm.image="/dev/nand0.system.ubi.kernel" > +global.linux.bootargs.dyn.root="ubi.mtd=system ubi.block=0,root ro" > diff --git a/arch/arm/boards/myirtech-x335x/defaultenv-myirtech-x335x/nv/boot.default b/arch/arm/boards/myirtech-x335x/defaultenv-myirtech-x335x/nv/boot.default > new file mode 100644 > index 0000000000..026a25cc7e > --- /dev/null > +++ b/arch/arm/boards/myirtech-x335x/defaultenv-myirtech-x335x/nv/boot.default > @@ -0,0 +1 @@ > +nand > diff --git a/arch/arm/boards/myirtech-x335x/defaultenv-myirtech-x335x/nv/linux.bootargs.console b/arch/arm/boards/myirtech-x335x/defaultenv-myirtech-x335x/nv/linux.bootargs.console > new file mode 100644 > index 0000000000..4310fdd693 > --- /dev/null > +++ b/arch/arm/boards/myirtech-x335x/defaultenv-myirtech-x335x/nv/linux.bootargs.console > @@ -0,0 +1 @@ > +console=ttyS0,115200n8 earlyprintk The console= part shouldn't be needed. barebox should add a console= parameter matching the current barebox console automatically. I wouldn't add the earlyprintk by default. It might break booting when the kernel is not exactly configured for your board. Anyway, that's personal taste. > diff --git a/arch/arm/configs/am335x_mlo_defconfig b/arch/arm/configs/am335x_mlo_defconfig > index 51d238db3e..83bb20e4b5 100644 > --- a/arch/arm/configs/am335x_mlo_defconfig > +++ b/arch/arm/configs/am335x_mlo_defconfig > @@ -5,6 +5,7 @@ CONFIG_OMAP_SERIALBOOT=y > CONFIG_OMAP_MULTI_BOARDS=y > CONFIG_MACH_AFI_GF=y > CONFIG_MACH_BEAGLEBONE=y > +CONFIG_MACH_MYIRTECH_X335X=y > CONFIG_MACH_PHYTEC_SOM_AM335X=y > CONFIG_THUMB2_BAREBOX=y > # CONFIG_MEMINFO is not set > diff --git a/arch/arm/configs/myirtech_am335x_myd_defconfig b/arch/arm/configs/myirtech_am335x_myd_defconfig Do you need this config? I rather prefer to add the board to some existing config, omap_defconfig in this case. 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@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox