mirror of
https://github.com/pine64/blisp.git
synced 2024-12-22 06:20:12 +00:00
Added initial BL61X and BL808 support, some chip changes
This commit is contained in:
parent
841a52177b
commit
2740d305ba
@ -5,17 +5,26 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
enum blisp_chip_type { BLISP_CHIP_BL60X, BLISP_CHIP_BL70X };
|
||||
enum blisp_chip_type {
|
||||
BLISP_CHIP_BL60X,
|
||||
BLISP_CHIP_BL70X,
|
||||
BLISP_CHIP_BL606P,
|
||||
BLISP_CHIP_BL808,
|
||||
BLISP_CHIP_BL61X,
|
||||
};
|
||||
|
||||
struct blisp_chip { // TODO: Move elsewhere?
|
||||
enum blisp_chip_type type;
|
||||
const char* type_str;
|
||||
bool usb_isp_available;
|
||||
float handshake_byte_multiplier;
|
||||
const char* default_eflash_loader_xtal; // TODO: Make this selectable
|
||||
const char* default_xtal; // TODO: Make this selectable
|
||||
bool needs_eflash_loader;
|
||||
};
|
||||
|
||||
extern struct blisp_chip blisp_chip_bl60x;
|
||||
extern struct blisp_chip blisp_chip_bl70x;
|
||||
extern struct blisp_chip blisp_chip_bl808;
|
||||
extern struct blisp_chip blisp_chip_bl61x;
|
||||
|
||||
#endif
|
@ -5,6 +5,7 @@ struct blisp_chip blisp_chip_bl60x = {
|
||||
.type = BLISP_CHIP_BL60X,
|
||||
.type_str = "bl60x",
|
||||
.usb_isp_available = false,
|
||||
.default_eflash_loader_xtal = "40m",
|
||||
.default_xtal = "40m",
|
||||
.handshake_byte_multiplier = 0.006f,
|
||||
.needs_eflash_loader = true
|
||||
};
|
||||
|
11
lib/chip/blisp_chip_bl61x.c
Normal file
11
lib/chip/blisp_chip_bl61x.c
Normal file
@ -0,0 +1,11 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
#include "blisp.h"
|
||||
|
||||
struct blisp_chip blisp_chip_bl61x = {
|
||||
.type = BLISP_CHIP_BL61X,
|
||||
.type_str = "bl808",
|
||||
.usb_isp_available = true,
|
||||
.default_xtal = "-", // ?
|
||||
.handshake_byte_multiplier = 0.003f,
|
||||
.needs_eflash_loader = false
|
||||
};
|
@ -5,6 +5,7 @@ struct blisp_chip blisp_chip_bl70x = {
|
||||
.type = BLISP_CHIP_BL70X,
|
||||
.type_str = "bl70x",
|
||||
.usb_isp_available = true,
|
||||
.default_eflash_loader_xtal = "32m",
|
||||
.default_xtal = "32m",
|
||||
.handshake_byte_multiplier = 0.003f,
|
||||
.needs_eflash_loader = true
|
||||
};
|
||||
|
11
lib/chip/blisp_chip_bl808.c
Normal file
11
lib/chip/blisp_chip_bl808.c
Normal file
@ -0,0 +1,11 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
#include "blisp.h"
|
||||
|
||||
struct blisp_chip blisp_chip_bl808 = {
|
||||
.type = BLISP_CHIP_BL808,
|
||||
.type_str = "bl808",
|
||||
.usb_isp_available = true, // TODO: Only for BL808D :-(
|
||||
.default_xtal = "-", // ?
|
||||
.handshake_byte_multiplier = 0.003f,
|
||||
.needs_eflash_loader = false
|
||||
};
|
@ -286,7 +286,7 @@ void blisp_flash_firmware() {
|
||||
}
|
||||
snprintf(eflash_loader_path, PATH_MAX, "%s/data/%s/eflash_loader_%s.bin",
|
||||
exe_path, device.chip->type_str,
|
||||
device.chip->default_eflash_loader_xtal);
|
||||
device.chip->default_xtal);
|
||||
printf("Loading the eflash loader file from disk\n");
|
||||
eflash_loader_file = fopen(eflash_loader_path, "rb"); // TODO: Error handling
|
||||
if (eflash_loader_file == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user