aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc/modems/xmm626/os_partitions.h
blob: c1b5a7427867d513f17886c193fb30513bfe69a7 (plain)
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
/*
 * This file is part of libsamsung-ipc.
 *
 * Copyright (C) 2013-2014 Paul Kocialkowski <contact@paulk.fr>
 * Copyright (C) 2020 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 *
 * libsamsung-ipc is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * libsamsung-ipc is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with libsamsung-ipc.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef XMM626_OS_PARTITIONS
#define XMM626_OS_PARTITIONS

/*  Current function/partition mapping
 *  TODO: migrate functions
 *  +-----------------+-----------+
 *  | Function        | Partition | 
 *  +-----------------+-----------+
 *  | psi             | PSIRAM    |
 *  | ebl             | EBL       |
 *  | firmware        | MAIN      |
 *  | sec_start       | SECPACK   |
 *  | device specific | NV        |
 *  +-----------------+-----------+
 */

enum ipc_client_modem_os_subpartition_type {
	MODEM_OS_PARTITION_HEADER = 0,
        MODEM_OS_PARTITION_PSIRAM,
        MODEM_OS_PARTITION_EBL,
        MODEM_OS_PARTITION_MAIN,
        MODEM_OS_PARTITION_SECPACK,
        MODEM_OS_PARTITION_NV,
};

#define ipc_client_modem_os_subpartition_string(subpartition) #subpartition
	/* #if subpartition > MODEM_OS_PARTITION_NV	\ */
	/* 	#error "Unknown modem_os_subpartition"	\ */
	/* #else						\ */
	/* #subpartition					\ */
	/* #endif						\ */

struct ipc_client_modem_os_subpartition {
	const enum ipc_client_modem_os_subpartition_type type;
	void *data;
	const size_t offset;
	const size_t size;
};

struct ipc_client_modem_os_partition_specs {
	char* path;
	size_t size;
	struct ipc_client_modem_os_subpartition *subpartitions_specs[];
};

int xmm626_load_os_subpartition(struct ipc_client *client,
				enum ipc_client_modem_os_subpartition_type type, int fd,
				void *data, size_t data_size);

#endif /* XMM626_OS_PARTITIONS */