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
7 changes: 5 additions & 2 deletions ref_app/src/mcal/am6254_soc/mcal_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@

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

inline auto acquire_spin_lock(volatile std::uint32_t* p_sync) noexcept -> void { mcal_cpu_secure_acquire_spin_lock(p_sync); }
inline auto release_spin_lock(volatile std::uint32_t* p_sync) noexcept -> void { mcal_cpu_secure_release_spin_lock(p_sync); }
struct secure
{
static auto acquire_spin_lock(volatile std::uint32_t* p_sync) noexcept -> void { mcal_cpu_secure_acquire_spin_lock(p_sync); }
static auto release_spin_lock(volatile std::uint32_t* p_sync) noexcept -> void { mcal_cpu_secure_release_spin_lock(p_sync); }
};
}
}
#endif
Expand Down
11 changes: 8 additions & 3 deletions ref_app/src/mcal/am6254_soc/mcal_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@

void mcal::port::init(const config_type*)
{
// The pad configuration of gpio0.37 is on pad37 (empirical observation).
// So we must initialize pad37 since we will use gpio0.36 as the
// benchmark toggle-pin.
// Initialize the benchmark toggle pin explicitly, even though
// this is also done in the application benchmark when one
// of the benchmarks is active.

mcal::port::port_pin<mcal::reg::gpio0, 36U>::set_pin_low();
mcal::port::port_pin<mcal::reg::gpio0, 36U>::set_direction_output();

// Empirical observation seemingly reveals that the pad configuration
// of gpio0.36 is mistakenly on pad37. So we must initialize pad37
// as well since we will use gpio0.36 as the benchmark toggle-pin.

mcal::port::port_pin<mcal::reg::gpio0, 37U>::set_pin_low();
mcal::port::port_pin<mcal::reg::gpio0, 37U>::set_direction_output();
}
20 changes: 10 additions & 10 deletions ref_app/src/mcal/am6254_soc/mcal_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef MCAL_PORT_2014_01_10_H_
#define MCAL_PORT_2014_01_10_H_
#ifndef MCAL_PORT_2014_01_10_H
#define MCAL_PORT_2014_01_10_H

#include <mcal_cpu.h>
#include <mcal_reg.h>
Expand All @@ -33,9 +33,9 @@
public:
static auto set_direction_output() noexcept -> void
{
mcal::cpu::acquire_spin_lock(&sync_object);
mcal::cpu::secure::acquire_spin_lock(&sync_object);
GPIO_CONFIG_AS_OUTPUT();
mcal::cpu::release_spin_lock(&sync_object);
mcal::cpu::secure::release_spin_lock(&sync_object);
}

static auto set_direction_input() noexcept -> void
Expand All @@ -45,18 +45,18 @@

static auto set_pin_high() noexcept -> void
{
mcal::cpu::acquire_spin_lock(&sync_object);
mcal::cpu::secure::acquire_spin_lock(&sync_object);
OUTPUT_HIGH();
output_is_high = true;
mcal::cpu::release_spin_lock(&sync_object);
mcal::cpu::secure::release_spin_lock(&sync_object);
}

static auto set_pin_low() noexcept -> void
{
mcal::cpu::acquire_spin_lock(&sync_object);
mcal::cpu::secure::acquire_spin_lock(&sync_object);
OUTPUT_LOW();
output_is_high = false;
mcal::cpu::release_spin_lock(&sync_object);
mcal::cpu::secure::release_spin_lock(&sync_object);
}

static auto read_input_value() noexcept -> bool
Expand All @@ -67,10 +67,10 @@

static auto toggle_pin() noexcept -> void
{
mcal::cpu::acquire_spin_lock(&sync_object);
mcal::cpu::secure::acquire_spin_lock(&sync_object);
(output_is_high ? OUTPUT_LOW() : OUTPUT_HIGH());
output_is_high = (!output_is_high);
mcal::cpu::release_spin_lock(&sync_object);
mcal::cpu::secure::release_spin_lock(&sync_object);
}

