[U-Boot-Users] [PATCH 3/3] ppc4xx: Add initial esd PMC440 board support

Stefan Roese sr at denx.de
Fri Nov 9 16:33:12 CET 2007


Hi Matthias,

On Friday 09 November 2007, Matthias Fuchs wrote:
> ppc4xx: Add initial esd PMC440 board support
>
> This patch is based on Stefan's for-1.3.1 branch.
>
> Signed-off-by: Matthias Fuchs <matthias.fuchs at esd-electronics.com>
>
> ---
> commit 69a91d4b1575d1dec7b38c163fc0bcadb8b79705
> tree 55c7dbafa6b182a65abbc8dd252788aa22ce8359
> parent e2166ace3e44dd42196d2c0ce41367ec9950ffb8
> author Matthias Fuchs <matthias.fuchs at esd-electronics.com> Fri, 09 Nov 2007
> 15:53:46 +0100 committer Matthias Fuchs
> <matthias.fuchs at esd-electronics.com> Fri, 09 Nov 2007 15:53:46 +0100
>
>  Makefile                         |    3
>  board/esd/pmc440/Makefile        |   53 ++
>  board/esd/pmc440/cmd_pmc440.c    |  555 +++++++++++++++++++++++++
>  board/esd/pmc440/config.mk       |   41 ++
>  board/esd/pmc440/fpga.c          |  463 +++++++++++++++++++++
>  board/esd/pmc440/fpga.h          |   49 ++
>  board/esd/pmc440/init.S          |  170 ++++++++
>  board/esd/pmc440/pmc440.c        |  839
> ++++++++++++++++++++++++++++++++++++++ board/esd/pmc440/pmc440.h        | 
> 148 +++++++
>  board/esd/pmc440/sdram.c         |  442 ++++++++++++++++++++
>  board/esd/pmc440/sdram.h         |  505 +++++++++++++++++++++++
>  board/esd/pmc440/u-boot-nand.lds |  137 ++++++
>  board/esd/pmc440/u-boot.lds      |  145 +++++++
>  13 files changed, 3550 insertions(+), 0 deletions(-)

You forgot to add your new board port to MAKEALL and MAINTAINERS. Please add 
this in the next respin.

And where is the board config file (include/configs/PMC440.h)?

> diff --git a/Makefile b/Makefile
> index 814bba8..f79d357 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1225,6 +1225,9 @@ PLU405_config:	unconfig
>  PMC405_config:	unconfig
>  	@$(MKCONFIG) $(@:_config=) ppc ppc4xx pmc405 esd
>
> +PMC440_config:	unconfig
> +	@$(MKCONFIG) $(@:_config=) ppc ppc4xx pmc440 esd
> +
>  PPChameleonEVB_config		\
>  PPChameleonEVB_BA_25_config	\
>  PPChameleonEVB_ME_25_config	\
> diff --git a/board/esd/pmc440/Makefile b/board/esd/pmc440/Makefile
> new file mode 100644
> index 0000000..4dd9c38
> --- /dev/null
> +++ b/board/esd/pmc440/Makefile
> @@ -0,0 +1,53 @@
> +#
> +# (C) Copyright 2002-2006
> +# Wolfgang Denk, DENX Software Engineering, wd at 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
> +#
> +
> +include $(TOPDIR)/config.mk
> +
> +LIB	= $(obj)lib$(BOARD).a
> +
> +COBJS	= $(BOARD).o cmd_pmc440.o sdram.o fpga.o \
> +	../common/cmd_loadpci.o
> +
> +SOBJS	= init.o
> +
> +SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
> +OBJS	:= $(addprefix $(obj),$(COBJS))
> +SOBJS	:= $(addprefix $(obj),$(SOBJS))
> +
> +$(LIB):	$(OBJS) $(SOBJS)
> +	$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
> +
> +clean:
> +	rm -f $(SOBJS) $(OBJS)
> +
> +distclean:	clean
> +	rm -f $(LIB) core *.bak .depend
> +
> +#########################################################################
> +
> +# defines $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#########################################################################
> diff --git a/board/esd/pmc440/cmd_pmc440.c b/board/esd/pmc440/cmd_pmc440.c
> new file mode 100644
> index 0000000..2fdce11
> --- /dev/null
> +++ b/board/esd/pmc440/cmd_pmc440.c
> @@ -0,0 +1,555 @@
> +/*
> + * (C) Copyright 2007
> + * Matthias Fuchs, esd Gmbh, matthias.fuchs at esd-electronics.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
> + *
> + */
> +
> +#include <common.h>
> +#include <command.h>
> +#include <asm/io.h>
> +
> +#include <asm/processor.h>
> +
> +#include "pmc440.h"
> +
> +int is_monarch(void);
> +int bootstrap_eeprom_write (unsigned dev_addr, unsigned offset, uchar
> *buffer, unsigned cnt); +int eeprom_write_enable (unsigned dev_addr, int
> state);
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +#ifdef CONFIG_CMD_BSP
> +
> +static int got_fifoirq;
> +static int got_hcirq;
> +
> +int fpga_interrupt(u32 arg)
> +{
> +	pmc440_fpga_t *fpga = (pmc440_fpga_t *)arg;
> +	int rc = -1; /* not for us */
> +	u32 status = FPGA_IN32(&fpga->status);
> +
> +	/* check for interrupt from fifo module */
> +	if (status & STATUS_FIFO_ISF) {
> +                /* disable this int source */

Something is wrong here with the indentation. Spaces instead of tabs?

> +		FPGA_OUT32(&fpga->hostctrl, HOSTCTRL_FIFOIE_GATE);
> +		rc = 0;
> +		got_fifoirq = 1; /* trigger backend */
> +	}
> +
> +	if (status & STATUS_HOST_ISF) {
> +		FPGA_OUT32(&fpga->hostctrl, HOSTCTRL_HCINT_GATE);
> +		rc = 0;
> +		got_hcirq = 1;
> +	}
> +
> +	return rc;
> +}
> +
> +
> +int do_waithci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> +{
> +	pmc440_fpga_t *fpga = (pmc440_fpga_t *)FPGA_BA;
> +
> +	got_hcirq = 0;
> +
> +	FPGA_CLRBITS(&fpga->ctrla, CTRL_HOST_IE);
> +	FPGA_OUT32(&fpga->hostctrl, HOSTCTRL_HCINT_GATE);
> +
> +	irq_install_handler (IRQ0_FPGA,
> +			     (interrupt_handler_t *)fpga_interrupt,
> +			     fpga);

Please stick to one coding style in each source file. So if you generally 
don't add the space before the "(" of a function call, then please never do 
it. Please check the complete patch for this.

> +
> +	FPGA_SETBITS(&fpga->ctrla, CTRL_HOST_IE);
> +
> +	while(!got_hcirq) {

A space would be nice here.

> +		/* Abort if ctrl-c was pressed */
> +		if (ctrlc()) {
> +			puts("\nAbort\n");
> +			break;
> +		}
> +	}
> +	if (got_hcirq)
> +		printf("Got interrupt!\n");
> +
> +	FPGA_CLRBITS(&fpga->ctrla, CTRL_HOST_IE);
> +	irq_free_handler(IRQ0_FPGA);
> +	return 0;
> +}
> +U_BOOT_CMD(
> +	waithci,	1,	1,	do_waithci,
> +	"waithci - Wait for host control interrupt\n",
> +	NULL
> +	);
> +
> +
> +void dump_fifo(pmc440_fpga_t *fpga, int f, int *n)
> +{
> +	u32 ctrl;
> +
> +	while(!((ctrl = FPGA_IN32(&fpga->fifo[f].ctrl)) & FIFO_EMPTY)) {

Space missing.

I'm stopping here for now, since the mail seems to be too big for the list 
already. Please split your patch up into smaller pieces, so that it fits.

Thanks. Looks good otherwise.

Viele Grüße,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================




More information about the U-Boot mailing list