diff options
author | Pascal Vizeli <pvizeli@syshack.ch> | 2020-11-27 17:28:21 +0100 |
---|---|---|
committer | Neil Armstrong <narmstrong@baylibre.com> | 2021-01-11 14:59:54 +0100 |
commit | d42e7964d9ca756bced0c0e7e879ed06edb4b6cb (patch) | |
tree | 95965ca555f63a40e58c762ed8a7c8f5ca78787d /arch/arm | |
parent | cf47c0e23a25f10ea87fdb3ac4b1e4ea14823e16 (diff) | |
download | u-boot-d42e7964d9ca756bced0c0e7e879ed06edb4b6cb.zip u-boot-d42e7964d9ca756bced0c0e7e879ed06edb4b6cb.tar.gz u-boot-d42e7964d9ca756bced0c0e7e879ed06edb4b6cb.tar.bz2 |
meson: Add soc_rev to environment
Add SoC revision to environment. This can be useful to select the
correct device tree at runtime (N2/N2+).
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/include/asm/arch-meson/boot.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-meson/board-info.c | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-meson/boot.h b/arch/arm/include/asm/arch-meson/boot.h index a90fe55..c67d12d 100644 --- a/arch/arm/include/asm/arch-meson/boot.h +++ b/arch/arm/include/asm/arch-meson/boot.h @@ -7,6 +7,8 @@ #ifndef __MESON_BOOT_H__ #define __MESON_BOOT_H__ +#include <linux/types.h> + /* Boot device */ #define BOOT_DEVICE_RESERVED 0 #define BOOT_DEVICE_EMMC 1 @@ -17,4 +19,6 @@ int meson_get_boot_device(void); +int meson_get_soc_rev(char *buff, size_t buff_len); + #endif /* __MESON_BOOT_H__ */ diff --git a/arch/arm/mach-meson/board-info.c b/arch/arm/mach-meson/board-info.c index a0bcf38..90e7dfa 100644 --- a/arch/arm/mach-meson/board-info.c +++ b/arch/arm/mach-meson/board-info.c @@ -187,3 +187,15 @@ int show_board_info(void) return 0; } + +int meson_get_soc_rev(char *buff, size_t buff_len) +{ + unsigned int socinfo; + + socinfo = get_socinfo(); + if (!socinfo) + return -1; + + /* Write SoC info */ + return snprintf(buff, buff_len, "%x", socinfo_to_minor(socinfo)); +} |