diff options
Diffstat (limited to 'py/config/bsp.py')
-rw-r--r-- | py/config/bsp.py | 423 |
1 files changed, 423 insertions, 0 deletions
diff --git a/py/config/bsp.py b/py/config/bsp.py new file mode 100644 index 0000000000..3fc61cad62 --- /dev/null +++ b/py/config/bsp.py @@ -0,0 +1,423 @@ +from glob import glob + + +import inspect + +from imp import new_module +from copy import copy + + +# XXX: This should work in Windows? +def bsp_class(arch_only=None): + map_bsp = {} + bsp_py = glob("bsps/*/*/py/__init__.py") + + for i in bsp_py: + split = i.split("/") + + arch = split[1] + bsp = split[2] + + map_bsp.setdefault(arch, []).append(bsp) + + if arch_only: + return map_bsp[arch] + + return map_bsp + + +def get_option_class(): + map = {} + skip = ("Option", "Boolean", "String", "StringList", "Integer") + + + mod = new_module("RTEMS_OPTION") + + file = "py/config/options.py" + with open(file, "r") as fp: + exec(compile(fp.read(), file, "exec"), mod.__dict__) + + file = "py/waf/option.py" + with open(file, "r") as fp: + exec(compile(fp.read(), file, "exec"), mod.__dict__) + + list_bsp = bsp_class() + + for arch in list_bsp: + + file = "bsps/%s/py/option.py" % arch + with open(file, "r") as fp: + exec(compile(fp.read(), file, "exec"), mod.__dict__) + + for bsp in list_bsp[arch]: + file = "bsps/%s/%s/py/option.py" % (arch, bsp) + with open(file, "r") as fp: + exec(compile(fp.read(), file, "exec"), mod.__dict__) + + for i in mod.__dict__.keys(): + m = getattr(mod, i) + try: + if m.__module__ == "RTEMS_OPTION": + map[i] = m + except: + pass + + return map + + +# Collect a list of configs from a module +# XXX: Check to make sure only configs are passed to this, remove the 'skip' list. +def get_config_class(): + config_list = [] + skip = ("__class__", "Base", "Config") + + list_bsp = bsp_class() + + for arch in list_bsp: + mod = new_module("RTEMS_CONFIG") + file = "bsps/%s/py/base.py" % arch + with open(file, "r") as fp: + exec(compile(fp.read(), file, "exec"), mod.__dict__) + for bsp in list_bsp[arch]: + file = "bsps/%s/%s/py/bsp.py" % (arch, bsp) + with open(file, "r") as fp: + exec(compile(fp.read(), file, "exec"), mod.__dict__) + mod.BSP.name = "%s/%s" % (mod.BSP.arch, mod.BSP.bsp) + + config_list.append(mod.BSP) + + return config_list + + + + +# XXX: This should work in Windows? +def map_bsp(arch_only=None): + map_bsp = {} + + for i in get_config_class(): + if arch_only: + map_bsp[i.arch] + else: + map_bsp.setdefault(i.arch, []).append(i.bsp) + + return map_bsp + + + + + +""" +list_bsp = { + "arm": [ + "altcycv_devkit", + "altcycv_devkit_smp", + "arm1136jfs", + "arm1136js", + "arm7tdmi", + "arm920", + "armcortexa9", + "bbxm", + "beagleboardorig", + "beagleboardxm", + "beagleboneblack", + "beaglebonewhite", + "csb336", + "csb337", + "csb637", + "edb7312", + "gba", + "gp32", + "gumstix", + "kit637_v6", + "lm3s3749", + "lm3s6965", + "lm3s6965_qemu", + "lm4f120", + "lpc1768_mbed", + "lpc1768_mbed_ahb_ram", + "lpc1768_mbed_ahb_ram_eth", + "lpc17xx_ea_ram", + "lpc17xx_ea_rom_int", + "lpc17xx_plx800_ram", + "lpc17xx_plx800_rom_int", + "lpc2362", + "lpc23xx_tli800", + "lpc24xx_ea", + "lpc24xx_ncs_ram", + "lpc24xx_ncs_rom_ext", + "lpc24xx_ncs_rom_int", + "lpc24xx_plx800_ram", + "lpc24xx_plx800_rom_int", + "lpc32xx_mzx", + "lpc32xx_mzx_stage_1", + "lpc32xx_mzx_stage_2", + "lpc32xx_phycore", + "lpc40xx_ea_ram", + "lpc40xx_ea_rom_int", + "nds", + "raspberrypi", + "realview_pbx_a9_qemu", + "realview_pbx_a9_qemu_smp", + "rtl22xx", + "rtl22xx_t", + "smdk2410", + "stm32f105rc", + "stm32f4", + "tms570ls3137_hdk", + "tms570ls3137_hdk_intram", + "tms570ls3137_hdk_sdram", + "xilinx_zynq_a9_qemu", + "xilinx_zynq_zc702", + "xilinx_zynq_zc706", + "xilinx_zynq_zedboard", + ], + + "avr": [ + "avrtest", + ], + + "bfin": [ + "bf537stamp", + "ezkit533", + "tll6527m", + ], + + "h8300": [ + "h8sim", + "h8sxsim", + ], + + "i386": [ + "pc386", + "pc486", + "pc586", + "pc586-sse", + "pc686", + "pcp4", + ], + + "lm32": [ + "lm32_evr", + "milkymist", + ], + + "m32c": [ + "m32csim", + ], + + "m32r": [ + "m32rsim", + ], + + "m68k": [ + "av5282", + "cobra5475", + "csb360", + "gen68302", + "gen68340", + "gen68360", + "gen68360_040", + "idp", + "m5484fireengine", + "mcf5206elite", + "mcf52235", + "mcf5225x", + "mcf5235", + "mcf5329", + "mrm332", + "mvme136", + "mvme147", + "mvme147s", + "mvme162", + "mvme162lx", + "mvme167", + "ods68302", + "pgh360", + "sim68000", + "simcpu32", + "uc5282", + ], + + "mips": [ + "csb350", + "genmongoosev", + "hurricane", + "jmr3904", + "malta", + "rbtx4925", + "rbtx4938", + ], + + "moxie": [ + "moxiesim", + ], + + "nios2": [ + "nios2_iss", + ], + + "or1k": [ + "or1ksim", + "sim", + ], + + "powerpc": [ + "beatnik", + "br_uid", + "brs5l", + "brs6l", + "dp2", + "ep1a", + "gwlcfm", + "haleakala", + "hsc_cm01", + "icecube", + "mbx821_001", + "mbx821_002", + "mbx821_002b", + "mbx860_001b", + "mbx860_002", + "mbx860_005b", + "mbx860_1b", + "mcp750", + "mpc5566evb", + "mpc5566evb_spe", + "mpc5643l_dpu", + "mpc5643l_evb", + "mpc5668g", + "mpc5674f_ecu508_app", + "mpc5674f_ecu508_boot", + "mpc5674f_rsm6", + "mpc5674fevb", + "mpc5674fevb_spe", + "mpc8260ads", + "mpc8309som", + "mpc8313erdb", + "mpc8349eamds", + "mtx603e", + "mvme2100", + "mvme2307", + "mvme3100", + "mvme5500", + "pghplus", + "phycore_mpc5554", + "pm520_cr825", + "pm520_ze30", + "psim", + "qemuppc", + "qemuprep", + "qemuprep-altivec", + "qoriq_core_0", + "qoriq_core_1", + "qoriq_p1020rdb", + "score603e", + "ss555", + "t32mppc", + "tqm8xx_stk8xx", + "virtex", + "virtex4", + "virtex5", + ], + + "sh": [ + "gensh1", + "gensh2", + "gensh4", + "simsh1", + "simsh2", + "simsh2e", + "simsh4", + ], + + "sparc": [ + "erc32", + "leon2", + "leon3", + "ngmp", + "sis", + ], + + "sparc64": [ + "niagara", + "usiii", + ], + + "v850": [ + "v850e1sim", + "v850e2sim", + "v850e2v3sim", + "v850esim", + "v850essim", + "v850sim", + ] +} + + + +list_bsp = { + "arm": [ + "lm3s3749", + "lm3s6965", + "lm3s6965_qemu", + "lpc17xx_ea_ram", + "lpc17xx_ea_rom_int", + "lpc17xx_plx800_ram", + "lpc17xx_plx800_rom_int", + "lpc24xx_plx800_ram", + "lpc24xx_plx800_rom_int", + "raspberrypi", + "realview_pbx_a9_qemu", + "stm32f4", + "xilinx_zynq_a9_qemu", + ], + + "i386": [ + "pcp4", + ], + + "mips": [ + "malta", + ], + + "moxie": [ + "moxiesim", + ], + + "nios2": [ + "nios2_iss", + ], + + "powerpc": [ + "br_uid", + "brs6l", + "mpc5566evb_spe", + "mpc5643l_dpu", + "mpc5643l_evb", + "mpc5674f_ecu508_app", + "mpc5674f_ecu508_boot", + "mpc5674f_rsm6", + "mpc5674fevb", + "mpc5674fevb_spe", + "mpc8309som", + "phycore_mpc5554", + "qemuprep", + "qemuprep-altivec", + "qoriq_core_0", + "qoriq_core_1", + "qoriq_p1020rdb", + "t32mppc", + "virtex4", + "virtex5", + ], + + "v850": [ + "v850e1sim", + "v850e2sim", + "v850e2v3sim", + "v850esim", + "v850essim", + "v850sim", + ] +} +""" |