Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analog Devices Inc. (ADI) Updates #986

Merged
merged 6 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions projects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,14 @@ projects:
- *module_if
- *module_hic_max32625
- records/board/max78000fthr.yaml
max32625_max32670evkit_if:
- *module_if
- *module_hic_max32625
- records/board/max32670evkit.yaml
max32625_max32650fthr_if:
- *module_if
- *module_hic_max32625
- records/board/max32650fthr.yaml
nrf52820_microbit_bl:
- *module_bl
- records/hic_hal/nrf52820.yaml
Expand Down
7 changes: 7 additions & 0 deletions records/board/max32650fthr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
common:
sources:
board:
- source/board/max32650fthr.c
family:
- source/family/maxim/max32650/target.c
- source/family/maxim/target_reset_max32xxx.c
7 changes: 7 additions & 0 deletions records/board/max32670evkit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
common:
sources:
board:
- source/board/max32670evkit.c
family:
- source/family/maxim/max32670/target.c
- source/family/maxim/target_reset_max32xxx.c
35 changes: 35 additions & 0 deletions source/board/max32650fthr.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* @file max32650fthr.c
* @brief board ID for the Maxim Integrated's MAX32650FTHR
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2021, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "target_family.h"
#include "target_board.h"

const board_info_t g_board_info = {
.info_version = kBoardInfoVersion,
.board_id = "0425",
.family_id = kMaxim_MAX3266X_FamilyID,
.flags = kEnablePageErase,
.target_cfg = &target_device,
.daplink_url_name = "MAX32650HTM",
.daplink_target_url = "http://www.maximintegrated.com/max32650FTHR",
.board_vendor = "Maxim Integrated",
.board_name = "MAX32650FTHR",
};
35 changes: 35 additions & 0 deletions source/board/max32670evkit.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* @file max32670evkit.c
* @brief board ID for the Maxim Integrated's max32670evkit
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "target_family.h"
#include "target_board.h"

const board_info_t g_board_info = {
.info_version = kBoardInfoVersion,
.board_id = "0424",
.family_id = kMaxim_MAX3266X_FamilyID,
.flags = kEnablePageErase,
.target_cfg = &target_device,
.daplink_url_name = "MAX32670HTM",
.daplink_target_url = "http://www.maximintegrated.com/max32670evkit",
.board_vendor = "Maxim Integrated",
.board_name = "MAX32670EVKIT",
};
100 changes: 100 additions & 0 deletions source/family/maxim/max32650/flash_blob.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/**
* @file flash_blob.c
* @brief Flash algorithm for the MAX32650
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2019, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "flash_blob.h"

#define CLOCK_DIV 0x000000C0
#define BURST_SIZE 0x00000080

#define FLC0_BASE 0x40029000
#define FLASH0_BASE 0x10000000 //
#define FLASH0_SIZE 0x00300000 // 3MB

#define FLC1_BASE 0 // second flash controller
#define FLASH1_BASE 0 // second block of flash
#define FLASH1_SIZE 0 //

#define FLASH_SIZE MB(3)
#define FLASH_SECTOR KB(16)

#define FLASH_BASE FLASH0_BASE

static const uint32_t maxim_flash_prog_blob[] = {
0xE00ABE00,
0x444949a6, 0x68826808, 0x0f07f012, 0x68cad10b, 0x69486042, 0x6948b148, 0xf0126882, 0xbf040f07,
0x604168c9, 0x2001d001, 0x20004770, 0x499b4770, 0x68084449, 0xf0226882, 0x60824270, 0xb1206948,
0x68816948, 0x4170f021, 0x20006081, 0xb5104770, 0x444c4c92, 0xf0006820, 0xb928f8f4, 0xb1286960,
0xf0006960, 0xb108f8ee, 0xbd102001, 0xbd102000, 0x4449498a, 0xb132698a, 0x4282698a, 0x688ad803,
0x1a806949, 0x6809e000, 0xf012688a, 0xd1270f07, 0xb13a6a4a, 0x624a2200, 0xb11a6a4a, 0x624a2202,
0xb9ea6a4a, 0xf022688a, 0xf0424270, 0x608a5200, 0xf422688a, 0xf442427f, 0x608a42aa, 0x68886008,
0x0004f040, 0x68886088, 0x0f04f010, 0x6888d1fb, 0x4070f020, 0x6a486088, 0x0002f010, 0x4770bf08,
0x47702001, 0x4c6db430, 0x69a3444c, 0x69a3b133, 0xd8034283, 0x1ac068a3, 0xe0006963, 0xf0126823,
0xbf040f03, 0xc008f8d3, 0x0f07f01c, 0xf8d3d17d, 0xf1bcc024, 0xd0110f00, 0x0c00f04f, 0xc024f8c3,
0xc024f8d3, 0x0f00f1bc, 0xf04fd008, 0xf8c30c02, 0xf8d3c024, 0xf1bcc024, 0xd17f0f00, 0xc008f8d3,
0x4c70f02c, 0x5c00f04c, 0xc008f8c3, 0x6018e011, 0xcb04f852, 0xc030f8c3, 0xc008f8d3, 0x0c01f04c,
0xc008f8c3, 0xc008f8d3, 0x0f01f01c, 0x1d00d1fa, 0x29041f09, 0xf010d302, 0xd1e80f1f, 0xc010f8d4,
0x0f80f1bc, 0x2910d121, 0x6018d31f, 0xcb04f852, 0xc030f8c3, 0xcb04f852, 0xc034f8c3, 0xcb04f852,
0xc038f8c3, 0xcb04f852, 0xc03cf8c3, 0xc008f8d3, 0x0c01f04c, 0xc008f8c3, 0xc008f8d3, 0x0f01f01c,
0x3010d1fa, 0x29103910, 0x2904d2df, 0x6018d313, 0xcb04f852, 0xc030f8c3, 0xc008f8d3, 0x0c01f04c,
0xc008f8c3, 0xc008f8d3, 0x0f01f01c, 0x1d00d1fa, 0x29041f09, 0xb1b9d2eb, 0xf04f6812, 0xf04f34ff,
0xea620cff, 0x402c050c, 0xe017e000, 0x2c0cea4f, 0xd1f61e49, 0x631c6018, 0xf0406898, 0x60980001,
0xf0106898, 0xd1fb0f01, 0xf0206898, 0x60984070, 0xf0106a58, 0xbf040002, 0x4770bc30, 0xbc302001,
0x68814770, 0x0f07f011, 0x6a41d126, 0x2100b139, 0x6a416241, 0x2102b119, 0x6a416241, 0x6881b9e1,
0x4170f021, 0x5100f041, 0x68816081, 0x417ff421, 0x412af441, 0x68816081, 0x0102f041, 0x68816081,
0x0f02f011, 0x6881d1fb, 0x4170f021, 0x6a406081, 0x0002f010, 0x4770bf08, 0x47702001, 0x00000004,
0x00000000,
FLC0_BASE, FLASH0_BASE,FLASH0_SIZE,CLOCK_DIV, BURST_SIZE, FLC1_BASE, FLASH1_BASE,FLASH1_SIZE
};

/**
* List of start and size for each size of flash sector - even indexes are start, odd are size
* The size will apply to all sectors between the listed address and the next address
* in the list.
* The last pair in the list will have sectors starting at that address and ending
* at address flash_start + flash_size.
*/
static const sector_info_t sectors_info[] = {
FLASH0_BASE, FLASH_SECTOR,
};

static const program_target_t flash = {
0x20000005, // Init
0x20000033, // UnInit
0x20000053, // EraseChip
0x20000075, // EraseSector
0x200000e9, // ProgramPage
0x0, // Verify

// BKPT : start of blob + 1
// RSB : blob start + header + rw data offset
// RSP : stack pointer
{
0x20000001,
0x200002a4,
0x20000500
},

0x20000000 + 0x00000A00, // mem buffer location
0x20000000, // location to write prog_blob in target RAM
sizeof(maxim_flash_prog_blob), // prog_blob size
maxim_flash_prog_blob, // address of prog_blob
0x00004000 // ram_to_flash_bytes_to_be_written
};
38 changes: 38 additions & 0 deletions source/family/maxim/max32650/target.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* @file target.c
* @brief Target information for the MAX32650
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2021, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "target_config.h"

#include "flash_blob.c"

/* ME10 -- MAX32650 3MiB Flash, 1MiB RAM */
target_cfg_t target_device = {
.sectors_info = sectors_info,
.sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)),
.flash_regions[0].start = 0x10000000,
.flash_regions[0].end = 0x10000000 + MB(3),
.flash_regions[0].flags = kRegionIsDefault,
.flash_regions[0].flash_algo = (program_target_t *) &flash,
.ram_regions[0].start = 0x20000000,
.ram_regions[0].end = 0x20000000 + MB(1),
.target_vendor = "Maxim",
.target_part_number = "MAX32650",
};
89 changes: 54 additions & 35 deletions source/family/maxim/max32666/flash_blob.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,46 @@

