efm32 addons missing file

This commit is contained in:
pnb 2015-09-06 13:10:41 +02:00
parent 9d5f04cd45
commit 55dcbb4ca2
4 changed files with 202 additions and 125 deletions

View File

@ -76,7 +76,44 @@
* Pre-processor Definitions
*******************************************************************************************************************************/
#define DEVINFO ((const struct efm32_devinfo_s *)EFM32_DEVINFO_BASE)
/* MSC Register Offsets ********************************************************************************************************/
#define EFM32_DEVINFO_CAL_OFFSET 0x0000
#define EFM32_DEVINFO_ADC0CALn_OFFSET(n) (0x0004+(n)*4)
#define EFM32_DEVINFO_DAC0CALn_OFFSET(n) (0x0018+(n)*4)
#define EFM32_DEVINFO_AUXHFRCOCALn_OFFSET(n) (0x0024+(n)*4)
#define EFM32_DEVINFO_HFRCOCALn_OFFSET(n) (0x002c+(n)*4)
#define EFM32_DEVINFO_MEMINFO_PAGE_SIZE_OFFSET 0x0034
#define EFM32_DEVINFO_UNIQUEL_OFFSET 0x0040
#define EFM32_DEVINFO_UNIQUEH_OFFSET 0x0044
#define EFM32_DEVINFO_MEMINFO_SIZE_OFFSET 0x0048
#define EFM32_DEVINFO_PART_OFFSET 0x004c
/* MSC Register Addresses ******************************************************************************************************/
#define EFM32_DEVINFO_CAL (EFM32_DEVINFO_BASE+EFM32_DEVINFO_CAL_OFFSET)
#define EFM32_DEVINFO_ADC0CALn(n) (EFM32_DEVINFO_BASE+EFM32_DEVINFO_ADC0CALn_OFFSET(n))
#define EFM32_DEVINFO_ADC0CAL0 (EFM32_DEVINFO_BASE+EFM32_DEVINFO_ADC0CALn_OFFSET(0))
#define EFM32_DEVINFO_ADC0CAL1 (EFM32_DEVINFO_BASE+EFM32_DEVINFO_ADC0CALn_OFFSET(1))
#define EFM32_DEVINFO_ADC0CAL2 (EFM32_DEVINFO_BASE+EFM32_DEVINFO_ADC0CALn_OFFSET(2))
#define EFM32_DEVINFO_DAC0CALn(n) (EFM32_DEVINFO_BASE+EFM32_DEVINFO_DAC0CALn_OFFSET(n))
#define EFM32_DEVINFO_DAC0CAL0 (EFM32_DEVINFO_BASE+EFM32_DEVINFO_DAC0CALn_OFFSET(0))
#define EFM32_DEVINFO_DAC0CAL1 (EFM32_DEVINFO_BASE+EFM32_DEVINFO_DAC0CALn_OFFSET(1))
#define EFM32_DEVINFO_DAC0CAL2 (EFM32_DEVINFO_BASE+EFM32_DEVINFO_DAC0CALn_OFFSET(2))
#define EFM32_DEVINFO_AUXHFRCOCALn(n) (EFM32_DEVINFO_BASE+EFM32_DEVINFO_AUXHFRCOCALn_OFFSET(n))
#define EFM32_DEVINFO_AUXHFRCOCAL0 (EFM32_DEVINFO_BASE+EFM32_DEVINFO_AUXHFRCOCALn_OFFSET(0))
#define EFM32_DEVINFO_AUXHFRCOCAL1 (EFM32_DEVINFO_BASE+EFM32_DEVINFO_AUXHFRCOCALn_OFFSET(1))
#define EFM32_DEVINFO_HFRCOCALn(n) (EFM32_DEVINFO_BASE+EFM32_DEVINFO_HFRCOCALn_OFFSET(n))
#define EFM32_DEVINFO_HFRCOCAL0 (EFM32_DEVINFO_BASE+EFM32_DEVINFO_HFRCOCALn_OFFSET(0))
#define EFM32_DEVINFO_HFRCOCAL1 (EFM32_DEVINFO_BASE+EFM32_DEVINFO_HFRCOCALn_OFFSET(1))
#define EFM32_DEVINFO_MEMINFO_PAGE_SIZE (EFM32_DEVINFO_BASE+EFM32_DEVINFO_MEMINFO_PAGE_SIZE_OFFSET)
#define EFM32_DEVINFO_UNIQUEL (EFM32_DEVINFO_BASE+EFM32_DEVINFO_UNIQUEL_OFFSET)
#define EFM32_DEVINFO_UNIQUEH (EFM32_DEVINFO_BASE+EFM32_DEVINFO_UNIQUEH_OFFSET)
#define EFM32_DEVINFO_MEMINFO_SIZE (EFM32_DEVINFO_BASE+EFM32_DEVINFO_MEMINFO_SIZE_OFFSET)
#define EFM32_DEVINFO_PART (EFM32_DEVINFO_BASE+EFM32_DEVINFO_PART_OFFSET)
/* Bit fields for struct efm32_devinfo_s */
@ -166,10 +203,10 @@
#define _DEVINFO_UNIQUEH_MASK 0xFFFFFFFFUL /* High part of 64-bit device unique number */
#define _DEVINFO_UNIQUEH_SHIFT 0 /* Unique High 32-bit shift */
#define _DEVINFO_MSIZE_SRAM_MASK 0xFFFF0000UL /* Flash size in kilobytes */
#define _DEVINFO_MSIZE_SRAM_SHIFT 16 /* Bit position for flash size */
#define _DEVINFO_MSIZE_FLASH_MASK 0x0000FFFFUL /* SRAM size in kilobytes */
#define _DEVINFO_MSIZE_FLASH_SHIFT 0 /* Bit position for SRAM size */
#define _DEVINFO_MEMINFO_SIZE_SRAM_MASK 0xFFFF0000UL /* Flash size in kilobytes */
#define _DEVINFO_MEMINFO_SIZE_SRAM_SHIFT 16 /* Bit position for flash size */
#define _DEVINFO_MEMINFO_SIZE_FLASH_MASK 0x0000FFFFUL /* SRAM size in kilobytes */
#define _DEVINFO_MEMINFO_SIZE_FLASH_SHIFT 0 /* Bit position for SRAM size */
#define _DEVINFO_PART_PROD_REV_MASK 0xFF000000UL /* Production revision */
#define _DEVINFO_PART_PROD_REV_SHIFT 24 /* Bit position for production revision */
@ -188,26 +225,5 @@
* Public Type Definitions
*******************************************************************************************************************************/
struct efm32_devinfo_s
{
const uint32_t cal; /* Calibration temperature and checksum */
const uint32_t adc0cal0; /* ADC0 Calibration register 0 */
const uint32_t adc0cal1; /* ADC0 Calibration register 1 */
const uint32_t adc0cal2; /* ADC0 Calibration register 2 */
uint32_t reserved0[2]; /* Reserved */
const uint32_t dac0cal0; /* DAC calibration register 0 */
const uint32_t dac0cal1; /* DAC calibration register 1 */
const uint32_t dac0cal2; /* DAC calibration register 2 */
const uint32_t auxhfrcocal0; /* AUXHFRCO calibration register 0 */
const uint32_t auxhfrcocal1; /* AUXHFRCO calibration register 1 */
const uint32_t hfrcocal0; /* HFRCO calibration register 0 */
const uint32_t hfrcocal1; /* HFRCO calibration register 1 */
const uint32_t meminfo; /* Memory information */
uint32_t reserved2[2]; /* Reserved */
const uint32_t uniquel; /* Low 32 bits of device unique number */
const uint32_t uniqueh; /* High 32 bits of device unique number */
const uint32_t msize; /* Flash and SRAM Memory size in KiloBytes */
const uint32_t part; /* Part description */
};
#endif /* __ARCH_ARM_SRC_EFM32_CHIP_EFM32_DEVINFO_H */

