[U-Boot] [PATCH 1/2] mxc_ocotp: Do not disable the OCOTP clock after every access

Benoît Thébaudeau benoit.thebaudeau.dev at gmail.com
Tue Nov 25 21:13:22 CET 2014


Hi Fabio,

On Tue, Nov 25, 2014 at 8:56 PM, Fabio Estevam <festevam at gmail.com> wrote:
> On Tue, Nov 25, 2014 at 5:48 PM, Benoît Thébaudeau
> <benoit.thebaudeau.dev at gmail.com> wrote:
>
>> That, or:
>>  - Make imx_get_mac_from_fuse() call enable_ocotp_clk(1) before
>> reading the fuses, then call enable_ocotp_clk(0).
>
> Yes, I started with this exact same approach as well. It works, but
> Nitin told me he also had similiar issues with hab.
>
> Other issue I see with such approach is that if people would try to
> read the ocotp registers manually in the U-boot prompt (via md.l
> command), then they will also get a hang.

If users access the OCOTP registers manually, they can also enable the
OCOTP clock in the corresponding register beforehand, even if this
complicates things.

>>  - Make enable_ocotp_clk() return the clock initial state and store it
>> in prepare_access(), then restore it in finish_access(). Same in
>> imx_get_mac_from_fuse().
>
> This would work as well, but with some more complexity. Still would
> cause the hang via manual readings.
>
>> Which of these 3 choices do you think would be the best?
>
> I think the simplest one and the one that would be more general would
> be the one proposed by this patch.

The only possible issue that I see with leaving the OCOTP clock
enabled is the risk of inadvertently writing the fuses, either in
U-Boot or in the booted OS. That being said, Freescale advise against
leaving the fuses powered for production boards, in which cases there
is no such risk.

Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau.dev at gmail.com>

Regards,
Benoît


More information about the U-Boot mailing list