Commit e76f1c88 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] M68k update (part 20)

Merge remaining bits of core HP300 support
parent a2b705cd
...@@ -312,6 +312,9 @@ ...@@ -312,6 +312,9 @@
#ifdef CONFIG_Q40 #ifdef CONFIG_Q40
.globl q40_mem_cptr .globl q40_mem_cptr
#endif #endif
#ifdef CONFIG_HP300
.globl hp300_phys_ram_base
#endif
CPUTYPE_040 = 1 /* indicates an 040 */ CPUTYPE_040 = 1 /* indicates an 040 */
CPUTYPE_060 = 2 /* indicates an 060 */ CPUTYPE_060 = 2 /* indicates an 060 */
...@@ -596,6 +599,64 @@ ENTRY(_start) ...@@ -596,6 +599,64 @@ ENTRY(_start)
__INIT __INIT
ENTRY(__start) ENTRY(__start)
#ifdef CONFIG_HP300
/* This is a hack. The HP NetBSD bootloader loads us at an arbitrary
address (apparently 0xff002000 in practice) which is not good if we need
to be able to map this to VA 0x1000. We could do it with pagetables but
a better solution seems to be to relocate the kernel in physical memory
before we start.
So, we copy the entire kernel image (code+data+bss) down to the 16MB
boundary that marks the start of RAM. This is slightly tricky because
we must not overwrite the copying code itself. :-) */
/* 15/5/98. The start address of physical RAM changes depending on how much
RAM is present. This is actually a blessing in disguise as it provides
a way for us to work out the RAM size rather than hardwiring it. */
lea %pc@(_start),%a0
movel %a0,%d6
and #0xffff0000, %d6
lea %pc@(hp300_phys_ram_base),%a0
movel %d6, %a0@
movel %pc@(L(custom)),%a3
moveb #0xfe,%d7
moveb %d7,%a3@(0x1ffff)
lea %pc@(Lcopystart),%a0
lea %pc@(Lcopyend),%a1
movel %d6,%a2 /* Start of physical RAM */
1: moveb %a0@+,%d0
moveb %d0,%a2@+
cmpl %a0,%a1
jbne 1b
movel %d6,%a2
moveb #0xfd,%d7
moveb %d7,%a3@(0x1ffff)
lea %pc@(_stext),%a0
lea %pc@(_end),%a1
jmp %a2@
Lcopystart:
moveb #0xf7,%d7
moveb %d7,%a3@(0x1ffff)
movel %d6,%a2 /* Start of kernel */
add #0x1000,%a2
1: moveb %a0@+,%d0
moveb %d0,%a2@+
cmpl %a0,%a1
jbne 1b
moveb #0,%d7
moveb %d7,%a3@(0x1ffff)
movel %d6,%a0
addl #Lstart1,%a0
jmp %a0@
Lcopyend:
Lstart1:
moveb #0x3f,%d7
moveb %d7,%a3@(0x1ffff)
#endif /* CONFIG_HP300 */
/* /*
* Setup initial stack pointer * Setup initial stack pointer
*/ */
...@@ -605,6 +666,7 @@ ENTRY(__start) ...@@ -605,6 +666,7 @@ ENTRY(__start)
* Record the CPU and machine type. * Record the CPU and machine type.
*/ */
#ifndef CONFIG_HP300
get_bi_record BI_MACHTYPE get_bi_record BI_MACHTYPE
lea %pc@(m68k_machtype),%a1 lea %pc@(m68k_machtype),%a1
movel %a0@,%a1@ movel %a0@,%a1@
...@@ -620,6 +682,23 @@ ENTRY(__start) ...@@ -620,6 +682,23 @@ ENTRY(__start)
get_bi_record BI_CPUTYPE get_bi_record BI_CPUTYPE
lea %pc@(m68k_cputype),%a1 lea %pc@(m68k_cputype),%a1
movel %a0@,%a1@ movel %a0@,%a1@
#else /* CONFIG_HP300 */
/* FIXME HP300 doesn't use bootinfo yet */
movel #MACH_HP300,%d4
lea %pc@(m68k_machtype),%a0
movel %d4,%a0@
movel #FPU_68881,%d0
lea %pc@(m68k_fputype),%a0
movel %d0,%a0@
movel #MMU_68030,%d0
lea %pc@(m68k_mmutype),%a0
movel %d0,%a0@
movel #CPU_68030,%d0
lea %pc@(m68k_cputype),%a0
movel %d0,%a0@
leds(0x1)
#endif /* CONFIG_HP300 */
#ifdef CONFIG_MAC #ifdef CONFIG_MAC
/* /*
...@@ -893,6 +972,9 @@ L(nocon): ...@@ -893,6 +972,9 @@ L(nocon):
putc '\n' putc '\n'
putc 'A' putc 'A'
#ifdef CONFIG_HP300
leds(0x2)
#endif /* CONFIG_HP300 */
dputn %pc@(L(cputype)) dputn %pc@(L(cputype))
dputn %pc@(m68k_supervisor_cachemode) dputn %pc@(m68k_supervisor_cachemode)
dputn %pc@(m68k_pgtable_cachemode) dputn %pc@(m68k_pgtable_cachemode)
...@@ -1490,6 +1572,7 @@ func_start get_bi_record,%d1 ...@@ -1490,6 +1572,7 @@ func_start get_bi_record,%d1
movel ARG1,%d0 movel ARG1,%d0
lea %pc@(_end),%a0 lea %pc@(_end),%a0
#ifndef CONFIG_HP300
1: tstw %a0@(BIR_TAG) 1: tstw %a0@(BIR_TAG)
jeq 3f jeq 3f
cmpw %a0@(BIR_TAG),%d0 cmpw %a0@(BIR_TAG),%d0
...@@ -1503,6 +1586,7 @@ func_start get_bi_record,%d1 ...@@ -1503,6 +1586,7 @@ func_start get_bi_record,%d1
3: moveq #-1,%d0 3: moveq #-1,%d0
lea %a0@(BIR_SIZE),%a0 lea %a0@(BIR_SIZE),%a0
4: 4:
#endif /* CONFIG_HP300 */
func_return get_bi_record func_return get_bi_record
...@@ -3739,7 +3823,12 @@ L(showtest): ...@@ -3739,7 +3823,12 @@ L(showtest):
__INITDATA __INITDATA
.align 4 .align 4
#if defined(CONFIG_ATARI) || defined(CONFIG_AMIGA) || defined(CONFIG_HP300) #ifdef CONFIG_HP300
hp300_phys_ram_base:
#endif
#if defined(CONFIG_ATARI) || defined(CONFIG_AMIGA) || \
defined(CONFIG_HP300) || defined(CONFIG_APOLLO)
L(custom): L(custom):
L(iobase): L(iobase):
.long 0 .long 0
...@@ -3830,8 +3919,6 @@ L(mac_sccbase): ...@@ -3830,8 +3919,6 @@ L(mac_sccbase):
LSRB0 = 0x10412 LSRB0 = 0x10412
LTHRB0 = 0x10416 LTHRB0 = 0x10416
LCPUCTRL = 0x10100 LCPUCTRL = 0x10100
L(iobase):
.long 0
#endif #endif
__FINIT __FINIT
......
...@@ -217,8 +217,20 @@ void __init setup_arch(char **cmdline_p) ...@@ -217,8 +217,20 @@ void __init setup_arch(char **cmdline_p)
int i; int i;
char *p, *q; char *p, *q;
/* The bootinfo is located right after the kernel bss */ if (!MACH_IS_HP300) {
m68k_parse_bootinfo((const struct bi_record *)&_end); /* The bootinfo is located right after the kernel bss */
m68k_parse_bootinfo((const struct bi_record *)&_end);
} else {
/* FIXME HP300 doesn't use bootinfo yet */
extern unsigned long hp300_phys_ram_base;
unsigned long hp300_mem_size = 0xffffffff-hp300_phys_ram_base;
m68k_cputype = CPU_68030;
m68k_fputype = FPU_68882;
m68k_memory[0].addr = hp300_phys_ram_base;
/* 0.5M fudge factor */
m68k_memory[0].size = hp300_mem_size-512*1024;
m68k_num_memory++;
}
if (CPU_IS_040) if (CPU_IS_040)
m68k_is040or060 = 4; m68k_is040or060 = 4;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment