-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathfirmware.h
60 lines (50 loc) · 1.76 KB
/
firmware.h
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
/*
* ps4-kexec - a kexec() implementation for Orbis OS / FreeBSD
*
* Copyright (C) 2015-2016 shuffle2 <[email protected]>
* Copyright (C) 2015-2016 Hector Martin "marcan" <[email protected]>
*
* This code is licensed to you under the 2-clause BSD license. See the LICENSE
* file for more information.
*/
#ifndef FIRMWARE_H
#define FIRMWARE_H
#include "types.h"
// sizes for liverpool
#define LVP_FW_CE_SIZE 8576
#define LVP_FW_ME_SIZE 16768
#define LVP_FW_MEC_SIZE 16768
#define LVP_FW_MEC2_SIZE 16768
#define LVP_FW_PFP_SIZE 16768
#define LVP_FW_RLC_SIZE 6144
#define LVP_FW_SDMA_SIZE 4200
#define LVP_FW_SDMA1_SIZE 4200
// sizes for gladius
#define GL_FW_CE_SIZE 8576
#define GL_FW_ME_SIZE 16768
#define GL_FW_MEC_SIZE 16768
#define GL_FW_MEC2_SIZE 16768
#define GL_FW_PFP_SIZE 16768
#define GL_FW_RLC_SIZE 8192
#define GL_FW_SDMA_SIZE 4200
#define GL_FW_SDMA1_SIZE 4200
#define MAX(x ,y) (((x) > (y)) ? (x) : (y))
#define MAX_FW_SIZE(engine) MAX(LVP_FW_ ## engine ## _SIZE, GL_FW_ ## engine ## _SIZE)
#define FW_CE_SIZE MAX_FW_SIZE(CE)
#define FW_ME_SIZE MAX_FW_SIZE(ME)
#define FW_MEC_SIZE MAX_FW_SIZE(MEC)
#define FW_MEC2_SIZE MAX_FW_SIZE(MEC2)
#define FW_PFP_SIZE MAX_FW_SIZE(PFP)
#define FW_RLC_SIZE MAX_FW_SIZE(RLC)
#define FW_SDMA_SIZE MAX_FW_SIZE(SDMA)
#define FW_SDMA1_SIZE MAX_FW_SIZE(SDMA1)
// Conservative value (max 113 bytes plus name size plus alignment)
#define CPIO_HEADER_SIZE 256
#define FW_HEADER_SIZE 256
// Leave space for 16 files (currently 12)
#define FW_CPIO_SIZE ( (CPIO_HEADER_SIZE * 16) + FW_CE_SIZE + FW_ME_SIZE + \
FW_MEC_SIZE + FW_MEC2_SIZE + FW_PFP_SIZE + \
FW_RLC_SIZE + FW_SDMA_SIZE + FW_SDMA1_SIZE + \
FW_HEADER_SIZE * 8)
ssize_t firmware_extract(void *dest);
#endif