Skip to content

Commit 4d0611c

Browse files
authored
Merge pull request #664 from ckormanyos/more_syntax
More syntax
2 parents 3213d07 + a17fb34 commit 4d0611c

File tree

8 files changed

+30
-199
lines changed

8 files changed

+30
-199
lines changed

ref_app/src/mcal/am6254_soc/mcal_cpu.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@
3939

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

42-
inline auto acquire_spin_lock(volatile std::uint32_t* p_sync) noexcept -> void { mcal_cpu_secure_acquire_spin_lock(p_sync); }
43-
inline auto release_spin_lock(volatile std::uint32_t* p_sync) noexcept -> void { mcal_cpu_secure_release_spin_lock(p_sync); }
42+
struct secure
43+
{
44+
static auto acquire_spin_lock(volatile std::uint32_t* p_sync) noexcept -> void { mcal_cpu_secure_acquire_spin_lock(p_sync); }
45+
static auto release_spin_lock(volatile std::uint32_t* p_sync) noexcept -> void { mcal_cpu_secure_release_spin_lock(p_sync); }
46+
};
4447
}
4548
}
4649
#endif

ref_app/src/mcal/am6254_soc/mcal_port.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@
99

1010
void mcal::port::init(const config_type*)
1111
{
12-
// The pad configuration of gpio0.37 is on pad37 (empirical observation).
13-
// So we must initialize pad37 since we will use gpio0.36 as the
14-
// benchmark toggle-pin.
12+
// Initialize the benchmark toggle pin explicitly, even though
13+
// this is also done in the application benchmark when one
14+
// of the benchmarks is active.
15+
1516
mcal::port::port_pin<mcal::reg::gpio0, 36U>::set_pin_low();
1617
mcal::port::port_pin<mcal::reg::gpio0, 36U>::set_direction_output();
1718

19+
// Empirical observation seemingly reveals that the pad configuration
20+
// of gpio0.36 is mistakenly on pad37. So we must initialize pad37
21+
// as well since we will use gpio0.36 as the benchmark toggle-pin.
22+
1823
mcal::port::port_pin<mcal::reg::gpio0, 37U>::set_pin_low();
1924
mcal::port::port_pin<mcal::reg::gpio0, 37U>::set_direction_output();
2025
}

ref_app/src/mcal/am6254_soc/mcal_port.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// or copy at http://www.boost.org/LICENSE_1_0.txt)
66
//
77

8-
#ifndef MCAL_PORT_2014_01_10_H_
9-
#define MCAL_PORT_2014_01_10_H_
8+
#ifndef MCAL_PORT_2014_01_10_H
9+
#define MCAL_PORT_2014_01_10_H
1010

1111
#include <mcal_cpu.h>
1212
#include <mcal_reg.h>
@@ -33,9 +33,9 @@
3333
public:
3434
static auto set_direction_output() noexcept -> void
3535
{
36-
mcal::cpu::acquire_spin_lock(&sync_object);
36+
mcal::cpu::secure::acquire_spin_lock(&sync_object);
3737
GPIO_CONFIG_AS_OUTPUT();
38-
mcal::cpu::release_spin_lock(&sync_object);
38+
mcal::cpu::secure::release_spin_lock(&sync_object);
3939
}
4040

4141
static auto set_direction_input() noexcept -> void
@@ -45,18 +45,18 @@
4545

4646
static auto set_pin_high() noexcept -> void
4747
{
48-
mcal::cpu::acquire_spin_lock(&sync_object);
48+
mcal::cpu::secure::acquire_spin_lock(&sync_object);
4949
OUTPUT_HIGH();
5050
output_is_high = true;
51-
mcal::cpu::release_spin_lock(&sync_object);
51+
mcal::cpu::secure::release_spin_lock(&sync_object);
5252
}
5353

5454
static auto set_pin_low() noexcept -> void
5555
{
56-
mcal::cpu::acquire_spin_lock(&sync_object);
56+
mcal::cpu::secure::acquire_spin_lock(&sync_object);
5757
OUTPUT_LOW();
5858
output_is_high = false;
59-
mcal::cpu::release_spin_lock(&sync_object);
59+
mcal::cpu::secure::release_spin_lock(&sync_object);
6060
}
6161

6262
static auto read_input_value() noexcept -> bool
@@ -67,10 +67,10 @@
6767

6868
static auto toggle_pin() noexcept -> void
6969
{
70-
mcal::cpu::acquire_spin_lock(&sync_object);
70+
mcal::cpu::secure::acquire_spin_lock(&sync_object);
7171
(output_is_high ? OUTPUT_LOW() : OUTPUT_HIGH());
7272
output_is_high = (!output_is_high);
73-
mcal::cpu::release_spin_lock(&sync_object);
73+
mcal::cpu::secure::release_spin_lock(&sync_object);
7474
}
7575

7676
private:

ref_app/target.vcxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,6 @@
10881088
<ClCompile Include="target\micros\am335x\startup\int_vect.cpp" />
10891089
<ClCompile Include="target\micros\am6254_soc\Code\Appli\Core\a53\main.c" />
10901090
<ClCompile Include="target\micros\am6254_soc\Code\Appli\Core\a53\main_cores.cpp" />
1091-
<ClCompile Include="target\micros\am6254_soc\Code\Mcal\SysTickTimer\SysTickTimer.c" />
10921091
<ClCompile Include="target\micros\am6254_soc\Code\Startup\Core\a53\Startup.c" />
10931092
<ClCompile Include="target\micros\atmega2560\startup\crt0.cpp" />
10941093
<ClCompile Include="target\micros\atmega2560\startup\crt0_init_ram.cpp" />
@@ -1198,7 +1197,6 @@
11981197
<Text Include="target\micros\bcm2835_raspi_b\startup\SD_CARD\PiZero\config.txt" />
11991198
</ItemGroup>
12001199
<ItemGroup>
1201-
<ClInclude Include="target\micros\am6254_soc\Code\Mcal\SysTickTimer\SysTickTimer.h" />
12021200
<ClInclude Include="target\micros\am6254_soc\Code\Startup\Core\a53\core_macros.h" />
12031201
<ClInclude Include="target\micros\am6254_soc\Code\Startup\Core\a53\gic-500.h" />
12041202
<ClInclude Include="target\micros\xtensa_esp32_s3\startup\Std\core-isa.h" />

ref_app/target.vcxproj.filters

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,6 @@
304304
<Filter Include="micros\am6254_soc\Code\Appli">
305305
<UniqueIdentifier>{cf4696b9-385a-4605-865f-97849321f94c}</UniqueIdentifier>
306306
</Filter>
307-
<Filter Include="micros\am6254_soc\Code\Mcal">
308-
<UniqueIdentifier>{3f405389-8f32-49e3-ab7e-07d4de5f0956}</UniqueIdentifier>
309-
</Filter>
310307
<Filter Include="micros\am6254_soc\Code\SBL">
311308
<UniqueIdentifier>{2ee0ef48-0226-416d-a1be-7e266c81089a}</UniqueIdentifier>
312309
</Filter>
@@ -316,9 +313,6 @@
316313
<Filter Include="micros\am6254_soc\Code\Appli\Core\a53">
317314
<UniqueIdentifier>{1fdc07e4-455b-4051-b1d5-00f3432e8d1c}</UniqueIdentifier>
318315
</Filter>
319-
<Filter Include="micros\am6254_soc\Code\Mcal\SysTickTimer">
320-
<UniqueIdentifier>{75aa46d5-c890-44e1-bf1b-e294be531ee8}</UniqueIdentifier>
321-
</Filter>
322316
<Filter Include="micros\am6254_soc\Code\Startup">
323317
<UniqueIdentifier>{0fb41c05-2289-4721-980a-786b1026a315}</UniqueIdentifier>
324318
</Filter>
@@ -1070,9 +1064,6 @@
10701064
<ClCompile Include="target\micros\am6254_soc\Code\Appli\Core\a53\main.c">
10711065
<Filter>micros\am6254_soc\Code\Appli\Core\a53</Filter>
10721066
</ClCompile>
1073-
<ClCompile Include="target\micros\am6254_soc\Code\Mcal\SysTickTimer\SysTickTimer.c">
1074-
<Filter>micros\am6254_soc\Code\Mcal\SysTickTimer</Filter>
1075-
</ClCompile>
10761067
<ClCompile Include="target\micros\am6254_soc\Code\Startup\Core\a53\Startup.c">
10771068
<Filter>micros\am6254_soc\Code\Startup\Core\a53</Filter>
10781069
</ClCompile>
@@ -1092,9 +1083,6 @@
10921083
<ClInclude Include="target\micros\xtensa_esp32_s3\startup\Std\core-isa.h">
10931084
<Filter>micros\xtensa_esp32_s3\startup\Std</Filter>
10941085
</ClInclude>
1095-
<ClInclude Include="target\micros\am6254_soc\Code\Mcal\SysTickTimer\SysTickTimer.h">
1096-
<Filter>micros\am6254_soc\Code\Mcal\SysTickTimer</Filter>
1097-
</ClInclude>
10981086
<ClInclude Include="target\micros\am6254_soc\Code\Startup\Core\a53\core_macros.h">
10991087
<Filter>micros\am6254_soc\Code\Startup\Core\a53</Filter>
11001088
</ClInclude>

ref_app/target/micros/am6254_soc/Code/Mcal/SysTickTimer/SysTickTimer.c

Lines changed: 0 additions & 69 deletions
This file was deleted.

ref_app/target/micros/am6254_soc/Code/Mcal/SysTickTimer/SysTickTimer.h

Lines changed: 0 additions & 90 deletions
This file was deleted.

ref_app/target/micros/am6254_soc/make/am6254_soc_flags.gmk

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ TGT_SUFFIX = elf
1818

1919
TGT_ALLFLAGS = -O2 \
2020
-finline-functions \
21-
-finline-limit=32 \
21+
-finline-limit=128 \
2222
-mcpu=cortex-a53 \
2323
-march=armv8-a \
2424
-mabi=lp64
@@ -31,15 +31,8 @@ TGT_CFLAGS = -std=c11
3131
TGT_CXXFLAGS = -std=c++20 \
3232
$(TGT_ALLFLAGS)
3333

34-
TGT_INCLUDES = -I$(PATH_TGT)/Code \
35-
-I$(PATH_TGT)/Code/Appli/ \
36-
-I$(PATH_TGT)/Code/Appli/Core/$(CORE_FAMILY) \
37-
-I$(PATH_TGT)/Code/Mcal \
38-
-I$(PATH_TGT)/Code/Mcal/SysTickTimer \
39-
-I$(PATH_TGT)/Code/Startup \
40-
-I$(PATH_TGT)/Code/Startup/Core/$(CORE_FAMILY) \
41-
-I$(PATH_APP)/mcal/$(TGT) \
42-
-I$(PATH_APP)
34+
TGT_INCLUDES = -I$(PATH_TGT)/Code/Appli/Core/$(CORE_FAMILY) \
35+
-I$(PATH_TGT)/Code/Startup/Core/$(CORE_FAMILY)
4336

4437
TGT_AFLAGS =
4538

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

60-
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
53+
NAME_IMAGE_FILE := $(PATH_BIN)/$(CORE_FAMILY)_baremetal_am6254_nosdk
54+
55+
RULE_SPECIAL_MAKE_IMAGE_FILE := $(ECHO) "+++ creating special image file $(NAME_IMAGE_FILE).bin" \
56+
&& $(OBJCOPY) $(APP).$(TGT_SUFFIX) -O binary $(NAME_IMAGE_FILE).bin

0 commit comments

Comments
 (0)