From efb4b858e24de48823be8c7ef1dbdebb140bfbe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Thu, 25 Jun 2015 22:37:22 +0200 Subject: [PATCH] cc2538: Define the flash memory organization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Define the flash memory page and word sizes. These definitions are grouped with the flash lock bit page and CCA definitions, so flash-cca.h is renamed to flash.h. Signed-off-by: Benoît Thébaudeau --- cpu/cc2538/Makefile.cc2538 | 2 +- cpu/cc2538/dev/{flash-cca.h => flash.h} | 20 +++++++++++++------- cpu/cc2538/startup-gcc.c | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) rename cpu/cc2538/dev/{flash-cca.h => flash.h} (91%) diff --git a/cpu/cc2538/Makefile.cc2538 b/cpu/cc2538/Makefile.cc2538 index b555d7e8f..bb70be6b5 100644 --- a/cpu/cc2538/Makefile.cc2538 +++ b/cpu/cc2538/Makefile.cc2538 @@ -111,7 +111,7 @@ CUSTOM_RULE_LINK=1 LDGENFLAGS += $(addprefix -D,$(subst $(COMMA), ,$(DEFINES))) LDGENFLAGS += $(addprefix -I,$(SOURCEDIRS)) LDGENFLAGS += -imacros "contiki-conf.h" -imacros "dev/cc2538-dev.h" -LDGENFLAGS += -imacros "dev/flash-cca.h" +LDGENFLAGS += -imacros "dev/flash.h" LDGENFLAGS += -x c -P -E # NB: Assumes LDSCRIPT was not overridden and is in $(OBJECTDIR) diff --git a/cpu/cc2538/dev/flash-cca.h b/cpu/cc2538/dev/flash.h similarity index 91% rename from cpu/cc2538/dev/flash-cca.h rename to cpu/cc2538/dev/flash.h index bbd5074be..6af19723e 100644 --- a/cpu/cc2538/dev/flash-cca.h +++ b/cpu/cc2538/dev/flash.h @@ -36,22 +36,28 @@ * \addtogroup cc2538 * @{ * - * \defgroup cc2538-flash-cca cc2538 flash CCA + * \defgroup cc2538-flash cc2538 flash memory * - * Definitions for the cc2538 flash lock bit page and customer configuration - * area + * Definitions for the cc2538 flash memory * @{ * * \file - * Header file for the flash lock bit page and CCA definitions + * Header file for the flash memory definitions */ -#ifndef FLASH_CCA_H_ -#define FLASH_CCA_H_ +#ifndef FLASH_H_ +#define FLASH_H_ #include "dev/cc2538-dev.h" #include /*---------------------------------------------------------------------------*/ +/** \name Flash memory organization + * @{ + */ +#define FLASH_PAGE_SIZE 2048 +#define FLASH_WORD_SIZE 4 +/** @} */ +/*---------------------------------------------------------------------------*/ /** \name Flash lock bit page and CCA location * @{ */ @@ -95,7 +101,7 @@ typedef struct { } flash_cca_lock_page_t; /** @} */ -#endif /* FLASH_CCA_H_ */ +#endif /* FLASH_H_ */ /** * @} diff --git a/cpu/cc2538/startup-gcc.c b/cpu/cc2538/startup-gcc.c index 0c0da7104..35c2329d2 100644 --- a/cpu/cc2538/startup-gcc.c +++ b/cpu/cc2538/startup-gcc.c @@ -38,7 +38,7 @@ */ #include "contiki.h" #include "reg.h" -#include "flash-cca.h" +#include "flash.h" #include "sys-ctrl.h" #include "rom-util.h"