blisp/lib/chip/blisp_chip_bl60x.c

25 lines
798 B
C
Raw Normal View History

2022-11-30 12:17:30 +00:00
// SPDX-License-Identifier: MIT
2023-01-09 20:23:46 +00:00
#include <malloc.h>
#include <string.h>
#include "../../data/bl60x_eflash_loader.h"
2022-11-08 21:06:14 +00:00
#include "blisp.h"
2023-01-09 20:23:46 +00:00
int64_t blisp_chip_bl60x_get_eflash_loader(uint8_t clk_type, uint8_t** firmware_buf_ptr)
{
uint8_t* firmware_buf = malloc(sizeof(bl60x_eflash_loader_bin));
memcpy(firmware_buf, bl60x_eflash_loader_bin, sizeof(bl60x_eflash_loader_bin));
*(firmware_buf + 0xE0) = 4; // TODO: 40 MHz clock
*firmware_buf_ptr = firmware_buf;
return sizeof(bl60x_eflash_loader_bin);
}
2022-11-08 21:06:14 +00:00
struct blisp_chip blisp_chip_bl60x = {
.type = BLISP_CHIP_BL60X,
.type_str = "bl60x",
.usb_isp_available = false,
.default_xtal = "40m",
2022-11-08 21:06:14 +00:00
.handshake_byte_multiplier = 0.006f,
2023-01-09 20:23:46 +00:00
.load_eflash_loader = blisp_chip_bl60x_get_eflash_loader,
.tcm_address = 0x22010000
2022-11-08 21:06:14 +00:00
};