mirror of
https://github.com/drasko/codezero.git
synced 2026-02-27 09:13:13 +01:00
More progress on build scripts
Created a config directory for configuration files. Moved all absolute path variables to a projpaths.py file All scripts can now universally learn absolute paths via projpaths.py Moved the config_symbols class to the configuration.py file. Moved libs to loader since they are only referred by the loader
This commit is contained in:
0
config/__init__.py
Normal file
0
config/__init__.py
Normal file
193
config/cml/arm.cml
Normal file
193
config/cml/arm.cml
Normal file
@@ -0,0 +1,193 @@
|
||||
start main_menu
|
||||
|
||||
#############
|
||||
# SYMBOLS #
|
||||
#############
|
||||
symbols
|
||||
|
||||
CONFIG_ARCH_ARM 'ARM'
|
||||
|
||||
arm_cpu_type 'ARM Processor Type'
|
||||
CONFIG_CPU_ARM1136 'ARM1136 - To be added'
|
||||
CONFIG_CPU_ARM11MPCORE 'ARM11 MPCore - To be added'
|
||||
CONFIG_CPU_ARM926 'ARM926EJ-S'
|
||||
CONFIG_CPU_CORTEXA8 'ARM Cortex-A8 - Not supported'
|
||||
|
||||
arm_subarch_type 'ARM Architecture Family'
|
||||
CONFIG_SUBARCH_V5 'ARM v5 Architecture'
|
||||
CONFIG_SUBARCH_V6 'ARM v6 Architecture, To be added'
|
||||
CONFIG_SUBARCH_V7 'ARM v7 Architecture, To be added'
|
||||
|
||||
arm_platform_type 'ARM Platform Type'
|
||||
CONFIG_PLATFORM_EB 'Realview EB Platform, Unsupported yet'
|
||||
CONFIG_PLATFORM_AB926 'Versatile AB926 Platform, Unsupported yet'
|
||||
CONFIG_PLATFORM_PB926 'Versatile PB926 Platform'
|
||||
CONFIG_PLATFORM_PB11MPCORE 'Realview PB11MPCore Platform'
|
||||
CONFIG_PLATFORM_PBA8 'Realview PB-A8 Platform'
|
||||
|
||||
CONFIG_DRIVER_UART_PL011 'ARM UART Primecell driver PL011'
|
||||
CONFIG_DRIVER_TIMER_SP804 'ARM Dual Timer Primecell driver SP804'
|
||||
CONFIG_DRIVER_IRQ_PL190 'ARM Vectored Interrupt Controller PL190'
|
||||
CONFIG_DRIVER_IRQ_GIC 'ARM Generic Interrupt Controller GIC'
|
||||
|
||||
main_menu 'Codezero Microkernel Configurator'
|
||||
arm_menu 'ARM Architecture Configuration'
|
||||
#arm_subarch_menu 'ARM Architecture Version'
|
||||
arm_cpu_menu 'ARM CPU type'
|
||||
arm_platform_menu 'ARM Platform Type'
|
||||
drivers_menu 'Platform Drivers'
|
||||
arch_type 'Main architecture'
|
||||
containers_menu 'Container Setup'
|
||||
|
||||
CONFIG_CONTAINERS 'Number of containers'
|
||||
CONFIG_CONT0_PHYS_START 'Cont0 Physical Start Address' text
|
||||
Physical address that this containers starts
|
||||
.
|
||||
|
||||
CONFIG_CONT0_PHYS_END 'Cont0 Physical End Address' text
|
||||
Physical address that this container ends
|
||||
.
|
||||
|
||||
CONFIG_CONT1_PHYS_START 'Cont1 Physical Start Address' text
|
||||
Physical address that this containers starts
|
||||
.
|
||||
|
||||
CONFIG_CONT1_PHYS_END 'Cont1 Physical End Address' text
|
||||
Physical address that this container ends
|
||||
.
|
||||
|
||||
CONFIG_CONT2_PHYS_START 'Cont2 Physical Start Address' text
|
||||
physical address that this containers starts
|
||||
.
|
||||
|
||||
CONFIG_CONT2_PHYS_END 'Cont2 Physical End Address' text
|
||||
Physical address that this container ends
|
||||
.
|
||||
|
||||
CONFIG_CONT3_PHYS_START 'Cont3 Physical Start Address' text
|
||||
physical address that this containers starts
|
||||
.
|
||||
|
||||
CONFIG_CONT3_PHYS_END 'Cont3 Physical End Address' text
|
||||
Physical address that this container ends
|
||||
.
|
||||
|
||||
|
||||
|
||||
|
||||
#############
|
||||
# CHOICES #
|
||||
#############
|
||||
choices arch_type
|
||||
CONFIG_ARCH_ARM
|
||||
default CONFIG_ARCH_ARM
|
||||
|
||||
choices arm_subarch_type
|
||||
CONFIG_SUBARCH_V5
|
||||
CONFIG_SUBARCH_V6
|
||||
CONFIG_SUBARCH_V7
|
||||
default CONFIG_SUBARCH_V5
|
||||
|
||||
choices arm_cpu_type
|
||||
CONFIG_CPU_ARM926
|
||||
CONFIG_CPU_ARM1136
|
||||
CONFIG_CPU_ARM11MPCORE
|
||||
CONFIG_CPU_CORTEXA8
|
||||
default CONFIG_CPU_ARM926
|
||||
|
||||
choices arm_platform_type
|
||||
CONFIG_PLATFORM_EB
|
||||
CONFIG_PLATFORM_AB926
|
||||
CONFIG_PLATFORM_PB926
|
||||
CONFIG_PLATFORM_PB11MPCORE
|
||||
CONFIG_PLATFORM_PBA8
|
||||
default CONFIG_PLATFORM_PB926
|
||||
|
||||
#############
|
||||
# MENUS #
|
||||
#############
|
||||
menu containers_menu
|
||||
CONFIG_CONT0_PHYS_START@
|
||||
CONFIG_CONT0_PHYS_END@
|
||||
CONFIG_CONT1_PHYS_START@
|
||||
CONFIG_CONT1_PHYS_END@
|
||||
CONFIG_CONT2_PHYS_START@
|
||||
CONFIG_CONT2_PHYS_END@
|
||||
CONFIG_CONT3_PHYS_START@
|
||||
CONFIG_CONT3_PHYS_END@
|
||||
|
||||
menu arm_cpu_menu
|
||||
arm_cpu_type
|
||||
|
||||
menu arm_platform_menu
|
||||
arm_platform_type
|
||||
|
||||
menu drivers_menu
|
||||
CONFIG_DRIVER_UART_PL011
|
||||
CONFIG_DRIVER_TIMER_SP804
|
||||
CONFIG_DRIVER_IRQ_PL190
|
||||
CONFIG_DRIVER_IRQ_GIC
|
||||
|
||||
menu arm_menu
|
||||
arm_subarch_type
|
||||
arm_cpu_menu
|
||||
arm_platform_menu
|
||||
drivers_menu
|
||||
|
||||
menu main_menu
|
||||
arch_type
|
||||
arm_menu
|
||||
CONFIG_CONTAINERS%
|
||||
containers_menu
|
||||
|
||||
#############
|
||||
# RULES #
|
||||
#############
|
||||
|
||||
#Platform rules:
|
||||
unless CONFIG_SUBARCH_V5 suppress CONFIG_PLATFORM_PB926
|
||||
unless CONFIG_SUBARCH_V5 suppress CONFIG_PLATFORM_AB926
|
||||
unless CONFIG_SUBARCH_V6 suppress CONFIG_PLATFORM_PB11MPCORE
|
||||
unless CONFIG_SUBARCH_V7 suppress CONFIG_PLATFORM_PBA8
|
||||
|
||||
#CPU rules:
|
||||
unless CONFIG_SUBARCH_V5 suppress CONFIG_CPU_ARM926
|
||||
unless CONFIG_SUBARCH_V6 suppress CONFIG_CPU_ARM1136
|
||||
unless CONFIG_SUBARCH_V6 suppress CONFIG_CPU_ARM11MPCORE
|
||||
unless CONFIG_SUBARCH_V7 suppress CONFIG_CPU_CORTEXA8
|
||||
|
||||
# NOTE: Unlike menus, choices dont take { sym } model of visibility
|
||||
# dependencies. Instead, a choice symbol is declared in a menu, and
|
||||
# suppress statement is used to make sym visible, instead of a
|
||||
# { sym } model under the choices. (See manual for { sym } usage).
|
||||
|
||||
unless CONFIG_SUBARCH_V5 suppress CONFIG_PLATFORM_PB926
|
||||
unless CONFIG_ARCH_ARM suppress arm_menu
|
||||
unless CONFIG_PLATFORM_PB926 or CONFIG_PLATFORM_AB926 suppress CONFIG_DRIVER_IRQ_PL190
|
||||
unless CONFIG_PLATFORM_EB suppress CONFIG_CPU_ARM1136
|
||||
unless CONFIG_PLATFORM_EB or CONFIG_PLATFORM_PBA8 or CONFIG_PLATFORM_PB11MPCORE suppress CONFIG_DRIVER_IRQ_GIC
|
||||
default CONFIG_DRIVER_UART_PL011 from y
|
||||
default CONFIG_DRIVER_TIMER_SP804 from y
|
||||
default CONFIG_DRIVER_IRQ_PL190 from y
|
||||
default CONFIG_DRIVER_IRQ_GIC from y
|
||||
|
||||
# Container Rules
|
||||
default CONFIG_CONTAINERS from 1
|
||||
unless CONFIG_CONTAINERS > 1 suppress CONFIG_CONT1_PHYS_START CONFIG_CONT1_PHYS_END
|
||||
unless CONFIG_CONTAINERS > 2 suppress CONFIG_CONT2_PHYS_START CONFIG_CONT2_PHYS_END
|
||||
unless CONFIG_CONTAINERS > 3 suppress CONFIG_CONT3_PHYS_START CONFIG_CONT3_PHYS_END
|
||||
|
||||
default CONFIG_CONT0_PHYS_START from 0x40000
|
||||
default CONFIG_CONT0_PHYS_END from 0x1000000
|
||||
default CONFIG_CONT1_PHYS_START from 0x1000000
|
||||
default CONFIG_CONT1_PHYS_END from 0x2000000
|
||||
default CONFIG_CONT2_PHYS_START from 0x2000000
|
||||
default CONFIG_CONT2_PHYS_END from 0x3000000
|
||||
default CONFIG_CONT3_PHYS_START from 0x3000000
|
||||
default CONFIG_CONT3_PHYS_END from 0x4000000
|
||||
|
||||
|
||||
# USELESS!! This doesnt force it to define invisible symbols as says in the manual.
|
||||
#when ARCH_TEST save SUBARCH_TEST PLATFORM_TEST
|
||||
#derive SUBARCH_TEST from ARCH_TEST
|
||||
#derive PLATFORM_TEST from ARCH_TEST
|
||||
47
config/configuration.py
Normal file
47
config/configuration.py
Normal file
@@ -0,0 +1,47 @@
|
||||
#! /usr/bin/env python2.6
|
||||
# -*- mode: python; coding: utf-8; -*-
|
||||
|
||||
import os, sys, shelve, shutil
|
||||
|
||||
class config_symbols:
|
||||
arch = None
|
||||
subarch = None
|
||||
platform = None
|
||||
kbuild = []
|
||||
all = []
|
||||
|
||||
# Get all name value symbols
|
||||
def get_all(self, name, val):
|
||||
self.all.append([name, val])
|
||||
|
||||
# Convert line to name value pair, if possible
|
||||
def line_to_name_value(self, line):
|
||||
parts = line.split()
|
||||
if len(parts) > 0:
|
||||
if parts[0] == "#define":
|
||||
return parts[1], parts[2]
|
||||
return None
|
||||
|
||||
# Extract architecture from a name value pair
|
||||
def get_arch(self, name, val):
|
||||
if name[:len("CONFIG_ARCH_")] == "CONFIG_ARCH_":
|
||||
parts = name.split("_", 3)
|
||||
self.arch = parts[2].lower()
|
||||
|
||||
# Extract subarch from a name value pair
|
||||
def get_subarch(self, name, val):
|
||||
if name[:len("CONFIG_SUBARCH_")] == "CONFIG_SUBARCH_":
|
||||
parts = name.split("_", 3)
|
||||
self.subarch = parts[2].lower()
|
||||
|
||||
# Extract platform from a name value pair
|
||||
def get_platform(self, name, val):
|
||||
if name[:len("CONFIG_PLATFORM_")] == "CONFIG_PLATFORM_":
|
||||
parts = name.split("_", 3)
|
||||
self.platform = parts[2].lower()
|
||||
|
||||
# Extract number of containers
|
||||
def get_ncontainers(self, name, val):
|
||||
if name[:len("CONFIG_CONTAINERS")] == "CONFIG_CONTAINERS":
|
||||
self.ncontainers = val
|
||||
|
||||
20
config/projpaths.py
Normal file
20
config/projpaths.py
Normal file
@@ -0,0 +1,20 @@
|
||||
#! /usr/bin/env python2.6
|
||||
# -*- mode: python; coding: utf-8; -*-
|
||||
|
||||
import os, sys, shelve, shutil
|
||||
from os.path import join
|
||||
|
||||
# Way to get project root from any script importing this one :-)
|
||||
PROJROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
||||
|
||||
BUILDDIR = join(PROJROOT, "build")
|
||||
TOOLSDIR = join(PROJROOT, "tools")
|
||||
CML2_CONFIG_SRCDIR = join(PROJROOT, "config/cml")
|
||||
CML2TOOLSDIR = join(TOOLSDIR, "cml2-tools")
|
||||
CML2RULES = join(BUILDDIR, "cml2_rules.out")
|
||||
CML2_CONFIG_PROPERTIES = join(BUILDDIR, "cml2_config.out")
|
||||
CML2_CONFIG_H = join(BUILDDIR, "cml2_config.h")
|
||||
CONFIG_H = join("include/l4/config.h")
|
||||
CONFIG_SHELVE_DIR = join(BUILDDIR, "configdata")
|
||||
CONFIG_SHELVE_FILENAME = "configuration"
|
||||
CONFIG_SHELVE = join(CONFIG_SHELVE_DIR, CONFIG_SHELVE_FILENAME)
|
||||
Reference in New Issue
Block a user