From 4f4de4a07d64bc681f5ae2c6d1e374ecd4f4471f Mon Sep 17 00:00:00 2001 From: Michael Cardell Widerkrantz Date: Tue, 29 Apr 2025 17:49:44 +0200 Subject: [PATCH] fw: Harmonize comment style --- hw/application_fpga/fw/reset_test/main.c | 6 +- hw/application_fpga/fw/testapp/main.c | 6 +- hw/application_fpga/fw/testfw/main.c | 6 +- hw/application_fpga/fw/testfw/start.S | 14 ++-- hw/application_fpga/fw/testloadapp/blink.h | 3 + hw/application_fpga/fw/testloadapp/main.c | 3 + hw/application_fpga/fw/tk1/auth_app.c | 10 +-- hw/application_fpga/fw/tk1/main.c | 8 +- hw/application_fpga/fw/tk1/mgmt_app.c | 2 +- hw/application_fpga/fw/tk1/partition_table.h | 77 +++++++++--------- hw/application_fpga/fw/tk1/preload_app.c | 38 +++++---- hw/application_fpga/fw/tk1/proto.c | 6 +- hw/application_fpga/fw/tk1/proto.h | 6 +- hw/application_fpga/fw/tk1/reset.c | 6 +- hw/application_fpga/fw/tk1/start.S | 21 ++--- hw/application_fpga/fw/tk1/state.h | 6 +- hw/application_fpga/fw/tk1/storage.c | 82 ++++++++++---------- hw/application_fpga/fw/tk1/syscall_enable.S | 2 +- hw/application_fpga/fw/tk1/syscall_handler.c | 6 +- 19 files changed, 150 insertions(+), 158 deletions(-) diff --git a/hw/application_fpga/fw/reset_test/main.c b/hw/application_fpga/fw/reset_test/main.c index 2be91cb..076114d 100644 --- a/hw/application_fpga/fw/reset_test/main.c +++ b/hw/application_fpga/fw/reset_test/main.c @@ -1,7 +1,5 @@ -/* - * Copyright (C) 2022, 2023 - Tillitis AB - * SPDX-License-Identifier: GPL-2.0-only - */ +// Copyright (C) 2022, 2023 - Tillitis AB +// SPDX-License-Identifier: GPL-2.0-only #include #include diff --git a/hw/application_fpga/fw/testapp/main.c b/hw/application_fpga/fw/testapp/main.c index be4e6bc..61f6266 100644 --- a/hw/application_fpga/fw/testapp/main.c +++ b/hw/application_fpga/fw/testapp/main.c @@ -1,7 +1,5 @@ -/* - * Copyright (C) 2022, 2023 - Tillitis AB - * SPDX-License-Identifier: GPL-2.0-only - */ +// Copyright (C) 2022, 2023 - Tillitis AB +// SPDX-License-Identifier: GPL-2.0-only #include #include diff --git a/hw/application_fpga/fw/testfw/main.c b/hw/application_fpga/fw/testfw/main.c index 2051cd2..656a266 100644 --- a/hw/application_fpga/fw/testfw/main.c +++ b/hw/application_fpga/fw/testfw/main.c @@ -1,7 +1,5 @@ -/* - * Copyright (C) 2022, 2023 - Tillitis AB - * SPDX-License-Identifier: GPL-2.0-only - */ +// Copyright (C) 2022, 2023 - Tillitis AB +// SPDX-License-Identifier: GPL-2.0-only #include #include diff --git a/hw/application_fpga/fw/testfw/start.S b/hw/application_fpga/fw/testfw/start.S index 6ed1408..26d6186 100644 --- a/hw/application_fpga/fw/testfw/start.S +++ b/hw/application_fpga/fw/testfw/start.S @@ -1,7 +1,5 @@ -/* - * Copyright (C) 2022, 2023 - Tillitis AB - * SPDX-License-Identifier: GPL-2.0-only -*/ +// Copyright (C) 2022, 2023 - Tillitis AB +// SPDX-License-Identifier: GPL-2.0-only .section ".text.init" .globl _start @@ -38,7 +36,7 @@ _start: li x30,0 li x31,0 - /* Clear all RAM */ + // Clear all RAM li a0, 0x40000000 // TK1_RAM_BASE li a1, 0x40020000 // TK1_RAM_BASE + TK1_RAM_SIZE clear: @@ -46,9 +44,9 @@ clear: addi a0, a0, 4 blt a0, a1, clear - /* - * For testfw we init stack at top of RAM - */ + // NOTE WELL + // For testfw we init stack at top of RAM + // li sp, 0x40020000 // TK1_RAM_BASE + TK1_RAM_SIZE call main diff --git a/hw/application_fpga/fw/testloadapp/blink.h b/hw/application_fpga/fw/testloadapp/blink.h index a597e50..9aeb21f 100644 --- a/hw/application_fpga/fw/testloadapp/blink.h +++ b/hw/application_fpga/fw/testloadapp/blink.h @@ -1,3 +1,6 @@ +// Copyright (C) 2025 - Tillitis AB +// SPDX-License-Identifier: GPL-2.0-only + #ifndef BLINK_APP_H #define BLINK_APP_H diff --git a/hw/application_fpga/fw/testloadapp/main.c b/hw/application_fpga/fw/testloadapp/main.c index f3ccd3c..16f3e73 100644 --- a/hw/application_fpga/fw/testloadapp/main.c +++ b/hw/application_fpga/fw/testloadapp/main.c @@ -1,3 +1,6 @@ +// Copyright (C) 2025 - Tillitis AB +// SPDX-License-Identifier: GPL-2.0-only + #include #include #include diff --git a/hw/application_fpga/fw/tk1/auth_app.c b/hw/application_fpga/fw/tk1/auth_app.c index 68d5497..d9175e1 100644 --- a/hw/application_fpga/fw/tk1/auth_app.c +++ b/hw/application_fpga/fw/tk1/auth_app.c @@ -14,8 +14,8 @@ static volatile uint32_t *cdi = (volatile uint32_t *)TK1_MMIO_TK1_CDI_FIRST; -/* Calculates the authentication digest based on a supplied nonce and the CDI. - * Requires that the CDI is already calculated and stored */ +// Calculates the authentication digest based on a supplied nonce and +// the CDI. Requires that the CDI is already calculated and stored static void calculate_auth_digest(uint8_t *nonce, uint8_t *auth_digest) { assert(nonce != NULL); @@ -31,7 +31,7 @@ static void calculate_auth_digest(uint8_t *nonce, uint8_t *auth_digest) blake2s_final(&ctx, auth_digest); } -/* Generates a 16 byte nonce */ +// Generates a 16 byte nonce static void generate_nonce(uint32_t *nonce) { assert(nonce != NULL); @@ -42,8 +42,8 @@ static void generate_nonce(uint32_t *nonce) return; } -/* Returns the authentication digest and random nonce. Requires that the CDI is - * already calculated and stored */ +// Returns the authentication digest and random nonce. Requires that +// the CDI is already calculated and stored void auth_app_create(struct auth_metadata *auth_table) { assert(auth_table != NULL); diff --git a/hw/application_fpga/fw/tk1/main.c b/hw/application_fpga/fw/tk1/main.c index ae577af..c03007b 100644 --- a/hw/application_fpga/fw/tk1/main.c +++ b/hw/application_fpga/fw/tk1/main.c @@ -1,7 +1,5 @@ -/* - * Copyright (C) 2022, 2023 - Tillitis AB - * SPDX-License-Identifier: GPL-2.0-only - */ +// Copyright (C) 2022, 2023 - Tillitis AB +// SPDX-License-Identifier: GPL-2.0-only #include #include @@ -607,7 +605,7 @@ int main(void) } /*@ -compdestroy @*/ - /* We don't care about memory leaks here. */ + // We don't care about memory leaks here. return (int)0xcafebabe; } diff --git a/hw/application_fpga/fw/tk1/mgmt_app.c b/hw/application_fpga/fw/tk1/mgmt_app.c index d1be65c..e5732aa 100644 --- a/hw/application_fpga/fw/tk1/mgmt_app.c +++ b/hw/application_fpga/fw/tk1/mgmt_app.c @@ -31,7 +31,7 @@ int mgmt_app_init(uint8_t app_digest[32]) return 0; } -/* Authenticate an management app */ +// Authenticate an management app bool mgmt_app_authenticate(void) { return memeq(current_app_digest, allowed_app_digest, 32) != 0; diff --git a/hw/application_fpga/fw/tk1/partition_table.h b/hw/application_fpga/fw/tk1/partition_table.h index f45ff92..097942e 100644 --- a/hw/application_fpga/fw/tk1/partition_table.h +++ b/hw/application_fpga/fw/tk1/partition_table.h @@ -6,25 +6,25 @@ #include -/* ---- Flash ---- ---- */ -/* name size start addr */ -/* ---- ---- ---- */ -/* bitstream 128KiB 0x00 */ -/* ---- ---- ---- */ -/* Partition 64KiB 0x20000 */ -/* ---- ---- ---- */ -/* Pre load 1 128KiB 0x30000 */ -/* Pre load 2 128KiB 0x50000 */ -/* ---- ---- ---- */ -/* storage 1 128KiB 0x70000 */ -/* storage 2 128KiB 0x90000 */ -/* storage 3 128KiB 0xB0000 */ -/* storage 4 128KiB 0xD0000 */ -/* ---- ---- ---- */ -/* Partition2 64KiB 0xf0000 */ +// ---- Flash ---- ---- +// name size start addr +// ---- ---- ---- +// bitstream 128KiB 0x00 +// ---- ---- ---- +// Partition 64KiB 0x20000 +// ---- ---- ---- +// Pre load 1 128KiB 0x30000 +// Pre load 2 128KiB 0x50000 +// ---- ---- ---- +// storage 1 128KiB 0x70000 +// storage 2 128KiB 0x90000 +// storage 3 128KiB 0xB0000 +// storage 4 128KiB 0xD0000 +// ---- ---- ---- +// Partition2 64KiB 0xf0000 -/* To simplify all blocks are aligned with the 64KiB blocks on the W25Q80DL - * flash. */ +// To simplify all blocks are aligned with the 64KiB blocks on the +// W25Q80DL flash. #define PART_TABLE_VERSION 1 @@ -52,26 +52,27 @@ enum part_status { PART_SLOT0_INVALID = 1, }; -/* Partition Table */ -/*- Table header */ -/* - 1 bytes Version */ -/**/ -/*- Pre-loaded device app 1 */ -/* - 4 bytes length. */ -/* - 32 bytes digest. */ -/* - 64 bytes signature. */ -/**/ -/*- Pre-loaded device app 2 */ -/* - 4 bytes length. */ -/* - 32 bytes digest. */ -/* - 64 bytes signature. */ -/**/ -/*- Device app storage area */ -/* - 1 byte status. */ -/* - 16 bytes random nonce. */ -/* - 16 bytes authentication tag. */ -/**/ -/*- Checksum over the above */ +// Partition Table +// ---------------------------------------------------------------------- +// - Table header +// - 1 bytes Version +// +// - Pre-loaded device app 1 +// - 4 bytes length. +// - 32 bytes digest. +// - 64 bytes signature. +// +// - Pre-loaded device app 2 +// - 4 bytes length. +// - 32 bytes digest. +// - 64 bytes signature. +// +// - Device app storage area +// - 1 byte status. +// - 16 bytes random nonce. +// - 16 bytes authentication tag. +// +// - Checksum over the above struct auth_metadata { uint8_t nonce[16]; diff --git a/hw/application_fpga/fw/tk1/preload_app.c b/hw/application_fpga/fw/tk1/preload_app.c index 4f40f99..80fa3b5 100644 --- a/hw/application_fpga/fw/tk1/preload_app.c +++ b/hw/application_fpga/fw/tk1/preload_app.c @@ -18,7 +18,7 @@ static uint32_t slot_to_start_address(uint8_t slot) return ADDR_PRE_LOADED_APP_0 + slot * SIZE_PRE_LOADED_APP; } -/* Loads a preloaded app from flash to app RAM */ +// Loads a preloaded app from flash to app RAM int preload_load(struct partition_table *part_table, uint8_t from_slot) { if (part_table == NULL) { @@ -29,24 +29,28 @@ int preload_load(struct partition_table *part_table, uint8_t from_slot) return -1; } - /* Check for a valid app in flash */ + // Check for a valid app in flash if (part_table->pre_app_data[from_slot].size == 0 && part_table->pre_app_data[from_slot].size <= TK1_APP_MAX_SIZE) { return -1; } uint8_t *loadaddr = (uint8_t *)TK1_RAM_BASE; - /* Read from flash, straight into RAM */ + // Read from flash, straight into RAM int ret = flash_read_data(slot_to_start_address(from_slot), loadaddr, part_table->pre_app_data[from_slot].size); return ret; } -/* Expects to receive chunks of data up to 4096 bytes to store into the - * preloaded area. The offset needs to be kept and updated between each call. - * Once done, call preload_store_finalize() with the last parameters. - * */ +// preload_store stores chunks of an app in app slot to_slot. data is +// a buffer of size size (max 4096 bytes) to be written at byte offset +// in the slot. offset needs to be kept and updated between each call. +// +// When all data has been written call preload_store_finalize() with +// the last parameters. +// +// Returns 0 on success. int preload_store(struct partition_table *part_table, uint32_t offset, uint8_t *data, size_t size, uint8_t to_slot) { @@ -58,12 +62,13 @@ int preload_store(struct partition_table *part_table, uint32_t offset, return -1; } - /* Check if we are allowed to store */ + // Check if we are allowed to store if (!mgmt_app_authenticate()) { return -1; } - /* Check for a valid app in flash, bale out if it already exists */ + // Check for a valid app in flash, bale out if it already + // exists if (part_table->pre_app_data[to_slot].size != 0) { return -1; } @@ -77,7 +82,7 @@ int preload_store(struct partition_table *part_table, uint32_t offset, } if ((offset + size) > SIZE_PRE_LOADED_APP) { - /* Writing outside of area */ + // Writing outside of area return -1; } @@ -115,12 +120,13 @@ int preload_store_finalize(struct partition_table_storage *part_table_storage, return -1; } - /* Check if we are allowed to store */ + // Check if we are allowed to store if (!mgmt_app_authenticate()) { return -1; } - /* Check for a valid app in flash, bale out if it already exists */ + // Check for a valid app in flash, bale out if it already + // exists if (part_table->pre_app_data[to_slot].size != 0) { return -1; } @@ -160,12 +166,12 @@ int preload_delete(struct partition_table_storage *part_table_storage, return -1; } - /* Check if we are allowed to deleted */ + // Check if we are allowed to delete if (!mgmt_app_authenticate()) { return -1; } - /*Check for a valid app in flash */ + // Check for a valid app in flash if (part_table->pre_app_data[slot].size == 0) { // Nothing to do. return 0; @@ -183,7 +189,7 @@ int preload_delete(struct partition_table_storage *part_table_storage, return -1; } - /* Assumes the area is 64 KiB block aligned */ + // Assumes the area is 64 KiB block aligned flash_block_64_erase( slot_to_start_address(slot)); // Erase first 64 KB block flash_block_64_erase(slot_to_start_address(slot) + @@ -204,7 +210,7 @@ int preload_get_digsig(struct partition_table *part_table, return -1; } - /* Check if we are allowed to read */ + // Check if we are allowed to read if (!mgmt_app_authenticate()) { return -1; } diff --git a/hw/application_fpga/fw/tk1/proto.c b/hw/application_fpga/fw/tk1/proto.c index 22affee..4ddf1c4 100644 --- a/hw/application_fpga/fw/tk1/proto.c +++ b/hw/application_fpga/fw/tk1/proto.c @@ -1,7 +1,5 @@ -/* - * Copyright (C) 2022, 2023 - Tillitis AB - * SPDX-License-Identifier: GPL-2.0-only - */ +// Copyright (C) 2022, 2023 - Tillitis AB +// SPDX-License-Identifier: GPL-2.0-only #include #include diff --git a/hw/application_fpga/fw/tk1/proto.h b/hw/application_fpga/fw/tk1/proto.h index 0c4ebda..3a0d8ce 100644 --- a/hw/application_fpga/fw/tk1/proto.h +++ b/hw/application_fpga/fw/tk1/proto.h @@ -1,7 +1,5 @@ -/* - * Copyright (C) 2022, 2023 - Tillitis AB - * SPDX-License-Identifier: GPL-2.0-only - */ +// Copyright (C) 2022, 2023 - Tillitis AB +// SPDX-License-Identifier: GPL-2.0-only #include #include diff --git a/hw/application_fpga/fw/tk1/reset.c b/hw/application_fpga/fw/tk1/reset.c index 4f37429..df43ab2 100644 --- a/hw/application_fpga/fw/tk1/reset.c +++ b/hw/application_fpga/fw/tk1/reset.c @@ -1,7 +1,5 @@ -/* - * Copyright (C) 2025 - Tillitis AB - * SPDX-License-Identifier: GPL-2.0-only - */ +// Copyright (C) 2025 - Tillitis AB +// SPDX-License-Identifier: GPL-2.0-only #include #include diff --git a/hw/application_fpga/fw/tk1/start.S b/hw/application_fpga/fw/tk1/start.S index f947e1e..d0be087 100644 --- a/hw/application_fpga/fw/tk1/start.S +++ b/hw/application_fpga/fw/tk1/start.S @@ -1,7 +1,5 @@ -/* - * Copyright (C) 2022-2025 - Tillitis AB - * SPDX-License-Identifier: GPL-2.0-only -*/ +// Copyright (C) 2022-2025 - Tillitis AB +// SPDX-License-Identifier: GPL-2.0-only #include @@ -28,9 +26,7 @@ _start: j init -/* - * IRQ handler -*/ +// IRQ handler .=0x10 irq_handler: // PicoRV32 stores the IRQ bitmask in x4. @@ -112,9 +108,8 @@ x3_valid: picorv32_retirq_insn() // Return from interrupt -/* - * Init -*/ +// Init + .=0x100 init: li x1, 0 @@ -149,7 +144,7 @@ init: li x30,0 li x31,0 - /* Clear FW_RAM */ + // Clear FW_RAM la a0, _sfwram la a1, _efwram clear: @@ -157,7 +152,7 @@ clear: addi a0, a0, 4 blt a0, a1, clear - /* Zero-init bss section */ + // Zero-init bss section la a0, _sbss la a1, _ebss @@ -166,7 +161,7 @@ loop_init_bss: addi a0, a0, 4 blt a0, a1, loop_init_bss - /* Init stack */ + // Init stack la sp, _estack call main diff --git a/hw/application_fpga/fw/tk1/state.h b/hw/application_fpga/fw/tk1/state.h index fd085dd..5df5385 100644 --- a/hw/application_fpga/fw/tk1/state.h +++ b/hw/application_fpga/fw/tk1/state.h @@ -1,7 +1,5 @@ -/* - * Copyright (C) 2023 - Tillitis AB - * SPDX-License-Identifier: GPL-2.0-only - */ +// Copyright (C) 2023 - Tillitis AB +// SPDX-License-Identifier: GPL-2.0-only #ifndef STATE_H #define STATE_H diff --git a/hw/application_fpga/fw/tk1/storage.c b/hw/application_fpga/fw/tk1/storage.c index f59c6e1..16f6d93 100644 --- a/hw/application_fpga/fw/tk1/storage.c +++ b/hw/application_fpga/fw/tk1/storage.c @@ -13,11 +13,9 @@ #include "partition_table.h" #include "storage.h" -/* - * Returns the index of the first empty area. - * - * Returns -1 on errors. - */ +// Returns the index of the first empty area. +// +// Returns -1 on errors. static int get_first_empty(struct partition_table *part_table) { if (part_table == NULL) { @@ -48,11 +46,9 @@ static int index_to_address(int index, uint32_t *address) return 0; } -/* - * Returns the index of the area an app has allocated. - * - * Returns -1 on errors. - */ +// Returns the index of the area an app has allocated. +// +// Returns -1 on errors. static int storage_get_area(struct partition_table *part_table) { if (part_table == NULL) { @@ -71,8 +67,9 @@ static int storage_get_area(struct partition_table *part_table) return -1; } -/* Allocate a new area for an app. Returns zero if a new area is allocated, one - * if an area already was allocated, and negative values for errors. */ +// Allocate a new area for an app. Returns zero if a new area is +// allocated, one if an area already was allocated, and negative +// values for errors. int storage_allocate_area(struct partition_table_storage *part_table_storage) { if (part_table_storage == NULL) { @@ -98,15 +95,15 @@ int storage_allocate_area(struct partition_table_storage *part_table_storage) return -3; } - /* Allocate the empty index found */ - /* Erase area first */ + // Allocate the empty index found + // Erase area first - /* Assumes the area is 64 KiB block aligned */ + // Assumes the area is 64 KiB block aligned flash_block_64_erase(start_address); // Erase first 64 KB block flash_block_64_erase(start_address + 0x10000); // Erase second 64 KB block - /* Write partition table lastly */ + // Write partition table lastly part_table->app_storage[index].status = 0x01; auth_app_create(&part_table->app_storage[index].auth); @@ -117,8 +114,9 @@ int storage_allocate_area(struct partition_table_storage *part_table_storage) return 0; } -/* Dealloacate a previously allocated storage area. Returns zero on success, and - * non-zero on errors. */ +// Dealloacate a previously allocated storage area. +// +// Returns zero on success, and non-zero on errors. int storage_deallocate_area(struct partition_table_storage *part_table_storage) { if (part_table_storage == NULL) { @@ -129,7 +127,7 @@ int storage_deallocate_area(struct partition_table_storage *part_table_storage) int index = storage_get_area(part_table); if (index < 0) { - /* No area to deallocate */ + // No area to deallocate return -1; } @@ -138,14 +136,14 @@ int storage_deallocate_area(struct partition_table_storage *part_table_storage) return -1; } - /* Erase area first */ + // Erase area first - /* Assumes the area is 64 KiB block aligned */ + // Assumes the area is 64 KiB block aligned flash_block_64_erase(start_address); // Erase first 64 KB block flash_block_64_erase(start_address + 0x10000); // Erase second 64 KB block - /* Clear partition table lastly */ + // Clear partition table lastly part_table->app_storage[index].status = 0; (void)memset(part_table->app_storage[index].auth.nonce, 0x00, @@ -162,9 +160,11 @@ int storage_deallocate_area(struct partition_table_storage *part_table_storage) return 0; } -/* Erases sector. Offset of a sector to begin erasing, must be a multiple of - * the sector size. Size to erase in bytes, must be a multiple of the sector * - * size. Returns zero on success, negative error code on failure */ +// Erases sector. Offset of a sector to begin erasing, must be a +// multiple of the sector size. Size to erase in bytes, must be a +// multiple of the sector size. +// +// Returns zero on success, negative error code on failure int storage_erase_sector(struct partition_table *part_table, uint32_t offset, size_t size) { @@ -174,7 +174,7 @@ int storage_erase_sector(struct partition_table *part_table, uint32_t offset, int index = storage_get_area(part_table); if (index == -1) { - /* No allocated area */ + // No allocated area return -1; } @@ -187,12 +187,12 @@ int storage_erase_sector(struct partition_table *part_table, uint32_t offset, return -1; } - /* Cannot only erase entire sectors */ + // Cannot only erase entire sectors if (offset % 4096 != 0) { return -1; } - /* Cannot erase less than one sector */ + // Cannot erase less than one sector if (size < 4096 || size > SIZE_STORAGE_AREA || size % 4096 != 0) { return -1; } @@ -215,10 +215,11 @@ int storage_erase_sector(struct partition_table *part_table, uint32_t offset, return 0; } -/* Writes the specified data to the offset inside of the - * allocated area. Assumes area has been erased before hand. - * Currently only handles writes to one sector, hence max size of 4096 bytes. - * Returns zero on success. */ +// Writes the specified data to the offset inside of the allocated +// area. Assumes area has been erased before hand. Currently only +// handles writes to one sector, hence max size of 4096 bytes. +// +// Returns zero on success. int storage_write_data(struct partition_table *part_table, uint32_t offset, uint8_t *data, size_t size) { @@ -234,7 +235,7 @@ int storage_write_data(struct partition_table *part_table, uint32_t offset, int index = storage_get_area(part_table); if (index == -1) { - /* No allocated area */ + // No allocated area return -1; } @@ -252,7 +253,7 @@ int storage_write_data(struct partition_table *part_table, uint32_t offset, } if ((offset + size) > SIZE_STORAGE_AREA) { - /* Writing outside of area */ + // Writing outside of area return -1; } @@ -265,9 +266,12 @@ int storage_write_data(struct partition_table *part_table, uint32_t offset, return flash_write_data(address, data, size); } -/* Reads size bytes of data at the specified offset inside of - * the allocated area. Returns zero on success. Only read limit - * is the size of the allocated area */ +// Reads size bytes of data at the specified offset inside of the +// allocated area. +// +// Only read limit is the size of the allocated area. +// +// Returns zero on success. int storage_read_data(struct partition_table *part_table, uint32_t offset, uint8_t *data, size_t size) { @@ -283,7 +287,7 @@ int storage_read_data(struct partition_table *part_table, uint32_t offset, int index = storage_get_area(part_table); if (index == -1) { - /* No allocated area */ + // No allocated area return -1; } @@ -302,7 +306,7 @@ int storage_read_data(struct partition_table *part_table, uint32_t offset, } if ((offset + size) > SIZE_STORAGE_AREA) { - /* Reading outside of area */ + // Reading outside of area return -1; } diff --git a/hw/application_fpga/fw/tk1/syscall_enable.S b/hw/application_fpga/fw/tk1/syscall_enable.S index 2060ddb..459c097 100644 --- a/hw/application_fpga/fw/tk1/syscall_enable.S +++ b/hw/application_fpga/fw/tk1/syscall_enable.S @@ -13,7 +13,7 @@ syscall_enable: - /* Enable syscall IRQ */ + // Enable syscall IRQ li t0, 0x7fffffff // IRQ31 mask picorv32_maskirq_insn(zero, t0) // Enable IRQs diff --git a/hw/application_fpga/fw/tk1/syscall_handler.c b/hw/application_fpga/fw/tk1/syscall_handler.c index 18bba35..7d3c310 100644 --- a/hw/application_fpga/fw/tk1/syscall_handler.c +++ b/hw/application_fpga/fw/tk1/syscall_handler.c @@ -1,7 +1,5 @@ -/* - * Copyright (C) 2025 - Tillitis AB - * SPDX-License-Identifier: GPL-2.0-only - */ +// Copyright (C) 2025 - Tillitis AB +// SPDX-License-Identifier: GPL-2.0-only #include #include