diff options
Diffstat (limited to 'src/arch/ppc/lib')
-rw-r--r-- | src/arch/ppc/lib/Config.lb | 19 | ||||
-rw-r--r-- | src/arch/ppc/lib/abort.c | 32 | ||||
-rw-r--r-- | src/arch/ppc/lib/c_start.S | 127 | ||||
-rw-r--r-- | src/arch/ppc/lib/cpu.c | 69 | ||||
-rw-r--r-- | src/arch/ppc/lib/cpuid.c | 83 | ||||
-rw-r--r-- | src/arch/ppc/lib/div64.S | 58 | ||||
-rw-r--r-- | src/arch/ppc/lib/floats.S | 60 | ||||
-rw-r--r-- | src/arch/ppc/lib/floats.inc | 58 | ||||
-rw-r--r-- | src/arch/ppc/lib/pci_dev.c | 54 | ||||
-rw-r--r-- | src/arch/ppc/lib/pci_ppc_conf1_ops.c | 46 | ||||
-rw-r--r-- | src/arch/ppc/lib/ppc.c | 65 | ||||
-rw-r--r-- | src/arch/ppc/lib/printk_init.c | 49 | ||||
-rw-r--r-- | src/arch/ppc/lib/timebase.S | 60 | ||||
-rw-r--r-- | src/arch/ppc/lib/timer.c | 41 |
14 files changed, 0 insertions, 821 deletions
diff --git a/src/arch/ppc/lib/Config.lb b/src/arch/ppc/lib/Config.lb deleted file mode 100644 index f5bce95a5e..0000000000 --- a/src/arch/ppc/lib/Config.lb +++ /dev/null @@ -1,19 +0,0 @@ -object c_start.S -object pci_ppc_conf1_ops.o -object pci_dev.o -object timer.o -object cpuid.o -object cpu.o -object ppc.o -object timebase.S -object floats.S -object div64.S -object abort.o -initobject pci_dev.o -initobject printk_init.o -initobject timebase.S -initobject timer.o -initobject floats.S -initobject div64.S -initobject ppc.o -initobject abort.o diff --git a/src/arch/ppc/lib/abort.c b/src/arch/ppc/lib/abort.c deleted file mode 100644 index 4fd3f0aa94..0000000000 --- a/src/arch/ppc/lib/abort.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2009 coresystems GmbH - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* gcc produces calls to an abort function in their trampoline code on powerpc - * 32bit platforms. - * This trampoline code is emitted for example in nested functions. - */ - -void abort(void) -{ - /* We would want to call die() here, but it might not be available at - * this point, so for now we have to die silently. - */ - for (;;) ; -} - diff --git a/src/arch/ppc/lib/c_start.S b/src/arch/ppc/lib/c_start.S deleted file mode 100644 index 3bae8da751..0000000000 --- a/src/arch/ppc/lib/c_start.S +++ /dev/null @@ -1,127 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2000 AG Electronics Ltd. - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* - * The assumption is that we're located in ROM and we have a fake stack - * located in cache. Our task is to turn on memory proper, the finish - * configuring the machine. - */ - -#define ASM -#include "ppcreg.h" -#include <ppc_asm.tmpl> - -.section ".text" -.globl _start - -_start: - /* - * init stack pointer to real ram now that memory is on - * Note: We use the last 8 bytes on the stack to hold struct cpu_info, - * Which are initialized to zero as we clear the stack. - */ - li r0, 0 - lis r1, _estack@ha - addi r1, r1, _estack@l - stwu r0,-64(r1) - stwu r1,-24(r1) - - /* - * Clear stack - */ - lis r4, _stack@ha - addi r4, r4, _stack@l - lis r7, _estack@ha - addi r7, r7, _estack@l - lis r5, 0 -1: stwx r5, 0, r4 - addi r4, r4, 4 - cmp 0, 0, r4, r7 - ble 1b - sync - - /* - * Clear bss - */ - lis r4, _bss@ha - addi r4, r4, _bss@l - lis r7, _ebss@ha - addi r7, r7, _ebss@l - lis r5, 0 -1: stwx r5, 0, r4 - addi r4, r4, 4 - cmp 0, 0, r4, r7 - ble 1b - sync - - /* - * Set up the EABI pointers, before we enter any C code - */ - lis r13, _SDA_BASE_@ha - addi r13, r13, _SDA_BASE_@l - lis r2, _SDA2_BASE_@ha - addi r2, r2, _SDA2_BASE_@l - - /* - * load start address into SRR0 for rfi - */ - lis r3, hardwaremain@ha - addi r3, r3, hardwaremain@l - mtspr SRR0, r3 - - /* - * load the current MSR into SRR1 so that it will be copied - * back into MSR on rfi - */ - mfmsr r4 - mtspr SRR1, r4 // load SRR1 with r4 - - /* - * If something returns after rfi then die - */ - lis r3, dead@ha - addi r3, r3, dead@l - mtlr r3 - - /* - * Complete rest of initialization in C (hardwaremain) - */ - rfi - - /* - * Stop here if something goes wrong - */ -dead: - b dead - /*NOTREACHED*/ - -/* Remove need for ecrti.o and ectrn.o */ -.globl __init -__init: -.globl __fini -__fini: -.globl __CTOR_LIST__ -__CTOR_LIST__: -.globl __CTOR_END__ -__CTOR_END__: -.globl __DTOR_LIST__ -__DTOR_LIST__: -.globl __DTOR_END__ -__DTOR_END__: - blr diff --git a/src/arch/ppc/lib/cpu.c b/src/arch/ppc/lib/cpu.c deleted file mode 100644 index 95840c0cca..0000000000 --- a/src/arch/ppc/lib/cpu.c +++ /dev/null @@ -1,69 +0,0 @@ -#include <console/console.h> -#include <arch/io.h> -#include <string.h> -#include <device/device.h> -#include <cpu/cpu.h> -#include <cpu/ppc/cpuid.h> -#include "ppc.h" -#include "ppcreg.h" - -#if 0 -static void set_cpu_ops(struct device *cpu) -{ - struct cpu_driver *driver; - cpu->ops = 0; - for (driver = cpu_drivers; driver < ecpu_drivers; driver++) { - struct cpu_device_id *id; - for(id = driver->id_table; id->pvr != 0; id++) { - if (cpu->device == id->pvr) - { - goto found; - } - } - } - die("Unknown cpu"); - return; - found: - cpu->ops = driver->ops; -} -#endif - -void cpu_initialize(void) -{ - /* Because we busy wait at the printk spinlock. - * It is important to keep the number of printed messages - * from secondary cpus to a minimum, when debugging is - * disabled. - */ - struct device *cpu; - struct cpu_info *info; - info = cpu_info(); - - printk_notice("Initializing CPU #%d\n", info->index); - - cpu = info->cpu; - if (!cpu) { - die("CPU: missing cpu device structure"); - } - - /* Find what type of cpu we are dealing with */ - cpu->vendor = 0; /* PPC cpus do not have a vendor field */ - cpu->device = ppc_getpvr(); - display_cpuid(cpu); - -#if 0 - /* Lookup the cpu's operations */ - set_cpu_ops(cpu); - - /* Initialize the cpu */ - if (cpu->ops && cpu->ops->init) { - cpu->enabled = 1; - cpu->initialized = 1; - cpu->ops->init(); - } -#endif - /* Turn on caching if we haven't already */ - - printk_info("CPU #%d initialized\n", info->index); - return; -} diff --git a/src/arch/ppc/lib/cpuid.c b/src/arch/ppc/lib/cpuid.c deleted file mode 100644 index e28de924e9..0000000000 --- a/src/arch/ppc/lib/cpuid.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2000 AG Electronics Ltd. - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "ppc.h" -#include "ppcreg.h" -#include <device/device.h> -#include <console/console.h> - -void display_cpuid(struct device *cpu) -{ - unsigned type = cpu->device >> 16; - unsigned version = cpu->device & 0xffff; - const char *cpu_string = 0; - switch(type) { - case 0x0001: - cpu_string = "601"; - break; - case 0x0003: - cpu_string = "603"; - break; - case 0x0004: - cpu_string = "604"; - break; - case 0x0006: - cpu_string = "603e"; - break; - case 0x0007: - cpu_string = "603ev"; - break; - case 0x0008: - cpu_string = "750"; - break; - case 0x0009: - cpu_string = "604e"; - break; - case 0x000a: - cpu_string = "604ev5 (MachV)"; - break; - case 0x000c: - cpu_string = "7400"; - break; - case 0x0032: - cpu_string = "821"; - break; - case 0x0050: - cpu_string = "860"; - break; - case 0x4011: - cpu_string = "405GP"; - break; - case 0x5091: - cpu_string = "405GPr"; - break; - case 0x5121: - cpu_string = "405EP"; - break; - case 0x800c: - cpu_string = "7410"; - break; - } - if (cpu_string) - printk_info("PowerPC %s", cpu_string); - else - printk_info("PowerPC unknown (0x%x)", type); - printk_info(" CPU, version %d.%d\n", version >> 8, version & 0xff); -} - diff --git a/src/arch/ppc/lib/div64.S b/src/arch/ppc/lib/div64.S deleted file mode 100644 index 48047747e0..0000000000 --- a/src/arch/ppc/lib/div64.S +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Divide a 64-bit unsigned number by a 32-bit unsigned number. - * This routine assumes that the top 32 bits of the dividend are - * non-zero to start with. - * On entry, r3 points to the dividend, which get overwritten with - * the 64-bit quotient, and r4 contains the divisor. - * On exit, r3 contains the remainder. - * - * Copyright (C) 2002 Paul Mackerras, IBM Corp. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#include <ppc_asm.tmpl> - - .globl __div64_32 -__div64_32: - lwz r5,0(r3) # get the dividend into r5/r6 - lwz r6,4(r3) - cmplw r5,r4 - li r7,0 - li r8,0 - blt 1f - divwu r7,r5,r4 # if dividend.hi >= divisor, - mullw r0,r7,r4 # quotient.hi = dividend.hi / divisor - subf. r5,r0,r5 # dividend.hi %= divisor - beq 3f -1: mr r11,r5 # here dividend.hi != 0 - andis. r0,r5,0xc000 - bne 2f - cntlzw r0,r5 # we are shifting the dividend right - li r10,-1 # to make it < 2^32, and shifting - srw r10,r10,r0 # the divisor right the same amount, - add r9,r4,r10 # rounding up (so the estimate cannot - andc r11,r6,r10 # ever be too large, only too small) - andc r9,r9,r10 - or r11,r5,r11 - rotlw r9,r9,r0 - rotlw r11,r11,r0 - divwu r11,r11,r9 # then we divide the shifted quantities -2: mullw r10,r11,r4 # to get an estimate of the quotient, - mulhwu r9,r11,r4 # multiply the estimate by the divisor, - subfc r6,r10,r6 # take the product from the divisor, - add r8,r8,r11 # and add the estimate to the accumulated - subfe. r5,r9,r5 # quotient - bne 1b -3: cmplw r6,r4 - blt 4f - divwu r0,r6,r4 # perform the remaining 32-bit division - mullw r10,r0,r4 # and get the remainder - add r8,r8,r0 - subf r6,r10,r6 -4: stw r7,0(r3) # return the quotient in *r3 - stw r8,4(r3) - mr r3,r6 # return the remainder in r3 - blr diff --git a/src/arch/ppc/lib/floats.S b/src/arch/ppc/lib/floats.S deleted file mode 100644 index 1b56f40a37..0000000000 --- a/src/arch/ppc/lib/floats.S +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 1999-2000 AG Electronics Ltd. - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include <ppc_asm.tmpl> - - .globl ppc_init_float_registers - -ppc_init_float_registers: - lfd fr0, 0(r3) - lfd fr1, 0(r3) - lfd fr2, 0(r3) - lfd fr3, 0(r3) - lfd fr4, 0(r3) - lfd fr5, 0(r3) - lfd fr6, 0(r3) - lfd fr7, 0(r3) - lfd fr8, 0(r3) - lfd fr9, 0(r3) - lfd fr10, 0(r3) - lfd fr11, 0(r3) - lfd fr12, 0(r3) - lfd fr13, 0(r3) - lfd fr14, 0(r3) - lfd fr15, 0(r3) - lfd fr16, 0(r3) - lfd fr17, 0(r3) - lfd fr18, 0(r3) - lfd fr19, 0(r3) - lfd fr20, 0(r3) - lfd fr21, 0(r3) - lfd fr22, 0(r3) - lfd fr23, 0(r3) - lfd fr24, 0(r3) - lfd fr25, 0(r3) - lfd fr26, 0(r3) - lfd fr27, 0(r3) - lfd fr28, 0(r3) - lfd fr29, 0(r3) - lfd fr30, 0(r3) - lfd fr31, 0(r3) - blr - - .end - diff --git a/src/arch/ppc/lib/floats.inc b/src/arch/ppc/lib/floats.inc deleted file mode 100644 index c075a8b408..0000000000 --- a/src/arch/ppc/lib/floats.inc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 1999-2000 AG Electronics Ltd. - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* .text*/ - .globl _init_float_registers - -_init_float_registers: - lfd 0, 0(3) - lfd 1, 0(3) - lfd 2, 0(3) - lfd 3, 0(3) - lfd 4, 0(3) - lfd 5, 0(3) - lfd 6, 0(3) - lfd 7, 0(3) - lfd 8, 0(3) - lfd 9, 0(3) - lfd 10, 0(3) - lfd 11, 0(3) - lfd 12, 0(3) - lfd 13, 0(3) - lfd 14, 0(3) - lfd 15, 0(3) - lfd 16, 0(3) - lfd 17, 0(3) - lfd 18, 0(3) - lfd 19, 0(3) - lfd 20, 0(3) - lfd 21, 0(3) - lfd 22, 0(3) - lfd 23, 0(3) - lfd 24, 0(3) - lfd 25, 0(3) - lfd 26, 0(3) - lfd 27, 0(3) - lfd 28, 0(3) - lfd 29, 0(3) - lfd 30, 0(3) - lfd 31, 0(3) - blr - .end - diff --git a/src/arch/ppc/lib/pci_dev.c b/src/arch/ppc/lib/pci_dev.c deleted file mode 100644 index d821f17c77..0000000000 --- a/src/arch/ppc/lib/pci_dev.c +++ /dev/null @@ -1,54 +0,0 @@ -#include <arch/io.h> -#include <arch/pciconf.h> - -/* - * Direct access to PCI hardware... - */ - -uint8_t pci_ppc_read_config8(unsigned char bus, int devfn, int where) -{ - uint8_t res; - - out_le32((unsigned *)CONFIG_PCIC0_CFGADDR, CONFIG_CMD(bus, devfn, where)); - res = in_8((unsigned char *)CONFIG_PCIC0_CFGDATA + (where & 3)); - return res; -} - -uint16_t pci_ppc_read_config16(unsigned char bus, int devfn, int where) -{ - uint16_t res; - - out_le32((unsigned *)CONFIG_PCIC0_CFGADDR, CONFIG_CMD(bus, devfn, where)); - res = in_le16((unsigned short *)CONFIG_PCIC0_CFGDATA + (where & 2)); - return res; -} - -uint32_t pci_ppc_read_config32(unsigned char bus, int devfn, int where) -{ - uint32_t res; - - out_le32((unsigned *)CONFIG_PCIC0_CFGADDR, CONFIG_CMD(bus, devfn, where)); - res = in_le32((unsigned *)CONFIG_PCIC0_CFGDATA); - return res; -} - -int pci_ppc_write_config8(unsigned char bus, int devfn, int where, uint8_t data) -{ - out_le32((unsigned *)CONFIG_PCIC0_CFGADDR, CONFIG_CMD(bus, devfn, where)); - out_8((unsigned char *)CONFIG_PCIC0_CFGDATA + (where & 3), data); - return 0; -} - -int pci_ppc_write_config16(unsigned char bus, int devfn, int where, uint16_t data) -{ - out_le32((unsigned *)CONFIG_PCIC0_CFGADDR, CONFIG_CMD(bus, devfn, where)); - out_le16((unsigned short *)CONFIG_PCIC0_CFGDATA + (where & 2), data); - return 0; -} - -int pci_ppc_write_config32(unsigned char bus, int devfn, int where, uint32_t data) -{ - out_le32((unsigned *)CONFIG_PCIC0_CFGADDR, CONFIG_CMD(bus, devfn, where)); - out_le32((unsigned *)CONFIG_PCIC0_CFGDATA, data); - return 0; -} diff --git a/src/arch/ppc/lib/pci_ppc_conf1_ops.c b/src/arch/ppc/lib/pci_ppc_conf1_ops.c deleted file mode 100644 index 12e4529784..0000000000 --- a/src/arch/ppc/lib/pci_ppc_conf1_ops.c +++ /dev/null @@ -1,46 +0,0 @@ -#include <console/console.h> -#include <arch/pciconf.h> -#include <device/device.h> -#include <device/pci.h> -#include <device/pci_ids.h> -#include <device/pci_ops.h> - -static uint8_t ppc_conf1_read_config8(struct bus *pbus, unsigned char bus, int devfn, int where) -{ - return pci_ppc_read_config8(bus, devfn, where); -} - -static uint16_t ppc_conf1_read_config16(struct bus *pbus, unsigned char bus, int devfn, int where) -{ - return pci_ppc_read_config16(bus, devfn, where); -} - -static uint32_t ppc_conf1_read_config32(struct bus *pbus, unsigned char bus, int devfn, int where) -{ - return pci_ppc_read_config32(bus, devfn, where); -} - -static void ppc_conf1_write_config8(struct bus *pbus, unsigned char bus, int devfn, int where, uint8_t val) -{ - pci_ppc_write_config8(bus, devfn, where, val); -} - -static void ppc_conf1_write_config16(struct bus *pbus, unsigned char bus, int devfn, int where, uint16_t val) -{ - pci_ppc_write_config16(bus, devfn, where, val); -} - -static void ppc_conf1_write_config32(struct bus *pbus, unsigned char bus, int devfn, int where, uint32_t val) -{ - pci_ppc_write_config32(bus, devfn, where, val); -} - -const struct pci_bus_operations pci_ppc_conf1 = -{ - .read8 = ppc_conf1_read_config8, - .read16 = ppc_conf1_read_config16, - .read32 = ppc_conf1_read_config32, - .write8 = ppc_conf1_write_config8, - .write16 = ppc_conf1_write_config16, - .write32 = ppc_conf1_write_config32, -}; diff --git a/src/arch/ppc/lib/ppc.c b/src/arch/ppc/lib/ppc.c deleted file mode 100644 index 66039e76df..0000000000 --- a/src/arch/ppc/lib/ppc.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2000 AG Electronics Ltd. - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "ppc.h" -#include "ppcreg.h" - -unsigned ppc_getmsr(void) -{ - unsigned result; - __asm__ volatile ("mfmsr %0" : "=r" (result)); - return result; -} - -unsigned ppc_gethid0(void) -{ - unsigned result; - __asm__ volatile ("mfspr %0,1008" : "=r" (result)); - return result; -} - -unsigned ppc_gethid1(void) -{ - unsigned result; - __asm__ volatile ("mfspr %0,1009" : "=r" (result)); - return result; -} - -void ppc_sethid0(unsigned value) -{ - __asm__ volatile ("mtspr 1008,%0" : : "r" (value)); -} - -unsigned ppc_getpvr(void) -{ - unsigned result; - __asm__("mfspr %0, 287" : "=r" (result)); - return result; -} - -void ppc_setmsr(unsigned value) -{ - __asm__ volatile ("mtmsr %0; sync" :: "r" (value)); -} - -void ppc_set1015(unsigned value) -{ - __asm__ volatile ("mtspr 1015,%0" : : "r" (value)); -} - diff --git a/src/arch/ppc/lib/printk_init.c b/src/arch/ppc/lib/printk_init.c deleted file mode 100644 index d9e6bacfb3..0000000000 --- a/src/arch/ppc/lib/printk_init.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; version 2 of - * the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - * MA 02110-1301 USA - */ - -#include <stdarg.h> -#include <console/vtxprintf.h> -#include <console/loglevel.h> -#include <uart8250.h> - -int console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL; - -void console_tx_byte(unsigned char byte) -{ - if (byte == '\n') - uart8250_tx_byte(CONFIG_TTYS0_BASE, '\r'); - - uart8250_tx_byte(CONFIG_TTYS0_BASE, byte); -} - -int do_printk(int msg_level, const char *fmt, ...) -{ - va_list args; - int i; - - if (msg_level >= console_loglevel) { - return 0; - } - - va_start(args, fmt); - i = vtxprintf(console_tx_byte, fmt, args); - va_end(args); - - return i; -} diff --git a/src/arch/ppc/lib/timebase.S b/src/arch/ppc/lib/timebase.S deleted file mode 100644 index 9e0b2a9290..0000000000 --- a/src/arch/ppc/lib/timebase.S +++ /dev/null @@ -1,60 +0,0 @@ -/* - * (C) Copyright 2000, 2001 - * Erik Theisen, Wave 7 Optics, etheisen@mindspring.com. - * base on code by - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - * MA 02110-1301 USA - */ -#include <ppc_asm.tmpl> - - .text -/* - * unsigned long long _get_ticks(void); - */ - .globl _get_ticks -_get_ticks: -1: mftbu r3 - mftb r4 - mftbu r5 - cmpw 0,r3,r5 - bne 1b - blr - -/* - * Delay for a number of ticks - */ - .globl _wait_ticks -_wait_ticks: - mflr r8 /* save link register */ - mr r7, r3 /* save tick count */ - bl _get_ticks /* Get start time */ - - /* Calculate end time */ - addc r7, r4, r7 /* Compute end time lower */ - addze r6, r3 /* and end time upper */ - -1: bl _get_ticks /* Get current time */ - subfc r4, r4, r7 /* Subtract current time from end time */ - subfe. r3, r3, r6 - bge 1b /* Loop until time expired */ - - mtlr r8 /* restore link register */ - blr - diff --git a/src/arch/ppc/lib/timer.c b/src/arch/ppc/lib/timer.c deleted file mode 100644 index 0663afd769..0000000000 --- a/src/arch/ppc/lib/timer.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2000 AG Electronics Ltd. - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include <ppc.h> -#include <timer.h> -#include <clock.h> - -unsigned long get_hz(void) -{ - return get_timer_freq(); -} - -unsigned long ticks_since_boot(void) -{ - extern unsigned long _get_ticks(void); - return _get_ticks(); -} - -void udelay(int usecs) -{ - extern void _wait_ticks(unsigned long); - unsigned long ticksperusec = get_hz() / 1000000; - - _wait_ticks(ticksperusec * usecs); -} |