summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/eth_comm/startup
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2004-11-23 22:20:44 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2004-11-23 22:20:44 +0000
commit279eb2c2e06a9803021d8fd752f0de575796f1ae (patch)
treebda5bb60ea9027918675ee9fbaa4a3bb7035215f /c/src/lib/libbsp/powerpc/eth_comm/startup
parentAdd PR617 as fixed by conversion to new exceptions. (diff)
downloadrtems-279eb2c2e06a9803021d8fd752f0de575796f1ae.tar.bz2
2004-11-23 Joel Sherrill <joel@OARcorp.com>
* eth_comm/.cvsignore, eth_comm/ChangeLog, eth_comm/Makefile.am, eth_comm/README, eth_comm/bsp_specs, eth_comm/configure.ac, eth_comm/times, eth_comm/canbus/canbus.c, eth_comm/clock/p_clock.c, eth_comm/console/console.c, eth_comm/include/.cvsignore, eth_comm/include/8xx_immap.h, eth_comm/include/bsp.h, eth_comm/include/canbus.h, eth_comm/include/commproc.h, eth_comm/include/coverhd.h, eth_comm/include/info.h, eth_comm/include/tm27.h, eth_comm/irq/irq.c, eth_comm/irq/irq.h, eth_comm/irq/irq_asm.S, eth_comm/irq/irq_init.c, eth_comm/network/README, eth_comm/network/network.c, eth_comm/start/start.S, eth_comm/startup/bspstart.c, eth_comm/startup/cpuinit.c, eth_comm/startup/linkcmds, eth_comm/startup/mmutlbtab.c, eth_comm/vectors/vectors.S, eth_comm/vectors/vectors.h, eth_comm/vectors/vectors_init.c, eth_comm/wrapup/.cvsignore, eth_comm/wrapup/Makefile.am: Removed.
Diffstat (limited to 'c/src/lib/libbsp/powerpc/eth_comm/startup')
-rw-r--r--c/src/lib/libbsp/powerpc/eth_comm/startup/bspstart.c215
-rw-r--r--c/src/lib/libbsp/powerpc/eth_comm/startup/cpuinit.c44
-rw-r--r--c/src/lib/libbsp/powerpc/eth_comm/startup/linkcmds207
-rw-r--r--c/src/lib/libbsp/powerpc/eth_comm/startup/mmutlbtab.c45
4 files changed, 0 insertions, 511 deletions
diff --git a/c/src/lib/libbsp/powerpc/eth_comm/startup/bspstart.c b/c/src/lib/libbsp/powerpc/eth_comm/startup/bspstart.c
deleted file mode 100644
index ad0cdcc183..0000000000
--- a/c/src/lib/libbsp/powerpc/eth_comm/startup/bspstart.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/* bsp_start()
- *
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * The MPC860 specific stuff was written by Jay Monkman (jmonkman@frasca.com)
- *
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-
-#include <string.h>
-
-#include <bsp.h>
-#include <bsp/irq.h>
-#include <rtems/libio.h>
-#include <rtems/libcsupport.h>
-#include <info.h>
-#include <libcpu/cpuIdent.h>
-#include <libcpu/spr.h>
-#include <rtems/bspIo.h>
-
-boardinfo_t M860_binfo;
-
-/*
- * The original table from the application and our copy of it with
- * some changes.
- */
-extern rtems_configuration_table Configuration;
-extern unsigned long intrStackPtr;
-rtems_configuration_table BSP_Configuration;
-
-rtems_cpu_table Cpu_table;
-
-char *rtems_progname;
-
-/*
- * Use the shared implementations of the following routines
- */
-void bsp_postdriver_hook(void);
-void bsp_libc_init( void *, uint32_t, int );
-
-void BSP_panic(char *s)
-{
- printk("%s PANIC %s\n",_RTEMS_version, s);
- __asm__ __volatile ("sc");
-}
-
-void _BSP_Fatal_error(unsigned int v)
-{
- printk("%s PANIC ERROR %x\n",_RTEMS_version, v);
- __asm__ __volatile ("sc");
-}
-
-/*
- * Function: bsp_pretasking_hook
- * Created: 95/03/10
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void
-bsp_pretasking_hook(void)
-{
- extern int _end;
- uint32_t heap_start;
-
- /*
- * Let's check to see if the size of M860_binfo is what
- * it should be. It might not be if the info.h files
- * for RTEMS and the bootloader define boardinfo_t
- * differently.
- */
-
- /* Oops. printf() won't work yet, since the console is not initialized.
- I should probably find some way of doing this though.
- if (M860_binfo.size != sizeof(boardinfo_t)) {
- printf("The size of the Board Info Block appears to be incorrect.\n");
- printf(" This could occur if the 'info.h' files for RTEMS and the\n");
- printf(" bootloader differ in their definition of boardinfo_t\n");
- }
- */
- heap_start = (uint32_t) &_end;
-
- /* Align the heap on a natural boundary (4 bytes?) */
- if (heap_start & (CPU_ALIGNMENT-1)) {
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
- }
- /* set up a 256K heap */
- bsp_libc_init((void *) heap_start, 256 * 1024, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
-SPR_RW(SPRG0)
-SPR_RW(SPRG1)
-
-void bsp_start(void)
-{
- extern int _end;
- uint32_t heap_start;
- uint32_t ws_start;
- ppc_cpu_id_t myCpu;
- ppc_cpu_revision_t myCpuRevision;
- register unsigned char* intrStack;
- extern void cpu_init(void);
-
- /*
- * Get CPU identification dynamically. Note that the get_ppc_cpu_type() function
- * store the result in global variables so that it can be used latter...
- */
- myCpu = get_ppc_cpu_type();
- myCpuRevision = get_ppc_cpu_revision();
-
- cpu_init();
- mmu_init();
- /*
- * Initialize some SPRG registers related to irq handling
- */
-
- intrStack = (((unsigned char*)&intrStackPtr) - CPU_MINIMUM_STACK_FRAME_SIZE);
-
- _write_SPRG1((unsigned int)intrStack);
-
- /* Signal them that this BSP has fixed PR288 - eventually, this should go away */
- _write_SPRG0(PPC_BSP_HAS_FIXED_PR288);
-
- /*
- * Install our own set of exception vectors
- */
- initialize_exceptions();
-
- /*
- * Allocate the memory for the RTEMS Work Space. This can come from
- * a variety of places: hard coded address, malloc'ed from outside
- * RTEMS world (e.g. simulator or primitive memory manager), or (as
- * typically done by stock BSPs) by subtracting the required amount
- * of work space from the last physical address on the CPU board.
- */
-
- /*
- * Need to "allocate" the memory for the RTEMS Workspace and
- * tell the RTEMS configuration where it is. This memory is
- * not malloc'ed. It is just "pulled from the air".
- */
-
- heap_start = (uint32_t) &_end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- ws_start = heap_start + (256 * 1024);
- if (ws_start & ((512 * 1024) - 1)) { /* align to 512K boundary */
- ws_start = (ws_start + (512 * 1024)) & ~((512 * 1024) - 1);
- }
-
- BSP_Configuration.work_space_start = (void *)ws_start;
- BSP_Configuration.work_space_size = 512 * 1024;
-
- /*
- * initialize the CPU table for this BSP
- */
-
- Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.postdriver_hook = bsp_postdriver_hook;
- Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
-
- Cpu_table.clicks_per_usec = 1; /* for 4MHz extclk */
- Cpu_table.serial_per_sec = 10000000;
- Cpu_table.serial_external_clock = 1;
- Cpu_table.serial_xon_xoff = 0;
- Cpu_table.serial_cts_rts = 1;
- Cpu_table.serial_rate = 9600;
- Cpu_table.timer_average_overhead = 0;
- Cpu_table.timer_least_valid = 0;
- Cpu_table.clock_speed = 40000000;
-
- /*
- * Since we are currently autodetecting whether to use SCC1 or
- * the FEC for ethernet, we set up a register in the ethernet
- * transciever that is used for 10/100 Mbps ethernet now, so that
- * we can attempt to read it later in rtems_enet_driver_attach()
- */
- m8xx.fec.mii_speed = 0x0a;
- m8xx.fec.mii_data = 0x680a0000;
-
- m8xx.scc2.sccm=0;
- m8xx.scc2p.rbase=0;
- m8xx.scc2p.tbase=0;
- m8xx_cp_execute_cmd( M8xx_CR_OP_STOP_TX | M8xx_CR_CHAN_SCC2 );
- /*
- * Initalize RTEMS IRQ system
- */
- BSP_rtems_irq_mng_init(0);
-#ifdef SHOW_MORE_INIT_SETTINGS
- printk("Exit from bspstart\n");
-#endif
-
-}
diff --git a/c/src/lib/libbsp/powerpc/eth_comm/startup/cpuinit.c b/c/src/lib/libbsp/powerpc/eth_comm/startup/cpuinit.c
deleted file mode 100644
index 99355ea11e..0000000000
--- a/c/src/lib/libbsp/powerpc/eth_comm/startup/cpuinit.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * cpuinit.c - this file contains functions for initializing the CPU
- *
- * Written by Jay Monkman (jmonkman@frasca.com)
- *
- * $Id$
- */
-
-#include <bsp.h>
-
-/* Macros for handling all the MMU SPRs */
-#define PUT_IC_CST(r) __asm__ volatile ("mtspr 0x230,%0\n" ::"r"(r))
-#define GET_IC_CST(r) __asm__ volatile ("mfspr %0,0x230\n" :"=r"(r))
-#define PUT_DC_CST(r) __asm__ volatile ("mtspr 0x238,%0\n" ::"r"(r))
-#define GET_DC_CST(r) __asm__ volatile ("mfspr %0,0x238\n" :"=r"(r))
-
-void cpu_init(void)
-{
- register unsigned long t1, t2;
-
- /* Let's clear MSR[IR] and MSR[DR] */
- t2 = PPC_MSR_IR | PPC_MSR_DR;
- __asm__ volatile (
- "mfmsr %0\n"
- "andc %0, %0, %1\n"
- "mtmsr %0\n" :"=r"(t1), "=r"(t2):
- "1"(t2));
-
- t1 = M8xx_CACHE_CMD_UNLOCK;
- /* PUT_DC_CST(t1); */
- PUT_IC_CST(t1);
-
- t1 = M8xx_CACHE_CMD_INVALIDATE;
- /* PUT_DC_CST(t1); */
- PUT_IC_CST(t1);
-
- t1 = M8xx_CACHE_CMD_ENABLE;
- PUT_IC_CST(t1);
-
- t1 = M8xx_CACHE_CMD_SFWT;
- /* PUT_DC_CST(t1); */
- t1 = M8xx_CACHE_CMD_ENABLE;
- /* PUT_DC_CST(t1);*/
-}
diff --git a/c/src/lib/libbsp/powerpc/eth_comm/startup/linkcmds b/c/src/lib/libbsp/powerpc/eth_comm/startup/linkcmds
deleted file mode 100644
index 5b9054af9f..0000000000
--- a/c/src/lib/libbsp/powerpc/eth_comm/startup/linkcmds
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * This file contains directives for the GNU linker which are specific
- * to the Ethernet-Comm Board
- *
- * $Id$
- */
-
-OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
- "elf32-powerpc")
-OUTPUT_ARCH(powerpc)
-
-ENTRY(start)
-
-MEMORY
- {
- ram : org = 0x0, l = 4M
- dpram : org = 0xff000000, l = 16K
- canbus : org = 0xff100000, l = 12K
- flash : org = 0xfff00000, l = 512K
- }
-
-
-SECTIONS
-{
- .vectors :
- {
- *(.vectors)
- } >ram
-
- /*
- * The stack will live in this area - between the vectors and
- * the text section.
- */
-
- .text 0x10000:
- {
- text.start = .;
- *(.entry)
- *(.entry2)
- *(.text)
- *(.rodata*)
-
- /*
- * Special FreeBSD sysctl sections.
- */
- . = ALIGN (16);
- __start_set_sysctl_set = .;
- *(set_sysctl_*);
- __stop_set_sysctl_set = ABSOLUTE(.);
- *(set_domain_*);
- *(set_pseudo_*);
-
- *(.eh_frame)
- *(.gnu.linkonce.r*)
- *(.rodata1)
- *(.gnu.linkonce.t.*)
- *(.descriptors)
- /* .gnu.warning sections are handled specially by elf32.em. */
- *(.gnu.warning)
- *(rom_ver)
- etext = ALIGN(0x10);
- _etext = .;
-
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
-
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
-
- *(.lit)
- *(.shdata)
- _init = .; *(.init)
- _fini = .; *(.fini)
- _endtext = .;
- text.end = .;
- } > ram
-
- /* R/W Data */
- .data :
- {
- *(.data)
- *(.data1)
- *(.gnu.linkonce.d.*)
- PROVIDE (__SDATA_START__ = .);
- *(.sdata)
- *(.gnu.linkonce.s.*)
- } > ram
-
- PROVIDE (__EXCEPT_START__ = .);
- .gcc_except_table : { *(.gcc_except_table) } >ram
- PROVIDE (__EXCEPT_END__ = .);
- __GOT_START__ = .;
- .got :
- {
- s.got = .;
- *(.got.plt) *(.got)
- } > ram
- __GOT_END__ = .;
-
- .got1 : { *(.got1) } >ram
- PROVIDE (__GOT2_START__ = .);
- PROVIDE (_GOT2_START_ = .);
- .got2 : { *(.got2) } >ram
- PROVIDE (__GOT2_END__ = .);
- PROVIDE (_GOT2_END_ = .);
-
- PROVIDE (__FIXUP_START__ = .);
- PROVIDE (_FIXUP_START_ = .);
- .fixup : { *(.fixup) } >ram
- PROVIDE (_FIXUP_END_ = .);
- PROVIDE (__FIXUP_END__ = .);
-
- PROVIDE (__SDATA2_START__ = .);
- .sdata2 : { *(.sdata2) *(.gnu.linkonce.s2.*) } >ram
- .sbss2 : { *(.sbss2) *(.gnu.linkonce.sb2.*) } >ram
- PROVIDE (__SBSS2_END__ = .);
-
- .sbss2 : { *(.sbss2) } >ram
- PROVIDE (__SBSS2_END__ = .);
-
- __SBSS_START__ = .;
- .bss :
- {
- bss.start = .;
- *(.bss) *(.sbss) *(COMMON)
- . = ALIGN(4);
- bss.end = .;
- } > ram
- __SBSS_END__ = .;
-
- bss.size = bss.end - bss.start;
- text.size = text.end - text.start;
- PROVIDE(_end = bss.end);
- /*
- * Interrupt stack setup
- */
-
- IntrStack_start = ALIGN(0x10);
- . += 0x4000;
- intrStack = .;
- PROVIDE(intrStackPtr = intrStack);
-
- dpram :
- {
- m8xx = .;
- _m8xx = .;
- . += (8 * 1024);
- } >dpram
-
- canbus :
- {
- canbus0 = .;
- . += (0x1000);
- canbus1 = .;
- . += (0x1000);
- canbus2 = .;
- . += (0x1000);
- } >canbus
-
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
-
- /* DWARF debug sections.
- Symbols in the DWARF debugging sections are relative to the beginning
- of the section so we begin them at 0. */
- /* DWARF 1 */
- .debug 0 : { *(.debug) }
- .line 0 : { *(.line) }
-
- /* GNU DWARF 1 extensions */
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
-
- /* DWARF 1.1 and DWARF 2 */
- .debug_aranges 0 : { *(.debug_aranges) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
-
- /* DWARF 2 */
- .debug_info 0 : { *(.debug_info) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_line 0 : { *(.debug_line) }
- .debug_frame 0 : { *(.debug_frame) }
- .debug_str 0 : { *(.debug_str) }
- .debug_loc 0 : { *(.debug_loc) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
-
- /* SGI/MIPS DWARF 2 extensions */
- .debug_weaknames 0 : { *(.debug_weaknames) }
- .debug_funcnames 0 : { *(.debug_funcnames) }
- .debug_typenames 0 : { *(.debug_typenames) }
- .debug_varnames 0 : { *(.debug_varnames) }
- /* These must appear regardless of . */
-
-}
diff --git a/c/src/lib/libbsp/powerpc/eth_comm/startup/mmutlbtab.c b/c/src/lib/libbsp/powerpc/eth_comm/startup/mmutlbtab.c
deleted file mode 100644
index adc3c0491d..0000000000
--- a/c/src/lib/libbsp/powerpc/eth_comm/startup/mmutlbtab.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * mmutlbtab.c
- *
- * This file defines the MMU_TLB_table for the eth_comm board.
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- */
-
-#include <bsp.h>
-#include <mpc8xx/mmu.h>
-
-/*
- * This MMU_TLB_table is used to statically initialize the Table Lookaside
- * Buffers in the MMU of the MPC860 processor.
- *
- * We initialize the entries in both the instruction and data TLBs
- * with the same values - a few bits relevant to the data TLB are unused
- * in the instruction TLB.
- *
- * An Effective Page Number (EPN), Tablewalk Control Register (TWC) and
- * Real Page Number (RPN) value are supplied in the table for each TLB entry.
- *
- * The instruction and data TLBs each can hold 32 entries, so _TLB_Table must
- * not have more than 32 lines in it!
- *
- * We set up the virtual memory map so that virtual address of a
- * location is equal to its real address.
- */
-MMU_TLB_table_t MMU_TLB_table[] = {
- /*
- * DRAM: CS1, Start address 0x00000000, 8M,
- * ASID=0x0, APG=0x0, not guarded memory, copyback data cache policy,
- * R/W,X for supervisor, no ASID comparison, not cache-inhibited.
- * EPN TWC RPN
- */
- { 0x00000200, 0x0D, 0x000001FD } /* DRAM - PS=PS=8M */
-};
-
-/*
- * MMU_N_TLB_Table_Entries is defined here because the size of the
- * MMU_TLB_table is only known in this file.
- */
-int MMU_N_TLB_Table_Entries = ( sizeof(MMU_TLB_table) / sizeof(MMU_TLB_table[0]) );