* [U-Boot] First Patch
@ 2008-09-06 10:25 Georg Schardt
2008-09-06 10:25 ` [U-Boot] [PATCH 1/3] Add support for the virtex4fx12 minimodul Georg Schardt
0 siblings, 1 reply; 16+ messages in thread
From: Georg Schardt @ 2008-09-06 10:25 UTC (permalink / raw)
To: u-boot
Hi,
the following patch is my first, so please say what i can do better the next time.
the patch adds board support for the virtex4fx12 minimodul by avnet.
Sorry for the three files, i don't know how to merge the files to on.
regards
georg
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 1/3] Add support for the virtex4fx12 minimodul
2008-09-06 10:25 [U-Boot] First Patch Georg Schardt
@ 2008-09-06 10:25 ` Georg Schardt
2008-09-06 10:25 ` [U-Boot] [PATCH 2/3] fix checkpatch errors Georg Schardt
2008-09-06 13:34 ` [U-Boot] [PATCH 1/3] Add support for the virtex4fx12 minimodul Wolfgang Denk
0 siblings, 2 replies; 16+ messages in thread
From: Georg Schardt @ 2008-09-06 10:25 UTC (permalink / raw)
To: u-boot
---
board/xilinx/fx12mm/Makefile | 64 +++++++++++
board/xilinx/fx12mm/config.mk | 28 +++++
board/xilinx/fx12mm/fx12mm.c | 118 +++++++++++++++++++
board/xilinx/fx12mm/init.S | 48 ++++++++
board/xilinx/fx12mm/serial.c | 154 +++++++++++++++++++++++++
board/xilinx/fx12mm/u-boot.lds | 149 ++++++++++++++++++++++++
board/xilinx/fx12mm/xparameters.h | 225 +++++++++++++++++++++++++++++++++++++
include/configs/FX12MM.h | 103 +++++++++++++++++
8 files changed, 889 insertions(+), 0 deletions(-)
diff --git a/board/xilinx/fx12mm/Makefile b/board/xilinx/fx12mm/Makefile
new file mode 100644
index 0000000..61aba24
--- /dev/null
+++ b/board/xilinx/fx12mm/Makefile
@@ -0,0 +1,64 @@
+#
+# (C) Copyright 2000-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
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+$(shell mkdir -p $(obj)../xilinx_iic)
+endif
+
+INCS := -I../common -I../xilinx_iic
+CFLAGS += $(INCS)
+HOST_CFLAGS += $(INCS)
+
+LIB = $(obj)lib$(BOARD).a
+
+COBJS = $(BOARD).o \
+ ../common/xbasic_types.o ../common/xdma_channel.o \
+ ../common/xdma_channel_sg.o \
+ ../common/xversion.o \
+ serial.o \
+
+SOBJS = init.o
+
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(COBJS))
+SOBJS := $(addprefix $(obj),$(SOBJS))
+
+$(LIB): $(OBJS) $(SOBJS)
+ $(AR) $(ARFLAGS) $@ $^
+
+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/xilinx/fx12mm/config.mk b/board/xilinx/fx12mm/config.mk
new file mode 100644
index 0000000..69490fb
--- /dev/null
+++ b/board/xilinx/fx12mm/config.mk
@@ -0,0 +1,28 @@
+#
+# (C) Copyright 2000
+# 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
+#
+
+#
+# Memec/Avnet Virtex4FX12 MiniModul
+# Standard EDK 10.1 Flash Address
+#
+TEXT_BASE = 0xFF800000
diff --git a/board/xilinx/fx12mm/fx12mm.c b/board/xilinx/fx12mm/fx12mm.c
new file mode 100644
index 0000000..0f2dd76
--- /dev/null
+++ b/board/xilinx/fx12mm/fx12mm.c
@@ -0,0 +1,118 @@
+/*
+ * fx12mm.c: U-Boot platform support for Avnet/Memec FX12 MiniModul
+ *
+ * Author: Xilinx, Inc.
+ *
+ *
+ * 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.
+ *
+ *
+ * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
+ * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
+ * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR STANDARD,
+ * XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION IS FREE
+ * FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE FOR OBTAINING
+ * ANY THIRD PARTY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
+ * XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
+ * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY
+ * WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM
+ * CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *
+ * Xilinx hardware products are not intended for use in life support
+ * appliances, devices, or systems. Use in such applications is
+ * expressly prohibited.
+ *
+ *
+ * (c) Copyright 2002-2004 Xilinx Inc.
+ * All rights reserved.
+ *
+ *
+ * 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.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include <config.h>
+#include <common.h>
+#include <asm/processor.h>
+
+#ifdef CFG_ENV_IS_IN_EEPROM
+extern void convert_env(void);
+#endif
+
+int
+board_pre_init(void)
+{
+ return 0;
+}
+
+int
+checkboard(void)
+{
+ char tmp[64]; /* long enough for environment variables */
+ char *s, *e;
+ int i = getenv_r("L", tmp, sizeof(tmp));
+
+ if (i < 0) {
+ printf("### No HW ID - assuming FX12MM");
+ } else {
+ for (e = tmp; *e; ++e) {
+ if (*e == ' ')
+ break;
+ }
+
+ printf("### Board Serial# is ");
+
+ for (s = tmp; s < e; ++s) {
+ putc(*s);
+ }
+
+ }
+ putc('\n');
+
+ return 0;
+}
+
+phys_size_t
+initdram(int board_type)
+{
+ return 64 * 1024 * 1024;
+}
+
+int
+testdram(void)
+{
+ printf("test: xxx MB - ok\n");
+
+ return 0;
+}
+
+/* implement functions originally in cpu/ppc4xx/speed.c */
+void
+get_sys_info(sys_info_t *sysInfo)
+{
+ sysInfo->freqProcessor = XPAR_CORE_CLOCK_FREQ_HZ;
+
+ /* only correct if the PLB and OPB run at the same frequency */
+
+ sysInfo->freqPLB = XPAR_UARTNS550_0_CLOCK_FREQ_HZ;
+ sysInfo->freqPCI = XPAR_UARTNS550_0_CLOCK_FREQ_HZ / 3;
+}
+
+#ifdef CONFIG_MISC_INIT_R
+
+int
+misc_init_r()
+{
+ /* convert env name and value to u-boot standard */
+ convert_env();
+ return 0;
+}
+
+#endif
diff --git a/board/xilinx/fx12mm/init.S b/board/xilinx/fx12mm/init.S
new file mode 100644
index 0000000..f753df8
--- /dev/null
+++ b/board/xilinx/fx12mm/init.S
@@ -0,0 +1,48 @@
+/*
+ * init.S: Stubs for U-Boot initialization
+ *
+ * Author: Xilinx, Inc.
+ *
+ *
+ * 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.
+ *
+ *
+ * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
+ * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
+ * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR STANDARD,
+ * XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION IS FREE
+ * FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE FOR OBTAINING
+ * ANY THIRD PARTY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
+ * XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
+ * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY
+ * WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM
+ * CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *
+ * Xilinx hardware products are not intended for use in life support
+ * appliances, devices, or systems. Use in such applications is
+ * expressly prohibited.
+ *
+ *
+ * (c) Copyright 2002-2004 Xilinx Inc.
+ * All rights reserved.
+ *
+ *
+ * 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.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *
+ */
+
+ .globl ext_bus_cntlr_init
+ext_bus_cntlr_init:
+ blr
+
+ .globl sdram_init
+sdram_init:
+ blr
diff --git a/board/xilinx/fx12mm/serial.c b/board/xilinx/fx12mm/serial.c
new file mode 100644
index 0000000..0c3e868
--- /dev/null
+++ b/board/xilinx/fx12mm/serial.c
@@ -0,0 +1,154 @@
+/*
+ * Author: Xilinx, Inc.
+ *
+ *
+ * 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.
+ *
+ *
+ * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
+ * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
+ * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR STANDARD,
+ * XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION IS FREE
+ * FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE FOR OBTAINING
+ * ANY THIRD PARTY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
+ * XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
+ * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY
+ * WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM
+ * CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *
+ * Xilinx hardware products are not intended for use in life support
+ * appliances, devices, or systems. Use in such applications is
+ * expressly prohibited.
+ *
+ *
+ * (c) Copyright 2002-2004 Xilinx Inc.
+ * All rights reserved.
+ *
+ *
+ * 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.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include <asm/u-boot.h>
+#include <asm/processor.h>
+#include <common.h>
+#include <command.h>
+#include <config.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define USE_CHAN1 \
+ ((defined XPAR_UARTNS550_0_BASEADDR) && (defined CFG_INIT_CHAN1))
+#define USE_CHAN2 \
+ ((defined XPAR_UARTNS550_1_BASEADDR) && (defined CFG_INIT_CHAN2))
+
+#if USE_CHAN1
+#include <ns16550.h>
+#endif
+
+#if USE_CHAN1
+const NS16550_t COM_PORTS[] = { (NS16550_t) (XPAR_UARTNS550_0_BASEADDR + 3)
+#if USE_CHAN2
+ , (NS16550_t) (XPAR_UARTNS550_1_BASEADDR + 3)
+#endif
+};
+#endif
+
+int
+serial_init(void)
+{
+#if USE_CHAN1
+ int clock_divisor;
+
+ clock_divisor = XPAR_UARTNS550_0_CLOCK_FREQ_HZ / 16 / gd->baudrate;
+ (void) NS16550_init(COM_PORTS[0], clock_divisor);
+#if USE_CHAN2
+ clock_divisor = XPAR_UARTNS550_1_CLOCK_FREQ_HZ / 16 / gd->baudrate;
+ (void) NS16550_init(COM_PORTS[1], clock_divisor);
+#endif
+#endif
+ return 0;
+
+}
+
+void
+serial_putc(const char c)
+{
+ if (c == '\n')
+ NS16550_putc(COM_PORTS[CFG_DUART_CHAN], '\r');
+
+ NS16550_putc(COM_PORTS[CFG_DUART_CHAN], c);
+}
+
+int
+serial_getc(void)
+{
+ return NS16550_getc(COM_PORTS[CFG_DUART_CHAN]);
+}
+
+int
+serial_tstc(void)
+{
+ return NS16550_tstc(COM_PORTS[CFG_DUART_CHAN]);
+}
+
+void
+serial_setbrg(void)
+{
+#if USE_CHAN1
+ int clock_divisor;
+
+ clock_divisor = XPAR_UARTNS550_0_CLOCK_FREQ_HZ / 16 / gd->baudrate;
+ NS16550_reinit(COM_PORTS[0], clock_divisor);
+#if USE_CHAN2
+ clock_divisor = XPAR_UARTNS550_1_CLOCK_FREQ_HZ / 16 / gd->baudrate;
+ NS16550_reinit(COM_PORTS[1], clock_divisor);
+#endif
+#endif
+}
+
+void
+serial_puts(const char *s)
+{
+ while (*s)
+ serial_putc(*s++);
+
+}
+
+#if defined(CONFIG_CMD_KGDB)
+void
+kgdb_serial_init(void)
+{
+}
+
+void
+putDebugChar(int c)
+{
+ serial_putc(c);
+}
+
+void
+putDebugStr(const char *str)
+{
+ serial_puts(str);
+}
+
+int
+getDebugChar(void)
+{
+ return serial_getc();
+}
+
+void
+kgdb_interruptible(int yes)
+{
+ return;
+}
+#endif
diff --git a/board/xilinx/fx12mm/u-boot.lds b/board/xilinx/fx12mm/u-boot.lds
new file mode 100644
index 0000000..31af107
--- /dev/null
+++ b/board/xilinx/fx12mm/u-boot.lds
@@ -0,0 +1,149 @@
+/*
+ * (C) Copyright 2000
+ * 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
+ */
+
+OUTPUT_ARCH(powerpc)
+ENTRY(_start)
+SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
+/* Do we need any of these for elf?
+ __DYNAMIC = 0; */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .rel.text : { *(.rel.text) }
+ .rela.text : { *(.rela.text) }
+ .rel.data : { *(.rel.data) }
+ .rela.data : { *(.rela.data) }
+ .rel.rodata : { *(.rel.rodata) }
+ .rela.rodata : { *(.rela.rodata) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.bss : { *(.rel.bss) }
+ .rela.bss : { *(.rela.bss) }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .init : { *(.init) }
+ .plt : { *(.plt) }
+ .text :
+ {
+ /* WARNING - the following is hand-optimized to fit within */
+ /* the sector layout of our flash chips! XXX FIXME XXX */
+/*
+ cpu/ppc4xx/start.o (.text)
+ board/xilinx/fx12mm/init.o (.text)
+ cpu/ppc4xx/kgdb.o (.text)
+ cpu/ppc4xx/traps.o (.text)
+ cpu/ppc4xx/interrupts.o (.text)
+ cpu/ppc4xx/serial.o (.text)
+ cpu/ppc4xx/cpu_init.o (.text)
+ cpu/ppc4xx/speed.o (.text)
+ cpu/ppc4xx/4xx_enet.o (.text)
+ common/dlmalloc.o (.text)
+ lib_generic/crc32.o (.text)
+ lib_ppc/extable.o (.text)
+ lib_generic/zlib.o (.text)
+*/
+/* . = env_offset;*/
+/* common/environment.o(.text)*/
+
+ *(.text)
+ *(.fixup)
+ *(.got1)
+ }
+ _etext = .;
+ PROVIDE (etext = .);
+ .rodata :
+ {
+ *(.rodata)
+ *(.rodata1)
+ *(.rodata.str1.4)
+ *(.eh_frame)
+ }
+ .fini : { *(.fini) } =0
+ .ctors : { *(.ctors) }
+ .dtors : { *(.dtors) }
+
+ /* Read-write section, merged into data segment: */
+ . = (. + 0x00FF) & 0xFFFFFF00;
+ _erotext = .;
+ PROVIDE (erotext = .);
+ .reloc :
+ {
+ *(.got)
+ _GOT2_TABLE_ = .;
+ *(.got2)
+ _FIXUP_TABLE_ = .;
+ *(.fixup)
+ }
+ __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+ __fixup_entries = (. - _FIXUP_TABLE_)>>2;
+
+ .data :
+ {
+ *(.data)
+ *(.data1)
+ *(.sdata)
+ *(.sdata2)
+ *(.dynamic)
+ CONSTRUCTORS
+ }
+ _edata = .;
+ PROVIDE (edata = .);
+
+ . = .;
+ __u_boot_cmd_start = .;
+ .u_boot_cmd : { *(.u_boot_cmd) }
+ __u_boot_cmd_end = .;
+
+
+ . = .;
+ __start___ex_table = .;
+ __ex_table : { *(__ex_table) }
+ __stop___ex_table = .;
+
+ . = ALIGN(256);
+ __init_begin = .;
+ .text.init : { *(.text.init) }
+ .data.init : { *(.data.init) }
+ . = ALIGN(256);
+ __init_end = .;
+
+ __bss_start = .;
+ .bss :
+ {
+ *(.sbss) *(.scommon)
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ }
+ _end = . ;
+ PROVIDE (end = .);
+}
diff --git a/board/xilinx/fx12mm/xparameters.h b/board/xilinx/fx12mm/xparameters.h
new file mode 100644
index 0000000..c197186
--- /dev/null
+++ b/board/xilinx/fx12mm/xparameters.h
@@ -0,0 +1,225 @@
+
+/*******************************************************************
+*
+* CAUTION: This file is automatically generated by libgen.
+* Version: Xilinx EDK 10.1.02 EDK_K_SP2.5
+* DO NOT EDIT.
+*
+* Copyright (c) 2005 Xilinx, Inc. All rights reserved.
+*
+* Description: Driver parameters
+*
+*******************************************************************/
+
+
+/* Definitions for peripheral XPS_BRAM_IF_CNTLR_1 */
+#define XPAR_XPS_BRAM_IF_CNTLR_1_BASEADDR 0xFFFFE000
+#define XPAR_XPS_BRAM_IF_CNTLR_1_HIGHADDR 0xFFFFFFFF
+
+
+/******************************************************************/
+
+/* Definitions for driver UARTNS550 */
+#define XPAR_XUARTNS550_NUM_INSTANCES 1
+#define XPAR_XUARTNS550_CLOCK_HZ 100000000
+
+/* Definitions for peripheral RS232 */
+#define XPAR_RS232_DEVICE_ID 0
+#define XPAR_RS232_BASEADDR 0x83E00000
+#define XPAR_RS232_HIGHADDR 0x83E0FFFF
+
+
+/******************************************************************/
+
+
+/* Canonical definitions for peripheral RS232 */
+#define XPAR_UARTNS550_0_CLOCK_FREQ_HZ 100000000
+#define XPAR_UARTNS550_0_DEVICE_ID XPAR_RS232_DEVICE_ID
+#define XPAR_UARTNS550_0_BASEADDR 0x83E00000
+#define XPAR_UARTNS550_0_HIGHADDR 0x83E0FFFF
+#define XPAR_UARTNS550_0_SIO_CHAN 1
+
+
+/******************************************************************/
+
+/* Definitions for driver EMACLITE */
+#define XPAR_XEMACLITE_NUM_INSTANCES 1
+
+/* Definitions for peripheral ETHERNET_MAC */
+#define XPAR_ETHERNET_MAC_DEVICE_ID 0
+#define XPAR_ETHERNET_MAC_BASEADDR 0x81000000
+#define XPAR_ETHERNET_MAC_HIGHADDR 0x8100FFFF
+#define XPAR_ETHERNET_MAC_TX_PING_PONG 0
+#define XPAR_ETHERNET_MAC_RX_PING_PONG 0
+
+
+/******************************************************************/
+
+
+/* Canonical definitions for peripheral ETHERNET_MAC */
+#define XPAR_EMACLITE_0_DEVICE_ID XPAR_ETHERNET_MAC_DEVICE_ID
+#define XPAR_EMACLITE_0_BASEADDR 0x81000000
+#define XPAR_EMACLITE_0_HIGHADDR 0x8100FFFF
+#define XPAR_EMACLITE_0_TX_PING_PONG 0
+#define XPAR_EMACLITE_0_RX_PING_PONG 0
+
+
+/******************************************************************/
+
+
+/* Definitions for peripheral FLASH_2MX16 */
+#define XPAR_FLASH_2MX16_NUM_BANKS_MEM 1
+
+
+/******************************************************************/
+
+/* Definitions for peripheral FLASH_2MX16 */
+#define XPAR_FLASH_2MX16_MEM0_BASEADDR 0xFF800000
+#define XPAR_FLASH_2MX16_MEM0_HIGHADDR 0xFFBFFFFF
+
+/******************************************************************/
+
+#define XPAR_INTC_MAX_NUM_INTR_INPUTS 2
+#define XPAR_XINTC_HAS_IPR 1
+#define XPAR_XINTC_USE_DCR 0
+/* Definitions for driver INTC */
+#define XPAR_XINTC_NUM_INSTANCES 1
+
+/* Definitions for peripheral XPS_INTC_0 */
+#define XPAR_XPS_INTC_0_DEVICE_ID 0
+#define XPAR_XPS_INTC_0_BASEADDR 0x81800000
+#define XPAR_XPS_INTC_0_HIGHADDR 0x8180FFFF
+#define XPAR_XPS_INTC_0_KIND_OF_INTR 0x00000001
+
+
+/******************************************************************/
+
+#define XPAR_INTC_SINGLE_BASEADDR 0x81800000
+#define XPAR_INTC_SINGLE_HIGHADDR 0x8180FFFF
+#define XPAR_INTC_SINGLE_DEVICE_ID XPAR_XPS_INTC_0_DEVICE_ID
+#define XPAR_ETHERNET_MAC_IP2INTC_IRPT_MASK 0X000001
+#define XPAR_XPS_INTC_0_ETHERNET_MAC_IP2INTC_IRPT_INTR 0
+#define XPAR_RS232_IP2INTC_IRPT_MASK 0X000002
+#define XPAR_XPS_INTC_0_RS232_IP2INTC_IRPT_INTR 1
+
+/******************************************************************/
+
+
+/* Canonical definitions for peripheral XPS_INTC_0 */
+#define XPAR_INTC_0_DEVICE_ID XPAR_XPS_INTC_0_DEVICE_ID
+#define XPAR_INTC_0_BASEADDR 0x81800000
+#define XPAR_INTC_0_HIGHADDR 0x8180FFFF
+#define XPAR_INTC_0_KIND_OF_INTR 0x00000001
+
+#define XPAR_INTC_0_EMACLITE_0_VEC_ID XPAR_XPS_INTC_0_ETHERNET_MAC_IP2INTC_IRPT_INTR
+#define XPAR_INTC_0_UARTNS550_0_VEC_ID XPAR_XPS_INTC_0_RS232_IP2INTC_IRPT_INTR
+
+/******************************************************************/
+
+/* Definitions for driver MPMC */
+#define XPAR_XMPMC_NUM_INSTANCES 1
+
+/* Definitions for peripheral DDR_SDRAM_32MX16 */
+#define XPAR_DDR_SDRAM_32MX16_DEVICE_ID 0
+#define XPAR_DDR_SDRAM_32MX16_MPMC_BASEADDR 0x00000000
+#define XPAR_DDR_SDRAM_32MX16_MPMC_CTRL_BASEADDR 0xFFFFFFFF
+#define XPAR_DDR_SDRAM_32MX16_INCLUDE_ECC_SUPPORT 0
+#define XPAR_DDR_SDRAM_32MX16_USE_STATIC_PHY 0
+#define XPAR_DDR_SDRAM_32MX16_PM_ENABLE 0
+#define XPAR_DDR_SDRAM_32MX16_NUM_PORTS 2
+
+
+/******************************************************************/
+
+
+/* Definitions for peripheral DDR_SDRAM_32MX16 */
+#define XPAR_DDR_SDRAM_32MX16_MPMC_BASEADDR 0x00000000
+#define XPAR_DDR_SDRAM_32MX16_MPMC_HIGHADDR 0x03FFFFFF
+
+
+/******************************************************************/
+
+
+/* Canonical definitions for peripheral DDR_SDRAM_32MX16 */
+#define XPAR_MPMC_0_DEVICE_ID XPAR_DDR_SDRAM_32MX16_DEVICE_ID
+#define XPAR_MPMC_0_MPMC_BASEADDR 0x00000000
+#define XPAR_MPMC_0_MPMC_CTRL_BASEADDR 0xFFFFFFFF
+#define XPAR_MPMC_0_INCLUDE_ECC_SUPPORT 0
+#define XPAR_MPMC_0_USE_STATIC_PHY 0
+#define XPAR_MPMC_0_PM_ENABLE 0
+#define XPAR_MPMC_0_NUM_PORTS 2
+
+
+/******************************************************************/
+
+#define XPAR_CPU_PPC405_CORE_CLOCK_FREQ_HZ 300000000
+
+/******************************************************************/
+
+#define XPAR_CPU_ID 0
+#define XPAR_PPC405_VIRTEX4_ID 0
+#define XPAR_PPC405_VIRTEX4_CORE_CLOCK_FREQ_HZ 300000000
+#define XPAR_PPC405_VIRTEX4_DPLB0_DWIDTH 64
+#define XPAR_PPC405_VIRTEX4_DPLB0_NATIVE_DWIDTH 64
+#define XPAR_PPC405_VIRTEX4_IPLB0_DWIDTH 64
+#define XPAR_PPC405_VIRTEX4_IPLB0_NATIVE_DWIDTH 64
+#define XPAR_PPC405_VIRTEX4_DPLB1_DWIDTH 64
+#define XPAR_PPC405_VIRTEX4_DPLB1_NATIVE_DWIDTH 64
+#define XPAR_PPC405_VIRTEX4_IPLB1_DWIDTH 64
+#define XPAR_PPC405_VIRTEX4_IPLB1_NATIVE_DWIDTH 64
+#define XPAR_PPC405_VIRTEX4_DPLB1_ADDR_BASE 0x00000000
+#define XPAR_PPC405_VIRTEX4_DPLB1_ADDR_HIGH 0x03ffffff
+#define XPAR_PPC405_VIRTEX4_IPLB1_ADDR_BASE 0x00000000
+#define XPAR_PPC405_VIRTEX4_IPLB1_ADDR_HIGH 0x03ffffff
+#define XPAR_PPC405_VIRTEX4_FASTEST_PLB_CLOCK DPLB0
+#define XPAR_PPC405_VIRTEX4_GENERATE_PLB_TIMESPECS 1
+#define XPAR_PPC405_VIRTEX4_DPLB0_P2P 0
+#define XPAR_PPC405_VIRTEX4_DPLB1_P2P 1
+#define XPAR_PPC405_VIRTEX4_IPLB0_P2P 0
+#define XPAR_PPC405_VIRTEX4_IPLB1_P2P 1
+#define XPAR_PPC405_VIRTEX4_IDCR_BASEADDR 0x00000100
+#define XPAR_PPC405_VIRTEX4_IDCR_HIGHADDR 0x000001FF
+#define XPAR_PPC405_VIRTEX4_DISABLE_OPERAND_FORWARDING 1
+#define XPAR_PPC405_VIRTEX4_MMU_ENABLE 1
+#define XPAR_PPC405_VIRTEX4_DETERMINISTIC_MULT 0
+#define XPAR_PPC405_VIRTEX4_PLBSYNCBYPASS 1
+#define XPAR_PPC405_VIRTEX4_APU_CONTROL 0b1101111000000000
+#define XPAR_PPC405_VIRTEX4_APU_UDI_1 0b101000011000100110000011
+#define XPAR_PPC405_VIRTEX4_APU_UDI_2 0b101000111000100110000011
+#define XPAR_PPC405_VIRTEX4_APU_UDI_3 0b101001011000100111000011
+#define XPAR_PPC405_VIRTEX4_APU_UDI_4 0b101001111000100111000011
+#define XPAR_PPC405_VIRTEX4_APU_UDI_5 0b101010011000110000000011
+#define XPAR_PPC405_VIRTEX4_APU_UDI_6 0b101010111000110000000011
+#define XPAR_PPC405_VIRTEX4_APU_UDI_7 0b101011011000110001000011
+#define XPAR_PPC405_VIRTEX4_APU_UDI_8 0b101011111000110001000011
+#define XPAR_PPC405_VIRTEX4_PVR_HIGH 0b0000
+#define XPAR_PPC405_VIRTEX4_PVR_LOW 0b0000
+#define XPAR_PPC405_VIRTEX4_HW_VER "2.01.a"
+
+/******************************************************************/
+
+
+/******************************************************************/
+
+/* Cannonical Constant Names */
+
+/******************************************************************/
+
+#undef XPAR_UARTNS550_0_BASEADDR
+#define XPAR_UARTNS550_0_BASEADDR (XPAR_RS232_BASEADDR+0x1000)
+
+/******************************************************************/
+
+
+/******************************************************************/
+
+#define XPAR_PLB_CLOCK_FREQ_HZ 100000000
+#define XPAR_CORE_CLOCK_FREQ_HZ XPAR_CPU_PPC405_CORE_CLOCK_FREQ_HZ
+#define XPAR_DDR_0_SIZE 0x04000000
+
+/******************************************************************/
+
+#define XPAR_PCI_0_CLOCK_FREQ_HZ 0
+
+/******************************************************************/
+
diff --git a/include/configs/FX12MM.h b/include/configs/FX12MM.h
new file mode 100644
index 0000000..b47e403
--- /dev/null
+++ b/include/configs/FX12MM.h
@@ -0,0 +1,103 @@
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+
+#include "../board/xilinx/fx12mm/xparameters.h"
+
+#define CONFIG_4xx 1 /* PPC4xx family */
+#define CONFIG_405 1
+#define CONFIG_XILINX_405 1 /* Xilinx On Chip */
+
+#define CONFIG_SYS_CLK_FREQ 100000000
+
+#ifdef XPAR_SYSACE_0_DEVICE_ID
+#define CONFIG_SYSTEMACE 1
+#define CONFIG_DOS_PARTITION 1
+#define CFG_SYSTEMACE_BASE XPAR_SYSACE_0_BASEADDR
+#define CFG_SYSTEMACE_WIDTH XPAR_SYSACE_0_MEM_WIDTH
+#define ADD_SYSTEMACE_CMDS (| CFG_CMD_FAT)
+#define RM_SYSTEMACE_CMDS
+#else
+#define ADD_SYSTEMACE_CMDS
+#define RM_SYSTEMACE_CMDS | CFG_CMD_FAT
+#endif
+
+
+#define CFG_ENV_IS_IN_FLASH 1 /* environment is in FLASH */
+#define ADD_FLASH_CMDS | CFG_CMD_FLASH
+#define RM_FLASH_CMDS
+
+
+#ifdef XPAR_IIC_0_DEVICE_ID
+#if ! defined(CFG_ENV_IS_IN_FLASH)
+#define CFG_ENV_IS_IN_EEPROM 1 /* environment is in IIC EEPROM */
+#endif
+#define ADD_IIC_CMDS | CFG_CMD_I2C
+#define RM_IIC_CMDS
+#else
+#define ADD_IIC_CMDS
+#define RM_IIC_CMDS | CFG_CMD_I2C
+#endif
+
+
+#define CFG_FLASH_BASE 0xff800000
+#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
+#define CFG_MAX_FLASH_SECT 256 /* max number of sectors on one chip */
+#define CFG_FLASH_ERASE_TOUT 150000 /* Timeout for Flash Erase (in ms) */
+#define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
+#define CFG_FLASH_CFI 1
+#define CONFIG_FLASH_CFI_DRIVER 1
+#define CFG_ENV_OFFSET 0x003fe000
+#define CFG_ENV_SIZE 0x00002000
+#define CONFIG_ENV_OVERWRITE 1 /* writable ethaddr and serial# */
+#define CFG_MONITOR_BASE 0xff800000
+
+#define CONFIG_BAUDRATE 115200
+#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
+
+#define CFG_BAUDRATE_TABLE \
+ {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
+
+#include <config_cmd_default.h>
+#undef CONFIG_CMD_NET
+#define CONFIG_CMD_JFFS2
+
+
+#define CFG_PROMPT "=> " /* Monitor Command Prompt */
+#define CFG_CBSIZE 256 /* Console I/O Buffer Size */
+#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
+#define CFG_MAXARGS 16 /* max number of command args */
+#define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
+
+#define CFG_MEMTEST_START 0x0400000 /* memtest works on */
+#define CFG_MEMTEST_END 0x0800000 /* 4 ... 12 MB in DRAM */
+
+#define CFG_DUART_CHAN 0
+#define CFG_NS16550_REG_SIZE -4
+#define CFG_NS16550 1
+#define CFG_INIT_CHAN1 1
+
+#define CFG_LOAD_ADDR 0x01000000 /* default load address */
+
+#define CFG_HZ 2000 /* decrementer freq: 1 ms ticks */
+
+#define CFG_SDRAM_BASE 0x00000000
+#define CFG_MONITOR_LEN (192 * 1024) /* Reserve 196 kB for Monitor */
+#define CFG_MALLOC_LEN (1024 * 1024) /* Reserve 128 kB for malloc() */
+
+#define CFG_CACHELINE_SIZE 32 /* ... */
+#define CFG_CACHELINE_SHIFT 2
+
+#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
+
+#define CFG_INIT_RAM_ADDR 0x800000 /* inside of SDRAM */
+#define CFG_INIT_RAM_END 0x2000 /* End of used area in RAM */
+#define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
+#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
+#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
+
+#define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
+#define BOOTFLAG_WARM 0x02 /* Software reboot */
+
+#endif /* __CONFIG_H */
+
--
1.4.4.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/3] fix checkpatch errors
2008-09-06 10:25 ` [U-Boot] [PATCH 1/3] Add support for the virtex4fx12 minimodul Georg Schardt
@ 2008-09-06 10:25 ` Georg Schardt
2008-09-06 10:25 ` [U-Boot] [PATCH 3/3] fix some other patch errors Georg Schardt
` (2 more replies)
2008-09-06 13:34 ` [U-Boot] [PATCH 1/3] Add support for the virtex4fx12 minimodul Wolfgang Denk
1 sibling, 3 replies; 16+ messages in thread
From: Georg Schardt @ 2008-09-06 10:25 UTC (permalink / raw)
To: u-boot
---
include/configs/FX12MM.h | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/configs/FX12MM.h b/include/configs/FX12MM.h
index b47e403..8b8d41c 100644
--- a/include/configs/FX12MM.h
+++ b/include/configs/FX12MM.h
@@ -15,28 +15,28 @@
#define CONFIG_DOS_PARTITION 1
#define CFG_SYSTEMACE_BASE XPAR_SYSACE_0_BASEADDR
#define CFG_SYSTEMACE_WIDTH XPAR_SYSACE_0_MEM_WIDTH
-#define ADD_SYSTEMACE_CMDS (| CFG_CMD_FAT)
+#define ADD_SYSTEMACE_CMDS ( | CFG_CMD_FAT )
#define RM_SYSTEMACE_CMDS
#else
#define ADD_SYSTEMACE_CMDS
-#define RM_SYSTEMACE_CMDS | CFG_CMD_FAT
+#define RM_SYSTEMACE_CMDS ( | CFG_CMD_FAT )
#endif
#define CFG_ENV_IS_IN_FLASH 1 /* environment is in FLASH */
-#define ADD_FLASH_CMDS | CFG_CMD_FLASH
+#define ADD_FLASH_CMDS ( | CFG_CMD_FLASH )
#define RM_FLASH_CMDS
#ifdef XPAR_IIC_0_DEVICE_ID
-#if ! defined(CFG_ENV_IS_IN_FLASH)
+#if !defined(CFG_ENV_IS_IN_FLASH)
#define CFG_ENV_IS_IN_EEPROM 1 /* environment is in IIC EEPROM */
#endif
-#define ADD_IIC_CMDS | CFG_CMD_I2C
+#define ADD_IIC_CMDS ( | CFG_CMD_I2C )
#define RM_IIC_CMDS
#else
#define ADD_IIC_CMDS
-#define RM_IIC_CMDS | CFG_CMD_I2C
+#define RM_IIC_CMDS ( | CFG_CMD_I2C )
#endif
--
1.4.4.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 3/3] fix some other patch errors
2008-09-06 10:25 ` [U-Boot] [PATCH 2/3] fix checkpatch errors Georg Schardt
@ 2008-09-06 10:25 ` Georg Schardt
2008-09-06 13:22 ` [U-Boot] [PATCH 2/3] fix checkpatch errors Wolfgang Denk
2008-09-08 12:15 ` JerryVanBaren
2 siblings, 0 replies; 16+ messages in thread
From: Georg Schardt @ 2008-09-06 10:25 UTC (permalink / raw)
To: u-boot
---
Makefile | 3 +++
board/xilinx/fx12mm/fx12mm.c | 4 ----
board/xilinx/fx12mm/serial.c | 2 +-
include/configs/FX12MM.h | 8 ++++----
4 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile
index 8d82ef5..1fc476d 100644
--- a/Makefile
+++ b/Makefile
@@ -1282,6 +1282,9 @@ ERIC_config: unconfig
EXBITGEN_config: unconfig
@$(MKCONFIG) $(@:_config=) ppc ppc4xx exbitgen
+FX12MM_config: unconfig
+ @$(MKCONFIG) $(@:_config=) ppc ppc4xx fx12mm xilinx
+
G2000_config: unconfig
@$(MKCONFIG) $(@:_config=) ppc ppc4xx g2000
diff --git a/board/xilinx/fx12mm/fx12mm.c b/board/xilinx/fx12mm/fx12mm.c
index 0f2dd76..a58a3dc 100644
--- a/board/xilinx/fx12mm/fx12mm.c
+++ b/board/xilinx/fx12mm/fx12mm.c
@@ -42,10 +42,6 @@
#include <common.h>
#include <asm/processor.h>
-#ifdef CFG_ENV_IS_IN_EEPROM
-extern void convert_env(void);
-#endif
-
int
board_pre_init(void)
{
diff --git a/board/xilinx/fx12mm/serial.c b/board/xilinx/fx12mm/serial.c
index 0c3e868..3af589b 100644
--- a/board/xilinx/fx12mm/serial.c
+++ b/board/xilinx/fx12mm/serial.c
@@ -36,6 +36,7 @@
*
*/
+#include <asm/types.h>
#include <asm/u-boot.h>
#include <asm/processor.h>
#include <common.h>
@@ -119,7 +120,6 @@ serial_puts(const char *s)
{
while (*s)
serial_putc(*s++);
-
}
#if defined(CONFIG_CMD_KGDB)
diff --git a/include/configs/FX12MM.h b/include/configs/FX12MM.h
index 8b8d41c..88ceee8 100644
--- a/include/configs/FX12MM.h
+++ b/include/configs/FX12MM.h
@@ -82,17 +82,17 @@
#define CFG_HZ 2000 /* decrementer freq: 1 ms ticks */
#define CFG_SDRAM_BASE 0x00000000
-#define CFG_MONITOR_LEN (192 * 1024) /* Reserve 196 kB for Monitor */
-#define CFG_MALLOC_LEN (1024 * 1024) /* Reserve 128 kB for malloc() */
+#define CFG_MONITOR_LEN (192 * 1024)
+#define CFG_MALLOC_LEN (1024 * 1024)
#define CFG_CACHELINE_SIZE 32 /* ... */
#define CFG_CACHELINE_SHIFT 2
-#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
+#define CFG_BOOTMAPSZ (8 << 20)
#define CFG_INIT_RAM_ADDR 0x800000 /* inside of SDRAM */
#define CFG_INIT_RAM_END 0x2000 /* End of used area in RAM */
-#define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
+#define CFG_GBL_DATA_SIZE 128
#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
--
1.4.4.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/3] fix checkpatch errors
2008-09-06 10:25 ` [U-Boot] [PATCH 2/3] fix checkpatch errors Georg Schardt
2008-09-06 10:25 ` [U-Boot] [PATCH 3/3] fix some other patch errors Georg Schardt
@ 2008-09-06 13:22 ` Wolfgang Denk
2008-09-06 14:02 ` Georg Schardt
2008-09-08 12:15 ` JerryVanBaren
2 siblings, 1 reply; 16+ messages in thread
From: Wolfgang Denk @ 2008-09-06 13:22 UTC (permalink / raw)
To: u-boot
Dear Georg Schardt,
In message <12206967521471-git-send-email-schardt@team-ctech.de> you wrote:
> ---
> include/configs/FX12MM.h | 12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
This file does not even exist yet.
Please fix the code in your local branch, rebase your patch, and
resubmit a cleaned up patch.
But make sure it actually compiles.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Don't you know anything? I should have thought anyone knows that who
knows anything about anything... - Terry Pratchett, _Soul Music_
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 1/3] Add support for the virtex4fx12 minimodul
2008-09-06 10:25 ` [U-Boot] [PATCH 1/3] Add support for the virtex4fx12 minimodul Georg Schardt
2008-09-06 10:25 ` [U-Boot] [PATCH 2/3] fix checkpatch errors Georg Schardt
@ 2008-09-06 13:34 ` Wolfgang Denk
2008-09-07 21:50 ` Ricardo
1 sibling, 1 reply; 16+ messages in thread
From: Wolfgang Denk @ 2008-09-06 13:34 UTC (permalink / raw)
To: u-boot
Dear Georg Schardt,
In message <12206967521515-git-send-email-schardt@team-ctech.de> you wrote:
> ---
> board/xilinx/fx12mm/Makefile | 64 +++++++++++
> board/xilinx/fx12mm/config.mk | 28 +++++
> board/xilinx/fx12mm/fx12mm.c | 118 +++++++++++++++++++
> board/xilinx/fx12mm/init.S | 48 ++++++++
> board/xilinx/fx12mm/serial.c | 154 +++++++++++++++++++++++++
> board/xilinx/fx12mm/u-boot.lds | 149 ++++++++++++++++++++++++
> board/xilinx/fx12mm/xparameters.h | 225 +++++++++++++++++++++++++++++++++++++
> include/configs/FX12MM.h | 103 +++++++++++++++++
> 8 files changed, 889 insertions(+), 0 deletions(-)
There are a couple of coding style issues with your code; trailing
white space, indentation not by TAB, etc. Please clean up.
> diff --git a/board/xilinx/fx12mm/Makefile b/board/xilinx/fx12mm/Makefile
> new file mode 100644
> index 0000000..61aba24
> --- /dev/null
> +++ b/board/xilinx/fx12mm/Makefile
> @@ -0,0 +1,64 @@
> +#
> +# (C) Copyright 2000-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
> +ifneq ($(OBJTREE),$(SRCTREE))
> +$(shell mkdir -p $(obj)../common)
> +$(shell mkdir -p $(obj)../xilinx_iic)
> +endif
> +
> +INCS := -I../common -I../xilinx_iic
> +CFLAGS += $(INCS)
> +HOST_CFLAGS += $(INCS)
> +
> +LIB = $(obj)lib$(BOARD).a
> +
> +COBJS = $(BOARD).o \
> + ../common/xbasic_types.o ../common/xdma_channel.o \
> + ../common/xdma_channel_sg.o \
> + ../common/xversion.o \
> + serial.o \
> +
> +SOBJS = init.o
> +
> +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
> +OBJS := $(addprefix $(obj),$(COBJS))
> +SOBJS := $(addprefix $(obj),$(SOBJS))
> +
> +$(LIB): $(OBJS) $(SOBJS)
> + $(AR) $(ARFLAGS) $@ $^
> +
> +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/xilinx/fx12mm/config.mk b/board/xilinx/fx12mm/config.mk
> new file mode 100644
> index 0000000..69490fb
> --- /dev/null
> +++ b/board/xilinx/fx12mm/config.mk
> @@ -0,0 +1,28 @@
> +#
> +# (C) Copyright 2000
> +# 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
> +#
> +
> +#
> +# Memec/Avnet Virtex4FX12 MiniModul
> +# Standard EDK 10.1 Flash Address
> +#
> +TEXT_BASE = 0xFF800000
> diff --git a/board/xilinx/fx12mm/fx12mm.c b/board/xilinx/fx12mm/fx12mm.c
> new file mode 100644
> index 0000000..0f2dd76
> --- /dev/null
> +++ b/board/xilinx/fx12mm/fx12mm.c
> @@ -0,0 +1,118 @@
> +/*
> + * fx12mm.c: U-Boot platform support for Avnet/Memec FX12 MiniModul
> + *
> + * Author: Xilinx, Inc.
> + *
> + *
> + * 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.
> + *
> + *
> + * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
> + * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
> + * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR STANDARD,
> + * XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION IS FREE
> + * FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE FOR OBTAINING
> + * ANY THIRD PARTY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
> + * XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
> + * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY
> + * WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM
> + * CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND
> + * FITNESS FOR A PARTICULAR PURPOSE.
> + *
> + *
> + * Xilinx hardware products are not intended for use in life support
> + * appliances, devices, or systems. Use in such applications is
> + * expressly prohibited.
This is a restriction in the rights you have with the software which
is incompatible with the rights the GPL grants you. There must be no
such restrictions in GPLed code.
The same applies for other files as well.
> +int
> +checkboard(void)
> +{
> + char tmp[64]; /* long enough for environment variables */
> + char *s, *e;
> + int i = getenv_r("L", tmp, sizeof(tmp));
> +
> + if (i < 0) {
> + printf("### No HW ID - assuming FX12MM");
> + } else {
> + for (e = tmp; *e; ++e) {
> + if (*e == ' ')
> + break;
> + }
> +
> + printf("### Board Serial# is ");
> +
> + for (s = tmp; s < e; ++s) {
> + putc(*s);
> + }
No braces for one line loops, please.
> diff --git a/board/xilinx/fx12mm/serial.c b/board/xilinx/fx12mm/serial.c
> new file mode 100644
> index 0000000..0c3e868
> --- /dev/null
> +++ b/board/xilinx/fx12mm/serial.c
> @@ -0,0 +1,154 @@
> +/*
> + * Author: Xilinx, Inc.
> + *
> + *
> + * 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.
> + *
> + *
> + * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
> + * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
> + * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR STANDARD,
> + * XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION IS FREE
> + * FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE FOR OBTAINING
> + * ANY THIRD PARTY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
> + * XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
> + * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY
> + * WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM
> + * CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND
> + * FITNESS FOR A PARTICULAR PURPOSE.
> + *
> + *
> + * Xilinx hardware products are not intended for use in life support
> + * appliances, devices, or systems. Use in such applications is
> + * expressly prohibited.
> + *
> + *
> + * (c) Copyright 2002-2004 Xilinx Inc.
> + * All rights reserved.
> + *
> + *
> + * 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.,
> + * 675 Mass Ave, Cambridge, MA 02139, USA.
> + *
> + */
> +
> +#include <asm/u-boot.h>
> +#include <asm/processor.h>
> +#include <common.h>
> +#include <command.h>
> +#include <config.h>
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +#define USE_CHAN1 \
> + ((defined XPAR_UARTNS550_0_BASEADDR) && (defined CFG_INIT_CHAN1))
> +#define USE_CHAN2 \
> + ((defined XPAR_UARTNS550_1_BASEADDR) && (defined CFG_INIT_CHAN2))
> +
> +#if USE_CHAN1
> +#include <ns16550.h>
> +#endif
> +
> +#if USE_CHAN1
> +const NS16550_t COM_PORTS[] = { (NS16550_t) (XPAR_UARTNS550_0_BASEADDR + 3)
> +#if USE_CHAN2
> + , (NS16550_t) (XPAR_UARTNS550_1_BASEADDR + 3)
> +#endif
> +};
> +#endif
This code is ugly and close to unreadable.
> +int
> +serial_init(void)
> +{
> +#if USE_CHAN1
> + int clock_divisor;
> +
> + clock_divisor = XPAR_UARTNS550_0_CLOCK_FREQ_HZ / 16 / gd->baudrate;
> + (void) NS16550_init(COM_PORTS[0], clock_divisor);
> +#if USE_CHAN2
> + clock_divisor = XPAR_UARTNS550_1_CLOCK_FREQ_HZ / 16 / gd->baudrate;
> + (void) NS16550_init(COM_PORTS[1], clock_divisor);
> +#endif
> +#endif
> + return 0;
Please get rid of all these #if's in your code.
> index 0000000..c197186
> --- /dev/null
> +++ b/board/xilinx/fx12mm/xparameters.h
> @@ -0,0 +1,225 @@
> +
> +/*******************************************************************
> +*
> +* CAUTION: This file is automatically generated by libgen.
> +* Version: Xilinx EDK 10.1.02 EDK_K_SP2.5
> +* DO NOT EDIT.
> +*
> +* Copyright (c) 2005 Xilinx, Inc. All rights reserved.
> +*
> +* Description: Driver parameters
Not GPL conformant.
> diff --git a/include/configs/FX12MM.h b/include/configs/FX12MM.h
> new file mode 100644
> index 0000000..b47e403
> --- /dev/null
> +++ b/include/configs/FX12MM.h
> @@ -0,0 +1,103 @@
> +#ifndef __CONFIG_H
> +#define __CONFIG_H
> +
> +
GPL conformant license ,issing.
This code needs some major cleanup before it can go into mainline.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Who is the oldest inhabitant of this village?"
"We haven't got one; we had one, but he died three weeks ago."
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/3] fix checkpatch errors
2008-09-06 13:22 ` [U-Boot] [PATCH 2/3] fix checkpatch errors Wolfgang Denk
@ 2008-09-06 14:02 ` Georg Schardt
2008-09-06 15:45 ` Wolfgang Denk
0 siblings, 1 reply; 16+ messages in thread
From: Georg Schardt @ 2008-09-06 14:02 UTC (permalink / raw)
To: u-boot
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
i tried to rebase my local testing-branch with my local master-branch,
but i always get the message that the branch is up to date.
then i merge my master-branch with "git pull . testing" with the
testing-branch, but "git format-patch origin" creates me a patch-file
for every commit from the testing-branch.
how can i create a single file patch with the differents between the
head of my testing-branch and the head of the master-branch ?
regards
georg
Wolfgang Denk schrieb:
> Dear Georg Schardt,
>
> In message <12206967521471-git-send-email-schardt@team-ctech.de> you wrote:
>> ---
>> include/configs/FX12MM.h | 12 ++++++------
>> 1 files changed, 6 insertions(+), 6 deletions(-)
>
> This file does not even exist yet.
>
> Please fix the code in your local branch, rebase your patch, and
> resubmit a cleaned up patch.
>
> But make sure it actually compiles.
>
> Best regards,
>
> Wolfgang Denk
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkjCjV4ACgkQUicxT/v10ZveRQCfSUUfqVC90k/C8OaW+NS3LAc+
OVYAnA62F9hbvPI8BrhBbsau2aCBV+gK
=OVKI
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/3] fix checkpatch errors
2008-09-06 14:02 ` Georg Schardt
@ 2008-09-06 15:45 ` Wolfgang Denk
2008-09-07 10:56 ` Georg Schardt
0 siblings, 1 reply; 16+ messages in thread
From: Wolfgang Denk @ 2008-09-06 15:45 UTC (permalink / raw)
To: u-boot
Dear Georg Schardt,
In message <48C28D5E.5030802@team-ctech.de> you wrote:
>
> i tried to rebase my local testing-branch with my local master-branch,
> but i always get the message that the branch is up to date.
Which exact commands are you using?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Very ugly or very beautiful women should be flattered on their
understanding, and mediocre ones on their beauty.
-- Philip Earl of Chesterfield
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/3] fix checkpatch errors
2008-09-06 15:45 ` Wolfgang Denk
@ 2008-09-07 10:56 ` Georg Schardt
2008-09-07 11:15 ` Wolfgang Denk
0 siblings, 1 reply; 16+ messages in thread
From: Georg Schardt @ 2008-09-07 10:56 UTC (permalink / raw)
To: u-boot
Dear Wolfgang Denk,
thank you for the help. I use the following commands:
- create my own testing branch: "git branch testing"
- switch to this branch: "git checkout testing"
- copy/modify files
- add the new files with "git add board/xilinx/fx12mm/"
- commit the changes with "git commit -a"
- create a patch with "git format-patch origin"
- check this patch with checkpatch.pl
- fix the errors, commit again, create patch again get 2 patchfiles
- then i try "git rebase master" and get the message "Current branch
master is up to date"
thanks
georg
Wolfgang Denk wrote:
> Dear Georg Schardt,
>
> In message <48C28D5E.5030802@team-ctech.de> you wrote:
>
>> i tried to rebase my local testing-branch with my local master-branch,
>> but i always get the message that the branch is up to date.
>>
>
> Which exact commands are you using?
>
>
> Best regards,
>
> Wolfgang Denk
>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/3] fix checkpatch errors
2008-09-07 10:56 ` Georg Schardt
@ 2008-09-07 11:15 ` Wolfgang Denk
2008-09-07 11:48 ` Georg Schardt
0 siblings, 1 reply; 16+ messages in thread
From: Wolfgang Denk @ 2008-09-07 11:15 UTC (permalink / raw)
To: u-boot
Dear Georg Schardt,
In message <48C3B358.6010500@team-ctech.de> you wrote:
>
> - create my own testing branch: "git branch testing"
> - switch to this branch: "git checkout testing"
> - copy/modify files
> - add the new files with "git add board/xilinx/fx12mm/"
> - commit the changes with "git commit -a"
> - create a patch with "git format-patch origin"
> - check this patch with checkpatch.pl
> - fix the errors, commit again, create patch again get 2 patchfiles
This all looks good so far
> - then i try "git rebase master" and get the message "Current branch
> master is up to date"
Hm... the "current branch master" makes be believe that you might have
checked out the master branch now? You should still have the "testing"
branch checked out.
Also note, that when you want to combine the two commits into one for
submission, you have to use "git-rebase -i master" to run in
interactive mode.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Have you lived in this village all your life?" "No, not yet."
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/3] fix checkpatch errors
2008-09-07 11:15 ` Wolfgang Denk
@ 2008-09-07 11:48 ` Georg Schardt
0 siblings, 0 replies; 16+ messages in thread
From: Georg Schardt @ 2008-09-07 11:48 UTC (permalink / raw)
To: u-boot
Hi again,
> This all looks good so far
>
>
>> - then i try "git rebase master" and get the message "Current branch
>> master is up to date"
>>
>
> Hm... the "current branch master" makes be believe that you might have
> checked out the master branch now? You should still have the "testing"
> branch checked out.
>
you are right, sorry. but with testing checkout there is no different
schardt at schleppi:~/embedded/u-boot$ git branch
i.MX31
lwmon5
master
origin
* testing
wd at denx.de
schardt at schleppi:~/embedded/u-boot$ git-rebase master
Current branch testing is up to date.
> Also note, that when you want to combine the two commits into one for
> submission, you have to use "git-rebase -i master" to run in
> interactive mode.
>
>
Huuh, i have no option -i available. i use git 1.4.4.4. *argl*
regards
georg
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 1/3] Add support for the virtex4fx12 minimodul
2008-09-06 13:34 ` [U-Boot] [PATCH 1/3] Add support for the virtex4fx12 minimodul Wolfgang Denk
@ 2008-09-07 21:50 ` Ricardo
0 siblings, 0 replies; 16+ messages in thread
From: Ricardo @ 2008-09-07 21:50 UTC (permalink / raw)
To: u-boot
Hello Georg
First of all, it is great to see more people sending fpgas paths:
Some comments
1) The V4 FX12 MM is by avnet, not by Xilinx, please locate your code
under the folder board/avnet . Maybe it is not in WD branch yet. Take
a look to the ppc4xx board by Stefan
http://git.denx.de/?p=u-boot/u-boot-ppc4xx.git;a=summary
2) We had a big discussions some days ago about how to handle fpga
boards. I have uploaded a new "method" for the virtex5 ppc440 boards.
The idea was to use this method also in Xilinx ppc400.
http://git.denx.de/?p=u-boot/u-boot-ppc4xx.git;a=commit;h=e07f4a8033b6270b8103049adb6456f660ff4a89
To sum up. The idea is to crate 1 generic board for every processor
(ppc440, ppc400 and microblace) and base all the boards with that
processor on that board.
3) Remove all the unnecessary lines in the xparameters file.
4) The xilinx_iic driver will be removed sooner or later. I would
remove the i2c support of your board or create a flattened driver
under /drivers/i2c
5) You are using a "propietary" way of locating the serial number and
mac address. I know that it is the way Xilinx use to do it, but on
u-boot we have a common way of saving that variables using the
environment. On my boards I use it.
Best regards.
On Sat, Sep 6, 2008 at 09:34, Wolfgang Denk <wd@denx.de> wrote:
> Dear Georg Schardt,
>
> In message <12206967521515-git-send-email-schardt@team-ctech.de> you wrote:
>> ---
>> board/xilinx/fx12mm/Makefile | 64 +++++++++++
>> board/xilinx/fx12mm/config.mk | 28 +++++
>> board/xilinx/fx12mm/fx12mm.c | 118 +++++++++++++++++++
>> board/xilinx/fx12mm/init.S | 48 ++++++++
>> board/xilinx/fx12mm/serial.c | 154 +++++++++++++++++++++++++
>> board/xilinx/fx12mm/u-boot.lds | 149 ++++++++++++++++++++++++
>> board/xilinx/fx12mm/xparameters.h | 225 +++++++++++++++++++++++++++++++++++++
>> include/configs/FX12MM.h | 103 +++++++++++++++++
>> 8 files changed, 889 insertions(+), 0 deletions(-)
>
> There are a couple of coding style issues with your code; trailing
> white space, indentation not by TAB, etc. Please clean up.
>
>
>> diff --git a/board/xilinx/fx12mm/Makefile b/board/xilinx/fx12mm/Makefile
>> new file mode 100644
>> index 0000000..61aba24
>> --- /dev/null
>> +++ b/board/xilinx/fx12mm/Makefile
>> @@ -0,0 +1,64 @@
>> +#
>> +# (C) Copyright 2000-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
>> +ifneq ($(OBJTREE),$(SRCTREE))
>> +$(shell mkdir -p $(obj)../common)
>> +$(shell mkdir -p $(obj)../xilinx_iic)
>> +endif
>> +
>> +INCS := -I../common -I../xilinx_iic
>> +CFLAGS += $(INCS)
>> +HOST_CFLAGS += $(INCS)
>> +
>> +LIB = $(obj)lib$(BOARD).a
>> +
>> +COBJS = $(BOARD).o \
>> + ../common/xbasic_types.o ../common/xdma_channel.o \
>> + ../common/xdma_channel_sg.o \
>> + ../common/xversion.o \
>> + serial.o \
>> +
>> +SOBJS = init.o
>> +
>> +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
>> +OBJS := $(addprefix $(obj),$(COBJS))
>> +SOBJS := $(addprefix $(obj),$(SOBJS))
>> +
>> +$(LIB): $(OBJS) $(SOBJS)
>> + $(AR) $(ARFLAGS) $@ $^
>> +
>> +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/xilinx/fx12mm/config.mk b/board/xilinx/fx12mm/config.mk
>> new file mode 100644
>> index 0000000..69490fb
>> --- /dev/null
>> +++ b/board/xilinx/fx12mm/config.mk
>> @@ -0,0 +1,28 @@
>> +#
>> +# (C) Copyright 2000
>> +# 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
>> +#
>> +
>> +#
>> +# Memec/Avnet Virtex4FX12 MiniModul
>> +# Standard EDK 10.1 Flash Address
>> +#
>> +TEXT_BASE = 0xFF800000
>> diff --git a/board/xilinx/fx12mm/fx12mm.c b/board/xilinx/fx12mm/fx12mm.c
>> new file mode 100644
>> index 0000000..0f2dd76
>> --- /dev/null
>> +++ b/board/xilinx/fx12mm/fx12mm.c
>> @@ -0,0 +1,118 @@
>> +/*
>> + * fx12mm.c: U-Boot platform support for Avnet/Memec FX12 MiniModul
>> + *
>> + * Author: Xilinx, Inc.
>> + *
>> + *
>> + * 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.
>> + *
>> + *
>> + * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
>> + * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
>> + * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR STANDARD,
>> + * XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION IS FREE
>> + * FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE FOR OBTAINING
>> + * ANY THIRD PARTY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
>> + * XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
>> + * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY
>> + * WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM
>> + * CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND
>> + * FITNESS FOR A PARTICULAR PURPOSE.
>> + *
>> + *
>> + * Xilinx hardware products are not intended for use in life support
>> + * appliances, devices, or systems. Use in such applications is
>> + * expressly prohibited.
>
> This is a restriction in the rights you have with the software which
> is incompatible with the rights the GPL grants you. There must be no
> such restrictions in GPLed code.
>
> The same applies for other files as well.
>
>
>> +int
>> +checkboard(void)
>> +{
>> + char tmp[64]; /* long enough for environment variables */
>> + char *s, *e;
>> + int i = getenv_r("L", tmp, sizeof(tmp));
>> +
>> + if (i < 0) {
>> + printf("### No HW ID - assuming FX12MM");
>> + } else {
>> + for (e = tmp; *e; ++e) {
>> + if (*e == ' ')
>> + break;
>> + }
>> +
>> + printf("### Board Serial# is ");
>> +
>> + for (s = tmp; s < e; ++s) {
>> + putc(*s);
>> + }
>
> No braces for one line loops, please.
>
>> diff --git a/board/xilinx/fx12mm/serial.c b/board/xilinx/fx12mm/serial.c
>> new file mode 100644
>> index 0000000..0c3e868
>> --- /dev/null
>> +++ b/board/xilinx/fx12mm/serial.c
>> @@ -0,0 +1,154 @@
>> +/*
>> + * Author: Xilinx, Inc.
>> + *
>> + *
>> + * 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.
>> + *
>> + *
>> + * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
>> + * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
>> + * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR STANDARD,
>> + * XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION IS FREE
>> + * FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE FOR OBTAINING
>> + * ANY THIRD PARTY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
>> + * XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
>> + * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY
>> + * WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM
>> + * CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND
>> + * FITNESS FOR A PARTICULAR PURPOSE.
>> + *
>> + *
>> + * Xilinx hardware products are not intended for use in life support
>> + * appliances, devices, or systems. Use in such applications is
>> + * expressly prohibited.
>> + *
>> + *
>> + * (c) Copyright 2002-2004 Xilinx Inc.
>> + * All rights reserved.
>> + *
>> + *
>> + * 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.,
>> + * 675 Mass Ave, Cambridge, MA 02139, USA.
>> + *
>> + */
>> +
>> +#include <asm/u-boot.h>
>> +#include <asm/processor.h>
>> +#include <common.h>
>> +#include <command.h>
>> +#include <config.h>
>> +
>> +DECLARE_GLOBAL_DATA_PTR;
>> +
>> +#define USE_CHAN1 \
>> + ((defined XPAR_UARTNS550_0_BASEADDR) && (defined CFG_INIT_CHAN1))
>> +#define USE_CHAN2 \
>> + ((defined XPAR_UARTNS550_1_BASEADDR) && (defined CFG_INIT_CHAN2))
>> +
>> +#if USE_CHAN1
>> +#include <ns16550.h>
>> +#endif
>> +
>> +#if USE_CHAN1
>> +const NS16550_t COM_PORTS[] = { (NS16550_t) (XPAR_UARTNS550_0_BASEADDR + 3)
>> +#if USE_CHAN2
>> + , (NS16550_t) (XPAR_UARTNS550_1_BASEADDR + 3)
>> +#endif
>> +};
>> +#endif
>
> This code is ugly and close to unreadable.
>
>> +int
>> +serial_init(void)
>> +{
>> +#if USE_CHAN1
>> + int clock_divisor;
>> +
>> + clock_divisor = XPAR_UARTNS550_0_CLOCK_FREQ_HZ / 16 / gd->baudrate;
>> + (void) NS16550_init(COM_PORTS[0], clock_divisor);
>> +#if USE_CHAN2
>> + clock_divisor = XPAR_UARTNS550_1_CLOCK_FREQ_HZ / 16 / gd->baudrate;
>> + (void) NS16550_init(COM_PORTS[1], clock_divisor);
>> +#endif
>> +#endif
>> + return 0;
>
> Please get rid of all these #if's in your code.
>
>> index 0000000..c197186
>> --- /dev/null
>> +++ b/board/xilinx/fx12mm/xparameters.h
>> @@ -0,0 +1,225 @@
>> +
>> +/*******************************************************************
>> +*
>> +* CAUTION: This file is automatically generated by libgen.
>> +* Version: Xilinx EDK 10.1.02 EDK_K_SP2.5
>> +* DO NOT EDIT.
>> +*
>> +* Copyright (c) 2005 Xilinx, Inc. All rights reserved.
>> +*
>> +* Description: Driver parameters
>
> Not GPL conformant.
>
>> diff --git a/include/configs/FX12MM.h b/include/configs/FX12MM.h
>> new file mode 100644
>> index 0000000..b47e403
>> --- /dev/null
>> +++ b/include/configs/FX12MM.h
>> @@ -0,0 +1,103 @@
>> +#ifndef __CONFIG_H
>> +#define __CONFIG_H
>> +
>> +
>
> GPL conformant license ,issing.
>
>
> This code needs some major cleanup before it can go into mainline.
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> "Who is the oldest inhabitant of this village?"
> "We haven't got one; we had one, but he died three weeks ago."
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
--
Ricardo Ribalda
http://www.eps.uam.es/~rribalda/
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/3] fix checkpatch errors
2008-09-06 10:25 ` [U-Boot] [PATCH 2/3] fix checkpatch errors Georg Schardt
2008-09-06 10:25 ` [U-Boot] [PATCH 3/3] fix some other patch errors Georg Schardt
2008-09-06 13:22 ` [U-Boot] [PATCH 2/3] fix checkpatch errors Wolfgang Denk
@ 2008-09-08 12:15 ` JerryVanBaren
2008-09-08 12:38 ` Wolfgang Denk
2008-09-08 13:01 ` Haavard Skinnemoen
2 siblings, 2 replies; 16+ messages in thread
From: JerryVanBaren @ 2008-09-08 12:15 UTC (permalink / raw)
To: u-boot
Georg Schardt wrote:
> ---
> include/configs/FX12MM.h | 12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/include/configs/FX12MM.h b/include/configs/FX12MM.h
> index b47e403..8b8d41c 100644
> --- a/include/configs/FX12MM.h
> +++ b/include/configs/FX12MM.h
> @@ -15,28 +15,28 @@
> #define CONFIG_DOS_PARTITION 1
> #define CFG_SYSTEMACE_BASE XPAR_SYSACE_0_BASEADDR
> #define CFG_SYSTEMACE_WIDTH XPAR_SYSACE_0_MEM_WIDTH
> -#define ADD_SYSTEMACE_CMDS (| CFG_CMD_FAT)
> +#define ADD_SYSTEMACE_CMDS ( | CFG_CMD_FAT )
> #define RM_SYSTEMACE_CMDS
> #else
> #define ADD_SYSTEMACE_CMDS
> -#define RM_SYSTEMACE_CMDS | CFG_CMD_FAT
> +#define RM_SYSTEMACE_CMDS ( | CFG_CMD_FAT )
Dear List,
Philosophical question: is it better to put silly parenthesis around
#defines to make checkpatch shut up or to accept that checkpatch isn't
perfect and let it bitch about things that were done intentionally and
make sense per their usage?
(Yes, I see the first one already had () and the change is just fixing
the spacing.)
I'm serious about this question: in my day job I see a lot of mechanical
praying to the god of miserableC (MISRA-C) adding a HUGE amount of
unnecessary syntax noise such that it becomes hard to read the code
because of all the noise. I've had people at work ask me why "we"
cannot write code that is as easy to understand as the linux kernel.
The answer is simple: "we" are slavishly and mechanically following the
god of "if it was good practice somewhere, sometime, it must always be a
good practice" and not applying good engineering judgment and experience.
It is WRONG to let our tools rule us.[1]
Thanks for letting me unload,
gvb
[1] It took four movies to kill the Terminators, and now I see we still
haven't succeeded.
<http://en.wikipedia.org/wiki/Terminator_Salvation>
P.S. In my day job I've seen way too much lot of...
#define FOOBAR_THREE (3)
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/3] fix checkpatch errors
2008-09-08 12:15 ` JerryVanBaren
@ 2008-09-08 12:38 ` Wolfgang Denk
2008-09-08 13:01 ` Haavard Skinnemoen
1 sibling, 0 replies; 16+ messages in thread
From: Wolfgang Denk @ 2008-09-08 12:38 UTC (permalink / raw)
To: u-boot
Dear JerryVanBaren,
In message <48C51773.5020803@ge.com> you wrote:
> Georg Schardt wrote:
...
> > -#define RM_SYSTEMACE_CMDS | CFG_CMD_FAT
> > +#define RM_SYSTEMACE_CMDS ( | CFG_CMD_FAT )
...
> Philosophical question: is it better to put silly parenthesis around
> #defines to make checkpatch shut up or to accept that checkpatch isn't
> perfect and let it bitch about things that were done intentionally and
> make sense per their usage?
Well, the most important thin is actually that the code is correct,
and the second important thing is that it can be compiled.
With above definitions of "( | CFG_CMD_FAT )" and similar, I think
that the code would NOT compile; instead, I expect GCC to issue some
"error: expected expression before '|' token" error messages (most
probably followed by some other "error: called object 'foo' is not a
function" erros.
> (Yes, I see the first one already had () and the change is just fixing
> the spacing.)
No matter if it fixes spacing or not - it breaks the code.
> I'm serious about this question: in my day job I see a lot of mechanical
OK, here is a serious anser: no. Such changes as suggested above make
zero sense even if they don't effect correctness of code.
See my previous discussion with Guennadi - changing all "return (1);"
into "return 1;" makes no sense to me when it's done just to silence
checkpatch.pl.
> It is WRONG to let our tools rule us.[1]
Agreed 100%.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Do not underestimate the value of print statements for debugging.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/3] fix checkpatch errors
2008-09-08 12:15 ` JerryVanBaren
2008-09-08 12:38 ` Wolfgang Denk
@ 2008-09-08 13:01 ` Haavard Skinnemoen
1 sibling, 0 replies; 16+ messages in thread
From: Haavard Skinnemoen @ 2008-09-08 13:01 UTC (permalink / raw)
To: u-boot
JerryVanBaren <gerald.vanbaren@ge.com> wrote:
> Georg Schardt wrote:
> > ---
> > include/configs/FX12MM.h | 12 ++++++------
> > 1 files changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/include/configs/FX12MM.h b/include/configs/FX12MM.h
> > index b47e403..8b8d41c 100644
> > --- a/include/configs/FX12MM.h
> > +++ b/include/configs/FX12MM.h
> > @@ -15,28 +15,28 @@
> > #define CONFIG_DOS_PARTITION 1
> > #define CFG_SYSTEMACE_BASE XPAR_SYSACE_0_BASEADDR
> > #define CFG_SYSTEMACE_WIDTH XPAR_SYSACE_0_MEM_WIDTH
> > -#define ADD_SYSTEMACE_CMDS (| CFG_CMD_FAT)
> > +#define ADD_SYSTEMACE_CMDS ( | CFG_CMD_FAT )
> > #define RM_SYSTEMACE_CMDS
> > #else
> > #define ADD_SYSTEMACE_CMDS
> > -#define RM_SYSTEMACE_CMDS | CFG_CMD_FAT
> > +#define RM_SYSTEMACE_CMDS ( | CFG_CMD_FAT )
>
> Dear List,
>
> Philosophical question: is it better to put silly parenthesis around
> #defines to make checkpatch shut up or to accept that checkpatch isn't
> perfect and let it bitch about things that were done intentionally and
> make sense per their usage?
In this particular case, I'd recommend not starting the macro with a
binary operator in the first place. That's just _wrong_.
Better define ADD_SYSTEMACE_CMDS etc. as 0 if no flags are to be
added/removed, and add the operator at the callsite.
> (Yes, I see the first one already had () and the change is just fixing
> the spacing.)
The checkpatch author probably never considered that anyone would
actually define a macro beginning with a binary operator, so it's no
surprise that it comes up with strange suggestions.
That said, putting parentheses around macro contents is a good rule in
general since it might avoid quite a few surprises. E.g.
#define FOO -1
bar = 2FOO; /* should give a compile error, but doesn't */
> I'm serious about this question: in my day job I see a lot of mechanical
> praying to the god of miserableC (MISRA-C) adding a HUGE amount of
> unnecessary syntax noise such that it becomes hard to read the code
> because of all the noise. I've had people at work ask me why "we"
> cannot write code that is as easy to understand as the linux kernel.
> The answer is simple: "we" are slavishly and mechanically following the
> god of "if it was good practice somewhere, sometime, it must always be a
> good practice" and not applying good engineering judgment and experience.
I'm not particularly familiar with MISRA-C, but from what I've seen of
it, it's a particularly horrible example of following rules just for
the sake of the rules.
> It is WRONG to let our tools rule us.[1]
Agreed.
Haavard
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/3] fix checkpatch errors
@ 2008-09-09 15:02 Hugo Villeneuve
0 siblings, 0 replies; 16+ messages in thread
From: Hugo Villeneuve @ 2008-09-09 15:02 UTC (permalink / raw)
To: u-boot
git diff ${GITDIFF_OPTS} ${commit} >> ${patch}.patchu-boot-bounces at lists.denx.de wrote:
> Dear Georg Schardt,
>
> In message <48C3B358.6010500@team-ctech.de> you wrote:
>>
>> - create my own testing branch: "git branch testing"
>> - switch to this branch: "git checkout testing"
>> - copy/modify files
>> - add the new files with "git add board/xilinx/fx12mm/"
>> - commit the changes with "git commit -a"
>> - create a patch with "git format-patch origin"
>> - check this patch with checkpatch.pl
>> - fix the errors, commit again, create patch again get 2 patchfiles
I?m not an expert with GIT, but I would suggest the following change to avoid unnecessary commits:
1. Create my own testing branch: "git branch testing"
2. Switch to this branch: "git checkout testing"
3. Copy/modify files
4. Create temporary patch from local changes: "git diff > temporary.patch"
5. Check this patch with checkpatch.pl
6. If errors found: go back to step 3, else go to step 7
7. Add the new/modified files with "git add board/xilinx/fx12mm/"
8. Commit the changes with "git commit -a"
9. Create a patch with "git format-patch origin"
10. Check this patch with checkpatch.pl
Hugo V.
Hugo Villeneuve
Hardware developer | Concepteur mat?riel
Lyrtech
Phone/T?l. : (1) (418) 877-4644 #2395
Toll-free/Sans frais - Canada & USA : (1) (888) 922-4644 #2395
Fax/T?l?c. : (1) (418) 877-7710
www.lyrtech.com
Infinite possibilities...TM
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2008-09-09 15:02 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-06 10:25 [U-Boot] First Patch Georg Schardt
2008-09-06 10:25 ` [U-Boot] [PATCH 1/3] Add support for the virtex4fx12 minimodul Georg Schardt
2008-09-06 10:25 ` [U-Boot] [PATCH 2/3] fix checkpatch errors Georg Schardt
2008-09-06 10:25 ` [U-Boot] [PATCH 3/3] fix some other patch errors Georg Schardt
2008-09-06 13:22 ` [U-Boot] [PATCH 2/3] fix checkpatch errors Wolfgang Denk
2008-09-06 14:02 ` Georg Schardt
2008-09-06 15:45 ` Wolfgang Denk
2008-09-07 10:56 ` Georg Schardt
2008-09-07 11:15 ` Wolfgang Denk
2008-09-07 11:48 ` Georg Schardt
2008-09-08 12:15 ` JerryVanBaren
2008-09-08 12:38 ` Wolfgang Denk
2008-09-08 13:01 ` Haavard Skinnemoen
2008-09-06 13:34 ` [U-Boot] [PATCH 1/3] Add support for the virtex4fx12 minimodul Wolfgang Denk
2008-09-07 21:50 ` Ricardo
-- strict thread matches above, loose matches on Subject: below --
2008-09-09 15:02 [U-Boot] [PATCH 2/3] fix checkpatch errors Hugo Villeneuve
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox