diff options
Diffstat (limited to '')
-rw-r--r-- | bsps/powerpc/virtex4/include/bsp.h | 2 | ||||
-rw-r--r-- | bsps/powerpc/virtex4/include/bsp/irq.h | 51 | ||||
-rw-r--r-- | bsps/powerpc/virtex4/irq/irq_init.c | 54 | ||||
-rw-r--r-- | bsps/powerpc/virtex4/start/bsp_specs | 0 | ||||
-rw-r--r-- | bsps/powerpc/virtex4/start/bspstart.c | 4 | ||||
-rw-r--r-- | bsps/powerpc/virtex4/start/dummy_console.c | 2 | ||||
-rw-r--r-- | bsps/powerpc/virtex4/start/linkcmds | 2 | ||||
-rw-r--r-- | bsps/powerpc/virtex4/start/mmu.c | 23 |
8 files changed, 89 insertions, 49 deletions
diff --git a/bsps/powerpc/virtex4/include/bsp.h b/bsps/powerpc/virtex4/include/bsp.h index d0ab96813d..dc9d4cd0a5 100644 --- a/bsps/powerpc/virtex4/include/bsp.h +++ b/bsps/powerpc/virtex4/include/bsp.h @@ -16,7 +16,7 @@ * Author: Thomas Doerfler <td@imd.m.isar.de> * IMD Ingenieurbuero fuer Microcomputertechnik * - * COPYRIGHT (c) 1998 by IMD + * Copyright (c) 1998 IMD Ingenieurbuero fuer Microcomputertechnik * * Changes from IMD are covered by the original distributions terms. * This file has been derived from the papyrus BSP. diff --git a/bsps/powerpc/virtex4/include/bsp/irq.h b/bsps/powerpc/virtex4/include/bsp/irq.h index 4db8b3551e..5cc4c01b60 100644 --- a/bsps/powerpc/virtex4/include/bsp/irq.h +++ b/bsps/powerpc/virtex4/include/bsp/irq.h @@ -1,21 +1,36 @@ -/*===============================================================*\ -| Project: RTEMS virtex BSP | -+-----------------------------------------------------------------+ -| Copyright (c) 2007 | -| Embedded Brains GmbH | -| Obere Lagerstr. 30 | -| D-82178 Puchheim | -| Germany | -| rtems@embedded-brains.de | -+-----------------------------------------------------------------+ -| The license and distribution terms for this file may be | -| found in the file LICENSE in this distribution or at | -| | -| http://www.rtems.org/license/LICENSE. | -| | -+-----------------------------------------------------------------+ -| this file declares constants of the interrupt controller | -\*===============================================================*/ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * RTEMS virtex BSP + * + * This file declares constants of the interrupt controller. + */ + +/* + * Copyright (c) 2007 embedded brains GmbH & Co. KG + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + #ifndef VIRTEX4_IRQ_IRQ_H #define VIRTEX4_IRQ_IRQ_H diff --git a/bsps/powerpc/virtex4/irq/irq_init.c b/bsps/powerpc/virtex4/irq/irq_init.c index 5feafaf4b6..2756025662 100644 --- a/bsps/powerpc/virtex4/irq/irq_init.c +++ b/bsps/powerpc/virtex4/irq/irq_init.c @@ -1,24 +1,36 @@ -/*===============================================================*\ -| Project: RTEMS virtex BSP | -+-----------------------------------------------------------------+ -| Partially based on the code references which are named below. | -| Adaptions, modifications, enhancements and any recent parts of | -| the code are: | -| Copyright (c) 2007 | -| Embedded Brains GmbH | -| Obere Lagerstr. 30 | -| D-82178 Puchheim | -| Germany | -| rtems@embedded-brains.de | -+-----------------------------------------------------------------+ -| The license and distribution terms for this file may be | -| found in the file LICENSE in this distribution or at | -| | -| http://www.rtems.org/license/LICENSE. | -| | -+-----------------------------------------------------------------+ -| this file contains the irq controller handler | -\*===============================================================*/ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * RTEMS virtex BSP + * + * This file contains the irq controller handler. + */ + +/* + * Copyright (c) 2007 embedded brains GmbH & Co. KG + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + #include <libcpu/spr.h> #include <bsp/irq.h> #include <bsp.h> diff --git a/bsps/powerpc/virtex4/start/bsp_specs b/bsps/powerpc/virtex4/start/bsp_specs deleted file mode 100644 index e69de29bb2..0000000000 --- a/bsps/powerpc/virtex4/start/bsp_specs +++ /dev/null diff --git a/bsps/powerpc/virtex4/start/bspstart.c b/bsps/powerpc/virtex4/start/bspstart.c index 6ff743312c..3597c9a359 100644 --- a/bsps/powerpc/virtex4/start/bspstart.c +++ b/bsps/powerpc/virtex4/start/bspstart.c @@ -9,7 +9,7 @@ * Author: Thomas Doerfler <td@imd.m.isar.de> * IMD Ingenieurbuero fuer Microcomputertechnik * - * COPYRIGHT (c) 1998 by IMD + * Copyright (c) 1998 IMD Ingenieurbuero fuer Microcomputertechnik * * Changes from IMD are covered by the original distributions terms. * This file has been derived from the papyrus BSP: @@ -33,7 +33,7 @@ * with linker command file by * Thomas Doerfler <td@imd.m.isar.de> * for these modifications: - * COPYRIGHT (c) 1997 by IMD, Puchheim, Germany. + * Copyright (c) 1997 IMD Ingenieurbuero fuer Microcomputertechnik * * To anyone who acknowledges that this file is provided "AS IS" * without any express or implied warranty: diff --git a/bsps/powerpc/virtex4/start/dummy_console.c b/bsps/powerpc/virtex4/start/dummy_console.c index 642fe45618..ca8d2e7854 100644 --- a/bsps/powerpc/virtex4/start/dummy_console.c +++ b/bsps/powerpc/virtex4/start/dummy_console.c @@ -31,7 +31,7 @@ static rtems_termios_callbacks gMemCallbacks = { 0, /* SetAttr */ 0, /* stopRemoteTx */ 0, /* startRemoteTx */ - 0 /* outputUsesInterrupts */ + TERMIOS_POLLED /* outputUsesInterrupts */ }; rtems_device_driver console_initialize(rtems_device_major_number major, diff --git a/bsps/powerpc/virtex4/start/linkcmds b/bsps/powerpc/virtex4/start/linkcmds index ff61396710..e053cf5aeb 100644 --- a/bsps/powerpc/virtex4/start/linkcmds +++ b/bsps/powerpc/virtex4/start/linkcmds @@ -253,7 +253,7 @@ SECTIONS PROVIDE(__bsp_ram_start = .); .noinit (NOLOAD) : { - *(.noinit*) + *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*))) } >RAM .rtemsstack (NOLOAD) : { diff --git a/bsps/powerpc/virtex4/start/mmu.c b/bsps/powerpc/virtex4/start/mmu.c index e96619796b..8013f9cbc8 100644 --- a/bsps/powerpc/virtex4/start/mmu.c +++ b/bsps/powerpc/virtex4/start/mmu.c @@ -66,6 +66,7 @@ #include <rtems.h> #include <rtems/bspIo.h> #include <rtems/powerpc/powerpc.h> +#include <rtems/score/sysstate.h> #include <inttypes.h> #include <stdio.h> @@ -92,7 +93,7 @@ myprintf(FILE *f, char *fmt, ...) va_list ap; va_start(ap, fmt); - if (!f || !_impure_ptr->__sdidinit) { + if (!f || !_System_state_Is_up(_System_state_Get())) { /* Might be called at an early stage when stdio is not yet initialized. */ vprintk(fmt,ap); } else { @@ -132,13 +133,16 @@ static void fetch(bsp_tlb_idx_t key, bsp_tlb_entry_t* tlb) { register uint32_t tmp; - __asm__ volatile ("mfpid %[tmp] \n\t" + __asm__ volatile (".machine \"push\" \n\t" + ".machine \"any\" \n\t" + "mfpid %[tmp] \n\t" "stw %[tmp],0(%[tlb]) \n\t" "tlbrehi %[tmp],%[key] \n\t" "stw %[tmp],4(%[tlb]) \n\t" "tlbrelo %[tmp],%[key] \n\t" "stw %[tmp],8(%[tlb]) \n\t" "sync \n\t" + ".machine \"pop\" \n\t" : [tmp]"=&r"(tmp) : [key]"r"(key), [tlb]"b"(tlb) @@ -150,12 +154,15 @@ static void store(bsp_tlb_idx_t key, bsp_tlb_entry_t* tlb) { register uint32_t tmp; - __asm__ volatile ("lwz %[tmp],0(%[tlb]) \n\t" + __asm__ volatile (".machine \"push\" \n\t" + ".machine \"any\" \n\t" + "lwz %[tmp],0(%[tlb]) \n\t" "mtpid %[tmp] \n\t" "lwz %[tmp],4(%[tlb]) \n\t" "tlbwehi %[tmp],%[key] \n\t" "lwz %[tmp],8(%[tlb]) \n\t" "tlbwelo %[tmp],%[key] \n\t" + ".machine \"pop\" \n\t" : [tmp]"=&r"(tmp) : [tlb]"b"(tlb), [key]"r"(key) @@ -289,9 +296,12 @@ bsp_mmu_find_first_free() for (idx=0; idx<NTLBS; idx++) { register uint32_t tmp; - __asm__ volatile ("tlbrehi %[tmp],%[idx] \n\t" + __asm__ volatile (".machine \"push\" \n\t" + ".machine \"any\" \n\t" + "tlbrehi %[tmp],%[idx] \n\t" "stw %[tmp],4(%[tlb]) \n\t" /* entry.hi */ "sync \n\t" + ".machine \"pop\" \n\t" : [tmp]"=&r"(tmp) : [idx]"r"(idx), [tlb]"b"(&entry) @@ -488,11 +498,14 @@ bsp_mmu_find(uint32_t ea, uint32_t tid) rtems_interrupt_disable(lvl); - __asm__ volatile ("mfpid %[pid] \n\t" /* Save PID */ + __asm__ volatile (".machine \"push\"\n\t" + ".machine \"any\"\n\t" + "mfpid %[pid] \n\t" /* Save PID */ "mtpid %[tid] \n\t" "tlbsx. %[idx],0,%[ea] \n\t" /* Failure changes the index reg randomly. */ "mfcr %[failure] \n\t" "mtpid %[pid] \n\t" /* Restore PID */ + ".machine \"pop\"\n\t" : [pid]"=r"(pid), [idx]"=&r"(idx), [failure]"=&r"(failure) |