View File

@ -0,0 +1,56 @@
/************************************************************************************
* arch/arm/src/efm32/chip/efm32_flash.h
*
* Copyright (C) 2014 Bouteville Pierre-Noel. All rights reserved.
* Author: Bouteville Pierre-Noel <pnb990@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
#ifndef __ARCH_ARM_SRC_EFM32_CHIP_EFM32_FLASH_H
#define __ARCH_ARM_SRC_EFM32_CHIP_EFM32_FLASH_H
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
#if defined(CONFIG_EFM32_EFM32GG)
# define EFM32_FLASH_PAGESIZE 4096
#elif defined(CONFIG_EFM32_EFM32LG)
# define EFM32_FLASH_PAGESIZE 2048
#elif defined(CONFIG_EFM32_EFM32WG)
# define EFM32_FLASH_PAGESIZE 2048
#elif defined(CONFIG_EFM32_EFM32ZG)
# define EFM32_FLASH_PAGESIZE 1024
#elif defined(CONFIG_EFM32_EFM32G)
# define EFM32_FLASH_PAGESIZE 512
#elif defined(CONFIG_EFM32_EFM32TG)
# define EFM32_FLASH_PAGESIZE 512
#endif

View File

@ -544,6 +544,8 @@
#define MSC_LOCK_LOCKKEY_LOCKED (_MSC_LOCK_LOCKKEY_LOCKED << 0) /* Shifted mode LOCKED for MSC_LOCK */
#define MSC_LOCK_LOCKKEY_UNLOCK (_MSC_LOCK_LOCKKEY_UNLOCK << 0) /* Shifted mode UNLOCK for MSC_LOCK */
#define MSC_UNLOCK_CODE 0x1B71 /**< MSC unlock code */
/* Bit fields for MSC CMD */
#if defined(CONFIG_EFM32_EFM32GG)

View File

@ -137,4 +137,7 @@
#define EFM32_CALIBRATE_BASE 0x0fe08000 /* CALIBRATE base address */
#define EFM32_DEVINFO_BASE 0x0fe081b0 /* DEVINFO base address */
#define EFM32_USERDATA_SIZE 0x00000800 /* User data page size */
#define EFM32_USERDATA_NPAGES 1 /* User data page number */
#endif /* __ARCH_ARM_SRC_EFM32_CHIP_EFM32GG_MEMORYMAP_H */