From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RESEND PATCH v14 07/10] arm64: core support
Date: Thu, 7 Nov 2013 14:03:24 -0800 [thread overview]
Message-ID: <527C0E2C.4030203@freescale.com> (raw)
In-Reply-To: <1381808089-8535-8-git-send-email-fenghua@phytium.com.cn>
On 10/14/2013 08:34 PM, fenghua at phytium.com.cn wrote:
> From: David Feng <fenghua@phytium.com.cn>
>
> Relocation code based on a patch by Scott Wood, which is:
> Signed-off-by: Scott Wood <scottwood@freescale.com>
>
> Signed-off-by: David Feng <fenghua@phytium.com.cn>
> ---
> arch/arm/config.mk | 3 +-
> arch/arm/cpu/armv8/Makefile | 38 +++++
> arch/arm/cpu/armv8/cache.S | 130 +++++++++++++++++
<snip>
> diff --git a/arch/arm/cpu/armv8/cache.S b/arch/arm/cpu/armv8/cache.S
> new file mode 100644
> index 0000000..419f169
> --- /dev/null
> +++ b/arch/arm/cpu/armv8/cache.S
> @@ -0,0 +1,130 @@
> +/*
> + * (C) Copyright 2013
> + * David Feng <fenghua@phytium.com.cn>
> + *
> + * SPDX-License-Identifier: GPL-2.0+
> + */
> +
> +#include <asm-offsets.h>
> +#include <config.h>
> +#include <version.h>
> +#include <asm/macro.h>
> +#include <linux/linkage.h>
> +
> +/*
> + * void __asm_flush_dcache_level(level)
> + *
> + * clean and invalidate one level cache.
> + *
> + * x0: cache level
> + * x1~x9: clobbered
> + */
> +ENTRY(__asm_flush_dcache_level)
> + lsl x1, x0, #1
> + msr csselr_el1, x1 /* select cache level */
> + isb /* isb to sych the new cssr & csidr */
> + mrs x6, ccsidr_el1 /* read the new ccsidr */
> + and x2, x6, #7 /* x2 <- length of the cache lines */
> + add x2, x2, #4 /* add 4 (line length offset) */
> + mov x3, #0x3ff
> + and x3, x3, x6, lsr #3 /* x3 <- maximum number of way size */
> + clz w5, w3 /* bit position of way size */
> + mov x4, #0x7fff
> + and x4, x4, x1, lsr #13 /* x4 <- max number of the set size */
Shouldn't this x1 be x6?
> + /* x1 <- cache level << 1 */
> + /* x2 <- line length offset */
> + /* x3 <- number of cache ways */
> + /* x4 <- number of cache sets */
> + /* x5 <- bit position of way size */
> +
> +loop_set:
> + mov x6, x3 /* create working copy of way size */
> +loop_way:
> + lsl x7, x6, x5
> + orr x9, x0, x7 /* map way and level to cisw value */
Shouldn't this x0 be x1?
> + lsl x7, x4, x2
> + orr x9, x9, x7 /* map set number to cisw value */
> + dc cisw, x9 /* clean & invalidate by set/way */
> + subs x6, x6, #1 /* decrement the way */
> + b.ge loop_way
> + subs x4, x4, #1 /* decrement the set */
> + b.ge loop_set
> +
> + ret
> +ENDPROC(__asm_flush_dcache_level)
> +
I haven't been able to verify this change. It simply takes too long to
finish on emulator.
York
next prev parent reply other threads:[~2013-11-07 22:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-15 3:34 [U-Boot] [RESEND PATCH v14 00/10] arm64 pat fenghua at phytium.com.cn
2013-10-15 3:34 ` [U-Boot] [RESEND PATCH v14 01/10] fdt_support: 64bit initrd start address support fenghua at phytium.com.cn
2013-10-15 3:34 ` [U-Boot] [RESEND PATCH v14 02/10] cmd_pxe: remove compiling warnings fenghua at phytium.com.cn
2013-10-15 3:34 ` [U-Boot] [RESEND PATCH v14 03/10] add weak entry definition fenghua at phytium.com.cn
2013-10-15 3:34 ` [U-Boot] [RESEND PATCH v14 04/10] arm64: Add tool to statically apply RELA relocations fenghua at phytium.com.cn
2013-10-15 3:34 ` [U-Boot] [RESEND PATCH v14 05/10] arm64: Turn u-boot.bin back into an ELF file after relocate-rela fenghua at phytium.com.cn
2013-10-15 3:34 ` [U-Boot] [RESEND PATCH v14 06/10] arm64: Make checkarmreloc accept arm64 relocations fenghua at phytium.com.cn
2013-10-15 3:34 ` [U-Boot] [RESEND PATCH v14 07/10] arm64: core support fenghua at phytium.com.cn
2013-10-15 3:34 ` [U-Boot] [RESEND PATCH v14 08/10] arm64: generic board support fenghua at phytium.com.cn
2013-10-15 3:34 ` [U-Boot] [RESEND PATCH v14 09/10] arm64: board support of vexpress_aemv8a fenghua at phytium.com.cn
2013-10-15 3:34 ` [U-Boot] [RESEND PATCH v14 10/10] arm64: MAKEALL, filter armv8 boards from LIST_arm fenghua at phytium.com.cn
2013-11-07 22:03 ` York Sun [this message]
[not found] ` <11c0def.6d6d.142361794f5.Coremail.fenghua@phytium.com.cn>
[not found] ` <DC75256C-A24F-4C87-889D-3F4D6DD18672@freescale.com>
2013-11-08 6:25 ` [U-Boot] [RESEND PATCH v14 07/10] arm64: core support york sun
2013-11-08 0:44 ` Scott Wood
[not found] ` <2527b2.406.1423641c047.Coremail.fenghua@phytium.com.cn>
2013-11-09 1:23 ` Scott Wood
2013-11-11 13:16 ` Simon Glass
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=527C0E2C.4030203@freescale.com \
--to=yorksun@freescale.com \
--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