TT Zephyr Platforms 18.11.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
jtag_bootrom.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Tenstorrent AI ULC
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef TENSTORRENT_JTAG_BOOTROM_H_
8#define TENSTORRENT_JTAG_BOOTROM_H_
9
10#include <stddef.h>
11#include <stdint.h>
12
13#include <zephyr/sys/util.h>
14#include <zephyr/spinlock.h>
15
16#include <tenstorrent/bh_chip.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22const uint8_t *get_bootcode(void);
23const size_t get_bootcode_len(void);
24
25int jtag_bootrom_init(struct bh_chip *chip);
26
27int jtag_bootrom_reset_asic(struct bh_chip *chip);
28
29int jtag_bootrom_patch_offset(struct bh_chip *chip, const uint32_t *patch, size_t patch_len,
30 const uint32_t start_addr);
31int jtag_bootrom_verify(const struct device *dev, const uint32_t *patch, size_t patch_len);
32void jtag_bootrom_soft_reset_arc(struct bh_chip *chip);
33void jtag_bootrom_teardown(const struct bh_chip *chip);
34
35ALWAYS_INLINE int jtag_bootrom_patch(struct bh_chip *chip, const uint32_t *patch, size_t patch_len)
36{
37 return jtag_bootrom_patch_offset(chip, patch, patch_len, 0);
38}
39
40/* for verification via gpio-emul */
41void jtag_bootrom_emul_setup(const uint32_t *buf, size_t buf_len);
45
46#ifdef __cplusplus
47}
48#endif
49
50#endif
#define ALWAYS_INLINE
void jtag_bootrom_teardown(const struct bh_chip *chip)
Definition jtag_bootrom.c:315
void jtag_bootrom_emul_setup(const uint32_t *buf, size_t buf_len)
int jtag_bootrom_emul_axiread(uint32_t addr, uint32_t *value)
int jtag_bootrom_patch_offset(struct bh_chip *chip, const uint32_t *patch, size_t patch_len, const uint32_t start_addr)
Definition jtag_bootrom.c:191
int jtag_bootrom_verify(const struct device *dev, const uint32_t *patch, size_t patch_len)
Definition jtag_bootrom.c:227
int jtag_bootrom_init(struct bh_chip *chip)
Definition jtag_bootrom.c:136
uint32_t get_dm_init_duration(void)
Definition jtag_bootrom.c:263
uint32_t get_arc_start_time(void)
Definition jtag_bootrom.c:258
int jtag_bootrom_reset_asic(struct bh_chip *chip)
Definition jtag_bootrom.c:86
const uint8_t * get_bootcode(void)
const size_t get_bootcode_len(void)
Definition reset.c:27
void jtag_bootrom_soft_reset_arc(struct bh_chip *chip)
Definition jtag_bootrom.c:269
ALWAYS_INLINE int jtag_bootrom_patch(struct bh_chip *chip, const uint32_t *patch, size_t patch_len)
Definition jtag_bootrom.h:35
static uint8_t buf[1]
Definition log_backend_ringbuf.c:24
__UINT32_TYPE__ uint32_t
__UINT8_TYPE__ uint8_t
Definition bh_chip.h:92