History log of /openbmc/u-boot/arch/arc/lib/cache.c (Results 1 – 25 of 53)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v00.04.15, v00.04.14, v00.04.13, v00.04.12, v00.04.11, v00.04.10, v00.04.09, v00.04.08, v00.04.07, v00.04.06, v00.04.05, v00.04.04, v00.04.03, v00.04.02, v00.04.01, v00.04.00, v2021.04, v00.03.03, v2021.01, v2020.10, v2020.07, v00.02.13, v2020.04, v2020.01, v2019.10, v00.02.05, v00.02.04, v00.02.03, v00.02.02, v00.02.01, v2019.07, v00.02.00, v2019.04, v2018.07
# c90c43cd 31-May-2018 Tom Rini <trini@konsulko.com>

Merge tag 'arc-updates-for-2018.07-rc1' of git://git.denx.de/u-boot-arc

Here we do a couple of minor fixes like:
- Move .ivt section to the very beginning of the image
by default which allows us

Merge tag 'arc-updates-for-2018.07-rc1' of git://git.denx.de/u-boot-arc

Here we do a couple of minor fixes like:
- Move .ivt section to the very beginning of the image
by default which allows us to use that image put right
at reset vector (usually 0x0)

- Improve relocation fix-up which became required once
we moved .ivt and understood a problem with existing implementation
where we relied on a particular placement of sections.
Now we don't care about placement because we just explicitly
check for .text and in case of ARCompact .ivt sections

- Re-implemnt do_reset() such that it calls reset_cpu() which
could implmented for a particular board

And hte most important part we introduce support for yet another
devboard from Synopsys - EMDK.

show more ...


# d0a5023a 25-May-2018 Alexey Brodkin <abrodkin@synopsys.com>

ARC: Cache: Don't compare I$ and D$ line lengths

We don't care much about I$ line length really as there're
no per-line ops on I$ instead we only do full invalidation of it
on occasion of relocation

ARC: Cache: Don't compare I$ and D$ line lengths

We don't care much about I$ line length really as there're
no per-line ops on I$ instead we only do full invalidation of it
on occasion of relocation and right before jumping to the OS.

Also as compared to Linux kernel where we don't support different
lengths of I$ and D$ lines in U-Boot we have to deal with such an
exotic configs if the target board is not supposed to run Linux kernel.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

show more ...


# 423effc0 23-Mar-2018 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-arc

Alexey:
1. Significantly rework cache-related functionality.
In particular that fixes coherency problems in some corner-cases,
allows us to enable and dis

Merge git://git.denx.de/u-boot-arc

Alexey:
1. Significantly rework cache-related functionality.
In particular that fixes coherency problems in some corner-cases,
allows us to enable and disable caches in run-time and still
have properly running system, finally support execution from
real flash (before we used to run from DDR from the very beginning).

2. Remove string routines implemented in assembly.
That allows us to build and run U-Boot on wide range of ARC cores
with different configurations. I.e. whatever tuning is used on GCC's
command-line we'll get code for desired flavor of ARC.
Otherwise for each and every corner-case we would need to add ifdefs
in assembly code to accommodate missing instructions etc.

3. Get use of GCC's garbage collector which helps to slim-down resulting image
quite a bit.

4. Also now we may disable U-Boot self-relocation for ARC if needed either
by platform or for debugging purposes.

show more ...


# 6b85b26e 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Cache: Refactor arc_ioc_setup()

Move all checks before cache flush and IOC setup.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys

ARC: Cache: Refactor arc_ioc_setup()

Move all checks before cache flush and IOC setup.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# 9f0253c6 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Cache: Add missing cache cleanup before cache disable

Add missing cache cleanup before cache disable:
* Flush and invalidate L1 D$ before disabling. Flush and invalidate
SLC before L1 D$ di

ARC: Cache: Add missing cache cleanup before cache disable

Add missing cache cleanup before cache disable:
* Flush and invalidate L1 D$ before disabling. Flush and invalidate
SLC before L1 D$ disabling (as it will be bypassed for data)
Otherwise we can lose some data when we disable L1 D$ if this data
isn't flushed to next level cache. Or we can get wrong data if L1 D$
has some entries after enable which we modified when the L1 D$ was
disabled.
* Invalidate L1 I$ before disabling. Otherwise we can execute wrong
instructions after L1 I$ enable if we modified any code when
L1 I$ was disabled.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# 7241944a 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Cache: Add more HW configuration checks

Add additional cache configuration checks and note about
supported configurations.

It is unlikely to face some configuration in real life but
it's bette

ARC: Cache: Add more HW configuration checks

Add additional cache configuration checks and note about
supported configurations.

It is unlikely to face some configuration in real life but
it's better to be prepared and refuse to work on those.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# 375945ba 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Implement a function to sync and cleanup caches

Implement specialized function to clenup caches (and therefore
sync instruction and data caches) which can be used for cleanup before linux
launc

ARC: Implement a function to sync and cleanup caches

