X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=board%2Fhermes%2Fhermes.c;h=6126b73442f9c4722e62e942fcd025d083e89f69;hb=0df8afdf107268198e706ce84b71820db3572936;hp=9a3e5f669092ffb19851ee6ad2d2d7464a7b4f90;hpb=156feb90d200f186cdfd856d7f6f1878bb1bec1e;p=u-boot diff --git a/board/hermes/hermes.c b/board/hermes/hermes.c index 9a3e5f6690..6126b73442 100644 --- a/board/hermes/hermes.c +++ b/board/hermes/hermes.c @@ -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 @@ -27,7 +11,7 @@ #ifdef CONFIG_SHOW_BOOT_PROGRESS # include -# define SHOW_BOOT_PROGRESS(arg) show_boot_progress(arg) +# define SHOW_BOOT_PROGRESS(arg) bootstage_mark(arg) #else # define SHOW_BOOT_PROGRESS(arg) #endif @@ -107,21 +91,19 @@ const uint sdram_table[] = { int checkboard (void) { - char *s = getenv ("serial#"); - char *e; + char buf[64]; + int i; + int l = getenv_f("serial#", buf, sizeof(buf)); puts ("Board: "); - if (!s || strncmp (s, "HERMES", 6)) { + if (l < 0 || strncmp(buf, "HERMES", 6)) { puts ("### No HW ID - assuming HERMES-PRO"); } else { - for (e = s; *e; ++e) { - if (*e == ' ') + for (i = 0; i < l; i++) { + if (buf[i] == ' ') break; - } - - for (; s < e; ++s) { - putc (*s); + putc (buf[i]); } } @@ -372,7 +354,7 @@ static ulong board_init (void) immr->im_ioport.iop_pcdat |= PC_REP_RES; } } - SHOW_BOOT_PROGRESS (0x00); + SHOW_BOOT_PROGRESS(BOOTSTAGE_ID_CHECK_MAGIC); return ((revision << 16) | (speed & 0xFFFF)); } @@ -597,7 +579,9 @@ void show_boot_progress (int status) { volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR; - if (status < -32) status = -1; /* let things compatible */ + /* let things compatible */ + if (status < -BOOTSTAGE_ID_POST_FAIL_R) + status = -1; status ^= 0x0F; status = (status & 0x0F) << 14; immr->im_cpm.cp_pbdat = (immr->im_cpm.cp_pbdat & ~PB_LED_ALL) | status;