2018-12-03 |
ARM: mmu64: include dma.h
...
dma.h provides the prototypes for the different dma_alloc_* functions,
so we should include it to make sure the prototypes are consistent.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Lucas Stach
authored
on 30 Nov 2018
Sascha Hauer
committed
on 3 Dec 2018
|
2018-08-24 |
ARM: mmu64: Don't flush freshly invalidated region
...
Current code for dma_sync_single_for_device(), when called with dir
set to DMA_FROM_DEVICE, will first invalidate given region of memory
as a first step and then clean+invalidate it as a second. While the
second step should be harmless it seems to be an unnecessary no-op
that could probably be avoided.
Analogous code in Linux kernel (4.18) in arch/arm64/mm/cache.S:
ENTRY(__dma_map_area)
cmp w2, #DMA_FROM_DEVICE
b.eq __dma_inv_area
b __dma_clean_area
ENDPIPROC(__dma_map_area)
is written to only perform either invalidate or clean, depending on
the direction, so change dma_sync_single_for_device() to behave in the
same vein and perfom _either_ invlidate or flush of the given region.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Andrey Smirnov
authored
on 23 Aug 2018
Sascha Hauer
committed
on 24 Aug 2018
|
2018-06-08 |
ARM: mmu64: Convert flags in arch_remap_range()
...
Flags passed to arch_remap_range() are architecture independent, so it
can't be passed as is to map_region(). Add code to do the proper
conversion to avoid subtle bugs that this confusion brings.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Andrey Smirnov
authored
on 7 Jun 2018
Sascha Hauer
committed
on 8 Jun 2018
|
ARM: mmu64: Make use of create_table()
...
Make use of create_table() instead of calling xmemalign() and memset()
explicitly.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Andrey Smirnov
authored
on 7 Jun 2018
Sascha Hauer
committed
on 8 Jun 2018
|
ARM: mmu64: Trivial code simplification
...
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Andrey Smirnov
authored
on 7 Jun 2018
Sascha Hauer
committed
on 8 Jun 2018
|
2018-04-09 |
ARM: mmu64: Add commment
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 9 Apr 2018
|
2018-04-04 |
ARM: aarch64: Make early MMU support work
...
Until now it was not possible to enable the MMU in PBL because
create_section needs memory allocations which are not available. With
this patch we move the early MMU support to a separate file and all
necessary aux functions to mmu_64.h. create_sections is reimplmented
for the early case to only create 1st level pagetables.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2018
|
ARM: change mmu_early_enable() prototype
...
Change the arguements to type unsigned long which is suitable for both
arm32 and arm64. While at it move the prototype to arch/arm/include/.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2018
|
ARM: create separate mmu_64.h file
...
cpu/mmu.h has nothing in common for the 32bit and 64bit variant. Make it
two separate files.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Apr 2018
|
2018-03-29 |
ARM: aarch64: mmu: Make zero page faulting
...
Make zero page faulting which allows us to catch NULL pointer derefs.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 29 Mar 2018
|
ARM: aarch64: implement dma operations
...
For proper DMA support dma_alloc_coherent and DMA sync operations are
needed. Implement them.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 29 Mar 2018
|
2018-03-23 |
ARM: aarch64: mmu: Fix disabling the MMU
...
Do it as U-Boot: Disable MMU first, then flush caches and finally
invalidate tlbs. I wish I could reference some document instead of
U-Boot code, but I haven't found anything.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Mar 2018
|
ARM: aarch64: mmu: drop ttb check when disabling the MMU
...
If the MMU is enabled then we should be able to disable it, no
matter if we initialized it in barebox or not. This change is not
really needed but helps when we are starting second stage from U-Boot
with the 'go' command which leaves the MMU enabled.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Mar 2018
|
ARM: aarch64: mmu: No need to disable icache
...
When the MMU is disabled there is no need to disable the icache. Leave
it enabled.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Mar 2018
|
ARM: aarch64: mmu: Fix TCR setting
...
A BITS_PER_VA value of 33 is a little small. Increase it to 39 which is
the maximum size we can do with 3 level page tables. The TCR value
depends on the current exception level, so we have to calculate the
value during runtime. To do this use a function derived from U-Boots
get_tcr function.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Mar 2018
|
ARM: aarch64: mmu: Fix PTE_TYPE_* flags
...
When we reach level 3 page tables we set the PTE_TYPE_PAGE bit in attr.
This is wrong since in the outer loop we can fall back to a lower level
in which case the PTE_TYPE_PAGE may not be set.
Fix this by not modifying attr and instead compose the *pte value when
needed.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Mar 2018
|
ARM: aarch64: mmu: Fix adding additional page table levels
...
When we create a higher level page table we have to initialize it
with the settings from the previous lower level page table so that
we do not modify unrelated mappings. split_block() is taken from
U-Boot code and does this job.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Mar 2018
|
ARM: aarch64: mmu: use PTE_* definitions from U-Boot
...
'PMD' (Page Middle Directory) is a Linuxism that is not really
helpful in the barebox MMU code. Use the U-Boot definitions
which only use PTE_* and seem to be more consistent for our
usecase.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Mar 2018
|
ARM: aarch64: mmu: enable mmu in generic code
...
Using board code to enable the MMU is not nice. Do it in generic
code. Since mmu_enable() is now done in mmu_64.c we no longer have
to export it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Mar 2018
|
ARM: aarch64: mmu: Fix mair register setting
...
The memory attributes register contains the memory attribute settings
for the corresponding to the possible AttrIndx values in the page
table entries. Passing UNCACHED_MEM makes no sense here, pass the
desired attributes instead.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Mar 2018
|
ARM: aarch64: mmu: by default map as device memory
...
By default map the whole address space as unshared device memory
as this is what barebox drivers normally expect.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Mar 2018
|
ARM: aarch64: mmu: remove unused map_io_sections()
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Mar 2018
|
ARM: aarch64: mmu: fix creation of flat mapping
...
During initialization of the page tables we want to create a flat
uncached mapping for the whole address space. create_sections() takes
the size in bytes, not in MiB as assumed by the callees. Fix this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Mar 2018
|
ARM: aarch64: mmu: create_sections() takes size in bytes
...
create_sections() takes size in bytes, not in megabytes, so
drop the _m prefix from the size argument.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Mar 2018
|
ARM: aarch64: mmu: Allocate page tables dynamically
...
Current code allocates 16KiB for page tables. Whenever a new
table is needed an index is increased, but the bounds of this
index are never checked. Allocate the page tables dynamically
to solve this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Mar 2018
|
2018-03-21 |
ARM: aarch64: silence compiler warning
...
find_pte is currently unused, nevertheless it's useful for debugging
purposes. Add a __maybe_unused to silence the compiler warning.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 21 Mar 2018
|
ARM: mmu: include pgtable header from where it's needed
...
Instead of #ifdefing the correct pgtable header file to include,
include it where it's needed. Also, move the memory type attributes
into there consumers, namely the mmu.c files.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 21 Mar 2018
|
2016-07-06 |
arm: cpu: add basic arm64 mmu support
...
This commit adds basic mmu support, ie:
- DMA cache handling is not supported
- Remapping memory region also
The current mmu setting is:
- 4KB granularity
- 3 level lookup (skipping L0)
- 33 bits per VA
This is based on coreboot and u-boot mmu configuration.
Signed-off-by: Raphael Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Raphael Poggi
authored
on 4 Jul 2016
Sascha Hauer
committed
on 6 Jul 2016
|