Commit 3abe33fa authored by Tomasz Wlostowski's avatar Tomasz Wlostowski Committed by Grzegorz Daniluk

UART bootloader for Greg

parent 361de2e8
......@@ -25,6 +25,8 @@
#include <stdint.h>
#define BASE_CLOCK 62500000 // Xtal frequency
#define CPU_CLOCK 62500000 // Xtal frequency
#define CONSOLE_UART_BAUDRATE 921600 // Xtal frequency
#define BASE_UART 0x20500
#define BASE_SYSCON 0x20400
......
......@@ -22,7 +22,7 @@
#include <stdint.h>
#include <stdio.h>
#define CONFIG_ERTM14_FLASH
#undef CONFIG_ERTM14_FLASH
#include "board.h"
......@@ -79,6 +79,8 @@ struct gpio_device gpio_aux;
struct spi_bus spi_flash;
struct spi_flash_device dev_flash;
void start_user();
static void boot_sysc_gpio_set_dir(const struct gpio_pin *pin, int dir)
{
}
......@@ -119,7 +121,7 @@ void boot_flash_init()
&boot_pin_sysc_spi_sclk, 10 );
spi_flash_create( &dev_flash, &spi_flash, 16384 );
spi_flash_create( &dev_flash, &spi_flash, 16384, 0x0 );
}
#endif
......@@ -398,8 +400,10 @@ void boot_fsm()
#define ERTM14_FLASH_PAGE_SIZE 65536
#define ERTM14_FLASH_SIZE 16777216
#define ERTM14_FIRMWARE_MAGIC 0xf1dee41a
void try_flash_boot()
{
#ifdef CONFIG_ERTM14_FLASH
uint8_t buf[512];
uint32_t offset;
for(offset = 0; offset < ERTM14_FLASH_SIZE; offset += ERTM14_FLASH_PAGE_SIZE)
......@@ -415,6 +419,7 @@ void try_flash_boot()
start_user();
}
}
#endif
}
......
......@@ -7,10 +7,10 @@ MEMORY
LENGTH = 0x100
ram :
ORIGIN = 131072 + 65536 - 8192
ORIGIN = 131072 - 8192
LENGTH = 6800
stack :
ORIGIN = 131072 + 65536 - 2048,
ORIGIN = 131072 - 2048,
LENGTH = 2038
}
......
This diff is collapsed.
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