hw: basic support for ODROID XU board (Fix #991)

This commit is contained in:
Stefan Kalkowski 2013-12-03 11:10:13 +01:00 committed by Norman Feske
parent 9b456fb3be
commit 7b49dbf2f3
17 changed files with 266 additions and 31 deletions

View File

@ -1,6 +1,7 @@
/* /*
* \brief Serial output driver for console lib * \brief Serial output driver for console lib
* \author Martin Stein * \author Martin Stein
* \author Stefan Kalkowski
* \date 2013-01-09 * \date 2013-01-09
*/ */
@ -11,19 +12,19 @@
* under the terms of the GNU General Public License version 2. * under the terms of the GNU General Public License version 2.
*/ */
#ifndef _INCLUDE__ARNDALE_UART__DRIVERS__SERIAL_LOG_H_ #ifndef _INCLUDE__EXYNOS_UART__DRIVERS__SERIAL_LOG_H_
#define _INCLUDE__ARNDALE_UART__DRIVERS__SERIAL_LOG_H_ #define _INCLUDE__EXYNOS_UART__DRIVERS__SERIAL_LOG_H_
/* Genode includes */ /* Genode includes */
#include <board.h> #include <board.h>
#include <drivers/uart/arndale_uart_base.h> #include <drivers/uart/exynos_uart_base.h>
namespace Genode namespace Genode
{ {
/** /**
* Serial output driver for console lib * Serial output driver for console lib
*/ */
class Serial_log : public Arndale_uart_base class Serial_log : public Exynos_uart_base
{ {
public: public:
@ -33,11 +34,11 @@ namespace Genode
* \param baud_rate targeted transfer baud-rate * \param baud_rate targeted transfer baud-rate
*/ */
Serial_log(unsigned const baud_rate) : Serial_log(unsigned const baud_rate) :
Arndale_uart_base(Board::UART_2_MMIO_BASE, Exynos_uart_base(Board::UART_2_MMIO_BASE,
Board::UART_2_CLOCK, baud_rate) Board::UART_2_CLOCK, baud_rate)
{ } { }
}; };
} }
#endif /* _INCLUDE__ARNDALE_UART__DRIVERS__SERIAL_LOG_H_ */ #endif /* _INCLUDE__EXYNOS_UART__DRIVERS__SERIAL_LOG_H_ */

View File

@ -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 # \author Martin Stein
# \date 2013-01-09 # \date 2013-01-09
# #
@ -7,6 +7,9 @@
# denote wich specs are also fullfilled by this spec # denote wich specs are also fullfilled by this spec
SPECS += hw platform_arndale SPECS += hw platform_arndale
# add repository relative paths
REP_INC_DIR += include/exynos5_uart
# set address where to link the text segment at # set address where to link the text segment at
LD_TEXT_ADDR ?= 0x80000000 LD_TEXT_ADDR ?= 0x80000000

View File

@ -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)

View File

@ -10,6 +10,7 @@ REQUIRES += platform_arndale
# add include paths # add include paths
INC_DIR += $(REP_DIR)/src/core/arndale INC_DIR += $(REP_DIR)/src/core/arndale
INC_DIR += $(REP_DIR)/src/core/exynos5
INC_DIR += $(REP_DIR)/src/core/arm INC_DIR += $(REP_DIR)/src/core/arm
# add C++ sources # add C++ sources

View File

@ -11,8 +11,8 @@
* under the terms of the GNU General Public License version 2. * under the terms of the GNU General Public License version 2.
*/ */
#ifndef _ARNDALE__CPU_H_ #ifndef _EXYNOS5__CPU_H_
#define _ARNDALE__CPU_H_ #define _EXYNOS5__CPU_H_
/* core includes */ /* core includes */
#include <cpu/cortex_a15.h> #include <cpu/cortex_a15.h>
@ -25,5 +25,5 @@ namespace Genode
class Cpu : public Cortex_a15::Cpu { }; class Cpu : public Cortex_a15::Cpu { };
} }
#endif /* _ARNDALE__CPU_H_ */ #endif /* _EXYNOS5__CPU_H_ */

View File

@ -11,8 +11,8 @@
* under the terms of the GNU General Public License version 2. * under the terms of the GNU General Public License version 2.
*/ */
#ifndef _ARNDALE__PIC_H_ #ifndef _EXYNOS5__PIC_H_
#define _ARNDALE__PIC_H_ #define _EXYNOS5__PIC_H_
/* core includes */ /* core includes */
#include <pic/corelink_gic400.h> #include <pic/corelink_gic400.h>
@ -38,5 +38,5 @@ namespace Kernel
bool Arm_gic::Pic::_use_security_ext() { return 0; } bool Arm_gic::Pic::_use_security_ext() { return 0; }
#endif /* _ARNDALE__PIC_H_ */ #endif /* _EXYNOS5__PIC_H_ */

View File

