1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2017 Socionext Inc.
4 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
7 #include <linux/bitfield.h>
9 #include <linux/types.h>
14 unsigned int uniphier_get_soc_id(void)
16 u32 rev = readl(sg_base + SG_REVISION);
18 return FIELD_GET(SG_REVISION_TYPE_MASK, rev);
21 unsigned int uniphier_get_soc_model(void)
23 u32 rev = readl(sg_base + SG_REVISION);
25 return FIELD_GET(SG_REVISION_MODEL_MASK, rev);
28 unsigned int uniphier_get_soc_revision(void)
30 u32 rev = readl(sg_base + SG_REVISION);
32 return FIELD_GET(SG_REVISION_REV_MASK, rev);