]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/rbc823/rbc823.c
cros_ec: Add an enum for the number of flash regions
[karo-tx-uboot.git] / board / rbc823 / rbc823.c
index b2949060c029448fc2ef9427ec541a6b3aa7ac53..5881111c70e7c43bfcf6fdc0eb568757fe7b6742 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2000
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -94,7 +78,7 @@ const uint static_table[] =
        0x0FFFFC04, 0x0FF3FC04, 0x0FF3CC04, 0x0FF3CC04,
        0x0FF3EC04, 0x0FF3CC00, 0x0FF7FC04, 0x3FFFFC04,
        0xFFFFFC04, 0xFFFFFC05, /* last */
-                               _NOT_USED_, _NOT_USED_,
+                               _NOT_USED_, _NOT_USED_,
        _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
        _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
        _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
@@ -127,15 +111,16 @@ const uint static_table[] =
 
 int checkboard (void)
 {
-       char *s = getenv ("serial#");
+       char buf[64];
+       int i = getenv_f("serial#", buf, sizeof(buf));
 
-       if (!s || strncmp (s, "TQM8", 4)) {
+       if (i < 0 || strncmp(buf, "TQM8", 4)) {
                printf ("### No HW ID - assuming RBC823\n");
                return (0);
        }
 
-       puts (s);
-       putc ('\n');
+       puts(buf);
+       putc('\n');
 
        return (0);
 }
@@ -256,6 +241,7 @@ static long int dram_size (long int mamr_value, long int *base,
        return (get_ram_size (base, maxsize));
 }
 
+#ifdef CONFIG_CMD_DOC
 void doc_init (void)
 {
        volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
@@ -267,3 +253,4 @@ void doc_init (void)
 
        doc_probe (FLASH_BASE1_PRELIM);
 }
+#endif