mirror of
https://github.com/blackmagic-debug/blackmagic.git
synced 2025-10-14 02:58:36 +08:00
sam3x: const
-correctness for the function signatures
This commit is contained in:
@@ -240,7 +240,7 @@ static void sam_add_flash(target_s *const target, const uint32_t eefc_base, cons
|
||||
target_add_flash(target, target_flash);
|
||||
}
|
||||
|
||||
static void samx7x_add_ram(target_s *target, uint32_t tcm_config, uint32_t ram_size)
|
||||
static void samx7x_add_ram(target_s *const target, const uint32_t tcm_config, const uint32_t ram_size)
|
||||
{
|
||||
uint32_t itcm_size = 0;
|
||||
uint32_t dtcm_size = 0;
|
||||
@@ -269,7 +269,7 @@ static void samx7x_add_ram(target_s *target, uint32_t tcm_config, uint32_t ram_s
|
||||
target_add_ram32(target, 0x20400000, sram_size);
|
||||
}
|
||||
|
||||
static size_t sam_flash_size(uint32_t cidr)
|
||||
static size_t sam_flash_size(const uint32_t cidr)
|
||||
{
|
||||
switch (cidr & CHIPID_CIDR_NVPSIZ_MASK) {
|
||||
case CHIPID_CIDR_NVPSIZ_8K:
|
||||
@@ -295,7 +295,7 @@ static size_t sam_flash_size(uint32_t cidr)
|
||||
}
|
||||
}
|
||||
|
||||
static size_t sam_sram_size(uint32_t cidr)
|
||||
static size_t sam_sram_size(const uint32_t cidr)
|
||||
{
|
||||
switch (cidr & CHIPID_CIDR_SRAMSIZ_MASK) {
|
||||
case CHIPID_CIDR_SRAMSIZ_256K:
|
||||
@@ -307,7 +307,7 @@ static size_t sam_sram_size(uint32_t cidr)
|
||||
}
|
||||
}
|
||||
|
||||
samx7x_descr_s samx7x_parse_id(uint32_t cidr, uint32_t exid)
|
||||
samx7x_descr_s samx7x_parse_id(const uint32_t cidr, const uint32_t exid)
|
||||
{
|
||||
samx7x_descr_s descr = {0};
|
||||
|
||||
@@ -383,7 +383,7 @@ samx7x_descr_s samx7x_parse_id(uint32_t cidr, uint32_t exid)
|
||||
return descr;
|
||||
}
|
||||
|
||||
bool samx7x_probe(target_s *target)
|
||||
bool samx7x_probe(target_s *const target)
|
||||
{
|
||||
/* Start by reading out the ChipID peripheral's CIDR, and if that indicates there's an EXID, that too */
|
||||
const uint32_t cidr = target_mem32_read32(target, SAM_CHIPID_CIDR);
|
||||
@@ -448,7 +448,7 @@ bool samx7x_probe(target_s *target)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool sam3x_probe(target_s *target)
|
||||
bool sam3x_probe(target_s *const target)
|
||||
{
|
||||
uint32_t cidr = target_mem32_read32(target, SAM_CHIPID_CIDR);
|
||||
size_t size = sam_flash_size(cidr);
|
||||
@@ -546,7 +546,7 @@ static bool sam_flash_cmd(target_s *const target, const uint32_t base, const uin
|
||||
return !(status & EEFC_FSR_ERROR);
|
||||
}
|
||||
|
||||
static sam_driver_e sam_driver(target_s *target)
|
||||
static sam_driver_e sam_driver(target_s *const target)
|
||||
{
|
||||
if (strcmp(target->driver, "Atmel SAM3X") == 0)
|
||||
return DRIVER_SAM3X;
|
||||
@@ -559,7 +559,7 @@ static sam_driver_e sam_driver(target_s *target)
|
||||
return DRIVER_SAMX7X;
|
||||
}
|
||||
|
||||
static bool sam_flash_erase(target_flash_s *flash, target_addr_t addr, size_t len)
|
||||
static bool sam_flash_erase(target_flash_s *const flash, const target_addr_t addr, const size_t len)
|
||||
{
|
||||
(void)len;
|
||||
target_s *target = flash->t;
|
||||
@@ -588,7 +588,8 @@ static bool sam3_flash_erase(target_flash_s *flash, target_addr_t addr, size_t l
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool sam_flash_write(target_flash_s *flash, target_addr_t dest, const void *src, size_t len)
|
||||
static bool sam_flash_write(
|
||||
target_flash_s *const flash, const target_addr_t dest, const void *const src, const size_t len)
|
||||
{
|
||||
target_s *const target = flash->t;
|
||||
sam_flash_s *const sam_flash = (sam_flash_s *)flash;
|
||||
@@ -618,7 +619,7 @@ static bool sam_mass_erase(target_flash_s *const flash, platform_timeout_s *cons
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool sam_gpnvm_get(target_s *target, uint32_t base, uint32_t *gpnvm)
|
||||
static bool sam_gpnvm_get(target_s *const target, const uint32_t base, uint32_t *const gpnvm)
|
||||
{
|
||||
if (!gpnvm || !sam_flash_cmd(target, base, EEFC_FCR_FCMD_GGPB, 0))
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user