aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorutzig <utzig@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-09-01 01:02:07 +0000
committerutzig <utzig@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-09-01 01:02:07 +0000
commit7132c002eb698230e3a3b59eace00d87e6b19107 (patch)
tree6211af117f5f24ef5c1a2043d7b889149ffd7636
parent2ed2fd66ec26af7bece0a5a560b641b88db8a947 (diff)
downloadChibiOS-7132c002eb698230e3a3b59eace00d87e6b19107.tar.gz
ChibiOS-7132c002eb698230e3a3b59eace00d87e6b19107.tar.bz2
ChibiOS-7132c002eb698230e3a3b59eace00d87e6b19107.zip
[KINETIS] Add flash protection defaults to HAL
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7222 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--os/hal/ports/KINETIS/K20x/hal_lld.c21
-rw-r--r--os/hal/ports/KINETIS/KL2x/hal_lld.c21
2 files changed, 42 insertions, 0 deletions
diff --git a/os/hal/ports/KINETIS/K20x/hal_lld.c b/os/hal/ports/KINETIS/K20x/hal_lld.c
index 0ca58d0a0..471e23b80 100644
--- a/os/hal/ports/KINETIS/K20x/hal_lld.c
+++ b/os/hal/ports/KINETIS/K20x/hal_lld.c
@@ -37,6 +37,27 @@
/* Driver local variables and types. */
/*===========================================================================*/
+__attribute__ ((section(".cfmconfig")))
+const uint8_t _cfm[0x10] = {
+ 0xFF, /* NV_BACKKEY3: KEY=0xFF */
+ 0xFF, /* NV_BACKKEY2: KEY=0xFF */
+ 0xFF, /* NV_BACKKEY1: KEY=0xFF */
+ 0xFF, /* NV_BACKKEY0: KEY=0xFF */
+ 0xFF, /* NV_BACKKEY7: KEY=0xFF */
+ 0xFF, /* NV_BACKKEY6: KEY=0xFF */
+ 0xFF, /* NV_BACKKEY5: KEY=0xFF */
+ 0xFF, /* NV_BACKKEY4: KEY=0xFF */
+ 0xFF, /* NV_FPROT3: PROT=0xFF */
+ 0xFF, /* NV_FPROT2: PROT=0xFF */
+ 0xFF, /* NV_FPROT1: PROT=0xFF */
+ 0xFF, /* NV_FPROT0: PROT=0xFF */
+ 0x7E, /* NV_FSEC: KEYEN=1,MEEN=3,FSLACC=3,SEC=2 */
+ 0xFF, /* NV_FOPT: ??=1,??=1,FAST_INIT=1,LPBOOT1=1,RESET_PIN_CFG=1,
+ NMI_DIS=1,EZPORT_DIS=1,LPBOOT0=1 */
+ 0xFF,
+ 0xFF
+};
+
/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/
diff --git a/os/hal/ports/KINETIS/KL2x/hal_lld.c b/os/hal/ports/KINETIS/KL2x/hal_lld.c
index 9909f2bd5..63773936f 100644
--- a/os/hal/ports/KINETIS/KL2x/hal_lld.c
+++ b/os/hal/ports/KINETIS/KL2x/hal_lld.c
@@ -37,6 +37,27 @@
/* Driver local variables and types. */
/*===========================================================================*/
+__attribute__ ((section(".cfmconfig")))
+const uint8_t _cfm[0x10] = {
+ 0xFF, /* NV_BACKKEY3: KEY=0xFF */
+ 0xFF, /* NV_BACKKEY2: KEY=0xFF */
+ 0xFF, /* NV_BACKKEY1: KEY=0xFF */
+ 0xFF, /* NV_BACKKEY0: KEY=0xFF */
+ 0xFF, /* NV_BACKKEY7: KEY=0xFF */
+ 0xFF, /* NV_BACKKEY6: KEY=0xFF */
+ 0xFF, /* NV_BACKKEY5: KEY=0xFF */
+ 0xFF, /* NV_BACKKEY4: KEY=0xFF */
+ 0xFF, /* NV_FPROT3: PROT=0xFF */
+ 0xFF, /* NV_FPROT2: PROT=0xFF */
+ 0xFF, /* NV_FPROT1: PROT=0xFF */
+ 0xFF, /* NV_FPROT0: PROT=0xFF */
+ 0x7E, /* NV_FSEC: KEYEN=1,MEEN=3,FSLACC=3,SEC=2 */
+ 0xFF, /* NV_FOPT: ??=1,??=1,FAST_INIT=1,LPBOOT1=1,RESET_PIN_CFG=1,
+ NMI_DIS=1,EZPORT_DIS=1,LPBOOT0=1 */
+ 0xFF,
+ 0xFF
+};
+
/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/