u-boot/arch/arm/include/asm/arch-meson/boot.h
Evgeny Bachinin dedea0d18d arch: arm: meson: support Amlogic chip_id v1 and v2
Patch introduces:
* chip_id API - useful for various things, but used now for
  device_id (did) generation as mentioned in [1] on our private board
  code. Our device_id is calculated by means of permutations of
  chip_id value.
* new SoCs (a1, s4, etc) are usually coming with the support of chip_id
  v2 right away, whereas secure monitors on old SoCs (like axg, g12b,
  g12a, etc) may support only chip_id v1. Chip_id API handles both
  cases
* meson_sm_get_serial() is described via chip_id API.

Links:
[1] https://lore.kernel.org/linux-arm-kernel/202311242104.RjBPI3uI-lkp@intel.com/T/#m630fbeea6a6e7d531290b5c0af205af4fb979757

Signed-off-by: Viacheslav Bocharov <adeep@lexina.in>
Co-developed-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Signed-off-by: Evgeny Bachinin <EABachinin@salutedevices.com>
Link: https://lore.kernel.org/r/20250210-meson_chip_id_all_vers-v1-3-b98f8b6880b8@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2025-03-18 15:27:25 +01:00

39 lines
1.0 KiB
C

/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (C) 2016 BayLibre, SAS
* Author: Neil Armstrong <narmstrong@baylibre.com>
*/
#ifndef __MESON_BOOT_H__
#define __MESON_BOOT_H__
#include <linux/types.h>
/* Boot device */
#define BOOT_DEVICE_RESERVED 0
#define BOOT_DEVICE_EMMC 1
#define BOOT_DEVICE_NAND 2
#define BOOT_DEVICE_SPI 3
#define BOOT_DEVICE_SD 4
#define BOOT_DEVICE_USB 5
int meson_get_boot_device(void);
int meson_get_soc_rev(char *buff, size_t buff_len);
/**
* meson_get_socinfo - retrieve cpu_id of the Amlogic SoC
*
* The value in the following format is read from register:
* +-----------+------------+------------+------------+
* | family_id | package_id | chip_rev | layout_rev |
* +-----------+------------+------------+------------+
* | 31 24 | 23 16 | 15 8 | 7 0 |
* +-----------+------------+------------+------------+
*
* Return: 4 bytes value of cpu_id on success or 0 on failure.
*/
u32 meson_get_socinfo(void);
#endif /* __MESON_BOOT_H__ */