arch/powerpc/kernel/l2cr_6xx.S
Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/l2cr_6xx.S
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/kernel/l2cr_6xx.S- Extension
.S- Size
- 10506 bytes
- Lines
- 460
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: arch/powerpc
- Status
- atlas-only
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
Dependency Surface
asm/processor.hasm/cputable.hasm/ppc_asm.hasm/cache.hasm/page.hasm/feature-fixups.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
L2CR functions
Copyright © 1997-1998 by PowerLogix R & D, Inc.
*/
/*
Thur, Dec. 12, 1998.
- First public release, contributed by PowerLogix.
***********
Sat, Aug. 7, 1999.
- Terry: Made sure code disabled interrupts before running. (Previously
it was assumed interrupts were already disabled).
- Terry: Updated for tentative G4 support. 4MB of memory is now flushed
instead of 2MB. (Prob. only 3 is necessary).
- Terry: Updated for workaround to HID0[DPM] processor bug
during global invalidates.
***********
Thu, July 13, 2000.
- Terry: Added isync to correct for an errata.
22 August 2001.
- DanM: Finally added the 7450 patch I've had for the past
several months. The L2CR is similar, but I'm going
to assume the user of this functions knows what they
are doing.
Author: Terry Greeniaus (tgree@phys.ualberta.ca)
Please e-mail updates to this file to me, thanks!
*/
#include <asm/processor.h>
#include <asm/cputable.h>
#include <asm/ppc_asm.h>
#include <asm/cache.h>
#include <asm/page.h>
#include <asm/feature-fixups.h>
/* Usage:
When setting the L2CR register, you must do a few special
things. If you are enabling the cache, you must perform a
global invalidate. If you are disabling the cache, you must
flush the cache contents first. This routine takes care of
doing these things. When first enabling the cache, make sure
you pass in the L2CR you want, as well as passing in the
global invalidate bit set. A global invalidate will only be
performed if the L2I bit is set in applyThis. When enabling
the cache, you should also set the L2E bit in applyThis. If
you want to modify the L2CR contents after the cache has been
enabled, the recommended procedure is to first call
__setL2CR(0) to disable the cache and then call it again with
the new values for L2CR. Examples:
_setL2CR(0) - disables the cache
_setL2CR(0xB3A04000) - enables my G3 upgrade card:
- L2E set to turn on the cache
- L2SIZ set to 1MB
- L2CLK set to 1:1
- L2RAM set to pipelined synchronous late-write
- L2I set to perform a global invalidation
- L2OH set to 0.5 nS
- L2DF set because this upgrade card
requires it
A similar call should work for your card. You need to know
the correct setting for your card and then place them in the
fields I have outlined above. Other fields support optional
features, such as L2DO which caches only data, or L2TS which
causes cache pushes from the L1 cache to go to the L2 cache
instead of to main memory.
IMPORTANT:
Annotation
- Immediate include surface: `asm/processor.h`, `asm/cputable.h`, `asm/ppc_asm.h`, `asm/cache.h`, `asm/page.h`, `asm/feature-fixups.h`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.