68hc11: outchar belongs in platform (some platforms might use another uart)
authorAlan Cox <alan@linux.intel.com>
Sun, 26 Jul 2015 13:02:18 +0000 (14:02 +0100)
committerAlan Cox <alan@linux.intel.com>
Sun, 26 Jul 2015 13:02:18 +0000 (14:02 +0100)
Kernel/lowlevel-68hc11.s
Kernel/platform-68hc11test/p68hc11.s

index 7c1d1da..351a0e9 100644 (file)
@@ -13,7 +13,6 @@
 
        .globl outnewline
        .globl outcharhex
-       .globl outchar
        .globl outstring
        .globl outx
        .globl outy
@@ -41,9 +40,9 @@ irqrestore:           ; D holds the return from di where A is the cc
 
 outnewline:
        ldab #0x0d
-       bsr outchar
+       bsr outchar_call
        ldab #0x0a
-       bra outchar
+       bra outchar_call
 
 
 outcharhex:
@@ -65,20 +64,13 @@ outnibble:
        ble outh2
        addb #0x07
 outh2: addb #0x30
-outchar:
-       psha
-outchar1:
-       ldaa scsr
-       anda #0x80
-       beq outchar1
-       stab scdr
-       pula
-       rts
+outchar_call:
+       jmp outchar
 
 outstring:
        ldab ,x
        beq outsdone
-       bsr outchar
+       bsr outchar_call
        inx
        bra outstring
 
index 20b52e0..fa81139 100644 (file)
        .globl map_process_always
        .globl map_save
        .globl map_restore
+       .globl outchar
 
         ; exported debugging tools
         .globl trap_monitor
         .globl trap_reboot
 
+       include "cpu.def"
+       include "eeprom.def"
         include "kernel.def"
         include "../kernel-hc11.def"
 
-;
-;      TODO: hardware registers
-;
-
-       .globl baud
-.equ baud,0xf000
-       .globl sccr1
-.equ sccr1,0xf000
-       .globl sccr2
-.equ sccr2,0xf000
-       .globl scdr
-.equ scdr,0xf000
-       .globl scsr
-.equ scsr,0xf000
-
         .sect .data
 
 trapmsg:
@@ -60,15 +48,25 @@ trap_monitor:
 trap_reboot:
        jmp reboot
 
+outchar:
+       psha
+outchar1:
+       ldaa scsr
+       anda #0x80
+       beq outchar
+       stab scdr
+       pula
 init_early:
        rts
 
 init_hardware:
        ; set system RAM size
-       ldd #512
+       ldd ram         ; Size from firmware
        std ramsize
-       ldd #512-64
-       std procmem
+       clc
+       sbcb #64
+       sbca #0
+       std procmem     ; 64K is lost to kernel
 
        ; Our vectors are in high memory unlike Z80 but we still
        ; need vectors