Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
0054609f
Commit
0054609f
authored
5 years ago
by
q3k
Committed by
Serge Bazanski
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix indentation
parent
d726f2e6
No related branches found
No related tags found
1 merge request
!45
l0dables: implement l0der
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
epicardium/main.c
+2
-2
2 additions, 2 deletions
epicardium/main.c
l0dables/lib/hardware.c
+43
-43
43 additions, 43 deletions
l0dables/lib/hardware.c
l0dables/lib/l0dable.ld
+7
-7
7 additions, 7 deletions
l0dables/lib/l0dable.ld
with
52 additions
and
52 deletions
epicardium/main.c
+
2
−
2
View file @
0054609f
...
...
@@ -118,8 +118,8 @@ int main(void)
core1_start
(
info
.
isr_vector
);
}
}
else
{
LOG_INFO
(
"startup"
,
"Starting pycardium on core1 ..."
);
core1_start
((
void
*
)
0x10080000
);
LOG_INFO
(
"startup"
,
"Starting pycardium on core1 ..."
);
core1_start
((
void
*
)
0x10080000
);
}
...
...
This diff is collapsed.
Click to expand it.
l0dables/lib/hardware.c
+
43
−
43
View file @
0054609f
...
...
@@ -19,56 +19,56 @@ uint32_t SystemCoreClock = HIRC_FREQ >> 1;
void
SystemCoreClockUpdate
(
void
)
{
uint32_t
base_freq
,
div
,
clk_src
;
uint32_t
base_freq
,
div
,
clk_src
;
// Determine the clock source and frequency
clk_src
=
(
MXC_GCR
->
clkcn
&
MXC_F_GCR_CLKCN_CLKSEL
);
switch
(
clk_src
)
{
case
MXC_S_GCR_CLKCN_CLKSEL_HIRC
:
base_freq
=
HIRC_FREQ
;
break
;
case
MXC_S_GCR_CLKCN_CLKSEL_XTAL32M
:
base_freq
=
XTAL32M_FREQ
;
break
;
case
MXC_S_GCR_CLKCN_CLKSEL_LIRC8
:
base_freq
=
LIRC8_FREQ
;
break
;
case
MXC_S_GCR_CLKCN_CLKSEL_HIRC96
:
base_freq
=
HIRC96_FREQ
;
break
;
case
MXC_S_GCR_CLKCN_CLKSEL_HIRC8
:
base_freq
=
HIRC8_FREQ
;
break
;
case
MXC_S_GCR_CLKCN_CLKSEL_XTAL32K
:
base_freq
=
XTAL32K_FREQ
;
break
;
default:
// Values 001 and 111 are reserved, and should never be encountered.
base_freq
=
HIRC_FREQ
;
break
;
}
// Clock divider is retrieved to compute system clock
div
=
(
MXC_GCR
->
clkcn
&
MXC_F_GCR_CLKCN_PSC
)
>>
MXC_F_GCR_CLKCN_PSC_POS
;
// Determine the clock source and frequency
clk_src
=
(
MXC_GCR
->
clkcn
&
MXC_F_GCR_CLKCN_CLKSEL
);
switch
(
clk_src
)
{
case
MXC_S_GCR_CLKCN_CLKSEL_HIRC
:
base_freq
=
HIRC_FREQ
;
break
;
case
MXC_S_GCR_CLKCN_CLKSEL_XTAL32M
:
base_freq
=
XTAL32M_FREQ
;
break
;
case
MXC_S_GCR_CLKCN_CLKSEL_LIRC8
:
base_freq
=
LIRC8_FREQ
;
break
;
case
MXC_S_GCR_CLKCN_CLKSEL_HIRC96
:
base_freq
=
HIRC96_FREQ
;
break
;
case
MXC_S_GCR_CLKCN_CLKSEL_HIRC8
:
base_freq
=
HIRC8_FREQ
;
break
;
case
MXC_S_GCR_CLKCN_CLKSEL_XTAL32K
:
base_freq
=
XTAL32K_FREQ
;
break
;
default:
// Values 001 and 111 are reserved, and should never be encountered.
base_freq
=
HIRC_FREQ
;
break
;
}
// Clock divider is retrieved to compute system clock
div
=
(
MXC_GCR
->
clkcn
&
MXC_F_GCR_CLKCN_PSC
)
>>
MXC_F_GCR_CLKCN_PSC_POS
;
SystemCoreClock
=
base_freq
>>
div
;
SystemCoreClock
=
base_freq
>>
div
;
}
__weak
void
SystemInit
()
{
// Enable FPU.
SCB
->
CPACR
|=
SCB_CPACR_CP10_Msk
|
SCB_CPACR_CP11_Msk
;
__DSB
();
__ISB
();
// Enable FPU.
SCB
->
CPACR
|=
SCB_CPACR_CP10_Msk
|
SCB_CPACR_CP11_Msk
;
__DSB
();
__ISB
();
// Enable ICache1 Clock
MXC_GCR
->
perckcn1
&=
~
(
1
<<
22
);
// Enable ICache1 Clock
MXC_GCR
->
perckcn1
&=
~
(
1
<<
22
);
// Invalidate cache and wait until ready
MXC_ICC1
->
invalidate
=
1
;
while
(
!
(
MXC_ICC1
->
cache_ctrl
&
MXC_F_ICC_CACHE_CTRL_CACHE_RDY
));
// Invalidate cache and wait until ready
MXC_ICC1
->
invalidate
=
1
;
while
(
!
(
MXC_ICC1
->
cache_ctrl
&
MXC_F_ICC_CACHE_CTRL_CACHE_RDY
));
// Enable Cache
MXC_ICC1
->
cache_ctrl
|=
MXC_F_ICC_CACHE_CTRL_CACHE_EN
;
// Enable Cache
MXC_ICC1
->
cache_ctrl
|=
MXC_F_ICC_CACHE_CTRL_CACHE_EN
;
SystemCoreClockUpdate
();
SystemCoreClockUpdate
();
}
This diff is collapsed.
Click to expand it.
l0dables/lib/l0dable.ld
+
7
−
7
View file @
0054609f
...
...
@@ -45,10 +45,10 @@ SECTIONS {
. = ALIGN(4);
*(.data*)
. = ALIGN(4);
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP(*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
. = ALIGN(4);
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP(*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
. = ALIGN(4);
...
...
@@ -79,7 +79,7 @@ SECTIONS {
CARD10_STACK_LIMIT = .;
} :data
/* Limit based on current limitations of l0dable setup - only uses core1 RAM. */
/* Limit based on current limitations of l0dable setup - only uses core1 RAM. */
ASSERT(. < 0x40000, "Exceeded available RAM")
/DISCARD/ :
...
...
@@ -90,7 +90,7 @@ SECTIONS {
*(.ARM.attributes)
/* Original interpreter path from gcc/ld - nuke. */
*(.interp)
/* Dynamic linking section - nuke, we're not a .so and nothing is going to link against us. */
*(.dynamic)
/* Dynamic linking section - nuke, we're not a .so and nothing is going to link against us. */
*(.dynamic)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment