]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/amcc/bamboo/bamboo.c
Merge branch 'u-boot/master' into u-boot-arm/master
[karo-tx-uboot.git] / board / amcc / bamboo / bamboo.c
index 99497b2d427bb8c53027dda7c8fa3f6e74afb288..84bbacf4c501f0e8f1a415f12934a5cab2e2ae12 100644 (file)
@@ -2,28 +2,12 @@
  * (C) Copyright 2005-2007
  * Stefan Roese, DENX Software Engineering, sr@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>
 #include <asm/processor.h>
-#include <asm/gpio.h>
+#include <asm/ppc4xx-gpio.h>
 #include <spd_sdram.h>
 #include <asm/ppc440.h>
 #include "bamboo.h"
@@ -440,12 +424,13 @@ int board_early_init_f(void)
 
 int checkboard(void)
 {
-       char *s = getenv("serial#");
+       char buf[64];
+       int i = getenv_f("serial#", buf, sizeof(buf));
 
        printf("Board: Bamboo - AMCC PPC440EP Evaluation Board");
-       if (s != NULL) {
+       if (i > 0) {
                puts(", serial# ");
-               puts(s);
+               puts(buf);
        }
        putc('\n');
 
@@ -476,16 +461,16 @@ int is_powerpc440ep_pass1(void)
        pvr = get_pvr();
 
        if (pvr == PVR_POWERPC_440EP_PASS1)
-               return TRUE;
+               return true;
        else if (pvr == PVR_POWERPC_440EP_PASS2)
-               return FALSE;
+               return false;
        else {
                printf("brdutil error 3\n");
                for (;;)
                        ;
        }
 
-       return(FALSE);
+       return false;
 }
 
 /*----------------------------------------------------------------------------+
@@ -494,9 +479,9 @@ int is_powerpc440ep_pass1(void)
 int is_nand_selected(void)
 {
 #ifdef CONFIG_BAMBOO_NAND
-       return TRUE;
+       return true;
 #else
-       return FALSE;
+       return false;
 #endif
 }
 
@@ -506,7 +491,7 @@ int is_nand_selected(void)
 unsigned char config_on_ebc_cs4_is_small_flash(void)
 {
        /* Not implemented yet => returns constant value */
-       return TRUE;
+       return true;
 }
 
 /*----------------------------------------------------------------------------+
@@ -554,13 +539,13 @@ void ext_bus_cntlr_init(void)
          |
          +-------------------------------------------------------------------------*/
        /* Read Pin Strap Register in PPC440EP */
-       mfsdr(sdr_pstrp0, sdr0_pstrp0);
+       mfsdr(SDR0_PINSTP, sdr0_pstrp0);
        bootstrap_settings = sdr0_pstrp0 & SDR0_PSTRP0_BOOTSTRAP_MASK;
 
        /*-------------------------------------------------------------------------+
          |  PPC440EP Pass1
          +-------------------------------------------------------------------------*/
-       if (is_powerpc440ep_pass1() == TRUE) {
+       if (is_powerpc440ep_pass1() == true) {
                switch(bootstrap_settings) {
                case SDR0_PSTRP0_BOOTSTRAP_SETTINGS0:
                        /* Default Strap Settings 0 : CPU 400 - PLB 133 - Boot EBC 8 bit 33MHz */
@@ -737,7 +722,7 @@ void ext_bus_cntlr_init(void)
                /*------------------------------------------------------------------------- */
                ebc0_cs0_bnap_value = EBC0_BNAP_SMALL_FLASH;
                ebc0_cs0_bncr_value = EBC0_BNCR_SMALL_FLASH_CS0;
-               if ((is_nand_selected()) == TRUE) {
+               if ((is_nand_selected()) == true) {
                        /* NAND Flash */
                        ebc0_cs1_bnap_value = EBC0_BNAP_NAND_FLASH;
                        ebc0_cs1_bncr_value = EBC0_BNCR_NAND_FLASH_CS1;
@@ -764,7 +749,7 @@ void ext_bus_cntlr_init(void)
                /*------------------------------------------------------------------------- */
                ebc0_cs0_bnap_value = EBC0_BNAP_LARGE_FLASH_OR_SRAM;
                ebc0_cs0_bncr_value = EBC0_BNCR_LARGE_FLASH_OR_SRAM_CS0;
-               if ((is_nand_selected()) == TRUE) {
+               if ((is_nand_selected()) == true) {
                        /* NAND Flash */
                        ebc0_cs1_bnap_value = EBC0_BNAP_NAND_FLASH;
                        ebc0_cs1_bncr_value = EBC0_BNCR_NAND_FLASH_CS1;
@@ -811,7 +796,7 @@ void ext_bus_cntlr_init(void)
                ebc0_cs0_bnap_value = 0;
                ebc0_cs0_bncr_value = 0;
 
-               if ((is_nand_selected()) == TRUE) {
+               if ((is_nand_selected()) == true) {
                        /* NAND Flash */
                        ebc0_cs1_bnap_value = EBC0_BNAP_NAND_FLASH;
                        ebc0_cs1_bncr_value = EBC0_BNCR_NAND_FLASH_CS1;
@@ -829,7 +814,7 @@ void ext_bus_cntlr_init(void)
                        ebc0_cs3_bncr_value = 0;
                }
 
-               if ((config_on_ebc_cs4_is_small_flash()) == TRUE) {
+               if ((config_on_ebc_cs4_is_small_flash()) == true) {
                        /* Small Flash */
                        ebc0_cs4_bnap_value = EBC0_BNAP_SMALL_FLASH;
                        ebc0_cs4_bncr_value = EBC0_BNCR_SMALL_FLASH_CS4;