Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
8ba622e5
Commit
8ba622e5
authored
Apr 24, 2023
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce size of bootloader (remove ref to div64_32)
parent
b5444fe9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
simple_uart.c
dev/simple_uart.c
+2
-0
boot.mk
tools/uart-bootloader/boot.mk
+1
-5
No files found.
dev/simple_uart.c
View file @
8ba622e5
...
...
@@ -19,6 +19,7 @@
( ((( (unsigned long long)baudrate * 8ULL) << (16 - 7)) + \
(CPU_CLOCK >> 8)) / (CPU_CLOCK >> 7) )
#ifndef IN_BOOTLOADER
/* Avoid use of div64_32 */
static
inline
uint32_t
suart_calc_baud
(
int
baudrate
)
{
uint64_t
n
=
(((
uint64_t
)
(
baudrate
))
<<
12
)
+
(
CPU_CLOCK
>>
8
);
...
...
@@ -31,6 +32,7 @@ void suart_init(struct simple_uart_device *dev, uint32_t base_addr, int baudrate
dev
->
base
=
(
void
*
)
base_addr
;
writel
(
suart_calc_baud
(
baudrate
),
dev
->
base
+
UART_REG_BCR
);
}
#endif
void
suart_init_default_baudrate
(
struct
simple_uart_device
*
dev
,
uint32_t
base_addr
)
{
...
...
tools/uart-bootloader/boot.mk
View file @
8ba622e5
...
...
@@ -7,8 +7,7 @@ BOOTLOADER_OBJS = \
tools/uart-bootloader/bb_spi.o \
tools/uart-bootloader/gpio.o \
tools/uart-bootloader/spi_flash.o \
tools/uart-bootloader/simple_uart.o \
tools/uart-bootloader/div64.o
tools/uart-bootloader/simple_uart.o
BOOTLOADER_LDFLAGS = -Os -march=rv32im -mabi=ilp32
...
...
@@ -31,9 +30,6 @@ tools/uart-bootloader/spi_flash.o: dev/spi_flash.c
tools/uart-bootloader/simple_uart.o: dev/simple_uart.c
${CC} $(BOOTLOADER_CFLAGS) -c $^ -o $@
tools/uart-bootloader/div64.o: pp_printf/div64.c
${CC} $(BOOTLOADER_CFLAGS) -c $^ -o $@
obj-$(CONFIG_BOOTLOADER) += tools/uart-bootloader/bootloader.o
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment