]> Git Repo - J-u-boot.git/blob - drivers/bootcount/bootcount_env.c
net: fec: phy: Don't advertise Gbit on (R)MII
[J-u-boot.git] / drivers / bootcount / bootcount_env.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2013
4  * Heiko Schocher, DENX Software Engineering, [email protected].
5  */
6
7 #include <env.h>
8
9 void bootcount_store(ulong a)
10 {
11         int upgrade_available = env_get_ulong("upgrade_available", 10, 0);
12
13         if (upgrade_available) {
14                 env_set_ulong("bootcount", a);
15                 env_save();
16         }
17 }
18
19 ulong bootcount_load(void)
20 {
21         int upgrade_available = env_get_ulong("upgrade_available", 10, 0);
22         ulong val = 0;
23
24         if (upgrade_available)
25                 val = env_get_ulong("bootcount", 10, 0);
26
27         return val;
28 }
This page took 0.0259 seconds and 4 git commands to generate.