Commit 8ba622e5 authored by Tristan Gingold's avatar Tristan Gingold

Reduce size of bootloader (remove ref to div64_32)

parent b5444fe9
......@@ -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)
{
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment