Commit 739b8e6f authored by Jay Vasanth's avatar Jay Vasanth Committed by Carles Cufi
Browse files

mec172xmodular_assy6930: add board support



Add board files and documentation for mec172xmodular_assy6930.
This is for MEC172x Modular Card support.

Signed-off-by: default avatarJay Vasanth <jay.vasanth@microchip.com>
parent 603cc270
Loading
Loading
Loading
Loading
+35 −0
Original line number Diff line number Diff line
#
# Copyright (c) 2022 Microchip Technology Inc.
#
# SPDX-License-Identifier: Apache-2.0
#

zephyr_library()

#Allow users to pre-specify the tool using '-DMEC172X_SPI_GEN=<path-to-tool>/toolname'
if (NOT DEFINED MEC172X_SPI_GEN)
  set(MEC172X_SPI_GEN $ENV{MEC172X_SPI_GEN})
endif()
find_program (MEC172X_SPI_GEN NAMES mec172x_spi_gen_lin_x86_64 mec172x_spi_gen)
if(MEC172X_SPI_GEN STREQUAL MEC172X_SPI_GEN-NOTFOUND)
  message(WARNING "Microchip SPI Image Generation tool is not available. SPI Image will not be generated.")
endif()

if (NOT DEFINED MEC172X_SPI_CFG)
  set(MEC172X_SPI_CFG $ENV{MEC172X_SPI_CFG})
endif()
find_file (MEC172X_SPI_CFG NAMES spi_cfg_4MBit.txt spi_cfg_128MBit.txt spi_cfg.txt PATHS ${BOARD_DIR}/support)
if(MEC172X_SPI_CFG STREQUAL MEC172X_SPI_CFG-NOTFOUND)
  message(WARNING "Microchip SPI Image Generation tool configuration file is not available. SPI Image will not be generated.")
endif()

if (NOT MEC172X_SPI_GEN STREQUAL MEC172X_SPI_GEN-NOTFOUND AND NOT MEC172X_SPI_CFG STREQUAL MEC172X_SPI_CFG-NOTFOUND)
  set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
    COMMAND ${MEC172X_SPI_GEN}
    -i ${MEC172X_SPI_CFG}
    -o ${PROJECT_BINARY_DIR}/${SPI_IMAGE_NAME}
  )

  unset(MEC172X_SPI_GEN)
  unset(MEC172X_SPI_CFG)
endif()
+6 −0
Original line number Diff line number Diff line
# Copyright (c) 2022, Microchip Technology Inc.
# SPDX-License-Identifier: Apache-2.0

config BOARD_MEC172XMODULAR_ASSY6930
	bool "Microchip MEC172X MODULAR ASSY 6930 Development board"
	depends on SOC_MEC172X_NSZ
+39 −0
Original line number Diff line number Diff line
# Copyright (c) 2022 Microchip Technology Inc.
# SPDX-License-Identifier: Apache-2.0

if BOARD_MEC172XMODULAR_ASSY6930

config BOARD
	default "mec172xmodular_assy6930"

if RTOS_TIMER

# XEC RTOS timer HW frequency is fixed at 32768 Hz.
# The driver requires tickless mode and ticks per second to be 32768 for
# accurate operation.

config SYS_CLOCK_HW_CYCLES_PER_SEC
	default 32768

config SYS_CLOCK_TICKS_PER_SEC
	default 32768

endif # RTOS_TIMER

if !RTOS_TIMER

# If RTOS timer is not enabled we use ARM Cortex-M
# SYSTICK. SYSTICK frequency is 96 MHz divided down by the MEC172x PCR
# processor clock divider register. We assume PCR processor clock divider
# is set to 1. Refer to SOC_MEC172X_PROC_CLK_DIV
#

config SYS_CLOCK_HW_CYCLES_PER_SEC
	default 96000000

config SYS_CLOCK_TICKS_PER_SEC
	default 1000

endif # RTOS_TIMER

endif # BOARD_MEC172XMODULAR_ASSY6930
+11 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: Apache-2.0

set(SPI_IMAGE_NAME spi_image.bin)

board_set_flasher_ifnset(dediprog)

# --vcc=0 - use 3.5V to flash
board_finalize_runner_args(dediprog
  "--spi-image=${PROJECT_BINARY_DIR}/${SPI_IMAGE_NAME}"
  "--vcc=0"
)
+88.4 KiB
Loading image diff...
Loading