Skip to content

Commit

Permalink
Merge branches 'at91', 'davinci', 'imx', 'iop', 'ixp', 'ks8695', 'mis…
Browse files Browse the repository at this point in the history
…c', 'pxa' and 's3c' into devel
  • Loading branch information
Russell King authored and Russell King committed Jul 12, 2007
9 parents feb4722 + 83f5322 + 89bba43 + 51198ea + eab03b3 + 8a87a99 + fcae8e0 + 46c41e6 + 3c3e69c commit ca9ced7
Show file tree
Hide file tree
Showing 76 changed files with 2,914 additions and 484 deletions.
5 changes: 5 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ config ARCH_H720X

config ARCH_IMX
bool "IMX"
select GENERIC_GPIO
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
help
Support for Motorola's i.MX family of processors (MX1, MXL).

Expand Down Expand Up @@ -308,6 +311,7 @@ config ARCH_L7200

config ARCH_KS8695
bool "Micrel/Kendin KS8695"
select GENERIC_GPIO
help
Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
System-on-Chip devices.
Expand Down Expand Up @@ -384,6 +388,7 @@ config ARCH_DAVINCI
bool "TI DaVinci"
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
select GENERIC_GPIO
help
Support for TI's DaVinci platform.

Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/compressed/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
piggy.gz
font.c
13 changes: 7 additions & 6 deletions arch/arm/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@

HEAD = head.o
OBJS = misc.o
FONTC = drivers/video/console/font_acorn_8x8.c

FONT = $(addprefix ../../../../drivers/video/console/, font_acorn_8x8.o)
FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c

#
# Architecture dependencies
#
ifeq ($(CONFIG_ARCH_ACORN),y)
OBJS += ll_char_wr.o $(FONT)
OBJS += ll_char_wr.o font.o
endif

ifeq ($(CONFIG_ARCH_SHARK),y)
Expand Down Expand Up @@ -73,7 +71,7 @@ endif

SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/

targets := vmlinux vmlinux.lds piggy.gz piggy.o $(FONT) \
targets := vmlinux vmlinux.lds piggy.gz piggy.o font.o font.c \
head.o misc.o $(OBJS)
EXTRA_CFLAGS := -fpic
EXTRA_AFLAGS :=
Expand Down Expand Up @@ -105,7 +103,10 @@ $(obj)/piggy.gz: $(obj)/../Image FORCE

$(obj)/piggy.o: $(obj)/piggy.gz FORCE

CFLAGS_font_acorn_8x8.o := -Dstatic=
CFLAGS_font.o := -Dstatic=

$(obj)/font.c: $(FONTC)
$(call cmd,shipped)

$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config
@sed "$(SEDFLAGS)" < $< > $@
Expand Down
5 changes: 0 additions & 5 deletions arch/arm/boot/compressed/head-xscale.S
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ __XScale_start:
mov r7, #MACH_TYPE_COTULLA_IDP
#endif

#ifdef CONFIG_MACH_GTWX5715
mov r7, #(MACH_TYPE_GTWX5715 & 0xff)
orr r7, r7, #(MACH_TYPE_GTWX5715 & 0xff00)
#endif

#ifdef CONFIG_ARCH_IXP2000
mov r1, #-1
mov r0, #0xd6000000
Expand Down
93 changes: 92 additions & 1 deletion arch/arm/boot/compressed/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,28 @@ __armv4_mmu_cache_on:
mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs
mov pc, r12

__armv7_mmu_cache_on:
mov r12, lr
mrc p15, 0, r11, c0, c1, 4 @ read ID_MMFR0
tst r11, #0xf @ VMSA
blne __setup_mmu
mov r0, #0
mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
tst r11, #0xf @ VMSA
mcrne p15, 0, r0, c8, c7, 0 @ flush I,D TLBs
mrc p15, 0, r0, c1, c0, 0 @ read control reg
orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement
orr r0, r0, #0x003c @ write buffer
orrne r0, r0, #1 @ MMU enabled
movne r1, #-1
mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer
mcrne p15, 0, r1, c3, c0, 0 @ load domain access control
mcr p15, 0, r0, c1, c0, 0 @ load control register
mrc p15, 0, r0, c1, c0, 0 @ and read it back
mov r0, #0
mcr p15, 0, r0, c7, c5, 4 @ ISB
mov pc, r12

__arm6_mmu_cache_on:
mov r12, lr
bl __setup_mmu
Expand Down Expand Up @@ -622,11 +644,17 @@ proc_types:
b __armv4_mmu_cache_flush

.word 0x0007b000 @ ARMv6
.word 0x0007f000
.word 0x000ff000
b __armv4_mmu_cache_on
b __armv4_mmu_cache_off
b __armv6_mmu_cache_flush

.word 0x000f0000 @ new CPU Id
.word 0x000f0000
b __armv7_mmu_cache_on
b __armv7_mmu_cache_off
b __armv7_mmu_cache_flush

