First Patch
Subsystems (2)
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
PATCH 1/3 Add support for the virtex4fx12 minimodul
--- 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(-)
board/xilinx/fx12mm/Makefile new file +64 -0
@@ -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 + +#########################################################################
board/xilinx/fx12mm/config.mk new file +28 -0
@@ -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
board/xilinx/fx12mm/fx12mm.c new file +118 -0
118 lines not on this page · raw message
board/xilinx/fx12mm/init.S new file +48 -0
48 lines not on this page · raw message
board/xilinx/fx12mm/serial.c new file +154 -0
154 lines not on this page · raw message
board/xilinx/fx12mm/u-boot.lds new file +149 -0
149 lines not on this page · raw message
board/xilinx/fx12mm/xparameters.h new file +225 -0
225 lines not on this page · raw message
include/configs/FX12MM.h new file +103 -0
103 lines not on this page · raw message
Signature · 1 line
1.4.4.4
PATCH 2/3 fix checkpatch errors
--- include/configs/FX12MM.h | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
include/configs/FX12MM.h +6 -6
@@ -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
Signature · 1 line
1.4.4.4
PATCH 3/3 fix some other patch errors
--- 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(-)
Makefile +3 -0
@@ -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
board/xilinx/fx12mm/fx12mm.c +0 -4
@@ -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 ) {
board/xilinx/fx12mm/serial.c +1 -1
@@ -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 )
include/configs/FX12MM.h +4 -4
@@ -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
Signature · 1 line
1.4.4.4
PATCH 2/3 fix checkpatch errors
In reply to Georg SchardtDear Georg Schardt,
Quoted 3 lines · In message <[email protected]> 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
Signature · 5 lines
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_
PATCH 2/3 fix checkpatch errors
-----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
Quoted 9 lines · Wolfgang Denk
Dear Georg Schardt,
Quoted 3 lines · In message <[email protected]> you wrote:
--- include/configs/FX12MM.h | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)This file does not even exist yet.
Quoted 9 lines
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-----
PATCH 2/3 fix checkpatch errors
Dear Georg Schardt,
Quoted 3 lines · In message <[email protected]> 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
Signature · 6 lines
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 ChesterfieldPATCH 2/3 fix checkpatch errors
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
Quoted 16 lines · Wolfgang Denk
Dear Georg Schardt,
Quoted 3 lines · In message <[email protected]> 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
PATCH 2/3 fix checkpatch errors
Dear Georg Schardt,
Quoted 9 lines · In message <[email protected]> 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
Quoted 2 lines
- 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
Signature · 4 lines
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."
PATCH 2/3 fix checkpatch errors
Hi again,
Quoted 11 lines
This all looks good so far
Quoted 3 lines
- 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.
Quoted 5 lines
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
PATCH 2/3 fix checkpatch errors
In reply to Georg SchardtQuoted 9 lines · Georg Schardt
--- include/configs/FX12MM.h | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)include/configs/FX12MM.h +0
-0
include/configs/FX12MM.h line 22
Quoted 10 lines
include/configs/FX12MM.h +2
-2@@ -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)
PATCH 2/3 fix checkpatch errors
Dear JerryVanBaren,
Quoted 1 line · In message <[email protected]> you wrote:
Georg Schardt wrote:
...
Quoted 2 lines
Quoted 2 lines
include/configs/FX12MM.h +1
-1-#define RM_SYSTEMACE_CMDS | CFG_CMD_FAT +#define RM_SYSTEMACE_CMDS ( | CFG_CMD_FAT )
...
Quoted 4 lines
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.
Quoted 2 lines
(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.
Quoted 1 line
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.
Quoted 1 line
It is WRONG to let our tools rule us.[1]
Agreed 100%.
Best regards,
Wolfgang Denk
Signature · 4 lines
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.
PATCH 2/3 fix checkpatch errors
In reply to JerryVanBarenQuoted 23 lines · JerryVanBaren
Quoted 9 lines · Georg Schardt
--- include/configs/FX12MM.h | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)include/configs/FX12MM.h +0
-0include/configs/FX12MM.h line 22
Quoted 10 lines
include/configs/FX12MM.h +2
-2@@ -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,
Quoted 4 lines
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.
Quoted 2 lines
(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 */
Quoted 8 lines
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.
Quoted 1 line
It is WRONG to let our tools rule us.[1]
Agreed.
Haavard
PATCH 1/3 Add support for the virtex4fx12 minimodul
In reply to Georg SchardtDear Georg Schardt,
Quoted 10 lines · In message <[email protected]> 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.
Quoted 128 lines
board/xilinx/fx12mm/Makefile new file +64
-0@@ -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 + +#########################################################################board/xilinx/fx12mm/config.mk new file +28
-0@@ -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 = 0xFF800000board/xilinx/fx12mm/fx12mm.c new file +18
-0@@ -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.
board/xilinx/fx12mm/fx12mm.c line 28
Quoted 10 lines
board/xilinx/fx12mm/fx12mm.c new file +10
-0+* 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.
Quoted 10 lines
board/xilinx/fx12mm/fx12mm.c new file +10
-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 {
board/xilinx/fx12mm/fx12mm.c line 74
Quoted 10 lines
board/xilinx/fx12mm/fx12mm.c new file +10
-0+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.
Quoted 58 lines
board/xilinx/fx12mm/serial.c new file +52
-0@@ -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
board/xilinx/fx12mm/serial.c line 62
Quoted 10 lines
board/xilinx/fx12mm/serial.c new file +10
-0+#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.
Quoted 4 lines
board/xilinx/fx12mm/serial.c new file +4
-0+int +serial_init (void ) +{ +#if USE_CHAN1
board/xilinx/fx12mm/serial.c line 77
Quoted 10 lines
board/xilinx/fx12mm/serial.c new file +10
-0+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.
Quoted 4 lines
index 0000000..c197186
board/xilinx/fx12mm/xparameters.h line 10
Quoted 10 lines
board/xilinx/fx12mm/xparameters.h new file +10
-0@@ -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.
include/configs/FX12MM.h line 4
Quoted 10 lines
include/configs/FX12MM.h new file +4
-0@@ -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
Signature · 5 lines
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."
PATCH 1/3 Add support for the virtex4fx12 minimodul
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.
Quoted 323 lines · Wolfgang Denk
Dear Georg Schardt,
Quoted 10 lines · In message <[email protected]> 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.
Quoted 128 lines
board/xilinx/fx12mm/Makefile new file +64
-0@@ -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 + +#########################################################################board/xilinx/fx12mm/config.mk new file +28
-0@@ -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 = 0xFF800000board/xilinx/fx12mm/fx12mm.c new file +18
-0@@ -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. board/xilinx/fx12mm/fx12mm.c line 28
Quoted 10 lines
board/xilinx/fx12mm/fx12mm.c new file +10
-0+* 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.
Quoted 10 lines
board/xilinx/fx12mm/fx12mm.c new file +10
-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 {board/xilinx/fx12mm/fx12mm.c line 74
Quoted 10 lines
board/xilinx/fx12mm/fx12mm.c new file +10
-0+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.
Quoted 58 lines
board/xilinx/fx12mm/serial.c new file +52
-0@@ -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 board/xilinx/fx12mm/serial.c line 62
Quoted 10 lines
board/xilinx/fx12mm/serial.c new file +10
-0+#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.
Quoted 4 lines
board/xilinx/fx12mm/serial.c new file +4
-0+int +serial_init (void ) +{ +#if USE_CHAN1 board/xilinx/fx12mm/serial.c line 77
Quoted 10 lines
board/xilinx/fx12mm/serial.c new file +10
-0+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.
Quoted 4 lines
index 0000000..c197186
board/xilinx/fx12mm/xparameters.h line 10
Quoted 10 lines
board/xilinx/fx12mm/xparameters.h new file +10
-0@@ -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.
include/configs/FX12MM.h line 4
Quoted 10 lines
include/configs/FX12MM.h new file +4
-0@@ -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
Signature · 2 lines
Ricardo Ribalda http://www.eps.uam.es/~rribalda/