Back to home page

LXR

 
 

    


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

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /**
0004  * @file
0005  *
0006  * @ingroup RTEMSBSPsPowerPCMPC55XX
0007  *
0008  * @brief Global BSP definitions.
0009  */
0010 
0011 /*
0012  * Copyright (C) 2008, 2012 embedded brains GmbH & Co. KG
0013  *
0014  * Redistribution and use in source and binary forms, with or without
0015  * modification, are permitted provided that the following conditions
0016  * are met:
0017  * 1. Redistributions of source code must retain the above copyright
0018  *    notice, this list of conditions and the following disclaimer.
0019  * 2. Redistributions in binary form must reproduce the above copyright
0020  *    notice, this list of conditions and the following disclaimer in the
0021  *    documentation and/or other materials provided with the distribution.
0022  *
0023  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0024  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0025  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0026  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0027  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0028  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0029  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0030  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0031  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0032  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0033  * POSSIBILITY OF SUCH DAMAGE.
0034  */
0035 
0036 #ifndef LIBBSP_POWERPC_MPC55XXEVB_BSP_H
0037 #define LIBBSP_POWERPC_MPC55XXEVB_BSP_H
0038 
0039 /**
0040  * @defgroup RTEMSBSPsPowerPCMPC55XX NXP MPC55XX and MPC56XX
0041  *
0042  * @ingroup RTEMSBSPsPowerPC
0043  *
0044  * @brief NXP MPC55XX and MPC56XX Board Support Package.
0045  *
0046  * @{
0047  */
0048 
0049 #include <bspopts.h>
0050 
0051 #define BSP_FEATURE_IRQ_EXTENSION
0052 
0053 #define MPC55XX_PERIPHERAL_CLOCK \
0054   (MPC55XX_SYSTEM_CLOCK / MPC55XX_SYSTEM_CLOCK_DIVIDER)
0055 
0056 #ifndef ASM
0057 
0058 #include <rtems.h>
0059 
0060 #include <libcpu/powerpc-utility.h>
0061 
0062 #include <bsp/tictac.h>
0063 #include <bsp/linker-symbols.h>
0064 #include <bsp/default-initial-extension.h>
0065 
0066 #ifdef __cplusplus
0067 extern "C" {
0068 #endif /* __cplusplus */
0069 
0070 /** @brief System clock frequency */
0071 extern unsigned int bsp_clock_speed;
0072 
0073 /** @brief Time base clicks per micro second */
0074 extern uint32_t bsp_clicks_per_usec;
0075 
0076 /** @brief Convert Decrementer ticks to microseconds */
0077 #define BSP_Convert_decrementer( _value ) \
0078   (((unsigned long long) (_value)) / ((unsigned long long)bsp_clicks_per_usec))
0079 
0080 rtems_status_code mpc55xx_sd_card_init( bool mount);
0081 
0082 /* Network driver configuration */
0083 
0084 struct rtems_bsdnet_ifconfig;
0085 
0086 int smsc9218i_attach_detach(
0087   struct rtems_bsdnet_ifconfig *config,
0088   int attaching
0089 );
0090 
0091 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH smsc9218i_attach_detach
0092 
0093 #define RTEMS_BSP_NETWORK_DRIVER_NAME "eth0"
0094 
0095 rtems_status_code bsp_register_i2c(void);
0096 
0097 void bsp_restart(void *addr);
0098 
0099 void *bsp_idle_thread(uintptr_t arg);
0100 
0101 #define BSP_IDLE_TASK_BODY bsp_idle_thread
0102 
0103 LINKER_SYMBOL(bsp_section_dsram_begin)
0104 LINKER_SYMBOL(bsp_section_dsram_end)
0105 LINKER_SYMBOL(bsp_section_dsram_size)
0106 LINKER_SYMBOL(bsp_section_dsram_load_begin)
0107 LINKER_SYMBOL(bsp_section_dsram_load_end)
0108 
0109 #define BSP_DSRAM_SECTION __attribute__((section(".bsp_dsram")))
0110 
0111 LINKER_SYMBOL(bsp_section_sysram_begin)
0112 LINKER_SYMBOL(bsp_section_sysram_end)
0113 LINKER_SYMBOL(bsp_section_sysram_size)
0114 LINKER_SYMBOL(bsp_section_sysram_load_begin)
0115 LINKER_SYMBOL(bsp_section_sysram_load_end)
0116 
0117 #define BSP_SYSRAM_SECTION __attribute__((section(".bsp_sysram")))
0118 
0119 #ifdef __cplusplus
0120 }
0121 #endif /* __cplusplus */
0122 
0123 #endif /* ASM */
0124 
0125 /** @} */
0126 
0127 #endif /* LIBBSP_POWERPC_MPC55XXEVB_BSP_H */