mirror of
https://github.com/pine64/blisp.git
synced 2024-12-22 06:20:12 +00:00
Fixed bug in reading chip ID
This commit is contained in:
parent
80a0854f2c
commit
04916cf5a4
17
lib/blisp.c
17
lib/blisp.c
@ -279,13 +279,16 @@ blisp_return_t blisp_device_get_boot_info(struct blisp_device* device,
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
memcpy(boot_info->boot_rom_version, &device->rx_buffer[0],
|
||||
4); // TODO: Endianess; this may break on big endian machines
|
||||
if (device->chip->type == BLISP_CHIP_BL70X || device->chip->type == BLISP_CHIP_BL808) { // TODO: This is only 70X related
|
||||
memcpy(boot_info->chip_id, &device->rx_buffer[16], 8);
|
||||
}
|
||||
// TODO: BL60X, BL808
|
||||
return BLISP_OK;
|
||||
// TODO: Endianess; this may break on big endian machines
|
||||
memcpy(boot_info->boot_rom_version, &device->rx_buffer[0], 4);
|
||||
|
||||
if (device->chip->type == BLISP_CHIP_BL70X) {
|
||||
memcpy(boot_info->chip_id, &device->rx_buffer[16], 8);
|
||||
} else {
|
||||
memcpy(boot_info->chip_id, &device->rx_buffer[12], 6);
|
||||
}
|
||||
|
||||
return BLISP_OK;
|
||||
}
|
||||
|
||||
// TODO: Use struct instead of uint8_t*
|
||||
|
@ -78,14 +78,26 @@ blisp_return_t blisp_common_prepare_flash(struct blisp_device* device) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
printf(
|
||||
"BootROM version %d.%d.%d.%d, ChipID: "
|
||||
"%02X%02X%02X%02X%02X%02X%02X%02X\n",
|
||||
boot_info.boot_rom_version[0], boot_info.boot_rom_version[1],
|
||||
boot_info.boot_rom_version[2], boot_info.boot_rom_version[3],
|
||||
boot_info.chip_id[0], boot_info.chip_id[1], boot_info.chip_id[2],
|
||||
boot_info.chip_id[3], boot_info.chip_id[4], boot_info.chip_id[5],
|
||||
boot_info.chip_id[6], boot_info.chip_id[7]);
|
||||
// TODO: Do we want this to print in big endian to match the output
|
||||
// of Bouffalo's software?
|
||||
if (device->chip->type == BLISP_CHIP_BL70X) {
|
||||
printf(
|
||||
"BootROM version %d.%d.%d.%d, ChipID: "
|
||||
"%02X%02X%02X%02X%02X%02X%02X%02X\n",
|
||||
boot_info.boot_rom_version[0], boot_info.boot_rom_version[1],
|
||||
boot_info.boot_rom_version[2], boot_info.boot_rom_version[3],
|
||||
boot_info.chip_id[0], boot_info.chip_id[1], boot_info.chip_id[2],
|
||||
boot_info.chip_id[3], boot_info.chip_id[4], boot_info.chip_id[5],
|
||||
boot_info.chip_id[6], boot_info.chip_id[7]);
|
||||
} else {
|
||||
printf(
|
||||
"BootROM version %d.%d.%d.%d, ChipID: "
|
||||
"%02X%02X%02X%02X%02X%02X\n",
|
||||
boot_info.boot_rom_version[0], boot_info.boot_rom_version[1],
|
||||
boot_info.boot_rom_version[2], boot_info.boot_rom_version[3],
|
||||
boot_info.chip_id[0], boot_info.chip_id[1], boot_info.chip_id[2],
|
||||
boot_info.chip_id[3], boot_info.chip_id[4], boot_info.chip_id[5]);
|
||||
}
|
||||
|
||||
if (device->chip->type == BLISP_CHIP_BL808) {
|
||||
printf("Setting clock parameters ...\n");
|
||||
|
Loading…
Reference in New Issue
Block a user