Re: [U-Boot-Users] Altera Stratix II
On 08:19 Tue 26 Feb , Markus Brunner wrote: > Hi, > > I've seen some patches for stratix II support on the Mailinglist, but none > ended up in the git repository. > e.g.: > http://article.gmane.org/gmane.comp.boot-loaders.u-boot/28559 > > Where are the problems and what has to be done to bring them into u-boot? First, the patch is broken Second, there some coding style Third, the patch won't applied on the current tree Feel free to send a rebase and fixed patch Best Regards, J. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Re: [U-Boot-Users] [PATCH] MPC5121e ADS PCI support
On 08:02 Tue 26 Feb , Jean-Christophe PLAGNIOL-VILLARD wrote: > On 17:03 Mon 25 Feb , John Rigby wrote: > > Third time's the charm. > > > > Adds PCI support for MPC5121 > > > > Tested with drivers/net/rtl8139.c > > > > This patch is identical to the previous except PCI support is > > now conditonal since pci on old silicon (most silicon currently in field) > > does not work. > > > > ads5121_PCI_config turns on PCI > > > > Signed-off-by: John Rigby <[EMAIL PROTECTED]> > > --- > > Makefile | 11 ++- > > board/ads5121/Makefile|2 +- > > board/ads5121/ads5121.c |1 + > > board/ads5121/pci.c | 216 > > + > > cpu/mpc512x/speed.c | 21 +++- > > include/asm-ppc/global_data.h |1 + > > include/asm-ppc/immap_512x.h | 61 +++- > > include/configs/ads5121.h | 32 ++- > > include/mpc512x.h | 84 > > 9 files changed, 414 insertions(+), 15 deletions(-) > > create mode 100644 board/ads5121/pci.c > > > > diff --git a/Makefile b/Makefile > > index d6a0299..4f4efa4 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -733,8 +733,15 @@ motionpro_config: unconfig > > # > > ## MPC512x Systems > > # > > -ads5121_config: unconfig > > - @$(MKCONFIG) ads5121 ppc mpc512x ads5121 > > +ads5121_config \ > > +ads5121_PCI_config \ > > + :unconfig > > + @echo "" >$(obj)include/config.h > > + @if [ "$(findstring _PCI_,$@)" ] ; then \ > > + echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \ > > + $(XECHO) "... with PCI enabled" ; \ > > + fi > > + @$(MKCONFIG) -a ads5121 ppc mpc512x ads5121 > > > > > > # > > diff --git a/board/ads5121/Makefile b/board/ads5121/Makefile > > index cd8148c..f15a88b 100644 > > I think I'll be better ot move the CONFIG_PCI to Makefile as follow > > > --- a/board/ads5121/Makefile > > +++ b/board/ads5121/Makefile > > @@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk > > > > LIB= $(obj)lib$(BOARD).a > COBJS-y := $(BOARD).o > COBJS-$(CONFIG_PCI) := pci sorry a few missing, it will be this COBJS-y+= $(BOARD).o COBJS-$(CONFIG_PCI)+= pci > > SRCS:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c) > OBJS := $(addprefix $(obj),$(COBJS-y)) > > instead of > > > > -COBJS := $(BOARD).o > > +COBJS := $(BOARD).o pci.o Best Regards, J. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Re: [U-Boot-Users] [PATCH 4/8] [Makefile] Sort COBJS in lib_ Makefiles
On 18:35 Mon 25 Feb , Marian Balakowicz wrote: > Signed-off-by: Marian Balakowicz <[EMAIL PROTECTED]> > --- > > lib_avr32/Makefile |2 +- > lib_blackfin/Makefile |4 ++-- > lib_i386/Makefile |4 ++-- > lib_m68k/Makefile |2 +- > lib_microblaze/Makefile |2 +- > lib_mips/Makefile |2 +- > lib_nios/Makefile |2 +- > lib_nios2/Makefile |2 +- > lib_ppc/Makefile|5 ++--- > 9 files changed, 12 insertions(+), 13 deletions(-) > > > diff --git a/lib_avr32/Makefile b/lib_avr32/Makefile > index ebe237b..afbce45 100644 > --- a/lib_avr32/Makefile > +++ b/lib_avr32/Makefile > @@ -29,7 +29,7 @@ LIB = $(obj)lib$(ARCH).a > > SOBJS= memset.o > > -COBJS= board.o interrupts.o bootm.o > +COBJS= board.o bootm.o interrupts.o > > SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) > OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) > diff --git a/lib_blackfin/Makefile b/lib_blackfin/Makefile > index ac3fb28..4a262fc 100644 > --- a/lib_blackfin/Makefile > +++ b/lib_blackfin/Makefile > @@ -29,9 +29,9 @@ include $(TOPDIR)/config.mk > > LIB = $(obj)lib$(ARCH).a > > -SOBJS= memcpy.o memcmp.o memset.o memmove.o > +SOBJS= memcmp.o memcpy.o memmove.o memset.o > > -COBJS= post.o tests.o board.o bootm.o bf533_string.o cache.o muldi3.o > +COBJS= bf533_string.o board.o bootm.o cache.o muldi3.o post.o tests.o > It will be nice if you could split it in 1 line for 1 file as it -SOBJS = memcpy.o memcmp.o memset.o memmove.o +SOBJS += memcmp.o +SOBJS += mmemcpy.o +SOBJS += memmove.o +SOBJS += memset.o . > SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) > OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) > diff --git a/lib_i386/Makefile b/lib_i386/Makefile Best regards, J. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] Altera Stratix II
Hi, I've seen some patches for stratix II support on the Mailinglist, but none ended up in the git repository. e.g.: http://article.gmane.org/gmane.comp.boot-loaders.u-boot/28559 Where are the problems and what has to be done to bring them into u-boot? Regards Markus - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Re: [U-Boot-Users] [PATCH] MPC5121e ADS PCI support
On 17:03 Mon 25 Feb , John Rigby wrote: > Third time's the charm. > > Adds PCI support for MPC5121 > > Tested with drivers/net/rtl8139.c > > This patch is identical to the previous except PCI support is > now conditonal since pci on old silicon (most silicon currently in field) > does not work. > > ads5121_PCI_config turns on PCI > > Signed-off-by: John Rigby <[EMAIL PROTECTED]> > --- > Makefile | 11 ++- > board/ads5121/Makefile|2 +- > board/ads5121/ads5121.c |1 + > board/ads5121/pci.c | 216 > + > cpu/mpc512x/speed.c | 21 +++- > include/asm-ppc/global_data.h |1 + > include/asm-ppc/immap_512x.h | 61 +++- > include/configs/ads5121.h | 32 ++- > include/mpc512x.h | 84 > 9 files changed, 414 insertions(+), 15 deletions(-) > create mode 100644 board/ads5121/pci.c > > diff --git a/Makefile b/Makefile > index d6a0299..4f4efa4 100644 > --- a/Makefile > +++ b/Makefile > @@ -733,8 +733,15 @@ motionpro_config:unconfig > # > ## MPC512x Systems > # > -ads5121_config: unconfig > - @$(MKCONFIG) ads5121 ppc mpc512x ads5121 > +ads5121_config \ > +ads5121_PCI_config \ > + :unconfig > + @echo "" >$(obj)include/config.h > + @if [ "$(findstring _PCI_,$@)" ] ; then \ > + echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \ > + $(XECHO) "... with PCI enabled" ; \ > + fi > + @$(MKCONFIG) -a ads5121 ppc mpc512x ads5121 > > > # > diff --git a/board/ads5121/Makefile b/board/ads5121/Makefile > index cd8148c..f15a88b 100644 I think I'll be better ot move the CONFIG_PCI to Makefile as follow > --- a/board/ads5121/Makefile > +++ b/board/ads5121/Makefile > @@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk > > LIB = $(obj)lib$(BOARD).a COBJS-y := $(BOARD).o COBJS-$(CONFIG_PCI) := pci SRCS:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c) OBJS:= $(addprefix $(obj),$(COBJS-y)) instead of > > -COBJS:= $(BOARD).o > +COBJS:= $(BOARD).o pci.o > > SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) > OBJS := $(addprefix $(obj),$(COBJS)) > +#include > + > +#ifdef CONFIG_PCI so you could remove this > + > +#include > +#include > +#include > +#if defined(CONFIG_OF_LIBFDT) > +#include > +#include > +#endif > + > +DECLARE_GLOBAL_DATA_PTR; > + ... > + tmp[0] = cpu_to_be32(gd->pci_clk); > + do_fixup_by_path(blob, path, "clock-frequency", > + &tmp, sizeof(tmp[0]), 1); > +#endif /* CONFIG_OF_LIBFDT */ > +#endif/* CONFIG_PCI */ and this > diff --git a/include/configs/ads5121.h b/include/configs/ads5121.h > index 09c3140..21c60ae 100644 > --- a/include/configs/ads5121.h > +++ b/include/configs/ads5121.h > @@ -34,6 +34,9 @@ > * 0x3000_ - 0x3001_ SRAM (128 KB) > * 0x8000_ - 0x803F_ IMMR (4 MB) > * 0x8200_ - 0x8200_001F CPLD (32 B) > + * 0x8400_ - 0x82FF_ PCI I/O space (16 MB) > + * 0xA000_ - 0xAFFF_ PCI memory space (256 MB) > + * 0xB000_ - 0xBFFF_ PCI memory mapped I/O space (256 MB) > * 0xFC00_ - 0x_ NOR Boot FLASH (64 MB) > */ > > @@ -43,7 +46,9 @@ > #define CONFIG_E300 1 /* E300 Family */ > #define CONFIG_MPC512X 1 /* MPC512X family */ > > -#undef CONFIG_PCI > +#if 0 /* set at config time */ > +#define CONFIG_PCI > +#endif I think is not needed, just a simple comment will be enough > > #define CFG_MPC512X_CLKIN6600/* in Hz */ > > @@ -217,6 +222,31 @@ > #define CFG_PROMPT_HUSH_PS2 "> " > #endif Best Regards, J. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Re: [U-Boot-Users] [PATCH 0/8] [new uImage] patchset5: Dual format uImage handling framework
On Feb 25, 2008, at 11:34 AM, Marian Balakowicz wrote: > This patch series adds initial framework for dual format uImage > support to > U-boot. Booting control flow is reworked and is now able to > recognize both > formats: legacy format based on a binary image_header stucture and > new FIT > uImage format based on a libfdt. Legacy specific code is adapted a > bit and > enterd only for legacy format images. Proper new uImage format > handling is not > implement in this patch series, appropriate cases are stubed and > will be > updated with the new uImage format low level code in the comming > patchsets. > > To sum up: > Legacy format image handling shall continue to work, FIT format > image handling > will produce debug messages and return with error. > > Three other patches refactor legacy format specific code to a helper > routines > image_get_kernel(), image_get_fdt() and move PPC FDT blob > relocattion code to > a dedicated routine fdt_relocate(). > > Included are also fixes: reworked gen_get_image() and correced raw > FDT blob > handling when CONFIG_FIT is disabled. > > Please review and comment. > > Marian Balakowicz (8): > [new uImage] Correct raw FDT blob handlig when CONFIG_FIT is > disabled > [new uImage] POWERPC: Add image_get_fdt() routine > [new uImage] Add image_get_kernel() routine > [new uImage] Move image verify flag to bootm_headers structure > [Makefile] Sort COBJS in lib_ Makefiles > [new uImage] Optimize gen_get_image() flow control > [new uImage] POWERPC: Split get_fdt() into get and relocate > routines > [new uImage] Add dual format uImage support framework Is it just me or did patch [1/8 - add dual format..] not make it to the list? -k - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] update new-image branch of u-boot-testing
Can we get 1.3.2-rc2 pulled into the 'new-image' branch of u-boot- testing. thanks - k - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Re: [U-Boot-Users] [PATCH v2] [new uImage] ppc: Re-order ramdisk/fdt handling sequence
On Feb 22, 2008, at 11:08 AM, Marian Balakowicz wrote: > Jerry Van Baren wrote: >> Marian Balakowicz wrote: >>> Kumar Gala wrote: On Feb 18, 2008, at 1:46 PM, Jerry Van Baren wrote: > Kumar Gala wrote: >> On Feb 18, 2008, at 1:15 PM, Jerry Van Baren wrote: >>> Kumar Gala wrote: On Feb 18, 2008, at 11:51 AM, Jerry Van Baren wrote: > Kumar Gala wrote: > snip > >>> The patch is creating dummy initrd entries in the reserved map >>> and in /chosen, only to work hard to delete and re-create the >>> reserved map entries and rewrite the /chosen entries. >>> >>> My counter-proposal is to not bother with dummy values. Simply >>> pass in 0,0 which will prevent the creation of the initrd >>> entries >>> by fdt_chosen(). By not creating dummy entries, you can simply >>> create the proper entries once you know what the the correct >>> values are, rather than the more complicated rsvmap search & >>> delete + rsvmap creation + /chosen modifications. >> Ahh, the reason I wanted them created was to ensure we have >> enough >> size for them up front rather than figuring that out later. By >> creating them and replacing them I will not being changing the >> size at all. >> - k > OK, I see. > > Currently this isn't an issue because our blob has a fixed size > that has free space inside it, so creating the rsvmap and /chosen > entries eat at the internal free space and don't change the total > blob size. > > People are advocating dynamically increasing the blob size, which > simplifies things for blob generation (don't have to guess how big > to make the blob when running the dtc to create it), but that > would > cause problems with my counter-proposal. And the whole point of my patch was to enable the ability to dynamically grow the blob before we do anything w/the ramdisk. >>> >>> But we don't really grow the blob, we are just allocating the >>> space for >>> the initrd properties - *if* the blob already has enough free >>> space. If >>> the blob does not have enough free space we'll hit the bottom >>> anyway, >>> whether in fdt_chosen() or ft_board_setup(), so it seem that it >>> doesn't >>> matter whether we pre-allocate space for initrd or not. Or am I >>> missing >>> something? >>> >>> I was rather thinking of increasing the total blob size when >>> relocating >>> it. Currently relocation happens only when the blob is not within >>> BOOTMAPSZ region, so we would need to always relocate the blob and >>> figure out the size delta: (1) get it from env variable, if set >>> (2) or >>> use some default delta. What do you think? >>> > >> The missing part is libfdt doesn't exactly support dynamic resizing >> and >> our current code doesn't do in-place resizing (which it could do by >> doing a move to the same location, but with a larger/smaller length). >> >> Kumar is lining up the pieces to get there, but we aren't there >> yet... > > I see, but how about resizing to a new location: > > - err = fdt_open_into (fdt_blob, (void *)of_start, of_len); > + err = fdt_open_into (fdt_blob, (void *)of_start, of_len + delta); > > Should that work? > > If we add LMB and rework bootm memory allocation, putting things > (kernel, cmdline, kdb, initrd (optionally), fdt) in sequence starting > from bootm_low then we may want to always relocate fdt to avoid > overlapping. And, in case of new uImage FDT blob will be embedded in a > new uImage shell which is a blob itself. So, in this case in-place > resizing is not really a clean option, we would need to resize the > embedding new uImage blob first, and this one may have significant > size, > so I suspect it may impact performance. I felt the sequence (on PPC) is either: kernel, cmdline, kdb, initrd or kernel, fdt, initrd The reason being is that initrd doesn't need to be constrained to BOOTMAPSZ but cmdline, kdb, and fdt would/should be. - k - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Re: [U-Boot-Users] [PATCH] [new uImage] rework error handling so common functions don't reset
On Feb 22, 2008, at 8:36 AM, Bartlomiej Sieka wrote: > Wolfgang Denk wrote: >> Dear Kumar, >> in message > [EMAIL PROTECTED]> you wrote: >>> Changed image_get_ramdisk() to just return NULL on error and have >>> get_ramdisk() propogate that error to the caller. It's left to the >>> caller to call do_reset() if it wants to. >>> >>> Also moved calling do_reset() in get_fdt() on ppc to a common >>> location. >>> In the future we will change get_fdt() to return success/failure and >>> not call do_reset() at all. >>> >>> Signed-off-by: Kumar Gala <[EMAIL PROTECTED]> >> Just to make my position clear: I expect that you negotiate new-image >> related patches more or less directly with Bartek, who I consider as >> kind of "new-image" custodian. >> That means that I will not track the state of these patches - if you >> want me to apply something directly, please ring a bell. >> Bartek: I would also appreciate if you could merge Kumar's patches in >> a local repo and then send me just a pull request when something is >> ready to go into u-boot-testing (or even into mainline). > > OK, will coordinate new uImage stuff that gets posted to the list, > and request pulling as needed. Works for me. I'll look at updating my patches based on the new code in the branch. - k - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Re: [U-Boot-Users] [PATCH v2] [new uImage] ppc: Re-order ramdisk/fdt handling sequence
On Feb 22, 2008, at 8:36 AM, Bartlomiej Sieka wrote: > Jerry Van Baren wrote: >> Wolfgang Denk wrote: >>> In message <8B11A571-3BC2-42BD-9B66- >>> [EMAIL PROTECTED]> you wrote: And the whole point of my patch was to enable the ability to dynamically grow the blob before we do anything w/the ramdisk. >>> So what is the state of this patch now? Will it go in through the >>> FDT >>> custodian repo, or has it been rejected, or am I supposed to apply >>> it >>> directly? Or? > [...] >> Most of the email exchanges were with me and the patch is fine IMHO. >> I was expecting it to go through the "new-image" custodian, but I >> would be happy to apply it to the u-boot-fdt repo and push it up >> from there. > > Jerry, Kumar, > > I think it would be better to have this patch (and other ones by Kumar > that touch booting-related code) go through the new-image branch. > Otherwise we'll have merge conflicts down the road, especially since > we've got a big patch coming, that adds framework for new image > handling. I'd like to have this framework patch merged first, then > take > care of (re-based) boot-related patches that have been posted > recently. Agreed. Was off having some fun for a few days. I think going through the new image tree is best. - k - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] Problems with new ethernet init on mpc8360
Hi Kim, I have a mpc8360emds eval board. The ee62ed patch (below) speeds up the start up (good), but seems to cause the board to hang on the *second* ethernet operation. I can cause this by doing two pings in a row: the first ping initializes the network and completes successfully. The second ping hangs the board: it never completes. I cannot abort it with ^C. The only way out is to reset the board. The same thing happens with two back-to-back tftp operations or a ping followed by a tftp operation. If I back out the ee62ed patch (below), it "fixes" the problem. I tried backing out some simple portions of the patch (added delays back in) with no success. I've given up chasing this for tonight. Any inspiration you can generate would be appreciated, I'll chase it some more tomorrow. Thanks, gvb commit ee62ed3286f83b98b7785e0318dc6379e78f7ff6 Author: Kim Phillips <[EMAIL PROTECTED]> Date: Tue Jan 15 14:11:00 2008 -0600 net: reduce boot latency on QE UEC based boards actually polling for PHY autonegotiation to finish enables us to remove the 5 second boot prompt latency present on QE based boards. call to qe_set_mii_clk_src in init_phy, and mv call to init_phy from uec_initialize to uec_init by Joakim Tjernlund; autonegotiation wait code shamelessly stolen from tsec driver. also rm unused CONFIG_RMII_MODE code. Signed-off-by: Kim Phillips <[EMAIL PROTECTED]> Signed-off-by: Joakim Tjernlund <[EMAIL PROTECTED]> Signed-off-by: Ben Warren <[EMAIL PROTECTED]> - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Re: [U-Boot-Users] [PATCH] Add support for Generic PHY in macb
Michael Trimarchi wrote: > Hi, > - Messaggio originale - > >> Da: Haavard Skinnemoen <[EMAIL PROTECTED]> >> A: Michael Trimarchi <[EMAIL PROTECTED]> >> Cc: Michael Schwingen <[EMAIL PROTECTED]>; u-boot-users@lists.sourceforge.net >> Inviato: Venerdì 22 febbraio 2008, 17:08:56 >> Oggetto: Re: [U-Boot-Users] [PATCH] Add support for Generic PHY in macb >> >> On Fri, 22 Feb 2008 16:02:13 + (GMT) >> Michael Trimarchi wrote: >> >> In any case, the dm9161a PHY in question does implement MDIO, so it really should work without any modifications. >>> Maybe we can add the for cycle like in linux to check the phy addr? >>> >> Yes, we could do that. But it comes with its own share of problems -- >> some boards have a too weak pull-up (or none at all) on the MDIO line, >> so the probing code sometimes thinks it has found a whole bunch of >> PHYs... >> >> Haavard >> >> > But the u-boot user may to choice to use the automatic detection, based on > phy_id mask and stop the search on the first one, or somenthing like this. > > Michael > I don't follow why you'd want to do this. As Andy, Haavard and others have pointed out, you can't probe for PHY addresses because quite often multiple ports will share an MDIO bus, and also it's unreliable at best. Anybody who writes U-boot code needs to know the details of his or her board, and PHY addresses are always fixed in hardware. There may be some reason to make them dynamic, but I can't imagine why. regards, Ben - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Re: [U-Boot-Users] [PATCH] Add support for Generic PHY in macb
Haavard Skinnemoen wrote: > On Fri, 22 Feb 2008 16:05:34 +0100 > Michael Schwingen <[EMAIL PROTECTED]> wrote: > > >> Haavard Skinnemoen wrote: >> >>> All MII-capable PHYs should have a working PHYSID1 register. If it >>> doesn't, something is broken. >>> >>> >> It depends - I am not sure if there are PHYs which simply do not >> implement MDIO, but at least for ethernet switches, such chips do exist. >> > > Right. We might need to add support for such PHYs, but just disabling > the sanity check is far from enough. > > In any case, the dm9161a PHY in question does implement MDIO, so it > really should work without any modifications. > > >>> So I think the CONFIG_GENERIC_PHY name is misleading -- the test is >>> generic enough as is. CONFIG_BROKEN_PHY would be better, if there's >>> really no way to get your PHY to behave. >>> >>> >> Right. Or CONFIG_PHY_NO_MDIO or something like that. This is in the >> direction of CONFIG_MII_ETHSWITCH which is used eg. by AcTux-2 for this >> purpose. >> > > I think U-Boot needs a common PHY layer like Linux has. IIRC someone > suggested the same thing some time ago. There's no point going around > adding the same special-case code to every ethernet driver in the > tree... > > Yeah, that's me. I'm working on porting the Linux PHY driver over, but have had next to no time in the past few months (had to find a new job etc...) I hope to seriously get back into it in the next few days, with a goal of the next U-boot release for an initial spin. >>> But note that if MDIO communication isn't working, autonegotiation >>> won't work, and the speed and duplex settings will most likely be >>> wrong. So I don't think simply #ifdefing out that sanity check is >>> really going to solve any problems. >>> >>> >> The chip may do autonegotiation by default, however, the MAC driver >> still needs to know about the negotiated speed/duplex, so unless there >> is some board-specific way to read those (eg. by GPIO pins), only one >> speed/duplex will work and all other modes will be broken. This is >> different from the case with the hardwired ethernet switch - in case of >> the switch, we know that the MII port is always running at 100Mbps, >> full-duplex. >> > > Hmm...most switches support autonegotiation don't they? If not, what > happens if you plug in in an old computer with a 10Mbps ethernet board? > > Some do and some don't. Typically when you connect to a switch via RvMII the data rate is set by strap pins or over the control plane, which can be MDIO, SPI, or whatever. > But I guess we need something equivalent to CONFIG_FIXED_PHY in Linux... > > Yeah > Haavard > > - > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ > ___ > U-Boot-Users mailing list > U-Boot-Users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/u-boot-users > > - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Re: [U-Boot-Users] [PATCH] MPC5121e ADS PCI support
Ignore the second patch it is the same as the first. Sorry about that. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH] MPC5121e ADS PCI support
Third time's the charm. Adds PCI support for MPC5121 Tested with drivers/net/rtl8139.c This patch is identical to the previous except PCI support is now conditonal since pci on old silicon (most silicon currently in field) does not work. ads5121_PCI_config turns on PCI Signed-off-by: John Rigby <[EMAIL PROTECTED]> --- Makefile | 11 ++- board/ads5121/Makefile|2 +- board/ads5121/ads5121.c |1 + board/ads5121/pci.c | 216 + cpu/mpc512x/speed.c | 21 +++- include/asm-ppc/global_data.h |1 + include/asm-ppc/immap_512x.h | 61 +++- include/configs/ads5121.h | 32 ++- include/mpc512x.h | 84 9 files changed, 414 insertions(+), 15 deletions(-) create mode 100644 board/ads5121/pci.c diff --git a/Makefile b/Makefile index d6a0299..4f4efa4 100644 --- a/Makefile +++ b/Makefile @@ -733,8 +733,15 @@ motionpro_config: unconfig # ## MPC512x Systems # -ads5121_config: unconfig - @$(MKCONFIG) ads5121 ppc mpc512x ads5121 +ads5121_config \ +ads5121_PCI_config \ + :unconfig + @echo "" >$(obj)include/config.h + @if [ "$(findstring _PCI_,$@)" ] ; then \ + echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \ + $(XECHO) "... with PCI enabled" ; \ + fi + @$(MKCONFIG) -a ads5121 ppc mpc512x ads5121 # diff --git a/board/ads5121/Makefile b/board/ads5121/Makefile index cd8148c..f15a88b 100644 --- a/board/ads5121/Makefile +++ b/board/ads5121/Makefile @@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk LIB= $(obj)lib$(BOARD).a -COBJS := $(BOARD).o +COBJS := $(BOARD).o pci.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/board/ads5121/ads5121.c b/board/ads5121/ads5121.c index 462f41d..8629b03 100644 --- a/board/ads5121/ads5121.c +++ b/board/ads5121/ads5121.c @@ -34,6 +34,7 @@ CLOCK_SCCR1_PSCFIFO_EN | \ CLOCK_SCCR1_DDR_EN | \ CLOCK_SCCR1_FEC_EN | \ +CLOCK_SCCR1_PCI_EN | \ CLOCK_SCCR1_TPR_EN) #define SCCR2_CLOCKS_EN(CLOCK_SCCR2_MEM_EN | \ diff --git a/board/ads5121/pci.c b/board/ads5121/pci.c new file mode 100644 index 000..8868171 --- /dev/null +++ b/board/ads5121/pci.c @@ -0,0 +1,216 @@ +/* + * Copyright (C) Freescale Semiconductor, Inc. 2006, 2007. All rights reserved. + * + * 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 + +#ifdef CONFIG_PCI + +#include +#include +#include +#if defined(CONFIG_OF_LIBFDT) +#include +#include +#endif + +DECLARE_GLOBAL_DATA_PTR; + +/* System RAM mapped to PCI space */ +#define CONFIG_PCI_SYS_MEM_BUS CFG_SDRAM_BASE +#define CONFIG_PCI_SYS_MEM_PHYSCFG_SDRAM_BASE + +static struct pci_controller pci_hose; + + +/** + * pci_init_board() + * + */ +void +pci_init_board(void) +{ + volatile immap_t *immr = (immap_t *) CFG_IMMR; + volatile law512x_t *pci_law; + volatile pot512x_t *pci_pot; + volatile pcictrl512x_t *pci_ctrl; + volatile pciconf512x_t *pci_conf; + u16 reg16; + u32 reg32; + u32 dev; + struct pci_controller *hose; + + /* Set PCI divider for 33MHz */ + reg32 = immr->clk.scfr[0]; + reg32 &= ~(SCFR1_PCI_DIV_MASK); + reg32 |= SCFR1_PCI_DIV << SCFR1_PCI_DIV_SHIFT; + immr->clk.scfr[0] = reg32; + + pci_law = immr->sysconf.pcilaw; + pci_pot = immr->ios.pot; + pci_ctrl = &immr->pci_ctrl; + pci_conf = &immr->pci_conf; + + hose = &pci_hose; + + /* +* Release PCI RST Output signal +*/ + pci_ctrl->gcr = 0; + udelay(2000); + pci_ctrl->gcr = 1; + +
[U-Boot-Users] [PATCH] MPC5121e ADS PCI support
Adds PCI support for MPC5121 Tested with drivers/net/rtl8139.c This patch is identical to the previous except PCI support is now conditonal since pci on old silicon (most silicon currently in field) does not work. ads5121_PCI_config turns on PCI Signed-off-by: John Rigby <[EMAIL PROTECTED]> --- board/ads5121/Makefile|2 +- board/ads5121/ads5121.c |1 + board/ads5121/pci.c | 216 + cpu/mpc512x/speed.c | 21 +++- include/asm-ppc/global_data.h |1 + include/asm-ppc/immap_512x.h | 61 +++- include/configs/ads5121.h | 30 ++- include/mpc512x.h | 84 8 files changed, 403 insertions(+), 13 deletions(-) create mode 100644 board/ads5121/pci.c diff --git a/board/ads5121/Makefile b/board/ads5121/Makefile index cd8148c..f15a88b 100644 --- a/board/ads5121/Makefile +++ b/board/ads5121/Makefile @@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk LIB= $(obj)lib$(BOARD).a -COBJS := $(BOARD).o +COBJS := $(BOARD).o pci.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/board/ads5121/ads5121.c b/board/ads5121/ads5121.c index 462f41d..8629b03 100644 --- a/board/ads5121/ads5121.c +++ b/board/ads5121/ads5121.c @@ -34,6 +34,7 @@ CLOCK_SCCR1_PSCFIFO_EN | \ CLOCK_SCCR1_DDR_EN | \ CLOCK_SCCR1_FEC_EN | \ +CLOCK_SCCR1_PCI_EN | \ CLOCK_SCCR1_TPR_EN) #define SCCR2_CLOCKS_EN(CLOCK_SCCR2_MEM_EN | \ diff --git a/board/ads5121/pci.c b/board/ads5121/pci.c new file mode 100644 index 000..8868171 --- /dev/null +++ b/board/ads5121/pci.c @@ -0,0 +1,216 @@ +/* + * Copyright (C) Freescale Semiconductor, Inc. 2006, 2007. All rights reserved. + * + * 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 + +#ifdef CONFIG_PCI + +#include +#include +#include +#if defined(CONFIG_OF_LIBFDT) +#include +#include +#endif + +DECLARE_GLOBAL_DATA_PTR; + +/* System RAM mapped to PCI space */ +#define CONFIG_PCI_SYS_MEM_BUS CFG_SDRAM_BASE +#define CONFIG_PCI_SYS_MEM_PHYSCFG_SDRAM_BASE + +static struct pci_controller pci_hose; + + +/** + * pci_init_board() + * + */ +void +pci_init_board(void) +{ + volatile immap_t *immr = (immap_t *) CFG_IMMR; + volatile law512x_t *pci_law; + volatile pot512x_t *pci_pot; + volatile pcictrl512x_t *pci_ctrl; + volatile pciconf512x_t *pci_conf; + u16 reg16; + u32 reg32; + u32 dev; + struct pci_controller *hose; + + /* Set PCI divider for 33MHz */ + reg32 = immr->clk.scfr[0]; + reg32 &= ~(SCFR1_PCI_DIV_MASK); + reg32 |= SCFR1_PCI_DIV << SCFR1_PCI_DIV_SHIFT; + immr->clk.scfr[0] = reg32; + + pci_law = immr->sysconf.pcilaw; + pci_pot = immr->ios.pot; + pci_ctrl = &immr->pci_ctrl; + pci_conf = &immr->pci_conf; + + hose = &pci_hose; + + /* +* Release PCI RST Output signal +*/ + pci_ctrl->gcr = 0; + udelay(2000); + pci_ctrl->gcr = 1; + + /* We need to wait at least a 1sec based on PCI specs */ + { + int i; + + for (i = 0; i < 1000; i++) + udelay(1000); + } + + /* +* Configure PCI Local Access Windows +*/ + pci_law[0].bar = CFG_PCI_MEM_PHYS & LAWBAR_BAR; + pci_law[0].ar = LAWAR_EN | LAWAR_SIZE_512M; + + pci_law[1].bar = CFG_PCI_IO_PHYS & LAWBAR_BAR; + pci_law[1].ar = LAWAR_EN | LAWAR_SIZE_16M; + + /* +* Configure PCI Outbound Translation Windows +*/ + + /* PCI mem space - prefetch */ + pci_pot[0].potar = (CFG_PCI_MEM_BASE >> 12) & POTAR_TA_MASK; + pci_pot[0].pobar = (CFG_PCI_MEM_PHYS >> 12) & POBAR_BA_MASK; + pci_pot[0].pocmr = POCMR_EN | POCMR_PRE | POCMR_CM_256M; + + /* PCI IO space */ + pci_pot[1].potar = (CFG_PCI_IO_BASE >> 12) & POTAR_TA_
[U-Boot-Users] [PATCH] Fix warnings while compilation of post/drivers/memory.c
Fix warnings while compilation with new gcc in eldk-4.2 Signed-off-by: Anatolij Gustschin <[EMAIL PROTECTED]> --- post/drivers/memory.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/post/drivers/memory.c b/post/drivers/memory.c index fbc349a..fb96985 100644 --- a/post/drivers/memory.c +++ b/post/drivers/memory.c @@ -186,7 +186,7 @@ DECLARE_GLOBAL_DATA_PTR; * * For other processors, let the compiler generate the best code it can. */ -static void move64(unsigned long long *src, unsigned long long *dest) +static void move64(const unsigned long long *src, unsigned long long *dest) { #if defined(CONFIG_MPC8260) || defined(CONFIG_MPC824X) asm ("lfd 0, 0(3)\n\t" /* fpr0 = *scr */ @@ -233,12 +233,12 @@ static int memory_post_dataline(unsigned long long * pmem) int ret = 0; for ( i = 0; i < num_patterns; i++) { - move64((unsigned long long *)&(pattern[i]), pmem++); + move64(&(pattern[i]), pmem++); /* * Put a different pattern on the data lines: otherwise they * may float long enough to read back what we wrote. */ - move64((unsigned long long *)&otherpattern, pmem--); + move64(&otherpattern, pmem--); move64(pmem, &temp64); #ifdef INJECT_DATA_ERRORS -- 1.5.3.3 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH] MPC5121e ADS PCI support
Adds PCI support for MPC5121 to u-boot 1.3.2rc1 Tested with drivers/net/rtl8139.c It also works with linux kernel but not completely tested because pci interrupts on my board are not quite working. Signed-off-by: John Rigby <[EMAIL PROTECTED]> --- board/ads5121/Makefile|2 +- board/ads5121/ads5121.c |1 + board/ads5121/pci.c | 216 + cpu/mpc512x/speed.c | 21 +++- include/asm-ppc/global_data.h |1 + include/asm-ppc/immap_512x.h | 61 +++- include/configs/ads5121.h | 30 ++- include/mpc512x.h | 84 8 files changed, 403 insertions(+), 13 deletions(-) create mode 100644 board/ads5121/pci.c diff --git a/board/ads5121/Makefile b/board/ads5121/Makefile index cd8148c..f15a88b 100644 --- a/board/ads5121/Makefile +++ b/board/ads5121/Makefile @@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk LIB= $(obj)lib$(BOARD).a -COBJS := $(BOARD).o +COBJS := $(BOARD).o pci.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/board/ads5121/ads5121.c b/board/ads5121/ads5121.c index 462f41d..8629b03 100644 --- a/board/ads5121/ads5121.c +++ b/board/ads5121/ads5121.c @@ -34,6 +34,7 @@ CLOCK_SCCR1_PSCFIFO_EN | \ CLOCK_SCCR1_DDR_EN | \ CLOCK_SCCR1_FEC_EN | \ +CLOCK_SCCR1_PCI_EN | \ CLOCK_SCCR1_TPR_EN) #define SCCR2_CLOCKS_EN(CLOCK_SCCR2_MEM_EN | \ diff --git a/board/ads5121/pci.c b/board/ads5121/pci.c new file mode 100644 index 000..8868171 --- /dev/null +++ b/board/ads5121/pci.c @@ -0,0 +1,216 @@ +/* + * Copyright (C) Freescale Semiconductor, Inc. 2006, 2007. All rights reserved. + * + * 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 + +#ifdef CONFIG_PCI + +#include +#include +#include +#if defined(CONFIG_OF_LIBFDT) +#include +#include +#endif + +DECLARE_GLOBAL_DATA_PTR; + +/* System RAM mapped to PCI space */ +#define CONFIG_PCI_SYS_MEM_BUS CFG_SDRAM_BASE +#define CONFIG_PCI_SYS_MEM_PHYSCFG_SDRAM_BASE + +static struct pci_controller pci_hose; + + +/** + * pci_init_board() + * + */ +void +pci_init_board(void) +{ + volatile immap_t *immr = (immap_t *) CFG_IMMR; + volatile law512x_t *pci_law; + volatile pot512x_t *pci_pot; + volatile pcictrl512x_t *pci_ctrl; + volatile pciconf512x_t *pci_conf; + u16 reg16; + u32 reg32; + u32 dev; + struct pci_controller *hose; + + /* Set PCI divider for 33MHz */ + reg32 = immr->clk.scfr[0]; + reg32 &= ~(SCFR1_PCI_DIV_MASK); + reg32 |= SCFR1_PCI_DIV << SCFR1_PCI_DIV_SHIFT; + immr->clk.scfr[0] = reg32; + + pci_law = immr->sysconf.pcilaw; + pci_pot = immr->ios.pot; + pci_ctrl = &immr->pci_ctrl; + pci_conf = &immr->pci_conf; + + hose = &pci_hose; + + /* +* Release PCI RST Output signal +*/ + pci_ctrl->gcr = 0; + udelay(2000); + pci_ctrl->gcr = 1; + + /* We need to wait at least a 1sec based on PCI specs */ + { + int i; + + for (i = 0; i < 1000; i++) + udelay(1000); + } + + /* +* Configure PCI Local Access Windows +*/ + pci_law[0].bar = CFG_PCI_MEM_PHYS & LAWBAR_BAR; + pci_law[0].ar = LAWAR_EN | LAWAR_SIZE_512M; + + pci_law[1].bar = CFG_PCI_IO_PHYS & LAWBAR_BAR; + pci_law[1].ar = LAWAR_EN | LAWAR_SIZE_16M; + + /* +* Configure PCI Outbound Translation Windows +*/ + + /* PCI mem space - prefetch */ + pci_pot[0].potar = (CFG_PCI_MEM_BASE >> 12) & POTAR_TA_MASK; + pci_pot[0].pobar = (CFG_PCI_MEM_PHYS >> 12) & POBAR_BA_MASK; + pci_pot[0].pocmr = POCMR_EN | POCMR_PRE | POCMR_CM_256M; + + /* PCI IO space */ + pci_pot[1].potar = (CFG_PCI_IO_BASE >> 12) & POTAR_TA_MASK; + pci_pot[1].pobar = (CFG_PCI_IO_PHYS
Re: [U-Boot-Users] U-Boot v1.3.2-rc2 released
On Sun, 2008-02-24 at 09:24, Wolfgang Denk wrote: > MPC8610HPCD: > net.c: In function 'PingHandler': > net.c:770: warning: passing argument 1 of 'NetReadIP' discards > qualifiers from pointer target type > net.c: In function 'NetSetIP': > net.c:1694: warning: passing argument 1 of 'NetCopyIP' discards > qualifiers from pointer target type > net.c:1695: warning: passing argument 1 of 'NetCopyIP' discards > qualifiers from pointer target type > net.c: In function 'PingSend': > net.c:736: warning: passing argument 1 of 'NetCopyIP' discards > qualifiers from pointer target type > net.c:737: warning: passing argument 1 of 'NetCopyIP' discards > qualifiers from pointer target type Hi Wolfgang,, I've not been able to reproduce the above warnings using either a gcc 3.43 or a gcc 4.2.0 compiler. That is some very odd code, and I'm curious to know if it is only on the MPC8610HPCD board that you see this behavior, or is it also on some other board too? Can anyone else duplicate those warnings? > > sbc8641d: > sbc8641d.c: In function 'pci_init_board': > sbc8641d.c:233: error: 'MPC86xx_PORDEVSR_IO_SEL' undeclared (first use > in this function) > sbc8641d.c:233: error: (Each undeclared identifier is reported only once > sbc8641d.c:233: error: for each function it appears in.) > make[1]: *** [/work/wd/tmp-ppc/board/sbc8641d/sbc8641d.o] Error 1 > make: *** [/work/wd/tmp-ppc/board/sbc8641d/libsbc8641d.a] Error 2 I posted a patch to fix this brain-damage of mine. Left hand, meet right hand You know. Sorry. > Board maintainers - please test and post patches ASAP! A pull of u-boot-86xx will clean up the sbc8641d build. Thanks, jdl - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH] 86xx: Fix renamed GUR symbols in sbc8641d board.
Back in commit a551cee99ad1d1da20fd23ad265de47448852f56 (86xx: Fix GUR PCI config registers properly), we should have changed the MPC86xx_PORBMSR_HA and MPC86xx_PORDEVSR_IO_SEL symbols in the sbc8641d board as well. Fix this oversight. Signed-off-by: Jon Loeliger <[EMAIL PROTECTED]> --- Wolfgang, Argh. This fixes the sbc8641d build problem. I am dumb. Thanks, jdl board/sbc8641d/sbc8641d.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/board/sbc8641d/sbc8641d.c b/board/sbc8641d/sbc8641d.c index 78656e9..e7334ef 100644 --- a/board/sbc8641d/sbc8641d.c +++ b/board/sbc8641d/sbc8641d.c @@ -230,7 +230,8 @@ void pci_init_board(void) volatile immap_t *immap = (immap_t *) CFG_CCSRBAR; volatile ccsr_gur_t *gur = &immap->im_gur; uint devdisr = gur->devdisr; - uint io_sel = (gur->pordevsr & MPC86xx_PORDEVSR_IO_SEL) >> 16; + uint io_sel = (gur->pordevsr & MPC8641_PORDEVSR_IO_SEL) + >> MPC8641_PORDEVSR_IO_SEL_SHIFT; #ifdef CONFIG_PCI1 { @@ -238,7 +239,8 @@ void pci_init_board(void) extern void fsl_pci_init(struct pci_controller *hose); struct pci_controller *hose = &pci1_hose; #ifdef DEBUG - uint host1_agent = (gur->porbmsr & MPC86xx_PORBMSR_HA) >> 17; + uint host1_agent = (gur->porbmsr & MPC8641_PORBMSR_HA) + >> MPC8641_PORBMSR_HA_SHIFT; uint pex1_agent = (host1_agent == 0) || (host1_agent == 1); #endif if ((io_sel == 2 || io_sel == 3 || io_sel == 5 -- 1.5.4.rc5.19.g0509eb - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] Contribution: EHCI USB HC driver
All,Juniper Networks wrote a driver for the EHCI UCB HC and I'd like tocontribute that back if there's interest. Besides a new piece of code,this also changes some of the common USB code so that high-speeddevices and split-transactions are supported.At this time the EHCI driver is exclusive in that there's no supportfor having the companion controller active. I presume this is one ofthe major themes for adding EHCI support, so that's definitely open for discussion.Attached a patch with the common code changes as well as the EHCIdriver itself. The patch does not contain any changes to get it built(i.e. included in libusb, etc). A seasoned U-Boot developer shouldhave no problem playing with it, while the details are being workedout for getting this alongside a USB 1.1 HC driver.Comments and suggestions are welcome. Please let me know how best tomove forward with adding this to U-Boot, provided there's interest.FYI,-- Marcel Moolenaar[EMAIL PROTECTED] u-boot.diff Description: Binary data - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH] ppc4xx: Fix problem in 4xx_enet.c driver
U-Boot crashes in the net loop if CONFIG_4xx_DCACHE is enabled. To reproduce the problem ensure that 'ethrotate' environment variable isn't set to "no" and then run "tftp 20 not_existent_file". This patch tries to fix the issue. Signed-off-by: Anatolij Gustschin <[EMAIL PROTECTED]> --- cpu/ppc4xx/4xx_enet.c | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/cpu/ppc4xx/4xx_enet.c b/cpu/ppc4xx/4xx_enet.c index 44659ff..5ef1005 100644 --- a/cpu/ppc4xx/4xx_enet.c +++ b/cpu/ppc4xx/4xx_enet.c @@ -487,6 +487,9 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis) #endif u32 bd_cached; u32 bd_uncached = 0; +#ifdef CONFIG_4xx_DCACHE + static u32 last_used_ea = 0; +#endif EMAC_4XX_HW_PST hw_p = dev->priv; @@ -850,7 +853,12 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis) #ifdef CONFIG_4xx_DCACHE flush_dcache_range(bd_cached, bd_cached + MAL_ALLOC_SIZE); - bd_uncached = bis->bi_memsize; + if (!last_used_ea) + bd_uncached = bis->bi_memsize; + else + bd_uncached = last_used_ea + MAL_ALLOC_SIZE; + + last_used_ea = bd_uncached; program_tlb(bd_cached, bd_uncached, MAL_ALLOC_SIZE, TLB_WORD2_I_ENABLE); #else -- 1.5.3.3 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH] POST: Disable cache while SPR POST
Currently (since commit b2e2142c) u-boot crashes on sequoia board while SPR test if CONFIG_4xx_DCACHE is enabled. This patch disables the cache while SPR test. Signed-off-by: Anatolij Gustschin <[EMAIL PROTECTED]> --- post/cpu/ppc4xx/spr.c | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/post/cpu/ppc4xx/spr.c b/post/cpu/ppc4xx/spr.c index c12e378..37c9559 100644 --- a/post/cpu/ppc4xx/spr.c +++ b/post/cpu/ppc4xx/spr.c @@ -43,6 +43,12 @@ #include +#ifdef CONFIG_4xx_DCACHE +#include + +DECLARE_GLOBAL_DATA_PTR; +#endif + static struct { int number; char * name; @@ -164,6 +170,10 @@ int spr_post_test (int flags) }; unsigned long (*get_spr) (void) = (void *) code; +#ifdef CONFIG_4xx_DCACHE + /* disable cache */ + change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, TLB_WORD2_I_ENABLE); +#endif for (i = 0; i < spr_test_list_size; i++) { int num = spr_test_list[i].number; @@ -180,6 +190,10 @@ int spr_post_test (int flags) ret = -1; } } +#ifdef CONFIG_4xx_DCACHE + /* enable cache */ + change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, 0); +#endif return ret; } -- 1.5.3.3 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH 2/3 resubmit] ppc4xx: Add 405GPr based MCU25 board config file
Signed-off-by: Niklaus Giger <[EMAIL PROTECTED]> --- include/configs/mcu25.h | 362 +++ 1 files changed, 362 insertions(+), 0 deletions(-) create mode 100644 include/configs/mcu25.h diff --git a/include/configs/mcu25.h b/include/configs/mcu25.h new file mode 100644 index 000..26919d3 --- /dev/null +++ b/include/configs/mcu25.h @@ -0,0 +1,362 @@ +/* + *(C) Copyright 2005-2007 Netstal Maschinen AG + *Niklaus Giger ([EMAIL PROTECTED]) + * + * 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 + */ + +/ + * mcu25.h - configuration for MCU25 board (similar to hcu4.h) + ***/ + +#ifndef __CONFIG_H +#define __CONFIG_H + +/*--- + * High Level Configuration Options + *--*/ +#define CONFIG_MCU25 1 /* Board is MCU25 */ +#define CONFIG_4xx 1 /* ... PPC4xx family*/ +#define CONFIG_405GP 1 +#define CONFIG_4xx 1 + +#define CONFIG_SYS_CLK_FREQ/* external freq to pll */ + +#define CONFIG_BOARD_EARLY_INIT_F 1/* Call board_early_init_f */ +#define CONFIG_MISC_INIT_R 1 /* Call misc_init_r */ + +/*--- + * Base addresses -- Note these are effective addresses where the + * actual resources get mapped (not physical addresses) +*--*/ +#define CFG_MONITOR_LEN(320 * 1024) /* Reserve 320 kB for Monitor */ +#define CFG_MALLOC_LEN (256 * 1024) /* Reserve 256 kB for malloc() */ + + +#define CFG_SDRAM_BASE 0x /* _must_ be 0 */ +#define CFG_FLASH_BASE 0xfff8 /* start of FLASH */ +#define CFG_MONITOR_BASE TEXT_BASE + +/* ... with on-chip memory here (4KBytes) */ +#define CFG_OCM_DATA_ADDR 0xF400 +#define CFG_OCM_DATA_SIZE 0x1000 +/* Do not set up locked dcache as init ram. */ +#undef CFG_INIT_DCACHE_CS + +/* Use the On-Chip-Memory (OCM) as a temporary stack for the startup code. */ +#define CFG_TEMP_STACK_OCM 1 + +#define CFG_INIT_RAM_ADDR CFG_OCM_DATA_ADDR /* OCM */ +#define CFG_INIT_RAM_END CFG_OCM_DATA_SIZE +#define CFG_GBL_DATA_SIZE 256 /* num bytes initial data */ +#define CFG_GBL_DATA_OFFSET(CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE) +#define CFG_INIT_SP_OFFSET CFG_POST_WORD_ADDR + +/*--- + * Serial Port + *--*/ +/* + * If CFG_EXT_SERIAL_CLOCK, then the UART divisor is 1. + * If CFG_405_UART_ERRATA_59, then UART divisor is 31. + * Otherwise, UART divisor is determined by CPU Clock and CFG_BASE_BAUD value. + * The Linux BASE_BAUD define should match this configuration. + *baseBaud = cpuClock/(uartDivisor*16) + * If CFG_405_UART_ERRATA_59 and 200MHz CPU clock, + * set Linux BASE_BAUD to 403200. + */ +#undef CFG_EXT_SERIAL_CLOCK /* external serial clock */ +#define CONFIG_SERIAL_MULTI 1 +/* needed to be able to define CONFIG_SERIAL_SOFTWARE_FIFO */ +#undef CFG_405_UART_ERRATA_59 /* 405GP/CR Rev. D silicon */ +#define CFG_BASE_BAUD 691200 + +/* Size (bytes) of interrupt driven serial port buffer. + * Set to 0 to use polling instead of interrupts. + * Setting to 0 will also disable RTS/CTS handshaking. + */ +#undef CONFIG_SERIAL_SOFTWARE_FIFO + +/* Set console baudrate to 9600 */ +#define CONFIG_BAUDRATE9600 + + +#define CFG_BAUDRATE_TABLE \ + {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200} + +/*--- + * Flash + *--*/ + +/* Use common CFI driver */ +#define CFG_FLASH_CFI +#define CFG_FLASH_CFI_DRIVER +/* board provides its own
[U-Boot-Users] [PATCH 3/3 resubmit] ppc4xx: Add 405GPr based MCU25 board specific files
Signed-off-by: Niklaus Giger <[EMAIL PROTECTED]> --- board/netstal/mcu25/Makefile | 51 + board/netstal/mcu25/README.txt | 60 +++ board/netstal/mcu25/config.mk | 29 ++ board/netstal/mcu25/mcu25.c| 218 board/netstal/mcu25/u-boot.lds | 141 ++ 5 files changed, 499 insertions(+), 0 deletions(-) create mode 100644 board/netstal/mcu25/Makefile create mode 100644 board/netstal/mcu25/README.txt create mode 100644 board/netstal/mcu25/config.mk create mode 100644 board/netstal/mcu25/mcu25.c create mode 100644 board/netstal/mcu25/u-boot.lds diff --git a/board/netstal/mcu25/Makefile b/board/netstal/mcu25/Makefile new file mode 100644 index 000..53df61e --- /dev/null +++ b/board/netstal/mcu25/Makefile @@ -0,0 +1,51 @@ +# +# (C) Copyright 2007-2008 Netstal Maschinen AG +# Niklaus Giger ([EMAIL PROTECTED]) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).a + +# NOBJS : Netstal common objects +NOBJS = fixed_sdram.o nm_bsp.o +COBJS = $(BOARD).o +SOBJS = + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) $(addprefix ../common/,$(NOBJS:.o=.c)) +OBJS := $(addprefix $(obj),$(COBJS)) +NOBJS := $(addprefix $(obj)../common/,$(NOBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(OBJS) $(SOBJS) $(NOBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS) $(NOBJS) + +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/netstal/mcu25/README.txt b/board/netstal/mcu25/README.txt new file mode 100644 index 000..0b10342 --- /dev/null +++ b/board/netstal/mcu25/README.txt @@ -0,0 +1,60 @@ +MCU25 Configuration Details + +Memory Bank 0 -- Flash chip +--- + +0xfff0 - 0x + +The flash chip is really only 512Kbytes, but the high address bit of +the 1Meg region is ignored, so the flash is replicated through the +region. Thus, this is consistent with a flash base address 0xfff8. + +The placement at the end is to be consistent with reset behavior, +where the processor itself initially uses this bus to load the branch +vector and start running. + +On-Chip Memory +-- + +0xf400 - 0xf4000fff + +The 405GPr includes a 4K on-chip memory that can be placed however +software chooses. I choose to place the memory at this address, to +keep it out of the cachable areas. + + +Internal Peripherals + + +0xef600300 - 0xef6008ff + +These are scattered various peripherals internal to the PPC405GPr +chip. + +Chip-Select 2: Flash Memory +--- + +0x7000 + +Chip-Select 3: CAN Interface + +0x780 + + +Chip-Select 4: IMC-bus standard +--- + +Our IO-Bus (slow version) + + +Chip-Select 5: IMC-bus fast (inactive) +-- + +Our IO-Bus (fast, but not yet use) + + +Memory Bank 1 -- SDRAM +- + +0x - 0x2ff # Default 64 MB + diff --git a/board/netstal/mcu25/config.mk b/board/netstal/mcu25/config.mk new file mode 100644 index 000..12f61e7 --- /dev/null +++ b/board/netstal/mcu25/config.mk @@ -0,0 +1,29 @@ +# +# (C) Copyright 2005 Netstal Maschinen AG +# Niklaus Giger ([EMAIL PROTECTED]) +# 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 +
[U-Boot-Users] [PATCH 1/3 resubmit] ppc4xx: Add 405GPr based MCU25 board. Global files
Signed-off-by: Niklaus Giger <[EMAIL PROTECTED]> --- MAINTAINERS |1 + MAKEALL |1 + Makefile|4 3 files changed, 6 insertions(+), 0 deletions(-) mode change 100755 => 100644 MAKEALL diff --git a/MAINTAINERS b/MAINTAINERS index 273bfac..a666705 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -172,6 +172,7 @@ Matthias Fuchs <[EMAIL PROTECTED]> Niklaus Giger <[EMAIL PROTECTED]> HCU4PPC405GPr + MCU25 PPC405GPr HCU5PPC440EPx Frank Gottschling <[EMAIL PROTECTED]> diff --git a/MAKEALL b/MAKEALL old mode 100755 new mode 100644 index 0e1c0cb..a817f2f --- a/MAKEALL +++ b/MAKEALL @@ -198,6 +198,7 @@ LIST_4xx=" \ luan\ lwmon5 \ makalu \ + mcu25 \ METROBOX\ MIP405 \ MIP405T \ diff --git a/Makefile b/Makefile index a731ee8..d24726f 100644 --- a/Makefile +++ b/Makefile @@ -1280,6 +1280,10 @@ lwmon5_config: unconfig makalu_config: unconfig @$(MKCONFIG) $(@:_config=) ppc ppc4xx makalu amcc +mcu25_config: unconfig + @mkdir -p $(obj)board/netstal/common + @$(MKCONFIG) $(@:_config=) ppc ppc4xx mcu25 netstal + METROBOX_config: unconfig @$(MKCONFIG) $(@:_config=) ppc ppc4xx metrobox sandburst -- 1.5.2.5 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH 8/8] [new uImage] Correct raw FDT blob handlig when CONFIG_FIT is disabled
Dual format image code must properly handle all three FDT passing methods: - raw FDT blob passed - FDT blob embedded in the legacy uImage - FDT blob embedded in the new uImage This patch enables proper raw FDT handling when no FIT imaeg support is compiled in. This is a bit tricky as we must dected FIT format even when FIT uImage handling is not enabled as both FIT uImages and raw FDT blobs use tha same low level format (libfdt). Signed-off-by: Marian Balakowicz <[EMAIL PROTECTED]> --- common/image.c |8 ++-- include/image.h |5 +++-- lib_ppc/bootm.c | 18 -- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/common/image.c b/common/image.c index 5ca77b9..c689b0e 100644 --- a/common/image.c +++ b/common/image.c @@ -375,6 +375,10 @@ void image_print_contents (image_header_t *hdr) * gen_image_get_format() checks whether provided address points to a valid * legacy or FIT image. * + * New uImage format and FDT blob are based on a libfdt. FDT blob + * may be passed directly or embedded in a FIT image. In both situations + * gen_image_get_format() must be able to dectect libfdt header. + * * returns: * image format type or IMAGE_FORMAT_INVALID if no image is present */ @@ -382,14 +386,14 @@ int gen_image_get_format (void *img_addr) { ulong format = IMAGE_FORMAT_INVALID; image_header_t *hdr; -#if defined(CONFIG_FIT) +#if defined(CONFIG_FIT) || defined(CONFIG_OF_LIBFDT) char*fit_hdr; #endif hdr = (image_header_t *)img_addr; if (image_check_magic(hdr)) format = IMAGE_FORMAT_LEGACY; -#if defined(CONFIG_FIT) +#if defined(CONFIG_FIT) || defined(CONFIG_OF_LIBFDT) else { fit_hdr = (char *)img_addr; if (fdt_check_header (fit_hdr) == 0) diff --git a/include/image.h b/include/image.h index 1bc090a..08566ea 100644 --- a/include/image.h +++ b/include/image.h @@ -376,8 +376,9 @@ const char* image_get_comp_name (uint8_t comp); void image_print_contents (image_header_t *hdr); #define IMAGE_FORMAT_INVALID 0x00 -#define IMAGE_FORMAT_LEGACY0x01 -#define IMAGE_FORMAT_FIT 0x02 +#define IMAGE_FORMAT_LEGACY0x01/* legacy image_header based format */ +#define IMAGE_FORMAT_FIT 0x02/* new, libfdt based format */ + int gen_image_get_format (void *img_addr); ulong gen_get_image (ulong img_addr); diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index ad05bc5..d80d69a 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -357,11 +357,15 @@ static void get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], fdt_blob = (char *)image_get_load (fdt_hdr); break; -#if defined(CONFIG_FIT) case IMAGE_FORMAT_FIT: - - /* check FDT blob vs FIT hdr */ - if (fit_uname_config || fit_uname_fdt) { + /* +* This case will catch both: new uImage format +* (libfdt based) and raw FDT blob (also libfdt +* based). +*/ +#if defined(CONFIG_FIT) + /* check FDT blob vs FIT blob */ + if (0) { /* FIXME: call FIT format verification */ /* * FIT image */ @@ -369,15 +373,17 @@ static void get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], debug ("* fdt: FIT format image\n"); fit_unsupported_reset ("PPC fdt"); do_reset (cmdtp, flag, argc, argv); - } else { + } else +#endif + { /* * FDT blob */ + debug ("* fdt: raw FDT blob\n"); printf ("## Flattened Device Tree blob at %08lx\n", fdt_blob); fdt_blob = (char *)fdt_addr; } break; -#endif default: fdt_error ("Did not find a cmdline Flattened Device Tree"); do_reset (cmdtp, flag, argc, argv); - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH 7/8] [new uImage] POWERPC: Add image_get_fdt() routine
FDT blob may be passed either: (1) raw (2) or embedded in the legacy uImage (3) or embedded in the new uImage. For the (2) case embedding image must be verified before we get FDT from it. This patch factors out legacy image specific verification routine to the separate helper routine. Signed-off-by: Marian Balakowicz <[EMAIL PROTECTED]> --- lib_ppc/bootm.c | 76 --- 1 files changed, 44 insertions(+), 32 deletions(-) diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index 319d4ba..ad05bc5 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -237,6 +237,39 @@ static void fdt_error (const char *msg) puts (" - must RESET the board to recover.\n"); } +static image_header_t *image_get_fdt (ulong fdt_addr) +{ + image_header_t *fdt_hdr = (image_header_t *)fdt_addr; + + image_print_contents (fdt_hdr); + + puts (" Verifying Checksum ... "); + if (!image_check_hcrc (fdt_hdr)) { + fdt_error ("fdt header checksum invalid"); + return NULL; + } + + if (!image_check_dcrc (fdt_hdr)) { + fdt_error ("fdt checksum invalid"); + return NULL; + } + puts ("OK\n"); + + if (!image_check_type (fdt_hdr, IH_TYPE_FLATDT)) { + fdt_error ("uImage is not a fdt"); + return NULL; + } + if (image_get_comp (fdt_hdr) != IH_COMP_NONE) { + fdt_error ("uImage is compressed"); + return NULL; + } + if (fdt_check_header ((char *)image_get_data (fdt_hdr)) != 0) { + fdt_error ("uImage data is not a fdt"); + return NULL; + } + return fdt_hdr; +} + static void get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], bootm_headers_t *images, char **of_flat_tree, ulong *of_size) { @@ -297,12 +330,17 @@ static void get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], case IMAGE_FORMAT_LEGACY: debug ("* fdt: legacy format image\n"); - fdt_hdr = (image_header_t *)fdt_addr; + /* verify fdt_addr points to a valid image header */ printf ("## Flattened Device Tree Legacy Image at %08lx\n", - fdt_hdr); - - image_print_contents (fdt_hdr); + fdt_addr); + fdt_hdr = image_get_fdt (fdt_addr); + if (!fdt_hdr) + do_reset (cmdtp, flag, argc, argv); + /* +* move image data to the load address, +* make sure we don't overwrite initial image +*/ image_start = (ulong)fdt_hdr; image_end = image_get_image_end (fdt_hdr); @@ -313,35 +351,9 @@ static void get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], fdt_error ("fdt overwritten"); do_reset (cmdtp, flag, argc, argv); } - - puts (" Verifying Checksum ... "); - if (!image_check_hcrc (fdt_hdr)) { - fdt_error ("fdt header checksum invalid"); - do_reset (cmdtp, flag, argc, argv); - } - - if (!image_check_dcrc (fdt_hdr)) { - fdt_error ("fdt checksum invalid"); - do_reset (cmdtp, flag, argc, argv); - } - puts ("OK\n"); - - if (!image_check_type (fdt_hdr, IH_TYPE_FLATDT)) { - fdt_error ("uImage is not a fdt"); - do_reset (cmdtp, flag, argc, argv); - } - if (image_get_comp (fdt_hdr) != IH_COMP_NONE) { - fdt_error ("uImage is compressed"); - do_reset (cmdtp, flag, argc, argv); - } - if (fdt_check_header ((char *)image_get_data (fdt_hdr)) != 0) { - fdt_error ("uImage data is not a fdt"); - do_reset (cmdtp, flag, argc, argv); - } - memmove ((void *)image_get_load (fdt_hdr), - (void *)image_get_data (fdt_hdr), - image_get_data_size (fdt_hdr)); + (void *)image_get_data (fdt_hdr), + image_get_data_size (fdt_hdr)); fdt_blob = (char *)image_get_load (fdt_hdr); break; --
[U-Boot-Users] [PATCH 6/8] [new uImage] Add image_get_kernel() routine
Legacy image specific verification is factored out to a separate helper routine to keep get_kernel() generic and simple. Signed-off-by: Marian Balakowicz <[EMAIL PROTECTED]> --- common/cmd_bootm.c | 86 1 files changed, 53 insertions(+), 33 deletions(-) diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index ce2de2e..e5ed167 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -297,6 +297,57 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * pointer to image header if valid image was found, plus kernel start * address and length, otherwise NULL */ +static image_header_t *image_get_kernel (ulong img_addr, int verify) +{ + image_header_t *hdr = (image_header_t *)img_addr; + + if (!image_check_magic(hdr)) { + puts ("Bad Magic Number\n"); + show_boot_progress (-1); + return NULL; + } + show_boot_progress (2); + + if (!image_check_hcrc (hdr)) { + puts ("Bad Header Checksum\n"); + show_boot_progress (-2); + return NULL; + } + + show_boot_progress (3); + image_print_contents (hdr); + + if (verify) { + puts (" Verifying Checksum ... "); + if (!image_check_dcrc (hdr)) { + printf ("Bad Data CRC\n"); + show_boot_progress (-3); + return NULL; + } + puts ("OK\n"); + } + show_boot_progress (4); + + if (!image_check_target_arch (hdr)) { + printf ("Unsupported Architecture 0x%x\n", image_get_arch (hdr)); + show_boot_progress (-4); + return NULL; + } + return hdr; +} + +/** + * get_kernel - find kernel image + * @os_data: pointer to a ulong variable, will hold os data start address + * @os_len: pointer to a ulong variable, will hold os data length + * + * get_kernel() tries to find a kernel image, verifies its integrity + * and locates kernel data. + * + * returns: + * pointer to image header if valid image was found, plus kernel start + * address and length, otherwise NULL + */ static void *get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], bootm_headers_t *images, ulong *os_data, ulong *os_len) { @@ -339,40 +390,9 @@ static void *get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], case IMAGE_FORMAT_LEGACY: debug ("* kernel: legacy format image\n"); - hdr = (image_header_t *)img_addr; - - if (!image_check_magic(hdr)) { - puts ("Bad Magic Number\n"); - show_boot_progress (-1); + hdr = image_get_kernel (img_addr, images->verify); + if (!hdr) return NULL; - } - show_boot_progress (2); - - if (!image_check_hcrc (hdr)) { - puts ("Bad Header Checksum\n"); - show_boot_progress (-2); - return NULL; - } - - show_boot_progress (3); - image_print_contents (hdr); - - if (images->verify) { - puts (" Verifying Checksum ... "); - if (!image_check_dcrc (hdr)) { - printf ("Bad Data CRC\n"); - show_boot_progress (-3); - return NULL; - } - puts ("OK\n"); - } - show_boot_progress (4); - - if (!image_check_target_arch (hdr)) { - printf ("Unsupported Architecture 0x%x\n", image_get_arch (hdr)); - show_boot_progress (-4); - return NULL; - } show_boot_progress (5); switch (image_get_type (hdr)) { - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH 5/8] [new uImage] Move image verify flag to bootm_headers structure
Do not pass image verification flag directly to related routines. Simplify argument passing and move it to the bootm_header structure which contains curently processed image specific data and is already being passed on the argument list. Signed-off-by: Marian Balakowicz <[EMAIL PROTECTED]> --- common/cmd_bootm.c | 47 +-- common/image.c | 13 - include/image.h|7 ++- lib_arm/bootm.c|4 ++-- lib_avr32/bootm.c |4 ++-- lib_blackfin/bootm.c |2 +- lib_i386/bootm.c |4 ++-- lib_m68k/bootm.c |4 ++-- lib_microblaze/bootm.c |2 +- lib_mips/bootm.c |4 ++-- lib_nios/bootm.c |2 +- lib_nios2/bootm.c |2 +- lib_ppc/bootm.c|8 +++- lib_sh/bootm.c |2 +- 14 files changed, 49 insertions(+), 56 deletions(-) diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 3f09988..ce2de2e 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -65,10 +65,8 @@ static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); static void fixup_silent_linux (void); #endif -static void *get_kernel (cmd_tbl_t *cmdtp, int flag, - int argc, char *argv[], int verify, - bootm_headers_t *images, - ulong *os_data, ulong *os_len); +static void *get_kernel (cmd_tbl_t *cmdtp, int flag,int argc, char *argv[], + bootm_headers_t *images, ulong *os_data, ulong *os_len); extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); /* @@ -81,8 +79,7 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); */ typedef void boot_os_fn (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], - bootm_headers_t *images,/* pointers to os/initrd/fdt */ - int verify);/* getenv("verify")[0] != 'n' */ + bootm_headers_t *images); /* pointers to os/initrd/fdt */ extern boot_os_fn do_bootm_linux; static boot_os_fn do_bootm_netbsd; @@ -114,7 +111,6 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) ulong iflag; const char *type_name; uintunc_len = CFG_BOOTM_LEN; - int verify = getenv_verify(); uint8_t comp, type, os; void*os_hdr; @@ -123,9 +119,10 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) ulong load_start, load_end; memset ((void *)&images, 0, sizeof (images)); + images.verify = getenv_verify(); /* get kernel image header, start address and length */ - os_hdr = get_kernel (cmdtp, flag, argc, argv, verify, + os_hdr = get_kernel (cmdtp, flag, argc, argv, &images, &os_data, &os_len); if (os_len == 0) return 1; @@ -246,36 +243,36 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #ifdef CONFIG_SILENT_CONSOLE fixup_silent_linux(); #endif - do_bootm_linux (cmdtp, flag, argc, argv, &images, verify); + do_bootm_linux (cmdtp, flag, argc, argv, &images); break; case IH_OS_NETBSD: - do_bootm_netbsd (cmdtp, flag, argc, argv, &images, verify); + do_bootm_netbsd (cmdtp, flag, argc, argv, &images); break; #ifdef CONFIG_LYNXKDI case IH_OS_LYNXOS: - do_bootm_lynxkdi (cmdtp, flag, argc, argv, &images, verify); + do_bootm_lynxkdi (cmdtp, flag, argc, argv, &images); break; #endif case IH_OS_RTEMS: - do_bootm_rtems (cmdtp, flag, argc, argv, &images, verify); + do_bootm_rtems (cmdtp, flag, argc, argv, &images); break; #if defined(CONFIG_CMD_ELF) case IH_OS_VXWORKS: - do_bootm_vxworks (cmdtp, flag, argc, argv, &images, verify); + do_bootm_vxworks (cmdtp, flag, argc, argv, &images); break; case IH_OS_QNX: - do_bootm_qnxelf (cmdtp, flag, argc, argv, &images, verify); + do_bootm_qnxelf (cmdtp, flag, argc, argv, &images); break; #endif #ifdef CONFIG_ARTOS case IH_OS_ARTOS: - do_bootm_artos (cmdtp, flag, argc, argv, &images, verify); + do_bootm_artos (cmdtp, flag, argc, argv, &images); break; #endif } @@ -300,10 +297,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * pointer to image header if valid image was found, plus kernel start * address and length, otherwise NULL */ -static void *get_kernel (cmd_tbl_t *cmdtp, int flag, - int argc, char *argv[], int verify, - bootm_headers_t *images, - ulong *os_data, ulong *os_len) +static void *get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], + bootm_hea
[U-Boot-Users] [PATCH 4/8] [Makefile] Sort COBJS in lib_ Makefiles
Signed-off-by: Marian Balakowicz <[EMAIL PROTECTED]> --- lib_avr32/Makefile |2 +- lib_blackfin/Makefile |4 ++-- lib_i386/Makefile |4 ++-- lib_m68k/Makefile |2 +- lib_microblaze/Makefile |2 +- lib_mips/Makefile |2 +- lib_nios/Makefile |2 +- lib_nios2/Makefile |2 +- lib_ppc/Makefile|5 ++--- 9 files changed, 12 insertions(+), 13 deletions(-) diff --git a/lib_avr32/Makefile b/lib_avr32/Makefile index ebe237b..afbce45 100644 --- a/lib_avr32/Makefile +++ b/lib_avr32/Makefile @@ -29,7 +29,7 @@ LIB = $(obj)lib$(ARCH).a SOBJS = memset.o -COBJS = board.o interrupts.o bootm.o +COBJS = board.o bootm.o interrupts.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) diff --git a/lib_blackfin/Makefile b/lib_blackfin/Makefile index ac3fb28..4a262fc 100644 --- a/lib_blackfin/Makefile +++ b/lib_blackfin/Makefile @@ -29,9 +29,9 @@ include $(TOPDIR)/config.mk LIB= $(obj)lib$(ARCH).a -SOBJS = memcpy.o memcmp.o memset.o memmove.o +SOBJS = memcmp.o memcpy.o memmove.o memset.o -COBJS = post.o tests.o board.o bootm.o bf533_string.o cache.o muldi3.o +COBJS = bf533_string.o board.o bootm.o cache.o muldi3.o post.o tests.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) diff --git a/lib_i386/Makefile b/lib_i386/Makefile index ef0ba54..004278f 100644 --- a/lib_i386/Makefile +++ b/lib_i386/Makefile @@ -27,8 +27,8 @@ LIB = $(obj)lib$(ARCH).a SOBJS = bios.o bios_pci.o realmode_switch.o -COBJS = board.o bios_setup.o bootm.o zimage.o realmode.o \ - pci_type1.o pci.o video_bios.o video.o +COBJS = bios_setup.o board.o bootm.o pci.o pci_type1.o \ + realmode.o video_bios.o video.o zimage.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) diff --git a/lib_m68k/Makefile b/lib_m68k/Makefile index d515223..efde75d 100644 --- a/lib_m68k/Makefile +++ b/lib_m68k/Makefile @@ -27,7 +27,7 @@ LIB = $(obj)lib$(ARCH).a SOBJS = -COBJS = cache.o traps.o time.o interrupts.o board.o bootm.o +COBJS = board.o bootm.o cache.o interrupts.o time.o traps.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) diff --git a/lib_microblaze/Makefile b/lib_microblaze/Makefile index 9b317a2..9c3b519 100644 --- a/lib_microblaze/Makefile +++ b/lib_microblaze/Makefile @@ -27,7 +27,7 @@ LIB = $(obj)lib$(ARCH).a SOBJS = -COBJS = board.o bootm.o time.o cache.o +COBJS = board.o bootm.o cache.o time.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) diff --git a/lib_mips/Makefile b/lib_mips/Makefile index 93cca7a..bfcf463 100644 --- a/lib_mips/Makefile +++ b/lib_mips/Makefile @@ -27,7 +27,7 @@ LIB = $(obj)lib$(ARCH).a SOBJS = -COBJS = board.o time.o bootm.o +COBJS = board.o bootm.o time.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) diff --git a/lib_nios/Makefile b/lib_nios/Makefile index d8ae7bd..b81a3d4 100644 --- a/lib_nios/Makefile +++ b/lib_nios/Makefile @@ -27,7 +27,7 @@ LIB = $(obj)lib$(ARCH).a SOBJS = -COBJS = board.o cache.o divmod.o bootm.o mult.o time.o +COBJS = board.o bootm.o cache.o divmod.o mult.o time.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) diff --git a/lib_nios2/Makefile b/lib_nios2/Makefile index 5f996d3..c69cdd7 100644 --- a/lib_nios2/Makefile +++ b/lib_nios2/Makefile @@ -27,7 +27,7 @@ LIB = $(obj)lib$(ARCH).a SOBJS = cache.o -COBJS = board.o divmod.o bootm.o mult.o time.o +COBJS = board.o bootm.o divmod.o mult.o time.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) diff --git a/lib_ppc/Makefile b/lib_ppc/Makefile index 61507b0..21f644e 100644 --- a/lib_ppc/Makefile +++ b/lib_ppc/Makefile @@ -27,9 +27,8 @@ LIB = $(obj)lib$(ARCH).a SOBJS = ppccache.o ppcstring.o ticks.o -COBJS = board.o \ - bat_rw.o cache.o extable.o kgdb.o time.o interrupts.o \ - bootm.o +COBJS = bat_rw.o board.o bootm.o cache.o extable.o \ + interrupts.o kgdb.o time.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH 3/8] [new uImage] Optimize gen_get_image() flow control
When CONFIG_HAS_DATAFLASH is not defined gen_get_image() routine has nothing to do, update its control flow to better reflect that simple case. Signed-off-by: Marian Balakowicz <[EMAIL PROTECTED]> --- common/image.c | 64 +--- 1 files changed, 33 insertions(+), 31 deletions(-) diff --git a/common/image.c b/common/image.c index ea27b0b..dd55264 100644 --- a/common/image.c +++ b/common/image.c @@ -408,55 +408,57 @@ int gen_image_get_format (void *img_addr) */ ulong gen_get_image (ulong img_addr) { - ulong ram_addr, h_size, d_size; - - h_size = image_get_header_size (); -#if defined(CONFIG_FIT) - if (sizeof(struct fdt_header) > h_size) - h_size = sizeof(struct fdt_header); -#endif + ulong ram_addr = img_addr; #ifdef CONFIG_HAS_DATAFLASH + ulong h_size, d_size; + if (addr_dataflash (img_addr)){ + /* ger RAM address */ ram_addr = CFG_LOAD_ADDR; + + /* get header size */ + h_size = image_get_header_size (); +#if defined(CONFIG_FIT) + if (sizeof(struct fdt_header) > h_size) + h_size = sizeof(struct fdt_header); +#endif + + /* read in header */ debug (" Reading image header from dataflash address " "%08lx to RAM address %08lx\n", img_addr, ram_addr); - read_dataflash (img_addr, h_size, (char *)ram_addr); - } else -#endif - return img_addr; - ram_addr = img_addr; + read_dataflash (img_addr, h_size, (char *)ram_addr); - switch (gen_image_get_format ((void *)ram_addr)) { - case IMAGE_FORMAT_LEGACY: - d_size = image_get_data_size ((image_header_t *)ram_addr); - debug (" Legacy format image found at 0x%08lx, size 0x%08lx\n", - ram_addr, d_size); - break; + /* get data size */ + switch (gen_image_get_format ((void *)ram_addr)) { + case IMAGE_FORMAT_LEGACY: + d_size = image_get_data_size ((image_header_t *)ram_addr); + debug (" Legacy format image found at 0x%08lx, size 0x%08lx\n", + ram_addr, d_size); + break; #if defined(CONFIG_FIT) - case IMAGE_FORMAT_FIT: - d_size = fdt_totalsize((void *)ram_addr) - h_size; - debug (" FIT/FDT format image found at 0x%08lx, size 0x%08lx\n", - ram_addr, d_size); - - break; + case IMAGE_FORMAT_FIT: + d_size = fdt_totalsize((void *)ram_addr) - h_size; + debug (" FIT/FDT format image found at 0x%08lx, size 0x%08lx\n", + ram_addr, d_size); + break; #endif - default: - printf (" No valid image found at 0x%08lx\n", img_addr); - return ram_addr; - } + default: + printf (" No valid image found at 0x%08lx\n", img_addr); + return ram_addr; + } -#ifdef CONFIG_HAS_DATAFLASH - if (addr_dataflash (img_addr)) { + /* read in image data */ debug (" Reading image remaining data from dataflash address " "%08lx to RAM address %08lx\n", img_addr + h_size, ram_addr + h_size); read_dataflash (img_addr + h_size, d_size, (char *)(ram_addr + h_size)); + } -#endif +#endif /* CONFIG_HAS_DATAFLASH */ return ram_addr; } - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH 2/8] [new uImage] POWERPC: Split get_fdt() into get and relocate routines
PPC specific FDT blob handling code is divided into two separate routines: get_fdt() - find and verify a FDT blob (either raw or image embedded) fdt_relocate() - move FDT blob to within BOOTMAP if needed Signed-off-by: Marian Balakowicz <[EMAIL PROTECTED]> --- lib_ppc/bootm.c | 61 +++ 1 files changed, 43 insertions(+), 18 deletions(-) diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index a1bbfc6..d5e019e 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -41,9 +41,11 @@ #include static void fdt_error (const char *msg); -static ulong get_fdt (ulong alloc_current, cmd_tbl_t *cmdtp, int flag, - int argc, char *argv[], - bootm_headers_t *images, char **of_flat_tree); +static void get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], + bootm_headers_t *images, char **of_flat_tree, ulong *of_size); +static ulong fdt_relocate (ulong alloc_current, + cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], + char **of_flat_tree, ulong *of_size); #endif #ifdef CFG_INIT_RAM_LOCK @@ -73,7 +75,8 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, void(*kernel)(bd_t *, ulong, ulong, ulong, ulong); #if defined(CONFIG_OF_LIBFDT) - char*of_flat_tree; + char*of_flat_tree = NULL; + ulong of_size = 0; #endif /* @@ -124,14 +127,16 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, #if defined(CONFIG_OF_LIBFDT) /* find flattened device tree */ - alloc_current = get_fdt (alloc_current, - cmdtp, flag, argc, argv, images, &of_flat_tree); + get_fdt (cmdtp, flag, argc, argv, images, &of_flat_tree, &of_size); + + alloc_current = fdt_relocate (alloc_current, + cmdtp, flag, argc, argv, &of_flat_tree, &of_size); /* * Add the chosen node if it doesn't exist, add the env and bd_t * if the user wants it (the logic is in the subroutines). */ - if (of_flat_tree) { + if (of_size) { if (fdt_chosen(of_flat_tree, initrd_start, initrd_end, 0) < 0) { fdt_error ("/chosen node create failed"); do_reset (cmdtp, flag, argc, argv); @@ -234,16 +239,12 @@ static void fdt_error (const char *msg) puts (" - must RESET the board to recover.\n"); } -static ulong get_fdt (ulong alloc_current, - cmd_tbl_t *cmdtp, int flag, - int argc, char *argv[], - bootm_headers_t *images, char **of_flat_tree) +static void get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], + bootm_headers_t *images, char **of_flat_tree, ulong *of_size) { ulong fdt_addr; image_header_t *fdt_hdr; char*fdt_blob = NULL; - ulong fdt_relocate = 0; - ulong new_alloc_current; ulong image_start, image_end; ulong load_start, load_end; #if defined(CONFIG_FIT) @@ -410,13 +411,37 @@ static ulong get_fdt (ulong alloc_current, } else { debug ("## No Flattened Device Tree\n"); *of_flat_tree = NULL; + *of_size = 0; + return; + } + + *of_flat_tree = fdt_blob; + *of_size = be32_to_cpu (fdt_totalsize (fdt_blob)); + debug (" of_flat_tree at 0x%08lx size 0x%08lx\n", + *of_flat_tree, *of_size); +} + +static ulong fdt_relocate (ulong alloc_current, + cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], + char **of_flat_tree, ulong *of_size) +{ + char*fdt_blob = *of_flat_tree; + ulong relocate = 0; + ulong new_alloc_current; + + /* nothing to do */ + if (*of_size == 0) return alloc_current; + + if (fdt_check_header (fdt_blob) != 0) { + fdt_error ("image is not a fdt"); + do_reset (cmdtp, flag, argc, argv); } #ifndef CFG_NO_FLASH - /* move the blob if it is in flash (set fdt_relocate) */ + /* move the blob if it is in flash (set relocate) */ if (addr2info ((ulong)fdt_blob) != NULL) - fdt_relocate = 1; + relocate = 1; #endif #ifdef CFG_BOOTMAPSZ @@ -425,15 +450,15 @@ static ulong get_fdt (ulong alloc_current, * so we flag it to be copied if it is not. */ if (fdt_blob >= (char *)CFG_BOOTMAPSZ) - fdt_relocate = 1; + relocate = 1; #endif /* move flattend device tree if needed */ - if (fdt_relocate) { + if (relocate) { int err; ulong of_start, of_len; - of_len = be32_to_cpu (fdt_totalsize (fdt_blob)); + of_len = *of_size; /* position on a 4K boundary before the alloc_current */ of_start = alloc_curre
[U-Boot-Users] [PATCH 0/8] [new uImage] patchset5: Dual format uImage handling framework
This patch series adds initial framework for dual format uImage support to U-boot. Booting control flow is reworked and is now able to recognize both formats: legacy format based on a binary image_header stucture and new FIT uImage format based on a libfdt. Legacy specific code is adapted a bit and enterd only for legacy format images. Proper new uImage format handling is not implement in this patch series, appropriate cases are stubed and will be updated with the new uImage format low level code in the comming patchsets. To sum up: Legacy format image handling shall continue to work, FIT format image handling will produce debug messages and return with error. Three other patches refactor legacy format specific code to a helper routines image_get_kernel(), image_get_fdt() and move PPC FDT blob relocattion code to a dedicated routine fdt_relocate(). Included are also fixes: reworked gen_get_image() and correced raw FDT blob handling when CONFIG_FIT is disabled. Please review and comment. Marian Balakowicz (8): [new uImage] Correct raw FDT blob handlig when CONFIG_FIT is disabled [new uImage] POWERPC: Add image_get_fdt() routine [new uImage] Add image_get_kernel() routine [new uImage] Move image verify flag to bootm_headers structure [Makefile] Sort COBJS in lib_ Makefiles [new uImage] Optimize gen_get_image() flow control [new uImage] POWERPC: Split get_fdt() into get and relocate routines [new uImage] Add dual format uImage support framework Cheers, m. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Re: [U-Boot-Users] Problem with PXA PCMCIA & (IDE) CF
Hi, Rodolfo Giometti wrote: > ide_outb (dev= 2, port= 0x1f3, val= 0x00) : @ 0x21f3 > ide_outb (dev= 2, port= 0x1f4, val= 0x00) : @ 0x21f4 > ide_outb (dev= 2, port= 0x1f5, val= 0x00) : @ 0x21f5 > ide_outb (dev= 2, port= 0x1f6, val= 0xe0) : @ 0x21f6 > ide_outb (dev= 2, port= 0x1f7, val= 0x20) : @ 0x21f7 > ide_inb (dev= 2, port= 0x1f7) : @ 0x21f7 -> 0xd1 > ide_inb (dev= 2, port= 0x1f7) : @ 0x21f7 -> 0x51 > Error (no IRQ) dev 2 blk 0: status 0x51 > > So, the CF is recognized but when the system tries to read first > sectors something goes wrong! > > Any suggestions? > > Rodolfo > > This happen in the true ide mode when the timings are wrong so maybe you have the same problem in pcmcia mode. Michael - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] Problem with PXA PCMCIA & (IDE) CF
Hello, on my custom board I have 2 PCMCIA slots. After pcmcia init I get: equantum> pinit on Fixed Disk Card IDE interface [silicon] [single] [sleep] [standby] [idle] [low power] but when I do "ide reset" I get: Device 2: ide_outb (dev= 2, port= 0x1f6, val= 0xe0) : @ 0x21f6 ide_inb (dev= 2, port= 0x1f2) : @ 0x21f2 -> 0xd1 ide_outb (dev= 2, port= 0x1f7, val= 0xec) : @ 0x21f7 ide_inb (dev= 2, port= 0x1f7) : @ 0x21f7 -> 0xd1 ide_inb (dev= 2, port= 0x1f7) : @ 0x21f7 -> 0x58 in input data base for read is 21f0 Model: Industrial CF Card Firm: ra03.00f Ser#: CIAF0145 1 Type: Removable Hard Disk Capacity: 125.0 MB = 0.1 GB (256000 x 512) ide_read dev 2 start 0, blocks 1 buffer at A2EFF918 ide_outb (dev= 2, port= 0x1f6, val= 0xe0) : @ 0x21f6 ide_inb (dev= 2, port= 0x1f7) : @ 0x21f7 -> 0xd0 ide_inb (dev= 2, port= 0x1f7) : @ 0x21f7 -> 0x51 ide_outb (dev= 2, port= 0x1f7, val= 0xe5) : @ 0x21f7 ide_inb (dev= 2, port= 0x1f7) : @ 0x21f7 -> 0xd1 ide_inb (dev= 2, port= 0x1f7) : @ 0x21f7 -> 0x50 ide_inb (dev= 2, port= 0x1f2) : @ 0x21f2 -> 0x00 Powersaving 00 ide_inb (dev= 2, port= 0x1f7) : @ 0x21f7 -> 0x50 ide_outb (dev= 2, port= 0x1f2, val= 0x01) : @ 0x21f2 ide_outb (dev= 2, port= 0x1f3, val= 0x00) : @ 0x21f3 ide_outb (dev= 2, port= 0x1f4, val= 0x00) : @ 0x21f4 ide_outb (dev= 2, port= 0x1f5, val= 0x00) : @ 0x21f5 ide_outb (dev= 2, port= 0x1f6, val= 0xe0) : @ 0x21f6 ide_outb (dev= 2, port= 0x1f7, val= 0x20) : @ 0x21f7 ide_inb (dev= 2, port= 0x1f7) : @ 0x21f7 -> 0xd1 ide_inb (dev= 2, port= 0x1f7) : @ 0x21f7 -> 0x51 Error (no IRQ) dev 2 blk 0: status 0x51 So, the CF is recognized but when the system tries to read first sectors something goes wrong! Any suggestions? Rodolfo -- GNU/Linux Solutions e-mail:[EMAIL PROTECTED] Linux Device Driver [EMAIL PROTECTED] Embedded Systems[EMAIL PROTECTED] UNIX programming phone: +39 349 2432127 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH] TQM5200: use automatic fdt memory fixup
Call fdt_fixup_memory() on the boards TQM5200, TQM5200_B, TQM5200S, TB5200 and TB5200_B to fixup the /memory node with the memory values detected by U-Boot. Signed-off-by: Martin Krause <[EMAIL PROTECTED]> --- I forgot to include the header file. Please ignore the first version of the patch. Not my day ... --- board/tqm5200/tqm5200.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/board/tqm5200/tqm5200.c b/board/tqm5200/tqm5200.c index 8c3f701..33ad2a3 100644 --- a/board/tqm5200/tqm5200.c +++ b/board/tqm5200/tqm5200.c @@ -43,6 +43,10 @@ #include "mt48lc16m16a2-75.h" #endif +#ifdef CONFIG_OF_LIBFDT +#include +#endif /* CONFIG_OF_LIBFDT */ + DECLARE_GLOBAL_DATA_PTR; #ifdef CONFIG_PS2MULT @@ -795,5 +799,6 @@ int board_get_height (void) void ft_board_setup(void *blob, bd_t *bd) { ft_cpu_setup(blob, bd); + fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); } #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] mpc83xx and multiple flash banks.
Hi All, I am really almost at the end of my tether regarding a mpc8323 PPC chip and chip selects. I have 4 flash banks on the board (all identical strataflash on CS0->CS3) on boot the registers are configured. If I set flash banks to 4 (include/configs/MPC8323XEMDS.H if I remember) uboot then identifies the first bank as 16MB.. but fails the next 3 banks. After some digging the README states that C000(?) and some other addresses are set up as PRELIM chip selects and the PPC local bus memory locations and windows are set AFTER the flash chip is detected. Unless I got it all wrong, this does not happen. Neither does it remap the Memory window after flash has been detected. After setting the CFG_FLASH_BANKS_LIST { } and setting BR0/1, OR0/1 , BAR0/1 and AR0/1 registers it gets the QRY for the Strataflash, but then uboot catches a PPC trap and resets. After some mangling (setting Flash bank count to 1) and booting U-boot without an error... Bank0 responds as expected using the MD command (memory locations 0xfe00 -> 0xfeff are all readable) But the same commands on Flash bank 1 after the 2Megabyte barrier cause the PPC to trap. 0xf000 -> 0xf01f are all readable... but 1 byte over that and it PPC traps. I have read and re-read the spec... but something is biting me. Can anyone throw me a bone to chase :P I am at a loss why the memory window is only getting to 2MB although I have set to beyond 16MB (LBLAWAR 0x8018) I have disables all other chip select code segments in the config file and only BR0/1 AR0/1 are being set. (all others are zero) Anyone help me out? Best Regards, Richard -- Cambridge Broadband Networks Limited Registered in England and Wales under company number: 03879840 Registered office: Selwyn House, Cambridge Business Park, Cowley Road, Cambridge CB4 0WZ, UK. VAT number: GB 741 0186 64 This email and any attachments are private and confidential. If you believe you have received this email in error please inform the sender and delete it from your mailbox or any other storage mechanism. Cambridge Broadband Networks Limited cannot accept liability for any statements made which are clearly the individual sender's own and not expressly made on behalf of Cambridge Broadband Networks Limited. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Re: [U-Boot-Users] [PATCH] cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/
On Mon, Feb 25, 2008 at 10:03:38AM -0600, Scott Wood wrote: > On Mon, Feb 25, 2008 at 02:40:56PM +0300, Nikita V. Youshchenko wrote: > > commit 0e6e4bbe5be1ef7f601abe7eddbe44b56fd5e43a > > Author: Nikita Youshchenko <[EMAIL PROTECTED]> > > Date: Mon Feb 25 11:27:06 2008 + > > > > cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/ > > > > This patch splits mpc8260 fdt fixup code into individual file, fdt.c, > > and updates it up to what is in cpu/mpc83xx/fdt.c. > > > > Also, it adds setting current-speed property for SMC uart, and > > setting value of 'brg-frequency' property on SOC node, if that property > > exists. The later is needed to support booting of vendor kernels based > > on > > 2.6.18 or near that. > > brg-frequency is deprecated. You should set the clock-frequency property > in the brg node instead. Never mind, I should have read the patch itself more closely. The commit message should be updated, though. -Scott - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Re: [U-Boot-Users] [PATCH] cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/
On Mon, Feb 25, 2008 at 02:40:56PM +0300, Nikita V. Youshchenko wrote: > commit 0e6e4bbe5be1ef7f601abe7eddbe44b56fd5e43a > Author: Nikita Youshchenko <[EMAIL PROTECTED]> > Date: Mon Feb 25 11:27:06 2008 + > > cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/ > > This patch splits mpc8260 fdt fixup code into individual file, fdt.c, > and updates it up to what is in cpu/mpc83xx/fdt.c. > > Also, it adds setting current-speed property for SMC uart, and > setting value of 'brg-frequency' property on SOC node, if that property > exists. The later is needed to support booting of vendor kernels based on > 2.6.18 or near that. brg-frequency is deprecated. You should set the clock-frequency property in the brg node instead. -Scott - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [ppc4xx] Please pull git://www.denx.de/git/u-boot-ppc4xx.git
The following changes since commit b29661fc115106454288051bc9a488351ce8: Wolfgang Denk (1): Coding style cleanup. Prepare v1.3.2-rc2 release candidate are available in the git repository at: git://www.denx.de/git/u-boot-ppc4xx.git master Stefan Roese (1): ppc4xx: Fix acadia_nand build problem board/amcc/acadia/memory.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Re: [U-Boot-Users] [PATCH] cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/
This is an updated version, that actually works. commit 817027b43687a34d0c8e9880fcdea40a424ceb8d Author: Nikita Youshchenko <[EMAIL PROTECTED]> Date: Mon Feb 25 11:27:06 2008 + cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/ This patch: - splits mpc8260 fdt fixup code into individual file, fdt.c, - adds some fixups from cpu/mpc83xx/fdt.c, - adds additional fixups, under #ifdef CONFIG_OF_COMPAT, that assist booting older (e.g. 2.6.18-based) vendor kernels. Since cpu/mpc8260/config.mk unconditionally defines CONFIG_CPM2, checks for that macro are ommitted in cpu/mpc8260/fdt.c Signed-off-by: Nikita Youshchenko <[EMAIL PROTECTED]> diff --git a/cpu/mpc8260/Makefile b/cpu/mpc8260/Makefile index 80d7852..d2a9f79 100644 --- a/cpu/mpc8260/Makefile +++ b/cpu/mpc8260/Makefile @@ -28,7 +28,7 @@ LIB = $(obj)lib$(CPU).a START = start.o kgdb.o COBJS = traps.o serial_smc.o serial_scc.o cpu.o cpu_init.o speed.o \ interrupts.o ether_scc.o ether_fcc.o i2c.o commproc.o \ - bedbug_603e.o pci.o spi.o + bedbug_603e.o pci.o spi.o fdt.o SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) diff --git a/cpu/mpc8260/cpu.c b/cpu/mpc8260/cpu.c index 55e61a1..f6383c3 100644 --- a/cpu/mpc8260/cpu.c +++ b/cpu/mpc8260/cpu.c @@ -47,12 +47,6 @@ #include #include -#if defined(CONFIG_OF_LIBFDT) -#include -#include -#include -#endif - DECLARE_GLOBAL_DATA_PTR; #if defined(CONFIG_GET_CPU_STR_F) @@ -298,15 +292,3 @@ void watchdog_reset (void) enable_interrupts (); } #endif /* CONFIG_WATCHDOG */ - -/* - */ -#if defined(CONFIG_OF_LIBFDT) -void ft_cpu_setup (void *blob, bd_t *bd) -{ - char * cpu_path = "/cpus/" OF_CPU; - - do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1); - do_fixup_by_path_u32(blob, cpu_path, "timebase-frequency", OF_TBCLK, 1); - do_fixup_by_path_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1); -} -#endif /* CONFIG_OF_LIBFDT */ diff --git a/cpu/mpc8260/fdt.c b/cpu/mpc8260/fdt.c new file mode 100644 index 000..a077b06 --- /dev/null +++ b/cpu/mpc8260/fdt.c @@ -0,0 +1,67 @@ +/* + * Copyright 2007 Freescale Semiconductor, Inc. + * + * (C) Copyright 2000 + * Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED] + * + * 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 + +#if defined(CONFIG_OF_LIBFDT) + +#include +#include + +void ft_cpu_setup (void *blob, bd_t *bd) +{ + +#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\ +defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3) + fdt_fixup_ethernet(blob, bd); +#endif + + do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, + "timebase-frequency", (bd->bi_busfreq / 4), 1); + do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, + "bus-frequency", bd->bi_busfreq, 1); + do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, + "clock-frequency", bd->bi_intfreq, 1); + do_fixup_by_prop_u32(blob, "device_type", "soc", 4, + "bus-frequency", bd->bi_busfreq, 1); + +#ifdef CONFIG_OF_COMPAT + do_fixup_by_prop_u32(blob, "device_type", "cpm", 4, + "brg-frequency", bd->bi_brgfreq, 0); + do_fixup_by_compat_u32(blob, "cpm_uart", + "current-speed", bd->bi_baudrate, 1); +#endif + + do_fixup_by_compat_u32(blob, "fsl,cpm2-brg", + "clock-frequency", bd->bi_brgfreq, 1); + do_fixup_by_compat_u32(blob, "fsl,cpm2-smc-uart", + "current-speed", bd->bi_baudrate, 1); + do_fixup_by_compat_u32(blob, "fsl,cpm2-scc-uart", + "current-speed", bd->bi_baudrate, 1); + + fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); +} + +#endif /* CONFIG_OF_LIBFDT */ - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-User
[U-Boot-Users] Pull request:[ARM]
Wolfgang Please pull from the merge branch at git://denx.de/git/u-boot-arm.git master --- The following changes since commit b29661fc115106454288051bc9a488351ce8: Wolfgang Denk (1): Coding style cleanup. Prepare v1.3.2-rc2 release candidate are available in the git repository at: git://www.denx.de/git/u-boot-arm.git master Jean-Christophe PLAGNIOL-VILLARD (3): actua1/actua2/actua3: Fix multipleunused variable arm-imx: Fix registers definition mx1fs2/flash: Fix multiple pointertargets in assignment differ in signedness board/actux1/actux1.c |1 - board/actux2/actux2.c |8 +- board/actux3/actux3.c |1 - board/mx1fs2/flash.c|2 +- board/mx1fs2/mx1fs2.c |2 +- include/asm-arm/arch-imx/imx-regs.h | 175 +++ 6 files changed, 123 insertions(+), 66 deletions(-) --- Regards Peter - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH] TQM5200: use automatic fdt memory fixup
Call fdt_fixup_memory() on the boards TQM5200, TQM5200_B, TQM5200S, TB5200 and TB5200_B to fixup the /memory node with the memory values detected by U-Boot. Signed-off-by: Martin Krause <[EMAIL PROTECTED]> -- I consider this patch as bugfix, since linux 2.6 will not boot on boards with less SDRAM than the fixed value in the TQM5200 fdt (64 MiB AFAIK) --- board/tqm5200/tqm5200.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/board/tqm5200/tqm5200.c b/board/tqm5200/tqm5200.c index 8c3f701..97e3099 100644 --- a/board/tqm5200/tqm5200.c +++ b/board/tqm5200/tqm5200.c @@ -795,5 +795,6 @@ int board_get_height (void) void ft_board_setup(void *blob, bd_t *bd) { ft_cpu_setup(blob, bd); + fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); } #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Re: [U-Boot-Users] [PATCH v2] PPC440EPx: Reconfigure PLL for 667MHz processor
Mike, On Wednesday 20 February 2008, Mike Nuss wrote: > > don't you think this is a little bit to shortsighted? > > There are many other parameters beyond the CPU clock that could be > > modified in such a way. We have some code in the PMC440 board > > code that sets up the PCI sync clock dynamically dependant on > > a GPIO (M66EN pci pin). So I would vote for a more generic > > configuration than > > by a CPU frequency parameter. Just think about this: should > > 667 MHz on an EPx > > always mean 166 MHz PLB clock? 667MHZ with 133MHz PLB might also be > > a typical configuration (e.g. when you need 66MHz EBC clock ). > > > > So what about a function that takes the complete strapping values > > as parameters (I think 4 longs) instead of nothing but the > > CPU frequency. > > I agree that this could be much more configurable. Apparently no one has > needed those options yet, as there currenntly isn't any code to reconfigure > the clocks at all. I would guess most people are using an EEPROM to set > things up. Right. All boards I have seem so far, are equipped with such an EEPROM. And I would always recommend to add it to a 4xx design. > As for shortsightedness, keep in mind that I'm not a full time U-Boot > developer. I solved a problem to get our board working and I'm happy to > share the solution I came up with, but I just don't have the resources to > solve a problem that someone else might have later. IMO, with the basics in > this patch, it should be easy enough for anyone to modify it for additional > configurations if they are needed. Yes, I understand your situation. Thanks for changing the patch as I suggested. I'm inclined to accept your patch (if nobody objects) as is for the next merge window. If somebody needs an extended version of this PLL reconfiguration, he or she can easily adapt your code. Thanks. Best regards, Stefan = DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: [EMAIL PROTECTED] = - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Re: [U-Boot-Users] U-boot Bus Fault Error while accessing NOR flash
Hi Nikhil, On Wednesday 20 February 2008, Nikhil Gautam wrote: > Below is the most of my init.S file. You are correct about the > faulting location. But I can see in the init.S file that this address > location is defined as "AC_R|AC_W|AC_X|SA_G" so I think I should be > able to at least read it. I suggest that you look at the TLB setup with the BDI2000 when U-Boot is up and running, before trying to dump the last 4k from U-Boot: => tlb 0 63 This will show you the currently configured TLB's. > When I boot from 256Mb NAND flash, I don't > see this problem. Its only when I boot from 1Gb NAND flash. And 1Gb is large page, right? Best regards, Stefan = DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: [EMAIL PROTECTED] = - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH] TQM5200: fix bug in SDRAM initialization code
This patch fixes a bug in the SDRAM initialization code for the TQM5200. The hi_addr bit is now set correctly. Without this patch the hi_addr bit is always set to 1, if the second SDRAM bank is not populated. For other MPC5200 boards a correspondig patch has already been applied some time ago, see commit a63109281ad41b0fb489fdcb901171f76bcdbc2c. Signed-off-by: Martin Krause <[EMAIL PROTECTED]> -- Forget the first patch please. I confused flash with SDRAM in the comment ... --- board/tqm5200/tqm5200.c | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/board/tqm5200/tqm5200.c b/board/tqm5200/tqm5200.c index 905a043..8c3f701 100644 --- a/board/tqm5200/tqm5200.c +++ b/board/tqm5200/tqm5200.c @@ -155,10 +155,13 @@ long int initdram (int board_type) *(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize + 0x001c; /* 512MB */ /* find RAM size using SDRAM CS1 only */ - sdram_start(0); - test1 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x2000); - sdram_start(1); - test2 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x2000); + if (!dramsize) + sdram_start(0); + test2 = test1 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x2000); + if (!dramsize) { + sdram_start(1); + test2 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x2000); + } if (test1 > test2) { sdram_start(0); dramsize2 = test1; - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH] TQM5200: fix bug in SDRAM initialization code
This patch fixes a bug in the SDRAM initialization code for the TQM5200. The hi_addr bit is now set correctly. Without this patch the hi_addr bit is always set to 1, if the second flash bank is not populated. For other MPC5200 boards a correspondig patch has already been applied some time ago, see commit a63109281ad41b0fb489fdcb901171f76bcdbc2c. Signed-off-by: Martin Krause <[EMAIL PROTECTED]> --- board/tqm5200/tqm5200.c | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/board/tqm5200/tqm5200.c b/board/tqm5200/tqm5200.c index 905a043..8c3f701 100644 --- a/board/tqm5200/tqm5200.c +++ b/board/tqm5200/tqm5200.c @@ -155,10 +155,13 @@ long int initdram (int board_type) *(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize + 0x001c; /* 512MB */ /* find RAM size using SDRAM CS1 only */ - sdram_start(0); - test1 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x2000); - sdram_start(1); - test2 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x2000); + if (!dramsize) + sdram_start(0); + test2 = test1 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x2000); + if (!dramsize) { + sdram_start(1); + test2 = get_ram_size((long *)(CFG_SDRAM_BASE + dramsize), 0x2000); + } if (test1 > test2) { sdram_start(0); dramsize2 = test1; - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH] cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/
commit 0e6e4bbe5be1ef7f601abe7eddbe44b56fd5e43a Author: Nikita Youshchenko <[EMAIL PROTECTED]> Date: Mon Feb 25 11:27:06 2008 + cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/ This patch splits mpc8260 fdt fixup code into individual file, fdt.c, and updates it up to what is in cpu/mpc83xx/fdt.c. Also, it adds setting current-speed property for SMC uart, and setting value of 'brg-frequency' property on SOC node, if that property exists. The later is needed to support booting of vendor kernels based on 2.6.18 or near that. Signed-off-by: Nikita Youshchenko <[EMAIL PROTECTED]> diff --git a/cpu/mpc8260/Makefile b/cpu/mpc8260/Makefile index 80d7852..d2a9f79 100644 --- a/cpu/mpc8260/Makefile +++ b/cpu/mpc8260/Makefile @@ -28,7 +28,7 @@ LIB = $(obj)lib$(CPU).a START = start.o kgdb.o COBJS = traps.o serial_smc.o serial_scc.o cpu.o cpu_init.o speed.o \ interrupts.o ether_scc.o ether_fcc.o i2c.o commproc.o \ - bedbug_603e.o pci.o spi.o + bedbug_603e.o pci.o spi.o fdt.o SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) diff --git a/cpu/mpc8260/cpu.c b/cpu/mpc8260/cpu.c index 55e61a1..f6383c3 100644 --- a/cpu/mpc8260/cpu.c +++ b/cpu/mpc8260/cpu.c @@ -47,12 +47,6 @@ #include #include -#if defined(CONFIG_OF_LIBFDT) -#include -#include -#include -#endif - DECLARE_GLOBAL_DATA_PTR; #if defined(CONFIG_GET_CPU_STR_F) @@ -298,15 +292,3 @@ void watchdog_reset (void) enable_interrupts (); } #endif /* CONFIG_WATCHDOG */ - -/* - */ -#if defined(CONFIG_OF_LIBFDT) -void ft_cpu_setup (void *blob, bd_t *bd) -{ - char * cpu_path = "/cpus/" OF_CPU; - - do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1); - do_fixup_by_path_u32(blob, cpu_path, "timebase-frequency", OF_TBCLK, 1); - do_fixup_by_path_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1); -} -#endif /* CONFIG_OF_LIBFDT */ diff --git a/cpu/mpc8260/fdt.c b/cpu/mpc8260/fdt.c new file mode 100644 index 000..28bfe24 --- /dev/null +++ b/cpu/mpc8260/fdt.c @@ -0,0 +1,73 @@ +/* + * Copyright 2007 Freescale Semiconductor, Inc. + * + * (C) Copyright 2000 + * Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED] + * + * 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 + +#if defined(CONFIG_OF_LIBFDT) + +#include +#include + +void ft_cpu_setup (void *blob, bd_t *bd) +{ + +#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\ +defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3) + fdt_fixup_ethernet(blob, bd); +#endif + + do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, + "timebase-frequency", (bd->bi_busfreq / 4), 1); + do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, + "bus-frequency", bd->bi_busfreq, 1); + do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, + "clock-frequency", bd->bi_intfreq, 1); + do_fixup_by_prop_u32(blob, "device_type", "soc", 4, + "bus-frequency", bd->bi_busfreq, 1); + + /* This is used by obsolete kernels only. + Let's set it in case it exists, but not create it. */ + do_fixup_by_prop_u32(blob, "device_type", "soc", 4, + "brg-frequency", bd->bi_brgfreq, 0); + +#ifdef CFG_NS16550 + do_fixup_by_compat_u32(blob, "ns16550", + "clock-frequency", bd->bi_busfreq, 1); +#endif + +#ifdef CONFIG_CPM2 + do_fixup_by_compat_u32(blob, "fsl,cpm2-smc-uart", + "current-speed", bd->bi_baudrate, 1); + do_fixup_by_compat_u32(blob, "fsl,cpm2-scc-uart", + "current-speed", bd->bi_baudrate, 1); + + do_fixup_by_compat_u32(blob, "fsl,cpm2-brg", + "clock-frequency", bd->bi_brgfreq, 1); +#endif + + fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); +} + +#endif /* CONFIG_OF_LIBFDT */ signature.asc Description: This is a digitally signed message part. - This SF.net email is sponsored by: Microsoft Defy all challenges
[U-Boot-Users] [PATCH/review] Blackfin: cleanup and overhaul common board init functions
Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> --- lib_blackfin/Makefile |4 +- lib_blackfin/blackfin_board.h | 64 --- lib_blackfin/board.c | 394 +++-- 3 files changed, 226 insertions(+), 236 deletions(-) delete mode 100644 lib_blackfin/blackfin_board.h diff --git a/lib_blackfin/Makefile b/lib_blackfin/Makefile index 527fe1b..a5ab3f7 100644 --- a/lib_blackfin/Makefile +++ b/lib_blackfin/Makefile @@ -1,7 +1,7 @@ # # U-boot Makefile # -# Copyright (c) 2005-2007 Analog Devices Inc. +# Copyright (c) 2005-2008 Analog Devices Inc. # # (C) Copyright 2000-2006 # Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED] @@ -27,6 +27,8 @@ include $(TOPDIR)/config.mk +CFLAGS += -DBFIN_BOARD_NAME='"$(BOARD)"' + LIB= $(obj)lib$(ARCH).a SOBJS = memcpy.o memcmp.o memset.o memmove.o diff --git a/lib_blackfin/blackfin_board.h b/lib_blackfin/blackfin_board.h deleted file mode 100644 index 1353421..000 --- a/lib_blackfin/blackfin_board.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * U-boot - blackfin_board.h - * - * Copyright (c) 2005-2007 Analog Devices Inc. - * - * (C) Copyright 2000-2004 - * Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED] - * - * 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., 51 Franklin St, Fifth Floor, Boston, - * MA 02110-1301 USA - */ - -#ifndef __BLACKFIN_BOARD_H__ -#define __BLACKFIN_BOARD_H__ - -#include - -extern void timer_init(void); -extern void init_IRQ(void); -extern void rtc_init(void); - -extern ulong uboot_end_data; -extern ulong uboot_end; - -ulong monitor_flash_len; - - -#define VERSION_STRING_SIZE 150 /* including 40 bytes buffer to change any string */ -#define VERSION_STRING_FORMAT "%s (%s - %s)\n" -#define VERSION_STRING U_BOOT_VERSION, __DATE__, __TIME__ - -char version_string[VERSION_STRING_SIZE]; - -int *g_addr; -static ulong mem_malloc_start; -static ulong mem_malloc_end; -static ulong mem_malloc_brk; -extern char _sram_in_sdram_start[]; -extern char _sram_inst_size[]; -#ifdef DEBUG -static void display_global_data(void); -#endif - -/* definitions used to check the SMC card availability */ -#define SMC_BASE_ADDRESS CONFIG_SMC9_BASE -#define UPPER_BYTE_MASK0xFF00 -#define SMC_IDENT 0x3300 - -#endif diff --git a/lib_blackfin/board.c b/lib_blackfin/board.c index 140ec07..43d8be8 100644 --- a/lib_blackfin/board.c +++ b/lib_blackfin/board.c @@ -1,41 +1,29 @@ /* * U-boot - board.c First C file to be called contains init routines * - * Copyright (c) 2005-2007 Analog Devices Inc. + * Copyright (c) 2005-2008 Analog Devices Inc. * * (C) Copyright 2000-2004 * Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED] * - * 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., 51 Franklin St, Fifth Floor, Boston, - * MA 02110-1301 USA + * Licensed under the GPL-2 or later. */ #include #include -#include #include -#include -#include #include #include -#include "blackfin_board.h" +#include +#include +#include + #include -#include "../drivers/net/smc9.h" +#include + +#ifdef CONFIG_CMD_NAND +#include /* cannot even include nand.h if it isnt configured */ +#endif #if defined(CONFIG_POST) #include @@ -44,11 +32,19 @@ int post_flag; DECLARE_GLOBAL_DATA_PTR; -#ifndef CFG_NO_FLASH -extern flash_info_t flash_info[]; +const char version_string[] = U_BOOT_VERSION " (" __DATE__ " - " __TIME__ ")"; + +__attribute__((always_inline)) +static inline void serial_early_puts(const char *s) +{ +#ifdef CONFIG_DEBUG_EARLY_SERIAL + serial_puts("Early: "); +
[U-Boot-Users] [PATCH/review] Blackfin: add error debug to serial driver
This adds a new CONFIG_DEBUG_SERIAL define so that people can figure out if/when their serial port is hitting errors. Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> --- cpu/blackfin/serial.c | 57 +--- 1 files changed, 48 insertions(+), 9 deletions(-) diff --git a/cpu/blackfin/serial.c b/cpu/blackfin/serial.c index 0dfee51..f538bba 100644 --- a/cpu/blackfin/serial.c +++ b/cpu/blackfin/serial.c @@ -35,6 +35,29 @@ #include "serial.h" +#ifdef CONFIG_DEBUG_SERIAL +uint16_t cached_lsr[256]; +uint16_t cached_rbr[256]; +size_t cache_count; +#endif + +/* The LSR is read-to-clear on some parts, so we have to make sure status + * bits aren't inadvertently lost when doing various tests. + */ +static uint16_t uart_lsr_save; +static uint16_t uart_lsr_read(void) +{ + uint16_t lsr = *pUART_LSR; + uart_lsr_save |= (lsr & (OE|PE|FE|BI)); + return lsr | uart_lsr_save; +} +/* Just do the clear for everyone since it can't hurt. */ +static void uart_lsr_clear(void) +{ + uart_lsr_save = 0; + *pUART_LSR |= -1; +} + /* Symbol for our assembly to call. */ void serial_set_baud(uint32_t baud) { @@ -61,6 +84,12 @@ int serial_init(void) { serial_initialize(); serial_setbrg(); + uart_lsr_clear(); +#ifdef CONFIG_DEBUG_SERIAL + cache_count = 0; + memset(cached_lsr, 0x00, sizeof(cached_lsr)); + memset(cached_rbr, 0x00, sizeof(cached_rbr)); +#endif return 0; } @@ -73,7 +102,7 @@ void serial_putc(const char c) WATCHDOG_RESET(); /* wait for the hardware fifo to clear up */ - while (!(*pUART_LSR & THRE)) + while (!(uart_lsr_read() & THRE)) continue; /* queue the character for transmission */ @@ -83,14 +112,14 @@ void serial_putc(const char c) WATCHDOG_RESET(); /* wait for the byte to be shifted over the line */ - while (!(*pUART_LSR & TEMT)) + while (!(uart_lsr_read() & TEMT)) continue; } int serial_tstc(void) { WATCHDOG_RESET(); - return (*pUART_LSR & DR) ? 1 : 0; + return (uart_lsr_read() & DR) ? 1 : 0; } int serial_getc(void) @@ -102,15 +131,25 @@ int serial_getc(void) continue; /* clear the status and grab the new byte */ - uart_lsr_val = *pUART_LSR; + uart_lsr_val = uart_lsr_read(); uart_rbr_val = *pUART_RBR; +#ifdef CONFIG_DEBUG_SERIAL + cached_lsr[cache_count] = uart_lsr_val; + cached_rbr[cache_count] = uart_rbr_val; + cache_count = (cache_count + 1) % ARRAY_SIZE(cached_lsr); +#endif + if (uart_lsr_val & (OE|PE|FE|BI)) { - /* Some parts are read-to-clear while others are -* write-to-clear. Just do the write for everyone -* since it cant hurt (other than code size). -*/ - *pUART_LSR = (OE|PE|FE|BI); +#ifdef CONFIG_DEBUG_SERIAL + printf("\n[SERIAL ERROR]\n"); + do { + --cache_count; + printf("\t%3i: RBR=0x%02x LSR=0x%02x\n", cache_count, + cached_rbr[cache_count], cached_lsr[cache_count]); + } while (cache_count > 0); +#endif + uart_lsr_clear(); return -1; } -- 1.5.4.2 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH/review] Blackfin: cleanup lib_blackfin/cache.c
Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> --- lib_blackfin/cache.c | 35 --- lib_blackfin/cache.h | 35 --- 2 files changed, 8 insertions(+), 62 deletions(-) delete mode 100644 lib_blackfin/cache.h diff --git a/lib_blackfin/cache.c b/lib_blackfin/cache.c index 6fc4983..c2f6e28 100644 --- a/lib_blackfin/cache.c +++ b/lib_blackfin/cache.c @@ -1,45 +1,26 @@ /* * U-boot - cache.c * - * Copyright (c) 2005-2007 Analog Devices Inc. + * Copyright (c) 2005-2008 Analog Devices Inc. * * (C) Copyright 2000-2004 * Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED] * - * 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., 51 Franklin St, Fifth Floor, Boston, - * MA 02110-1301 USA + * Licensed under the GPL-2 or later. */ -/* for now: just dummy functions to satisfy the linker */ -#include #include #include -#include "cache.h" -void flush_cache(unsigned long dummy1, unsigned long dummy2) +void flush_cache(unsigned long addr, unsigned long size) { - if (dummy1 >= 0xE000) + /* no need to flush stuff in on chip memory (L1/L2/etc...) */ + if (addr >= 0xE000) return; if (icache_status()) - blackfin_icache_flush_range((void*)dummy1, (void*)(dummy1 + dummy2)); - if (dcache_status()) - blackfin_dcache_flush_range((void*)dummy1, (void*)(dummy1 + dummy2)); + blackfin_icache_flush_range((void *)addr, (void *)(addr + size)); - return; + if (dcache_status()) + blackfin_dcache_flush_range((void *)addr, (void *)(addr + size)); } diff --git a/lib_blackfin/cache.h b/lib_blackfin/cache.h deleted file mode 100644 index 3ea6809..000 --- a/lib_blackfin/cache.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * U-boot - prototypes for cache handling functions. - * - * Copyright (c) 2005-2007 Analog Devices Inc. - * - * (C) Copyright 2000-2004 - * Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED] - * - * 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, see the file COPYING, or write - * to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef _LIB_BLACKFIN_CACHE_H_ -#define _LIB_BLACKFIN_CACHE_H_ - -extern void blackfin_icache_flush_range(const void *, const void *); -extern void blackfin_dcache_flush_range(const void *, const void *); -extern void blackfin_dcache_invalidate_range(const void *, const void *); - -#endif -- 1.5.4.2 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH/review] Blackfin: add proper ELF markings to some assembly functions
Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> --- lib_blackfin/memcmp.S |3 +++ lib_blackfin/memcpy.S |3 +++ lib_blackfin/memmove.S |3 +++ lib_blackfin/memset.S |3 +++ 4 files changed, 12 insertions(+), 0 deletions(-) diff --git a/lib_blackfin/memcmp.S b/lib_blackfin/memcmp.S index 9b58832..6c834a7 100644 --- a/lib_blackfin/memcmp.S +++ b/lib_blackfin/memcmp.S @@ -31,6 +31,7 @@ */ .globl _memcmp; +.type _memcmp, STT_FUNC; _memcmp: I1 = P3; P0 = R0;/* P0 = s1 address */ @@ -98,3 +99,5 @@ _memcmp: R0 = 0; P3 = I1; RTS; + +.size _memcmp, .-_memcmp diff --git a/lib_blackfin/memcpy.S b/lib_blackfin/memcpy.S index 24577be..e6b359a 100644 --- a/lib_blackfin/memcpy.S +++ b/lib_blackfin/memcpy.S @@ -23,6 +23,7 @@ .align 2 .globl _memcpy_ASM; +.type _memcpy_ASM, STT_FUNC; _memcpy_ASM: CC = R2 <= 0; /* length not positive?*/ IF CC JUMP .L_P1L2147483647; /* Nothing to do */ @@ -112,3 +113,5 @@ _memcpy_ASM: B[P0--] = R1; RTS; + +.size _memcpy_ASM, .-_memcpy_ASM diff --git a/lib_blackfin/memmove.S b/lib_blackfin/memmove.S index 46f79ed..e385c4f 100644 --- a/lib_blackfin/memmove.S +++ b/lib_blackfin/memmove.S @@ -31,6 +31,7 @@ */ .globl _memmove; +.type _memmove, STT_FUNC; _memmove: I1 = P3; P0 = R0; /* P0 = To address */ @@ -91,3 +92,5 @@ _memmove: .Lno_loop: B[P0] = R1; P3 = I1; RTS; + +.size _memmove, .-_memmove diff --git a/lib_blackfin/memset.S b/lib_blackfin/memset.S index c33c551..26f63cd 100644 --- a/lib_blackfin/memset.S +++ b/lib_blackfin/memset.S @@ -31,6 +31,7 @@ */ .globl _memset; +.type _memset, STT_FUNC; _memset: P0 = R0 ; /* P0 = address */ P2 = R2 ; /* P2 = count */ @@ -91,3 +92,5 @@ _memset: B[P0++] = R1; B[P0++] = R1; JUMP .Laligned; + +.size _memset, .-_memset -- 1.5.4.2 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH/review] Blackfin: new cplbinfo command for viewing cplb tables
Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> --- common/Makefile |1 + common/cmd_cplbinfo.c | 59 + 2 files changed, 60 insertions(+), 0 deletions(-) create mode 100644 common/cmd_cplbinfo.c diff --git a/common/Makefile b/common/Makefile index 1244e0b..56d0581 100644 --- a/common/Makefile +++ b/common/Makefile @@ -41,6 +41,7 @@ COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o COBJS-y += cmd_bootm.o COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o +COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o COBJS-$(CONFIG_CMD_DATE) += cmd_date.o ifdef CONFIG_4xx COBJS-$(CONFIG_CMD_SETGETDCR) += cmd_dcr.o diff --git a/common/cmd_cplbinfo.c b/common/cmd_cplbinfo.c new file mode 100644 index 000..b2bbec1 --- /dev/null +++ b/common/cmd_cplbinfo.c @@ -0,0 +1,59 @@ +/* + * cmd_cplbinfo.c - dump the instruction/data cplb tables + * + * Copyright (c) 2007-2008 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#include +#include +#include +#include +#include + +/* + * Translate the PAGE_SIZE bits into a human string + */ +static const char *cplb_page_size(uint32_t data) +{ + static const char page_size_string_table[][4] = { "1K", "4K", "1M", "4M" }; + return page_size_string_table[(data & PAGE_SIZE_MASK) >> PAGE_SIZE_SHIFT]; +} + +/* + * show a hardware cplb table + */ +static void show_cplb_table(uint32_t *addr, uint32_t *data) +{ + size_t i; + printf(" Address Data Size Valid Locked\n"); + for (i = 1; i <= 16; ++i) { + printf(" %2i 0x%p 0x%05X %s %c %c\n", + i, *addr, *data, + cplb_page_size(*data), + (*data & CPLB_VALID ? 'Y' : 'N'), + (*data & CPLB_LOCK ? 'Y' : 'N')); + ++addr; + ++data; + } +} + +/* + * display current instruction and data cplb tables + */ +int do_cplbinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +{ + printf("%s CPLB table [%08x]:\n", "Instruction", *(uint32_t *)DMEM_CONTROL); + show_cplb_table((uint32_t *)ICPLB_ADDR0, (uint32_t *)ICPLB_DATA0); + + printf("%s CPLB table [%08x]:\n", "Data", *(uint32_t *)IMEM_CONTROL); + show_cplb_table((uint32_t *)DCPLB_ADDR0, (uint32_t *)DCPLB_DATA0); + + return 0; +} + +U_BOOT_CMD(cplbinfo, 1, 0, do_cplbinfo, + "cplbinfo- display current CPLB tables\n", + "\n" + "- display current CPLB tables\n"); -- 1.5.4.2 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH/review] Blackfin: BF537-stamp: cleanup spi flash driver
This punts the old spi flash driver for a new/generalized one. Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> --- board/bf533-stamp/Makefile |2 +- board/bf533-stamp/spi.c| 474 --- board/bf533-stamp/spi_flash.c |2 + board/bf537-stamp/Makefile |2 +- board/bf537-stamp/spi_flash.c | 815 board/bf537-stamp/stm_m25p64.c | 516 - 6 files changed, 819 insertions(+), 992 deletions(-) delete mode 100644 board/bf533-stamp/spi.c create mode 100644 board/bf533-stamp/spi_flash.c create mode 100644 board/bf537-stamp/spi_flash.c delete mode 100644 board/bf537-stamp/stm_m25p64.c diff --git a/board/bf533-stamp/Makefile b/board/bf533-stamp/Makefile index 02c941b..14bb7a2 100644 --- a/board/bf533-stamp/Makefile +++ b/board/bf533-stamp/Makefile @@ -29,7 +29,7 @@ include $(TOPDIR)/config.mk LIB= $(obj)lib$(BOARD).a -COBJS := $(BOARD).o spi.o +COBJS := $(BOARD).o spi_flash.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/board/bf533-stamp/spi_flash.c b/board/bf533-stamp/spi_flash.c new file mode 100644 index 000..8784741 --- /dev/null +++ b/board/bf533-stamp/spi_flash.c @@ -0,0 +1,2 @@ +/* Share the spi flash code */ +#include "../bf537-stamp/spi_flash.c" diff --git a/board/bf537-stamp/Makefile b/board/bf537-stamp/Makefile index 5d22393..5326154 100644 --- a/board/bf537-stamp/Makefile +++ b/board/bf537-stamp/Makefile @@ -29,7 +29,7 @@ include $(TOPDIR)/config.mk LIB= $(obj)lib$(BOARD).a -COBJS := $(BOARD).o post-memory.o stm_m25p64.o cmd_bf537led.o nand.o +COBJS := $(BOARD).o post-memory.o spi_flash.o cmd_bf537led.o nand.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/board/bf537-stamp/spi_flash.c b/board/bf537-stamp/spi_flash.c new file mode 100644 index 000..7c73ddd --- /dev/null +++ b/board/bf537-stamp/spi_flash.c @@ -0,0 +1,815 @@ +/* + * SPI flash driver + * + * Enter bugs at http://blackfin.uclinux.org/ + * + * Copyright (c) 2005-2007 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +/* Configuration options: + * CONFIG_SPI_BAUD - value to load into SPI_BAUD (divisor of SCLK to get SPI CLK) + * CONFIG_SPI_FLASH_SLOW_READ - force usage of the slower read + * WARNING: make sure your SCLK + SPI_BAUD is slow enough + */ + +#include +#include +#include +#include + +/* Forcibly phase out these */ +#ifdef CONFIG_SPI_FLASH_NUM_SECTORS +# error do not set CONFIG_SPI_FLASH_NUM_SECTORS +#endif +#ifdef CONFIG_SPI_FLASH_SECTOR_SIZE +# error do not set CONFIG_SPI_FLASH_SECTOR_SIZE +#endif + +#if defined(CONFIG_SPI) + +struct flash_info { + char *name; + uint16_t id; + unsigned sector_size; + unsigned num_sectors; +}; + +/* SPI Speeds: 50 MHz / 33 MHz */ +static struct flash_info flash_spansion_serial_flash[] = { + { "S25FL016", 0x0215, 64 * 1024, 32 }, + { "S25FL032", 0x0216, 64 * 1024, 64 }, + { "S25FL064", 0x0217, 64 * 1024, 128 }, + { "S25FL0128", 0x0218, 256 * 1024, 64 }, + { NULL, 0, 0, 0 } +}; + +/* SPI Speeds: 50 MHz / 20 MHz */ +static struct flash_info flash_st_serial_flash[] = { + { "m25p05", 0x2010, 32 * 1024, 2 }, + { "m25p10", 0x2011, 32 * 1024, 4 }, + { "m25p20", 0x2012, 64 * 1024, 4 }, + { "m25p40", 0x2013, 64 * 1024, 8 }, + { "m25p16", 0x2015, 64 * 1024, 32 }, + { "m25p32", 0x2016, 64 * 1024, 64 }, + { "m25p64", 0x2017, 64 * 1024, 128 }, + { "m25p128", 0x2018, 256 * 1024, 64 }, + { NULL, 0, 0, 0 } +}; + +/* SPI Speeds: 66 MHz / 33 MHz */ +static struct flash_info flash_atmel_dataflash[] = { + { "AT45DB011x", 0x0c, 264, 512 }, + { "AT45DB021x", 0x14, 264, 1025 }, + { "AT45DB041x", 0x1c, 264, 2048 }, + { "AT45DB081x", 0x24, 264, 4096 }, + { "AT45DB161x", 0x2c, 528, 4096 }, + { "AT45DB321x", 0x34, 528, 8192 }, + { "AT45DB642x", 0x3c, 1056, 8192 }, + { NULL, 0, 0, 0 } +}; + +/* SPI Speed: 50 MHz / 25 MHz or 40 MHz / 20 MHz */ +static struct flash_info flash_winbond_serial_flash[] = { + { "W25X10", 0x3011, 16 * 256, 32 }, + { "W25X20", 0x3012, 16 * 256, 64 }, + { "W25X40", 0x3013, 16 * 256, 128 }, + { "W25X80", 0x3014, 16 * 256, 256 }, + { "W25P80", 0x2014, 256 * 256, 16 }, + { "W25P16", 0x2015, 256 * 256, 32 }, + { NULL, 0, 0, 0 } +}; + +struct flash_ops { + uint8_t read, write, erase, status; +}; + +#ifdef CONFIG_SPI_FLASH_SLOW_READ +# define OP_READ 0x03 +#else +# define OP_READ 0x0B +#endif +static struct flash_ops flash_st_ops = { + .read = OP_READ, + .write = 0x02, + .erase = 0xD8, + .status = 0x05, +}; + +static struct flash_ops flash_atmel_ops = { + .read = OP_READ, + .write = 0x82, + .erase = 0x81, + .status = 0xD7, +}; + +static struct flash_ops flash_winbond_ops = { +
[U-Boot-Users] [PATCH/review] Blackfin: convert BFIN_CPU to CONFIG_BFIN_CPU
Stop tying things to the processor that should be tied to other defines and change BFIN_CPU to CONFIG_BFIN_CPU so that it can be used in the build system to select the -mcpu option. Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> --- blackfin_config.mk |6 +- board/bf533-ezkit/bf533-ezkit.c |7 --- board/bf533-stamp/bf533-stamp.c |7 --- board/bf537-stamp/bf537-stamp.c | 11 --- include/configs/bf533-ezkit.h |9 - include/configs/bf533-stamp.h | 25 - include/configs/bf537-stamp.h | 34 +- include/configs/bf561-ezkit.h |6 +- lib_blackfin/board.c|3 ++- 9 files changed, 29 insertions(+), 79 deletions(-) diff --git a/blackfin_config.mk b/blackfin_config.mk index a7513ea..d90eb23 100644 --- a/blackfin_config.mk +++ b/blackfin_config.mk @@ -24,9 +24,13 @@ PLATFORM_RELFLAGS += -ffixed-P5 PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN +ifneq (,$(CONFIG_BFIN_CPU)) +PLATFORM_RELFLAGS += -mcpu=$(CONFIG_BFIN_CPU) +endif + SYM_PREFIX = _ LDR_FLAGS += --use-vmas -ifeq (,$(findstring s,$(MAKEFLAGS))) +ifneq (,$(findstring s,$(MAKEFLAGS))) LDR_FLAGS += --quiet endif diff --git a/board/bf533-ezkit/bf533-ezkit.c b/board/bf533-ezkit/bf533-ezkit.c index 98ed6f8..738f69c 100644 --- a/board/bf533-ezkit/bf533-ezkit.c +++ b/board/bf533-ezkit/bf533-ezkit.c @@ -34,13 +34,6 @@ DECLARE_GLOBAL_DATA_PTR; int checkboard(void) { -#if (BFIN_CPU == ADSP_BF531) - printf("CPU: ADSP BF531 Rev.: 0.%d\n", *pCHIPID >> 28); -#elif (BFIN_CPU == ADSP_BF532) - printf("CPU: ADSP BF532 Rev.: 0.%d\n", *pCHIPID >> 28); -#else - printf("CPU: ADSP BF533 Rev.: 0.%d\n", *pCHIPID >> 28); -#endif printf("Board: ADI BF533 EZ-Kit Lite board\n"); printf(" Support: http://blackfin.uclinux.org/\n";); return 0; diff --git a/board/bf533-stamp/bf533-stamp.c b/board/bf533-stamp/bf533-stamp.c index af03597..c4dde92 100644 --- a/board/bf533-stamp/bf533-stamp.c +++ b/board/bf533-stamp/bf533-stamp.c @@ -43,13 +43,6 @@ DECLARE_GLOBAL_DATA_PTR; int checkboard(void) { -#if (BFIN_CPU == ADSP_BF531) - printf("CPU: ADSP BF531 Rev.: 0.%d\n", *pCHIPID >> 28); -#elif (BFIN_CPU == ADSP_BF532) - printf("CPU: ADSP BF532 Rev.: 0.%d\n", *pCHIPID >> 28); -#else - printf("CPU: ADSP BF533 Rev.: 0.%d\n", *pCHIPID >> 28); -#endif printf("Board: ADI BF533 Stamp board\n"); printf(" Support: http://blackfin.uclinux.org/\n";); return 0; diff --git a/board/bf537-stamp/bf537-stamp.c b/board/bf537-stamp/bf537-stamp.c index e36a1b6..6ca8e21 100644 --- a/board/bf537-stamp/bf537-stamp.c +++ b/board/bf537-stamp/bf537-stamp.c @@ -31,7 +31,6 @@ #include #include #include -#include "ether_bf537.h" #include /** @@ -56,13 +55,6 @@ DECLARE_GLOBAL_DATA_PTR; int checkboard(void) { -#if (BFIN_CPU == ADSP_BF534) - printf("CPU: ADSP BF534 Rev.: 0.%d\n", *pCHIPID >> 28); -#elif (BFIN_CPU == ADSP_BF536) - printf("CPU: ADSP BF536 Rev.: 0.%d\n", *pCHIPID >> 28); -#else - printf("CPU: ADSP BF537 Rev.: 0.%d\n", *pCHIPID >> 28); -#endif printf("Board: ADI BF537 stamp board\n"); printf(" Support: http://blackfin.uclinux.org/\n";); return 0; @@ -142,9 +134,6 @@ int misc_init_r(void) pMACaddr[2], pMACaddr[3], pMACaddr[4], pMACaddr[5]); setenv("ethaddr", nid); } - if (getenv("ethaddr")) { - SetupMacAddr(SrcAddr); - } #endif #endif /* BFIN_BOOT_MODE == BF537_BYPASS_BOOT */ diff --git a/include/configs/bf533-ezkit.h b/include/configs/bf533-ezkit.h index 6cb6bc4..f2c8703 100644 --- a/include/configs/bf533-ezkit.h +++ b/include/configs/bf533-ezkit.h @@ -5,6 +5,8 @@ #ifndef __CONFIG_EZKIT533_H__ #define __CONFIG_EZKIT533_H__ +#include + #define CONFIG_BAUDRATE57600 #define CONFIG_STAMP 1 @@ -41,10 +43,7 @@ #define CONFIG_PANIC_HANG 1 -#define ADSP_BF531 0x31 -#define ADSP_BF532 0x32 -#define ADSP_BF533 0x33 -#define BFIN_CPU ADSP_BF533 +#define CONFIG_BFIN_CPUbf533-0.3 /* This sets the default state of the cache on U-Boot's boot */ #define CONFIG_ICACHE_ON @@ -120,7 +119,7 @@ #define CONFIG_BOOTARGS "root=/dev/mtdblock0 ip=192.168.0.15:192.168.0.2:192.168.0.1:255.255.255.0:ezkit:eth0:off console=ttyBF0,57600" -#defineCFG_PROMPT "ezkit> " /* Monitor Command Prompt */ +#defineCFG_PROMPT "bfin> "/* Monitor Command Prompt */ #if defined(CONFIG_CMD_KGDB) #defineCFG_CBSIZE 1024/* Console I/O Buffer Size */ #else diff --git a/include/configs/bf533-stamp.h b/include/configs/bf533-stamp.h index cce6ef7..76dd2fa 100644 --- a/include/configs/bf533-stamp.h +++ b/include/configs/bf533-stamp.h @@ -5,6 +5,8 @@
[U-Boot-Users] [PATCH/review] Blackfin: BF537-stamp: drop board-specific flash driver for CFI
The parallel flash on the BF537-STAMP is CFI compliant, so there is no need for the board specific driver at all. Just use the common CFI driver. Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> --- board/bf537-stamp/Makefile|2 +- board/bf537-stamp/flash-defines.h | 123 --- board/bf537-stamp/flash.c | 403 - include/configs/bf537-stamp.h |9 +- 4 files changed, 6 insertions(+), 531 deletions(-) delete mode 100644 board/bf537-stamp/flash-defines.h delete mode 100644 board/bf537-stamp/flash.c diff --git a/board/bf537-stamp/Makefile b/board/bf537-stamp/Makefile index fcdfd24..5d22393 100644 --- a/board/bf537-stamp/Makefile +++ b/board/bf537-stamp/Makefile @@ -29,7 +29,7 @@ include $(TOPDIR)/config.mk LIB= $(obj)lib$(BOARD).a -COBJS := $(BOARD).o flash.o post-memory.o stm_m25p64.o cmd_bf537led.o nand.o +COBJS := $(BOARD).o post-memory.o stm_m25p64.o cmd_bf537led.o nand.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/include/configs/bf537-stamp.h b/include/configs/bf537-stamp.h index 0679f43..0e189d4 100644 --- a/include/configs/bf537-stamp.h +++ b/include/configs/bf537-stamp.h @@ -286,6 +286,11 @@ #defineCFG_SDRAM_BASE 0x #define CFG_FLASH_BASE 0x2000 +#define CFG_FLASH_CFI /* The flash is CFI compatible */ +#define CFG_FLASH_CFI_DRIVER /* Use common CFI driver */ +#define CFG_FLASH_PROTECTION +#define CFG_MAX_FLASH_BANKS1 +#define CFG_MAX_FLASH_SECT 71 /* some have 67 sectors (M29W320DB), but newer have 71 (M29W320EB) */ #defineCFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */ #define CFG_MONITOR_BASE (CFG_MAX_RAM_SIZE - CFG_MONITOR_LEN) @@ -295,10 +300,6 @@ #define CFG_GBL_DATA_ADDR (CFG_MALLOC_BASE - CFG_GBL_DATA_SIZE) #define CONFIG_STACKBASE (CFG_GBL_DATA_ADDR - 4) -#defineCFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ -#define CFG_MAX_FLASH_BANKS1 /* max number of memory banks */ -#define CFG_MAX_FLASH_SECT 71 /* max number of sectors on one chip */ - #if (BFIN_BOOT_MODE == BF537_BYPASS_BOOT) || (BFIN_BOOT_MODE == BF537_UART_BOOT) /* for bf537-stamp, usrt boot mode still store env in flash */ #defineCFG_ENV_IS_IN_FLASH 1 -- 1.5.4.2 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
[U-Boot-Users] [PATCH/review] Blackfin: move bootldr command to common code
This moves the Blackfin-common bootldr command out of the BF537-STAMP specific board directory and into the common directory so that all Blackfin boards may utilize it. Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> --- board/bf537-stamp/bf537-stamp.c | 45 --- common/Makefile |1 + common/cmd_bootldr.c| 64 +++ 3 files changed, 65 insertions(+), 45 deletions(-) create mode 100644 common/cmd_bootldr.c diff --git a/board/bf537-stamp/bf537-stamp.c b/board/bf537-stamp/bf537-stamp.c index d279817..e36a1b6 100644 --- a/board/bf537-stamp/bf537-stamp.c +++ b/board/bf537-stamp/bf537-stamp.c @@ -54,51 +54,6 @@ DECLARE_GLOBAL_DATA_PTR; #define POST_WORD_ADDR 0xFF903FFC -/* - * the bootldr command loads an address, checks to see if there - * is a Boot stream that the on-chip BOOTROM can understand, - * and loads it via the BOOTROM Callback. It is possible - * to also add booting from SPI, or TWI, but this function does - * not currently support that. - */ -int do_bootldr(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) -{ - ulong addr, entry; - ulong *data; - - /* Get the address */ - if (argc < 2) { - addr = load_addr; - } else { - addr = simple_strtoul(argv[1], NULL, 16); - } - - /* Check if it is a LDR file */ - data = (ulong *) addr; - if (*data == 0xFF800060 || *data == 0xFF800040 || *data == 0xFF800020) { - /* We want to boot from FLASH or SDRAM */ - entry = _BOOTROM_BOOT_DXE_FLASH; - printf("## Booting ldr image at 0x%08lx ...\n", addr); - if (icache_status()) - icache_disable(); - if (dcache_status()) - dcache_disable(); - - __asm__("R7=%[a];\n" "P0=%[b];\n" "JUMP (P0);\n": - :[a] "d"(addr),[b] "a"(entry) - :"R7", "P0"); - - } else { - printf("## No ldr image at address 0x%08lx\n", addr); - } - - return 0; -} - -U_BOOT_CMD(bootldr, 2, 0, do_bootldr, - "bootldr - boot ldr image from memory\n", - "[addr]\n - boot ldr image stored in memory\n"); - int checkboard(void) { #if (BFIN_CPU == ADSP_BF534) diff --git a/common/Makefile b/common/Makefile index a88d1ef..1244e0b 100644 --- a/common/Makefile +++ b/common/Makefile @@ -37,6 +37,7 @@ COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o COBJS-y += cmd_boot.o +COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o COBJS-y += cmd_bootm.o COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o diff --git a/common/cmd_bootldr.c b/common/cmd_bootldr.c new file mode 100644 index 000..e6474aa --- /dev/null +++ b/common/cmd_bootldr.c @@ -0,0 +1,64 @@ +/* + * U-boot - bootldr.c + * + * Copyright (c) 2005-2008 Analog Devices Inc. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * Licensed under the GPL-2 or later. + */ + +#include +#include +#include + +#include +#include + +/* + * the bootldr command loads an address, checks to see if there + * is a Boot stream that the on-chip BOOTROM can understand, + * and loads it via the BOOTROM Callback. It is possible + * to also add booting from SPI, or TWI, but this function does + * not currently support that. + */ + +int do_bootldr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +{ + void *addr; + uint32_t *data; + + /* Get the address */ + if (argc < 2) + addr = (void *)load_addr; + else + addr = (void *)simple_strtoul(argv[1], NULL, 16); + + /* Check if it is a LDR file */ + data = addr; +#if defined(__ADSPBF54x__) || defined(__ADSPBF52x__) + if ((*data & 0xFF00) == 0xAD00 && data[2] == 0x) { +#else + if (*data == 0xFF800060 || *data == 0xFF800040 || *data == 0xFF800020) { +#endif + /* We want to boot from FLASH or SDRAM */ + printf("## Booting ldr image at 0x%p ...\n", addr); + + icache_disable(); + dcache_disable(); + + __asm__( + "jump (%1);" + : + : "q7" (addr), "a" (_BOOTROM_MEMBOOT)); + } else + printf("## No ldr image at address 0x%p\n", addr); + + return 0; +} + +U_BOOT_CMD(bootldr, 2, 0, do_bootldr, + "bootldr - boot ldr image from memory\n", + "[addr]\n" + "- boot ldr image stored in memory\n"); -- 1.5.4.2 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ U-B