ext: hal: altera: Add Altera HAL into Zephyr build system

Make Altera HAL drivers compilable by adding them into
Zephyr build system.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
This commit is contained in:
Ramakrishna Pallala 2017-11-14 17:21:07 -05:00 committed by Anas Nashif
parent 3c922749d6
commit 2c2b087b81
14 changed files with 128 additions and 0 deletions

View file

@ -7,3 +7,4 @@ add_subdirectory_ifdef(CONFIG_HAS_STM32CUBE st)
add_subdirectory(ti)
add_subdirectory(silabs)
add_subdirectory(esp)
add_subdirectory_ifdef(CONFIG_HAS_ALTERA_HAL altera)

View file

@ -12,6 +12,8 @@ menu "HALs"
source "ext/hal/atmel/asf/Kconfig"
source "ext/hal/altera/Kconfig"
source "ext/hal/cmsis/Kconfig"
source "ext/hal/nordic/Kconfig"

View file

@ -0,0 +1,84 @@
#nios2 core/system level headers
zephyr_include_directories(
include
altera_hal/HAL/inc
)
if(CONFIG_ALTERA_AVALON_TIMER)
zephyr_include_directories(
drivers/altera_avalon_timer/inc
drivers/altera_avalon_timer/HAL/inc
)
add_subdirectory(drivers/altera_avalon_timer/HAL/src)
endif()
if(CONFIG_ALTERA_AVALON_SYSID)
zephyr_include_directories(
drivers/altera_avalon_sysid/inc
drivers/altera_avalon_sysid/HAL/inc
)
add_subdirectory(drivers/altera_avalon_sysid/HAL/src)
endif()
if(CONFIG_ALTERA_AVALON_UART)
zephyr_include_directories(
drivers/altera_avalon_uart/inc
drivers/altera_avalon_uart/HAL/inc
drivers/altera_avalon_uart/LWHAL/inc
)
add_subdirectory(
drivers/altera_avalon_uart/HAL/src
drivers/altera_avalon_uart/LWHAL/src
)
endif()
if(CONFIG_UART_ALTERA_JTAG)
zephyr_compile_definitions(ALTERA_AVALON_JTAG_UART_SMALL)
zephyr_include_directories(
drivers/altera_avalon_jtag_uart/inc
drivers/altera_avalon_jtag_uart/HAL/inc
drivers/altera_avalon_jtag_uart/LWHAL/inc
)
add_subdirectory(
drivers/altera_avalon_jtag_uart/HAL/src
drivers/altera_avalon_jtag_uart/LWHAL/src
)
endif()
if(CONFIG_ALTERA_AVALON_SGDMA)
zephyr_include_directories(
drivers/altera_avalon_sgdma/inc
drivers/altera_avalon_sgdma/HAL/inc
)
add_subdirectory(drivers/altera_avalon_sgdma/HAL/src)
endif()
if(CONFIG_ALTERA_AVALON_I2C)
zephyr_include_directories(
drivers/altera_avalon_i2c/inc
drivers/altera_avalon_i2c/HAL/inc
)
add_subdirectory(drivers/altera_avalon_i2c/HAL/src)
endif()
if(CONFIG_ALTERA_AVALON_SPI)
zephyr_include_directories(
drivers/altera_avalon_spi/inc
drivers/altera_avalon_spi/HAL/inc
)
add_subdirectory(drivers/altera_avalon_spi/HAL/src)
endif()
if(CONFIG_ALTERA_AVALON_QSPI)
zephyr_include_directories(
drivers/altera_epcq_controller/inc
drivers/altera_epcq_controller/HAL/inc
)
add_subdirectory(drivers/altera_epcq_controller/HAL/src)
endif()
if(CONFIG_ALTERA_AVALON_QSPI)
zephyr_include_directories(drivers/altera_avalon_pio/inc)
endif()

15
ext/hal/altera/Kconfig Normal file
View file

@ -0,0 +1,15 @@
# Kconfig - Altera HAL drivers configuration
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
# Some of the Altera HAL drivers depends on newlibc
# library, So make sure to enable the NEWLIB_LIBC
# before selecting the Altera HAL.
menuconfig HAS_ALTERA_HAL
bool "Altera HAL drivers support"
default n
depends on NIOS2
depends on NEWLIB_LIBC

View file

@ -0,0 +1 @@
zephyr_sources(altera_avalon_i2c.c)

View file

@ -0,0 +1,7 @@
zephyr_sources(
altera_avalon_jtag_uart_fd.c
altera_avalon_jtag_uart_init.c
altera_avalon_jtag_uart_ioctl.c
altera_avalon_jtag_uart_read.c
altera_avalon_jtag_uart_write.c
)

View file

@ -0,0 +1 @@
zephyr_sources(altera_avalon_jtag_uart_lwhal_putchar.c)

View file

@ -0,0 +1 @@
zephyr_sources(altera_avalon_sgdma.c)

View file

@ -0,0 +1 @@
zephyr_sources(altera_avalon_spi.c)

View file

@ -0,0 +1 @@
zephyr_sources(altera_avalon_sysid.c)

View file

@ -0,0 +1,5 @@
zephyr_sources(
altera_avalon_timer_sc.c
altera_avalon_timer_ts.c
altera_avalon_timer_vars.c
)

View file

@ -0,0 +1,7 @@
zephyr_sources(
altera_avalon_uart_fd.c
altera_avalon_uart_init.c
altera_avalon_uart_ioctl.c
altera_avalon_uart_read.c
altera_avalon_uart_write.c
)

View file

@ -0,0 +1 @@
zephyr_sources(altera_avalon_uart_lwhal_putchar.c)

View file

@ -0,0 +1 @@
zephyr_sources(altera_epcq_controller.c)