.word 0 @ unrecognised type
.word 0
mov pc, lr
Expand Down Expand Up @@ -674,6 +702,16 @@ __armv4_mmu_cache_off:
mcr p15, 0, r0, c8, c7 @ invalidate whole TLB v4
mov pc, lr

__armv7_mmu_cache_off:
mrc p15, 0, r0, c1, c0
bic r0, r0, #0x000d
mcr p15, 0, r0, c1, c0 @ turn MMU and cache off
mov r12, lr
bl __armv7_mmu_cache_flush
mov r0, #0
mcr p15, 0, r0, c8, c7, 0 @ invalidate whole TLB
mov pc, r12

__arm6_mmu_cache_off:
mov r0, #0x00000030 @ ARM6 control reg.
b __armv3_mmu_cache_off
Expand Down Expand Up @@ -730,6 +768,59 @@ __armv6_mmu_cache_flush:
mcr p15, 0, r1, c7, c10, 4 @ drain WB
mov pc, lr

__armv7_mmu_cache_flush:
mrc p15, 0, r10, c0, c1, 5 @ read ID_MMFR1
tst r10, #0xf << 16 @ hierarchical cache (ARMv7)
beq hierarchical
mov r10, #0
mcr p15, 0, r10, c7, c14, 0 @ clean+invalidate D
b iflush
hierarchical:
stmfd sp!, {r0-r5, r7, r9-r11}
mrc p15, 1, r0, c0, c0, 1 @ read clidr
ands r3, r0, #0x7000000 @ extract loc from clidr
mov r3, r3, lsr #23 @ left align loc bit field
beq finished @ if loc is 0, then no need to clean
mov r10, #0 @ start clean at cache level 0
loop1:
add r2, r10, r10, lsr #1 @ work out 3x current cache level
mov r1, r0, lsr r2 @ extract cache type bits from clidr
and r1, r1, #7 @ mask of the bits for current cache only
cmp r1, #2 @ see what cache we have at this level
blt skip @ skip if no cache, or just i-cache
mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr
mcr p15, 0, r10, c7, c5, 4 @ isb to sych the new cssr&csidr
mrc p15, 1, r1, c0, c0, 0 @ read the new csidr
and r2, r1, #7 @ extract the length of the cache lines
add r2, r2, #4 @ add 4 (line length offset)
ldr r4, =0x3ff
ands r4, r4, r1, lsr #3 @ find maximum number on the way size
.word 0xe16f5f14 @ clz r5, r4 - find bit position of way size increment
ldr r7, =0x7fff
ands r7, r7, r1, lsr #13 @ extract max number of the index size
loop2:
mov r9, r4 @ create working copy of max way size
loop3:
orr r11, r10, r9, lsl r5 @ factor way and cache number into r11
orr r11, r11, r7, lsl r2 @ factor index number into r11
mcr p15, 0, r11, c7, c14, 2 @ clean & invalidate by set/way
subs r9, r9, #1 @ decrement the way
bge loop3
subs r7, r7, #1 @ decrement the index
bge loop2
skip:
add r10, r10, #2 @ increment cache number
cmp r3, r10
bgt loop1
finished:
mov r10, #0 @ swith back to cache level 0
mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr
ldmfd sp!, {r0-r5, r7, r9-r11}
iflush:
mcr p15, 0, r10, c7, c5, 0 @ invalidate I+BTB
mcr p15, 0, r10, c7, c10, 4 @ drain WB
mov pc, lr

__armv4_mmu_cache_flush:
mov r2, #64*1024 @ default: 32K dcache size (*2)
mov r11, #32 @ default: 32 byte line size
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/common/sharpsl_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,9 +766,7 @@ static void sharpsl_apm_get_power_status(struct apm_power_info *info)
}

static struct pm_ops sharpsl_pm_ops = {
.prepare = pxa_pm_prepare,
.enter = corgi_pxa_pm_enter,
.finish = pxa_pm_finish,
.valid = pm_valid_only_mem,
};

Expand Down
40 changes: 37 additions & 3 deletions arch/arm/kernel/head-common.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ __switch_data:
.long _end @ r7
.long processor_id @ r4
.long __machine_arch_type @ r5
.long cr_alignment @ r6
.long __atags_pointer @ r6
.long cr_alignment @ r7
.long init_thread_union + THREAD_START_SP @ sp

/*
Expand All @@ -29,6 +30,7 @@ __switch_data:
*
* r0 = cp#15 control register
* r1 = machine ID
* r2 = atags pointer
* r9 = processor ID
*/
.type __mmap_switched, %function
Expand All @@ -47,11 +49,12 @@ __mmap_switched:
strcc fp, [r6],#4
bcc 1b

ldmia r3, {r4, r5, r6, sp}
ldmia r3, {r4, r5, r6, r7, sp}
str r9, [r4] @ Save processor ID
str r1, [r5] @ Save machine type
str r2, [r6] @ Save atags pointer
bic r4, r0, #CR_A @ Clear 'A' bit
stmia r6, {r0, r4} @ Save control register values
stmia r7, {r0, r4} @ Save control register values
b start_kernel

