File indexing completed on 2025-05-11 08:23:03
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #ifndef LIBBSP_ARM_LPC24XX_START_CONFIG_H
0037 #define LIBBSP_ARM_LPC24XX_START_CONFIG_H
0038
0039 #include <rtems/score/armv7m.h>
0040
0041 #include <bsp.h>
0042 #include <bsp/io.h>
0043 #include <bsp/start.h>
0044 #include <bsp/lpc-emc.h>
0045
0046 #ifdef __cplusplus
0047 extern "C" {
0048 #endif
0049
0050
0051
0052
0053 #define LPC24XX_PS_TO_CLK(ps, f) \
0054 (((((uint64_t) (ps)) * ((uint64_t) (f))) + 1000000000000ULL - 1ULL) \
0055 / 1000000000000ULL)
0056
0057
0058
0059
0060 #define LPC24XX_PS_TO_EMCCLK(ps, m) \
0061 (LPC24XX_PS_TO_CLK(ps, LPC24XX_EMCCLK) > (m) ? \
0062 LPC24XX_PS_TO_CLK(ps, LPC24XX_EMCCLK) - (m) : 0)
0063
0064 typedef struct {
0065 uint32_t refresh;
0066 uint32_t readconfig;
0067 uint32_t trp;
0068 uint32_t tras;
0069 uint32_t tsrex;
0070 uint32_t tapr;
0071 uint32_t tdal;
0072 uint32_t twr;
0073 uint32_t trc;
0074 uint32_t trfc;
0075 uint32_t txsr;
0076 uint32_t trrd;
0077 uint32_t tmrd;
0078 uint32_t emcdlyctl;
0079 } lpc24xx_emc_dynamic_config;
0080
0081 typedef struct {
0082 volatile lpc_emc_dynamic *chip_select;
0083 uint32_t address;
0084 uint32_t config;
0085 uint32_t rascas;
0086 uint32_t mode;
0087 } lpc24xx_emc_dynamic_chip_config;
0088
0089 typedef struct {
0090 volatile lpc_emc_static *chip_select;
0091 struct {
0092 uint32_t config;
0093 uint32_t waitwen;
0094 uint32_t waitoen;
0095 uint32_t waitrd;
0096 uint32_t waitpage;
0097 uint32_t waitwr;
0098 uint32_t waitrun;
0099 } config;
0100 } lpc24xx_emc_static_chip_config;
0101
0102 extern BSP_START_DATA_SECTION const lpc24xx_pin_range
0103 lpc24xx_start_config_pinsel [];
0104
0105 extern BSP_START_DATA_SECTION const lpc24xx_emc_dynamic_config
0106 lpc24xx_start_config_emc_dynamic [];
0107
0108 extern BSP_START_DATA_SECTION const lpc24xx_emc_dynamic_chip_config
0109 lpc24xx_start_config_emc_dynamic_chip [];
0110
0111 extern BSP_START_DATA_SECTION const size_t
0112 lpc24xx_start_config_emc_dynamic_chip_count;
0113
0114 extern BSP_START_DATA_SECTION const lpc24xx_emc_static_chip_config
0115 lpc24xx_start_config_emc_static_chip [];
0116
0117 extern BSP_START_DATA_SECTION const size_t
0118 lpc24xx_start_config_emc_static_chip_count;
0119
0120 #ifdef ARM_MULTILIB_ARCH_V7M
0121
0122 extern BSP_START_DATA_SECTION const ARMV7M_MPU_Region
0123 lpc24xx_start_config_mpu_region [];
0124
0125 extern BSP_START_DATA_SECTION const size_t
0126 lpc24xx_start_config_mpu_region_count;
0127
0128 #endif
0129
0130 #ifdef __cplusplus
0131 }
0132 #endif
0133
0134 #endif