diff options
Diffstat (limited to 'cpu/mpc83xx')
| -rw-r--r-- | cpu/mpc83xx/Makefile | 2 | ||||
| -rw-r--r-- | cpu/mpc83xx/cpu.c | 227 | ||||
| -rw-r--r-- | cpu/mpc83xx/pci.c | 192 | ||||
| -rw-r--r-- | cpu/mpc83xx/spd_sdram.c | 11 | ||||
| -rw-r--r-- | cpu/mpc83xx/speed.c | 78 | 
5 files changed, 414 insertions, 96 deletions
| diff --git a/cpu/mpc83xx/Makefile b/cpu/mpc83xx/Makefile index 4b9dcc818..bb96f774f 100644 --- a/cpu/mpc83xx/Makefile +++ b/cpu/mpc83xx/Makefile @@ -29,7 +29,7 @@ LIB	= $(obj)lib$(CPU).a  START	= start.o  COBJS	= traps.o cpu.o cpu_init.o speed.o interrupts.o \ -	  spd_sdram.o qe_io.o +	  spd_sdram.o qe_io.o pci.o  SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)  OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS)) diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c index 21b16463c..e078f27a2 100644 --- a/cpu/mpc83xx/cpu.c +++ b/cpu/mpc83xx/cpu.c @@ -52,13 +52,26 @@ int checkcpu(void)  	immr = (immap_t *)CFG_IMMR; -	if ((pvr & 0xFFFF0000) != PVR_83xx) { -		puts("Not MPC83xx Family!!!\n"); -		return -1; +	puts("CPU:   "); + +	switch (pvr & 0xffff0000) { +		case PVR_E300C1: +			printf("e300c1, "); +			break; + +		case PVR_E300C2: +			printf("e300c2, "); +			break; + +		case PVR_E300C3: +			printf("e300c3, "); +			break; + +		default: +			printf("Unknown core, ");  	}  	spridr = immr->sysconf.spridr; -	puts("CPU: ");  	switch(spridr) {  	case SPR_8349E_REV10:  	case SPR_8349E_REV11: @@ -124,6 +137,18 @@ int checkcpu(void)  	case SPR_8321_REV11:  		puts("MPC8321, ");  		break; +	case SPR_8311_REV10: +		puts("MPC8311, "); +		break; +	case SPR_8311E_REV10: +		puts("MPC8311E, "); +		break; +	case SPR_8313_REV10: +		puts("MPC8313, "); +		break; +	case SPR_8313E_REV10: +		puts("MPC8313E, "); +		break;  	default:  		puts("Rev: Unknown revision number.\nWarning: Unsupported cpu revision!\n");  		return 0; @@ -133,10 +158,12 @@ int checkcpu(void)  	/* Multiple revisons of 834x processors may have the same SPRIDR value.  	 * So use PVR to identify the revision number.  	 */ -	printf("Rev: %02x at %s MHz\n", PVR_MAJ(pvr)<<4 | PVR_MIN(pvr), strmhz(buf, clock)); +	printf("Rev: %02x at %s MHz", PVR_MAJ(pvr)<<4 | PVR_MIN(pvr), strmhz(buf, clock));  #else -	printf("Rev: %02x at %s MHz\n", spridr & 0x0000FFFF, strmhz(buf, clock)); +	printf("Rev: %02x at %s MHz", spridr & 0x0000FFFF, strmhz(buf, clock));  #endif +	printf(", CSB: %4d MHz\n", gd->csb_clk / 1000000); +  	return 0;  } @@ -300,92 +327,174 @@ void watchdog_reset (void)  #if defined(CONFIG_OF_LIBFDT)  /* + * "Setter" functions used to add/modify FDT entries. + */ +static int fdt_set_eth0(void *fdt, int nodeoffset, const char *name, bd_t *bd) +{ +	/* +	 * Fix it up if it exists, don't create it if it doesn't exist. +	 */ +	if (fdt_get_property(fdt, nodeoffset, name, 0)) { +		return fdt_setprop(fdt, nodeoffset, name, bd->bi_enetaddr, 6); +	} +	return -FDT_ERR_NOTFOUND; +} +#ifdef CONFIG_HAS_ETH1 +/* second onboard ethernet port */ +static int fdt_set_eth1(void *fdt, int nodeoffset, const char *name, bd_t *bd) +{ +	/* +	 * Fix it up if it exists, don't create it if it doesn't exist. +	 */ +	if (fdt_get_property(fdt, nodeoffset, name, 0)) { +		return fdt_setprop(fdt, nodeoffset, name, bd->bi_enet1addr, 6); +	} +	return -FDT_ERR_NOTFOUND; +} +#endif +#ifdef CONFIG_HAS_ETH2 +/* third onboard ethernet port */ +static int fdt_set_eth2(void *fdt, int nodeoffset, const char *name, bd_t *bd) +{ +	/* +	 * Fix it up if it exists, don't create it if it doesn't exist. +	 */ +	if (fdt_get_property(fdt, nodeoffset, name, 0)) { +		return fdt_setprop(fdt, nodeoffset, name, bd->bi_enet2addr, 6); +	} +	return -FDT_ERR_NOTFOUND; +} +#endif +#ifdef CONFIG_HAS_ETH3 +/* fourth onboard ethernet port */ +static int fdt_set_eth3(void *fdt, int nodeoffset, const char *name, bd_t *bd) +{ +	/* +	 * Fix it up if it exists, don't create it if it doesn't exist. +	 */ +	if (fdt_get_property(fdt, nodeoffset, name, 0)) { +		return fdt_setprop(fdt, nodeoffset, name, bd->bi_enet3addr, 6); +	} +	return -FDT_ERR_NOTFOUND; +} +#endif + +static int fdt_set_busfreq(void *fdt, int nodeoffset, const char *name, bd_t *bd) +{ +	u32  tmp; +	/* +	 * Create or update the property. +	 */ +	tmp = cpu_to_be32(bd->bi_busfreq); +	return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp)); +} + +/*   * Fixups to the fdt.  If "create" is TRUE, the node is created   * unconditionally.  If "create" is FALSE, the node is updated   * only if it already exists.   */ -#define	FT_UPDATE	0x00000000		/* update existing property only */ -#define	FT_CREATE	0x00000001		/* create property if it doesn't exist */ -#define	FT_BUSFREQ	0x00000002		/* source is bd->bi_busfreq */ -#define	FT_ENETADDR	0x00000004		/* source is bd->bi_enetaddr */  static const struct { -	int  createflags;  	char *node;  	char *prop; +	int (*set_fn)(void *fdt, int nodeoffset, const char *name, bd_t *bd);  } fixup_props[] = { -	{	FT_CREATE | FT_BUSFREQ, -		"/cpus/" OF_CPU, +	{	"/cpus/" OF_CPU,  		 "bus-frequency", +		fdt_set_busfreq  	}, -	{	FT_CREATE | FT_BUSFREQ, -		"/cpus/" OF_SOC, -		"bus-frequency" +	{	"/cpus/" OF_SOC, +		"bus-frequency", +		fdt_set_busfreq  	}, -	{	FT_CREATE | FT_BUSFREQ, -		"/" OF_SOC "/serial@4500/", -		"clock-frequency" +	{	"/" OF_SOC "/serial@4500/", +		"clock-frequency", +		fdt_set_busfreq  	}, -	{	FT_CREATE | FT_BUSFREQ, -		"/" OF_SOC "/serial@4600/", -		"clock-frequency" +	{	"/" OF_SOC "/serial@4600/", +		"clock-frequency", +		fdt_set_busfreq  	},  #ifdef CONFIG_MPC83XX_TSEC1 -	{	FT_UPDATE | FT_ENETADDR, -		"/" OF_SOC "/ethernet@24000, +	{	"/" OF_SOC "/ethernet@24000,  		"mac-address", +		fdt_set_eth0  	}, -	{	FT_UPDATE | FT_ENETADDR, -		"/" OF_SOC "/ethernet@24000, +	{	"/" OF_SOC "/ethernet@24000,  		"local-mac-address", +		fdt_set_eth0  	},  #endif  #ifdef CONFIG_MPC83XX_TSEC2 -	{	FT_UPDATE | FT_ENETADDR, -		"/" OF_SOC "/ethernet@25000, +	{	"/" OF_SOC "/ethernet@25000, +		"mac-address", +		fdt_set_eth1 +	}, +	{	"/" OF_SOC "/ethernet@25000, +		"local-mac-address", +		fdt_set_eth1 +	}, +#endif +#ifdef CONFIG_UEC_ETH1 +#if CFG_UEC1_UCC_NUM == 0  /* UCC1 */ +	{	"/" OF_QE "/ucc@2000/mac-address", +		"mac-address", +		fdt_set_eth0 +	}, +	{	"/" OF_QE "/ucc@2000/mac-address", +		"local-mac-address", +		fdt_set_eth0 +	}, +#elif CFG_UEC1_UCC_NUM == 2  /* UCC3 */ +	{	"/" OF_QE "/ucc@2200/mac-address",  		"mac-address", +		fdt_set_eth0  	}, -	{	FT_UPDATE | FT_ENETADDR, -		"/" OF_SOC "/ethernet@25000, +	{	"/" OF_QE "/ucc@2200/mac-address",  		"local-mac-address", +		fdt_set_eth0  	},  #endif +#endif +#ifdef CONFIG_UEC_ETH2 +#if CFG_UEC2_UCC_NUM == 1  /* UCC2 */ +	{	"/" OF_QE "/ucc@3000/mac-address", +		"mac-address", +		fdt_set_eth1 +	}, +	{	"/" OF_QE "/ucc@3000/mac-address", +		"local-mac-address", +		fdt_set_eth1 +	}, +#elif CFG_UEC1_UCC_NUM == 3  /* UCC4 */ +	{	"/" OF_QE "/ucc@3200/mac-address", +		"mac-address", +		fdt_set_eth1 +	}, +	{	"/" OF_QE "/ucc@3200/mac-address", +		"local-mac-address", +		fdt_set_eth1 +	}, +#endif +#endif  };  void  ft_cpu_setup(void *blob, bd_t *bd)  { -	int   nodeoffset; -	int   err; -	int j; +	int  nodeoffset; +	int  err; +	int  j;  	for (j = 0; j < (sizeof(fixup_props) / sizeof(fixup_props[0])); j++) { -		nodeoffset = fdt_path_offset (fdt, fixup_props[j].node); +		nodeoffset = fdt_path_offset(fdt, fixup_props[j].node);  		if (nodeoffset >= 0) { -			/* -			 * If unconditional create or the property already exists... -			 */ -			if ((fixup_props[j].createflags & FT_CREATE) || -				(fdt_get_property(fdt, nodeoffset, fixup_props[j].prop, 0))) { -				if (fixup_props[j].createflags & FT_BUSFREQ) { -					u32   tmp; - -					tmp = cpu_to_be32(bd->bi_busfreq); -					err = fdt_setprop(fdt, nodeoffset, -							fixup_props[j].prop, &tmp, sizeof(tmp)); -				} else if (fixup_props[j].createflags & FT_ENETADDR) { -					err = fdt_setprop(fdt, nodeoffset, -							fixup_props[j].prop, bd->bi_enetaddr, 6); -				} else { -					printf("ft_cpu_setup: %s %s has no flag for the value to set\n", -						fixup_props[j].node, -						fixup_props[j].prop); -				} -				if (err < 0) -					printf("libfdt: %s %s returned %s\n", -						fixup_props[j].node, -						fixup_props[j].prop, -						fdt_strerror(err)); -			} +			err = (*fixup_props[j].set_fn)(blob, nodeoffset, fixup_props[j].prop, bd); +			if (err < 0) +				printf("set_fn/libfdt: %s %s returned %s\n", +					fixup_props[j].node, +					fixup_props[j].prop, +					fdt_strerror(err));  		}  	}  } diff --git a/cpu/mpc83xx/pci.c b/cpu/mpc83xx/pci.c new file mode 100644 index 000000000..785d6129d --- /dev/null +++ b/cpu/mpc83xx/pci.c @@ -0,0 +1,192 @@ +/* + * Copyright (C) Freescale Semiconductor, Inc. 2007 + * + * Author: Scott Wood <scottwood@freescale.com>, + * with some bits from older board-specific PCI initialization. + * + * 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 + */ + +#include <common.h> +#include <pci.h> +#include <ft_build.h> +#include <asm/mpc8349_pci.h> + +#ifdef CONFIG_83XX_GENERIC_PCI +#define MAX_BUSES 2 + +DECLARE_GLOBAL_DATA_PTR; + +static struct pci_controller pci_hose[MAX_BUSES]; +static int pci_num_buses; + +static void pci_init_bus(int bus, struct pci_region *reg) +{ +	volatile immap_t *immr = (volatile immap_t *)CFG_IMMR; +	volatile pot83xx_t *pot = immr->ios.pot; +	volatile pcictrl83xx_t *pci_ctrl = &immr->pci_ctrl[bus]; +	struct pci_controller *hose = &pci_hose[bus]; +	u32 dev; +	u16 reg16; +	int i; + +	if (bus == 1) +		pot += 3; + +	/* Setup outbound translation windows */ +	for (i = 0; i < 3; i++, reg++, pot++) { +		if (reg->size == 0) +			break; + +		hose->regions[i] = *reg; +		hose->region_count++; + +		pot->potar = reg->bus_start >> 12; +		pot->pobar = reg->phys_start >> 12; +		pot->pocmr = ~(reg->size - 1) >> 12; + +		if (reg->flags & PCI_REGION_IO) +			pot->pocmr |= POCMR_IO; +#ifdef CONFIG_83XX_PCI_STREAMING +		else if (reg->flags & PCI_REGION_PREFETCH) +			pot->pocmr |= POCMR_SE; +#endif + +		if (bus == 1) +			pot->pocmr |= POCMR_DST; + +		pot->pocmr |= POCMR_EN; +	} + +	/* Point inbound translation at RAM */ +	pci_ctrl->pitar1 = 0; +	pci_ctrl->pibar1 = 0; +	pci_ctrl->piebar1 = 0; +	pci_ctrl->piwar1 = PIWAR_EN | PIWAR_PF | PIWAR_RTT_SNOOP | +	                   PIWAR_WTT_SNOOP | (__ilog2(gd->ram_size) - 1); + +	i = hose->region_count++; +	hose->regions[i].bus_start = 0; +	hose->regions[i].phys_start = 0; +	hose->regions[i].size = gd->ram_size; +	hose->regions[i].flags = PCI_REGION_MEM | PCI_REGION_MEMORY; + +	hose->first_busno = 0; +	hose->last_busno = 0xff; + +	pci_setup_indirect(hose, CFG_IMMR + 0x8300 + bus * 0x80, +	                         CFG_IMMR + 0x8304 + bus * 0x80); + +	pci_register_hose(hose); + +	/* +	 * Write to Command register +	 */ +	reg16 = 0xff; +	dev = PCI_BDF(hose->first_busno, 0, 0); +	pci_hose_read_config_word(hose, dev, PCI_COMMAND, ®16); +	reg16 |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY; +	pci_hose_write_config_word(hose, dev, PCI_COMMAND, reg16); + +	/* +	 * Clear non-reserved bits in status register. +	 */ +	pci_hose_write_config_word(hose, dev, PCI_STATUS, 0xffff); +	pci_hose_write_config_byte(hose, dev, PCI_LATENCY_TIMER, 0x80); +	pci_hose_write_config_byte(hose, dev, PCI_CACHE_LINE_SIZE, 0x08); + +#ifdef CONFIG_PCI_SCAN_SHOW +	printf("PCI:   Bus Dev VenId DevId Class Int\n"); +#endif +	/* +	 * Hose scan. +	 */ +	hose->last_busno = pci_hose_scan(hose); +} + +/* + * The caller must have already set OCCR, and the PCI_LAW BARs + * must have been set to cover all of the requested regions. + * + * If fewer than three regions are requested, then the region + * list is terminated with a region of size 0. + */ +void mpc83xx_pci_init(int num_buses, struct pci_region **reg, int warmboot) +{ +	volatile immap_t *immr = (volatile immap_t *)CFG_IMMR; +	int i; + +	if (num_buses > MAX_BUSES) { +		printf("%d PCI buses requsted, %d supported\n", +		       num_buses, MAX_BUSES); + +		num_buses = MAX_BUSES; +	} + +	pci_num_buses = num_buses; + +	/* +	 * Release PCI RST Output signal. +	 * Power on to RST high must be at least 100 ms as per PCI spec. +	 * On warm boots only 1 ms is required. +	 */ +	udelay(warmboot ? 1000 : 100000); + +	for (i = 0; i < num_buses; i++) +		immr->pci_ctrl[i].gcr = 1; + +	/* +	 * RST high to first config access must be at least 2^25 cycles +	 * as per PCI spec.  This could be cut in half if we know we're +	 * running at 66MHz.  This could be insufficiently long if we're +	 * running the PCI bus at significantly less than 33MHz. +	 */ +	udelay(1020000); + +	for (i = 0; i < num_buses; i++) +		pci_init_bus(i, reg[i]); +} + +#ifdef CONFIG_OF_FLAT_TREE +void ft_pci_setup(void *blob, bd_t *bd) +{ +	u32 *p; +	int len; + +	if (pci_num_buses < 1) +		return; + +	p = (u32 *)ft_get_prop(blob, "/" OF_SOC "/pci@8500/bus-range", &len); +	if (p) { +		p[0] = pci_hose[0].first_busno; +		p[1] = pci_hose[0].last_busno; +	} + +	if (pci_num_buses < 2) +		return; + +	p = (u32 *)ft_get_prop(blob, "/" OF_SOC "/pci@8600/bus-range", &len); +	if (p) { +		p[0] = pci_hose[1].first_busno; +		p[1] = pci_hose[1].last_busno; +	} +} +#endif /* CONFIG_OF_FLAT_TREE */ + +#endif /* CONFIG_83XX_GENERIC_PCI */ diff --git a/cpu/mpc83xx/spd_sdram.c b/cpu/mpc83xx/spd_sdram.c index d9b8753ca..647813f68 100644 --- a/cpu/mpc83xx/spd_sdram.c +++ b/cpu/mpc83xx/spd_sdram.c @@ -58,8 +58,8 @@ picos_to_clk(int picos)  	int clks;  	ddr_bus_clk = gd->ddr_clk >> 1; -	clks = picos / ((1000000000 / ddr_bus_clk) * 1000); -	if (picos % ((1000000000 / ddr_bus_clk) * 1000) != 0) +	clks = picos / (1000000000 / (ddr_bus_clk / 1000)); +	if (picos % (1000000000 / (ddr_bus_clk / 1000)) != 0)  		clks++;  	return clks; @@ -624,7 +624,7 @@ long int spd_sdram()  			 | (1 << (16 + 10))             /* DQS Differential disable */  			 | (add_lat << (16 + 3))        /* Additive Latency in EMRS1 */  			 | (mode_odt_enable << 16)      /* ODT Enable in EMRS1 */ -			 | ((twr_clk >> 1) << 9)        /* Write Recovery Autopre */ +			 | ((twr_clk - 1) << 9)         /* Write Recovery Autopre */  			 | (caslat << 4)                /* caslat */  			 | (burstlen << 0)              /* Burst length */  			); @@ -693,11 +693,6 @@ long int spd_sdram()  #ifdef CFG_DDR_SDRAM_CLK_CNTL	/* Optional platform specific value */  	ddr->sdram_clk_cntl = CFG_DDR_SDRAM_CLK_CNTL; -#else -	/* SS_EN = 0, source synchronous disable -	 * CLK_ADJST = 0, MCK/MCK# is launched aligned with addr/cmd -	 */ -	ddr->sdram_clk_cntl = 0x00000000;  #endif  	debug("DDR:sdram_clk_cntl=0x%08x\n", ddr->sdram_clk_cntl); diff --git a/cpu/mpc83xx/speed.c b/cpu/mpc83xx/speed.c index c75993059..bf3061654 100644 --- a/cpu/mpc83xx/speed.c +++ b/cpu/mpc83xx/speed.c @@ -25,6 +25,7 @@  #include <common.h>  #include <mpc83xx.h> +#include <command.h>  #include <asm/processor.h>  DECLARE_GLOBAL_DATA_PTR; @@ -99,12 +100,14 @@ int get_clocks(void)  	u32 lcrr;  	u32 csb_clk; -#if defined(CONFIG_MPC834X) +#if defined(CONFIG_MPC834X) || defined(CONFIG_MPC831X)  	u32 tsec1_clk;  	u32 tsec2_clk; -	u32 usbmph_clk;  	u32 usbdr_clk;  #endif +#ifdef CONFIG_MPC834X +	u32 usbmph_clk; +#endif  	u32 core_clk;  	u32 i2c1_clk;  #if !defined(CONFIG_MPC832X) @@ -148,7 +151,7 @@ int get_clocks(void)  	sccr = im->clk.sccr; -#if defined(CONFIG_MPC834X) +#if defined(CONFIG_MPC834X) || defined(CONFIG_MPC831X)  	switch ((sccr & SCCR_TSEC1CM) >> SCCR_TSEC1CM_SHIFT) {  	case 0:  		tsec1_clk = 0; @@ -167,6 +170,26 @@ int get_clocks(void)  		return -4;  	} +	switch ((sccr & SCCR_USBDRCM) >> SCCR_USBDRCM_SHIFT) { +	case 0: +		usbdr_clk = 0; +		break; +	case 1: +		usbdr_clk = csb_clk; +		break; +	case 2: +		usbdr_clk = csb_clk / 2; +		break; +	case 3: +		usbdr_clk = csb_clk / 3; +		break; +	default: +		/* unkown SCCR_USBDRCM value */ +		return -8; +	} +#endif + +#if defined(CONFIG_MPC834X)  	switch ((sccr & SCCR_TSEC2CM) >> SCCR_TSEC2CM_SHIFT) {  	case 0:  		tsec2_clk = 0; @@ -205,24 +228,6 @@ int get_clocks(void)  		return -7;  	} -	switch ((sccr & SCCR_USBDRCM) >> SCCR_USBDRCM_SHIFT) { -	case 0: -		usbdr_clk = 0; -		break; -	case 1: -		usbdr_clk = csb_clk; -		break; -	case 2: -		usbdr_clk = csb_clk / 2; -		break; -	case 3: -		usbdr_clk = csb_clk / 3; -		break; -	default: -		/* unkown SCCR_USBDRCM value */ -		return -8; -	} -  	if (usbmph_clk != 0 && usbdr_clk != 0 && usbmph_clk != usbdr_clk) {  		/* if USB MPH clock is not disabled and  		 * USB DR clock is not disabled then @@ -230,8 +235,16 @@ int get_clocks(void)  		 */  		return -9;  	} +#elif defined(CONFIG_MPC831X) +	tsec2_clk = tsec1_clk; + +	if (!(sccr & SCCR_TSEC1ON)) +		tsec1_clk = 0; +	if (!(sccr & SCCR_TSEC2ON)) +		tsec2_clk = 0;  #endif -#if defined(CONFIG_MPC8360) || defined(CONFIG_MPC832X) + +#if !defined(CONFIG_MPC834X)  	i2c1_clk = csb_clk;  #endif  #if !defined(CONFIG_MPC832X) @@ -314,12 +327,14 @@ int get_clocks(void)  #endif  	gd->csb_clk = csb_clk; -#if defined(CONFIG_MPC834X) +#if defined(CONFIG_MPC834X) || defined(CONFIG_MPC831X)  	gd->tsec1_clk = tsec1_clk;  	gd->tsec2_clk = tsec2_clk; -	gd->usbmph_clk = usbmph_clk;  	gd->usbdr_clk = usbdr_clk;  #endif +#if defined(CONFIG_MPC834X) +	gd->usbmph_clk = usbmph_clk; +#endif  	gd->core_clk = core_clk;  	gd->i2c1_clk = i2c1_clk;  #if !defined(CONFIG_MPC832X) @@ -351,11 +366,11 @@ ulong get_bus_freq(ulong dummy)  	return gd->csb_clk;  } -int print_clock_conf(void) +int do_clocks (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])  {  	printf("Clock configuration:\n"); -	printf("  Coherent System Bus: %4d MHz\n", gd->csb_clk / 1000000);  	printf("  Core:                %4d MHz\n", gd->core_clk / 1000000); +	printf("  Coherent System Bus: %4d MHz\n", gd->csb_clk / 1000000);  #if defined(CONFIG_MPC8360) || defined(CONFIG_MPC832X)  	printf("  QE:                  %4d MHz\n", gd->qe_clk / 1000000);  	printf("  BRG:                 %4d MHz\n", gd->brg_clk / 1000000); @@ -371,11 +386,18 @@ int print_clock_conf(void)  #if !defined(CONFIG_MPC832X)  	printf("  I2C2:                %4d MHz\n", gd->i2c2_clk / 1000000);  #endif -#if defined(CONFIG_MPC834X) +#if defined(CONFIG_MPC834X) || defined(CONFIG_MPC831X)  	printf("  TSEC1:               %4d MHz\n", gd->tsec1_clk / 1000000);  	printf("  TSEC2:               %4d MHz\n", gd->tsec2_clk / 1000000); -	printf("  USB MPH:             %4d MHz\n", gd->usbmph_clk / 1000000);  	printf("  USB DR:              %4d MHz\n", gd->usbdr_clk / 1000000);  #endif +#if defined(CONFIG_MPC834X) +	printf("  USB MPH:             %4d MHz\n", gd->usbmph_clk / 1000000); +#endif  	return 0;  } + +U_BOOT_CMD(clocks, 1, 0, do_clocks, +	"clocks  - print clock configuration\n", +	"    clocks\n" +); |