/*
Expand Down Expand Up @@ -215,3 +218,34 @@ ENTRY(lookup_machine_type)
bl __lookup_machine_type
mov r0, r5
ldmfd sp!, {r4 - r6, pc}

/* Determine validity of the r2 atags pointer. The heuristic requires
* that the pointer be aligned, in the first 16k of physical RAM and
* that the ATAG_CORE marker is first and present. Future revisions
* of this function may be more lenient with the physical address and
* may also be able to move the ATAGS block if necessary.
*
* r8 = machinfo
*
* Returns:
* r2 either valid atags pointer, or zero
* r5, r6 corrupted
*/

.type __vet_atags, %function
__vet_atags:
tst r2, #0x3 @ aligned?
bne 1f

ldr r5, [r2, #0] @ is first tag ATAG_CORE?
subs r5, r5, #ATAG_CORE_SIZE
bne 1f
ldr r5, [r2, #4]
ldr r6, =ATAG_CORE
cmp r5, r6
bne 1f

mov pc, lr @ atag pointer is ok

1: mov r2, #0
mov pc, lr
7 changes: 6 additions & 1 deletion arch/arm/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
#define KERNEL_RAM_VADDR (PAGE_OFFSET + TEXT_OFFSET)
#define KERNEL_RAM_PADDR (PHYS_OFFSET + TEXT_OFFSET)

#define ATAG_CORE 0x54410001
#define ATAG_CORE_SIZE ((2*4 + 3*4) >> 2)


/*
* swapper_pg_dir is the virtual address of the initial page table.
* We place the page tables 16K below KERNEL_RAM_VADDR. Therefore, we must
Expand Down Expand Up @@ -61,7 +65,7 @@
*
* 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.
* r1 = machine nr, r2 = atags pointer.
*
* This code is mostly position independent, so if you link the kernel at
* 0xc0008000, you call this at __pa(0xc0008000).
Expand All @@ -85,6 +89,7 @@ ENTRY(stext)
bl __lookup_machine_type @ r5=machinfo
movs r8, r5 @ invalid machine (r5=0)?
beq __error_a @ yes, error 'a'
bl __vet_atags
bl __create_page_tables

/*
Expand Down
8 changes: 6 additions & 2 deletions arch/arm/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ static const char *processor_modes[] = {
"UK8_32" , "UK9_32" , "UK10_32", "UND_32" , "UK12_32", "UK13_32", "UK14_32", "SYS_32"
};

static const char *isa_modes[] = {
"ARM" , "Thumb" , "Jazelle", "ThumbEE"
};

extern void setup_mm_for_reboot(char mode);

static volatile int hlt_counter;
Expand Down Expand Up @@ -230,11 +234,11 @@ void __show_regs(struct pt_regs *regs)
buf[3] = flags & PSR_V_BIT ? 'V' : 'v';
buf[4] = '\0';

printk("Flags: %s IRQs o%s FIQs o%s Mode %s%s Segment %s\n",
printk("Flags: %s IRQs o%s FIQs o%s Mode %s ISA %s Segment %s\n",
buf, interrupts_enabled(regs) ? "n" : "ff",
fast_interrupts_enabled(regs) ? "n" : "ff",
processor_modes[processor_mode(regs)],
thumb_mode(regs) ? " (T)" : "",
isa_modes[isa_mode(regs)],
get_fs() == get_ds() ? "kernel" : "user");
#ifdef CONFIG_CPU_CP15
{
Expand Down
6 changes: 5 additions & 1 deletion arch/arm/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ unsigned int processor_id;
unsigned int __machine_arch_type;
EXPORT_SYMBOL(__machine_arch_type);

unsigned int __atags_pointer __initdata;

unsigned int system_rev;
EXPORT_SYMBOL(system_rev);

Expand Down Expand Up @@ -780,7 +782,9 @@ void __init setup_arch(char **cmdline_p)
if (mdesc->soft_reboot)
reboot_setup("s");

if (mdesc->boot_params)
if (__atags_pointer)
tags = phys_to_virt(__atags_pointer);
else if (mdesc->boot_params)
tags = phys_to_virt(mdesc->boot_params);

/*
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-davinci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#

# Common objects
obj-y := time.o irq.o serial.o io.o id.o psc.o
obj-y := time.o irq.o clock.o serial.o io.o id.o psc.o \
gpio.o mux.o

# Board specific
obj-$(CONFIG_MACH_DAVINCI_EVM) += board-evm.o
2 changes: 2 additions & 0 deletions arch/arm/mach-davinci/board-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
void __init davinci_psc_init(void);
void __init davinci_irq_init(void);
void __init davinci_map_common_io(void);
void __init davinci_init_common_hw(void);

/* NOR Flash base address set to CS0 by default */
#define NOR_FLASH_PHYS 0x02000000
Expand Down Expand Up @@ -116,6 +117,7 @@ static __init void davinci_evm_init(void)

static __init void davinci_evm_irq_init(void)
{
davinci_init_common_hw();
davinci_irq_init();
}

Expand Down
Loading

0 comments on commit ca9ced7

Please sign in to comment.