Skip to content
Snippets Groups Projects
Commit 25026fa9 authored by Thierry Reding's avatar Thierry Reding Committed by Albert ARIBAUD
Browse files

ARM: cache-cp15: Use more accurate types


size_t is the canonical type to represent variables that contain a size.
Use it instead of signed integer. Physical addresses can be larger than
32-bit, so use a more appropriate type for them as well. phys_addr_t is
a type that is 32-bit on systems that use 32-bit addresses and 64-bit if
the system is 64-bit or uses a form of physical address extension to use
a larger address space on 32-bit systems. Using these types the same API
can be implemented on a wider range of systems.

Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent b9297c22
No related branches found
No related tags found
No related merge requests found
...@@ -201,7 +201,7 @@ enum { ...@@ -201,7 +201,7 @@ enum {
* \param size size of memory region to change * \param size size of memory region to change
* \param option dcache option to select * \param option dcache option to select
*/ */
void mmu_set_region_dcache_behaviour(u32 start, int size, void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size,
enum dcache_option option); enum dcache_option option);
/** /**
......
...@@ -47,15 +47,15 @@ __weak void mmu_page_table_flush(unsigned long start, unsigned long stop) ...@@ -47,15 +47,15 @@ __weak void mmu_page_table_flush(unsigned long start, unsigned long stop)
debug("%s: Warning: not implemented\n", __func__); debug("%s: Warning: not implemented\n", __func__);
} }
void mmu_set_region_dcache_behaviour(u32 start, int size, void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size,
enum dcache_option option) enum dcache_option option)
{ {
u32 *page_table = (u32 *)gd->arch.tlb_addr; u32 *page_table = (u32 *)gd->arch.tlb_addr;
u32 upto, end; unsigned long upto, end;
end = ALIGN(start + size, MMU_SECTION_SIZE) >> MMU_SECTION_SHIFT; end = ALIGN(start + size, MMU_SECTION_SIZE) >> MMU_SECTION_SHIFT;
start = start >> MMU_SECTION_SHIFT; start = start >> MMU_SECTION_SHIFT;
debug("%s: start=%x, size=%x, option=%d\n", __func__, start, size, debug("%s: start=%pa, size=%zu, option=%d\n", __func__, &start, size,
option); option);
for (upto = start; upto < end; upto++) for (upto = start; upto < end; upto++)
set_section_dcache(upto, option); set_section_dcache(upto, option);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment