1# 2# Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 3# 4# SPDX-License-Identifier: GPL-2.0-only 5# 6 7cmake_minimum_required(VERSION 3.7.2) 8 9declare_platform(am335x KernelPlatformAM335X PLAT_AM335X KernelSel4ArchAarch32) 10set(c_configs PLAT_AM335X_BONEBLACK PLAT_AM335X_BONEBLUE) 11set(cmake_configs KernelPlatformAM335XBoneBlack KernelPlatformAM335XBoneBlue) 12set(plat_lists am335x-boneblack am335x-boneblue) 13foreach(config IN LISTS cmake_configs) 14 unset(${config} CACHE) 15endforeach() 16 17if(KernelPlatformAM335X) 18 declare_seL4_arch(aarch32) 19 20 set(KernelHardwareDebugAPIUnsupported ON CACHE INTERNAL "") 21 22 set(KernelArmCortexA8 ON) 23 set(KernelArchArmV7a ON) 24 check_platform_and_fallback_to_default(KernelARMPlatform "am335x-boneblack") 25 list(FIND plat_lists ${KernelARMPlatform} index) 26 if("${index}" STREQUAL "-1") 27 message(FATAL_ERROR "Which am335x platform not specified") 28 endif() 29 30 list(GET c_configs ${index} c_config) 31 list(GET cmake_configs ${index} cmake_config) 32 config_set(KernelARMPlatform ARM_PLAT ${KernelARMPlatform}) 33 config_set(${cmake_config} ${c_config} ON) 34 list(APPEND KernelDTSList "tools/dts/${KernelARMPlatform}.dts") 35 if("${KernelARMPlatform}" STREQUAL "am335x-boneblack") 36 list(APPEND KernelDTSList "src/plat/am335x/overlay-am335x-boneblack.dts") 37 endif() 38 list(APPEND KernelDTSList "src/plat/am335x/overlay-am335x.dts") 39 40 declare_default_headers( 41 MAX_IRQ 127 42 TIMER drivers/timer/am335x.h 43 INTERRUPT_CONTROLLER 44 drivers/irq/am335x.h 45 # DMTIMER 2-7 have programmable CLKSRC. 46 # Currently Kernel timer is DMTIMER4 using CLK_M_OSC. 47 TIMER_FREQUENCY 24000000llu 48 CLK_MAGIC 2863311531llu 49 CLK_SHIFT 36u 50 KERNEL_WCET 10u 51 ) 52endif() 53 54add_sources( 55 DEP "KernelPlatformAM335X" 56 CFILES src/plat/am335x/machine/hardware.c src/plat/am335x/machine/l2cache.c 57) 58