Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:59

0001 /**
0002  * @file
0003  *
0004  * @ingroup RTEMSBSPsPowerPCTQM8XX
0005  *
0006  * @brief Global BSP definitions.
0007  */
0008 
0009 /*
0010  *  RTEMS TQM8xx BSP
0011  *  This include file contains all board IO definitions.
0012  */
0013 
0014 /*
0015  *  COPYRIGHT (c) 1989-2008.
0016  *  On-Line Applications Research Corporation (OAR).
0017  *
0018  *  Copyright (c) 2008 Thomas Doerfler, embedded brains GmbH & Co. KG
0019  *  All rights reserved.
0020  *
0021  *  The license and distribution terms for this file may be
0022  *  found in the file LICENSE in this distribution or at
0023  *  http://www.rtems.org/license/LICENSE.
0024  */
0025 
0026 #ifndef LIBBSP_POWERPC_TQM8XX_BSP_H
0027 #define LIBBSP_POWERPC_TQM8XX_BSP_H
0028 
0029 /**
0030  * @defgroup RTEMSBSPsPowerPCTQM8XX TQM8XX
0031  *
0032  * @ingroup RTEMSBSPsPowerPC
0033  *
0034  * @brief TQM8XX Board Support Package.
0035  *
0036  * @{
0037  */
0038 
0039 /*
0040  * indicate, that BSP is booted via TQMMon
0041  */
0042 #define BSP_HAS_TQMMON
0043 
0044 #include <libcpu/powerpc-utility.h>
0045 
0046 LINKER_SYMBOL(TopRamReserved);
0047 
0048 LINKER_SYMBOL( bsp_ram_start);
0049 LINKER_SYMBOL( bsp_ram_end);
0050 LINKER_SYMBOL( bsp_ram_size);
0051 
0052 LINKER_SYMBOL( bsp_rom_start);
0053 LINKER_SYMBOL( bsp_rom_end);
0054 LINKER_SYMBOL( bsp_rom_size);
0055 
0056 LINKER_SYMBOL( bsp_section_text_start);
0057 LINKER_SYMBOL( bsp_section_text_end);
0058 LINKER_SYMBOL( bsp_section_text_size);
0059 
0060 LINKER_SYMBOL( bsp_section_data_start);
0061 LINKER_SYMBOL( bsp_section_data_end);
0062 LINKER_SYMBOL( bsp_section_data_size);
0063 
0064 LINKER_SYMBOL( bsp_section_bss_start);
0065 LINKER_SYMBOL( bsp_section_bss_end);
0066 LINKER_SYMBOL( bsp_section_bss_size);
0067 
0068 LINKER_SYMBOL( bsp_work_area_start);
0069 
0070 #ifndef ASM
0071 
0072 #include <bspopts.h>
0073 
0074 #include <rtems.h>
0075 #include <rtems/irq.h>
0076 #include <mpc8xx.h>
0077 #include <mpc8xx/cpm.h>
0078 #include <mpc8xx/mmu.h>
0079 #include <mpc8xx/console.h>
0080 #include <bsp/vectors.h>
0081 #include <bsp/tqm.h>
0082 #include <libcpu/powerpc-utility.h>
0083 #include <bsp/default-initial-extension.h>
0084 
0085 #ifdef __cplusplus
0086 extern "C" {
0087 #endif
0088 
0089 /*
0090  * Network driver configuration
0091  */
0092 struct rtems_bsdnet_ifconfig;
0093 
0094 #if BSP_USE_NETWORK_FEC
0095 extern int rtems_fec_enet_driver_attach (struct rtems_bsdnet_ifconfig *config,
0096                      int attaching);
0097 #define RTEMS_BSP_FEC_NETWORK_DRIVER_NAME   "fec1"
0098 #define RTEMS_BSP_FEC_NETWORK_DRIVER_ATTACH rtems_fec_enet_driver_attach
0099 #endif
0100 
0101 #if BSP_USE_NETWORK_SCC
0102 extern int rtems_scc_enet_driver_attach (struct rtems_bsdnet_ifconfig *config,
0103                      int attaching);
0104 #define RTEMS_BSP_SCC_NETWORK_DRIVER_NAME   "scc1"
0105 #define RTEMS_BSP_SCC_NETWORK_DRIVER_ATTACH rtems_scc_enet_driver_attach
0106 #endif
0107 
0108 #if BSP_USE_NETWORK_FEC
0109 #define RTEMS_BSP_NETWORK_DRIVER_NAME   RTEMS_BSP_FEC_NETWORK_DRIVER_NAME
0110 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH RTEMS_BSP_FEC_NETWORK_DRIVER_ATTACH
0111 #elif BSP_USE_NETWORK_SCC
0112 #define RTEMS_BSP_NETWORK_DRIVER_NAME   RTEMS_BSP_SCC_NETWORK_DRIVER_NAME
0113 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH RTEMS_BSP_SCC_NETWORK_DRIVER_ATTACH
0114 #endif
0115 /*
0116  * We need to decide how much memory will be non-cacheable. This
0117  * will mainly be memory that will be used in DMA (network and serial
0118  * buffers).
0119  */
0120 #define NOCACHE_MEM_SIZE 512*1024
0121 
0122 /*
0123  * indicate, that BSP has IDE driver
0124  */
0125 #undef RTEMS_BSP_HAS_IDE_DRIVER
0126 
0127 /*
0128  * SPI driver configuration
0129  */
0130 
0131   /* select values for SPI addressing */
0132 #define PGHPLUS_SPI_ADDR_EEPROM 0
0133 #define PGHPLUS_SPI_ADDR_DISP4  1
0134   /* NOTE: DISP4 occupies two consecutive addresses for data and control port */
0135 #define PGHPLUS_SPI_ADDR_DISP4_DATA  (PGHPLUS_SPI_ADDR_DISP4)
0136 #define PGHPLUS_SPI_ADDR_DISP4_CTRL  (PGHPLUS_SPI_ADDR_DISP4_DATA+1)
0137 
0138   /* bit masks for Port B lines */
0139 #define PGHPLUS_PB_SPI_EEP_CE_MSK     (1<< 0)
0140 #define PGHPLUS_PB_SPI_DISP4_RS_MSK   (1<<15)
0141 #define PGHPLUS_PB_SPI_DISP4_CE_MSK   (1<<14)
0142 
0143 /*
0144  * our (internal) bus frequency
0145  */
0146 extern uint32_t BSP_bus_frequency;
0147 
0148 /*
0149  *  Interfaces to required Clock Driver support methods
0150  */
0151 int BSP_disconnect_clock_handler(void);
0152 int BSP_connect_clock_handler (rtems_irq_hdl);
0153 
0154 extern uint32_t bsp_clock_speed;
0155 
0156 char serial_getc(void);
0157 
0158 int serial_tstc(void);
0159 
0160 void serial_init(void);
0161 
0162 int mbx8xx_console_get_configuration(void);
0163 
0164 void _InitTQM8xx (void);
0165 
0166 rtems_status_code bsp_register_spi(void);
0167 
0168 void *bsp_idle_thread( uintptr_t ignored );
0169 
0170 void cpu_init(void);
0171 
0172 #ifdef __cplusplus
0173 }
0174 #endif
0175 
0176 #endif
0177 
0178 /** @} */
0179 
0180 #endif