2015-06-12 18:42:34 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 PHYTEC Messtechnik GmbH
|
|
|
|
* Copyright (C) 2015 Eistec AB
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser General
|
|
|
|
* Public License v2.1. See the file LICENSE in the top level directory for more
|
|
|
|
* details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2017-10-27 01:26:26 +02:00
|
|
|
* @ingroup cpu_kinetis
|
2015-06-12 18:42:34 +02:00
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Default FCF code for Freescale Kinetis MCUs
|
|
|
|
*
|
|
|
|
* @author Johann Fischer <j.fischer@phytec.de>
|
2015-09-20 13:47:39 +02:00
|
|
|
* @author Joakim Nohlgård <joakim.nohlgard@eistec.se>
|
2015-06-12 18:42:34 +02:00
|
|
|
*
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2018-11-27 16:20:54 +01:00
|
|
|
#include "cpu.h"
|
|
|
|
#include "board.h"
|
|
|
|
|
|
|
|
/* See the corresponding CPU reference manual for the meaning of the FOPT boot
|
|
|
|
* configuration bits. */
|
|
|
|
#ifndef KINETIS_FOPT
|
|
|
|
#define KINETIS_FOPT 0xff
|
|
|
|
#endif
|
2015-06-12 18:42:34 +02:00
|
|
|
|
|
|
|
/* fcfield table */
|
2018-07-31 18:08:07 +02:00
|
|
|
#ifdef KINETIS_SERIES_EA
|
|
|
|
__attribute__((weak, used, section(".fcfield")))
|
|
|
|
const uint8_t flash_configuration_field[] = {
|
|
|
|
0xff, /* backdoor comparison key 3., offset: 0x0 */
|
|
|
|
0xff, /* backdoor comparison key 2., offset: 0x1 */
|
|
|
|
0xff, /* backdoor comparison key 1., offset: 0x2 */
|
|
|
|
0xff, /* backdoor comparison key 0., offset: 0x3 */
|
|
|
|
0xff, /* backdoor comparison key 7., offset: 0x4 */
|
|
|
|
0xff, /* backdoor comparison key 6., offset: 0x5 */
|
|
|
|
0xff, /* backdoor comparison key 5., offset: 0x6 */
|
|
|
|
0xff, /* backdoor comparison key 4., offset: 0x7 */
|
|
|
|
0xff, /* reserved, offset: 0x8 */
|
|
|
|
0xff, /* reserved, offset: 0x9 */
|
|
|
|
0xff, /* reserved, offset: 0xa */
|
|
|
|
0xff, /* reserved, offset: 0xb */
|
|
|
|
0xff, /* reserved, offset: 0xc */
|
|
|
|
0xff, /* non-volatile flash protection register, offset: 0xd */
|
|
|
|
0xfe, /* non-volatile flash security register, offset: 0xe */
|
|
|
|
0xff, /* non-volatile flash nonvolatile register, offset: 0xf */
|
|
|
|
};
|
|
|
|
#else
|
2015-07-10 10:46:13 +02:00
|
|
|
__attribute__((weak, used, section(".fcfield")))
|
2015-06-12 18:42:34 +02:00
|
|
|
const uint8_t flash_configuration_field[] = {
|
|
|
|
0xff, /* backdoor comparison key 3., offset: 0x0 */
|
|
|
|
0xff, /* backdoor comparison key 2., offset: 0x1 */
|
|
|
|
0xff, /* backdoor comparison key 1., offset: 0x2 */
|
|
|
|
0xff, /* backdoor comparison key 0., offset: 0x3 */
|
|
|
|
0xff, /* backdoor comparison key 7., offset: 0x4 */
|
|
|
|
0xff, /* backdoor comparison key 6., offset: 0x5 */
|
|
|
|
0xff, /* backdoor comparison key 5., offset: 0x6 */
|
|
|
|
0xff, /* backdoor comparison key 4., offset: 0x7 */
|
|
|
|
0xff, /* non-volatile p-flash protection 1 - low register, offset: 0x8 */
|
|
|
|
0xff, /* non-volatile p-flash protection 1 - high register, offset: 0x9 */
|
|
|
|
0xff, /* non-volatile p-flash protection 0 - low register, offset: 0xa */
|
|
|
|
0xff, /* non-volatile p-flash protection 0 - high register, offset: 0xb */
|
|
|
|
0xfe, /* non-volatile flash security register, offset: 0xc */
|
2018-11-27 16:20:54 +01:00
|
|
|
KINETIS_FOPT, /* FOPT non-volatile flash option register, offset: 0xd */
|
2015-06-12 18:42:34 +02:00
|
|
|
0xff, /* non-volatile eeram protection register, offset: 0xe */
|
|
|
|
0xff, /* non-volatile d-flash protection register, offset: 0xf */
|
|
|
|
};
|
2018-07-31 18:08:07 +02:00
|
|
|
#endif
|