private:
Expand Down
2 changes: 0 additions & 2 deletions ref_app/target.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,6 @@
<ClCompile Include="target\micros\am335x\startup\int_vect.cpp" />
<ClCompile Include="target\micros\am6254_soc\Code\Appli\Core\a53\main.c" />
<ClCompile Include="target\micros\am6254_soc\Code\Appli\Core\a53\main_cores.cpp" />
<ClCompile Include="target\micros\am6254_soc\Code\Mcal\SysTickTimer\SysTickTimer.c" />
<ClCompile Include="target\micros\am6254_soc\Code\Startup\Core\a53\Startup.c" />
<ClCompile Include="target\micros\atmega2560\startup\crt0.cpp" />
<ClCompile Include="target\micros\atmega2560\startup\crt0_init_ram.cpp" />
Expand Down Expand Up @@ -1198,7 +1197,6 @@
<Text Include="target\micros\bcm2835_raspi_b\startup\SD_CARD\PiZero\config.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="target\micros\am6254_soc\Code\Mcal\SysTickTimer\SysTickTimer.h" />
<ClInclude Include="target\micros\am6254_soc\Code\Startup\Core\a53\core_macros.h" />
<ClInclude Include="target\micros\am6254_soc\Code\Startup\Core\a53\gic-500.h" />
<ClInclude Include="target\micros\xtensa_esp32_s3\startup\Std\core-isa.h" />
Expand Down
12 changes: 0 additions & 12 deletions ref_app/target.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,6 @@
<Filter Include="micros\am6254_soc\Code\Appli">
<UniqueIdentifier>{cf4696b9-385a-4605-865f-97849321f94c}</UniqueIdentifier>
</Filter>
<Filter Include="micros\am6254_soc\Code\Mcal">
<UniqueIdentifier>{3f405389-8f32-49e3-ab7e-07d4de5f0956}</UniqueIdentifier>
</Filter>
<Filter Include="micros\am6254_soc\Code\SBL">
<UniqueIdentifier>{2ee0ef48-0226-416d-a1be-7e266c81089a}</UniqueIdentifier>
</Filter>
Expand All @@ -316,9 +313,6 @@
<Filter Include="micros\am6254_soc\Code\Appli\Core\a53">
<UniqueIdentifier>{1fdc07e4-455b-4051-b1d5-00f3432e8d1c}</UniqueIdentifier>
</Filter>
<Filter Include="micros\am6254_soc\Code\Mcal\SysTickTimer">
<UniqueIdentifier>{75aa46d5-c890-44e1-bf1b-e294be531ee8}</UniqueIdentifier>
</Filter>
<Filter Include="micros\am6254_soc\Code\Startup">
<UniqueIdentifier>{0fb41c05-2289-4721-980a-786b1026a315}</UniqueIdentifier>
</Filter>
Expand Down Expand Up @@ -1070,9 +1064,6 @@
<ClCompile Include="target\micros\am6254_soc\Code\Appli\Core\a53\main.c">
<Filter>micros\am6254_soc\Code\Appli\Core\a53</Filter>
</ClCompile>
<ClCompile Include="target\micros\am6254_soc\Code\Mcal\SysTickTimer\SysTickTimer.c">
<Filter>micros\am6254_soc\Code\Mcal\SysTickTimer</Filter>
</ClCompile>
<ClCompile Include="target\micros\am6254_soc\Code\Startup\Core\a53\Startup.c">
<Filter>micros\am6254_soc\Code\Startup\Core\a53</Filter>
</ClCompile>
Expand All @@ -1092,9 +1083,6 @@
<ClInclude Include="target\micros\xtensa_esp32_s3\startup\Std\core-isa.h">
<Filter>micros\xtensa_esp32_s3\startup\Std</Filter>
</ClInclude>
<ClInclude Include="target\micros\am6254_soc\Code\Mcal\SysTickTimer\SysTickTimer.h">
<Filter>micros\am6254_soc\Code\Mcal\SysTickTimer</Filter>
</ClInclude>
<ClInclude Include="target\micros\am6254_soc\Code\Startup\Core\a53\core_macros.h">
<Filter>micros\am6254_soc\Code\Startup\Core\a53</Filter>
</ClInclude>
Expand Down

This file was deleted.

This file was deleted.

18 changes: 7 additions & 11 deletions ref_app/target/micros/am6254_soc/make/am6254_soc_flags.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ TGT_SUFFIX = elf

TGT_ALLFLAGS = -O2 \
-finline-functions \
-finline-limit=32 \
-finline-limit=128 \
-mcpu=cortex-a53 \
-march=armv8-a \
-mabi=lp64
Expand All @@ -31,15 +31,8 @@ TGT_CFLAGS = -std=c11
TGT_CXXFLAGS = -std=c++20 \
$(TGT_ALLFLAGS)

TGT_INCLUDES = -I$(PATH_TGT)/Code \
-I$(PATH_TGT)/Code/Appli/ \
-I$(PATH_TGT)/Code/Appli/Core/$(CORE_FAMILY) \
-I$(PATH_TGT)/Code/Mcal \
-I$(PATH_TGT)/Code/Mcal/SysTickTimer \
-I$(PATH_TGT)/Code/Startup \
-I$(PATH_TGT)/Code/Startup/Core/$(CORE_FAMILY) \
-I$(PATH_APP)/mcal/$(TGT) \
-I$(PATH_APP)
TGT_INCLUDES = -I$(PATH_TGT)/Code/Appli/Core/$(CORE_FAMILY) \
-I$(PATH_TGT)/Code/Startup/Core/$(CORE_FAMILY)

TGT_AFLAGS =

Expand All @@ -57,4 +50,7 @@ ifeq ($(TYP_OS),WIN)
OBJCOPY := $(subst /,\,$(PATH_TOOLS_CC)/$(GCC_PREFIX)-objcopy.exe)
endif

RULE_SPECIAL_MAKE_IMAGE_FILE := $(ECHO) "+++ creating special image file $(PATH_BIN)/$(CORE_FAMILY)_baremetal_am6254_nosdk.bin" && $(OBJCOPY) $(APP).$(TGT_SUFFIX) -O binary $(PATH_BIN)/$(CORE_FAMILY)_baremetal_am6254_nosdk.bin
NAME_IMAGE_FILE := $(PATH_BIN)/$(CORE_FAMILY)_baremetal_am6254_nosdk

RULE_SPECIAL_MAKE_IMAGE_FILE := $(ECHO) "+++ creating special image file $(NAME_IMAGE_FILE).bin" \
&& $(OBJCOPY) $(APP).$(TGT_SUFFIX) -O binary $(NAME_IMAGE_FILE).bin
Loading