diff --git a/base-hw/include/arndale_uart/drivers/serial_log.h b/base-hw/include/exynos5_uart/drivers/serial_log.h similarity index 59% rename from base-hw/include/arndale_uart/drivers/serial_log.h rename to base-hw/include/exynos5_uart/drivers/serial_log.h index c9f7d711b..ea944a5d8 100644 --- a/base-hw/include/arndale_uart/drivers/serial_log.h +++ b/base-hw/include/exynos5_uart/drivers/serial_log.h @@ -1,6 +1,7 @@ /* * \brief Serial output driver for console lib * \author Martin Stein + * \author Stefan Kalkowski * \date 2013-01-09 */ @@ -11,19 +12,19 @@ * under the terms of the GNU General Public License version 2. */ -#ifndef _INCLUDE__ARNDALE_UART__DRIVERS__SERIAL_LOG_H_ -#define _INCLUDE__ARNDALE_UART__DRIVERS__SERIAL_LOG_H_ +#ifndef _INCLUDE__EXYNOS_UART__DRIVERS__SERIAL_LOG_H_ +#define _INCLUDE__EXYNOS_UART__DRIVERS__SERIAL_LOG_H_ /* Genode includes */ #include -#include +#include namespace Genode { /** * Serial output driver for console lib */ - class Serial_log : public Arndale_uart_base + class Serial_log : public Exynos_uart_base { public: @@ -33,11 +34,11 @@ namespace Genode * \param baud_rate targeted transfer baud-rate */ Serial_log(unsigned const baud_rate) : - Arndale_uart_base(Board::UART_2_MMIO_BASE, - Board::UART_2_CLOCK, baud_rate) + Exynos_uart_base(Board::UART_2_MMIO_BASE, + Board::UART_2_CLOCK, baud_rate) { } }; } -#endif /* _INCLUDE__ARNDALE_UART__DRIVERS__SERIAL_LOG_H_ */ +#endif /* _INCLUDE__EXYNOS_UART__DRIVERS__SERIAL_LOG_H_ */ diff --git a/base-hw/mk/spec-hw_arndale.mk b/base-hw/mk/spec-hw_arndale.mk index 18bd21f25..f867035a2 100644 --- a/base-hw/mk/spec-hw_arndale.mk +++ b/base-hw/mk/spec-hw_arndale.mk @@ -1,5 +1,5 @@ # -# \brief Offer build configurations that are specific to base-hw and Pandaboard A2 +# \brief Offer build configurations that are specific to base-hw and Arndale # \author Martin Stein # \date 2013-01-09 # @@ -7,6 +7,9 @@ # denote wich specs are also fullfilled by this spec SPECS += hw platform_arndale +# add repository relative paths +REP_INC_DIR += include/exynos5_uart + # set address where to link the text segment at LD_TEXT_ADDR ?= 0x80000000 diff --git a/base-hw/mk/spec-hw_odroid_xu.mk b/base-hw/mk/spec-hw_odroid_xu.mk new file mode 100644 index 000000000..b552a08ce --- /dev/null +++ b/base-hw/mk/spec-hw_odroid_xu.mk @@ -0,0 +1,18 @@ +# +# \brief Offer build configurations that are specific to base-hw and Odroid XU +# \author Stefan Kalkowski +# \date 2013-11-25 +# + +# denote wich specs are also fullfilled by this spec +SPECS += hw platform_odroid_xu + +# add repository relative paths +REP_INC_DIR += include/exynos5_uart + +# set address where to link the text segment at +LD_TEXT_ADDR ?= 0x80000000 + +# include implied specs +include $(call select_from_repositories,mk/spec-hw.mk) +include $(call select_from_repositories,mk/spec-platform_odroid_xu.mk) diff --git a/base-hw/src/core/arndale/target.mk b/base-hw/src/core/arndale/target.mk index 51db8cd1a..5e07693af 100644 --- a/base-hw/src/core/arndale/target.mk +++ b/base-hw/src/core/arndale/target.mk @@ -10,6 +10,7 @@ REQUIRES += platform_arndale # add include paths INC_DIR += $(REP_DIR)/src/core/arndale +INC_DIR += $(REP_DIR)/src/core/exynos5 INC_DIR += $(REP_DIR)/src/core/arm # add C++ sources diff --git a/base-hw/src/core/arndale/cpu.h b/base-hw/src/core/exynos5/cpu.h similarity index 83% rename from base-hw/src/core/arndale/cpu.h rename to base-hw/src/core/exynos5/cpu.h index e3007b883..519194d0f 100644 --- a/base-hw/src/core/arndale/cpu.h +++ b/base-hw/src/core/exynos5/cpu.h @@ -11,8 +11,8 @@ * under the terms of the GNU General Public License version 2. */ -#ifndef _ARNDALE__CPU_H_ -#define _ARNDALE__CPU_H_ +#ifndef _EXYNOS5__CPU_H_ +#define _EXYNOS5__CPU_H_ /* core includes */ #include @@ -25,5 +25,5 @@ namespace Genode class Cpu : public Cortex_a15::Cpu { }; } -#endif /* _ARNDALE__CPU_H_ */ +#endif /* _EXYNOS5__CPU_H_ */ diff --git a/base-hw/src/core/arndale/pic.h b/base-hw/src/core/exynos5/pic.h similarity index 88% rename from base-hw/src/core/arndale/pic.h rename to base-hw/src/core/exynos5/pic.h index e3037f5de..94fcb7d6e 100644 --- a/base-hw/src/core/arndale/pic.h +++ b/base-hw/src/core/exynos5/pic.h @@ -11,8 +11,8 @@ * under the terms of the GNU General Public License version 2. */ -#ifndef _ARNDALE__PIC_H_ -#define _ARNDALE__PIC_H_ +#ifndef _EXYNOS5__PIC_H_ +#define _EXYNOS5__PIC_H_ /* core includes */ #include @@ -38,5 +38,5 @@ namespace Kernel bool Arm_gic::Pic::_use_security_ext() { return 0; } -#endif /* _ARNDALE__PIC_H_ */ +#endif /* _EXYNOS5__PIC_H_ */ diff --git a/base-hw/src/core/arndale/timer.h b/base-hw/src/core/exynos5/timer.h similarity index 88% rename from base-hw/src/core/arndale/timer.h rename to base-hw/src/core/exynos5/timer.h index 777fec737..d03f71b7d 100644 --- a/base-hw/src/core/arndale/timer.h +++ b/base-hw/src/core/exynos5/timer.h @@ -11,8 +11,8 @@ * under the terms of the GNU General Public License version 2. */ -#ifndef _ARNDALE__TIMER_H_ -#define _ARNDALE__TIMER_H_ +#ifndef _EXYNOS5__TIMER_H_ +#define _EXYNOS5__TIMER_H_ /* core includes */ #include @@ -37,5 +37,4 @@ namespace Kernel }; } -#endif /* _ARNDALE__TIMER_H_ */ - +#endif /* _EXYNOS5__TIMER_H_ */ diff --git a/base-hw/src/core/arndale/tlb.h b/base-hw/src/core/exynos5/tlb.h similarity index 90% rename from base-hw/src/core/arndale/tlb.h rename to base-hw/src/core/exynos5/tlb.h index 97619ef6c..bcbc1142b 100644 --- a/base-hw/src/core/arndale/tlb.h +++ b/base-hw/src/core/exynos5/tlb.h @@ -11,8 +11,8 @@ * under the terms of the GNU General Public License version 2. */ -#ifndef _ARNDALE__TLB_H_ -#define _ARNDALE__TLB_H_ +#ifndef _EXYNOS5__TLB_H_ +#define _EXYNOS5__TLB_H_ /* core includes */ #include @@ -43,5 +43,5 @@ namespace Genode }; } -#endif /* _ARNDALE__TLB_H_ */ +#endif /* _EXYNOS5__TLB_H_ */ diff --git a/base-hw/src/core/odroid_xu/platform_support.cc b/base-hw/src/core/odroid_xu/platform_support.cc new file mode 100644 index 000000000..6ebd19fd1 --- /dev/null +++ b/base-hw/src/core/odroid_xu/platform_support.cc @@ -0,0 +1,84 @@ +/* + * \brief Parts of platform that are specific to Odroid XU + * \author Stefan Kalkowski + * \date 2013-11-25 + */ + +/* + * Copyright (C) 2013 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +/* core includes */ +#include +#include +#include +#include +#include +#include + +using namespace Genode; + +namespace Kernel { void init_platform(); } + +/** + * Interrupts that core shall provide to users + */ +static unsigned irq_ids[] = +{ + Board::PWM_IRQ_0, +}; + +enum { IRQ_IDS_SIZE = sizeof(irq_ids)/sizeof(irq_ids[0]) }; + + +void Kernel::init_platform() +{ + /* make user IRQs become known by cores IRQ session backend and kernel */ + static uint8_t _irqs[IRQ_IDS_SIZE][sizeof(Irq)]; + for (unsigned i = 0; i < IRQ_IDS_SIZE; i++) { + new (_irqs[i]) Irq(irq_ids[i]); + } +} + + +unsigned * Platform::_irq(unsigned const i) +{ + return i < IRQ_IDS_SIZE ? &irq_ids[i] : 0; +} + + +Native_region * Platform::_ram_regions(unsigned const i) +{ + static Native_region _regions[] = + { + { Board::RAM_0_BASE, Board::RAM_0_SIZE }, + }; + return i < sizeof(_regions)/sizeof(_regions[0]) ? &_regions[i] : 0; +} + + +Native_region * Platform::_mmio_regions(unsigned const i) +{ + static Native_region _regions[] = + { + { Board::MMIO_0_BASE, Board::MMIO_0_SIZE }, + }; + return i < sizeof(_regions)/sizeof(_regions[0]) ? &_regions[i] : 0; +} + + +Native_region * Platform::_core_only_mmio_regions(unsigned const i) +{ + static Native_region _regions[] = + { + { Board::GIC_CPU_MMIO_BASE, Board::GIC_CPU_MMIO_SIZE }, + { Board::MCT_MMIO_BASE, Board::MCT_MMIO_SIZE }, + }; + return i < sizeof(_regions)/sizeof(_regions[0]) ? &_regions[i] : 0; +} + + +Cpu::User_context::User_context() { cpsr = Psr::init_user(); } diff --git a/base-hw/src/core/odroid_xu/target.mk b/base-hw/src/core/odroid_xu/target.mk new file mode 100644 index 000000000..42715182d --- /dev/null +++ b/base-hw/src/core/odroid_xu/target.mk @@ -0,0 +1,44 @@ +# +# \brief Build config for Genodes core process +# \author Stefan Kalkowski +# \date 2013-11-25 +# + +# declare wich specs must be given to build this target +REQUIRES += platform_odroid_xu + +# add include paths +INC_DIR += $(REP_DIR)/src/core/odroid_xu +INC_DIR += $(REP_DIR)/src/core/exynos5 +INC_DIR += $(REP_DIR)/src/core/arm + +# add C++ sources +SRC_CC += platform_services.cc \ + platform_support.cc \ + cpu_support.cc + +# add assembly sources +SRC_S += mode_transition.s \ + boot_modules.s \ + crt0.s + +# declare source paths +vpath platform_services.cc $(BASE_DIR)/src/core +vpath platform_support.cc $(REP_DIR)/src/core/odroid_xu +vpath mode_transition.s $(REP_DIR)/src/core/arm_v7 +vpath cpu_support.cc $(REP_DIR)/src/core/arm +vpath crt0.s $(REP_DIR)/src/core/arm + +# +# Check if there are other images wich shall be linked to core. +# If not use a dummy boot-modules file wich includes only the symbols. +# +ifeq ($(wildcard $(BUILD_BASE_DIR)/boot_modules.s),) + vpath boot_modules.s $(REP_DIR)/src/core/arm +else + INC_DIR += $(BUILD_BASE_DIR) + vpath boot_modules.s $(BUILD_BASE_DIR) +endif + +# include less specific target parts +include $(REP_DIR)/src/core/target.inc diff --git a/base/include/drivers/uart/arndale_uart_base.h b/base/include/drivers/uart/exynos_uart_base.h similarity index 93% rename from base/include/drivers/uart/arndale_uart_base.h rename to base/include/drivers/uart/exynos_uart_base.h index 3f5b80f5f..49c049e36 100644 --- a/base/include/drivers/uart/arndale_uart_base.h +++ b/base/include/drivers/uart/exynos_uart_base.h @@ -1,5 +1,5 @@ /* - * \brief Driver base for the Arndale UART + * \brief Driver base for the Exynos UART * \author Martin stein * \date 2013-01-09 */ @@ -11,8 +11,8 @@ * under the terms of the GNU General Public License version 2. */ -#ifndef _INCLUDE__DRIVERS__UART__ARNDALE_UART_BASE_H_ -#define _INCLUDE__DRIVERS__UART__ARNDALE_UART_BASE_H_ +#ifndef _INCLUDE__DRIVERS__UART__EXYNOS_UART_BASE_H_ +#define _INCLUDE__DRIVERS__UART__EXYNOS_UART_BASE_H_ /* Genode includes */ #include @@ -20,9 +20,9 @@ namespace Genode { /** - * Arndale UART driver base + * Exynos UART driver base */ - class Arndale_uart_base : Mmio + class Exynos_uart_base : Mmio { /** * Line control @@ -173,7 +173,7 @@ namespace Genode * \param clock reference clock * \param baud_rate targeted baud rate */ - Arndale_uart_base(addr_t const base, unsigned const clock, + Exynos_uart_base(addr_t const base, unsigned const clock, unsigned const baud_rate) : Mmio(base) { /* init control registers */ @@ -202,5 +202,5 @@ namespace Genode }; } -#endif /* _INCLUDE__DRIVERS__UART__ARNDALE_UART_BASE_H_ */ +#endif /* _INCLUDE__DRIVERS__UART__EXYNOS_UART_BASE_H_ */ diff --git a/base/include/platform/odroid_xu/drivers/board_base.h b/base/include/platform/odroid_xu/drivers/board_base.h new file mode 100644 index 000000000..9c51a5d76 --- /dev/null +++ b/base/include/platform/odroid_xu/drivers/board_base.h @@ -0,0 +1,63 @@ +/* + * \brief Driver base for the Odroid XU board + * \author Stefan Kalkowski + * \date 2013-11-25 + */ + +/* + * Copyright (C) 2013 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +#ifndef _INCLUDE__DRIVERS__BOARD_BASE_H_ +#define _INCLUDE__DRIVERS__BOARD_BASE_H_ + +namespace Genode +{ + /** + * Board driver base + */ + struct Board_base + { + enum + { + /* normal RAM */ + RAM_0_BASE = 0x40000000, + RAM_0_SIZE = 0x80000000, + + /* device IO memory */ + MMIO_0_BASE = 0x10000000, + MMIO_0_SIZE = 0x10000000, + + /* interrupt controller */ + GIC_CPU_MMIO_BASE = 0x10481000, + GIC_CPU_MMIO_SIZE = 0x00010000, + + /* UART */ + UART_2_MMIO_BASE = 0x12C20000, + UART_2_CLOCK = 62668800, + UART_2_IRQ = 85, + + /* timer */ + PWM_MMIO_BASE = 0x12dd0000, + PWM_MMIO_SIZE = 0x1000, + PWM_CLOCK = 66000000, + PWM_IRQ_0 = 68, + MCT_MMIO_BASE = 0x101c0000, + MCT_MMIO_SIZE = 0x1000, + MCT_CLOCK = 24000000, + MCT_IRQ_L0 = 152, + + /* CPU cache */ + CACHE_LINE_SIZE_LOG2 = 6, + + /* wether board provides security extension */ + SECURITY_EXTENSION = 0, + }; + }; +} + +#endif /* _INCLUDE__DRIVERS__BOARD_BASE_H_ */ + diff --git a/base/mk/spec-platform_arndale.mk b/base/mk/spec-platform_arndale.mk index c2f96ebaf..93fbf5b1a 100644 --- a/base/mk/spec-platform_arndale.mk +++ b/base/mk/spec-platform_arndale.mk @@ -8,8 +8,7 @@ SPECS += exynos5 cortex_a15 framebuffer usb # add repository relative paths -REP_INC_DIR += include/platform/arndale \ - include/arndale_uart +REP_INC_DIR += include/platform/arndale # include implied specs include $(call select_from_repositories,mk/spec-cortex_a15.mk) diff --git a/base/mk/spec-platform_odroid_xu.mk b/base/mk/spec-platform_odroid_xu.mk new file mode 100644 index 000000000..a96c173d5 --- /dev/null +++ b/base/mk/spec-platform_odroid_xu.mk @@ -0,0 +1,15 @@ +# +# \brief Build-system configurations for Odroid XU +# \author Stefan Kalkowski +# \date 2013-11-25 +# + +# denote specs that are fullfilled by this spec +SPECS += exynos5 cortex_a15 + +# add repository relative paths +REP_INC_DIR += include/platform/odroid_xu + +# include implied specs +include $(call select_from_repositories,mk/spec-cortex_a15.mk) + diff --git a/os/lib/mk/hw_odroid_xu/timer.mk b/os/lib/mk/hw_odroid_xu/timer.mk new file mode 100644 index 000000000..889ed2d31 --- /dev/null +++ b/os/lib/mk/hw_odroid_xu/timer.mk @@ -0,0 +1,3 @@ +INC_DIR += $(REP_DIR)/src/drivers/timer/hw $(REP_DIR)/src/drivers/timer/hw/exynos5 + +include $(REP_DIR)/lib/mk/timer.inc diff --git a/tool/builddir/etc/build.conf.hw_odroid_xu b/tool/builddir/etc/build.conf.hw_odroid_xu new file mode 100644 index 000000000..9c370116a --- /dev/null +++ b/tool/builddir/etc/build.conf.hw_odroid_xu @@ -0,0 +1 @@ +REPOSITORIES += $(GENODE_DIR)/base-hw diff --git a/tool/create_builddir b/tool/create_builddir index bb9011ba9..3307cc936 100755 --- a/tool/create_builddir +++ b/tool/create_builddir @@ -33,6 +33,7 @@ usage: @echo " 'hw_imx31'" @echo " 'hw_imx53'" @echo " 'hw_arndale'" + @echo " 'hw_odroid_xu'" @echo " 'hw_rpi'" @echo " 'foc_x86_32'" @echo " 'foc_x86_64'" @@ -130,7 +131,7 @@ endif # # Add ARM drivers repositories to ARM build directories # -ifeq ($(filter-out foc_panda foc_arndale hw_panda hw_arndale foc_imx53,$(PLATFORM)),) +ifeq ($(filter-out foc_panda foc_arndale hw_panda hw_arndale hw_odroid_xu foc_imx53,$(PLATFORM)),) $(BUILD_DIR)/etc/build.conf:: @cat $(BUILD_CONF).drivers_arm >> $@ endif @@ -203,6 +204,9 @@ hw_arndale:: hw_rpi:: @echo "SPECS = genode hw_rpi" > $(BUILD_DIR)/etc/specs.conf +hw_odroid_xu:: + @echo "SPECS = genode hw_odroid_xu" > $(BUILD_DIR)/etc/specs.conf + lx_hybrid_x86:: @echo "CROSS_DEV_PREFIX =" > $(BUILD_DIR)/etc/tools.conf @echo "SPECS += always_hybrid" >> $(BUILD_DIR)/etc/specs.conf