Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions ref_app/ref_app.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="src\mcal\am6254_soc\mcal_cpu_secure.s">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="src\mcal\am6254_soc\mcal_gpt.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
Expand Down Expand Up @@ -1512,10 +1516,6 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="src\mcal\am6254_soc\mcal_led_am6254_soc.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="src\mcal\am6254_soc\mcal_memory_progmem.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
Expand All @@ -1528,6 +1528,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="src\mcal\am6254_soc\mcal_reg.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="src\mcal\am6254_soc\mcal_ser.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
Expand Down
9 changes: 6 additions & 3 deletions ref_app/ref_app.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -1276,6 +1276,9 @@
<ClCompile Include="src\mcal\am6254_soc\mcal_led.cpp">
<Filter>src\mcal\am6254_soc</Filter>
</ClCompile>
<ClCompile Include="src\mcal\am6254_soc\mcal_cpu_secure.s">
<Filter>src\mcal\am6254_soc</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\math\calculus\derivative.h">
Expand Down Expand Up @@ -2892,9 +2895,6 @@
<ClInclude Include="src\mcal\am6254_soc\mcal_led.h">
<Filter>src\mcal\am6254_soc</Filter>
</ClInclude>
<ClInclude Include="src\mcal\am6254_soc\mcal_led_am6254_soc.h">
<Filter>src\mcal\am6254_soc</Filter>
</ClInclude>
<ClInclude Include="src\mcal\am6254_soc\mcal_spi.h">
<Filter>src\mcal\am6254_soc</Filter>
</ClInclude>
Expand All @@ -2919,6 +2919,9 @@
<ClInclude Include="src\mcal\am6254_soc\mcal_memory_progmem.h">
<Filter>src\mcal\am6254_soc</Filter>
</ClInclude>
<ClInclude Include="src\mcal\am6254_soc\mcal_reg.h">
<Filter>src\mcal\am6254_soc</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="src\util\STL\algorithm">
Expand Down
6 changes: 4 additions & 2 deletions ref_app/src/mcal/am6254_soc/mcal_benchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
#ifndef MCAL_BENCHMARK_2014_04_16_H
#define MCAL_BENCHMARK_2014_04_16_H

#include <cstdint>
#include <mcal_port.h>
#include <mcal_reg.h>

#include <cstdint>

namespace mcal
{
namespace benchmark
{
typedef mcal::port::port_pin<2U> benchmark_port_type;
typedef mcal::port::port_pin<mcal::reg::gpio0, 2U> benchmark_port_type;
}
}

Expand Down
6 changes: 6 additions & 0 deletions ref_app/src/mcal/am6254_soc/mcal_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

#include <cstdint>

extern "C" auto hw_acquire_spin_lock(volatile std::uint32_t*) noexcept -> void;
extern "C" auto hw_release_spin_lock(volatile std::uint32_t*) noexcept -> void;

namespace mcal
{
namespace cpu
Expand All @@ -19,6 +22,9 @@
inline auto post_init() -> void { }

inline auto nop() noexcept -> void { asm volatile("nop"); }

inline auto acquire_spin_lock(volatile std::uint32_t* p_sync) noexcept -> void { hw_acquire_spin_lock(p_sync); }
inline auto release_spin_lock(volatile std::uint32_t* p_sync) noexcept -> void { hw_release_spin_lock(p_sync); }
}
}

Expand Down
48 changes: 48 additions & 0 deletions ref_app/src/mcal/am6254_soc/mcal_cpu_secure.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2025.
// Distributed under the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//

// Originally from:

// ***************************************************************************************
// Filename : boot.s
//
// Core : ARM Cortex-A53
//
// Author : Chalandi Amine
//
// Owner : Chalandi Amine
//
// Date : 16.05.2025
//
// Description : multicore ARM Cortex-A53 (ARMv8-A) startup code
//
// ***************************************************************************************

.section .text
.type hw_acquire_spin_lock,@function
.align 3
.globl hw_acquire_spin_lock

hw_acquire_spin_lock:
mov w1, #1
.L_loop:
ldaxr w2, [x0]
cbnz w2, .L_loop
stxr w2, w1, [x0]
cbnz w2, .L_loop
dmb ish
ret

.section .text
.type hw_release_spin_lock,@function
.align 3
.globl hw_release_spin_lock

hw_release_spin_lock:
dmb ish
stlr wzr, [x0]
ret
45 changes: 41 additions & 4 deletions ref_app/src/mcal/am6254_soc/mcal_led.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,50 @@
//

#include <mcal_led.h>
#include <mcal_led_am6254_soc.h>
#include <mcal_led/mcal_led_port.h>
#include <mcal_port.h>
#include <mcal_reg.h>

auto mcal::led::led0() -> mcal::led::led_base&
{
using led0_led_type = led_am6254_soc<LED_1>;
using local_led_port_type = mcal::port::port_pin<mcal::reg::gpio0, mcal::led::LED_ID_1>;

static led0_led_type l0;
using local_led_type = led_port<local_led_port_type>;

return l0;
static local_led_type led_instance;

return led_instance;
}

auto mcal::led::led1() -> mcal::led::led_base&
{
using local_led_port_type = mcal::port::port_pin<mcal::reg::gpio0, mcal::led::LED_ID_2>;

using local_led_type = led_port<local_led_port_type>;

static local_led_type led_instance;

return led_instance;
}

auto mcal::led::led2() -> mcal::led::led_base&
{
using local_led_port_type = mcal::port::port_pin<mcal::reg::gpio0, mcal::led::LED_ID_3>;

using local_led_type = led_port<local_led_port_type>;

static local_led_type led_instance;

return led_instance;
}

auto mcal::led::led3() -> mcal::led::led_base&
{
using local_led_port_type = mcal::port::port_pin<mcal::reg::gpio0, mcal::led::LED_ID_4>;

using local_led_type = led_port<local_led_port_type>;

static local_led_type led_instance;

return led_instance;
}
10 changes: 10 additions & 0 deletions ref_app/src/mcal/am6254_soc/mcal_led.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,21 @@

#include <mcal_led/mcal_led_base.h>

#include <cstdint>

namespace mcal
{
namespace led
{
constexpr unsigned LED_ID_1 { UINT8_C(6) };
constexpr unsigned LED_ID_2 { UINT8_C(5) };
constexpr unsigned LED_ID_3 { UINT8_C(4) };
constexpr unsigned LED_ID_4 { UINT8_C(3) };

auto led0() -> led_base&;
auto led1() -> led_base&;
auto led2() -> led_base&;
auto led3() -> led_base&;
}
}

Expand Down
132 changes: 0 additions & 132 deletions ref_app/src/mcal/am6254_soc/mcal_led_am6254_soc.h

This file was deleted.

Loading
Loading