diff --git a/include/spec/parallella/drivers/board_base.h b/include/drivers/defs/zynq_parallella.h similarity index 71% rename from include/spec/parallella/drivers/board_base.h rename to include/drivers/defs/zynq_parallella.h index f418cca..4fcb885 100644 --- a/include/spec/parallella/drivers/board_base.h +++ b/include/drivers/defs/zynq_parallella.h @@ -5,26 +5,22 @@ */ /* - * Copyright (C) 2015 Genode Labs GmbH + * Copyright (C) 2015-2017 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. + * under the terms of the GNU Affero General Public License version 3. */ #ifndef _INCLUDE__PARALLELLA__DRIVERS__BOARD_BASE_H_ #define _INCLUDE__PARALLELLA__DRIVERS__BOARD_BASE_H_ -#include +#include -namespace Genode { struct Board_base; } +namespace Zynq_parallella { -/** - * Base driver for the Parallella platform - */ -struct Genode::Board_base : Zynq::Board_base -{ - enum - { + using namespace Zynq; + + enum { /* clocks (assuming 6:2:1 mode) */ PS_CLOCK = 33333333, CPU_1X_CLOCK = 111111100, diff --git a/include/spec/zc702/drivers/board_base.h b/include/drivers/defs/zynq_zc702.h similarity index 70% rename from include/spec/zc702/drivers/board_base.h rename to include/drivers/defs/zynq_zc702.h index 56ead40..972a92d 100644 --- a/include/spec/zc702/drivers/board_base.h +++ b/include/drivers/defs/zynq_zc702.h @@ -5,26 +5,22 @@ */ /* - * Copyright (C) 2016 Genode Labs GmbH + * Copyright (C) 2016-2017 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. + * under the terms of the GNU Affero General Public License version 3. */ #ifndef _INCLUDE__ZC702__DRIVERS__BOARD_BASE_H_ #define _INCLUDE__ZC702__DRIVERS__BOARD_BASE_H_ -#include +#include -namespace Genode { struct Board_base; } +namespace Zynq_zc702 { -/** - * Base driver for the ZC702 platform - */ -struct Genode::Board_base : Zynq::Board_base -{ - enum - { + using namespace Zynq; + + enum { /* clocks (assuming 6:2:1 mode) */ CPU_1X_CLOCK = 111111100, CPU_6X4X_CLOCK = 6*CPU_1X_CLOCK, diff --git a/include/spec/zc706/drivers/board_base.h b/include/drivers/defs/zynq_zc706.h similarity index 70% rename from include/spec/zc706/drivers/board_base.h rename to include/drivers/defs/zynq_zc706.h index 4dec7d1..c031956 100644 --- a/include/spec/zc706/drivers/board_base.h +++ b/include/drivers/defs/zynq_zc706.h @@ -5,26 +5,22 @@ */ /* - * Copyright (C) 2016 Genode Labs GmbH + * Copyright (C) 2016-2017 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. + * under the terms of the GNU Affero General Public License version 3. */ #ifndef _INCLUDE__ZC706__DRIVERS__BOARD_BASE_H_ #define _INCLUDE__ZC706__DRIVERS__BOARD_BASE_H_ -#include +#include -namespace Genode { struct Board_base; } +namespace Zynq_zc706 { -/** - * Base driver for the ZC706 platform - */ -struct Genode::Board_base : Zynq::Board_base -{ - enum - { + using namespace Zynq; + + enum { /* clocks (assuming 6:2:1 mode) */ CPU_1X_CLOCK = 111111100, CPU_6X4X_CLOCK = 6*CPU_1X_CLOCK, diff --git a/include/spec/zedboard/drivers/board_base.h b/include/drivers/defs/zynq_zedboard.h similarity index 79% rename from include/spec/zedboard/drivers/board_base.h rename to include/drivers/defs/zynq_zedboard.h index 4340d78..180fa5b 100644 --- a/include/spec/zedboard/drivers/board_base.h +++ b/include/drivers/defs/zynq_zedboard.h @@ -5,26 +5,23 @@ */ /* - * Copyright (C) 2015 Genode Labs GmbH + * Copyright (C) 2015-2017 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. + * under the terms of the GNU Affero General Public License version 3. */ #ifndef _INCLUDE__ZEDBOARD__DRIVERS__BOARD_BASE_H_ #define _INCLUDE__ZEDBOARD__DRIVERS__BOARD_BASE_H_ -#include +#include -namespace Genode { struct Board_base; } +namespace Zynq_zedboard { -/** - * Base driver for the Zedboard platform - */ -struct Genode::Board_base : Zynq::Board_base -{ - enum - { + using namespace Zynq; + + enum { + /* clocks (assuming 6:2:1 mode) */ PS_CLOCK = 33333333, ARM_PLL_CLOCK = 1333333*1000, DDR_PLL_CLOCK = 1066667*1000, diff --git a/lib/mk/spec/zynq_parallella/bootstrap-hw.mk b/lib/mk/spec/zynq_parallella/bootstrap-hw.mk index 68360e0..21312e6 100644 --- a/lib/mk/spec/zynq_parallella/bootstrap-hw.mk +++ b/lib/mk/spec/zynq_parallella/bootstrap-hw.mk @@ -1,7 +1,14 @@ -TMP := $(call select_from_repositories,lib/mk/spec/zynq/bootstrap-hw.inc) -BASE_HW_DIR := $(TMP:%lib/mk/spec/zynq/bootstrap-hw.inc=%) +TMP := $(call select_from_repositories,lib/mk/spec/zynq/core-hw.inc) +BASE_HW_DIR := $(TMP:%lib/mk/spec/zynq/core-hw.inc=%) -INC_DIR += $(REP_DIR)/src/core/include/spec/xilinx_uartps_1 -INC_DIR += $(REP_DIR)/src/core/include/spec/zynq_parallella +INC_DIR += $(BASE_HW_DIR)/src/bootstrap/spec/zynq -include $(BASE_HW_DIR)/lib/mk/spec/zynq/bootstrap-hw.inc +SRC_S += bootstrap/spec/arm/crt0.s + +SRC_CC += bootstrap/spec/arm/cpu.cc +SRC_CC += bootstrap/spec/arm/cortex_a9_mmu.cc +SRC_CC += bootstrap/spec/arm/pic.cc +SRC_CC += bootstrap/spec/zynq/platform.cc +SRC_CC += hw/spec/arm/arm_v7_cpu.cc + +include $(BASE_HW_DIR)/lib/mk/bootstrap-hw.inc diff --git a/lib/mk/spec/zynq_parallella/core-hw.mk b/lib/mk/spec/zynq_parallella/core-hw.mk index 86d138f..22b11da 100644 --- a/lib/mk/spec/zynq_parallella/core-hw.mk +++ b/lib/mk/spec/zynq_parallella/core-hw.mk @@ -8,7 +8,6 @@ TMP := $(call select_from_repositories,lib/mk/spec/zynq/core-hw.inc) BASE_HW_DIR := $(TMP:%lib/mk/spec/zynq/core-hw.inc=%) # add include paths -INC_DIR += $(REP_DIR)/src/core/include/spec/xilinx_uartps_1 INC_DIR += $(REP_DIR)/src/core/include/spec/zynq_parallella # include less specific configuration diff --git a/lib/mk/spec/zynq_zc702/bootstrap-hw.mk b/lib/mk/spec/zynq_zc702/bootstrap-hw.mk index f5c8f00..21312e6 100644 --- a/lib/mk/spec/zynq_zc702/bootstrap-hw.mk +++ b/lib/mk/spec/zynq_zc702/bootstrap-hw.mk @@ -1,7 +1,14 @@ -TMP := $(call select_from_repositories,lib/mk/spec/zynq/bootstrap-hw.inc) -BASE_HW_DIR := $(TMP:%lib/mk/spec/zynq/bootstrap-hw.inc=%) +TMP := $(call select_from_repositories,lib/mk/spec/zynq/core-hw.inc) +BASE_HW_DIR := $(TMP:%lib/mk/spec/zynq/core-hw.inc=%) -INC_DIR += $(REP_DIR)/src/core/include/spec/xilinx_uartps_1 -INC_DIR += $(REP_DIR)/src/core/include/spec/zynq_zc702 +INC_DIR += $(BASE_HW_DIR)/src/bootstrap/spec/zynq -include $(BASE_HW_DIR)/lib/mk/spec/zynq/bootstrap-hw.inc +SRC_S += bootstrap/spec/arm/crt0.s + +SRC_CC += bootstrap/spec/arm/cpu.cc +SRC_CC += bootstrap/spec/arm/cortex_a9_mmu.cc +SRC_CC += bootstrap/spec/arm/pic.cc +SRC_CC += bootstrap/spec/zynq/platform.cc +SRC_CC += hw/spec/arm/arm_v7_cpu.cc + +include $(BASE_HW_DIR)/lib/mk/bootstrap-hw.inc diff --git a/lib/mk/spec/zynq_zc702/core-hw.mk b/lib/mk/spec/zynq_zc702/core-hw.mk index f0f5617..1d53411 100644 --- a/lib/mk/spec/zynq_zc702/core-hw.mk +++ b/lib/mk/spec/zynq_zc702/core-hw.mk @@ -8,7 +8,6 @@ TMP := $(call select_from_repositories,lib/mk/spec/zynq/core-hw.inc) BASE_HW_DIR := $(TMP:%lib/mk/spec/zynq/core-hw.inc=%) # add include paths -INC_DIR += $(REP_DIR)/src/core/include/spec/xilinx_uartps_1 INC_DIR += $(REP_DIR)/src/core/include/spec/zynq_zc702 # include less specific configuration diff --git a/lib/mk/spec/zynq_zc706/bootstrap-hw.mk b/lib/mk/spec/zynq_zc706/bootstrap-hw.mk index ff06451..21312e6 100644 --- a/lib/mk/spec/zynq_zc706/bootstrap-hw.mk +++ b/lib/mk/spec/zynq_zc706/bootstrap-hw.mk @@ -1,7 +1,14 @@ -TMP := $(call select_from_repositories,lib/mk/spec/zynq/bootstrap-hw.inc) -BASE_HW_DIR := $(TMP:%lib/mk/spec/zynq/bootstrap-hw.inc=%) +TMP := $(call select_from_repositories,lib/mk/spec/zynq/core-hw.inc) +BASE_HW_DIR := $(TMP:%lib/mk/spec/zynq/core-hw.inc=%) -INC_DIR += $(REP_DIR)/src/core/include/spec/xilinx_uartps_1 -INC_DIR += $(REP_DIR)/src/core/include/spec/zynq_zc706 +INC_DIR += $(BASE_HW_DIR)/src/bootstrap/spec/zynq -include $(BASE_HW_DIR)/lib/mk/spec/zynq/bootstrap-hw.inc +SRC_S += bootstrap/spec/arm/crt0.s + +SRC_CC += bootstrap/spec/arm/cpu.cc +SRC_CC += bootstrap/spec/arm/cortex_a9_mmu.cc +SRC_CC += bootstrap/spec/arm/pic.cc +SRC_CC += bootstrap/spec/zynq/platform.cc +SRC_CC += hw/spec/arm/arm_v7_cpu.cc + +include $(BASE_HW_DIR)/lib/mk/bootstrap-hw.inc diff --git a/lib/mk/spec/zynq_zc706/core-hw.mk b/lib/mk/spec/zynq_zc706/core-hw.mk index c326510..ea2f27e 100644 --- a/lib/mk/spec/zynq_zc706/core-hw.mk +++ b/lib/mk/spec/zynq_zc706/core-hw.mk @@ -8,7 +8,6 @@ TMP := $(call select_from_repositories,lib/mk/spec/zynq/core-hw.inc) BASE_HW_DIR := $(TMP:%lib/mk/spec/zynq/core-hw.inc=%) # add include paths -INC_DIR += $(REP_DIR)/src/core/include/spec/xilinx_uartps_1 INC_DIR += $(REP_DIR)/src/core/include/spec/zynq_zc706 # include less specific configuration diff --git a/lib/mk/spec/zynq_zedboard/bootstrap-hw.mk b/lib/mk/spec/zynq_zedboard/bootstrap-hw.mk index 0231f1f..21312e6 100644 --- a/lib/mk/spec/zynq_zedboard/bootstrap-hw.mk +++ b/lib/mk/spec/zynq_zedboard/bootstrap-hw.mk @@ -1,7 +1,14 @@ -TMP := $(call select_from_repositories,lib/mk/spec/zynq/bootstrap-hw.inc) -BASE_HW_DIR := $(TMP:%lib/mk/spec/zynq/bootstrap-hw.inc=%) +TMP := $(call select_from_repositories,lib/mk/spec/zynq/core-hw.inc) +BASE_HW_DIR := $(TMP:%lib/mk/spec/zynq/core-hw.inc=%) -INC_DIR += $(REP_DIR)/src/core/include/spec/xilinx_uartps_1 -INC_DIR += $(REP_DIR)/src/core/include/spec/zynq_zedboard +INC_DIR += $(BASE_HW_DIR)/src/bootstrap/spec/zynq -include $(BASE_HW_DIR)/lib/mk/spec/zynq/bootstrap-hw.inc +SRC_S += bootstrap/spec/arm/crt0.s + +SRC_CC += bootstrap/spec/arm/cpu.cc +SRC_CC += bootstrap/spec/arm/cortex_a9_mmu.cc +SRC_CC += bootstrap/spec/arm/pic.cc +SRC_CC += bootstrap/spec/zynq/platform.cc +SRC_CC += hw/spec/arm/arm_v7_cpu.cc + +include $(BASE_HW_DIR)/lib/mk/bootstrap-hw.inc diff --git a/lib/mk/spec/zynq_zedboard/core-hw.mk b/lib/mk/spec/zynq_zedboard/core-hw.mk index eb3b200..3a28d29 100644 --- a/lib/mk/spec/zynq_zedboard/core-hw.mk +++ b/lib/mk/spec/zynq_zedboard/core-hw.mk @@ -8,7 +8,6 @@ TMP := $(call select_from_repositories,lib/mk/spec/zynq/core-hw.inc) BASE_HW_DIR := $(TMP:%lib/mk/spec/zynq/core-hw.inc=%) # add include paths -INC_DIR += $(REP_DIR)/src/core/include/spec/xilinx_uartps_1 INC_DIR += $(REP_DIR)/src/core/include/spec/zynq_zedboard # include less specific configuration diff --git a/mk/spec/zynq_parallella.mk b/mk/spec/zynq_parallella.mk index 39fb028..d1897f6 100644 --- a/mk/spec/zynq_parallella.mk +++ b/mk/spec/zynq_parallella.mk @@ -3,7 +3,4 @@ # SPECS += zynq cadence_gem zynq_sdhci -REP_INC_DIR += include/spec/parallella -REP_INC_DIR += include/spec/xilinx - include $(call select_from_repositories,mk/spec/zynq.mk) diff --git a/mk/spec/zynq_zc702.mk b/mk/spec/zynq_zc702.mk index ed6c157..d1897f6 100644 --- a/mk/spec/zynq_zc702.mk +++ b/mk/spec/zynq_zc702.mk @@ -3,7 +3,4 @@ # SPECS += zynq cadence_gem zynq_sdhci -REP_INC_DIR += include/spec/zc702 -REP_INC_DIR += include/spec/xilinx - include $(call select_from_repositories,mk/spec/zynq.mk) diff --git a/mk/spec/zynq_zc706.mk b/mk/spec/zynq_zc706.mk index 94d1b3b..d1897f6 100644 --- a/mk/spec/zynq_zc706.mk +++ b/mk/spec/zynq_zc706.mk @@ -3,7 +3,4 @@ # SPECS += zynq cadence_gem zynq_sdhci -REP_INC_DIR += include/spec/zc706 -REP_INC_DIR += include/spec/xilinx - include $(call select_from_repositories,mk/spec/zynq.mk) diff --git a/mk/spec/zynq_zedboard.mk b/mk/spec/zynq_zedboard.mk index 34ee14b..6c12121 100644 --- a/mk/spec/zynq_zedboard.mk +++ b/mk/spec/zynq_zedboard.mk @@ -3,7 +3,4 @@ # SPECS += zynq cadence_gem zynq_i2c -REP_INC_DIR += include/spec/zedboard -REP_INC_DIR += include/spec/xilinx - include $(call select_from_repositories,mk/spec/zynq.mk) diff --git a/src/core/include/spec/xilinx_uartps_1/serial.h b/src/core/include/spec/xilinx_uartps_1/serial.h deleted file mode 100644 index 03f20b7..0000000 --- a/src/core/include/spec/xilinx_uartps_1/serial.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * \brief Serial output driver for core - * \author Johannes Schlatow - * \date 2014-12-15 - */ - -/* - * Copyright (C) 2014-2015 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 _CORE__INCLUDE__SPEC__XILINX_UARTPS_1__SERIAL_H_ -#define _CORE__INCLUDE__SPEC__XILINX_UARTPS_1__SERIAL_H_ - -/* core includes */ -#include -#include - -/* Genode includes */ -#include - -namespace Genode { class Serial; } - -/** - * Serial output driver for core - */ -class Genode::Serial : public Xilinx_uartps_base -{ - public: - - /** - * Constructor - * - * \param baud_rate targeted transfer baud-rate - */ - Serial(unsigned const baud_rate) - : - Xilinx_uartps_base(Platform::mmio_to_virt(Board::UART_1_MMIO_BASE), - Board::UART_CLOCK, baud_rate) - { } -}; - -#endif /* _CORE__INCLUDE__SPEC__XILINX_UARTPS_1__SERIAL_H_ */ diff --git a/src/core/include/spec/zynq_parallella/board.h b/src/core/include/spec/zynq_parallella/board.h index 33a8c74..1b71528 100644 --- a/src/core/include/spec/zynq_parallella/board.h +++ b/src/core/include/spec/zynq_parallella/board.h @@ -7,27 +7,35 @@ */ /* - * Copyright (C) 2014-2015 Genode Labs GmbH + * Copyright (C) 2014-2017 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. + * under the terms of the GNU Affero General Public License version 3. */ #ifndef _CORE__INCLUDE__SPEC__ZYNQ_PARALLELLA__BOARD_H_ #define _CORE__INCLUDE__SPEC__ZYNQ_PARALLELLA__BOARD_H_ /* core includes */ -#include +#include +#include -namespace Genode -{ - struct Board : Cortex_a9::Board - { - enum { - KERNEL_UART_BASE = UART_1_MMIO_BASE, - KERNEL_UART_SIZE = UART_SIZE, - }; +#include +#include + +namespace Board { + using namespace Zynq_parallella; + using Cpu_mmio = Hw::Cortex_a9_mmio; + using L2_cache = Hw::Pl310; + using Serial = Genode::Xilinx_uart; + + enum { + UART_BASE = UART_1_MMIO_BASE, }; + + static constexpr bool SMP = true; + + L2_cache & l2_cache(); } #endif /* _CORE__INCLUDE__SPEC__ZYNQ_PARALLELLA__BOARD_H_ */ diff --git a/src/core/include/spec/zynq_zc702/board.h b/src/core/include/spec/zynq_zc702/board.h index 182022d..4fcd8d3 100644 --- a/src/core/include/spec/zynq_zc702/board.h +++ b/src/core/include/spec/zynq_zc702/board.h @@ -7,27 +7,35 @@ */ /* - * Copyright (C) 2014-2015 Genode Labs GmbH + * Copyright (C) 2014-2017 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. + * under the terms of the GNU Affero General Public License version 3. */ #ifndef _CORE__INCLUDE__SPEC__ZYNQ_ZC702__BOARD_H_ #define _CORE__INCLUDE__SPEC__ZYNQ_ZC702__BOARD_H_ /* core includes */ -#include +#include +#include -namespace Genode -{ - struct Board : Cortex_a9::Board - { - enum { - KERNEL_UART_BASE = UART_1_MMIO_BASE, - KERNEL_UART_SIZE = UART_SIZE, - }; +#include +#include + +namespace Board { + using namespace Zynq_zc702; + using Cpu_mmio = Hw::Cortex_a9_mmio; + using L2_cache = Hw::Pl310; + using Serial = Genode::Xilinx_uart; + + enum { + UART_BASE = UART_1_MMIO_BASE, }; + + static constexpr bool SMP = true; + + L2_cache & l2_cache(); } #endif /* _CORE__INCLUDE__SPEC__ZYNQ_ZC702__BOARD_H_ */ diff --git a/src/core/include/spec/zynq_zc706/board.h b/src/core/include/spec/zynq_zc706/board.h index 6865300..e87f500 100644 --- a/src/core/include/spec/zynq_zc706/board.h +++ b/src/core/include/spec/zynq_zc706/board.h @@ -7,27 +7,35 @@ */ /* - * Copyright (C) 2014-2015 Genode Labs GmbH + * Copyright (C) 2014-2017 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. + * under the terms of the GNU Affero General Public License version 3. */ #ifndef _CORE__INCLUDE__SPEC__ZYNQ_ZC706__BOARD_H_ #define _CORE__INCLUDE__SPEC__ZYNQ_ZC706__BOARD_H_ /* core includes */ -#include +#include +#include -namespace Genode -{ - struct Board : Cortex_a9::Board - { - enum { - KERNEL_UART_BASE = UART_1_MMIO_BASE, - KERNEL_UART_SIZE = UART_SIZE, - }; +#include +#include + +namespace Board { + using namespace Zynq_zc706; + using Cpu_mmio = Hw::Cortex_a9_mmio; + using L2_cache = Hw::Pl310; + using Serial = Genode::Xilinx_uart; + + enum { + UART_BASE = UART_1_MMIO_BASE, }; + + static constexpr bool SMP = true; + + L2_cache & l2_cache(); } #endif /* _CORE__INCLUDE__SPEC__ZYNQ_ZC706__BOARD_H_ */ diff --git a/src/core/include/spec/zynq_zedboard/board.h b/src/core/include/spec/zynq_zedboard/board.h index 6a01914..23c7087 100644 --- a/src/core/include/spec/zynq_zedboard/board.h +++ b/src/core/include/spec/zynq_zedboard/board.h @@ -7,27 +7,35 @@ */ /* - * Copyright (C) 2014-2015 Genode Labs GmbH + * Copyright (C) 2014-2017 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. + * under the terms of the GNU Affero General Public License version 3. */ #ifndef _CORE__INCLUDE__SPEC__ZYNQ_ZEDBOARD__BOARD_H_ #define _CORE__INCLUDE__SPEC__ZYNQ_ZEDBOARD__BOARD_H_ /* core includes */ -#include +#include +#include -namespace Genode -{ - struct Board : Cortex_a9::Board - { - enum { - KERNEL_UART_BASE = UART_1_MMIO_BASE, - KERNEL_UART_SIZE = UART_SIZE, - }; +#include +#include + +namespace Board { + using namespace Zynq_zedboard; + using Cpu_mmio = Hw::Cortex_a9_mmio; + using L2_cache = Hw::Pl310; + using Serial = Genode::Xilinx_uart; + + enum { + UART_BASE = UART_1_MMIO_BASE, }; + + static constexpr bool SMP = true; + + L2_cache & l2_cache(); } #endif /* _CORE__INCLUDE__SPEC__ZYNQ_ZEDBOARD__BOARD_H_ */