rockchip: misc: read the correct number of bytes from the efuse
Subsystems (3)
Heiko Stuebner
maintainerPATCH 1/1 rockchip: misc: read the correct number of bytes from the efuse
Originally the cpuid var the value gets read into was defined as
u8 cpuid[RK3399_CPUID_LEN];
hence the sizeof(cpuid) would return the correct the correct number of array elements.
With the move to a separate function cpuid becomes a pointer and sizeof(cpuid) hence returns the pointer size - 8 in the arm64 case.
We do have the actual id length available as function param so use it for actual amount of bytes to read.
--- arch/arm/mach-rockchip/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-rockchip/misc.c +1 -1
@@ -75,7 +75,7 @@ int rockchip_cpuid_from_efuse(const u32 cpuid_offset, }/* read the cpu_id range from the efuses */ - ret =misc_read (dev, cpuid_offset, cpuid,sizeof (cpuid)); + ret =misc_read (dev, cpuid_offset, cpuid, cpuid_length);if (ret) {debug ("%s: reading cpuid from the efuses failed\n" , __func__);
Signature · 1 line
2.23.0
PATCH 1/1 rockchip: misc: read the correct number of bytes from the efuse
Quoted 9 lines · Heiko Stuebner
Originally the cpuid var the value gets read into was defined as
u8 cpuid[RK3399_CPUID_LEN];
hence the sizeof(cpuid) would return the correct the correct number of array elements.
Quoted 8 lines
With the move to a separate function cpuid becomes a pointer and sizeof(cpuid) hence returns the pointer size - 8 in the arm64 case.
We do have the actual id length available as function param so use it for actual amount of bytes to read.
Fixes 04825384999f ("rockchip: rk3399: derive ethaddr from cpuid")Signed-off-by Heiko Stuebner <[email protected]>
PATCH 1/1 rockchip: misc: read the correct number of bytes from the efuse
In reply to Heiko StuebnerQuoted 5 lines · Heiko Stuebner
Originally the cpuid var the value gets read into was defined as
u8 cpuid[RK3399_CPUID_LEN];hence the sizeof(cpuid) would return the correct the correct number of array elements.
Quoted 8 lines
With the move to a separate function cpuid becomes a pointer and sizeof(cpuid) hence returns the pointer size - 8 in the arm64 case.
We do have the actual id length available as function param so use it for actual amount of bytes to read.
Fixes 04825384999f ("rockchip: rk3399: derive ethaddr from cpuid")Signed-off-by Heiko Stuebner <[email protected]>
Thanks,
- Kever
Quoted 17 lines
--- arch/arm/mach-rockchip/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-rockchip/misc.c +1
-1@@ -75,7 +75,7 @@ int rockchip_cpuid_from_efuse(const u32 cpuid_offset, }/* read the cpu_id range from the efuses */ - ret =misc_read (dev, cpuid_offset, cpuid,sizeof (cpuid)); + ret =misc_read (dev, cpuid_offset, cpuid, cpuid_length);if (ret) {debug ("%s: reading cpuid from the efuses failed\n" , __func__);
PATCH 1/1 rockchip: misc: read the correct number of bytes from the efuse【请注意,邮件由[email protected]代发】
Quoted 10 lines · Kever Yang
Quoted 8 lines · Heiko Stuebner
Originally the cpuid var the value gets read into was defined as u8 cpuid[RK3399_CPUID_LEN];
hence the sizeof(cpuid) would return the correct the correct number of array elements.With the move to a separate function cpuid becomes a pointer and sizeof(cpuid) hence returns the pointer size - 8 in the arm64 case.
Quoted 7 lines
Quoted 5 lines
We do have the actual id length available as function param so use it for actual amount of bytes to read.
Fixes 04825384999f ("rockchip: rk3399: derive ethaddr from cpuid")Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Kever Yang<[email protected]>
Applied to u-boot-rockchip/master.
Quoted 26 lines
Thanks,
- KeverQuoted 10 lines
---
arch/arm/mach-rockchip/misc.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-rockchip/misc.c +0
-0arch/arm/mach-rockchip/misc.c int rockchip_cpuid_from_efuse(const u32 cpuid_offset, · line 80
Quoted 7 lines
arch/arm/mach-rockchip/misc.c +1
-1@@ -75,7 +75,7 @@ int rockchip_cpuid_from_efuse(const u32 cpuid_offset, } /* read the cpu_id range from the efuses */ - ret = misc_read(dev, cpuid_offset, cpuid, sizeof(cpuid)); + ret = misc_read(dev, cpuid_offset, cpuid, cpuid_length); if (ret) { debug("%s: reading cpuid from the efuses failed\n", __func__);_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot