52 #define DIECFG0 0x400d3014 53 #define DIECFG0_SRAM_SIZE_OFS 7 54 #define DIECFG0_SRAM_SIZE_SZ 3 55 #define DIECFG0_SRAM_SIZE_MSK (((1 << DIECFG0_SRAM_SIZE_SZ) - 1) << \ 56 DIECFG0_SRAM_SIZE_OFS) 57 #define DIECFG2 0x400d301c 58 #define DIECFG2_DIE_REV_OFS 8 59 #define DIECFG2_DIE_REV_SZ 8 60 #define DIECFG2_DIE_REV_MSK (((1 << DIECFG2_DIE_REV_SZ) - 1) << \ 62 #define DIECFG2_AES_EN 0x00000002 63 #define DIECFG2_PKA_EN 0x00000001 67 #define LOG_MODULE "CC2538 SoC" 68 #define LOG_LEVEL LOG_LEVEL_NONE 73 uint8_t rev = (REG(DIECFG2) & DIECFG2_DIE_REV_MSK) >> DIECFG2_DIE_REV_OFS;
84 uint32_t size_code = (REG(DIECFG0) & DIECFG0_SRAM_SIZE_MSK) >>
85 DIECFG0_SRAM_SIZE_OFS;
87 return size_code <= 1 ? (2 - size_code) << 13 : 32 << 10;
93 return REG(DIECFG2) & (DIECFG2_AES_EN | DIECFG2_PKA_EN);
102 LOG_DBG(
"CC2538: ID: 0x%04lx, rev.: PG%d.%d, Flash: %lu KiB, " 103 "SRAM: %lu KiB, AES/SHA: %u, ECC/RSA: %u\n" 104 "System clock: %lu Hz\n" 105 "I/O clock: %lu Hz\n" 107 rom_util_get_chip_id(),
108 rev >> 4, rev & 0x0f,
109 rom_util_get_flash_size() >> 10,
Header file for the ARM Nested Vectored Interrupt Controller.
Header file for the cc2538 System Control driver.
const char * sys_ctrl_get_reset_cause_str(void)
Gets a string describing the cause of the last reset.
void nvic_init()
Initialises the NVIC driver.
void ioc_init()
Initialise the IOC driver.
uint32_t sys_ctrl_get_io_clock(void)
Returns the actual io clock in Hz.
Header file with register, macro and function declarations for the cc2538 low power module...
Header file with declarations for the I/O Control module.
void soc_print_info(void)
Prints SoC information.
uint8_t soc_get_rev(void)
Gets the SoC revision.
Header file with register manipulation macro definitions.
void gpio_hal_init()
Initialise the GPIO HAL.
#define SOC_FEATURE_ECC_RSA
Security HW ECC/RSA.
void soc_init()
Common initialisation routine for all CC2538-based platforms.
uint32_t sys_ctrl_get_sys_clock(void)
Returns the actual system clock in Hz.
uint32_t soc_get_features(void)
Gets the hardware features of the SoC that are enabled.
Header file with macro and function declarations for the cc2538 SoC.
void sys_ctrl_init()
Initialises the System Control Driver.
uint32_t soc_get_sram_size(void)
Gets the SRAM size of the SoC.
Header file for the cc2538 ROM utility function library driver.
void lpm_init()
Initialise the low-power mode management module.
Header file for the GPIO HAL.
Header file for the logging system
void rtimer_init(void)
Initialize the real-time scheduler.
void clock_init(void)
Arch-specific implementation of clock_init for the cc2538.
#define SOC_FEATURE_AES_SHA
Security HW AES/SHA.