 /*
 * Copyright 2004 Freescale Semiconductor.
 * (C) Copyright 2002,2003, Motorola Inc.
 * Xianghua Xiao, (X.Xiao@motorola.com)
 *
 * (C) Copyright 2002 Scott McNutt <smcnutt@artesyncp.com>
 *
 * 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
 */

#undef PQ37PC_DEBUG
#ifdef PQ37PC_DEBUG
	#define DEBUG(arg...) printf(arg)
#else
	#define DEBUG(arg...)
#endif

#include <common.h>
#include <asm/processor.h>
#include <asm/immap_85xx.h>

#include "../common/pq37pc.h"

int checkboard (void)
{
  volatile immap_t *immap = (immap_t *)CFG_CCSRBAR;
  volatile ccsr_gur_t *gur = &immap->im_gur;
  vu_char  *base = CFG_LED_BASE;
  uint boot0 = (*base & 0x10) >> 4;
  uint pci1_32 = gur->pordevsr & 0x10000;	/* PORDEVSR[15] */
  *base = 0xf0;
	
  DEBUG("%s: ENTER\n", __FUNCTION__);
  printf("\nBoard: PQ37 Processor Card Rev. %.1c.\n", ((*base & 0x3) + 'A'));  
  printf("       --Boot Flash is %s\n\n", (boot0 == 0) ? "U13" : "U8");

#ifdef CONFIG_PCI
	printf("PCI1:  %d bit, %d MHz, syn\n",
	           (pci1_32) ? 32 : 64, CONFIG_SYS_CLK_FREQ / 1000000);
#else
	printf("PCI1:  disabled\n");
#endif

	/*
	 * Initialize local bus.
	 */
	local_bus_init();
	DEBUG("%s: EXIT\n", __FUNCTION__);
	return 0;
}
