]> git.baikalelectronics.ru Git - uboot.git/commitdiff
stm32mp1: Replace OTP read by SHADOW read
authorPatrick Delaunay <patrick.delaunay@st.com>
Wed, 27 Feb 2019 16:01:29 +0000 (17:01 +0100)
committerPatrick Delaunay <patrick.delaunay@st.com>
Fri, 12 Apr 2019 14:09:13 +0000 (16:09 +0200)
Replace STM32_BSEC_OTP() by STM32_BSEC_SHADOW() to
increase read performance.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
arch/arm/mach-stm32mp/cpu.c

index f39941edfc719c4a4b159a9fb59a54455f5fea4d..7b4431c9c75cf3035a6fc7d0bb189907f259ecfb 100644 (file)
@@ -472,7 +472,7 @@ static int setup_mac_address(void)
        if (ret)
                return ret;
 
-       ret = misc_read(dev, BSEC_OTP_MAC * 4 + STM32_BSEC_OTP_OFFSET,
+       ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_MAC),
                        otp, sizeof(otp));
        if (ret < 0)
                return ret;
@@ -510,7 +510,7 @@ static int setup_serial_number(void)
        if (ret)
                return ret;
 
-       ret = misc_read(dev, BSEC_OTP_SERIAL * 4 + STM32_BSEC_OTP_OFFSET,
+       ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_SERIAL),
                        otp, sizeof(otp));
        if (ret < 0)
                return ret;