]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - board/karo/common/env.c
karo: tx6: rework PMIC code to allow for different configs for same chip
[karo-tx-uboot.git] / board / karo / common / env.c
1 /*
2  * (C) Copyright 2014 Lothar Waßmann <LW@KARO-electronics.de>
3  *
4  * See file CREDITS for list of people who contributed to this
5  * project.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * version 2 as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  */
17
18 #include <common.h>
19 #include <errno.h>
20 #include <libfdt.h>
21 #include <fdt_support.h>
22 #include <environment.h>
23
24 #include "karo.h"
25
26 DECLARE_GLOBAL_DATA_PTR;
27
28 #ifdef CONFIG_UBOOT_IGNORE_ENV
29 void env_cleanup(void)
30 {
31         set_default_env(NULL);
32 }
33 #else
34 static const char const *cleanup_vars[] = {
35         "bootargs",
36         "fileaddr",
37         "filesize",
38         "safeboot",
39         "wdreset",
40 };
41
42 void env_cleanup(void)
43 {
44         size_t i;
45
46         for (i = 0; i < ARRAY_SIZE(cleanup_vars); i++) {
47                 setenv(cleanup_vars[i], NULL);
48         }
49 }
50 #endif