committed by
Christian Helmuth
parent
585c4b8c69
commit
f051065582
@@ -1,97 +0,0 @@
|
||||
|
||||
===============================================
|
||||
Getting started with 'base-hw' on PandaBoard A2
|
||||
===============================================
|
||||
|
||||
|
||||
Martin Stein
|
||||
|
||||
Abstract
|
||||
########
|
||||
|
||||
This is a short tutorial that depicts a handy way to get a Genode ELF-image,
|
||||
build with 'base-hw', started on the PandaBoard A2. For informations
|
||||
about how to build Genode images with 'base-hw', have a look at
|
||||
'<GENODE_DIR>/repos/base-hw/doc/hw.txt'. This tutorial is dedicated to common
|
||||
Linux systems, but all examples originate from a Ubuntu 11.10.
|
||||
|
||||
|
||||
Tutorial
|
||||
########
|
||||
|
||||
Connect the PandaBoard to your local Ethernet through its RJ45 connector.
|
||||
Additionally connect the PandaBoard to your machine through its COM port.
|
||||
Ensure that you have installed the genode tool chain that is available at:
|
||||
|
||||
:[http://genode.org/download/tool-chain]:
|
||||
Genode tool-chain
|
||||
|
||||
Ensure that '<GENODE_TOOL_CHAIN_DIR>/bin/' is in your 'PATH' variable.
|
||||
Get the Linaro U-Boot repository and compile U-Boot for PandaBoard:
|
||||
|
||||
! git clone git://git.linaro.org/boot/u-boot-linaro-stable.git
|
||||
! cd <UBOOT_DIR>
|
||||
! make CROSS_COMPILE=genode-arm- omap4_panda_config
|
||||
! make CROSS_COMPILE=genode-arm-
|
||||
|
||||
During the compilation i had some errors. The first was in assembly code,
|
||||
it seemed to originate from a slip with the typo and was easy to fix.
|
||||
The second kind of errors occured because the GCC version had no support for
|
||||
direct array initialization, thus i avoided them by simply initialize
|
||||
the array elements separately.
|
||||
|
||||
Now install the following packages to communicate with the PandaBoard:
|
||||
|
||||
! apt-get install tftp-hpa minicom
|
||||
|
||||
Open '/etc/default/tftpd-hpa' with a text editor and ensure that it has
|
||||
the following content:
|
||||
|
||||
! TFTP_USERNAME="tftp"
|
||||
! TFTP_DIRECTORY="/var/lib/tftpboot"
|
||||
! TFTP_ADDRESS="0.0.0.0:69"
|
||||
! TFTP_OPTIONS="-l"
|
||||
|
||||
Tell TFTP wich image to provide:
|
||||
|
||||
! cd /var/lib/tftpboot/
|
||||
! ln -s <GENODE_BOOT_ELF> image.elf
|
||||
|
||||
Where '<GENODE_BOOT_ELF>' is the absolute path of the targeted ELF image.
|
||||
Start TFTP to enable the upload of the image:
|
||||
|
||||
! service tftp-hpa restart
|
||||
|
||||
Start Minicom in configuration mode:
|
||||
|
||||
! minicom -s
|
||||
|
||||
Go to 'Serial port setting' and ensure that the device is set to the
|
||||
TTY of the COM port you've conntected PandaBoard with. In my case it was
|
||||
'/dev/ttyS0'. Configure the other settings for a baud rate of '115200',
|
||||
8 bit char length, no parity and 1 stop bit. Quit Minicom and start
|
||||
it once more:
|
||||
|
||||
! minicom
|
||||
|
||||
Mount your SD-card and copy the U-Boot files to its boot partition:
|
||||
|
||||
! cd <UBOOT_DIR>; cp MLO /media/boot/; cp u-boot.bin /media/boot/
|
||||
|
||||
Unmount the SD card and insert it into the appropriate PandaBoard slot.
|
||||
Plug in the power connector or push the 'S1' button if the PandaBoard is
|
||||
already powered. Minicom should now show the following message below some
|
||||
bootloader info:
|
||||
|
||||
! Hit any key to stop autoboot:
|
||||
|
||||
We have to stop autoboot and type in this line to load and boot the genode
|
||||
image via ethernet:
|
||||
|
||||
! usb start; dhcp; bootelf 0x82000000
|
||||
|
||||
Now your Genode scenario should start and offer its debug output
|
||||
in Minicom. You can boot other images by redirecting the link
|
||||
'/var/lib/tftpboot/image.elf' accordingly, restarting your PandaBoard
|
||||
and instructing U-boot again as described above.
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
NR_OF_CPUS = 2
|
||||
|
||||
INC_DIR += $(BASE_DIR)/../base-hw/src/bootstrap/spec/panda
|
||||
SRC_CC += bootstrap/spec/arm/cpu.cc
|
||||
SRC_CC += bootstrap/spec/arm/cortex_a9_mmu.cc
|
||||
SRC_CC += bootstrap/spec/arm/gicv2.cc
|
||||
SRC_CC += bootstrap/spec/panda/platform.cc
|
||||
SRC_CC += bootstrap/spec/arm/arm_v7_cpu.cc
|
||||
SRC_CC += hw/spec/32bit/memory_map.cc
|
||||
SRC_S += bootstrap/spec/arm/crt0.s
|
||||
|
||||
CC_MARCH = -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=softfp
|
||||
|
||||
include $(BASE_DIR)/../base-hw/lib/mk/bootstrap-hw.inc
|
||||
@@ -1,19 +0,0 @@
|
||||
#
|
||||
# \brief Build config for Genodes core process
|
||||
# \author Stefan Kalkowski
|
||||
# \author Martin Stein
|
||||
# \date 2012-10-04
|
||||
#
|
||||
|
||||
# add include paths
|
||||
INC_DIR += $(REP_DIR)/src/core/spec/panda
|
||||
|
||||
# add C++ sources
|
||||
SRC_CC += platform_services.cc
|
||||
|
||||
NR_OF_CPUS += 2
|
||||
|
||||
CC_MARCH = -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=softfp
|
||||
|
||||
# include less specific configuration
|
||||
include $(REP_DIR)/lib/mk/spec/cortex_a9/core-hw.inc
|
||||
@@ -1,7 +0,0 @@
|
||||
BOARD = panda
|
||||
|
||||
include $(GENODE_DIR)/repos/base-hw/recipes/src/base-hw_content.inc
|
||||
|
||||
content: enable_board_spec
|
||||
enable_board_spec: etc/specs.conf
|
||||
echo "SPECS += panda" >> etc/specs.conf
|
||||
@@ -1 +0,0 @@
|
||||
2020-03-25 95696501234a205d9b50d1cb661aca7ca3d2beb2
|
||||
@@ -1,2 +0,0 @@
|
||||
base-hw
|
||||
base
|
||||
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* \brief Pandaboard specific definitions
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2017-02-20
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _SRC__BOOTSTRAP__SPEC__PANDA__BOARD_H_
|
||||
#define _SRC__BOOTSTRAP__SPEC__PANDA__BOARD_H_
|
||||
|
||||
#include <hw/spec/arm/panda_board.h>
|
||||
#include <spec/arm/cortex_a9_page_table.h>
|
||||
#include <spec/arm/cpu.h>
|
||||
#include <hw/spec/arm/gicv2.h>
|
||||
|
||||
namespace Board {
|
||||
using namespace Hw::Panda_board;
|
||||
using Pic = Hw::Gicv2;
|
||||
static constexpr bool NON_SECURE = false;
|
||||
|
||||
class L2_cache;
|
||||
}
|
||||
|
||||
namespace Bootstrap { struct Actlr; }
|
||||
|
||||
|
||||
struct Bootstrap::Actlr
|
||||
{
|
||||
static void enable_smp()
|
||||
{
|
||||
using namespace Board;
|
||||
call_panda_firmware(CPU_ACTLR_SMP_BIT_RAISE, 0);
|
||||
}
|
||||
|
||||
static void disable_smp() { /* not implemented */ }
|
||||
};
|
||||
|
||||
|
||||
class Board::L2_cache : Hw::Pl310
|
||||
{
|
||||
private:
|
||||
|
||||
unsigned long _init_value()
|
||||
{
|
||||
Aux::access_t v = 0;
|
||||
Aux::Associativity::set(v, Aux::Associativity::WAY_16);
|
||||
Aux::Way_size::set(v, Aux::Way_size::KB_64);
|
||||
Aux::Share_override::set(v, true);
|
||||
Aux::Replacement_policy::set(v, Aux::Replacement_policy::PRAND);
|
||||
Aux::Ns_lockdown::set(v, true);
|
||||
Aux::Ns_irq_ctrl::set(v, true);
|
||||
Aux::Data_prefetch::set(v, true);
|
||||
Aux::Inst_prefetch::set(v, true);
|
||||
Aux::Early_bresp::set(v, true);
|
||||
return v;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
L2_cache(Genode::addr_t mmio) : Hw::Pl310(mmio) {
|
||||
call_panda_firmware(L2_CACHE_AUX_REG, _init_value()); }
|
||||
|
||||
using Hw::Pl310::invalidate;
|
||||
|
||||
void enable()
|
||||
{
|
||||
call_panda_firmware(L2_CACHE_ENABLE_REG, 1);
|
||||
Pl310::mask_interrupts();
|
||||
}
|
||||
|
||||
void disable() {
|
||||
call_panda_firmware(L2_CACHE_ENABLE_REG, 0); }
|
||||
};
|
||||
|
||||
#endif /* _SRC__BOOTSTRAP__SPEC__PANDA__BOARD_H_ */
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* \brief Parts of platform that are specific to Pandaboard
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2017-01-30
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#include <platform.h>
|
||||
|
||||
using namespace Board;
|
||||
|
||||
Bootstrap::Platform::Board::Board()
|
||||
: early_ram_regions(Memory_region { RAM_0_BASE, RAM_0_SIZE }),
|
||||
core_mmio(Memory_region { CORTEX_A9_PRIVATE_MEM_BASE,
|
||||
CORTEX_A9_PRIVATE_MEM_SIZE },
|
||||
Memory_region { TL16C750_3_MMIO_BASE,
|
||||
TL16C750_MMIO_SIZE },
|
||||
Memory_region { PL310_MMIO_BASE,
|
||||
PL310_MMIO_SIZE }) { }
|
||||
|
||||
|
||||
bool Board::Cpu::errata(Board::Cpu::Errata) { return false; }
|
||||
|
||||
|
||||
void Board::Cpu::wake_up_all_cpus(void * const ip)
|
||||
{
|
||||
struct Wakeup_generator : Genode::Mmio
|
||||
{
|
||||
struct Aux_core_boot_0 : Register<0x800, 32> {
|
||||
struct Cpu1_status : Bitfield<2, 2> { }; };
|
||||
|
||||
struct Aux_core_boot_1 : Register<0x804, 32> { };
|
||||
|
||||
Wakeup_generator(void * const ip) : Mmio(CORTEX_A9_WUGEN_MMIO_BASE)
|
||||
{
|
||||
write<Aux_core_boot_1>((Genode::addr_t)ip);
|
||||
write<Aux_core_boot_0::Cpu1_status>(1);
|
||||
}
|
||||
};
|
||||
|
||||
Wakeup_generator wgen(ip);
|
||||
asm volatile("dsb\n"
|
||||
"sev\n");
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* \brief Board driver for core on pandaboard
|
||||
* \author Stefan Kalkowski
|
||||
* \author Martin Stein
|
||||
* \date 2014-06-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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 Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _CORE__SPEC__PANDA__BOARD_H_
|
||||
#define _CORE__SPEC__PANDA__BOARD_H_
|
||||
|
||||
#include <hw/spec/arm/gicv2.h>
|
||||
#include <hw/spec/arm/panda_board.h>
|
||||
#include <spec/arm/cortex_a9_private_timer.h>
|
||||
|
||||
namespace Board {
|
||||
using namespace Hw::Panda_board;
|
||||
|
||||
using Pic = Hw::Gicv2;
|
||||
|
||||
class L2_cache : public Hw::Pl310
|
||||
{
|
||||
private:
|
||||
|
||||
unsigned long _debug_value()
|
||||
{
|
||||
Debug::access_t v = 0;
|
||||
Debug::Dwb::set(v, 1);
|
||||
Debug::Dcl::set(v, 1);
|
||||
return v;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
L2_cache(Genode::addr_t mmio) : Hw::Pl310(mmio) { }
|
||||
|
||||
void clean_invalidate()
|
||||
{
|
||||
using namespace Hw;
|
||||
call_panda_firmware(L2_CACHE_SET_DEBUG_REG, _debug_value());
|
||||
Pl310::clean_invalidate();
|
||||
call_panda_firmware(L2_CACHE_SET_DEBUG_REG, 0);
|
||||
}
|
||||
};
|
||||
|
||||
L2_cache & l2_cache();
|
||||
}
|
||||
|
||||
#endif /* _CORE__SPEC__PANDA__BOARD_H_ */
|
||||
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* \brief Pandaboard specific definitions
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2019-05-16
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _SRC__INCLUDE__HW__SPEC__ARM__PANDA_BOARD_H_
|
||||
#define _SRC__INCLUDE__HW__SPEC__ARM__PANDA_BOARD_H_
|
||||
|
||||
#include <base/stdint.h>
|
||||
#include <drivers/defs/panda.h>
|
||||
#include <drivers/uart/tl16c750.h>
|
||||
#include <hw/spec/arm/boot_info.h>
|
||||
#include <hw/spec/arm/cortex_a9.h>
|
||||
#include <hw/spec/arm/pl310.h>
|
||||
|
||||
namespace Hw::Panda_board {
|
||||
using namespace Panda;
|
||||
using Cpu_mmio = Hw::Cortex_a9_mmio<CORTEX_A9_PRIVATE_MEM_BASE>;
|
||||
using Serial = Genode::Tl16c750_uart;
|
||||
|
||||
enum {
|
||||
UART_BASE = TL16C750_3_MMIO_BASE,
|
||||
UART_CLOCK = TL16C750_CLOCK,
|
||||
};
|
||||
|
||||
enum Panda_firmware_opcodes {
|
||||
CPU_ACTLR_SMP_BIT_RAISE = 0x25,
|
||||
L2_CACHE_SET_DEBUG_REG = 0x100,
|
||||
L2_CACHE_ENABLE_REG = 0x102,
|
||||
L2_CACHE_AUX_REG = 0x109,
|
||||
};
|
||||
|
||||
static inline void call_panda_firmware(Genode::addr_t func,
|
||||
Genode::addr_t val)
|
||||
{
|
||||
register Genode::addr_t _func asm("r12") = func;
|
||||
register Genode::addr_t _val asm("r0") = val;
|
||||
asm volatile("dsb \n"
|
||||
"push {r1-r11} \n"
|
||||
"smc #0 \n"
|
||||
"pop {r1-r11} \n"
|
||||
:: "r" (_func), "r" (_val) : "memory", "cc");
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _SRC__INCLUDE__HW__SPEC__ARM__PANDA_BOARD_H_ */
|
||||
Reference in New Issue
Block a user