FreeCalypso > hg > freecalypso-sw
changeset 160:dbfc9ff4e8d2
gsm-fw: starting to compile RTC code
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sun, 17 Nov 2013 22:52:52 +0000 |
parents | 3c42e6e5fc04 |
children | 98be4841eeb7 |
files | gsm-fw/bsp/Makefile gsm-fw/bsp/rtc/Makefile gsm-fw/bsp/rtc/rtc_api.h gsm-fw/bsp/rtc/rtc_config.h gsm-fw/bsp/rtc/rtc_env.c gsm-fw/bsp/rtc/rtc_env.h gsm-fw/bsp/rtc/rtc_functions.c gsm-fw/bsp/rtc/rtc_i.h gsm-fw/bsp/rtc/rtc_messages_i.h gsm-fw/riviera/rvf/rvf_pool_size.h |
diffstat | 10 files changed, 175 insertions(+), 146 deletions(-) [+] |
line wrap: on
line diff
--- a/gsm-fw/bsp/Makefile Sun Nov 17 22:10:10 2013 +0000 +++ b/gsm-fw/bsp/Makefile Sun Nov 17 22:52:52 2013 +0000 @@ -13,7 +13,7 @@ HDRS= armio.h clkm.h dma.h inth.h iq.h mem.h rhea_arm.h sim.h timer.h \ timer1.h timer2.h ulpd.h -SUBDIR= abb+spi +SUBDIR= abb+spi rtc all: ${IOBJS} ${XOBJS} ${SUBDIR} xipcode.o
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gsm-fw/bsp/rtc/Makefile Sun Nov 17 22:52:52 2013 +0000 @@ -0,0 +1,18 @@ +CC= arm-elf-gcc +CFLAGS= -O2 -fno-builtin -mthumb-interwork -mthumb +LD= arm-elf-ld + +OBJS= rtc_env.o + +HDRS= rtc_api.h rtc_config.h rtc_env.h rtc_i.h rtc_messages_i.h \ + rtc_pool_size.h + +all: xipcode.o + +${OBJS}: ${HDRS} + +xipcode.o: ${OBJS} + ${LD} -r -o $@ ${OBJS} + +clean: + rm -f *.[oa] *errs
--- a/gsm-fw/bsp/rtc/rtc_api.h Sun Nov 17 22:10:10 2013 +0000 +++ b/gsm-fw/bsp/rtc/rtc_api.h Sun Nov 17 22:52:52 2013 +0000 @@ -1,44 +1,44 @@ -/********************************************************************************/ -/* */ -/* File Name: rtc_functions.h */ -/* */ -/* Purpose: This file contains prototypes of RTC's internal functions. */ -/* */ -/* Note: None. */ -/* */ -/* Revision History: */ -/* 03/20/01 Laurent Sollier Create. */ -/* */ -/* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved */ -/* */ -/********************************************************************************/ +/******************************************************************************/ +/* */ +/* File Name: rtc_functions.h */ +/* */ +/* Purpose: This file contains prototypes of RTC's internal functions. */ +/* */ +/* Note: None. */ +/* */ +/* Revision History: */ +/* 03/20/01 Laurent Sollier Create. */ +/* */ +/* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved */ +/* */ +/******************************************************************************/ #ifndef _RTC_FUNCTIONS_H_ #define _RTC_FUNCTIONS_H_ -#include "rvf/rvf_api.h" +#include "../../riviera/rvf/rvf_api.h" -/********************************************************************************/ -/* */ -/* Generic functions declarations. */ -/* */ -/********************************************************************************/ +/******************************************************************************/ +/* */ +/* Generic functions declarations. */ +/* */ +/******************************************************************************/ /* Structure containing date and time */ -typedef struct { UINT8 second; /* seconds after the minute - [0,59] */ - UINT8 minute; /* minutes after the hour - [0,59] */ - UINT8 hour; /* hours after the midnight - [0,23] */ - UINT8 day; /* day of the month - [1,31] */ - UINT8 month; /* months - [01,12] */ - UINT8 year; /* years - [00,99] */ - UINT8 wday; /* days in a week - [0,6] */ - BOOL mode_12_hour; /* TRUE->12 hour mode ; FALSE-> 24 hour mode */ - BOOL PM_flag; /* if 12 hour flag = TRUE - TRUE->PM ; FALSE->AM */ - } T_RTC_DATE_TIME; +typedef struct { + UINT8 second; /* seconds after the minute - [0,59] */ + UINT8 minute; /* minutes after the hour - [0,59] */ + UINT8 hour; /* hours after the midnight - [0,23] */ + UINT8 day; /* day of the month - [1,31] */ + UINT8 month; /* months - [01,12] */ + UINT8 year; /* years - [00,99] */ + UINT8 wday; /* days in a week - [0,6] */ + BOOL mode_12_hour; /* TRUE->12 hour mode ; FALSE-> 24 hour mode */ + BOOL PM_flag; /* if 12 hour flag = TRUE: TRUE->PM ; FALSE->AM */ +} T_RTC_DATE_TIME; /*******************************************************************************
--- a/gsm-fw/bsp/rtc/rtc_config.h Sun Nov 17 22:10:10 2013 +0000 +++ b/gsm-fw/bsp/rtc/rtc_config.h Sun Nov 17 22:52:52 2013 +0000 @@ -1,51 +1,65 @@ -/********************************************************************************/ -/* */ -/* File Name: rtc_config.h */ -/* */ -/* Purpose: This file contains adresses for RTC register access. */ -/* and defined value */ -/* */ -/* Note: None. */ -/* */ -/* Revision History: */ -/* 05/31/01 Laurent Sollier Create. */ -/* */ -/* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved */ -/* */ -/********************************************************************************/ +/******************************************************************************/ +/* */ +/* File Name: rtc_config.h */ +/* */ +/* Purpose: This file contains adresses for RTC register access. */ +/* and defined value */ +/* */ +/* Note: None. */ +/* */ +/* Revision History: */ +/* 05/31/01 Laurent Sollier Create. */ +/* */ +/* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved */ +/* */ +/******************************************************************************/ #ifndef _RTC_CONFIG_H_ #define _RTC_CONFIG_H_ -#ifndef _WINDOWS - #include "chipset.cfg" -#endif +#include "../../include/config.h" - -#include "memif/mem.h" -#include "rv/general.h" - +#include "../mem.h" +#include "../../riviera/rv/general.h" /* FOR ULYSSE AND CALYPSO CHIP */ -#define RTC_SECONDS_REG (UINT8 *)(RTC_XIO_START) /* Seconds register */ -#define RTC_MINUTES_REG ((UINT8 *)(RTC_XIO_START) + 0x01) /* Minutes register */ -#define RTC_HOURS_REG ((UINT8 *)(RTC_XIO_START) + 0x02) /* Hours register */ -#define RTC_DAYS_REG ((UINT8 *)(RTC_XIO_START) + 0x03) /* Days register */ -#define RTC_MONTHS_REG ((UINT8 *)(RTC_XIO_START) + 0x04) /* Months register */ -#define RTC_YEARS_REG ((UINT8 *)(RTC_XIO_START) + 0x05) /* Years register */ -#define RTC_WEEK_REG ((UINT8 *)(RTC_XIO_START) + 0x06) /* Week register */ -#define RTC_ALARM_SECONDS_REG ((UINT8 *)(RTC_XIO_START) + 0x08) /* Alarms seconds register */ -#define RTC_ALARM_MINUTES_REG ((UINT8 *)(RTC_XIO_START) + 0x09) /* Alarms minutes register */ -#define RTC_ALARM_HOURS_REG ((UINT8 *)(RTC_XIO_START) + 0x0A) /* Alarms hours register */ -#define RTC_ALARM_DAYS_REG ((UINT8 *)(RTC_XIO_START) + 0x0B) /* Alarms days register */ -#define RTC_ALARM_MONTHS_REG ((UINT8 *)(RTC_XIO_START) + 0x0C) /* Alarms months register */ -#define RTC_ALARM_YEARS_REG ((UINT8 *)(RTC_XIO_START) + 0x0D) /* Alarms years register */ -#define RTC_CTRL_REG ((UINT8 *)(RTC_XIO_START) + 0x10) /* Control register */ -#define RTC_STATUS_REG ((UINT8 *)(RTC_XIO_START) + 0x11) /* Status register */ -#define RTC_INTERRUPTS_REG ((UINT8 *)(RTC_XIO_START) + 0x12) /* Interrupts register */ -#define RTC_COMP_LSB_REG ((UINT8 *)(RTC_XIO_START) + 0x13) /* LSB compensation register */ -#define RTC_COMP_MSB_REG ((UINT8 *)(RTC_XIO_START) + 0x14) /* MSB compensation register */ + /* Seconds register */ +#define RTC_SECONDS_REG (UINT8 *)(RTC_XIO_START) + /* Minutes register */ +#define RTC_MINUTES_REG ((UINT8 *)(RTC_XIO_START) + 0x01) + /* Hours register */ +#define RTC_HOURS_REG ((UINT8 *)(RTC_XIO_START) + 0x02) + /* Days register */ +#define RTC_DAYS_REG ((UINT8 *)(RTC_XIO_START) + 0x03) + /* Months register */ +#define RTC_MONTHS_REG ((UINT8 *)(RTC_XIO_START) + 0x04) + /* Years register */ +#define RTC_YEARS_REG ((UINT8 *)(RTC_XIO_START) + 0x05) + /* Week register */ +#define RTC_WEEK_REG ((UINT8 *)(RTC_XIO_START) + 0x06) + /* Alarms seconds register */ +#define RTC_ALARM_SECONDS_REG ((UINT8 *)(RTC_XIO_START) + 0x08) + /* Alarms minutes register */ +#define RTC_ALARM_MINUTES_REG ((UINT8 *)(RTC_XIO_START) + 0x09) + /* Alarms hours register */ +#define RTC_ALARM_HOURS_REG ((UINT8 *)(RTC_XIO_START) + 0x0A) + /* Alarms days register */ +#define RTC_ALARM_DAYS_REG ((UINT8 *)(RTC_XIO_START) + 0x0B) + /* Alarms months register */ +#define RTC_ALARM_MONTHS_REG ((UINT8 *)(RTC_XIO_START) + 0x0C) + /* Alarms years register */ +#define RTC_ALARM_YEARS_REG ((UINT8 *)(RTC_XIO_START) + 0x0D) + /* Control register */ +#define RTC_CTRL_REG ((UINT8 *)(RTC_XIO_START) + 0x10) + /* Status register */ +#define RTC_STATUS_REG ((UINT8 *)(RTC_XIO_START) + 0x11) + /* Interrupts register */ +#define RTC_INTERRUPTS_REG ((UINT8 *)(RTC_XIO_START) + 0x12) + /* LSB compensation register */ +#define RTC_COMP_LSB_REG ((UINT8 *)(RTC_XIO_START) + 0x13) + /* MSB compensation register */ +#define RTC_COMP_MSB_REG ((UINT8 *)(RTC_XIO_START) + 0x14) /* RTC Control register description */ @@ -56,31 +70,31 @@ #define RTC_TEST_MODE 0x0010 /* Test mode */ #define RTC_SET_32_COUNTER 0x0020 /* set 32 KHz counter with comp_reg */ #if ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || (CHIPSET == 11)) - #define RTC_nDELTA_OMEGA 0x0040 /* Analog Baseband Type */ + #define RTC_nDELTA_OMEGA 0x0040 /* Analog Baseband Type */ #endif /* RTC Interrupt register description */ -#define RTC_EVERY 0x0003 /* Define period of periodic interrupt - (second, minute, hour, day) */ +#define RTC_EVERY 0x0003 + /* Define period of periodic interrupt (second, minute, hour, day) */ #define RTC_IT_TIMER 0x0004 /* Enable periodic interrupt */ #define RTC_IT_ALARM 0x0008 /* Alarm interrupt enabled or not */ /* RTC Status register description */ -#define RTC_BUSY 0x0001 +#define RTC_BUSY 0x0001 #define RTC_RUN 0x0002 /* RTC is running */ #define RTC_1S_EVENT 0x0004 /* One second has occured */ -#define RTC_1M_EVENT 0x0008 /* One minute has occured */ +#define RTC_1M_EVENT 0x0008 /* One minute has occured */ #define RTC_1H_EVENT 0x0010 /* One hour has occured */ #define RTC_1D_EVENT 0x0020 /* One day has occrued */ -#define RTC_ALARM 0x0040 /* Alarm interrupt has been generated */ +#define RTC_ALARM 0x0040 /* Alarm interrupt has been generated */ #define RTC_POWER_UP 0x0080 /* Indicates that a reset occured */ #define RTC_EVERY_SEC 0x0000 #define RTC_EVERY_MIN 0x0001 -#define RTC_EVERY_HR 0x0002 +#define RTC_EVERY_HR 0x0002 #define RTC_EVERY_DAY 0x0003 /* 32 Khz and HF clock definition */
--- a/gsm-fw/bsp/rtc/rtc_env.c Sun Nov 17 22:10:10 2013 +0000 +++ b/gsm-fw/bsp/rtc/rtc_env.c Sun Nov 17 22:52:52 2013 +0000 @@ -1,27 +1,27 @@ -/********************************************************************************/ -/* */ -/* File Name: rtc_env.c */ -/* */ -/* Purpose: This file contains routines that will be called in order */ -/* to: */ -/* - notify the Riviera manager of the RTC's Memory */ -/* Banks requirements, */ -/* - initialize all the RTC's data structures, */ -/* */ -/* Note: None. */ -/* */ -/* Revision History: */ -/* 03/22/01 Laurent Sollier Create. */ -/* */ -/* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved */ -/* */ -/********************************************************************************/ +/******************************************************************************/ +/* */ +/* File Name: rtc_env.c */ +/* */ +/* Purpose: This file contains routines that will be called in order */ +/* to: */ +/* - notify the Riviera manager of the RTC's Memory */ +/* Banks requirements, */ +/* - initialize all the RTC's data structures, */ +/* */ +/* Note: None. */ +/* */ +/* Revision History: */ +/* 03/22/01 Laurent Sollier Create. */ +/* */ +/* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved */ +/* */ +/******************************************************************************/ -#include "rvm/rvm_priorities.h" -#include "rvm/rvm_use_id_list.h" -#include "rtc/rtc_env.h" -#include "rtc/rtc_i.h" -#include "rtc/rtc_api.h" +#include "../../riviera/rvm/rvm_priorities.h" +#include "../../riviera/rvm/rvm_use_id_list.h" +#include "rtc_env.h" +#include "rtc_i.h" +#include "rtc_api.h" #include <string.h> @@ -58,7 +58,7 @@ { /* SWE info */ swe_info->swe_type = RVM_SWE_TYPE_4; - swe_info->type_info.type4.swe_use_id = RTC_USE_ID; + swe_info->type_info.type4.swe_use_id = RTC_USE_ID; memcpy( swe_info->type_info.type4.swe_name, "RTC", sizeof("RTC") ); swe_info->type_info.type4.stack_size = RTC_STACK_SIZE; @@ -209,4 +209,4 @@ rvf_free_buf ((void *) rtc_env_ctrl_blk); return RV_OK; -} \ No newline at end of file +}
--- a/gsm-fw/bsp/rtc/rtc_env.h Sun Nov 17 22:10:10 2013 +0000 +++ b/gsm-fw/bsp/rtc/rtc_env.h Sun Nov 17 22:52:52 2013 +0000 @@ -19,9 +19,9 @@ #define __RTC_ENV_H_ -#include "rvm/rvm_gen.h" +#include "../../riviera/rvm/rvm_gen.h" -#include "rtc/rtc_pool_size.h" /* Stack & Memory Bank sizes definitions */ +#include "rtc_pool_size.h" /* Stack & Memory Bank sizes definitions */ /* memory bank size and watermark */ @@ -47,4 +47,3 @@ #endif /*__RTC_ENV_H_*/ -
--- a/gsm-fw/bsp/rtc/rtc_functions.c Sun Nov 17 22:10:10 2013 +0000 +++ b/gsm-fw/bsp/rtc/rtc_functions.c Sun Nov 17 22:52:52 2013 +0000 @@ -1,14 +1,13 @@ -/************************************************************************************/ -/* rtc_functions.c : contains low level function for the rtc */ -/* */ -/* */ -/* Author: Laurent Sollier */ -/* */ -/* version: 1.0 */ -/* */ -/* Date: 03/20/01 */ -/* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved */ -/************************************************************************************/ +/******************************************************************************/ +/* rtc_functions.c : contains low level function for the rtc */ +/* */ +/* */ +/* Author: Laurent Sollier */ +/* */ +/* version: 1.0 */ +/* */ +/* Date: 03/20/01 */ +/******************************************************************************/ #ifndef _WINDOWS #include "l1sw.cfg"
--- a/gsm-fw/bsp/rtc/rtc_i.h Sun Nov 17 22:10:10 2013 +0000 +++ b/gsm-fw/bsp/rtc/rtc_i.h Sun Nov 17 22:52:52 2013 +0000 @@ -1,36 +1,36 @@ -/********************************************************************************/ -/* */ -/* File Name: rtc_i.h */ -/* */ -/* Purpose: This file contains the structures, constants and prototypes */ -/* dedicated to RTC. */ -/* */ -/* Note: None. */ -/* */ -/* Revision History: */ -/* 03/20/01 Laurent Sollier Create. */ -/* */ -/* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved */ -/* */ -/********************************************************************************/ +/******************************************************************************/ +/* */ +/* File Name: rtc_i.h */ +/* */ +/* Purpose: This file contains the structures, constants and prototypes */ +/* dedicated to RTC. */ +/* */ +/* Note: None. */ +/* */ +/* Revision History: */ +/* 03/20/01 Laurent Sollier Create. */ +/* */ +/* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved */ +/* */ +/******************************************************************************/ #ifndef _RTC_I_H_ #define _RTC_I_H_ -#include "rvm/rvm_gen.h" -#include "rvf/rvf_api.h" +#include "../../riviera/rvm/rvm_gen.h" +#include "../../riviera/rvf/rvf_api.h" -/********************************************************************************/ -/* */ -/* Define a structure used to store all the informations related to RTC's task*/ -/* & MBs identifiers. */ -/* */ -/********************************************************************************/ +/******************************************************************************/ +/* */ +/* Define a structure used to store all the informations related to RTC's task*/ +/* & MBs identifiers. */ +/* */ +/******************************************************************************/ typedef struct { T_RVF_MB_ID prim_id; - T_RVF_ADDR_ID addr_id; + T_RVF_ADDR_ID addr_id; void* msg_alarm_event; } T_RTC_ENV_CTRL_BLK;
--- a/gsm-fw/bsp/rtc/rtc_messages_i.h Sun Nov 17 22:10:10 2013 +0000 +++ b/gsm-fw/bsp/rtc/rtc_messages_i.h Sun Nov 17 22:52:52 2013 +0000 @@ -19,8 +19,8 @@ #define __RTC_MESSAGES_H_ -#include "rv/rv_general.h" -#include "rvf/rvf_api.h" +#include "../../riviera/rv/rv_general.h" +#include "../../riviera/rvf/rvf_api.h" #ifdef __cplusplus extern "C" @@ -57,4 +57,3 @@ #endif /* __RTC_MESSAGES_H_ */ -
--- a/gsm-fw/riviera/rvf/rvf_pool_size.h Sun Nov 17 22:10:10 2013 +0000 +++ b/gsm-fw/riviera/rvf/rvf_pool_size.h Sun Nov 17 22:52:52 2013 +0000 @@ -403,7 +403,7 @@ * RTC SWE */ #ifdef RVM_RTC_SWE - #include "rtc/rtc_pool_size.h" + #include "../../bsp/rtc/rtc_pool_size.h" #define RVF_RTC_POOL_SIZE (RTC_POOL_SIZE) #else #define RVF_RTC_POOL_SIZE (0)