mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
rockchip: misc: read cpuid either from efuse or otp
Newer Rockchip socs use a different ip block to handle one-time- programmable memory, so depending on what got enabled get the cpuid from either source. Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
parent
a907dc3f25
commit
e61350a5f5
1 changed files with 6 additions and 1 deletions
|
@ -57,13 +57,18 @@ int rockchip_cpuid_from_efuse(const u32 cpuid_offset,
|
||||||
const u32 cpuid_length,
|
const u32 cpuid_length,
|
||||||
u8 *cpuid)
|
u8 *cpuid)
|
||||||
{
|
{
|
||||||
#if CONFIG_IS_ENABLED(ROCKCHIP_EFUSE)
|
#if CONFIG_IS_ENABLED(ROCKCHIP_EFUSE) || CONFIG_IS_ENABLED(ROCKCHIP_OTP)
|
||||||
struct udevice *dev;
|
struct udevice *dev;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* retrieve the device */
|
/* retrieve the device */
|
||||||
|
#if CONFIG_IS_ENABLED(ROCKCHIP_EFUSE)
|
||||||
ret = uclass_get_device_by_driver(UCLASS_MISC,
|
ret = uclass_get_device_by_driver(UCLASS_MISC,
|
||||||
DM_GET_DRIVER(rockchip_efuse), &dev);
|
DM_GET_DRIVER(rockchip_efuse), &dev);
|
||||||
|
#elif CONFIG_IS_ENABLED(ROCKCHIP_OTP)
|
||||||
|
ret = uclass_get_device_by_driver(UCLASS_MISC,
|
||||||
|
DM_GET_DRIVER(rockchip_otp), &dev);
|
||||||
|
#endif
|
||||||
if (ret) {
|
if (ret) {
|
||||||
debug("%s: could not find efuse device\n", __func__);
|
debug("%s: could not find efuse device\n", __func__);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in a new issue