arch/powerpc/platforms/83xx/suspend-asm.S

Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/83xx/suspend-asm.S

File Facts

System
Linux kernel
Corpus path
arch/powerpc/platforms/83xx/suspend-asm.S
Extension
.S
Size
10921 bytes
Lines
554
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.

Dependency Surface

Detected Declarations

Annotated Snippet

#include <asm/page.h>
#include <asm/ppc_asm.h>
#include <asm/reg.h>
#include <asm/asm-offsets.h>

#define SS_MEMSAVE	0x00 /* First 8 bytes of RAM */
#define SS_HID		0x08 /* 3 HIDs */
#define SS_IABR		0x14 /* 2 IABRs */
#define SS_IBCR		0x1c
#define SS_DABR		0x20 /* 2 DABRs */
#define SS_DBCR		0x28
#define SS_SP		0x2c
#define SS_SR		0x30 /* 16 segment registers */
#define SS_R2		0x70
#define SS_MSR		0x74
#define SS_SDR1		0x78
#define SS_LR		0x7c
#define SS_SPRG		0x80 /* 8 SPRGs */
#define SS_DBAT		0xa0 /* 8 DBATs */
#define SS_IBAT		0xe0 /* 8 IBATs */
#define SS_TB		0x120
#define SS_CR		0x128
#define SS_GPREG	0x12c /* r12-r31 */
#define STATE_SAVE_SIZE 0x17c

	.section .data
	.align	5

mpc83xx_sleep_save_area:
	.space	STATE_SAVE_SIZE
immrbase:
	.long	0

	.section .text
	.align	5

	/* r3 = physical address of IMMR */
_GLOBAL(mpc83xx_enter_deep_sleep)
	lis	r4, immrbase@ha
	stw	r3, immrbase@l(r4)

	/* The first 2 words of memory are used to communicate with the
	 * bootloader, to tell it how to resume.
	 *
	 * The first word is the magic number 0xf5153ae5, and the second
	 * is the pointer to mpc83xx_deep_resume.
	 *
	 * The original content of these two words is saved in SS_MEMSAVE.
	 */

	lis	r3, mpc83xx_sleep_save_area@h
	ori	r3, r3, mpc83xx_sleep_save_area@l

	lis	r4, KERNELBASE@h
	lwz	r5, 0(r4)
	lwz	r6, 4(r4)

	stw	r5, SS_MEMSAVE+0(r3)
	stw	r6, SS_MEMSAVE+4(r3)

	mfspr	r5, SPRN_HID0
	mfspr	r6, SPRN_HID1
	/* FIXME: Should this use SPRN_HID2_G2_LE? */
	mfspr	r7, SPRN_HID2_750FX

	stw	r5, SS_HID+0(r3)
	stw	r6, SS_HID+4(r3)
	stw	r7, SS_HID+8(r3)

	mfspr	r4, SPRN_IABR

Annotation

Implementation Notes