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 ...
|
264d298f | 16-Dec-2015 |
Alexey Brodkin <Alexey.Brodkin@synopsys.com> |
arc: Introduce a possibility to not relocate U-boot
Disabling relocation might be useful on ARC for 2 reasons: a) For advanced debugging with Synopsys proprietary MetaWare debugger which is cap
arc: Introduce a possibility to not relocate U-boot
Disabling relocation might be useful on ARC for 2 reasons: a) For advanced debugging with Synopsys proprietary MetaWare debugger which is capable of accessing much more specific hardware resources compared to gdb. For example it may show contents of L1 and L2 caches, internal states of some hardware blocks etc.
But on the downside MetaWare debugger still cannot work with PIE. Even though that limitation could be work-arounded with change of ELF's header and stripping down all debug info but with it we won't have debug info for source-level debugging which is quite inconvenient.
b) Some platforms which might benefit from usage of U-Boot basically don't have enough RAM to accommodate relocation of U-Boot so we keep code in flash and use as much of RAM as possible for more interesting things.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Heiko Schocher <hs@denx.de> Cc: York Sun <york.sun@nxp.com> Cc: Stefan Roese <sr@denx.de>
show more ...
|
0a097ba5 | 24-Jan-2018 |
Alexey Brodkin <abrodkin@synopsys.com> |
arc: Don't halt slaves
This commit basically reverts two commits: 1. cf628f772ef2 ("arc: arcv1: Disable master/slave check") 2. 6cba327bd96f ("arcv2: Halt non-master cores")
With mentioned commit
arc: Don't halt slaves
This commit basically reverts two commits: 1. cf628f772ef2 ("arc: arcv1: Disable master/slave check") 2. 6cba327bd96f ("arcv2: Halt non-master cores")
With mentioned commits in-place we experience more trouble than benefits. In case of SMP Linux kernel this is really required as we have all the cores running from the very beginning and then we need to allow master core to do some preparatory work while slaves are not getting in the way.
In case of U-Boot we: a) Don't really run more than 1 core in parallel b) We may use whatever core for that
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
show more ...
|
c0e6769a | 16-Jan-2018 |
Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> |
ARC: Invalidate instruction and data caches early on boot
This is useful to make sure no stale data exists in caches after bootloaders.
The worst thing could be some lines of cache were locked in a
ARC: Invalidate instruction and data caches early on boot
This is useful to make sure no stale data exists in caches after bootloaders.
The worst thing could be some lines of cache were locked in a bootloader for example during DDR recalibration and never unlocked. This may lead to really unpredictable issues later down the line.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
show more ...
|
b0146f9e | 16-Jan-2018 |
Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> |
ARC: Cache: Disable IOC by default
We'd like to keep IOC HW at the same state as t is right after reset when we start Linux kernel so there will be no re-configuration of IOC on the go.
The point i
ARC: Cache: Disable IOC by default
We'd like to keep IOC HW at the same state as t is right after reset when we start Linux kernel so there will be no re-configuration of IOC on the go.
The point is U-Boot doesn't benefit a lot from IOC as it doesn't do a lot of DMA operations especially on multiple cores simultaneously.
At the same time re-configuration of IOC in run-time might become quite a tricky experience because we need to make sure there're no DMA trannsactions in flight otherwise unexpected consequencses might affect us much later and debugging those kinds of issues will be a real nightmare.
That said let's make our life easier a little bit.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
show more ...
|
f2a22678 | 17-Nov-2017 |
Alexey Brodkin <abrodkin@synopsys.com> |
arc: cache: Add required NOPs after invalidation of instruction cache
As per ARC HS databook (see chapter 5.3.3.2) it is required to add 3 NOPs after each write to IC_IVIC which we do from now on.
arc: cache: Add required NOPs after invalidation of instruction cache
As per ARC HS databook (see chapter 5.3.3.2) it is required to add 3 NOPs after each write to IC_IVIC which we do from now on.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Eugeniy Paltsev <paltsev@synopsys.com>
show more ...
|
97a63144 | 26-Jun-2017 |
Alexey Brodkin <abrodkin@synopsys.com> |
arcv2: Set IOC aperture so it covers available DDR
We used to use the same memory layout and size for a couple of boards and thus we just hardcoding IOC aperture start and size.
Now when we're gett
arcv2: Set IOC aperture so it covers available DDR
We used to use the same memory layout and size for a couple of boards and thus we just hardcoding IOC aperture start and size.
Now when we're getting more boards with more memory on board we need to have an ability to set IOC so it matches real DDR layout and size.
Even though it is not really a must but for simplicity we assume IOC covers all the DDR we have, that gives us a chance to not bother where DMA buffers are allocated - any part of DDR is OK.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
show more ...
|