@ -11,8 +11,8 @@
* under the terms of the GNU General Public License version 2. * under the terms of the GNU General Public License version 2.
*/ */
#ifndef _ARNDALE__TIMER_H_ #ifndef _EXYNOS5__TIMER_H_
#define _ARNDALE__TIMER_H_ #define _EXYNOS5__TIMER_H_
/* core includes */ /* core includes */
#include <board.h> #include <board.h>
@ -37,5 +37,4 @@ namespace Kernel
}; };
} }
#endif /* _ARNDALE__TIMER_H_ */ #endif /* _EXYNOS5__TIMER_H_ */

View File

@ -11,8 +11,8 @@
* under the terms of the GNU General Public License version 2. * under the terms of the GNU General Public License version 2.
*/ */
#ifndef _ARNDALE__TLB_H_ #ifndef _EXYNOS5__TLB_H_
#define _ARNDALE__TLB_H_ #define _EXYNOS5__TLB_H_
/* core includes */ /* core includes */
#include <board.h> #include <board.h>
@ -43,5 +43,5 @@ namespace Genode
}; };
} }
#endif /* _ARNDALE__TLB_H_ */ #endif /* _EXYNOS5__TLB_H_ */

View File

@ -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 <board.h>
#include <platform.h>
#include <pic.h>
#include <cpu.h>
#include <timer.h>
#include <kernel/irq.h>
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(); }

View File

@ -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

View File

@ -1,5 +1,5 @@
/* /*
* \brief Driver base for the Arndale UART * \brief Driver base for the Exynos UART
* \author Martin stein * \author Martin stein
* \date 2013-01-09 * \date 2013-01-09
*/ */
@ -11,8 +11,8 @@
* under the terms of the GNU General Public License version 2. * under the terms of the GNU General Public License version 2.
*/ */
#ifndef _INCLUDE__DRIVERS__UART__ARNDALE_UART_BASE_H_ #ifndef _INCLUDE__DRIVERS__UART__EXYNOS_UART_BASE_H_
#define _INCLUDE__DRIVERS__UART__ARNDALE_UART_BASE_H_ #define _INCLUDE__DRIVERS__UART__EXYNOS_UART_BASE_H_
/* Genode includes */ /* Genode includes */
#include <util/mmio.h> #include <util/mmio.h>
@ -20,9 +20,9 @@
namespace Genode namespace Genode
{ {
/** /**
* Arndale UART driver base * Exynos UART driver base
*/ */
class Arndale_uart_base : Mmio class Exynos_uart_base : Mmio
{ {
/** /**
* Line control * Line control
@ -173,7 +173,7 @@ namespace Genode
* \param clock reference clock * \param clock reference clock
* \param baud_rate targeted baud rate * \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) unsigned const baud_rate) : Mmio(base)
{ {
/* init control registers */ /* 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_ */

View File

@ -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_ */

View File

@ -8,8 +8,7 @@
SPECS += exynos5 cortex_a15 framebuffer usb SPECS += exynos5 cortex_a15 framebuffer usb
# add repository relative paths # add repository relative paths
REP_INC_DIR += include/platform/arndale \ REP_INC_DIR += include/platform/arndale
include/arndale_uart
# include implied specs # include implied specs
include $(call select_from_repositories,mk/spec-cortex_a15.mk) include $(call select_from_repositories,mk/spec-cortex_a15.mk)

View File

@ -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)

View File

@ -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

View File

@ -0,0 +1 @@
REPOSITORIES += $(GENODE_DIR)/base-hw

View File

@ -33,6 +33,7 @@ usage:
@echo " 'hw_imx31'" @echo " 'hw_imx31'"
@echo " 'hw_imx53'" @echo " 'hw_imx53'"
@echo " 'hw_arndale'" @echo " 'hw_arndale'"
@echo " 'hw_odroid_xu'"
@echo " 'hw_rpi'" @echo " 'hw_rpi'"
@echo " 'foc_x86_32'" @echo " 'foc_x86_32'"
@echo " 'foc_x86_64'" @echo " 'foc_x86_64'"
@ -130,7 +131,7 @@ endif
# #
# Add ARM drivers repositories to ARM build directories # 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:: $(BUILD_DIR)/etc/build.conf::
@cat $(BUILD_CONF).drivers_arm >> $@ @cat $(BUILD_CONF).drivers_arm >> $@
endif endif
@ -203,6 +204,9 @@ hw_arndale::
hw_rpi:: hw_rpi::
@echo "SPECS = genode hw_rpi" > $(BUILD_DIR)/etc/specs.conf @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:: lx_hybrid_x86::
@echo "CROSS_DEV_PREFIX =" > $(BUILD_DIR)/etc/tools.conf @echo "CROSS_DEV_PREFIX =" > $(BUILD_DIR)/etc/tools.conf
@echo "SPECS += always_hybrid" >> $(BUILD_DIR)/etc/specs.conf @echo "SPECS += always_hybrid" >> $(BUILD_DIR)/etc/specs.conf