Implement specialized function to clenup caches (and therefore
sync instruction and data caches) which can be used for cleanup before linux
launch or to sync caches during U-Boot self-relocation.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# 95336738 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Cache: Fix SLC operations when SLC is bypassed for data

If L1 D$ is disabled SLC is bypassed for data and all
load/store requests are sent directly to main memory.

If L1 I$ is disabled SLC is

ARC: Cache: Fix SLC operations when SLC is bypassed for data

If L1 D$ is disabled SLC is bypassed for data and all
load/store requests are sent directly to main memory.

If L1 I$ is disabled SLC is NOT bypassed for instructions
and all instruction requests are fetched through SLC.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# c75eeb0b 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Cache: Implement [i,d]cache_enabled() as separate functions

Implement icache_enabled() and dcache_enabled() as separate functions
which can be used with "inline" attribute. This is a preparatio

ARC: Cache: Implement [i,d]cache_enabled() as separate functions

Implement icache_enabled() and dcache_enabled() as separate functions
which can be used with "inline" attribute. This is a preparation to
make them always_inline.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# 48b04832 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Move IOC enabling to compile-time options

Use CONFIG_ARC_DBG_IOC_ENABLE Kconfig option instead of
ioc_enable global variable.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Sign

ARC: Move IOC enabling to compile-time options

Use CONFIG_ARC_DBG_IOC_ENABLE Kconfig option instead of
ioc_enable global variable.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# 246ba284 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Cache: Move PAE exists check into slc_upper_region_init()

Move check for PAE existence into slc_upper_region_init()
instead of its caller as more appropriate place.

Signed-off-by: Eugeniy Palt

ARC: Cache: Move PAE exists check into slc_upper_region_init()

Move check for PAE existence into slc_upper_region_init()
instead of its caller as more appropriate place.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# bf8974ed 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Move cache global variables to arch_global_data

There is a problem with current implementation if we start U-Boot
from ROM, as we use global variables before ther initialization,
so these varia

ARC: Move cache global variables to arch_global_data

There is a problem with current implementation if we start U-Boot
from ROM, as we use global variables before ther initialization,
so these variables get overwritten when we copy .data section
from ROM.

Instead we move these global variables into our "global data"
structure so that we may really start from ROM.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# 75790873 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Cache: Get rid of [slc,pae,icache,dcache]_exists global variables

There is a problem with current implementation if we start U-Boot
from ROM, as we use global variables before ther initializati

ARC: Cache: Get rid of [slc,pae,icache,dcache]_exists global variables

There is a problem with current implementation if we start U-Boot
from ROM, as we use global variables before ther initialization,
so these variables get overwritten when we copy .data section
from ROM.

Instead we'll use icache_exists(), dcache_exists(), slc_exists(), pae_exists()
functions which directly check BCRs every time.

In U-Boot case ops are used only during self-relocation and DMA
so we shouldn't be hit by noticeable performance degradation.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# ea9f6f1e 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Cache: Move SLC status check into slc_entire_op() and slc_rgn_op()

As of today we check SLC status before each call of __slc_rgn_op()
or __slc_entire_op(). So move status check into __slc_rgn_o

ARC: Cache: Move SLC status check into slc_entire_op() and slc_rgn_op()

As of today we check SLC status before each call of __slc_rgn_op()
or __slc_entire_op(). So move status check into __slc_rgn_op()
and __slc_entire_op().

As we need to check status before *each* function execution and we
call slc_entire_op() and slc_rgn_op() from different places we add
this check directly into SLC entire/line functions instead of
their callers to avoid code duplication.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# 05c6a26a 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Cache: Use is_isa_arcv2() instead of CONFIG_ISA_ARCV2 ifdef

Use is_isa_arcv2() function where it is possible instead of
CONFIG_ISA_ARCV2 define check to make code cleaner at the same time
keepi

ARC: Cache: Use is_isa_arcv2() instead of CONFIG_ISA_ARCV2 ifdef

Use is_isa_arcv2() function where it is possible instead of
CONFIG_ISA_ARCV2 define check to make code cleaner at the same time
keeping pretty much the same functionality - code in branches
under "if (is_isa_arcv2())" won't be compiled if CONFIG_ISA_ARCV2
is not defined, still we need a couple of CONFIG_ISA_ARCV2
ifdefs to make compiler happy. That's because code in
!is_isa_x() branch gets compiled and only then gets optimized
away.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# c877a891 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Cache: Allways check D$ status before entire/line ops

As we are planning to get rid of dozens of ifdef's in cache.c we
would better check D$ status before each entire/line operation
then check

ARC: Cache: Allways check D$ status before entire/line ops

As we are planning to get rid of dozens of ifdef's in cache.c we
would better check D$ status before each entire/line operation
then check CONFIG_SYS_DCACHE_OFF config option.

This makes the code cleaner as well as D$ entire/line functions
remain functional even if we enable or disable D$ in run-time.