#include "flash_blob.h"

#define FLC_BASE 0x40029000
#define CLOCK_DIV 0x00000060
#define BURST_SIZE 0x00000080
#define FLASH_BASE 0x10000000

#define FLC0_BASE 0x40029000
#define FLASH0_BASE 0x10000000 //
#define FLASH0_SIZE 0x00080000 //

#define FLC1_BASE 0x40029400 // second flash controller
#define FLASH1_BASE 0x10080000 // second block of flash
#define FLASH1_SIZE 0x00080000 //

#define FLASH_SIZE MB(1)
#define FLASH_SECTOR KB(8)

static const uint32_t flash_algo_blob[] = {
0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2,
0x44494975, 0x68826808, 0x0f07f012, 0x2001bf1c, 0x68494770, 0x20006041, 0x486f4770, 0x68004448,
0xf0216881, 0x60814170, 0x47702000, 0xb510486a, 0x68044448, 0xf8b4f000, 0x68a0b9b0, 0x407ff420,
0x402af440, 0x68a060a0, 0x0002f040, 0x68a060a0, 0x0f02f010, 0x68a0d1fb, 0x4070f020, 0x6a6060a0,
0x0002f010, 0xbd10bf08, 0xbd102001, 0x4605b570, 0x44484859, 0xf0006804, 0xb9b8f893, 0xf42068a0,
0xf440407f, 0x60a040aa, 0x68a06025, 0x0004f040, 0x68a060a0, 0x0f04f010, 0x68a0d1fb, 0x4070f020,
0x6a6060a0, 0x0002f010, 0xbd70bf08, 0xbd702001, 0x41f0e92d, 0x8120f8df, 0x44c8460d, 0xf8d84606,
0x46174000, 0x0f03f012, 0xf000d167, 0x2800f869, 0xe00dd163, 0xf8576026, 0x63200b04, 0xf04068a0,
0x60a00001, 0xf01068a0, 0xd1fb0f01, 0x1d361f2d, 0xd3022d04, 0x0f1ff016, 0xf8d8d1ec, 0x28800008,
0x2d10d11a, 0x6026d318, 0x0b04f857, 0xf8576320, 0x63600b04, 0x0b04f857, 0xf85763a0, 0x63e00b04,
0xf04068a0, 0x60a00001, 0xf01068a0, 0xd1fb0f01, 0x36103d10, 0xd2e62d10, 0xd30f2d04, 0xf8576026,
0x63200b04, 0xf04068a0, 0x60a00001, 0xf01068a0, 0xd1fb0f01, 0x1d361f2d, 0xd2ef2d04, 0x683ab19d,
0x31fff04f, 0xea6220ff, 0x40190300, 0x1e6d0200, 0x6026d1f9, 0x68a06321, 0x0001f040, 0x68a060a0,
0x0f01f010, 0x68a0d1fb, 0x4070f020, 0x6a6060a0, 0x0002f010, 0xe8bdbf08, 0x200181f0, 0x81f0e8bd,
0x4448480d, 0x68816800, 0x0f07f011, 0x6a41d109, 0x2100b149, 0x6a416241, 0x2102b129, 0x6a416241,
0x2001b109, 0x68814770, 0x4170f021, 0x5100f041, 0x20006081, 0x00004770, 0x00000004, 0x00000000,
FLC_BASE, CLOCK_DIV, BURST_SIZE,
#define FLASH_BASE FLASH0_BASE

static const uint32_t maxim_flash_prog_blob[] = {
0xE00ABE00,
0x444949a4, 0x68826808, 0x0f07f012, 0x68cad10b, 0x69486042, 0x6948b148, 0xf0126882, 0xbf040f07,
0x604168c9, 0x2001d001, 0x20004770, 0x49994770, 0x68084449, 0xf0226882, 0x60824270, 0xb1206948,
0x68816948, 0x4170f021, 0x20006081, 0xb5104770, 0x444c4c90, 0xf0006820, 0xb928f8ef, 0xb1286960,
0xf0006960, 0xb108f8e9, 0xbd102001, 0xbd102000, 0x44494988, 0x4282698a, 0x6809bf88, 0x688ad802,
0x1a806949, 0xf012688a, 0xd1270f07, 0xb13a6a4a, 0x624a2200, 0xb11a6a4a, 0x624a2202, 0xb9ea6a4a,
0xf022688a, 0xf0424270, 0x608a5200, 0xf422688a, 0xf442427f, 0x608a42aa, 0x68886008, 0x0004f040,
0x68886088, 0x0f04f010, 0x6888d1fb, 0x4070f020, 0x6a486088, 0x0002f010, 0x4770bf08, 0x47702001,
0x4c6cb430, 0x69a3444c, 0xbf9d4283, 0x1ac068a3, 0x68236963, 0x0f03f012, 0xf8d3bf04, 0xf01cc008,
0xd17d0f07, 0xc024f8d3, 0x0f00f1bc, 0xf04fd011, 0xf8c30c00, 0xf8d3c024, 0xf1bcc024, 0xd0080f00,
0x0c02f04f, 0xc024f8c3, 0xc024f8d3, 0x0f00f1bc, 0xf8d3d17f, 0xf02cc008, 0xf04c4c70, 0xf8c35c00,
0xe011c008, 0xf8526018, 0xf8c3cb04, 0xf8d3c030, 0xf04cc008, 0xf8c30c01, 0xf8d3c008, 0xf01cc008,
0xd1fa0f01, 0x1f091d00, 0xd3022904, 0x0f1ff010, 0xf8d4d1e8, 0xf1bcc010, 0xd1210f80, 0xd31f2910,
0xf8526018, 0xf8c3cb04, 0xf852c030, 0xf8c3cb04, 0xf852c034, 0xf8c3cb04, 0xf852c038, 0xf8c3cb04,
0xf8d3c03c, 0xf04cc008, 0xf8c30c01, 0xf8d3c008, 0xf01cc008, 0xd1fa0f01, 0x39103010, 0xd2df2910,
0xd3132904, 0xf8526018, 0xf8c3cb04, 0xf8d3c030, 0xf04cc008, 0xf8c30c01, 0xf8d3c008, 0xf01cc008,
0xd1fa0f01, 0x1f091d00, 0xd2eb2904, 0x6812b1b9, 0x34fff04f, 0x0cfff04f, 0x050cea62, 0xe000402c,
0xea4fe017, 0x1e492c0c, 0x6018d1f6, 0x6898631c, 0x0001f040, 0x68986098, 0x0f01f010, 0x6898d1fb,
0x4070f020, 0x6a586098, 0x0002f010, 0xbc30bf04, 0x20014770, 0x4770bc30, 0xf0116881, 0xd1260f07,
0xb1396a41, 0x62412100, 0xb1196a41, 0x62412102, 0xb9e16a41, 0xf0216881, 0xf0414170, 0x60815100,
0xf4216881, 0xf441417f, 0x6081412a, 0xf0416881, 0x60810102, 0xf0116881, 0xd1fb0f02, 0xf0216881,
0x60814170, 0xf0106a40, 0xbf080002, 0x20014770, 0x00004770, 0x00000004, 0x00000000,
FLC0_BASE, FLASH0_BASE,FLASH0_SIZE,CLOCK_DIV, BURST_SIZE, FLC1_BASE, FLASH1_BASE,FLASH1_SIZE,
};

/**
Expand All @@ -56,25 +71,29 @@ static const uint32_t flash_algo_blob[] = {
* at address flash_start + flash_size.
*/
static const sector_info_t sectors_info[] = {
FLASH_BASE, FLASH_SECTOR,
FLASH0_BASE, FLASH_SECTOR,
};

static const program_target_t flash = {
0x20000021, // Init
0x2000003b, // UnInit
0x2000004d, // EraseChip
0x2000008d, // EraseSector
0x200000d1, // ProgramPage
0x00000000, // Verify
0x20000005, // Init
0x20000033, // UnInit
0x20000053, // EraseChip
0x20000075, // EraseSector
0x200000e5, // ProgramPage
0x0, // Verify

// BKPT : start of blob + 1
// RSB : blob start + header + rw data offset
// RSP : stack pointer
{
0x20000001, // BKPT : start of blob + 1
0x200001fc, // RSB : blob start + header + rw data offset
0x20000500 // RSP : stack pointer
0x20000001,
0x2000029c,
0x20000500
},

0x20000000 + 0x00000A00, // mem buffer location
0x20000000, // location to write prog_blob in target RAM
sizeof(flash_algo_blob), // prog_blob size
flash_algo_blob, // address of prog_blob
0x00000400 // ram_to_flash_bytes_to_be_written
0x20000000 + 0x00000A00, // mem buffer location
0x20000000, // location to write prog_blob in target RAM
sizeof(maxim_flash_prog_blob), // prog_blob size
maxim_flash_prog_blob, // address of prog_blob
0x00002000 // ram_to_flash_bytes_to_be_written
};
Loading