Skip to content

Commit

Permalink
arm64/imx9: add imx93-evk ddr training
Browse files Browse the repository at this point in the history
This performs the training for imx93-evk. In addition to the source code,
it downloads binaries which are included in the final image.

Signed-off-by: Eero Nurkkala <[email protected]>
  • Loading branch information
eenurkka committed Sep 20, 2024
1 parent 7c4bf98 commit 51c6d86
Show file tree
Hide file tree
Showing 8 changed files with 2,591 additions and 10 deletions.
11 changes: 9 additions & 2 deletions arch/arm64/src/imx9/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

include common/Make.defs

ifeq ($(CONFIG_IMX9_DDR_TRAINING),y)
include imx9/ddr/Make.defs
endif

# i.MX9-specific C source files

CHIP_CSRCS = imx9_boot.c imx9_ccm.c imx9_clockconfig.c imx9_gpio.c imx9_iomuxc.c
Expand Down Expand Up @@ -77,6 +81,9 @@ ifeq ($(CONFIG_IMX9_FLEXSPI_NOR), y)
endif

ifeq ($(CONFIG_IMX9_BOOTLOADER), y)
CHIP_CSRCS += imx9_system_ctl.c
CHIP_CSRCS += imx9_trdc.c
CHIP_CSRCS += imx9_system_ctl.c
CHIP_CSRCS += imx9_trdc.c
ifeq ($(CONFIG_IMX9_DDR_TRAINING),y)
CHIP_CSRCS += $(DDR_CSRCS)
endif
endif
50 changes: 50 additions & 0 deletions arch/arm64/src/imx9/ddr/Make.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
############################################################################
# arch/arm64/src/imx9/ddr/Make.defs
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################

include common/Make.defs

DEPPATH += --dep-path imx9/ddr
VPATH += imx9/ddr
SUBDIRS += imx9/ddr

DDR_CSRCS += imx9_ddr_training.c

DDR_UNPACK = firmware-imx-8.23
BASE_URL = https://www.nxp.com/lgfiles/NMG/MAD/YOCTO
DDR_BINARY = $(DDR_UNPACK).bin

$(DDR_BINARY):
$(call DOWNLOAD,$(BASE_URL),$(DDR_UNPACK).bin,imx9/ddr/$(DDR_BINARY))

.ddrunpack: $(DDR_BINARY)
$(Q) echo "Unpacking ddr binaries"
$(Q) chmod a+x ./imx9/ddr/$(DDR_BINARY)
$(Q) (cd imx9/ddr && ./$(DDR_BINARY) --auto-accept)
$(Q) touch imx9/ddr/.ddrunpack

ifeq ($(wildcard ddr/$(DDR_UNPACK)/.scmversion),)
context:: .ddrunpack

distclean::
$(call DELFILE, imx9/ddr/.ddr_unpack)
$(call DELFILE, imx9/ddr/$(DDR_BINARY))
$(call DELDIR, imx9/ddr/$(DDR_UNPACK))

endif
Loading

0 comments on commit 51c6d86

Please sign in to comment.