As we need to check status before *each* function execution and we
call D$ entire/line functions from different places we add
this check directly into D$ entire/line functions instead of
their callers to avoid code duplication.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# 88ae27ed 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Move BCR encodings to separate header file

We're starting to use more and more BCRs and having their
definitions in-lined in sources becomes a bit annoying
so we move it all to a separate heade

ARC: Move BCR encodings to separate header file

We're starting to use more and more BCRs and having their
definitions in-lined in sources becomes a bit annoying
so we move it all to a separate header.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# a6f557c4 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Cache: Move IOC initialization to a separate function

Move IOC initialization from cache_init() to a separate function.

This is the preparation for the next patch where we'll switch
to is_isa_

ARC: Cache: Move IOC initialization to a separate function

Move IOC initialization from cache_init() to a separate function.

This is the preparation for the next patch where we'll switch
to is_isa_arcv2() function usage instead of "CONFIG_ISA_ARCV2"
ifdef.

Also it makes cache_init function a bit cleaner.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# c27814be 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Flush & invalidate D$ with a single command

We don't implement separate flush_dcache_all() intentionally as
entire data cache invalidation is dangerous operation even if we flush
data cache rig

ARC: Flush & invalidate D$ with a single command

We don't implement separate flush_dcache_all() intentionally as
entire data cache invalidation is dangerous operation even if we flush
data cache right before invalidation.

There is the real example:
We may get stuck in the following code if we store any context (like
BLINK register) on stack in invalidate_dcache_all() function.

BLINK register is the register where return address is automatically saved
when we do function call with instructions like 'bl'.

void flush_dcache_all() {
__dc_entire_op(OP_FLUSH);
// Other code //
}

void invalidate_dcache_all() {
__dc_entire_op(OP_INV);
// Other code //
}

void foo(void) {
flush_dcache_all();
invalidate_dcache_all();
}

Now let's see what really happens during that code execution:

foo()
|->> call flush_dcache_all
[return address is saved to BLINK register]
[push BLINK] (save to stack) ![point 1]
|->> call __dc_entire_op(OP_FLUSH)
[return address is saved to BLINK register]
[flush L1 D$]
return [jump to BLINK]
<<------
[other flush_dcache_all code]
[pop BLINK] (get from stack)
return [jump to BLINK]
<<------
|->> call invalidate_dcache_all
[return address is saved to BLINK register]
[push BLINK] (save to stack) ![point 2]
|->> call __dc_entire_op(OP_FLUSH)
[return address is saved to BLINK register]
[invalidate L1 D$] ![point 3]
// Oops!!!
// We lose return address from invalidate_dcache_all function:
// we save it to stack and invalidate L1 D$ after that!
return [jump to BLINK]
<<------
[other invalidate_dcache_all code]
[pop BLINK] (get from stack)
// we don't have this data in L1 dcache as we invalidated it in [point 3]
// so we get it from next memory level (for example DDR memory)
// but in the memory we have value which we save in [point 1], which
// is return address from flush_dcache_all function (instead of
// address from current invalidate_dcache_all function which we
// saved in [point 2] !)
return [jump to BLINK]
<<------
// As BLINK points to invalidate_dcache_all, we call it again and
// loop forever.

Fortunately we may do flush and invalidation of D$ with a single one
instruction which automatically mitigates a situation described above.

And because invalidate_dcache_all() isn't used in common U-Boot code we
implement "flush and invalidate dcache all" instead.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# 5d7a24d6 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Cache: Add support for FLUSH_N_INV D$ operations

As of today __dc_line_op() and __dc_entire_op() support
only separate flush (OP_FLUSH) and invalidate (OP_INV) operations.

Add support of combi

ARC: Cache: Add support for FLUSH_N_INV D$ operations

As of today __dc_line_op() and __dc_entire_op() support
only separate flush (OP_FLUSH) and invalidate (OP_INV) operations.

Add support of combined flush and invalidate (OP_FLUSH_N_INV)
operation which we planing to use in subsequent patches.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# c4ef14d2 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Cache: Remove per-line I$ operations as unused

__cache_line_loop() function was copied from Linux kernel
where per-line instruction cache operations are really used.

In U-Boot we use only enti

ARC: Cache: Remove per-line I$ operations as unused

__cache_line_loop() function was copied from Linux kernel
where per-line instruction cache operations are really used.

In U-Boot we use only entire I$ ops, so we can drop support of
per-line I$ ops from __cache_line_loop() because __cache_line_loop()
is never called with OP_INV_IC parameter.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


# 16aeee81 21-Mar-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Cache: Move I$ entire operation to a separate function

Move instruction cache entire operation to a separate function
because we are planing to use it in other places like
sync_icache_dcache_al

ARC: Cache: Move I$ entire operation to a separate function

Move instruction cache entire operation to a separate function
because we are planing to use it in other places like
sync_icache_dcache_all().

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

show more ...


Revision tags: v2018.03
# c4cb6e64 19-Jan-2018 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-arc


# 19b10a42 16-Jan-2018 Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

ARC: Cache: Fix style violations reported by checkpatch

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>


123