blob: a11dfde719e3e48e10bcb1f6b1b84eb8586ca9e7 [file] [log] [blame]
Neil Armstrong2fbfcbb2018-07-27 14:10:00 +02001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) 2016 BayLibre, SAS
4 * Author: Neil Armstrong <narmstrong@baylibre.com>
5 */
6
7#ifndef __MESON_BOOT_H__
8#define __MESON_BOOT_H__
9
Pascal Vizeli07168542020-11-27 17:28:21 +010010#include <linux/types.h>
11
Neil Armstrong2fbfcbb2018-07-27 14:10:00 +020012/* Boot device */
13#define BOOT_DEVICE_RESERVED 0
14#define BOOT_DEVICE_EMMC 1
15#define BOOT_DEVICE_NAND 2
16#define BOOT_DEVICE_SPI 3
17#define BOOT_DEVICE_SD 4
18#define BOOT_DEVICE_USB 5
19
20int meson_get_boot_device(void);
21
Pascal Vizeli07168542020-11-27 17:28:21 +010022int meson_get_soc_rev(char *buff, size_t buff_len);
23
Evgeny Bachinin98eb5e42025-02-10 20:50:16 +030024/**
25 * meson_get_socinfo - retrieve cpu_id of the Amlogic SoC
26 *
27 * The value in the following format is read from register:
28 * +-----------+------------+------------+------------+
29 * | family_id | package_id | chip_rev | layout_rev |
30 * +-----------+------------+------------+------------+
31 * | 31 24 | 23 16 | 15 8 | 7 0 |
32 * +-----------+------------+------------+------------+
33 *
34 * Return: 4 bytes value of cpu_id on success or 0 on failure.
35 */
36u32 meson_get_socinfo(void);
37
Neil Armstrong2fbfcbb2018-07-27 14:10:00 +020038#endif /* __MESON_BOOT_H__ */