forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatform.h
More file actions
92 lines (68 loc) · 2.15 KB
/
platform.h
File metadata and controls
92 lines (68 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright 2021 NXP
*
* Author: Zhang Peng <peng.zhang_8@nxp.com>
*/
#ifdef __SOF_PLATFORM_H__
#ifndef __PLATFORM_PLATFORM_H__
#define __PLATFORM_PLATFORM_H__
#if !defined(__ASSEMBLER__) && !defined(LINKER)
#include <sof/drivers/mu.h>
#include <sof/lib/mailbox.h>
#include <stddef.h>
#include <stdint.h>
struct ll_schedule_domain;
struct timer;
#define PLATFORM_DEFAULT_CLOCK CLK_CPU(0)
#define LPSRAM_SIZE 16384
/* IPC Interrupt */
#define PLATFORM_IPC_INTERRUPT IRQ_NUM_MU3
#define PLATFORM_IPC_INTERRUPT_NAME NULL
/* Host page size */
#define HOST_PAGE_SIZE 4096
#define PLATFORM_PAGE_TABLE_SIZE 256
/* pipeline IRQ */
#define PLATFORM_SCHEDULE_IRQ IRQ_NUM_SOFTWARE0
#define PLATFORM_SCHEDULE_IRQ_NAME NULL
/* Platform stream capabilities */
#define PLATFORM_MAX_CHANNELS 4
#define PLATFORM_MAX_STREAMS 5
/* local buffer size of DMA tracing */
#define DMA_TRACE_LOCAL_SIZE HOST_PAGE_SIZE
/* trace bytes flushed during panic */
#define DMA_FLUSH_TRACE_SIZE (MAILBOX_TRACE_SIZE >> 2)
/* the interval of DMA trace copying */
#define DMA_TRACE_PERIOD 500000
/*
* the interval of reschedule DMA trace copying in special case like half
* fullness of local DMA trace buffer
*/
#define DMA_TRACE_RESCHEDULE_TIME 100
/* DSP default delay in cycles */
#define PLATFORM_DEFAULT_DELAY 12
#define SRAM_REG_FW_STATUS 0x4
/* Platform defined panic code */
static inline void platform_panic(uint32_t p)
{
/* Store the error code in the debug box so the
* application processor can pick it up. Takes up 4 bytes
* from the debug box.
*/
mailbox_sw_reg_write(SRAM_REG_FW_STATUS, p);
/* Notify application processor */
imx_mu_xcr_rmw(IMX_MU_VERSION, IMX_MU_GCR, IMX_MU_xCR_GIRn(IMX_MU_VERSION, 1), 0);
}
/**
* \brief Platform specific CPU entering idle.
* May be power-optimized using platform specific capabilities.
* @param level Interrupt level.
*/
void platform_wait_for_interrupt(int level);
extern intptr_t _module_init_start;
extern intptr_t _module_init_end;
#endif
#endif /* __PLATFORM_PLATFORM_H__ */
#else
#error "This file shouldn't be included from outside of sof/platform.h"
#endif /* __SOF_PLATFORM_H__ */