Skip to content

Commit a645be3

Browse files
committed
Fixed regression on sama5d3
1 parent 519d5fd commit a645be3

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ configure_file(include/target.h.in ${CMAKE_CURRENT_BINARY_DIR}/target.h @ONLY)
699699

700700
add_library(target INTERFACE)
701701
target_compile_definitions(target INTERFACE ${WOLFBOOT_DEFS})
702-
target_include_directories(target BEFORE INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
702+
target_include_directories(target BEFORE INTERFACE ${CMAKE_CURRENT_BINARY_DIR} lib/wolfssl)
703703

704704
set(KEYSTORE ${CMAKE_CURRENT_BINARY_DIR}/keystore.c)
705705

hal/sama5d3.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static int division(uint32_t dividend,
7878
return 0;
7979
}
8080

81-
static uint32_t div(uint32_t dividend, uint32_t divisor)
81+
static uint32_t div_u(uint32_t dividend, uint32_t divisor)
8282
{
8383
uint32_t quotient = 0;
8484
uint32_t remainder = 0;
@@ -504,7 +504,7 @@ static void nand_read_info(void)
504504
nand_flash.bad_block_pos = (*(uint16_t *)(onfi_data + PARAMS_POS_FEATURES)) & 1;
505505
nand_flash.ext_page_len = *(uint16_t *)(onfi_data + PARAMS_POS_EXT_PARAM_PAGE_LEN);
506506
nand_flash.parameter_page = *(uint16_t *)(onfi_data + PARAMS_POS_PARAMETER_PAGE);
507-
nand_flash.pages_per_block = div(nand_flash.block_size, nand_flash.page_size);
507+
nand_flash.pages_per_block = div_u(nand_flash.block_size, nand_flash.page_size);
508508
nand_flash.pages_per_device = nand_flash.pages_per_block * nand_flash.block_count;
509509
nand_flash.oob_size = *(uint16_t *)(onfi_data + PARAMS_POS_OOBSIZE);
510510
nand_flash.revision = *(uint16_t *)(onfi_data + PARAMS_POS_REVISION);
@@ -605,8 +605,8 @@ static int nand_check_bad_block(uint32_t block)
605605
int ext_flash_read(uintptr_t address, uint8_t *data, int len)
606606
{
607607
uint8_t buffer_page[NAND_FLASH_PAGE_SIZE];
608-
uint32_t block = div(address, nand_flash.block_size); /* The block where the address falls in */
609-
uint32_t page = div(address, nand_flash.page_size); /* The page where the address falls in */
608+
uint32_t block = div_u(address, nand_flash.block_size); /* The block where the address falls in */
609+
uint32_t page = div_u(address, nand_flash.page_size); /* The page where the address falls in */
610610
uint32_t start_page_in_block = mod(page, nand_flash.pages_per_block); /* The start page within this block */
611611
uint32_t in_block_offset = mod(address, nand_flash.block_size); /* The offset of the address within the block */
612612
uint32_t remaining = nand_flash.block_size - in_block_offset; /* How many bytes remaining to read in the first block */
@@ -637,7 +637,7 @@ int ext_flash_read(uintptr_t address, uint8_t *data, int len)
637637
} while (ret < 0);
638638

639639
/* Amount of pages to be read from this block */
640-
pages_to_read = div((sz + nand_flash.page_size - 1), nand_flash.page_size);
640+
pages_to_read = div_u((sz + nand_flash.page_size - 1), nand_flash.page_size);
641641

642642
if (pages_to_read * nand_flash.page_size > remaining)
643643
pages_to_read--;

0 commit comments

Comments
 (0)