|
| 1 | +/* |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | + * or more contributor license agreements. See the NOTICE file |
| 4 | + * distributed with this work for additional information |
| 5 | + * regarding copyright ownership. The ASF licenses this file |
| 6 | + * to you under the Apache License, Version 2.0 (the |
| 7 | + * "License"); you may not use this file except in compliance |
| 8 | + * with the License. You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, |
| 13 | + * software distributed under the License is distributed on an |
| 14 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | + * KIND, either express or implied. See the License for the |
| 16 | + * specific language governing permissions and limitations |
| 17 | + * under the License. |
| 18 | + */ |
| 19 | + |
| 20 | +#include <stdint.h> |
| 21 | +#include <stddef.h> |
| 22 | +#include <assert.h> |
| 23 | +#include <os/mynewt.h> |
| 24 | +#include <nrfx.h> |
| 25 | +#include <flash_map/flash_map.h> |
| 26 | +#include <hal/hal_bsp.h> |
| 27 | +#include <hal/hal_flash.h> |
| 28 | +#include <hal/hal_system.h> |
| 29 | +#include <mcu/nrf54l_hal.h> |
| 30 | +#include <mcu/nrf54l_periph.h> |
| 31 | +#include <bsp/bsp.h> |
| 32 | + |
| 33 | +/* |
| 34 | + * What memory to include in coredump. |
| 35 | + */ |
| 36 | +static const struct hal_bsp_mem_dump dump_cfg[] = { |
| 37 | + [0] = { |
| 38 | + .hbmd_start = &_ram_start, |
| 39 | + .hbmd_size = RAM_SIZE |
| 40 | + } |
| 41 | +}; |
| 42 | + |
| 43 | +const struct hal_flash * |
| 44 | +hal_bsp_flash_dev(uint8_t id) |
| 45 | +{ |
| 46 | + /* |
| 47 | + * Internal flash mapped to id 0. |
| 48 | + */ |
| 49 | + if (id == 0) { |
| 50 | + return &nrf54l_flash_dev; |
| 51 | + } |
| 52 | + |
| 53 | + return NULL; |
| 54 | +} |
| 55 | + |
| 56 | +const struct hal_bsp_mem_dump * |
| 57 | +hal_bsp_core_dump(int *area_cnt) |
| 58 | +{ |
| 59 | + *area_cnt = sizeof(dump_cfg) / sizeof(dump_cfg[0]); |
| 60 | + return dump_cfg; |
| 61 | +} |
| 62 | + |
| 63 | +int |
| 64 | +hal_bsp_power_state(int state) |
| 65 | +{ |
| 66 | + return 0; |
| 67 | +} |
| 68 | + |
| 69 | +void |
| 70 | +hal_bsp_init(void) |
| 71 | +{ |
| 72 | + /* Make sure system clocks have started */ |
| 73 | + hal_system_clock_start(); |
| 74 | + |
| 75 | + /* Create all available nRF54 peripherals */ |
| 76 | + nrf54l_periph_create(); |
| 77 | +} |
| 78 | + |
| 79 | +void |
| 80 | +hal_bsp_deinit(void) |
| 81 | +{ |
| 82 | +} |
0 commit comments