You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge with git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
This commit is contained in:
@@ -77,6 +77,14 @@ config FIQ
|
||||
config ARCH_MTD_XIP
|
||||
bool
|
||||
|
||||
config VECTORS_BASE
|
||||
hex
|
||||
default 0xffff0000 if MMU
|
||||
default DRAM_BASE if REMAP_VECTORS_TO_RAM
|
||||
default 0x00000000
|
||||
help
|
||||
The base address of exception vectors.
|
||||
|
||||
source "init/Kconfig"
|
||||
|
||||
menu "System Type"
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
#
|
||||
# Kconfig for uClinux(non-paged MM) depend configurations
|
||||
# Hyok S. Choi <hyok.choi@samsung.com>
|
||||
#
|
||||
|
||||
config SET_MEM_PARAM
|
||||
bool "Set flash/sdram size and base addr"
|
||||
help
|
||||
Say Y to manually set the base addresses and sizes.
|
||||
otherwise, the default values are assigned.
|
||||
|
||||
config DRAM_BASE
|
||||
hex '(S)DRAM Base Address' if SET_MEM_PARAM
|
||||
default 0x00800000
|
||||
|
||||
config DRAM_SIZE
|
||||
hex '(S)DRAM SIZE' if SET_MEM_PARAM
|
||||
default 0x00800000
|
||||
|
||||
config FLASH_MEM_BASE
|
||||
hex 'FLASH Base Address' if SET_MEM_PARAM
|
||||
default 0x00400000
|
||||
|
||||
config FLASH_SIZE
|
||||
hex 'FLASH Size' if SET_MEM_PARAM
|
||||
default 0x00400000
|
||||
|
||||
config REMAP_VECTORS_TO_RAM
|
||||
bool 'Install vectors to the begining of RAM' if DRAM_BASE
|
||||
depends on DRAM_BASE
|
||||
help
|
||||
The kernel needs to change the hardware exception vectors.
|
||||
In nommu mode, the hardware exception vectors are normally
|
||||
placed at address 0x00000000. However, this region may be
|
||||
occupied by read-only memory depending on H/W design.
|
||||
|
||||
If the region contains read-write memory, say 'n' here.
|
||||
|
||||
If your CPU provides a remap facility which allows the exception
|
||||
vectors to be mapped to writable memory, say 'n' here.
|
||||
|
||||
Otherwise, say 'y' here. In this case, the kernel will require
|
||||
external support to redirect the hardware exception vectors to
|
||||
the writable versions located at DRAM_BASE.
|
||||
+7
-2
@@ -20,6 +20,11 @@ GZFLAGS :=-9
|
||||
# Select a platform tht is kept up-to-date
|
||||
KBUILD_DEFCONFIG := versatile_defconfig
|
||||
|
||||
# defines filename extension depending memory manement type.
|
||||
ifeq ($(CONFIG_MMU),)
|
||||
MMUEXT := -nommu
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_FRAME_POINTER),y)
|
||||
CFLAGS +=-fno-omit-frame-pointer -mapcs -mno-sched-prolog
|
||||
endif
|
||||
@@ -73,7 +78,7 @@ AFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float
|
||||
CHECKFLAGS += -D__arm__
|
||||
|
||||
#Default value
|
||||
head-y := arch/arm/kernel/head.o arch/arm/kernel/init_task.o
|
||||
head-y := arch/arm/kernel/head$(MMUEXT).o arch/arm/kernel/init_task.o
|
||||
textofs-y := 0x00008000
|
||||
|
||||
machine-$(CONFIG_ARCH_RPC) := rpc
|
||||
@@ -133,7 +138,7 @@ else
|
||||
MACHINE :=
|
||||
endif
|
||||
|
||||
export TEXT_OFFSET GZFLAGS
|
||||
export TEXT_OFFSET GZFLAGS MMUEXT
|
||||
|
||||
# Do we have FASTFPE?
|
||||
FASTFPE :=arch/arm/fastfpe
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* linux/arch/arm/boot/compressed/head.S
|
||||
*
|
||||
* Copyright (C) 1996-2002 Russell King
|
||||
* Copyright (C) 2004 Hyok S. Choi (MPU support)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
@@ -320,6 +321,62 @@ params: ldr r0, =params_phys
|
||||
cache_on: mov r3, #8 @ cache_on function
|
||||
b call_cache_fn
|
||||
|
||||
/*
|
||||
* Initialize the highest priority protection region, PR7
|
||||
* to cover all 32bit address and cacheable and bufferable.
|
||||
*/
|
||||
__armv4_mpu_cache_on:
|
||||
mov r0, #0x3f @ 4G, the whole
|
||||
mcr p15, 0, r0, c6, c7, 0 @ PR7 Area Setting
|
||||
mcr p15, 0, r0, c6, c7, 1
|
||||
|
||||
mov r0, #0x80 @ PR7
|
||||
mcr p15, 0, r0, c2, c0, 0 @ D-cache on
|
||||
mcr p15, 0, r0, c2, c0, 1 @ I-cache on
|
||||
mcr p15, 0, r0, c3, c0, 0 @ write-buffer on
|
||||
|
||||
mov r0, #0xc000
|
||||
mcr p15, 0, r0, c5, c0, 1 @ I-access permission
|
||||
mcr p15, 0, r0, c5, c0, 0 @ D-access permission
|
||||
|
||||
mov r0, #0
|
||||
mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
|
||||
mcr p15, 0, r0, c7, c5, 0 @ flush(inval) I-Cache
|
||||
mcr p15, 0, r0, c7, c6, 0 @ flush(inval) D-Cache
|
||||
mrc p15, 0, r0, c1, c0, 0 @ read control reg
|
||||
@ ...I .... ..D. WC.M
|
||||
orr r0, r0, #0x002d @ .... .... ..1. 11.1
|
||||
orr r0, r0, #0x1000 @ ...1 .... .... ....
|
||||
|
||||
mcr p15, 0, r0, c1, c0, 0 @ write control reg
|
||||
|
||||
mov r0, #0
|
||||
mcr p15, 0, r0, c7, c5, 0 @ flush(inval) I-Cache
|
||||
mcr p15, 0, r0, c7, c6, 0 @ flush(inval) D-Cache
|
||||
mov pc, lr
|
||||
|
||||
__armv3_mpu_cache_on:
|
||||
mov r0, #0x3f @ 4G, the whole
|
||||
mcr p15, 0, r0, c6, c7, 0 @ PR7 Area Setting
|
||||
|
||||
mov r0, #0x80 @ PR7
|
||||
mcr p15, 0, r0, c2, c0, 0 @ cache on
|
||||
mcr p15, 0, r0, c3, c0, 0 @ write-buffer on
|
||||
|
||||
mov r0, #0xc000
|
||||
mcr p15, 0, r0, c5, c0, 0 @ access permission
|
||||
|
||||
mov r0, #0
|
||||
mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
|
||||
mrc p15, 0, r0, c1, c0, 0 @ read control reg
|
||||
@ .... .... .... WC.M
|
||||
orr r0, r0, #0x000d @ .... .... .... 11.1
|
||||
mov r0, #0
|
||||
mcr p15, 0, r0, c1, c0, 0 @ write control reg
|
||||
|
||||
mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
|
||||
mov pc, lr
|
||||
|
||||
__setup_mmu: sub r3, r4, #16384 @ Page directory size
|
||||
bic r3, r3, #0xff @ Align the pointer
|
||||
bic r3, r3, #0x3f00
|
||||
@@ -496,6 +553,18 @@ proc_types:
|
||||
b __armv4_mmu_cache_off
|
||||
mov pc, lr
|
||||
|
||||
.word 0x41007400 @ ARM74x
|
||||
.word 0xff00ff00
|
||||
b __armv3_mpu_cache_on
|
||||
b __armv3_mpu_cache_off
|
||||
b __armv3_mpu_cache_flush
|
||||
|
||||
.word 0x41009400 @ ARM94x
|
||||
.word 0xff00ff00
|
||||
b __armv4_mpu_cache_on
|
||||
b __armv4_mpu_cache_off
|
||||
b __armv4_mpu_cache_flush
|
||||
|
||||
.word 0x00007000 @ ARM7 IDs
|
||||
.word 0x0000f000
|
||||
mov pc, lr
|
||||
@@ -562,6 +631,24 @@ proc_types:
|
||||
cache_off: mov r3, #12 @ cache_off function
|
||||
b call_cache_fn
|
||||
|
||||
__armv4_mpu_cache_off:
|
||||
mrc p15, 0, r0, c1, c0
|
||||
bic r0, r0, #0x000d
|
||||
mcr p15, 0, r0, c1, c0 @ turn MPU and cache off
|
||||
mov r0, #0
|
||||
mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
|
||||
mcr p15, 0, r0, c7, c6, 0 @ flush D-Cache
|
||||
mcr p15, 0, r0, c7, c5, 0 @ flush I-Cache
|
||||
mov pc, lr
|
||||
|
||||
__armv3_mpu_cache_off:
|
||||
mrc p15, 0, r0, c1, c0
|
||||
bic r0, r0, #0x000d
|
||||
mcr p15, 0, r0, c1, c0, 0 @ turn MPU and cache off
|
||||
mov r0, #0
|
||||
mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
|
||||
mov pc, lr
|
||||
|
||||
__armv4_mmu_cache_off:
|
||||
mrc p15, 0, r0, c1, c0
|
||||
bic r0, r0, #0x000d
|
||||
@@ -601,6 +688,24 @@ cache_clean_flush:
|
||||
mov r3, #16
|
||||
b call_cache_fn
|
||||
|
||||
__armv4_mpu_cache_flush:
|
||||
mov r2, #1
|
||||
mov r3, #0
|
||||
mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
|
||||
mov r1, #7 << 5 @ 8 segments
|
||||
1: orr r3, r1, #63 << 26 @ 64 entries
|
||||
2: mcr p15, 0, r3, c7, c14, 2 @ clean & invalidate D index
|
||||
subs r3, r3, #1 << 26
|
||||
bcs 2b @ entries 63 to 0
|
||||
subs r1, r1, #1 << 5
|
||||
bcs 1b @ segments 7 to 0
|
||||
|
||||
teq r2, #0
|
||||
mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
|
||||
mcr p15, 0, ip, c7, c10, 4 @ drain WB
|
||||
mov pc, lr
|
||||
|
||||
|
||||
__armv6_mmu_cache_flush:
|
||||
mov r1, #0
|
||||
mcr p15, 0, r1, c7, c14, 0 @ clean+invalidate D
|
||||
@@ -638,6 +743,7 @@ no_cache_id:
|
||||
mov pc, lr
|
||||
|
||||
__armv3_mmu_cache_flush:
|
||||
__armv3_mpu_cache_flush:
|
||||
mov r1, #0
|
||||
mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
|
||||
mov pc, lr
|
||||
|
||||
@@ -666,7 +666,7 @@ __kuser_helper_start:
|
||||
*
|
||||
* #define __kernel_dmb() \
|
||||
* asm volatile ( "mov r0, #0xffff0fff; mov lr, pc; sub pc, r0, #95" \
|
||||
* : : : "lr","cc" )
|
||||
* : : : "r0", "lr","cc" )
|
||||
*/
|
||||
|
||||
__kuser_memory_barrier: @ 0xffff0fa0
|
||||
|
||||
@@ -0,0 +1,217 @@
|
||||
/*
|
||||
* linux/arch/arm/kernel/head-common.S
|
||||
*
|
||||
* Copyright (C) 1994-2002 Russell King
|
||||
* Copyright (c) 2003 ARM Limited
|
||||
* All Rights Reserved
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
.type __switch_data, %object
|
||||
__switch_data:
|
||||
.long __mmap_switched
|
||||
.long __data_loc @ r4
|
||||
.long __data_start @ r5
|
||||
.long __bss_start @ r6
|
||||
.long _end @ r7
|
||||
.long processor_id @ r4
|
||||
.long __machine_arch_type @ r5
|
||||
.long cr_alignment @ r6
|
||||
.long init_thread_union + THREAD_START_SP @ sp
|
||||
|
||||
/*
|
||||
* The following fragment of code is executed with the MMU on in MMU mode,
|
||||
* and uses absolute addresses; this is not position independent.
|
||||
*
|
||||
* r0 = cp#15 control register
|
||||
* r1 = machine ID
|
||||
* r9 = processor ID
|
||||
*/
|
||||
.type __mmap_switched, %function
|
||||
__mmap_switched:
|
||||
adr r3, __switch_data + 4
|
||||
|
||||
ldmia r3!, {r4, r5, r6, r7}
|
||||
cmp r4, r5 @ Copy data segment if needed
|
||||
1: cmpne r5, r6
|
||||
ldrne fp, [r4], #4
|
||||
strne fp, [r5], #4
|
||||
bne 1b
|
||||
|
||||
mov fp, #0 @ Clear BSS (and zero fp)
|
||||
1: cmp r6, r7
|
||||
strcc fp, [r6],#4
|
||||
bcc 1b
|
||||
|
||||
ldmia r3, {r4, r5, r6, sp}
|
||||
str r9, [r4] @ Save processor ID
|
||||
str r1, [r5] @ Save machine type
|
||||
bic r4, r0, #CR_A @ Clear 'A' bit
|
||||
stmia r6, {r0, r4} @ Save control register values
|
||||
b start_kernel
|
||||
|
||||
/*
|
||||
* Exception handling. Something went wrong and we can't proceed. We
|
||||
* ought to tell the user, but since we don't have any guarantee that
|
||||
* we're even running on the right architecture, we do virtually nothing.
|
||||
*
|
||||
* If CONFIG_DEBUG_LL is set we try to print out something about the error
|
||||
* and hope for the best (useful if bootloader fails to pass a proper
|
||||
* machine ID for example).
|
||||
*/
|
||||
|
||||
.type __error_p, %function
|
||||
__error_p:
|
||||
#ifdef CONFIG_DEBUG_LL
|
||||
adr r0, str_p1
|
||||
bl printascii
|
||||
b __error
|
||||
str_p1: .asciz "\nError: unrecognized/unsupported processor variant.\n"
|
||||
.align
|
||||
#endif
|
||||
|
||||
.type __error_a, %function
|
||||
__error_a:
|
||||
#ifdef CONFIG_DEBUG_LL
|
||||
mov r4, r1 @ preserve machine ID
|
||||
adr r0, str_a1
|
||||
bl printascii
|
||||
mov r0, r4
|
||||
bl printhex8
|
||||
adr r0, str_a2
|
||||
bl printascii
|
||||
adr r3, 3f
|
||||
ldmia r3, {r4, r5, r6} @ get machine desc list
|
||||
sub r4, r3, r4 @ get offset between virt&phys
|
||||
add r5, r5, r4 @ convert virt addresses to
|
||||
add r6, r6, r4 @ physical address space
|
||||
1: ldr r0, [r5, #MACHINFO_TYPE] @ get machine type
|
||||
bl printhex8
|
||||
mov r0, #'\t'
|
||||
bl printch
|
||||
ldr r0, [r5, #MACHINFO_NAME] @ get machine name
|
||||
add r0, r0, r4
|
||||
bl printascii
|
||||
mov r0, #'\n'
|
||||
bl printch
|
||||
add r5, r5, #SIZEOF_MACHINE_DESC @ next machine_desc
|
||||
cmp r5, r6
|
||||
blo 1b
|
||||
adr r0, str_a3
|
||||
bl printascii
|
||||
b __error
|
||||
str_a1: .asciz "\nError: unrecognized/unsupported machine ID (r1 = 0x"
|
||||
str_a2: .asciz ").\n\nAvailable machine support:\n\nID (hex)\tNAME\n"
|
||||
str_a3: .asciz "\nPlease check your kernel config and/or bootloader.\n"
|
||||
.align
|
||||
#endif
|
||||
|
||||
.type __error, %function
|
||||
__error:
|
||||
#ifdef CONFIG_ARCH_RPC
|
||||
/*
|
||||
* Turn the screen red on a error - RiscPC only.
|
||||
*/
|
||||
mov r0, #0x02000000
|
||||
mov r3, #0x11
|
||||
orr r3, r3, r3, lsl #8
|
||||
orr r3, r3, r3, lsl #16
|
||||
str r3, [r0], #4
|
||||
str r3, [r0], #4
|
||||
str r3, [r0], #4
|
||||
str r3, [r0], #4
|
||||
#endif
|
||||
1: mov r0, r0
|
||||
b 1b
|
||||
|
||||
|
||||
/*
|
||||
* Read processor ID register (CP#15, CR0), and look up in the linker-built
|
||||
* supported processor list. Note that we can't use the absolute addresses
|
||||
* for the __proc_info lists since we aren't running with the MMU on
|
||||
* (and therefore, we are not in the correct address space). We have to
|
||||
* calculate the offset.
|
||||
*
|
||||
* r9 = cpuid
|
||||
* Returns:
|
||||
* r3, r4, r6 corrupted
|
||||
* r5 = proc_info pointer in physical address space
|
||||
* r9 = cpuid (preserved)
|
||||
*/
|
||||
.type __lookup_processor_type, %function
|
||||
__lookup_processor_type:
|
||||
adr r3, 3f
|
||||
ldmda r3, {r5 - r7}
|
||||
sub r3, r3, r7 @ get offset between virt&phys
|
||||
add r5, r5, r3 @ convert virt addresses to
|
||||
add r6, r6, r3 @ physical address space
|
||||
1: ldmia r5, {r3, r4} @ value, mask
|
||||
and r4, r4, r9 @ mask wanted bits
|
||||
teq r3, r4
|
||||
beq 2f
|
||||
add r5, r5, #PROC_INFO_SZ @ sizeof(proc_info_list)
|
||||
cmp r5, r6
|
||||
blo 1b
|
||||
mov r5, #0 @ unknown processor
|
||||
2: mov pc, lr
|
||||
|
||||
/*
|
||||
* This provides a C-API version of the above function.
|
||||
*/
|
||||
ENTRY(lookup_processor_type)
|
||||
stmfd sp!, {r4 - r7, r9, lr}
|
||||
mov r9, r0
|
||||
bl __lookup_processor_type
|
||||
mov r0, r5
|
||||
ldmfd sp!, {r4 - r7, r9, pc}
|
||||
|
||||
/*
|
||||
* Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for
|
||||
* more information about the __proc_info and __arch_info structures.
|
||||
*/
|
||||
.long __proc_info_begin
|
||||
.long __proc_info_end
|
||||
3: .long .
|
||||
.long __arch_info_begin
|
||||
.long __arch_info_end
|
||||
|
||||
/*
|
||||
* Lookup machine architecture in the linker-build list of architectures.
|
||||
* Note that we can't use the absolute addresses for the __arch_info
|
||||
* lists since we aren't running with the MMU on (and therefore, we are
|
||||
* not in the correct address space). We have to calculate the offset.
|
||||
*
|
||||
* r1 = machine architecture number
|
||||
* Returns:
|
||||
* r3, r4, r6 corrupted
|
||||
* r5 = mach_info pointer in physical address space
|
||||
*/
|
||||
.type __lookup_machine_type, %function
|
||||
__lookup_machine_type:
|
||||
adr r3, 3b
|
||||
ldmia r3, {r4, r5, r6}
|
||||
sub r3, r3, r4 @ get offset between virt&phys
|
||||
add r5, r5, r3 @ convert virt addresses to
|
||||
add r6, r6, r3 @ physical address space
|
||||
1: ldr r3, [r5, #MACHINFO_TYPE] @ get machine type
|
||||
teq r3, r1 @ matches loader number?
|
||||
beq 2f @ found
|
||||
add r5, r5, #SIZEOF_MACHINE_DESC @ next machine_desc
|
||||
cmp r5, r6
|
||||
blo 1b
|
||||
mov r5, #0 @ unknown machine
|
||||
2: mov pc, lr
|
||||
|
||||
/*
|
||||
* This provides a C-API version of the above function.
|
||||
*/
|
||||
ENTRY(lookup_machine_type)
|
||||
stmfd sp!, {r4 - r6, lr}
|
||||
mov r1, r0
|
||||
bl __lookup_machine_type
|
||||
mov r0, r5
|
||||
ldmfd sp!, {r4 - r6, pc}
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* linux/arch/arm/kernel/head-nommu.S
|
||||
*
|
||||
* Copyright (C) 1994-2002 Russell King
|
||||
* Copyright (C) 2003-2006 Hyok S. Choi
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Common kernel startup code (non-paged MM)
|
||||
* for 32-bit CPUs which has a process ID register(CP15).
|
||||
*
|
||||
*/
|
||||
#include <linux/config.h>
|
||||
#include <linux/linkage.h>
|
||||
#include <linux/init.h>
|
||||
|
||||
#include <asm/assembler.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/procinfo.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/constants.h>
|
||||
#include <asm/system.h>
|
||||
|
||||
#define PROCINFO_INITFUNC 12
|
||||
|
||||
/*
|
||||
* Kernel startup entry point.
|
||||
* ---------------------------
|
||||
*
|
||||
* This is normally called from the decompressor code. The requirements
|
||||
* are: MMU = off, D-cache = off, I-cache = dont care, r0 = 0,
|
||||
* r1 = machine nr.
|
||||
*
|
||||
* See linux/arch/arm/tools/mach-types for the complete list of machine
|
||||
* numbers for r1.
|
||||
*
|
||||
*/
|
||||
__INIT
|
||||
.type stext, %function
|
||||
ENTRY(stext)
|
||||
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode
|
||||
@ and irqs disabled
|
||||
mrc p15, 0, r9, c0, c0 @ get processor id
|
||||
bl __lookup_processor_type @ r5=procinfo r9=cpuid
|
||||
movs r10, r5 @ invalid processor (r5=0)?
|
||||
beq __error_p @ yes, error 'p'
|
||||
bl __lookup_machine_type @ r5=machinfo
|
||||
movs r8, r5 @ invalid machine (r5=0)?
|
||||
beq __error_a @ yes, error 'a'
|
||||
|
||||
ldr r13, __switch_data @ address to jump to after
|
||||
@ the initialization is done
|
||||
adr lr, __after_proc_init @ return (PIC) address
|
||||
add pc, r10, #PROCINFO_INITFUNC
|
||||
|
||||
/*
|
||||
* Set the Control Register and Read the process ID.
|
||||
*/
|
||||
.type __after_proc_init, %function
|
||||
__after_proc_init:
|
||||
mrc p15, 0, r0, c1, c0, 0 @ read control reg
|
||||
#ifdef CONFIG_ALIGNMENT_TRAP
|
||||
orr r0, r0, #CR_A
|
||||
#else
|
||||
bic r0, r0, #CR_A
|
||||
#endif
|
||||
#ifdef CONFIG_CPU_DCACHE_DISABLE
|
||||
bic r0, r0, #CR_C
|
||||
#endif
|
||||
#ifdef CONFIG_CPU_BPREDICT_DISABLE
|
||||
bic r0, r0, #CR_Z
|
||||
#endif
|
||||
#ifdef CONFIG_CPU_ICACHE_DISABLE
|
||||
bic r0, r0, #CR_I
|
||||
#endif
|
||||
mcr p15, 0, r0, c1, c0, 0 @ write control reg
|
||||
|
||||
mov pc, r13 @ clear the BSS and jump
|
||||
@ to start_kernel
|
||||
|
||||
#include "head-common.S"
|
||||
+1
-206
@@ -102,49 +102,6 @@ ENTRY(stext)
|
||||
adr lr, __enable_mmu @ return (PIC) address
|
||||
add pc, r10, #PROCINFO_INITFUNC
|
||||
|
||||
.type __switch_data, %object
|
||||
__switch_data:
|
||||
.long __mmap_switched
|
||||
.long __data_loc @ r4
|
||||
.long __data_start @ r5
|
||||
.long __bss_start @ r6
|
||||
.long _end @ r7
|
||||
.long processor_id @ r4
|
||||
.long __machine_arch_type @ r5
|
||||
.long cr_alignment @ r6
|
||||
.long init_thread_union + THREAD_START_SP @ sp
|
||||
|
||||
/*
|
||||
* The following fragment of code is executed with the MMU on, and uses
|
||||
* absolute addresses; this is not position independent.
|
||||
*
|
||||
* r0 = cp#15 control register
|
||||
* r1 = machine ID
|
||||
* r9 = processor ID
|
||||
*/
|
||||
.type __mmap_switched, %function
|
||||
__mmap_switched:
|
||||
adr r3, __switch_data + 4
|
||||
|
||||
ldmia r3!, {r4, r5, r6, r7}
|
||||
cmp r4, r5 @ Copy data segment if needed
|
||||
1: cmpne r5, r6
|
||||
ldrne fp, [r4], #4
|
||||
strne fp, [r5], #4
|
||||
bne 1b
|
||||
|
||||
mov fp, #0 @ Clear BSS (and zero fp)
|
||||
1: cmp r6, r7
|
||||
strcc fp, [r6],#4
|
||||
bcc 1b
|
||||
|
||||
ldmia r3, {r4, r5, r6, sp}
|
||||
str r9, [r4] @ Save processor ID
|
||||
str r1, [r5] @ Save machine type
|
||||
bic r4, r0, #CR_A @ Clear 'A' bit
|
||||
stmia r6, {r0, r4} @ Save control register values
|
||||
b start_kernel
|
||||
|
||||
#if defined(CONFIG_SMP)
|
||||
.type secondary_startup, #function
|
||||
ENTRY(secondary_startup)
|
||||
@@ -367,166 +324,4 @@ __create_page_tables:
|
||||
mov pc, lr
|
||||
.ltorg
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Exception handling. Something went wrong and we can't proceed. We
|
||||
* ought to tell the user, but since we don't have any guarantee that
|
||||
* we're even running on the right architecture, we do virtually nothing.
|
||||
*
|
||||
* If CONFIG_DEBUG_LL is set we try to print out something about the error
|
||||
* and hope for the best (useful if bootloader fails to pass a proper
|
||||
* machine ID for example).
|
||||
*/
|
||||
|
||||
.type __error_p, %function
|
||||
__error_p:
|
||||
#ifdef CONFIG_DEBUG_LL
|
||||
adr r0, str_p1
|
||||
bl printascii
|
||||
b __error
|
||||
str_p1: .asciz "\nError: unrecognized/unsupported processor variant.\n"
|
||||
.align
|
||||
#endif
|
||||
|
||||
.type __error_a, %function
|
||||
__error_a:
|
||||
#ifdef CONFIG_DEBUG_LL
|
||||
mov r4, r1 @ preserve machine ID
|
||||
adr r0, str_a1
|
||||
bl printascii
|
||||
mov r0, r4
|
||||
bl printhex8
|
||||
adr r0, str_a2
|
||||
bl printascii
|
||||
adr r3, 3f
|
||||
ldmia r3, {r4, r5, r6} @ get machine desc list
|
||||
sub r4, r3, r4 @ get offset between virt&phys
|
||||
add r5, r5, r4 @ convert virt addresses to
|
||||
add r6, r6, r4 @ physical address space
|
||||
1: ldr r0, [r5, #MACHINFO_TYPE] @ get machine type
|
||||
bl printhex8
|
||||
mov r0, #'\t'
|
||||
bl printch
|
||||
ldr r0, [r5, #MACHINFO_NAME] @ get machine name
|
||||
add r0, r0, r4
|
||||
bl printascii
|
||||
mov r0, #'\n'
|
||||
bl printch
|
||||
add r5, r5, #SIZEOF_MACHINE_DESC @ next machine_desc
|
||||
cmp r5, r6
|
||||
blo 1b
|
||||
adr r0, str_a3
|
||||
bl printascii
|
||||
b __error
|
||||
str_a1: .asciz "\nError: unrecognized/unsupported machine ID (r1 = 0x"
|
||||
str_a2: .asciz ").\n\nAvailable machine support:\n\nID (hex)\tNAME\n"
|
||||
str_a3: .asciz "\nPlease check your kernel config and/or bootloader.\n"
|
||||
.align
|
||||
#endif
|
||||
|
||||
.type __error, %function
|
||||
__error:
|
||||
#ifdef CONFIG_ARCH_RPC
|
||||
/*
|
||||
* Turn the screen red on a error - RiscPC only.
|
||||
*/
|
||||
mov r0, #0x02000000
|
||||
mov r3, #0x11
|
||||
orr r3, r3, r3, lsl #8
|
||||
orr r3, r3, r3, lsl #16
|
||||
str r3, [r0], #4
|
||||
str r3, [r0], #4
|
||||
str r3, [r0], #4
|
||||
str r3, [r0], #4
|
||||
#endif
|
||||
1: mov r0, r0
|
||||
b 1b
|
||||
|
||||
|
||||
/*
|
||||
* Read processor ID register (CP#15, CR0), and look up in the linker-built
|
||||
* supported processor list. Note that we can't use the absolute addresses
|
||||
* for the __proc_info lists since we aren't running with the MMU on
|
||||
* (and therefore, we are not in the correct address space). We have to
|
||||
* calculate the offset.
|
||||
*
|
||||
* r9 = cpuid
|
||||
* Returns:
|
||||
* r3, r4, r6 corrupted
|
||||
* r5 = proc_info pointer in physical address space
|
||||
* r9 = cpuid (preserved)
|
||||
*/
|
||||
.type __lookup_processor_type, %function
|
||||
__lookup_processor_type:
|
||||
adr r3, 3f
|
||||
ldmda r3, {r5 - r7}
|
||||
sub r3, r3, r7 @ get offset between virt&phys
|
||||
add r5, r5, r3 @ convert virt addresses to
|
||||
add r6, r6, r3 @ physical address space
|
||||
1: ldmia r5, {r3, r4} @ value, mask
|
||||
and r4, r4, r9 @ mask wanted bits
|
||||
teq r3, r4
|
||||
beq 2f
|
||||
add r5, r5, #PROC_INFO_SZ @ sizeof(proc_info_list)
|
||||
cmp r5, r6
|
||||
blo 1b
|
||||
mov r5, #0 @ unknown processor
|
||||
2: mov pc, lr
|
||||
|
||||
/*
|
||||
* This provides a C-API version of the above function.
|
||||
*/
|
||||
ENTRY(lookup_processor_type)
|
||||
stmfd sp!, {r4 - r7, r9, lr}
|
||||
mov r9, r0
|
||||
bl __lookup_processor_type
|
||||
mov r0, r5
|
||||
ldmfd sp!, {r4 - r7, r9, pc}
|
||||
|
||||
/*
|
||||
* Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for
|
||||
* more information about the __proc_info and __arch_info structures.
|
||||
*/
|
||||
.long __proc_info_begin
|
||||
.long __proc_info_end
|
||||
3: .long .
|
||||
.long __arch_info_begin
|
||||
.long __arch_info_end
|
||||
|
||||
/*
|
||||
* Lookup machine architecture in the linker-build list of architectures.
|
||||
* Note that we can't use the absolute addresses for the __arch_info
|
||||
* lists since we aren't running with the MMU on (and therefore, we are
|
||||
* not in the correct address space). We have to calculate the offset.
|
||||
*
|
||||
* r1 = machine architecture number
|
||||
* Returns:
|
||||
* r3, r4, r6 corrupted
|
||||
* r5 = mach_info pointer in physical address space
|
||||
*/
|
||||
.type __lookup_machine_type, %function
|
||||
__lookup_machine_type:
|
||||
adr r3, 3b
|
||||
ldmia r3, {r4, r5, r6}
|
||||
sub r3, r3, r4 @ get offset between virt&phys
|
||||
add r5, r5, r3 @ convert virt addresses to
|
||||
add r6, r6, r3 @ physical address space
|
||||
1: ldr r3, [r5, #MACHINFO_TYPE] @ get machine type
|
||||
teq r3, r1 @ matches loader number?
|
||||
beq 2f @ found
|
||||
add r5, r5, #SIZEOF_MACHINE_DESC @ next machine_desc
|
||||
cmp r5, r6
|
||||
blo 1b
|
||||
mov r5, #0 @ unknown machine
|
||||
2: mov pc, lr
|
||||
|
||||
/*
|
||||
* This provides a C-API version of the above function.
|
||||
*/
|
||||
ENTRY(lookup_machine_type)
|
||||
stmfd sp!, {r4 - r6, lr}
|
||||
mov r1, r0
|
||||
bl __lookup_machine_type
|
||||
mov r0, r5
|
||||
ldmfd sp!, {r4 - r6, pc}
|
||||
#include "head-common.S"
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#define KERN_SIGRETURN_CODE 0xffff0500
|
||||
#define KERN_SIGRETURN_CODE (CONFIG_VECTORS_BASE + 0x00000500)
|
||||
|
||||
extern const unsigned long sigreturn_codes[7];
|
||||
|
||||
@@ -688,6 +688,7 @@ EXPORT_SYMBOL(abort);
|
||||
|
||||
void __init trap_init(void)
|
||||
{
|
||||
unsigned long vectors = CONFIG_VECTORS_BASE;
|
||||
extern char __stubs_start[], __stubs_end[];
|
||||
extern char __vectors_start[], __vectors_end[];
|
||||
extern char __kuser_helper_start[], __kuser_helper_end[];
|
||||
@@ -698,9 +699,9 @@ void __init trap_init(void)
|
||||
* into the vector page, mapped at 0xffff0000, and ensure these
|
||||
* are visible to the instruction stream.
|
||||
*/
|
||||
memcpy((void *)0xffff0000, __vectors_start, __vectors_end - __vectors_start);
|
||||
memcpy((void *)0xffff0200, __stubs_start, __stubs_end - __stubs_start);
|
||||
memcpy((void *)0xffff1000 - kuser_sz, __kuser_helper_start, kuser_sz);
|
||||
memcpy((void *)vectors, __vectors_start, __vectors_end - __vectors_start);
|
||||
memcpy((void *)vectors + 0x200, __stubs_start, __stubs_end - __stubs_start);
|
||||
memcpy((void *)vectors + 0x1000 - kuser_sz, __kuser_helper_start, kuser_sz);
|
||||
|
||||
/*
|
||||
* Copy signal return handlers into the vector page, and
|
||||
@@ -709,6 +710,6 @@ void __init trap_init(void)
|
||||
memcpy((void *)KERN_SIGRETURN_CODE, sigreturn_codes,
|
||||
sizeof(sigreturn_codes));
|
||||
|
||||
flush_icache_range(0xffff0000, 0xffff0000 + PAGE_SIZE);
|
||||
flush_icache_range(vectors, vectors + PAGE_SIZE);
|
||||
modify_domain(DOMAIN_USER, DOMAIN_CLIENT);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <asm/procinfo.h>
|
||||
#include <asm/hardware.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/pgtable-hwdef.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include "proc-macros.S"
|
||||
|
||||
@@ -240,7 +240,7 @@ cache_info(char *page)
|
||||
}
|
||||
p += sprintf(p,
|
||||
"%s Cache level %lu:\n"
|
||||
"\tSize : %lu bytes\n"
|
||||
"\tSize : %u bytes\n"
|
||||
"\tAttributes : ",
|
||||
cache_types[j+cci.pcci_unified], i+1,
|
||||
cci.pcci_cache_size);
|
||||
@@ -648,9 +648,9 @@ frequency_info(char *page)
|
||||
if (ia64_pal_freq_ratios(&proc, &bus, &itc) != 0) return 0;
|
||||
|
||||
p += sprintf(p,
|
||||
"Processor/Clock ratio : %ld/%ld\n"
|
||||
"Bus/Clock ratio : %ld/%ld\n"
|
||||
"ITC/Clock ratio : %ld/%ld\n",
|
||||
"Processor/Clock ratio : %d/%d\n"
|
||||
"Bus/Clock ratio : %d/%d\n"
|
||||
"ITC/Clock ratio : %d/%d\n",
|
||||
proc.num, proc.den, bus.num, bus.den, itc.num, itc.den);
|
||||
|
||||
return p - page;
|
||||
|
||||
@@ -188,7 +188,7 @@ ia64_init_itm (void)
|
||||
itc_freq = (platform_base_freq*itc_ratio.num)/itc_ratio.den;
|
||||
|
||||
local_cpu_data->itm_delta = (itc_freq + HZ/2) / HZ;
|
||||
printk(KERN_DEBUG "CPU %d: base freq=%lu.%03luMHz, ITC ratio=%lu/%lu, "
|
||||
printk(KERN_DEBUG "CPU %d: base freq=%lu.%03luMHz, ITC ratio=%u/%u, "
|
||||
"ITC freq=%lu.%03luMHz", smp_processor_id(),
|
||||
platform_base_freq / 1000000, (platform_base_freq / 1000) % 1000,
|
||||
itc_ratio.num, itc_ratio.den, itc_freq / 1000000, (itc_freq / 1000) % 1000);
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
* 2002/08/07 Erich Focht <efocht@ess.nec.de>
|
||||
* Populate cpu entries in sysfs for non-numa systems as well
|
||||
* Intel Corporation - Ashok Raj
|
||||
* 02/27/2006 Zhang, Yanmin
|
||||
* Populate cpu cache entries in sysfs for cpu cache info
|
||||
*/
|
||||
|
||||
#include <linux/config.h>
|
||||
@@ -19,6 +21,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/bootmem.h>
|
||||
#include <linux/nodemask.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <asm/mmzone.h>
|
||||
#include <asm/numa.h>
|
||||
#include <asm/cpu.h>
|
||||
@@ -101,3 +104,367 @@ out:
|
||||
}
|
||||
|
||||
subsys_initcall(topology_init);
|
||||
|
||||
|
||||
/*
|
||||
* Export cpu cache information through sysfs
|
||||
*/
|
||||
|
||||
/*
|
||||
* A bunch of string array to get pretty printing
|
||||
*/
|
||||
static const char *cache_types[] = {
|
||||
"", /* not used */
|
||||
"Instruction",
|
||||
"Data",
|
||||
"Unified" /* unified */
|
||||
};
|
||||
|
||||
static const char *cache_mattrib[]={
|
||||
"WriteThrough",
|
||||
"WriteBack",
|
||||
"", /* reserved */
|
||||
"" /* reserved */
|
||||
};
|
||||
|
||||
struct cache_info {
|
||||
pal_cache_config_info_t cci;
|
||||
cpumask_t shared_cpu_map;
|
||||
int level;
|
||||
int type;
|
||||
struct kobject kobj;
|
||||
};
|
||||
|
||||
struct cpu_cache_info {
|
||||
struct cache_info *cache_leaves;
|
||||
int num_cache_leaves;
|
||||
struct kobject kobj;
|
||||
};
|
||||
|
||||
static struct cpu_cache_info all_cpu_cache_info[NR_CPUS];
|
||||
#define LEAF_KOBJECT_PTR(x,y) (&all_cpu_cache_info[x].cache_leaves[y])
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
static void cache_shared_cpu_map_setup( unsigned int cpu,
|
||||
struct cache_info * this_leaf)
|
||||
{
|
||||
pal_cache_shared_info_t csi;
|
||||
int num_shared, i = 0;
|
||||
unsigned int j;
|
||||
|
||||
if (cpu_data(cpu)->threads_per_core <= 1 &&
|
||||
cpu_data(cpu)->cores_per_socket <= 1) {
|
||||
cpu_set(cpu, this_leaf->shared_cpu_map);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ia64_pal_cache_shared_info(this_leaf->level,
|
||||
this_leaf->type,
|
||||
0,
|
||||
&csi) != PAL_STATUS_SUCCESS)
|
||||
return;
|
||||
|
||||
num_shared = (int) csi.num_shared;
|
||||
do {
|
||||
for_each_cpu(j)
|
||||
if (cpu_data(cpu)->socket_id == cpu_data(j)->socket_id
|
||||
&& cpu_data(j)->core_id == csi.log1_cid
|
||||
&& cpu_data(j)->thread_id == csi.log1_tid)
|
||||
cpu_set(j, this_leaf->shared_cpu_map);
|
||||
|
||||
i++;
|
||||
} while (i < num_shared &&
|
||||
ia64_pal_cache_shared_info(this_leaf->level,
|
||||
this_leaf->type,
|
||||
i,
|
||||
&csi) == PAL_STATUS_SUCCESS);
|
||||
}
|
||||
#else
|
||||
static void cache_shared_cpu_map_setup(unsigned int cpu,
|
||||
struct cache_info * this_leaf)
|
||||
{
|
||||
cpu_set(cpu, this_leaf->shared_cpu_map);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
static ssize_t show_coherency_line_size(struct cache_info *this_leaf,
|
||||
char *buf)
|
||||
{
|
||||
return sprintf(buf, "%u\n", 1 << this_leaf->cci.pcci_line_size);
|
||||
}
|
||||
|
||||
static ssize_t show_ways_of_associativity(struct cache_info *this_leaf,
|
||||
char *buf)
|
||||
{
|
||||
return sprintf(buf, "%u\n", this_leaf->cci.pcci_assoc);
|
||||
}
|
||||
|
||||
static ssize_t show_attributes(struct cache_info *this_leaf, char *buf)
|
||||
{
|
||||
return sprintf(buf,
|
||||
"%s\n",
|
||||
cache_mattrib[this_leaf->cci.pcci_cache_attr]);
|
||||
}
|
||||
|
||||
static ssize_t show_size(struct cache_info *this_leaf, char *buf)
|
||||
{
|
||||
return sprintf(buf, "%uK\n", this_leaf->cci.pcci_cache_size / 1024);
|
||||
}
|
||||
|
||||
static ssize_t show_number_of_sets(struct cache_info *this_leaf, char *buf)
|
||||
{
|
||||
unsigned number_of_sets = this_leaf->cci.pcci_cache_size;
|
||||
number_of_sets /= this_leaf->cci.pcci_assoc;
|
||||
number_of_sets /= 1 << this_leaf->cci.pcci_line_size;
|
||||
|
||||
return sprintf(buf, "%u\n", number_of_sets);
|
||||
}
|
||||
|
||||
static ssize_t show_shared_cpu_map(struct cache_info *this_leaf, char *buf)
|
||||
{
|
||||
ssize_t len;
|
||||
cpumask_t shared_cpu_map;
|
||||
|
||||
cpus_and(shared_cpu_map, this_leaf->shared_cpu_map, cpu_online_map);
|
||||
len = cpumask_scnprintf(buf, NR_CPUS+1, shared_cpu_map);
|
||||
len += sprintf(buf+len, "\n");
|
||||
return len;
|
||||
}
|
||||
|
||||
static ssize_t show_type(struct cache_info *this_leaf, char *buf)
|
||||
{
|
||||
int type = this_leaf->type + this_leaf->cci.pcci_unified;
|
||||
return sprintf(buf, "%s\n", cache_types[type]);
|
||||
}
|
||||
|
||||
static ssize_t show_level(struct cache_info *this_leaf, char *buf)
|
||||
{
|
||||
return sprintf(buf, "%u\n", this_leaf->level);
|
||||
}
|
||||
|
||||
struct cache_attr {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(struct cache_info *, char *);
|
||||
ssize_t (*store)(struct cache_info *, const char *, size_t count);
|
||||
};
|
||||
|
||||
#ifdef define_one_ro
|
||||
#undef define_one_ro
|
||||
#endif
|
||||
#define define_one_ro(_name) \
|
||||
static struct cache_attr _name = \
|
||||
__ATTR(_name, 0444, show_##_name, NULL)
|
||||
|
||||
define_one_ro(level);
|
||||
define_one_ro(type);
|
||||
define_one_ro(coherency_line_size);
|
||||
define_one_ro(ways_of_associativity);
|
||||
define_one_ro(size);
|
||||
define_one_ro(number_of_sets);
|
||||
define_one_ro(shared_cpu_map);
|
||||
define_one_ro(attributes);
|
||||
|
||||
static struct attribute * cache_default_attrs[] = {
|
||||
&type.attr,
|
||||
&level.attr,
|
||||
&coherency_line_size.attr,
|
||||
&ways_of_associativity.attr,
|
||||
&attributes.attr,
|
||||
&size.attr,
|
||||
&number_of_sets.attr,
|
||||
&shared_cpu_map.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
#define to_object(k) container_of(k, struct cache_info, kobj)
|
||||
#define to_attr(a) container_of(a, struct cache_attr, attr)
|
||||
|
||||
static ssize_t cache_show(struct kobject * kobj, struct attribute * attr, char * buf)
|
||||
{
|
||||
struct cache_attr *fattr = to_attr(attr);
|
||||
struct cache_info *this_leaf = to_object(kobj);
|
||||
ssize_t ret;
|
||||
|
||||
ret = fattr->show ? fattr->show(this_leaf, buf) : 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct sysfs_ops cache_sysfs_ops = {
|
||||
.show = cache_show
|
||||
};
|
||||
|
||||
static struct kobj_type cache_ktype = {
|
||||
.sysfs_ops = &cache_sysfs_ops,
|
||||
.default_attrs = cache_default_attrs,
|
||||
};
|
||||
|
||||
static struct kobj_type cache_ktype_percpu_entry = {
|
||||
.sysfs_ops = &cache_sysfs_ops,
|
||||
};
|
||||
|
||||
static void __cpuinit cpu_cache_sysfs_exit(unsigned int cpu)
|
||||
{
|
||||
if (all_cpu_cache_info[cpu].cache_leaves) {
|
||||
kfree(all_cpu_cache_info[cpu].cache_leaves);
|
||||
all_cpu_cache_info[cpu].cache_leaves = NULL;
|
||||
}
|
||||
all_cpu_cache_info[cpu].num_cache_leaves = 0;
|
||||
memset(&all_cpu_cache_info[cpu].kobj, 0, sizeof(struct kobject));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static int __cpuinit cpu_cache_sysfs_init(unsigned int cpu)
|
||||
{
|
||||
u64 i, levels, unique_caches;
|
||||
pal_cache_config_info_t cci;
|
||||
int j;
|
||||
s64 status;
|
||||
struct cache_info *this_cache;
|
||||
int num_cache_leaves = 0;
|
||||
|
||||
if ((status = ia64_pal_cache_summary(&levels, &unique_caches)) != 0) {
|
||||
printk(KERN_ERR "ia64_pal_cache_summary=%ld\n", status);
|
||||
return -1;
|
||||
}
|
||||
|
||||
this_cache=kzalloc(sizeof(struct cache_info)*unique_caches,
|
||||
GFP_KERNEL);
|
||||
if (this_cache == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i=0; i < levels; i++) {
|
||||
for (j=2; j >0 ; j--) {
|
||||
if ((status=ia64_pal_cache_config_info(i,j, &cci)) !=
|
||||
PAL_STATUS_SUCCESS)
|
||||
continue;
|
||||
|
||||
this_cache[num_cache_leaves].cci = cci;
|
||||
this_cache[num_cache_leaves].level = i + 1;
|
||||
this_cache[num_cache_leaves].type = j;
|
||||
|
||||
cache_shared_cpu_map_setup(cpu,
|
||||
&this_cache[num_cache_leaves]);
|
||||
num_cache_leaves ++;
|
||||
}
|
||||
}
|
||||
|
||||
all_cpu_cache_info[cpu].cache_leaves = this_cache;
|
||||
all_cpu_cache_info[cpu].num_cache_leaves = num_cache_leaves;
|
||||
|
||||
memset(&all_cpu_cache_info[cpu].kobj, 0, sizeof(struct kobject));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Add cache interface for CPU device */
|
||||
static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
|
||||
{
|
||||
unsigned int cpu = sys_dev->id;
|
||||
unsigned long i, j;
|
||||
struct cache_info *this_object;
|
||||
int retval = 0;
|
||||
cpumask_t oldmask;
|
||||
|
||||
if (all_cpu_cache_info[cpu].kobj.parent)
|
||||
return 0;
|
||||
|
||||
oldmask = current->cpus_allowed;
|
||||
retval = set_cpus_allowed(current, cpumask_of_cpu(cpu));
|
||||
if (unlikely(retval))
|
||||
return retval;
|
||||
|
||||
retval = cpu_cache_sysfs_init(cpu);
|
||||
set_cpus_allowed(current, oldmask);
|
||||
if (unlikely(retval < 0))
|
||||
return retval;
|
||||
|
||||
all_cpu_cache_info[cpu].kobj.parent = &sys_dev->kobj;
|
||||
kobject_set_name(&all_cpu_cache_info[cpu].kobj, "%s", "cache");
|
||||
all_cpu_cache_info[cpu].kobj.ktype = &cache_ktype_percpu_entry;
|
||||
retval = kobject_register(&all_cpu_cache_info[cpu].kobj);
|
||||
|
||||
for (i = 0; i < all_cpu_cache_info[cpu].num_cache_leaves; i++) {
|
||||
this_object = LEAF_KOBJECT_PTR(cpu,i);
|
||||
this_object->kobj.parent = &all_cpu_cache_info[cpu].kobj;
|
||||
kobject_set_name(&(this_object->kobj), "index%1lu", i);
|
||||
this_object->kobj.ktype = &cache_ktype;
|
||||
retval = kobject_register(&(this_object->kobj));
|
||||
if (unlikely(retval)) {
|
||||
for (j = 0; j < i; j++) {
|
||||
kobject_unregister(
|
||||
&(LEAF_KOBJECT_PTR(cpu,j)->kobj));
|
||||
}
|
||||
kobject_unregister(&all_cpu_cache_info[cpu].kobj);
|
||||
cpu_cache_sysfs_exit(cpu);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* Remove cache interface for CPU device */
|
||||
static int __cpuinit cache_remove_dev(struct sys_device * sys_dev)
|
||||
{
|
||||
unsigned int cpu = sys_dev->id;
|
||||
unsigned long i;
|
||||
|
||||
for (i = 0; i < all_cpu_cache_info[cpu].num_cache_leaves; i++)
|
||||
kobject_unregister(&(LEAF_KOBJECT_PTR(cpu,i)->kobj));
|
||||
|
||||
if (all_cpu_cache_info[cpu].kobj.parent) {
|
||||
kobject_unregister(&all_cpu_cache_info[cpu].kobj);
|
||||
memset(&all_cpu_cache_info[cpu].kobj,
|
||||
0,
|
||||
sizeof(struct kobject));
|
||||
}
|
||||
|
||||
cpu_cache_sysfs_exit(cpu);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* When a cpu is hot-plugged, do a check and initiate
|
||||
* cache kobject if necessary
|
||||
*/
|
||||
static int __cpuinit cache_cpu_callback(struct notifier_block *nfb,
|
||||
unsigned long action, void *hcpu)
|
||||
{
|
||||
unsigned int cpu = (unsigned long)hcpu;
|
||||
struct sys_device *sys_dev;
|
||||
|
||||
sys_dev = get_cpu_sysdev(cpu);
|
||||
switch (action) {
|
||||
case CPU_ONLINE:
|
||||
cache_add_dev(sys_dev);
|
||||
break;
|
||||
case CPU_DEAD:
|
||||
cache_remove_dev(sys_dev);
|
||||
break;
|
||||
}
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
static struct notifier_block cache_cpu_notifier =
|
||||
{
|
||||
.notifier_call = cache_cpu_callback
|
||||
};
|
||||
|
||||
static int __cpuinit cache_sysfs_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for_each_online_cpu(i) {
|
||||
cache_cpu_callback(&cache_cpu_notifier, CPU_ONLINE,
|
||||
(void *)(long)i);
|
||||
}
|
||||
|
||||
register_cpu_notifier(&cache_cpu_notifier);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
device_initcall(cache_sysfs_init);
|
||||
|
||||
|
||||
@@ -60,6 +60,17 @@ config MMC_SDHCI
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config MMC_OMAP
|
||||
tristate "TI OMAP Multimedia Card Interface support"
|
||||
depends on ARCH_OMAP && MMC
|
||||
select TPS65010 if MACH_OMAP_H2
|
||||
help
|
||||
This selects the TI OMAP Multimedia card Interface.
|
||||
If you have an OMAP board with a Multimedia Card slot,
|
||||
say Y or M here.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config MMC_WBSD
|
||||
tristate "Winbond W83L51xD SD/MMC Card Interface support"
|
||||
depends on MMC && ISA_DMA_API
|
||||
|
||||
@@ -20,5 +20,10 @@ obj-$(CONFIG_MMC_PXA) += pxamci.o
|
||||
obj-$(CONFIG_MMC_SDHCI) += sdhci.o
|
||||
obj-$(CONFIG_MMC_WBSD) += wbsd.o
|
||||
obj-$(CONFIG_MMC_AU1X) += au1xmmc.o
|
||||
obj-$(CONFIG_MMC_OMAP) += omap.o
|
||||
|
||||
mmc_core-y := mmc.o mmc_queue.o mmc_sysfs.o
|
||||
|
||||
ifeq ($(CONFIG_MMC_DEBUG),y)
|
||||
EXTRA_CFLAGS += -DDEBUG
|
||||
endif
|
||||
|
||||
+9
-10
@@ -56,12 +56,11 @@
|
||||
#define DRIVER_NAME "au1xxx-mmc"
|
||||
|
||||
/* Set this to enable special debugging macros */
|
||||
/* #define MMC_DEBUG */
|
||||
|
||||
#ifdef MMC_DEBUG
|
||||
#define DEBUG(fmt, idx, args...) printk("au1xx(%d): DEBUG: " fmt, idx, ##args)
|
||||
#ifdef DEBUG
|
||||
#define DBG(fmt, idx, args...) printk("au1xx(%d): DEBUG: " fmt, idx, ##args)
|
||||
#else
|
||||
#define DEBUG(fmt, idx, args...)
|
||||
#define DBG(fmt, idx, args...)
|
||||
#endif
|
||||
|
||||
const struct {
|
||||
@@ -424,18 +423,18 @@ static void au1xmmc_receive_pio(struct au1xmmc_host *host)
|
||||
break;
|
||||
|
||||
if (status & SD_STATUS_RC) {
|
||||
DEBUG("RX CRC Error [%d + %d].\n", host->id,
|
||||
DBG("RX CRC Error [%d + %d].\n", host->id,
|
||||
host->pio.len, count);
|
||||
break;
|
||||
}
|
||||
|
||||
if (status & SD_STATUS_RO) {
|
||||
DEBUG("RX Overrun [%d + %d]\n", host->id,
|
||||
DBG("RX Overrun [%d + %d]\n", host->id,
|
||||
host->pio.len, count);
|
||||
break;
|
||||
}
|
||||
else if (status & SD_STATUS_RU) {
|
||||
DEBUG("RX Underrun [%d + %d]\n", host->id,
|
||||
DBG("RX Underrun [%d + %d]\n", host->id,
|
||||
host->pio.len, count);
|
||||
break;
|
||||
}
|
||||
@@ -721,7 +720,7 @@ static void au1xmmc_set_ios(struct mmc_host* mmc, struct mmc_ios* ios)
|
||||
{
|
||||
struct au1xmmc_host *host = mmc_priv(mmc);
|
||||
|
||||
DEBUG("set_ios (power=%u, clock=%uHz, vdd=%u, mode=%u)\n",
|
||||
DBG("set_ios (power=%u, clock=%uHz, vdd=%u, mode=%u)\n",
|
||||
host->id, ios->power_mode, ios->clock, ios->vdd,
|
||||
ios->bus_mode);
|
||||
|
||||
@@ -810,7 +809,7 @@ static irqreturn_t au1xmmc_irq(int irq, void *dev_id, struct pt_regs *regs)
|
||||
au1xmmc_receive_pio(host);
|
||||
}
|
||||
else if (status & 0x203FBC70) {
|
||||
DEBUG("Unhandled status %8.8x\n", host->id, status);
|
||||
DBG("Unhandled status %8.8x\n", host->id, status);
|
||||
handled = 0;
|
||||
}
|
||||
|
||||
@@ -839,7 +838,7 @@ static void au1xmmc_poll_event(unsigned long arg)
|
||||
|
||||
if (host->mrq != NULL) {
|
||||
u32 status = au_readl(HOST_STATUS(host));
|
||||
DEBUG("PENDING - %8.8x\n", host->id, status);
|
||||
DBG("PENDING - %8.8x\n", host->id, status);
|
||||
}
|
||||
|
||||
mod_timer(&host->timer, jiffies + AU1XMMC_DETECT_TIMEOUT);
|
||||
|
||||
+7
-12
@@ -27,12 +27,6 @@
|
||||
|
||||
#include "mmc.h"
|
||||
|
||||
#ifdef CONFIG_MMC_DEBUG
|
||||
#define DBG(x...) printk(KERN_DEBUG x)
|
||||
#else
|
||||
#define DBG(x...) do { } while (0)
|
||||
#endif
|
||||
|
||||
#define CMD_RETRIES 3
|
||||
|
||||
/*
|
||||
@@ -77,8 +71,9 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq)
|
||||
{
|
||||
struct mmc_command *cmd = mrq->cmd;
|
||||
int err = mrq->cmd->error;
|
||||
DBG("MMC: req done (%02x): %d: %08x %08x %08x %08x\n", cmd->opcode,
|
||||
err, cmd->resp[0], cmd->resp[1], cmd->resp[2], cmd->resp[3]);
|
||||
pr_debug("MMC: req done (%02x): %d: %08x %08x %08x %08x\n",
|
||||
cmd->opcode, err, cmd->resp[0], cmd->resp[1],
|
||||
cmd->resp[2], cmd->resp[3]);
|
||||
|
||||
if (err && cmd->retries) {
|
||||
cmd->retries--;
|
||||
@@ -102,8 +97,8 @@ EXPORT_SYMBOL(mmc_request_done);
|
||||
void
|
||||
mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
|
||||
{
|
||||
DBG("MMC: starting cmd %02x arg %08x flags %08x\n",
|
||||
mrq->cmd->opcode, mrq->cmd->arg, mrq->cmd->flags);
|
||||
pr_debug("MMC: starting cmd %02x arg %08x flags %08x\n",
|
||||
mrq->cmd->opcode, mrq->cmd->arg, mrq->cmd->flags);
|
||||
|
||||
WARN_ON(host->card_busy == NULL);
|
||||
|
||||
@@ -976,8 +971,8 @@ static unsigned int mmc_calculate_clock(struct mmc_host *host)
|
||||
if (!mmc_card_dead(card) && max_dtr > card->csd.max_dtr)
|
||||
max_dtr = card->csd.max_dtr;
|
||||
|
||||
DBG("MMC: selected %d.%03dMHz transfer rate\n",
|
||||
max_dtr / 1000000, (max_dtr / 1000) % 1000);
|
||||
pr_debug("MMC: selected %d.%03dMHz transfer rate\n",
|
||||
max_dtr / 1000000, (max_dtr / 1000) % 1000);
|
||||
|
||||
return max_dtr;
|
||||
}
|
||||
|
||||
@@ -33,12 +33,8 @@
|
||||
|
||||
#define DRIVER_NAME "mmci-pl18x"
|
||||
|
||||
#ifdef CONFIG_MMC_DEBUG
|
||||
#define DBG(host,fmt,args...) \
|
||||
pr_debug("%s: %s: " fmt, mmc_hostname(host->mmc), __func__ , args)
|
||||
#else
|
||||
#define DBG(host,fmt,args...) do { } while (0)
|
||||
#endif
|
||||
|
||||
static unsigned int fmax = 515633;
|
||||
|
||||
|
||||
+1226
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user