On 25/04/2022 20:06, Angus Ainslie wrote:
> Initial commit of Librem5 u-boot and SPL
> 
> Signed-off-by: Angus Ainslie <an...@akkea.ca>
> Co-developed-by: Sebastian Krzyszkowiak <sebastian.krzyszkow...@puri.sm>
> Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkow...@puri.sm>
> ---
> 
> All of the pre-requisite patches for this board are now upstream or in review.
> 
> Changes since v3:
> 
> Dropped unused MMCROOT
> Rebased on u-boot-imx
> Needs this patch to supress SPL warnings
> https://lists.denx.de/pipermail/u-boot/2022-April/482369.html
> 
> Changes since v2:
> 
> Cleanup Kconfig symbols used in librem5.h
> Cleanup various checkpatch issues
> Drop some un-used functions
> 
> Changes since v1:
> 
> Merged patches into a monolithic board patch
> Using DM drivers for devices in u-boot
> Added USB storage support for uSD rootfs
> Dropped many SPL_BUILD guarded define's
> Fixed documentation index
> 
>  arch/arm/dts/Makefile                        |    3 +-
>  arch/arm/dts/imx8mq-librem5-r4-u-boot.dtsi   |  134 ++
>  arch/arm/dts/imx8mq-librem5-r4.dts           |   35 +
>  arch/arm/dts/imx8mq-librem5.dtsi             | 1255 +++++++++++++++++
>  arch/arm/mach-imx/imx8m/Kconfig              |    9 +
>  board/purism/librem5/Kconfig                 |   15 +
>  board/purism/librem5/MAINTAINERS             |    8 +
>  board/purism/librem5/Makefile                |   13 +
>  board/purism/librem5/imximage-8mq-lpddr4.cfg |    8 +
>  board/purism/librem5/librem5.c               |  425 ++++++
>  board/purism/librem5/librem5.h               |  181 +++
>  board/purism/librem5/lpddr4_timing.c         | 1324 ++++++++++++++++++
>  board/purism/librem5/lpddr4_timing_b0.c      | 1191 ++++++++++++++++
>  board/purism/librem5/spl.c                   |  593 ++++++++
>  configs/librem5_defconfig                    |  142 ++
>  doc/board/index.rst                          |    1 +
>  doc/board/purism/index.rst                   |    9 +
>  doc/board/purism/librem5.rst                 |   60 +
>  include/configs/librem5.h                    |  113 ++
>  19 files changed, 5518 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/dts/imx8mq-librem5-r4-u-boot.dtsi
>  create mode 100644 arch/arm/dts/imx8mq-librem5-r4.dts
>  create mode 100644 arch/arm/dts/imx8mq-librem5.dtsi
>  create mode 100644 board/purism/librem5/Kconfig
>  create mode 100644 board/purism/librem5/MAINTAINERS
>  create mode 100644 board/purism/librem5/Makefile
>  create mode 100644 board/purism/librem5/imximage-8mq-lpddr4.cfg
>  create mode 100644 board/purism/librem5/librem5.c
>  create mode 100644 board/purism/librem5/librem5.h
>  create mode 100644 board/purism/librem5/lpddr4_timing.c
>  create mode 100644 board/purism/librem5/lpddr4_timing_b0.c
>  create mode 100644 board/purism/librem5/spl.c
>  create mode 100644 configs/librem5_defconfig
>  create mode 100644 doc/board/purism/index.rst
>  create mode 100644 doc/board/purism/librem5.rst
>  create mode 100644 include/configs/librem5.h
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 90f86e3fca..719fd7db8d 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -937,7 +937,8 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
>       imx8mp-venice-gw74xx.dtb \
>       imx8mp-verdin.dtb \
>       imx8mq-pico-pi.dtb \
> -     imx8mq-kontron-pitx-imx8m.dtb
> +     imx8mq-kontron-pitx-imx8m.dtb \
> +     imx8mq-librem5-r4.dtb
>  
>  dtb-$(CONFIG_ARCH_IMXRT) += imxrt1050-evk.dtb \
>       imxrt1020-evk.dtb
> diff --git a/arch/arm/dts/imx8mq-librem5-r4-u-boot.dtsi 
> b/arch/arm/dts/imx8mq-librem5-r4-u-boot.dtsi
> new file mode 100644
> index 0000000000..e3f780ca75
> --- /dev/null
> +++ b/arch/arm/dts/imx8mq-librem5-r4-u-boot.dtsi
> @@ -0,0 +1,134 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +
> +/ {
> +     binman: binman {
> +             multiple-images;
> +     };
> +};
> +
> +&binman {
> +     u-boot-spl-ddr {
> +             filename = "u-boot-spl-ddr.bin";
> +             pad-byte = <0xff>;
> +             align-size = <4>;
> +             align = <4>;
> +
> +             u-boot-spl {
> +                     align-end = <4>;
> +             };
> +
> +             blob_1: blob-ext@1 {
> +                     filename = "lpddr4_pmu_train_1d_imem.bin";
> +                     size = <0x8000>;
> +             };
> +
> +             blob_2: blob-ext@2 {
> +                     filename = "lpddr4_pmu_train_1d_dmem.bin";
> +                     size = <0x4000>;
> +             };
> +
> +             blob_3: blob-ext@3 {
> +                     filename = "lpddr4_pmu_train_2d_imem.bin";
> +                     size = <0x8000>;
> +             };
> +
> +             blob_4: blob-ext@4 {
> +                     filename = "lpddr4_pmu_train_2d_dmem.bin";
> +                     size = <0x4000>;
> +             };
> +     };
> +
> +     spl {
> +             filename = "spl.bin";
> +
> +             mkimage {
> +                     args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 
> 0x7e1000";
> +
> +                     blob {
> +                             filename = "u-boot-spl-ddr.bin";
> +                     };
> +             };
> +     };
> +
> +     itb {
> +             filename = "u-boot.itb";
> +
> +             fit {
> +                     description = "Configuration to load ATF before U-Boot";
> +                     #address-cells = <1>;
> +                     fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
> +
> +                     images {
> +                             uboot {
> +                                     description = "U-Boot (64-bit)";
> +                                     type = "standalone";
> +                                     arch = "arm64";
> +                                     compression = "none";
> +                                     load = <CONFIG_SYS_TEXT_BASE>;
> +
> +                                     uboot_blob: blob-ext {
> +                                             filename = "u-boot-nodtb.bin";
> +                                     };
> +                             };
> +
> +                             atf {
> +                                     description = "ARM Trusted Firmware";
> +                                     type = "firmware";
> +                                     arch = "arm64";
> +                                     compression = "none";
> +                                     load = <0x910000>;
> +                                     entry = <0x910000>;
> +
> +                                     atf_blob: blob-ext {
> +                                             filename = "bl31.bin";
> +                                     };
> +                             };
> +
> +                             fdt {
> +                                     description = "NAME";
> +                                     type = "flat_dt";
> +                                     compression = "none";
> +
> +                                     uboot_fdt_blob: blob-ext {
> +                                             filename = "u-boot.dtb";
> +                                     };
> +                             };
> +                     };
> +
> +                     configurations {
> +                             default = "conf";
> +
> +                             conf {
> +                                     description = "NAME";
> +                                     firmware = "uboot";
> +                                     loadables = "atf";
> +                                     fdt = "fdt";
> +                             };
> +                     };
> +             };
> +     };
> +
> +     imx-boot {
> +             filename = "flash.bin";
> +             pad-byte = <0x00>;
> +
> +             spl: blob-ext@1 {
> +                     offset = <0x0>;
> +                     filename = "spl.bin";
> +             };
> +
> +             uboot: blob-ext@2 {
> +                     offset = <0x57c00>;
> +                     filename = "u-boot.itb";
> +             };
> +     };
> +};

These look mostly the same as imx8mq-u-boot.dtsi, try #include-ing that
instead of duplicating things here.

> +
> +[...]

Reply via email to