|
| 1 | +/* mbed Microcontroller Library |
| 2 | + * Copyright (c) 2017 ARM Limited |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +#include "flash_api.h" |
| 18 | +#include "flash_data.h" |
| 19 | +#include "platform/mbed_critical.h" |
| 20 | + |
| 21 | +// This file is automatically generated |
| 22 | + |
| 23 | +#if DEVICE_FLASH |
| 24 | + |
| 25 | +// This is a flash algo binary blob. It is PIC (position independent code) that should be stored in RAM |
| 26 | +static uint32_t FLASH_ALGO[] = { |
| 27 | + 0x28100b00, 0x210ed302, 0x00d0eb01, 0xf44f4770, 0xfbb1707a, 0x4933f0f0, 0x60084449, 0x20014932, |
| 28 | + 0x20006408, 0x20004770, 0xe92d4770, 0xf7ff41f0, 0x4d2effe7, 0x444d4604, 0xe9c52032, 0xf1050400, |
| 29 | + 0x4e2b0114, 0x4628460f, 0x47b060ac, 0xb9686968, 0xe9c52034, 0x48230400, 0x444860ac, 0x68004639, |
| 30 | + 0x462860e8, 0x696847b0, 0xd0002800, 0xe8bd2001, 0xe92d81f0, 0x461441f0, 0xd10e0006, 0x0100e9d4, |
| 31 | + 0xe9d44408, 0x44111202, 0x69214408, 0x69614408, 0x69a14408, 0x42404408, 0x463061e0, 0xffb0f7ff, |
| 32 | + 0x21324d12, 0x4f12444d, 0x1000e9c5, 0x0114f105, 0x468860a8, 0x47b84628, 0xb9806968, 0xe9c52033, |
| 33 | + 0xf44f0600, 0xe9c56080, 0x48064002, 0x44484641, 0x61286800, 0x47b84628, 0x28006968, 0x2001d0c7, |
| 34 | + 0x0000e7c5, 0x00000004, 0x400fc000, 0x00000008, 0x1fff1ff1, 0x00000000, 0x00000000, 0x00000000, |
| 35 | + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 |
| 36 | +}; |
| 37 | + |
| 38 | +static const flash_algo_t flash_algo_config = { |
| 39 | + .init = 0xf, |
| 40 | + .uninit = 0x27, |
| 41 | + .erase_sector = 0x2b, |
| 42 | + .program_page = 0x73, |
| 43 | + .static_base = 0xf4, |
| 44 | + .algo_blob = FLASH_ALGO |
| 45 | +}; |
| 46 | + |
| 47 | +static const sector_info_t sectors_info[] = { |
| 48 | + {0x0, 0x1000}, |
| 49 | + {0x10000, 0x8000}, |
| 50 | +}; |
| 51 | + |
| 52 | +static const flash_target_config_t flash_target_config = { |
| 53 | + .page_size = 0x400, |
| 54 | + .flash_start = 0x0, |
| 55 | + .flash_size = 0x80000, |
| 56 | + .sectors = sectors_info, |
| 57 | + .sector_info_count = sizeof(sectors_info) / sizeof(sector_info_t) |
| 58 | +}; |
| 59 | + |
| 60 | +void flash_set_target_config(flash_t *obj) |
| 61 | +{ |
| 62 | + obj->flash_algo = &flash_algo_config; |
| 63 | + obj->target_config = &flash_target_config; |
| 64 | +} |
| 65 | + |
| 66 | +#endif |
0 commit comments