From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RESUBMIT PATCH v3 2/8] armv8: New MMU setup code allowing to use 48+ bits PA/VA
Date: Thu, 13 Aug 2015 19:31:29 +0200 [thread overview]
Message-ID: <201508131931.29921.marex@denx.de> (raw)
In-Reply-To: <1439484688-866-3-git-send-email-s.temerkhanov@gmail.com>
On Thursday, August 13, 2015 at 06:51:22 PM, Sergey Temerkhanov wrote:
> This patch adds code which sets up 2-level page tables on ARM64 thus
> extending available VA space. CPUs implementing 64k translation
> granule are able to use direct PA-VA mapping of the whole 48 bit
> address space.
> It also adds the ability to reset the SCTRL register at the very beginning
> of execution to avoid interference from stale mappings set up by early
> firmware/loaders/etc.
>
> Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
> Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
Hi!
[...]
> +static void setup_pgtables(void)
> +{
> + int l1_e, l2_e;
> + unsigned long pmd = 0;
> + unsigned long address;
> +
> + /* Setup the PMD pointers */
> + for (l1_e = 0; l1_e < CONFIG_SYS_MEM_MAP_SIZE; l1_e++) {
> + gd->arch.pmd_addr[l1_e] = gd->arch.tlb_addr +
> + PTL1_ENTRIES * sizeof(u64);
> + gd->arch.pmd_addr[l1_e] += PTL2_ENTRIES * sizeof(u64) * l1_e;
> + gd->arch.pmd_addr[l1_e] += 0xffffUL;
> + gd->arch.pmd_addr[l1_e] &= ~0xffffUL;
Is this an attempt for roundup() ? See include/linux/kernel.h for that macro.
Maybe you can even use round_up(), bit that has some limitations, so be careful.
> + }
> +
> + /* Setup the page tables */
> + for (l1_e = 0; l1_e < PTL1_ENTRIES; l1_e++) {
> + if (mem_map[pmd].base ==
> + (uintptr_t)l1_e << PTL2_BITS) {
> + set_ptl1_entry(l1_e, gd->arch.pmd_addr[pmd]);
> +
> + for (l2_e = 0; l2_e < PTL2_ENTRIES; l2_e++) {
> + address = mem_map[pmd].base
> + + (uintptr_t)l2_e * BLOCK_SIZE;
> + set_ptl2_block(gd->arch.pmd_addr[pmd], l2_e,
> + address, mem_map[pmd].attrs);
> + }
> +
> + pmd++;
> + } else {
> + set_ptl1_entry(l1_e, 0);
> + }
> + }
> +}
> +
> +#else
> +
> void set_pgtable_section(u64 *page_table, u64 index, u64 section,
> u64 memory_type)
> {
[...]
next prev parent reply other threads:[~2015-08-13 17:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-13 16:51 [U-Boot] [RESUBMIT PATCH v3 0/8] This patch series adds support for Cavium ThunderX 88xx SoC family Sergey Temerkhanov
2015-08-13 16:51 ` [U-Boot] [RESUBMIT PATCH v3 1/8] armv8: Add read_mpidr() function Sergey Temerkhanov
2015-08-14 18:55 ` Simon Glass
2015-08-13 16:51 ` [U-Boot] [RESUBMIT PATCH v3 2/8] armv8: New MMU setup code allowing to use 48+ bits PA/VA Sergey Temerkhanov
2015-08-13 17:31 ` Marek Vasut [this message]
2015-08-14 7:39 ` Sergei Temerkhanov
2015-08-13 16:51 ` [U-Boot] [RESUBMIT PATCH v3 3/8] armv8: Add SMC calls infrastructure Sergey Temerkhanov
2015-08-13 16:51 ` [U-Boot] [RESUBMIT PATCH v3 4/8] armv8: Add psci.h from the Linux kernel Sergey Temerkhanov
2015-08-13 16:51 ` [U-Boot] [RESUBMIT PATCH v3 5/8] arm: serial: Add ability to use pre-initialized UARTs Sergey Temerkhanov
2015-08-13 16:51 ` [U-Boot] [RESUBMIT PATCH v3 6/8] armv8: cavium: Add ThunderX 88xx board definition Sergey Temerkhanov
2015-08-13 16:51 ` [U-Boot] [RESUBMIT PATCH v3 7/8] armv8: cavium: Add an implementation of ATF calling functions Sergey Temerkhanov
2015-08-13 16:51 ` [U-Boot] [RESUBMIT PATCH v3 8/8] armv8: cavium: Get DRAM size from ATF Sergey Temerkhanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201508131931.29921.marex@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox