public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH 3/3] ppc4xx: Add initial esd PMC440 board support
Date: Fri, 9 Nov 2007 16:33:12 +0100	[thread overview]
Message-ID: <200711091633.12569.sr@denx.de> (raw)
In-Reply-To: <200711091606.07963.matthias.fuchs@esd-electronics.com>

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@esd-electronics.com>
>
> ---
> commit 69a91d4b1575d1dec7b38c163fc0bcadb8b79705
> tree 55c7dbafa6b182a65abbc8dd252788aa22ce8359
> parent e2166ace3e44dd42196d2c0ce41367ec9950ffb8
> author Matthias Fuchs <matthias.fuchs@esd-electronics.com> Fri, 09 Nov 2007
> 15:53:46 +0100 committer Matthias Fuchs
> <matthias.fuchs@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
=====================================================================

       reply	other threads:[~2007-11-09 15:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200711091606.07963.matthias.fuchs@esd-electronics.com>
2007-11-09 15:33 ` Stefan Roese [this message]
2007-11-11 12:04   ` [U-Boot-Users] [PATCH 3/3] ppc4xx: Add initial esd PMC440 board support Matthias Fuchs
2007-11-11 12:40     ` [U-Boot-Users] [PATCH 1/5] Add Epson RX8025 RTC support Matthias Fuchs
2007-11-11 12:40     ` [U-Boot-Users] [PATCH 2/5] serial: Make default_serial_console() a weak function Matthias Fuchs
2007-11-11 12:40     ` [U-Boot-Users] [PATCH 3/5] ppc4xx: Add initial esd PMC440 board files Matthias Fuchs
2007-11-11 12:40     ` [U-Boot-Users] [PATCH 4/5] ppc4xx: Add FPGA support and BSP command for PMC440 boards Matthias Fuchs
2007-11-12 14:58       ` Matthias Fuchs
2007-11-11 12:40     ` [U-Boot-Users] [PATCH 5/5] ppc4xx: Complete PMC440 board support Matthias Fuchs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200711091633.12569.sr@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox