Re: [U-Boot] [PATCH 0/6] ARM device tree support improvements
On Mon, Mar 28, 2011 at 01:58:25PM -0600, Grant Likely wrote: Hi Jerry Wolfgang, The following series fixes a bug in the device tree code and eliminates the CONFIG_OF_LIBFDT dependency on CONFIG_SYS_BOOTMAPSZ. It also adds parsing of the reserved mem regions so that U-Boot doesn't decide to use a regions set aside for another purpose. Finally, the last patch adds CONFIG_OF_LIBFDT to a bunch of boards. I'm not expecting the last patch to be picked up in mainline (yet), but it will be picked up into the Linaro tree for the 11.05 release. John, this same series applies cleanly on the linaro-stable u-boot tree. Can you pick them up please? Or would you prefer me to send you a pull request? g. --- Grant Likely (6): Stop passing around bootmem_base value. Default to bootm_size() when CONFIG_SYS_BOOTMAPSZ is not defined Remove device tree booting dependency on CONFIG_SYS_BOOTMAPSZ Fix off-by-one error in passing initrd end address via device tree Respect memreserve regions specified in the device tree Add CONFIG_OF_LIBFDT to more boards. On mx51evk (babbage) board: Tested-by: Shawn Guo shawn@linaro.org -- Regards, Shawn ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] MX5: Enable flat-device-tree support on mx53 loco board
--- Grant has submit one patchset: ARM device tree support improvements which remove device tree booting dependency on CONFIG_SYS_BOOTMAPSZ. Will provide patchset to clean CONFIG_SYS_BOOTMAPSZ after the patches applied to u-boot mainline Signed-off-by: Jason Liu jason@linaro.org --- include/configs/mx53loco.h |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h index 585e8c8..9c7dcc9 100644 --- a/include/configs/mx53loco.h +++ b/include/configs/mx53loco.h @@ -193,4 +193,7 @@ #define CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 +#define CONFIG_OF_LIBFDT +#define CONFIG_SYS_BOOTMAPSZ 0x80 + #endif /* __CONFIG_H */ -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] MX5: Enable flat-device-tree support on mx53 loco board
Dear Jason Liu, In message 1301387516-18201-1-git-send-email-jason@linaro.org you wrote: --- Grant has submit one patchset: ARM device tree support improvements which remove device tree booting dependency on CONFIG_SYS_BOOTMAPSZ. Will provide patchset to clean CONFIG_SYS_BOOTMAPSZ after the patches applied to u-boot mainline Signed-off-by: Jason Liu jason@linaro.org --- include/configs/mx53loco.h |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) Please use git-format-patch to create patches. The initial --- line in your posting kills not only the comment (or should this go into the commit message?), but also your Signed-off-by line, so this would be missing in the commit. Please fix. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Whoever undertakes to set himself up as a judge of Truth and Know- ledge is shipwrecked by the laughter of the gods. - Albert Einstein ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] MX5: Enable flat-device-tree support on mx53 loco board
Signed-off-by: Jason Liu jason@linaro.org --- Grant has submit one patchset: ARM device tree support improvements which remove device tree booting dependency on CONFIG_SYS_BOOTMAPSZ. Will provide patchset to clean CONFIG_SYS_BOOTMAPSZ after the patches applied to u-boot mainline --- Change log: v2: Fix the git commit log issue by move the Grant... below the S-O-B line --- include/configs/mx53loco.h |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h index 585e8c8..9c7dcc9 100644 --- a/include/configs/mx53loco.h +++ b/include/configs/mx53loco.h @@ -193,4 +193,7 @@ #define CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 +#define CONFIG_OF_LIBFDT +#define CONFIG_SYS_BOOTMAPSZ 0x80 + #endif /* __CONFIG_H */ -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] MX5: Enable flat-device-tree support on mx53 loco board
Hi, Wolfgang, On Tue, Mar 29, 2011 at 5:14 PM, Wolfgang Denk w...@denx.de wrote: Dear Jason Liu, In message 1301387516-18201-1-git-send-email-jason@linaro.org you wrote: --- Grant has submit one patchset: ARM device tree support improvements which remove device tree booting dependency on CONFIG_SYS_BOOTMAPSZ. Will provide patchset to clean CONFIG_SYS_BOOTMAPSZ after the patches applied to u-boot mainline Signed-off-by: Jason Liu jason@linaro.org --- include/configs/mx53loco.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) Please use git-format-patch to create patches. The initial --- line in your posting kills not only the comment (or should this go into the commit message?), but also your Signed-off-by line, so this would be missing in the commit. Please fix. My fault. I will submit v2 to fix it. Thanks, Jason Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Whoever undertakes to set himself up as a judge of Truth and Know- ledge is shipwrecked by the laughter of the gods. - Albert Einstein ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] ARM: Correct CONFIG_(SYS_)CONSOLE_INFO_QUIET rename ommissions
Correct some ommissions of renaming CONFIG_CONSOLE_INFO_QUIET to CONFIG_SYS_CONSOLE_INFO_QUIET Signed-off-by: Gray Remlin gryr...@gmail.com --- include/configs/edminiv2.h |2 +- include/configs/km_arm.h|2 +- include/configs/mv-common.h |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/configs/edminiv2.h b/include/configs/edminiv2.h index a75f06a..7d55db8 100644 --- a/include/configs/edminiv2.h +++ b/include/configs/edminiv2.h @@ -209,7 +209,7 @@ /* * Other required minimal configurations */ -#define CONFIG_CONSOLE_INFO_QUIET /* some code reduction */ +#define CONFIG_SYS_CONSOLE_INFO_QUIET /* Suppress console details at boot */ #define CONFIG_ARCH_CPU_INIT /* call arch_cpu_init() */ #define CONFIG_ARCH_MISC_INIT /* call arch_misc_init() */ #define CONFIG_DISPLAY_CPUINFO /* Display cpu info */ diff --git a/include/configs/km_arm.h b/include/configs/km_arm.h index bf77cc0..f5c7f53 100644 --- a/include/configs/km_arm.h +++ b/include/configs/km_arm.h @@ -112,7 +112,7 @@ /* * Other required minimal configurations */ -#define CONFIG_CONSOLE_INFO_QUIET /* some code reduction */ +#define CONFIG_SYS_CONSOLE_INFO_QUIET /* Suppress console details at boot */ #define CONFIG_ARCH_CPU_INIT /* call arch_cpu_init() */ #define CONFIG_ARCH_MISC_INIT /* call arch_misc_init() */ #define CONFIG_DISPLAY_CPUINFO /* Display cpu info */ diff --git a/include/configs/mv-common.h b/include/configs/mv-common.h index a8937dd..0cf6f1f 100644 --- a/include/configs/mv-common.h +++ b/include/configs/mv-common.h @@ -101,7 +101,7 @@ #define CONFIG_SYS_LONGHELP #define CONFIG_AUTO_COMPLETE #define CONFIG_CMDLINE_EDITING -#define CONFIG_CONSOLE_INFO_QUIET /* some code reduction */ +#define CONFIG_SYS_CONSOLE_INFO_QUIET /* Suppress console details at boot */ #define CONFIG_ARCH_CPU_INIT /* call arch_cpu_init() */ #define CONFIG_ARCH_MISC_INIT /* call arch_misc_init() */ #define CONFIG_BOARD_EARLY_INIT_F /* call board_init_f for early inits */ -- 1.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] using env import to import textfiles
Hi all, we currently try to remove some of our default environment and add this variables into textfiles which can be imported via env import -t ${loadaddr} ${filesize} One question to the textfiles. Should we add remarks to the environment variables inside the textfile in C-Syntax (/* bla */), first test shows that the import function works with this remarks . But whats the best way forward? Is this way ok or should we add into the directory where this scripts reside an additional README file where this variables are documented and remove the comments from the textfiles? Regards Holger Brunck ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] using env import to import textfiles
Dear Holger Brunck, In message 4d91b854.3010...@keymile.com you wrote: One question to the textfiles. Should we add remarks to the environment variables inside the textfile in C-Syntax (/* bla */), first test shows that the import function works with this remarks . But whats the best way forward? Is This is not supposed to work as you think it does - these comments will become part of the value of the respective environment variables. At the moment, environment import does not support any kind of comments, it's all raw data only. This could be changed, of course, if needed. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Minds are like parachutes - they only function when open. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Loading Ramdisk at particular address
Hi, I'm working on P2020 dual core bring up in AMP mode. Each core runs its own linux OS. Kernel image(gziped), ramdisk(gziped) and dtb are tftp-ed to below addresses: tftp 0x0a00 uImage.core1; tftp 0x0b00 ramdisk.small; tftp 0x0e00 p2020atv_camp_core1.dtb; I then bootm on loados,ramdisk and fdt. Later release the CPU 1, as shown below: interrupts off; bootm start 0xa00 0xb00 0xe00 bootm loados; bootm ramdisk; bootm fdt; fdt boardsetup; fdt chosen $initrd_start $initrd_end; bootm prep; cpu 1 release $bootm_low - $fdtaddr - When I 'bootm ramdisk' , UBOOT loads it at 0xdada000. How can I force the UBOOT to load the ramdisk at particular address for example to addres 0x0400? I tried setting initrd_start, rd_start. Found that initrd_start is actually returned by the UBOOT and setting rd_start also does not work. I'm new to board bring up activities. Is there any other variable that needs to be set? If there is any other mail chain which already talks about this, please point me to that. Thanks! Best Regards Prasanna Khanapur ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] using env import to import textfiles
Hello, Wolfgang Denk wrote: Dear Holger Brunck, In message 4d91b854.3010...@keymile.com you wrote: One question to the textfiles. Should we add remarks to the environment variables inside the textfile in C-Syntax (/* bla */), first test shows that the import function works with this remarks . But whats the best way forward? Is This is not supposed to work as you think it does - these comments will become part of the value of the respective environment variables. Ok. At the moment, environment import does not support any kind of comments, it's all raw data only. This could be changed, of course, if needed. no and I don't think it is really needed. Importing only the environment and not throwing afterwards unneeded parts from the textfile away seems to be more efficient. So we create an additional README file inside our scripts directory where this variables are documented. Thanks. Best regards Holger Brunck ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] without board level config.mk How to add CPPFLAGS
Dear zzs, In message 20110329012444.ga2...@greatfirst.com you wrote: And then how to do that thing : Append custom cpp flags to CPPFLAGS ? e.g. -Wcomments And after append them to CPPFLAGS, Does these flags appear in CFLAGS auto automatically ? Use CFLAGS_$(BCURDIR) if you want to set this for all files in a specific directory, or CFLAGS_$(BCURDIR)/$(@F) if you want to set this for a single file only. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Many aligators will be slain, but the swamp will remain. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ARM: Correct CONFIG_(SYS_)CONSOLE_INFO_QUIET rename ommissions
Hi Gray, Le 29/03/2011 12:15, Gray Remlin a écrit : Correct some ommissions of renaming CONFIG_CONSOLE_INFO_QUIET to CONFIG_SYS_CONSOLE_INFO_QUIET Signed-off-by: Gray Remlingryr...@gmail.com Tested-by: Albert ARIBAUD albert.arib...@free.fr (tested on ED Mini V2 only, as its maintainer) Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH RFC] Fix build problems caused by _end - __bss_end__ rename
Dear Albert ARIBAUD, In message 4d90ba8b.3080...@free.fr you wrote: Commit 44c6e65 rename _end to __bss_end__ broke building of a large number of systems (at least all PowerPC?): libstubs.o: In function `app_startup': examples/standalone/stubs.c:197: undefined reference to `__bss_end__' ... Hmm... The change from _end to __bss_end__ should not have been applied to the standalone apps, I believe. They are not compiled with start.S but with the standard lib, which will use _end. Good point. Will send an updated patch. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Any sufficiently advanced bug is indistinguishable from a feature. - Rich Kulawiec ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH RFC v2] Fix build problems caused by _end - __bss_end__ rename
Commit 44c6e65 rename _end to __bss_end__ broke building of a large number of systems (at least all PowerPC?): libstubs.o: In function `app_startup': examples/standalone/stubs.c:197: undefined reference to `__bss_end__' The rename should not be done for the files in the examples/standalone/ directory, as these are not using the code from start.S, but do their own BSS clearing, and either use their own linker scripts or the ones provided by the compilers. Signed-off-by: Wolfgang Denk w...@denx.de --- V2: Instead of messing with linker defines, revert the patch in question for the files in examples/standalone/ as suggested by Albert Aribaud. (Thanks!) examples/standalone/mips.lds |2 +- examples/standalone/sparc.lds |2 +- examples/standalone/stubs.c |4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/standalone/mips.lds b/examples/standalone/mips.lds index 68ae217..63a1c92 100644 --- a/examples/standalone/mips.lds +++ b/examples/standalone/mips.lds @@ -55,5 +55,5 @@ SECTIONS .sbss (NOLOAD) : { *(.sbss) } .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } - __bss_end__ = .; + _end = .; } diff --git a/examples/standalone/sparc.lds b/examples/standalone/sparc.lds index 7f060b6..9733daa 100644 --- a/examples/standalone/sparc.lds +++ b/examples/standalone/sparc.lds @@ -57,5 +57,5 @@ SECTIONS } . = ALIGN(4); __bss_end = .; - __bss_end__ = .; + _end = .; } diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c index 1379df7..2d2e709 100644 --- a/examples/standalone/stubs.c +++ b/examples/standalone/stubs.c @@ -187,14 +187,14 @@ void __attribute__((unused)) dummy(void) #include _exports.h } -extern unsigned long __bss_start, __bss_end__; +extern unsigned long __bss_start, _end; void app_startup(char * const *argv) { unsigned char * cp = (unsigned char *) __bss_start; /* Zero out BSS */ - while (cp (unsigned char *)__bss_end__) { + while (cp (unsigned char *)_end) { *cp++ = 0; } -- 1.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Please pull u-boot-mpc85xx.git (updated)
[ Pull in one other HW / SoC related fix in for v2011.03 ] The following changes since commit cb815e5ff979e36d68df130a810d34de4bf93289: Prepare v (2011-03-27 21:50:07 +0200) are available in the git repository at: git://git.denx.de/u-boot-mpc85xx.git master Jiang Yutang (1): powerpc/85xx: Enable various errata on P1022/P1013 SoCs Prabhakar Kushwaha (1): powerpc/85xx: Handle PCIe initialization requires for P1021 class SoCs arch/powerpc/cpu/mpc85xx/p1021_serdes.c | 49 - arch/powerpc/include/asm/config_mpc85xx.h | 10 ++ drivers/pci/fsl_pci_init.c|7 include/configs/P1022DS.h |1 + include/pci.h |1 + 5 files changed, 67 insertions(+), 1 deletions(-) ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] fix redundant environment for serial flash
This patch fixes problems in the handling of redundant environment in env_sf.c The major problem are double calls of free() on the allocated buffers, which damages the internal data of malloc and crashes on next call. In addition, the selection of the active environment had errors and compiler warnings, which are corrected by this patch. Signed-off-by: Thomas Langer thomas.lan...@lantiq.com --- This patch is done and tested against the version 2010.12 and applies also cleanly against the u-boot/master. --- a/common/env_sf.c +++ b/common/env_sf.c @@ -59,7 +59,6 @@ DECLARE_GLOBAL_DATA_PTR; extern uchar default_environment[]; char * env_name_spec = SPI Flash; -env_t *env_ptr; static struct spi_flash *env_flash; @@ -79,7 +78,7 @@ int saveenv(void) char*saved_buffer = NULL; u32 sector = 1; int ret; - charflag = OBSOLETE_FLAG, new_flag = ACTIVE_FLAG; + charflag = OBSOLETE_FLAG; if (!env_flash) { env_flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, @@ -159,7 +158,7 @@ int saveenv(void) gd-env_valid = (gd-env_valid == 2 ? 1 : 2); - printf(Valid environment: %d\n, gd-env_valid); + printf(Valid environment: %d\n, (int)gd-env_valid); done: if (saved_buffer) @@ -174,25 +173,20 @@ void env_relocate_spec(void) env_t *tmp_env1 = NULL; env_t *tmp_env2 = NULL; env_t *ep = NULL; - uchar flag1, flag2; - /* current_env is set only in case both areas are valid! */ - int current_env = 0; tmp_env1 = (env_t *)malloc(CONFIG_ENV_SIZE); tmp_env2 = (env_t *)malloc(CONFIG_ENV_SIZE); if (!tmp_env1 || !tmp_env2) { - free(tmp_env1); - free(tmp_env2); set_default_env(!malloc() failed); - return; + goto out; } env_flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS, CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE); if (!env_flash) { set_default_env(!spi_flash_probe() failed); - return; + goto out; } ret = spi_flash_read(env_flash, CONFIG_ENV_OFFSET, @@ -204,33 +198,30 @@ void env_relocate_spec(void) if (crc32(0, tmp_env1-data, ENV_SIZE) == tmp_env1-crc) crc1_ok = 1; - flag1 = tmp_env1-flags; ret = spi_flash_read(env_flash, CONFIG_ENV_OFFSET_REDUND, CONFIG_ENV_SIZE, tmp_env2); if (!ret) { if (crc32(0, tmp_env2-data, ENV_SIZE) == tmp_env2-crc) crc2_ok = 1; - flag2 = tmp_env2-flags; } if (!crc1_ok !crc2_ok) { - free(tmp_env1); - free(tmp_env2); set_default_env(!bad CRC); - return; + goto err_read; } else if (crc1_ok !crc2_ok) { gd-env_valid = 1; - ep = tmp_env1; } else if (!crc1_ok crc2_ok) { + gd-env_valid = 2; + } else if (tmp_env1-flags == ACTIVE_FLAG + tmp_env2-flags == OBSOLETE_FLAG) { gd-env_valid = 1; - } else if (flag1 == ACTIVE_FLAG flag2 == OBSOLETE_FLAG) { - gd-env_valid = 1; - } else if (flag1 == OBSOLETE_FLAG flag2 == ACTIVE_FLAG) { + } else if (tmp_env1-flags == OBSOLETE_FLAG + tmp_env2-flags == ACTIVE_FLAG) { gd-env_valid = 2; - } else if (flag1 == flag2) { + } else if (tmp_env1-flags == tmp_env2-flags) { gd-env_valid = 2; - } else if (flag1 == 0xFF) { + } else if (tmp_env1-flags == 0xFF) { gd-env_valid = 2; } else { /* @@ -240,8 +231,6 @@ void env_relocate_spec(void) gd-env_valid = 2; } - free(env_ptr); - if (gd-env_valid == 1) ep = tmp_env1; else @@ -257,10 +246,6 @@ err_read: spi_flash_free(env_flash); env_flash = NULL; out: - if (tmp_env1) - free(tmp_env1); - if (tmp_env2) - free(tmp_env2); free(tmp_env1); free(tmp_env2); ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/4] Kirkwood: Rename openrd_base board files to openrd.
-Original Message- From: Julian Pidancet [mailto:swaplin...@gmail.com] On Behalf Of julian.pidan...@citrix.com Sent: Friday, March 25, 2011 2:19 PM To: u-boot@lists.denx.de Cc: tanmay.upadh...@einfochips.com; Prafulla Wadaskar; Julian Pidancet Subject: [PATCH v2 1/4] Kirkwood: Rename openrd_base board files to openrd. From: Julian Pidancet julian.pidan...@citrix.com This patch renames openrd_base to openrd in order to add support for other boards of the OpenRD family in future commits. The openrd_base board name remain in use. Signed-off-by: Julian Pidancet julian.pidan...@citrix.com rename board/Marvell/{openrd_base = openrd}/Makefile (98%) rename board/Marvell/{openrd_base = openrd}/kwbimage.cfg (100%) rename board/Marvell/{openrd_base/openrd_base.c = openrd/openrd.c} (97%) rename board/Marvell/{openrd_base/openrd_base.h = openrd/openrd.h} (95%) create mode 100644 include/configs/openrd.h diff --git a/board/Marvell/openrd_base/Makefile b/board/Marvell/openrd/Makefile similarity index 98% rename from board/Marvell/openrd_base/Makefile rename to board/Marvell/openrd/Makefile index d6d0ed3..19020e4 100644 --- a/board/Marvell/openrd_base/Makefile +++ b/board/Marvell/openrd/Makefile @@ -31,7 +31,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).o -COBJS:= openrd_base.o +COBJS:= openrd.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/board/Marvell/openrd_base/kwbimage.cfg b/board/Marvell/openrd/kwbimage.cfg similarity index 100% rename from board/Marvell/openrd_base/kwbimage.cfg rename to board/Marvell/openrd/kwbimage.cfg diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd/openrd.c similarity index 97% rename from board/Marvell/openrd_base/openrd_base.c rename to board/Marvell/openrd/openrd.c index 10109c1..b395df7 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd/openrd.c @@ -31,7 +31,7 @@ #include miiphy.h #include asm/arch/kirkwood.h #include asm/arch/mpp.h -#include openrd_base.h +#include openrd.h DECLARE_GLOBAL_DATA_PTR; @@ -110,7 +110,7 @@ int board_init(void) /* * arch number of board */ - gd-bd-bi_arch_number = MACH_TYPE_OPENRD_BASE; + gd-bd-bi_arch_number = MACH_TYPE_OPENRD; NAK for this, the MACH_TYPE for any board is coming form external world. Tweaking it in u-boot is not recommended. You can have conditional code here to use different predefined MACH_TYPES instead of macros defining it. ...snip... diff --git a/boards.cfg b/boards.cfg index 45c3102..07c904b 100644 --- a/boards.cfg +++ b/boards.cfg @@ -96,7 +96,7 @@ davinci_sonata arm arm926ejs sonata davinci suen3arm arm926ejs km_arm keymilekirkwood guruplug arm arm926ejs - Marvellkirkwood mv88f6281gtw_ge arm arm926ejs - Marvellkirkwood -openrd_base arm arm926ejs - Marvellkirkwood +openrd_base arm arm926ejs openrd MarvellKirkwood You can pass additional options here to identify your board uniquely out of several supported boards (to be coming) For ex: +openrd_base arm arm926ejs openrd +MarvellKirkwoodopenrd_common:BOARD_IS_OPENRD_BASE This approach will help better way to add conditional code for other boards type For more details refer syntax in the top of this file. Regards.. Prafulla . . ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 2/4] Change OpenRD Base board identification string.
-Original Message- From: Julian Pidancet [mailto:swaplin...@gmail.com] On Behalf Of julian.pidan...@citrix.com Sent: Friday, March 25, 2011 2:19 PM To: u-boot@lists.denx.de Cc: tanmay.upadh...@einfochips.com; Prafulla Wadaskar; Julian Pidancet Subject: [PATCH v2 2/4] Change OpenRD Base board identification string. From: Julian Pidancet julian.pidan...@citrix.com Renamed from Openrd_base to OpenRD-Base Signed-off-by: Julian Pidancet julian.pidan...@citrix.com diff --git a/include/configs/openrd_base.h b/include/configs/openrd_base.h index 136d3bf..ba57d90 100644 --- a/include/configs/openrd_base.h +++ b/include/configs/openrd_base.h @@ -35,7 +35,7 @@ /* * Version number information */ -#define CONFIG_IDENT_STRING \nOpenRD_base +#define CONFIG_IDENT_STRING \nOpenRD-Base Ack Regards.. Prafulla . . ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 3/4] Add support for the Client variant of the OpenRD board.
-Original Message- From: Julian Pidancet [mailto:swaplin...@gmail.com] On Behalf Of julian.pidan...@citrix.com Sent: Friday, March 25, 2011 2:19 PM To: u-boot@lists.denx.de Cc: tanmay.upadh...@einfochips.com; Prafulla Wadaskar; Julian Pidancet Subject: [PATCH v2 3/4] Add support for the Client variant of the OpenRD board. From: Julian Pidancet julian.pidan...@citrix.com This patch takes care of initializing the second PHY of the OpenRD board. Signed-off-by: Julian Pidancet julian.pidan...@citrix.com create mode 100644 include/configs/openrd_client.h ...snip... --- /dev/null +++ b/include/configs/openrd_client.h @@ -0,0 +1,44 @@ +/* + * 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 Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#ifndef _CONFIG_OPENRD_CLIENT_H +#define _CONFIG_OPENRD_CLIENT_H + +#include configs/openrd.h + +/* + * Version number information + */ +#define CONFIG_IDENT_STRING \nOpenRD-Client + +/* Machine type */ +#define MACH_TYPE_OPENRD MACH_TYPE_OPENRD_CLIENT NAK for this Regards.. Prafulla . . ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V5 4/6] I2C: add i2c support for Pantheon platform
-Original Message- From: Lei Wen [mailto:lei...@marvell.com] Sent: Monday, March 28, 2011 12:24 PM To: Heiko Schocher; Prafulla Wadaskar; Wolfgang Denk; u- b...@lists.denx.de; Marek Vasut; Ashish Karkare; Prabhanjan Sarnaik; Yu Tang; adrian.w...@gmail.com Subject: [PATCH V5 4/6] I2C: add i2c support for Pantheon platform Add i2c support to dkb board with pantheon soc. Signed-off-by: Lei Wen lei...@marvell.com --- Changelog: V2: NO CHANGE V3: clean code sytle issue Add i2c clock enable code include in I2C configure define block V4: make i2c definition included in the ifdef V5: NO CHANGE arch/arm/cpu/arm926ejs/pantheon/cpu.c| 12 arch/arm/include/asm/arch-pantheon/cpu.h |4 +++- arch/arm/include/asm/arch-pantheon/mfp.h |6 -- board/Marvell/dkb/dkb.c |4 include/configs/dkb.h| 13 + 5 files changed, 36 insertions(+), 3 deletions(-) ...snip... diff --git a/include/configs/dkb.h b/include/configs/dkb.h index 638af5e..599c8b8 100644 --- a/include/configs/dkb.h +++ b/include/configs/dkb.h @@ -56,6 +56,19 @@ #include mv-common.h #undef CONFIG_ARCH_MISC_INIT + +/* + * I2C definition + */ +#define CONFIG_CMD_I2C This command definition should be moved up (below #include config_cmd_default.h Otherwise ack for rest of the code Regards.. Prafulla . . +#ifdef CONFIG_CMD_I2C +#define CONFIG_I2C_MV1 +#define CONFIG_PXA_I2C_REG 0xd4011000 +#define CONFIG_HARD_I2C 1 +#define CONFIG_SYS_I2C_SPEED 0 +#define CONFIG_SYS_I2C_SLAVE 0xfe +#endif + /* * Environment variables configurations */ -- 1.7.0.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V5 6/6] I2C: add i2c support for Armada100 platform
-Original Message- From: Lei Wen [mailto:lei...@marvell.com] Sent: Monday, March 28, 2011 12:24 PM To: Heiko Schocher; Prafulla Wadaskar; Wolfgang Denk; u- b...@lists.denx.de; Marek Vasut; Ashish Karkare; Prabhanjan Sarnaik; Yu Tang; adrian.w...@gmail.com Subject: [PATCH V5 6/6] I2C: add i2c support for Armada100 platform Add i2c support to aspenite board with Armada100 soc. Signed-off-by: Lei Wen lei...@marvell.com --- Changelog: V2: NO CHANGE V3: clean code sytle issue Add i2c clock enable code include in I2C configure define block V4: make i2c definition include in the ifdef V5: NO CHANGE arch/arm/cpu/arm926ejs/armada100/cpu.c| 16 +++ arch/arm/include/asm/arch-armada100/mfp.h | 40 -- --- board/Marvell/aspenite/aspenite.c |5 +++ include/configs/aspenite.h| 14 ++ 4 files changed, 57 insertions(+), 18 deletions(-) ...snip... /* + * I2C definition + */ +#define CONFIG_CMD_I2C 1 Same here, move up with other command configs. +#ifdef CONFIG_CMD_I2C +#define CONFIG_I2C_MV1 +#define CONFIG_PXA_I2C_NUM 2 +#define CONFIG_I2C_MULTI_BUS 1 +#define CONFIG_PXA_I2C_REG {0xd4011000, 0xd4025000} +#define CONFIG_HARD_I2C 1 +#define CONFIG_SYS_I2C_SPEED 0 +#define CONFIG_SYS_I2C_SLAVE 0xfe +#endif + +/* * Environment variables configurations */ #define CONFIG_ENV_IS_NOWHERE1 /* if env in SDRAM */ Regards.. Prafulla . . ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V5 3/6] mv_i2c: use structure to replace the direclty define
-Original Message- From: Lei Wen [mailto:lei...@marvell.com] Sent: Monday, March 28, 2011 12:24 PM To: Heiko Schocher; Prafulla Wadaskar; Wolfgang Denk; u- b...@lists.denx.de; Marek Vasut; Ashish Karkare; Prabhanjan Sarnaik; Yu Tang; adrian.w...@gmail.com Subject: [PATCH V5 3/6] mv_i2c: use structure to replace the direclty define Add i2c_clk_enable in the cpu specific code, since previous platform it, while new platform don't need. In the pantheon and armada100 platform, this function is defined as NULL one. Signed-off-by: Lei Wen lei...@marvell.com --- Changelog: V2: NO CHANGE V3: clean code sytle issue V4: V5: NO CHANGE arch/arm/cpu/pxa/cpu.c | 11 +++ arch/arm/include/asm/arch-pxa/pxa-regs.h | 56 - board/innokom/innokom.c |9 +-- drivers/i2c/mv_i2c.c | 131 ++- --- drivers/i2c/mv_i2c.h | 83 +++ include/configs/innokom.h|1 + include/configs/xm250.h |1 + 7 files changed, 159 insertions(+), 133 deletions(-) create mode 100644 drivers/i2c/mv_i2c.h ...snip... diff --git a/drivers/i2c/mv_i2c.c b/drivers/i2c/mv_i2c.c index 09756a4..734148b 100644 --- a/drivers/i2c/mv_i2c.c +++ b/drivers/i2c/mv_i2c.c @@ -8,6 +8,9 @@ * (C) Copyright 2003 Pengutronix e.K. * Robert Schwebel r.schwe...@pengutronix.de * + * (C) Copyright 2011 Marvell Inc. + * Lei Wen lei...@marvell.com + * * See file CREDITS for list of people who contributed to this * project. * @@ -34,24 +37,8 @@ #include asm/io.h #ifdef CONFIG_HARD_I2C - -/* - * - CONFIG_SYS_I2C_SPEED - * - I2C_PXA_SLAVE_ADDR - */ - -#include asm/arch/hardware.h -#include asm/arch/pxa-regs.h #include i2c.h - -#if (CONFIG_SYS_I2C_SPEED == 40) -#define I2C_ICR_INIT (ICR_FM | ICR_BEIE | ICR_IRFIE | ICR_ITEIE | ICR_GCD \ - | ICR_SCLE) -#else -#define I2C_ICR_INIT (ICR_BEIE | ICR_IRFIE | ICR_ITEIE | ICR_GCD | ICR_SCLE) -#endif - -#define I2C_ISR_INIT 0x7FF +#include mv_i2c.h #ifdef DEBUG_I2C #define PRINTD(x) printf x @@ -59,20 +46,6 @@ #define PRINTD(x) #endif -/* Shall the current transfer have a start/stop condition? */ -#define I2C_COND_NORMAL 0 -#define I2C_COND_START 1 -#define I2C_COND_STOP2 - -/* Shall the current transfer be ack/nacked or being waited for it? */ -#define I2C_ACKNAK_WAITACK 1 -#define I2C_ACKNAK_SENDACK 2 -#define I2C_ACKNAK_SENDNAK 4 - -/* Specify who shall transfer the data (master or slave) */ -#define I2C_READ 0 -#define I2C_WRITE1 - /* All transfers are described by this data structure */ struct i2c_msg { u8 condition; @@ -81,27 +54,37 @@ struct i2c_msg { u8 data; }; +struct pxa_i2c { + u32 ibmr; + u32 pad0; + u32 idbr; + u32 pad1; + u32 icr; + u32 pad2; + u32 isr; + u32 pad3; + u32 isar; +}; (Optional to implement) It is better if you can push register structure definition to the SoC specific header file, so that if there are new SoC that has different register structures that can be addressed cleanly. + +static struct pxa_i2c *base = (struct pxa_i2c *)CONFIG_PXA_I2C_REG; + /* * i2c_pxa_reset: - reset the host controller * */ static void i2c_reset(void) { - writel(readl(ICR) ~ICR_IUE, ICR); /* disable unit */ - writel(readl(ICR) | ICR_UR, ICR); /* reset the unit */ + andl(~ICR_IUE, base-icr); /* disable unit */ + orl(ICR_UR, base-icr);/* reset the unit */ Apart from discussion going on for patch - [PATCH V5.1 1/6] io: add and* and or* operation api to set and clear bit The original code looks more readable to me. udelay(100); - writel(readl(ICR) ~ICR_IUE, ICR); /* disable unit */ -#ifdef CONFIG_CPU_MONAHANS - /* | CKENB_1_PWM1 | CKENB_0_PWM0); */ - writel(readl(CKENB) | (CKENB_4_I2C), CKENB); -#else /* CONFIG_CPU_MONAHANS */ - /* set the global I2C clock on */ - writel(readl(CKEN) | CKEN14_I2C, CKEN); -#endif - writel(I2C_PXA_SLAVE_ADDR, ISAR); /* set our slave address */ - writel(I2C_ICR_INIT, ICR); /* set control reg values */ - writel(I2C_ISR_INIT, ISR); /* set clear interrupt bits */ - writel(readl(ICR) | ICR_IUE, ICR); /* enable unit */ + andl(~ICR_IUE, base-icr); /* disable unit */ + + i2c_clk_enable(); + + writel(CONFIG_SYS_I2C_SLAVE, base-isar);/* set our slave address */ + writel(I2C_ICR_INIT, base-icr); /* set control reg values */ Why don't you do I2C_ICR_INIT | ICR_IUE here and avoid orl below? + writel(I2C_ISR_INIT, base-isr); /* set clear interrupt bits */ + orl(ICR_IUE, base-icr); /* enable unit */ udelay(100); }
Re: [U-Boot] musb: usb storage: USB device not accepting new address error
Hi, Remy Bohmer-5 wrote: Have you tried 'git bisect' to find the offending patch already? I found the offending patch, it is the following commit that makes usb broken on OMAPL138. When i revert the patch the problem no more occurs. 3c0659b535b075be124c3d2a0714e55e65c46737 ARM: Avoid compiler optimization for readb, writeb and friends. I am working on a proper solution. Any help will be appreciated -- View this message in context: http://old.nabble.com/musb%3A-usb-storage%3A-USB-device-not-accepting-new-address-error-tp31245386p31267662.html Sent from the Uboot - Users mailing list archive at Nabble.com. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] arm imx35 timer failure
Hello, I'm developing a product based on the imx35 cpu with NOR and NAND flash. The SBC I use is the pcm-043 from Phytec. I use the FEC to communicate over the ethernet. I've made my own BSP for Das U-boot based on the release tagged v2011.03-rc2 on the git://git.denx.de/u-boot.git master repository. I've encountered one problem in uboot so that my board can work properly: This concerns the FEC autonegotiation timeout. I had some MDIO read an write and autonegotiation wait timeout failures. By debugging the problem I've found that the changes I've brought to the timer.c file (see patch below for arch/arm/cpu/arm1136/timer.c) of the imx35 cpu solves the problem. It seems that the return value of the get_timer_masked function is not given with the same unit as the input value for the get_timer function. It seems also to me that this value should be dependent of the CONFIG_SYS_HZ macro. Did anybody encountered this problem? Could you please tell me if there is really something wrong in timer.c file? Laurent Joye HaslerRail AG Bern, Switzerland Related patch: diff --git a/arch/arm/cpu/arm1136/mx35/timer.c b/arch/arm/cpu/arm1136/mx35/timer.c index db1e2c9..00ca3e6 100644 --- a/arch/arm/cpu/arm1136/mx35/timer.c +++ b/arch/arm/cpu/arm1136/mx35/timer.c @@ -70,7 +70,7 @@ inline ulong get_timer_masked(void) struct gpt_regs *gpt = (struct gpt_regs *)GPT1_BASE_ADDR; ulong val = readl(gpt-counter); - return val; + return val / CONFIG_SYS_HZ; } void reset_timer(void) @@ -84,12 +84,14 @@ ulong get_timer(ulong base) tmp = get_timer_masked(); - if (tmp = (base * 1000)) { + if (tmp base) { /* Overflow */ - tmp += (0x - base); + tmp = (0x - (base - tmp)); + } else { + tmp = tmp -base; } - return (tmp / 1000) - base; + return tmp; } void set_timer(ulong t) @@ -103,6 +105,7 @@ void set_timer(ulong t) void __udelay(unsigned long usec) { ulong tmp; + usec /= CONFIG_SYS_HZ; tmp = get_timer_masked(); /* get current timestamp */ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 0/4] Add DIG297 board and OMAP3 fixes
Hi all, here's a resubmit of the DIG297 board support with minor OMAP3 fixes. The board support is now working. It's always been working indeed, I was just doing the same mistake reported here: http://lists.denx.de/pipermail/u-boot/2011-March/089238.html. v3 just fixes little typos in the commit messages. The content is the same. Luca Ceresoli (4): ARMV7: OMAP3: Fix preprocessor check for CONFIG_OMAP34XX ARMV7: OMAP3: Remove unused variable boot_flash_env_addr ARMV7: OMAP3: boot_flash_env_addr should not be volatile ARMV7: OMAP3: Add support for Comelit DIG297 board Luca ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 1/4] ARMV7: OMAP3: Fix preprocessor check for CONFIG_OMAP34XX
CONFIG_OMAP34XX must be checked for existence, not value. Signed-off-by: Luca Ceresoli luca.ceres...@comelit.it Cc: Wolfgang Denk w...@denx.de Cc: Albert Aribaud albert.arib...@free.fr Cc: Sandeep Paulraj s-paul...@ti.com --- Changes in v2: - this patch is new in v2. Changes in v3: none. arch/arm/cpu/armv7/start.S |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S index d83d501..6387b8b 100644 --- a/arch/arm/cpu/armv7/start.S +++ b/arch/arm/cpu/armv7/start.S @@ -115,7 +115,7 @@ reset: orr r0, r0, #0xd3 msr cpsr,r0 -#if (CONFIG_OMAP34XX) +#if defined(CONFIG_OMAP34XX) /* Copy vectors to mask ROM indirect addr */ adr r0, _start @ r0 - current position of code add r0, r0, #4 @ skip reset vector -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 2/4] ARMV7: OMAP3: Remove unused variable boot_flash_env_addr
Signed-off-by: Luca Ceresoli luca.ceres...@comelit.it Cc: Wolfgang Denk w...@denx.de Cc: Albert Aribaud albert.arib...@free.fr Cc: Sandeep Paulraj s-paul...@ti.com --- Changes in v2: - this patch is new in v2. Changes in v3: none. include/configs/cm_t35.h|1 - include/configs/devkit8000.h|1 - include/configs/omap3_beagle.h |1 - include/configs/omap3_overo.h |1 - include/configs/omap3_pandora.h |1 - include/configs/omap3_sdp3430.h |1 - include/configs/omap3_zoom1.h |1 - include/configs/omap3_zoom2.h |1 - 8 files changed, 0 insertions(+), 8 deletions(-) diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h index 510c6d4..2c5f13b 100644 --- a/include/configs/cm_t35.h +++ b/include/configs/cm_t35.h @@ -326,7 +326,6 @@ #ifndef __ASSEMBLY__ extern unsigned int boot_flash_base; -extern volatile unsigned int boot_flash_env_addr; extern unsigned int boot_flash_off; extern unsigned int boot_flash_sec; extern unsigned int boot_flash_type; diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h index d898b77..060d7a6 100644 --- a/include/configs/devkit8000.h +++ b/include/configs/devkit8000.h @@ -301,7 +301,6 @@ #ifndef __ASSEMBLY__ extern unsigned int boot_flash_base; -extern volatile unsigned int boot_flash_env_addr; extern unsigned int boot_flash_off; extern unsigned int boot_flash_sec; extern unsigned int boot_flash_type; diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 5cfa4cb..d010ff7 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -322,7 +322,6 @@ #ifndef __ASSEMBLY__ extern unsigned int boot_flash_base; -extern volatile unsigned int boot_flash_env_addr; extern unsigned int boot_flash_off; extern unsigned int boot_flash_sec; extern unsigned int boot_flash_type; diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h index 1b3d439..1bf837e 100644 --- a/include/configs/omap3_overo.h +++ b/include/configs/omap3_overo.h @@ -287,7 +287,6 @@ #ifndef __ASSEMBLY__ extern unsigned int boot_flash_base; -extern volatile unsigned int boot_flash_env_addr; extern unsigned int boot_flash_off; extern unsigned int boot_flash_sec; extern unsigned int boot_flash_type; diff --git a/include/configs/omap3_pandora.h b/include/configs/omap3_pandora.h index 72b0cc2..2561428 100644 --- a/include/configs/omap3_pandora.h +++ b/include/configs/omap3_pandora.h @@ -276,7 +276,6 @@ #ifndef __ASSEMBLY__ extern unsigned int boot_flash_base; -extern volatile unsigned int boot_flash_env_addr; extern unsigned int boot_flash_off; extern unsigned int boot_flash_sec; extern unsigned int boot_flash_type; diff --git a/include/configs/omap3_sdp3430.h b/include/configs/omap3_sdp3430.h index 4708981..ad0d501 100644 --- a/include/configs/omap3_sdp3430.h +++ b/include/configs/omap3_sdp3430.h @@ -362,7 +362,6 @@ #ifndef __ASSEMBLY__ extern unsigned int boot_flash_base; -extern volatile unsigned int boot_flash_env_addr; extern unsigned int boot_flash_off; extern unsigned int boot_flash_sec; extern unsigned int boot_flash_type; diff --git a/include/configs/omap3_zoom1.h b/include/configs/omap3_zoom1.h index f7d0652..4cec6a9 100644 --- a/include/configs/omap3_zoom1.h +++ b/include/configs/omap3_zoom1.h @@ -301,7 +301,6 @@ #ifndef __ASSEMBLY__ extern unsigned int boot_flash_base; -extern volatile unsigned int boot_flash_env_addr; extern unsigned int boot_flash_off; extern unsigned int boot_flash_sec; extern unsigned int boot_flash_type; diff --git a/include/configs/omap3_zoom2.h b/include/configs/omap3_zoom2.h index 7377933..0736cef 100644 --- a/include/configs/omap3_zoom2.h +++ b/include/configs/omap3_zoom2.h @@ -268,7 +268,6 @@ #ifndef __ASSEMBLY__ extern unsigned int boot_flash_base; -extern volatile unsigned int boot_flash_env_addr; extern unsigned int boot_flash_off; extern unsigned int boot_flash_sec; extern unsigned int boot_flash_type; -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 3/4] ARMV7: OMAP3: boot_flash_env_addr should not be volatile
Signed-off-by: Luca Ceresoli luca.ceres...@comelit.it Cc: Wolfgang Denk w...@denx.de Cc: Albert Aribaud albert.arib...@free.fr Cc: Sandeep Paulraj s-paul...@ti.com --- Changes in v2: - this patch is new in v2. Changes in v3: none. arch/arm/cpu/armv7/omap3/mem.c |2 +- include/configs/am3517_evm.h |2 +- include/configs/omap3_evm.h|2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/cpu/armv7/omap3/mem.c b/arch/arm/cpu/armv7/omap3/mem.c index bd914b0..e9de05d 100644 --- a/arch/arm/cpu/armv7/omap3/mem.c +++ b/arch/arm/cpu/armv7/omap3/mem.c @@ -39,7 +39,7 @@ unsigned int boot_flash_base; unsigned int boot_flash_off; unsigned int boot_flash_sec; unsigned int boot_flash_type; -volatile unsigned int boot_flash_env_addr; +unsigned int boot_flash_env_addr; struct gpmc *gpmc_cfg; diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h index 70e8f07..bc2e8bb 100644 --- a/include/configs/am3517_evm.h +++ b/include/configs/am3517_evm.h @@ -325,7 +325,7 @@ #ifndef __ASSEMBLY__ extern unsigned int boot_flash_base; -extern volatile unsigned int boot_flash_env_addr; +extern unsigned int boot_flash_env_addr; extern unsigned int boot_flash_off; extern unsigned int boot_flash_sec; extern unsigned int boot_flash_type; diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h index 5bdb3fd..570e794 100644 --- a/include/configs/omap3_evm.h +++ b/include/configs/omap3_evm.h @@ -320,7 +320,7 @@ #ifndef __ASSEMBLY__ extern unsigned int boot_flash_base; -extern volatile unsigned int boot_flash_env_addr; +extern unsigned int boot_flash_env_addr; extern unsigned int boot_flash_off; extern unsigned int boot_flash_sec; extern unsigned int boot_flash_type; -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 4/4] ARMV7: OMAP3: Add support for Comelit DIG297 board
Board support for the DIG297 board manufactured by Comelit Group SpA. It is a custom board based on the BeagleBoard http://beagleboard.org/ by Texas Instruments. The board support is based on the BeagleBoard implementation. Signed-off-by: Luca Ceresoli luca.ceres...@comelit.it Cc: Wolfgang Denk w...@denx.de Cc: Albert Aribaud albert.arib...@free.fr Cc: Sandeep Paulraj s-paul...@ti.com --- MAINTAINERS |4 + MAKEALL |1 + board/comelit/dig297/Makefile | 49 ++ board/comelit/dig297/dig297.c | 174 +++ board/comelit/dig297/dig297.h | 380 + boards.cfg|1 + include/configs/dig297.h | 318 ++ 7 files changed, 927 insertions(+), 0 deletions(-) create mode 100644 board/comelit/dig297/Makefile create mode 100644 board/comelit/dig297/dig297.c create mode 100644 board/comelit/dig297/dig297.h create mode 100644 include/configs/dig297.h diff --git a/MAINTAINERS b/MAINTAINERS index 4756f14..d363710 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -599,6 +599,10 @@ Rick Bronson r...@efn.org AT91RM9200DKat91rm9200 +Luca Ceresoli luca.ceres...@comelit.it + + dig297 ARM ARMV7 (OMAP3530 SoC) + Po-Yu Chuang ratb...@faraday-tech.com a320evb FA526 (ARM920T-like) (a320 SoC) diff --git a/MAKEALL b/MAKEALL index a732e6a..3e28e64 100755 --- a/MAKEALL +++ b/MAKEALL @@ -425,6 +425,7 @@ LIST_ARMV7=\ igep0030\ mx51evk \ omap3_beagle\ + dig297 \ omap3_overo \ omap3_evm \ omap3_pandora \ diff --git a/board/comelit/dig297/Makefile b/board/comelit/dig297/Makefile new file mode 100644 index 000..8dffedd --- /dev/null +++ b/board/comelit/dig297/Makefile @@ -0,0 +1,49 @@ +# +# (C) Copyright 2000, 2001, 2002 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS := dig297.o + +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +$(LIB):$(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +clean: + rm -f $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak $(obj).depend + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/comelit/dig297/dig297.c b/board/comelit/dig297/dig297.c new file mode 100644 index 000..4d4ab5f --- /dev/null +++ b/board/comelit/dig297/dig297.c @@ -0,0 +1,174 @@ +/* + * (C) Copyright 2011 Comelit Group SpA + * Luca Ceresoli luca.ceres...@comelit.it + * + * Based on board/ti/beagle/beagle.c: + * (C) Copyright 2004-2008 + * Texas Instruments, www.ti.com + * + * Author : + * Sunil Kumar sunilsain...@gmail.com + * Shashi Ranjan shashiranjanmc...@gmail.com + * + * Derived from Beagle Board and 3430 SDP code by + * Richard Woodruff r-woodru...@ti.com + * Syed Mohammed Khasim kha...@ti.com + * + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ +#include common.h +#include netdev.h +#include twl4030.h +#include asm/io.h +#include asm/arch/mux.h
[U-Boot] Booting kernel from NAND flash on AT91SAM9 custom board using fsload
Hello, I've designed a custom circuit board based around the AT91SAM9RL64 processor from Atmel. This is an ARM9 AT91SAM9 series chip. The Atmel evaluation kit for this processor is supported by U-Boot, and the configuration header file can be found in the u-boot-2010.09 source code distribution (/include/configs/at91sam9rlek.h). To support my custom hardware, I've made small changes to the /include/configs/at91sam9rlek.h configuration file and to the files in the /board/atmel/at91sam9rlek/ directory. On my custom circuit board, the AT91bootstrap first-order bootloader is loaded from SPI Dataflash. In turn, the AT91bootstrap code loads U-Boot to SDRAM memory and then jumps to the load address. The U-Boot binary is also stored on SPI dataflash. I am able to successfully load U-Boot on my custom hardware, and I am able to use the nand subsystem commands to access the NAND flash. I would like to use the fsload command to load the Linux kernel from a JFFS2 filesystem written to the NAND flash, but to me it is not immediately clear what I need to modify in the U-Boot code to be able to do this. Perhaps the YAFFS filesystem would be more appropriate? I've found several mailing list threads on a related question, but I still can't determine how to boot from NAND flash. Does fsload only support NOR flash, or is it possible to use fsload on NAND flash? [1] http://lists.denx.de/pipermail/u-boot/2007-December/027578.html [2] http://www.mail-archive.com/u-boot@lists.denx.de/msg28173.html [3] http://old.nabble.com/NAND-boot-from-file-td7930776.html [4] http://blackfin.uclinux.org/gf/project/u-boot/forum/?_forum_action=ForumMessageBrowsethread_id=17711action=ForumBrowse As suggested in thread [4] above, I tried replacing jffs2_1pass.c with jffs2_nand_1pass.c in the fs/jffs2 directory. Also as instructed in the README.NAND, README.JFFS2 and README.JFFS2_NAND files found in the /doc/ directory, I've tried defining the following in my /include/configs/at91sam9rlek.h configuration file: #define CONFIG_JFFS2_NAND 1 #define CONFIG_CMD_JFFS2 #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_CMD_NAND1 However, after making these changes, the compilation process does not work, with the following error being reported: make[1]: Entering directory `/home/nkinar/DEVICE-CODE/uboot/u-boot-2010.09/common' arm-none-linux-gnueabi-gcc -g -Os -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -DTEXT_BASE=0x23f0 -I/home/nkinar/DEVICE-CODE/uboot/u-boot-2010.09/include -fno-builtin -ffreestanding -nostdinc -isystem /home/nkinar/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.5.1/include -pipe -DCONFIG_ARM -D__ARM__ -marm -mabi=aapcs-linux -mno-thumb-interwork -march=armv5te -Wall -Wstrict-prototypes -fno-stack-protector \ -o cmd_jffs2.o cmd_jffs2.c -c cmd_jffs2.c: In function 'mtd_device_validate': cmd_jffs2.c:172:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'flash_info' cmd_jffs2.c:172:24: error: 'flash_info' undeclared (first use in this function) cmd_jffs2.c:172:24: note: each undeclared identifier is reported only once for each function it appears in cmd_jffs2.c:172:35: error: expected expression before ']' token cmd_jffs2.c: In function 'get_part_sector_size_nor': cmd_jffs2.c:275:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'flash_info' cmd_jffs2.c:275:22: error: 'flash_info' undeclared (first use in this function) cmd_jffs2.c:275:33: error: expected expression before ']' token cmd_jffs2.c:279:2: error: 'flash_info_t' undeclared (first use in this function) cmd_jffs2.c:279:16: error: 'flash' undeclared (first use in this function) make[1]: *** [cmd_jffs2.o] Error 1 make[1]: Leaving directory `/home/nkinar/DEVICE-CODE/uboot/u-boot-2010.09/common' make: *** [common/libcommon.a] Error 2 What do I need to update in U-Boot to be able to use fsload on my custom hardware? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Booting kernel from NAND flash on AT91SAM9 custom board using fsload
On 29/03/2011 10:14 AM, Nicholas Kinar wrote: Also as instructed in the README.NAND, README.JFFS2 and README.JFFS2_NAND files found in the /doc/ directory, I've tried defining the following in my /include/configs/at91sam9rlek.h configuration file: #define CONFIG_JFFS2_NAND 1 #define CONFIG_CMD_JFFS2 #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_CMD_NAND1 I've now added the following #undef to the list of defines above: #undef CONFIG_CMD_FLASH Now after typing help at the U-Boot command line, I can finally see the fsload command listed. However running fsload gives the following error: U-Boot fsload support for FLASH devices not present incorrect device: nor0 This appears to be due to some code in the /common/cmd_jffs2.c file. Can fsload be only used for NOR memory, or is there a way to use it for NAND flash as well? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Booting kernel from NAND flash on AT91SAM9 custom board using fsload
On Tue, 29 Mar 2011 11:37:25 -0600 Nicholas Kinar n.ki...@usask.ca wrote: On 29/03/2011 10:14 AM, Nicholas Kinar wrote: Also as instructed in the README.NAND, README.JFFS2 and README.JFFS2_NAND files found in the /doc/ directory, I've tried defining the following in my /include/configs/at91sam9rlek.h configuration file: #define CONFIG_JFFS2_NAND 1 #define CONFIG_CMD_JFFS2 #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_CMD_NAND1 I've now added the following #undef to the list of defines above: #undef CONFIG_CMD_FLASH Now after typing help at the U-Boot command line, I can finally see the fsload command listed. However running fsload gives the following error: U-Boot fsload support for FLASH devices not present incorrect device: nor0 This appears to be due to some code in the /common/cmd_jffs2.c file. Can fsload be only used for NOR memory, or is there a way to use it for NAND flash as well? support for FLASH devices not present is printed when it's trying to act on a device labelled as NOR, but there's no NOR support present. Try the chpart command to switch to a NAND device, and/or make sure that your mtdparts variable is set correctly. -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V4 1/6] io: add and* and or* operation api to set and clear bit
On Tue, 29 Mar 2011 10:47:04 +0800 Lei Wen adrian.w...@gmail.com wrote: Hi Scott, On Tue, Mar 29, 2011 at 12:05 AM, Scott Wood scottw...@freescale.com wrote: What does this do that setbits*/clrbits* don't? Those and*/or* include the dmb() operation included in the read*/write*, which is not included in the __raw_read*/__raw_write* that setbits*/clrbits* refer to. I think it's better to keep another instance to set the bit, since there is read* and __raw_read* exist and have difference. But why are setbits/clrbits using raw accesses? That's not how they're defined on powerpc, which is where these accessors originated. I suspect they were defined that way out of laziness from before ARM made a distinction between raw and non-raw accessors, and it is now a bug in setbits/clrbits (and out_be*, in_le*, etc) which should be fixed rather than introducing an alternative. And then if you want a raw version of these functions, introduce raw_setbits_le32, raw_in_le16, etc. -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/7] tsec: use IO accessories to access the register
From: Mingkai Hu mingkai...@freescale.com Signed-off-by: Mingkai Hu mingkai...@freescale.com Acked-by: Andy Fleming aflem...@freescale.com Signed-off-by: Kumar Gala ga...@kernel.crashing.org --- drivers/net/tsec.c | 234 ++- include/tsec.h |8 +- 2 files changed, 123 insertions(+), 119 deletions(-) diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 9c8fe62..1665174 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -5,7 +5,7 @@ * terms of the GNU Public License, Version 2, incorporated * herein by reference. * - * Copyright 2004-2010 Freescale Semiconductor, Inc. + * Copyright 2004-2011 Freescale Semiconductor, Inc. * (C) Copyright 2003, Motorola, Inc. * author Andy Fleming * @@ -50,7 +50,7 @@ static int tsec_recv(struct eth_device *dev); static int tsec_init(struct eth_device *dev, bd_t * bd); static int tsec_initialize(bd_t * bis, struct tsec_info_struct *tsec_info); static void tsec_halt(struct eth_device *dev); -static void init_registers(volatile tsec_t * regs); +static void init_registers(tsec_t * regs); static void startup_tsec(struct eth_device *dev); static int init_phy(struct eth_device *dev); void write_phy_reg(struct tsec_private *priv, uint regnum, uint value); @@ -166,9 +166,9 @@ static int tsec_initialize(bd_t * bis, struct tsec_info_struct *tsec_info) eth_register(dev); /* Reset the MAC */ - priv-regs-maccfg1 |= MACCFG1_SOFT_RESET; + setbits_be32(priv-regs-maccfg1, MACCFG1_SOFT_RESET); udelay(2); /* Soft Reset must be asserted for 3 TX clocks */ - priv-regs-maccfg1 = ~(MACCFG1_SOFT_RESET); + clrbits_be32(priv-regs-maccfg1, MACCFG1_SOFT_RESET); #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \ !defined(BITBANGMII) @@ -190,16 +190,16 @@ static int tsec_init(struct eth_device *dev, bd_t * bd) char tmpbuf[MAC_ADDR_LEN]; int i; struct tsec_private *priv = (struct tsec_private *)dev-priv; - volatile tsec_t *regs = priv-regs; + tsec_t *regs = priv-regs; /* Make sure the controller is stopped */ tsec_halt(dev); /* Init MACCFG2. Defaults to GMII */ - regs-maccfg2 = MACCFG2_INIT_SETTINGS; + out_be32(regs-maccfg2, MACCFG2_INIT_SETTINGS); /* Init ECNTRL */ - regs-ecntrl = ECNTRL_INIT_SETTINGS; + out_be32(regs-ecntrl, ECNTRL_INIT_SETTINGS); /* Copy the station address into the address registers. * Backwards, because little endian MACS are dumb */ @@ -209,11 +209,11 @@ static int tsec_init(struct eth_device *dev, bd_t * bd) tempval = (tmpbuf[0] 24) | (tmpbuf[1] 16) | (tmpbuf[2] 8) | tmpbuf[3]; - regs-macstnaddr1 = tempval; + out_be32(regs-macstnaddr1, tempval); tempval = *((uint *) (tmpbuf + 4)); - regs-macstnaddr2 = tempval; + out_be32(regs-macstnaddr2, tempval); /* reset the indices to zero */ rxIdx = 0; @@ -230,17 +230,17 @@ static int tsec_init(struct eth_device *dev, bd_t * bd) } /* Writes the given phy's reg with value, using the specified MDIO regs */ -static void tsec_local_mdio_write(volatile tsec_mdio_t *phyregs, uint addr, +static void tsec_local_mdio_write(tsec_mdio_t *phyregs, uint addr, uint reg, uint value) { int timeout = 100; - phyregs-miimadd = (addr 8) | reg; - phyregs-miimcon = value; + out_be32(phyregs-miimadd, (addr 8) | reg); + out_be32(phyregs-miimcon, value); asm(sync); timeout = 100; - while ((phyregs-miimind MIIMIND_BUSY) timeout--) ; + while ((in_be32(phyregs-miimind) MIIMIND_BUSY) timeout--) ; } @@ -254,28 +254,27 @@ static void tsec_local_mdio_write(volatile tsec_mdio_t *phyregs, uint addr, * notvalid bit cleared), and the bus to cease activity (miimind * busy bit cleared), and then returns the value */ -static uint tsec_local_mdio_read(volatile tsec_mdio_t *phyregs, - uint phyid, uint regnum) +static uint tsec_local_mdio_read(tsec_mdio_t *phyregs, uint phyid, uint regnum) { uint value; /* Put the address of the phy, and the register * number into MIIMADD */ - phyregs-miimadd = (phyid 8) | regnum; + out_be32(phyregs-miimadd, (phyid 8) | regnum); /* Clear the command register, and wait */ - phyregs-miimcom = 0; + out_be32(phyregs-miimcom, 0); asm(sync); /* Initiate a read command, and wait */ - phyregs-miimcom = MIIM_READ_COMMAND; + out_be32(phyregs-miimcom, MIIM_READ_COMMAND); asm(sync); /* Wait for the the indication that the read is done */ - while ((phyregs-miimind (MIIMIND_NOTVALID | MIIMIND_BUSY))) ; + while ((in_be32(phyregs-miimind) (MIIMIND_NOTVALID | MIIMIND_BUSY))) ; /* Grab the value read from the PHY */ - value =
[U-Boot] [PATCH 4/7] Create PHY Lib for U-Boot
Extends the mii_dev structure to participate in a full-blown MDIO and PHY driver scheme. The mii_dev structure and miiphy calls are modified in such a way to allow the original mii command and miiphy infrastructure to work as before, but also to support a new set of APIs which allow (among other things) sharing of PHY driver code and 10G support The mii command will continue to support normal PHY management functions (Clause 22 of 802.3), but will not be changed to support 10G (Clause 45). The basic design is similar to PHY Lib from Linux, but simplified for U-Boot's network and driver infrastructure. We now have MDIO drivers and PHY drivers An MDIO driver provides: read write reset A PHY driver provides: (optionally): probe config - initial setup, starting of auto-negotiation startup - waiting for AN, and reading link state shutdown - any cleanup needed The ethernet drivers interact with the PHY Lib using these functions: phy_connect() phy_config() phy_startup() phy_shutdown() Each PHY driver can be configured separately, or all at once using phylib_all_drivers.h (added in the patch which adds the drivers) Signed-off-by: Andy Fleming aflem...@freescale.com --- common/Makefile |1 + common/miiphyutil.c | 173 ++-- drivers/net/phy/Makefile |1 + drivers/net/phy/phy.c| 705 ++ include/miiphy.h | 31 ++ include/phy.h| 487 net/eth.c|6 + 7 files changed, 1375 insertions(+), 29 deletions(-) create mode 100644 drivers/net/phy/phy.c create mode 100644 include/phy.h diff --git a/common/Makefile b/common/Makefile index 048df0c..00847ef 100644 --- a/common/Makefile +++ b/common/Makefile @@ -114,6 +114,7 @@ COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o COBJS-$(CONFIG_CMD_MG_DISK) += cmd_mgdisk.o COBJS-$(CONFIG_MII) += miiphyutil.o COBJS-$(CONFIG_CMD_MII) += miiphyutil.o +COBJS-$(CONFIG_PHYLIB) += miiphyutil.o COBJS-$(CONFIG_CMD_MII) += cmd_mii.o COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o diff --git a/common/miiphyutil.c b/common/miiphyutil.c index e282096..e79c639 100644 --- a/common/miiphyutil.c +++ b/common/miiphyutil.c @@ -28,6 +28,7 @@ #include common.h #include miiphy.h +#include phy.h #include asm/types.h #include linux/list.h @@ -44,22 +45,13 @@ #define debug(fmt,args...) #endif /* MII_DEBUG */ -struct mii_dev { - struct list_head link; - const char *name; - int (*read) (const char *devname, unsigned char addr, -unsigned char reg, unsigned short *value); - int (*write) (const char *devname, unsigned char addr, - unsigned char reg, unsigned short value); -}; - static struct list_head mii_devs; static struct mii_dev *current_mii; /* * Lookup the mii_dev struct by the registered device name. */ -static struct mii_dev *miiphy_get_dev_by_name(const char *devname, int quiet) +struct mii_dev *miiphy_get_dev_by_name(const char *devname) { struct list_head *entry; struct mii_dev *dev; @@ -75,8 +67,6 @@ static struct mii_dev *miiphy_get_dev_by_name(const char *devname, int quiet) return dev; } - if (!quiet) - printf(No such device: %s\n, devname); return NULL; } @@ -90,6 +80,25 @@ void miiphy_init(void) current_mii = NULL; } +static int legacy_miiphy_read(struct mii_dev *bus, int addr, int devad, int reg) +{ + unsigned short val; + int ret; + struct legacy_mii_dev *ldev = bus-priv; + + ret = ldev-read(bus-name, addr, reg, val); + + return ret ? -1 : (int)val; +} + +static int legacy_miiphy_write(struct mii_dev *bus, int addr, int devad, + int reg, u16 val) +{ + struct legacy_mii_dev *ldev = bus-priv; + + return ldev-write(bus-name, addr, reg, val); +} + /* * * Register read and write MII access routines for the device name. @@ -101,11 +110,12 @@ void miiphy_register(const char *name, unsigned char reg, unsigned short value)) { struct mii_dev *new_dev; + struct legacy_mii_dev *ldev; unsigned int name_len; char *new_name; /* check if we have unique name */ - new_dev = miiphy_get_dev_by_name(name, 1); + new_dev = miiphy_get_dev_by_name(name); if (new_dev) { printf(miiphy_register: non unique device name '%s'\n, name); return; @@ -113,10 +123,10 @@ void miiphy_register(const char *name, /* allocate memory */ name_len = strlen (name); - new_dev = - (struct mii_dev *)malloc (sizeof (struct mii_dev) + name_len + 1); + new_dev = malloc (sizeof (struct mii_dev) + name_len + 1); + ldev = malloc (sizeof (*ldev)); - if
[U-Boot] [PATCH-v2] fat32 root directory handling
From: Erik Hansen e...@makarta.com Fat directory handling didn't check reaching the end of the root directory. It relied on a stop condition based on a directory entry with a name starting with a '\0' character. This check in itself is wrong ('\0' indicates free entry, not end_of_directory) but outside the scope of this fix. For FAT32, the end of the rootdir is reached when the end of the cluster chain is reached. The code didn't check this condition and started to read an incorrect cluster. This caused a subsequent read request of a sector outside the range of the usb stick in use. On its turn, the usb stick protested with a stall handshake. Both FAT32 and non-FAT32 (FAT16/FAT12) end or rootdir checks have been put in. Signed-off-by: Erik Hansen e...@makarta.com Signed-off-by: Remy Bohmer li...@bohmer.net --- V2: Removed added new line I pick this patch up from here since this patch fixes a long standing issue we have with several USB sticks. fs/fat/fat.c | 37 +++-- 1 files changed, 23 insertions(+), 14 deletions(-) diff --git a/fs/fat/fat.c b/fs/fat/fat.c index a75e4f2..c450bf6 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -209,7 +209,7 @@ static __u32 get_fatent (fsdata *mydata, __u32 entry) /* Read a new block of FAT entries into the cache. */ if (bufnum != mydata-fatbufnum) { - int getsize = FATBUFSIZE / FS_BLOCK_SIZE; + __u32 getsize = FATBUFSIZE / FS_BLOCK_SIZE; __u8 *bufptr = mydata-fatbuf; __u32 fatlength = mydata-fatlength; __u32 startblock = bufnum * FATBUFBLOCKS; @@ -279,7 +279,7 @@ static int get_cluster (fsdata *mydata, __u32 clustnum, __u8 *buffer, unsigned long size) { - int idx = 0; + __u32 idx = 0; __u32 startsect; if (clustnum 0) { @@ -767,12 +767,13 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize, dir_entry *dentptr; __u16 prevcksum = 0x; char *subname = ; - int cursect; + __u32 cursect; int idx, isdir = 0; int files = 0, dirs = 0; long ret = 0; int firsttime; - int root_cluster; + __u32 root_cluster; + int rootdir_size = 0; int j; if (read_bootsectandvi(bs, volinfo, mydata-fatsize)) { @@ -798,8 +799,6 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize, mydata-data_begin = mydata-rootdir_sect - (mydata-clust_size * 2); } else { - int rootdir_size; - rootdir_size = ((bs.dir_entries[1] * (int)256 + bs.dir_entries[0]) * sizeof(dir_entry)) / @@ -1006,20 +1005,18 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize, * root directory clusters when a cluster has been * completely processed. */ - if ((mydata-fatsize == 32) (++j == mydata-clust_size)) { - int nxtsect; - int nxt_clust; + ++j; + int fat32_end = 0; + if ((mydata-fatsize == 32) (j == mydata-clust_size)) { + int nxtsect = 0; + int nxt_clust = 0; nxt_clust = get_fatent(mydata, root_cluster); + fat32_end = CHECK_CLUST(nxt_clust, 32); nxtsect = mydata-data_begin + (nxt_clust * mydata-clust_size); - debug(END LOOP: sect=%d, root_clust=%d, - n_sect=%d, n_clust=%d\n, - cursect, root_cluster, - nxtsect, nxt_clust); - root_cluster = nxt_clust; cursect = nxtsect; @@ -1027,6 +1024,18 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize, } else { cursect++; } + + /* If end of rootdir reached */ + if ((mydata-fatsize == 32 fat32_end) || + (mydata-fatsize != 32 j == rootdir_size)) { + if (dols == LS_ROOT) { + printf(\n%d file(s), %d dir(s)\n\n, + files, dirs); + return 0; + } else { + return -1; + } + } } rootdir_done: -- 1.7.4.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] Kirkwood: SATA supports only one device per bus
Change CONFIG_SYS_IDE_MAXDEVICE from 2 to 1 Signed-off-by: Gray Remlin gryr...@gmail.com --- arch/arm/include/asm/arch-kirkwood/config.h |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/arm/include/asm/arch-kirkwood/config.h b/arch/arm/include/asm/arch-kirkwood/config.h index 71ba464..f582ba4 100644 --- a/arch/arm/include/asm/arch-kirkwood/config.h +++ b/arch/arm/include/asm/arch-kirkwood/config.h @@ -128,7 +128,8 @@ #define CONFIG_LBA48 /* CONFIG_CMD_IDE requires some #defines for ATA registers */ #define CONFIG_SYS_IDE_MAXBUS 2 -#define CONFIG_SYS_IDE_MAXDEVICE 2 +/* Only one device per bus on SATA */ +#define CONFIG_SYS_IDE_MAXDEVICE 1 /* ATA registers base is at SATA controller base */ #define CONFIG_SYS_ATA_BASE_ADDR MV_SATA_BASE #endif /* CONFIG_CMD_IDE */ -- 1.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RFC 0/7] Universal PHY Infrastructure
Or PHY Lib for U-Boot. This sequence of patches adds infrastructure for universally-available PHY drivers (and MDIO drivers). It piggy-backs on the existing miiphy code, for backwards compatibility, but it also creates a new set of APIs. This was necessary partly to provide cleaner interfaces for more robust driver support, and partly because one goal was to support 10G (802.3 Clause 45) MDIO buses, which has an extra argument for addressing PHY registers. The first three patches clear the way, and are in this sequence mostly because the tsec changes depend on them. Special thanks goes to Mingkai Hu, who did a substantial amount of work up front to convert the tsec PHY code into something more usable, which I have mostly copied for the purposes of PHY Lib. As the subject says, these are submitted here for comment. I hope they will go in for the presumptive June release. Andy Fleming (5): Remove instances of phy_read/write Create PHY Lib for U-Boot Add mdio command for new PHY infrastructure phylib: Add a bunch of PHY drivers from tsec tsec: Convert tsec to use PHY Lib Mingkai Hu (2): tsec: use IO accessories to access the register tsec: arrange the code to avoid useless function declaration arch/powerpc/include/asm/config.h |7 + arch/powerpc/include/asm/fsl_enet.h | 10 + board/freescale/mpc837xemds/mpc837xemds.c |7 + board/freescale/mpc8536ds/mpc8536ds.c |6 + board/freescale/mpc8544ds/mpc8544ds.c | 30 + board/freescale/mpc8572ds/mpc8572ds.c |6 + board/freescale/p1022ds/p1022ds.c |6 + board/freescale/p1_p2_rdb/p1_p2_rdb.c |6 + board/freescale/p2020ds/p2020ds.c |7 + common/Makefile |4 + common/cmd_mdio.c | 293 + common/miiphyutil.c | 173 +++- drivers/net/Makefile |2 +- drivers/net/dm9000x.c | 18 +- drivers/net/enc28j60.c| 24 +- drivers/net/fsl_mdio.c| 117 ++ drivers/net/phy/Makefile | 11 + drivers/net/phy/atheros.c | 37 + drivers/net/phy/broadcom.c| 275 drivers/net/phy/davicom.c | 86 ++ drivers/net/phy/lxt.c | 76 ++ drivers/net/phy/marvell.c | 357 ++ drivers/net/phy/micrel.c | 29 + drivers/net/phy/natsemi.c | 85 ++ drivers/net/phy/phy.c | 733 +++ drivers/net/phy/realtek.c | 120 ++ drivers/net/phy/teranetics.c | 43 + drivers/net/phy/vitesse.c | 330 + drivers/net/tsec.c| 1966 - drivers/net/uli526x.c | 24 +- drivers/qe/uec.c |3 - drivers/qe/uec_phy.c | 145 ++-- include/fsl_mdio.h| 62 + include/miiphy.h | 31 + include/phy.h | 498 include/phylib_all_drivers.h | 25 + include/tsec.h| 302 + net/eth.c |6 + 38 files changed, 3860 insertions(+), 2100 deletions(-) create mode 100644 common/cmd_mdio.c create mode 100644 drivers/net/fsl_mdio.c create mode 100644 drivers/net/phy/atheros.c create mode 100644 drivers/net/phy/broadcom.c create mode 100644 drivers/net/phy/davicom.c create mode 100644 drivers/net/phy/lxt.c create mode 100644 drivers/net/phy/marvell.c create mode 100644 drivers/net/phy/micrel.c create mode 100644 drivers/net/phy/natsemi.c create mode 100644 drivers/net/phy/phy.c create mode 100644 drivers/net/phy/realtek.c create mode 100644 drivers/net/phy/teranetics.c create mode 100644 drivers/net/phy/vitesse.c create mode 100644 include/fsl_mdio.h create mode 100644 include/phy.h create mode 100644 include/phylib_all_drivers.h ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/7] tsec: arrange the code to avoid useless function declaration
From: Mingkai Hu mingkai...@freescale.com Signed-off-by: Mingkai Hu mingkai...@freescale.com Acked-by: Andy Fleming aflem...@freescale.com Signed-off-by: Kumar Gala ga...@kernel.crashing.org --- drivers/net/tsec.c | 857 +--- 1 files changed, 416 insertions(+), 441 deletions(-) diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 1665174..f563d34 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -44,31 +44,6 @@ static RTXBD rtx __attribute__ ((aligned(8))); #error rtx must be 64-bit aligned #endif -static int tsec_send(struct eth_device *dev, -volatile void *packet, int length); -static int tsec_recv(struct eth_device *dev); -static int tsec_init(struct eth_device *dev, bd_t * bd); -static int tsec_initialize(bd_t * bis, struct tsec_info_struct *tsec_info); -static void tsec_halt(struct eth_device *dev); -static void init_registers(tsec_t * regs); -static void startup_tsec(struct eth_device *dev); -static int init_phy(struct eth_device *dev); -void write_phy_reg(struct tsec_private *priv, uint regnum, uint value); -uint read_phy_reg(struct tsec_private *priv, uint regnum); -static struct phy_info *get_phy_info(struct eth_device *dev); -static void phy_run_commands(struct tsec_private *priv, struct phy_cmd *cmd); -static void adjust_link(struct eth_device *dev); -#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \ -!defined(BITBANGMII) -static int tsec_miiphy_write(const char *devname, unsigned char addr, -unsigned char reg, unsigned short value); -static int tsec_miiphy_read(const char *devname, unsigned char addr, - unsigned char reg, unsigned short *value); -#endif -#ifdef CONFIG_MCAST_TFTP -static int tsec_mcast_addr (struct eth_device *dev, u8 mcast_mac, u8 set); -#endif - /* Default initializations for TSEC controllers. */ static struct tsec_info_struct tsec_info[] = { @@ -95,140 +70,6 @@ static struct tsec_info_struct tsec_info[] = { #endif }; -/* - * Initialize all the TSEC devices - * - * Returns the number of TSEC devices that were initialized - */ -int tsec_eth_init(bd_t *bis, struct tsec_info_struct *tsecs, int num) -{ - int i; - int ret, count = 0; - - for (i = 0; i num; i++) { - ret = tsec_initialize(bis, tsecs[i]); - if (ret 0) - count += ret; - } - - return count; -} - -int tsec_standard_init(bd_t *bis) -{ - return tsec_eth_init(bis, tsec_info, ARRAY_SIZE(tsec_info)); -} - -/* Initialize device structure. Returns success if PHY - * initialization succeeded (i.e. if it recognizes the PHY) - */ -static int tsec_initialize(bd_t * bis, struct tsec_info_struct *tsec_info) -{ - struct eth_device *dev; - int i; - struct tsec_private *priv; - - dev = (struct eth_device *)malloc(sizeof *dev); - - if (NULL == dev) - return 0; - - memset(dev, 0, sizeof *dev); - - priv = (struct tsec_private *)malloc(sizeof(*priv)); - - if (NULL == priv) - return 0; - - privlist[num_tsecs++] = priv; - priv-regs = tsec_info-regs; - priv-phyregs = tsec_info-miiregs; - priv-phyregs_sgmii = tsec_info-miiregs_sgmii; - - priv-phyaddr = tsec_info-phyaddr; - priv-flags = tsec_info-flags; - - sprintf(dev-name, tsec_info-devname); - dev-iobase = 0; - dev-priv = priv; - dev-init = tsec_init; - dev-halt = tsec_halt; - dev-send = tsec_send; - dev-recv = tsec_recv; -#ifdef CONFIG_MCAST_TFTP - dev-mcast = tsec_mcast_addr; -#endif - - /* Tell u-boot to get the addr from the env */ - for (i = 0; i 6; i++) - dev-enetaddr[i] = 0; - - eth_register(dev); - - /* Reset the MAC */ - setbits_be32(priv-regs-maccfg1, MACCFG1_SOFT_RESET); - udelay(2); /* Soft Reset must be asserted for 3 TX clocks */ - clrbits_be32(priv-regs-maccfg1, MACCFG1_SOFT_RESET); - -#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \ -!defined(BITBANGMII) - miiphy_register(dev-name, tsec_miiphy_read, tsec_miiphy_write); -#endif - - /* Try to initialize PHY here, and return */ - return init_phy(dev); -} - -/* Initializes data structures and registers for the controller, - * and brings the interface up. Returns the link status, meaning - * that it returns success if the link is up, failure otherwise. - * This allows u-boot to find the first active controller. - */ -static int tsec_init(struct eth_device *dev, bd_t * bd) -{ - uint tempval; - char tmpbuf[MAC_ADDR_LEN]; - int i; - struct tsec_private *priv = (struct tsec_private *)dev-priv; - tsec_t *regs = priv-regs; - - /* Make sure the controller is stopped */ - tsec_halt(dev); - - /* Init MACCFG2. Defaults to GMII */ - out_be32(regs-maccfg2, MACCFG2_INIT_SETTINGS); - -
[U-Boot] [PATCH 6/7] phylib: Add a bunch of PHY drivers from tsec
The tsec driver had a bunch of PHY drivers already written. This converts them all into PHY Lib drivers, and serves as the first set of PHY drivers for PHY Lib. Signed-off-by: Andy Fleming aflem...@freescale.com --- drivers/net/phy/Makefile | 10 ++ drivers/net/phy/atheros.c| 37 + drivers/net/phy/broadcom.c | 275 drivers/net/phy/davicom.c| 86 ++ drivers/net/phy/lxt.c| 76 + drivers/net/phy/marvell.c| 357 ++ drivers/net/phy/micrel.c | 29 drivers/net/phy/natsemi.c| 85 ++ drivers/net/phy/phy.c| 28 drivers/net/phy/realtek.c| 120 ++ drivers/net/phy/teranetics.c | 43 + drivers/net/phy/vitesse.c| 330 ++ include/phy.h| 11 ++ include/phylib_all_drivers.h | 25 +++ 14 files changed, 1512 insertions(+), 0 deletions(-) create mode 100644 drivers/net/phy/atheros.c create mode 100644 drivers/net/phy/broadcom.c create mode 100644 drivers/net/phy/davicom.c create mode 100644 drivers/net/phy/lxt.c create mode 100644 drivers/net/phy/marvell.c create mode 100644 drivers/net/phy/micrel.c create mode 100644 drivers/net/phy/natsemi.c create mode 100644 drivers/net/phy/realtek.c create mode 100644 drivers/net/phy/teranetics.c create mode 100644 drivers/net/phy/vitesse.c create mode 100644 include/phylib_all_drivers.h diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile index 7cb1094..f67a79a 100644 --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile @@ -28,6 +28,16 @@ LIB := $(obj)libphy.o COBJS-$(CONFIG_BITBANGMII) += miiphybb.o COBJS-$(CONFIG_MV88E61XX_SWITCH) += mv88e61xx.o COBJS-$(CONFIG_PHYLIB) += phy.o +COBJS-$(CONFIG_PHY_VITESSE) += vitesse.o +COBJS-$(CONFIG_PHY_TERANETICS) += teranetics.o +COBJS-$(CONFIG_PHY_MARVELL) += marvell.o +COBJS-$(CONFIG_PHY_REALTEK) += realtek.o +COBJS-$(CONFIG_PHY_BROADCOM) += broadcom.o +COBJS-$(CONFIG_PHY_DAVICOM) += davicom.o +COBJS-$(CONFIG_PHY_LXT) += lxt.o +COBJS-$(CONFIG_PHY_NATSEMI) += natsemi.o +COBJS-$(CONFIG_PHY_MICREL) += micrel.o +COBJS-$(CONFIG_PHY_ATHEROS) += atheros.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c) diff --git a/drivers/net/phy/atheros.c b/drivers/net/phy/atheros.c new file mode 100644 index 000..68bb5cd --- /dev/null +++ b/drivers/net/phy/atheros.c @@ -0,0 +1,37 @@ +/* + * Atheros PHY drivers + * + * This software may be used and distributed according to the + * terms of the GNU Public License, Version 2, incorporated + * herein by reference. + * + * Copyright 2011 Freescale Semiconductor, Inc. + * author Andy Fleming + * + */ +#include phy.h + +static int ar8021_config(struct phy_device *phydev) +{ + phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x05); + phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x3D47); + + return 0; +} + +struct phy_driver AR8021_driver = { +.name = AR8021, + .uid = 0x4dd040, + .mask = 0xf0, + .features = PHY_GBIT_FEATURES, + .config = ar8021_config, + .startup = genphy_startup, + .shutdown = genphy_shutdown, +}; + +int atheros_init(void) +{ + phy_register(AR8021_driver); + + return 0; +} diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c new file mode 100644 index 000..e62a81d --- /dev/null +++ b/drivers/net/phy/broadcom.c @@ -0,0 +1,275 @@ +/* + * Broadcom PHY drivers + * + * This software may be used and distributed according to the + * terms of the GNU Public License, Version 2, incorporated + * herein by reference. + * + * Copyright 2010-2011 Freescale Semiconductor, Inc. + * author Andy Fleming + * + */ +#include config.h +#include common.h +#include phy.h + +/* Broadcom BCM54xx -- taken from linux sungem_phy */ +#define MIIM_BCM54xx_AUXCNTL 0x18 +#define MIIM_BCM54xx_AUXCNTL_ENCODE(val) ((val 0x7) 12)|(val 0x7) +#define MIIM_BCM54xx_AUXSTATUS 0x19 +#define MIIM_BCM54xx_AUXSTATUS_LINKMODE_MASK 0x0700 +#define MIIM_BCM54xx_AUXSTATUS_LINKMODE_SHIFT 8 + +#define MIIM_BCM54XX_SHD 0x1c +#define MIIM_BCM54XX_SHD_WRITE 0x8000 +#define MIIM_BCM54XX_SHD_VAL(x)((x 0x1f) 10) +#define MIIM_BCM54XX_SHD_DATA(x) ((x 0x3ff) 0) +#define MIIM_BCM54XX_SHD_WR_ENCODE(val, data) \ + (MIIM_BCM54XX_SHD_WRITE | MIIM_BCM54XX_SHD_VAL(val) | \ +MIIM_BCM54XX_SHD_DATA(data)) + +#define MIIM_BCM54XX_EXP_DATA 0x15/* Expansion register data */ +#define MIIM_BCM54XX_EXP_SEL 0x17/* Expansion register select */ +#define MIIM_BCM54XX_EXP_SEL_SSD 0x0e00 /* Secondary SerDes select */ +#define MIIM_BCM54XX_EXP_SEL_ER0x0f00 /* Expansion register select */ + +/* Broadcom BCM5461S */ +static int bcm5461_config(struct phy_device *phydev) +{ + genphy_config_aneg(phydev); + + return
[U-Boot] [PATCH 5/7] Add mdio command for new PHY infrastructure
The new mdio command doesn't have all of the features of the mii command, but it provides the necessary read/write primitives, and allows users to interact with 10G PHYs, and other PHYs which use Clause 45 of 802.3. This means that the mdio command requires a Device Address argument, though for clause 22 PHYs, the argument can be -. Signed-off-by: Andy Fleming aflem...@freescale.com --- common/Makefile |3 + common/cmd_mdio.c | 293 + 2 files changed, 296 insertions(+), 0 deletions(-) create mode 100644 common/cmd_mdio.c diff --git a/common/Makefile b/common/Makefile index 00847ef..a644627 100644 --- a/common/Makefile +++ b/common/Makefile @@ -116,6 +116,9 @@ COBJS-$(CONFIG_MII) += miiphyutil.o COBJS-$(CONFIG_CMD_MII) += miiphyutil.o COBJS-$(CONFIG_PHYLIB) += miiphyutil.o COBJS-$(CONFIG_CMD_MII) += cmd_mii.o +ifdef CONFIG_PHYLIB +COBJS-$(CONFIG_CMD_MII) += cmd_mdio.o +endif COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o COBJS-$(CONFIG_MP) += cmd_mp.o diff --git a/common/cmd_mdio.c b/common/cmd_mdio.c new file mode 100644 index 000..3ab0bef --- /dev/null +++ b/common/cmd_mdio.c @@ -0,0 +1,293 @@ +/* + * (C) Copyright 2011 Freescale Semiconductor, Inc + * Andy Fleming + * + * 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 + */ + +/* + * MDIO Commands + */ + +#include common.h +#include command.h +#include miiphy.h +#include phy.h + + +static char last_op[2]; +static uint last_data; +static uint last_addr_lo; +static uint last_addr_hi; +static uint last_devad_lo; +static uint last_devad_hi; +static uint last_reg_lo; +static uint last_reg_hi; + +static int extract_range(char *input, int *plo, int *phi) +{ + char * end; + *plo = simple_strtol(input, end, 0); + if (end == input) + return -1; + + if (*end == '-') { + end++; + *phi = simple_strtol(end, NULL, 0); + } else if (*end == '\0') { + *phi = *plo; + } else + return -1; + + return 0; +} + +int mdio_write_ranges(struct mii_dev *bus, int addrlo, + int addrhi, int devadlo, int devadhi, + int reglo, int reghi, unsigned short data) +{ + int addr, devad, reg; + int err = 0; + + for (addr = addrlo; addr = addrhi; addr++) { + for (devad = devadlo; devad = devadhi; devad++) { + for (reg = reglo; reg = reghi; reg++) { + err = bus-write(bus, addr, devad, reg, data); + + if (err) + goto err_out; + } + } + } + +err_out: + return err; +} + +int mdio_read_ranges(struct mii_dev *bus, int addrlo, + int addrhi, int devadlo, int devadhi, + int reglo, int reghi) +{ + int addr, devad, reg; + + printf(Reading from bus %s\n, bus-name); + for (addr = addrlo; addr = addrhi; addr++) { + printf(PHY at address %d:\n, addr); + + for (devad = devadlo; devad = devadhi; devad++) { + for (reg = reglo; reg = reghi; reg++) { + u16 val; + val = bus-read(bus, addr, devad, reg); + + if (val 0) { + printf(Error\n); + + return val; + } + + if (devad = 0) + printf(%d., devad); + + printf(%d - 0x%x\n, reg, val 0x); + } + } + } + + return 0; +} + +int extract_phy_range(char * const argv[], int argc, struct mii_dev **bus, + int *addrlo, int *addrhi) +{ + struct phy_device *phydev; + char *addrstr; + int addrlen, namelen; + char busname[MDIO_NAME_LEN]; + + if ((argc 1) || (argc 2)) + return -1; + + /* If there are two arguments, it's busname addr */ + if
[U-Boot] [PATCH 3/7] Remove instances of phy_read/write
There were a few files which were already using phy_read and phy_write for their PHY function names. It's only a few places, and the name seems most appropriate for the high-level abstraction, so let's rename the other versions to something more specific. Also, uec_phy.c had a marvell_init function which I renamed to not conflict with the one in marvell.c Signed-off-by: Andy Fleming aflem...@freescale.com --- drivers/net/dm9000x.c | 18 +++--- drivers/net/enc28j60.c | 24 drivers/net/uli526x.c | 24 drivers/qe/uec.c |3 - drivers/qe/uec_phy.c | 145 5 files changed, 107 insertions(+), 107 deletions(-) diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c index 709f67a..b5c5573 100644 --- a/drivers/net/dm9000x.c +++ b/drivers/net/dm9000x.c @@ -110,8 +110,8 @@ static board_info_t dm9000_info; /* function declaration - */ static int dm9000_probe(void); -static u16 phy_read(int); -static void phy_write(int, u16); +static u16 dm9000_phy_read(int); +static void dm9000_phy_write(int, u16); static u8 DM9000_ior(int); static void DM9000_iow(int reg, u8 value); @@ -361,7 +361,7 @@ static int dm9000_init(struct eth_device *dev, bd_t *bd) DM9000_iow(DM9000_IMR, IMR_PAR); i = 0; - while (!(phy_read(1) 0x20)) { /* autonegation complete bit */ + while (!(dm9000_phy_read(1) 0x20)) { /* autonegation complete bit */ udelay(1000); i++; if (i == 1) { @@ -371,7 +371,7 @@ static int dm9000_init(struct eth_device *dev, bd_t *bd) } /* see what we've got */ - lnk = phy_read(17) 12; + lnk = dm9000_phy_read(17) 12; printf(operating at ); switch (lnk) { case 1: @@ -445,7 +445,7 @@ static void dm9000_halt(struct eth_device *netdev) DM9000_DBG(%s\n, __func__); /* RESET devie */ - phy_write(0, 0x8000); /* PHY RESET */ + dm9000_phy_write(0, 0x8000);/* PHY RESET */ DM9000_iow(DM9000_GPR, 0x01); /* Power-Down PHY */ DM9000_iow(DM9000_IMR, 0x80); /* Disable all interrupt */ DM9000_iow(DM9000_RCR, 0x00); /* Disable RX */ @@ -581,7 +581,7 @@ DM9000_iow(int reg, u8 value) Read a word from phyxcer */ static u16 -phy_read(int reg) +dm9000_phy_read(int reg) { u16 val; @@ -593,7 +593,7 @@ phy_read(int reg) val = (DM9000_ior(DM9000_EPDRH) 8) | DM9000_ior(DM9000_EPDRL); /* The read data keeps on REG_0D REG_0E */ - DM9000_DBG(phy_read(0x%x): 0x%x\n, reg, val); + DM9000_DBG(dm9000_phy_read(0x%x): 0x%x\n, reg, val); return val; } @@ -601,7 +601,7 @@ phy_read(int reg) Write a word to phyxcer */ static void -phy_write(int reg, u16 value) +dm9000_phy_write(int reg, u16 value) { /* Fill the phyxcer register into REG_0C */ @@ -613,7 +613,7 @@ phy_write(int reg, u16 value) DM9000_iow(DM9000_EPCR, 0xa); /* Issue phyxcer write command */ udelay(500);/* Wait write complete */ DM9000_iow(DM9000_EPCR, 0x0); /* Clear phyxcer write command */ - DM9000_DBG(phy_write(reg:0x%x, value:0x%x)\n, reg, value); + DM9000_DBG(dm9000_phy_write(reg:0x%x, value:0x%x)\n, reg, value); } int dm9000_initialize(bd_t *bis) diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index 6c161b6..d55cacd 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c @@ -314,7 +314,7 @@ static void enc_release_bus(enc_dev_t *enc) /* * Read PHY register */ -static u16 phy_read(enc_dev_t *enc, const u8 addr) +static u16 enc_phy_read(enc_dev_t *enc, const u8 addr) { uint64_t etime; u8 status; @@ -339,7 +339,7 @@ static u16 phy_read(enc_dev_t *enc, const u8 addr) /* * Write PHY register */ -static void phy_write(enc_dev_t *enc, const u8 addr, const u16 data) +static void enc_phy_write(enc_dev_t *enc, const u8 addr, const u16 data) { uint64_t etime; u8 status; @@ -374,7 +374,7 @@ static int enc_phy_link_wait(enc_dev_t *enc) #ifdef CONFIG_ENC_SILENTLINK /* check if we have a link, then just return */ - status = phy_read(enc, PHY_REG_PHSTAT1); + status = enc_phy_read(enc, PHY_REG_PHSTAT1); if (status ENC_PHSTAT1_LLSTAT) return 0; #endif @@ -382,10 +382,10 @@ static int enc_phy_link_wait(enc_dev_t *enc) /* wait for link with 1 second timeout */ etime = get_ticks() + get_tbclk(); while (get_ticks() = etime) { - status = phy_read(enc, PHY_REG_PHSTAT1); + status = enc_phy_read(enc, PHY_REG_PHSTAT1); if (status ENC_PHSTAT1_LLSTAT) { /* now we have a link */ - status = phy_read(enc, PHY_REG_PHSTAT2); + status = enc_phy_read(enc, PHY_REG_PHSTAT2); duplex = (status
Re: [U-Boot] [PATCH RFC v2] Fix build problems caused by _end - __bss_end__ rename
Dear Po-Yu Chuang, In message 1301402371-8697-1-git-send-email...@denx.de I wrote: Commit 44c6e65 rename _end to __bss_end__ broke building of a large number of systems (at least all PowerPC?): libstubs.o: In function `app_startup': examples/standalone/stubs.c:197: undefined reference to `__bss_end__' The rename should not be done for the files in the examples/standalone/ directory, as these are not using the code from start.S, but do their own BSS clearing, and either use their own linker scripts or the ones provided by the compilers. Signed-off-by: Wolfgang Denk w...@denx.de --- V2: Instead of messing with linker defines, revert the patch in question for the files in examples/standalone/ as suggested by Albert Aribaud. (Thanks!) Only now I realize that you submitted the very same patch before. Stupid me. Does that mean that we have an agreement that this hould be the fix then? If yes, I would like to pull this in (Po-Yu Chuang's patch, that is). Do you agree? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de A weak mind is like a microscope, which magnifies trifling things, but cannot receive great ones. -- Philip Earl of Chesterfield ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] NET: Correct potential missing goto label in case statement.
If neither CONFIG_CMD_PING or CONFIG_CMD_SNTP are defined but CONFIG_CMD_DNS is, a compile-time error will occur due to the absence of a goto label. Signed-off-by: Gray Remlin gryr...@gmail.com --- net/net.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/net/net.c b/net/net.c index a609632..e50bdf1 100644 --- a/net/net.c +++ b/net/net.c @@ -1724,7 +1724,8 @@ static int net_check_prereq (proto_t protocol) puts (*** ERROR: `serverip' not set\n); return (1); } -#if defined(CONFIG_CMD_PING) || defined(CONFIG_CMD_SNTP) +#if defined(CONFIG_CMD_PING) || defined(CONFIG_CMD_SNTP) || \ +defined(CONFIG_CMD_DNS) common: #endif -- 1.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Booting kernel from NAND flash on AT91SAM9 custom board using fsload
On 29/03/2011 11:56 AM, Scott Wood wrote: On Tue, 29 Mar 2011 11:37:25 -0600 Nicholas Kinarn.ki...@usask.ca wrote: On 29/03/2011 10:14 AM, Nicholas Kinar wrote: Also as instructed in the README.NAND, README.JFFS2 and README.JFFS2_NAND files found in the /doc/ directory, I've tried defining the following in my /include/configs/at91sam9rlek.h configuration file: #define CONFIG_JFFS2_NAND 1 #define CONFIG_CMD_JFFS2 #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_CMD_NAND1 I've now added the following #undef to the list of defines above: #undef CONFIG_CMD_FLASH Now after typing help at the U-Boot command line, I can finally see the fsload command listed. However running fsload gives the following error: U-Boot fsload support for FLASH devices not present incorrect device: nor0 This appears to be due to some code in the /common/cmd_jffs2.c file. Can fsload be only used for NOR memory, or is there a way to use it for NAND flash as well? support for FLASH devices not present is printed when it's trying to act on a device labelled as NOR, but there's no NOR support present. Try the chpart command to switch to a NAND device, and/or make sure that your mtdparts variable is set correctly. -Scott Thank you very much for your response, Scott; this is greatly appreciated! To compile in support for the chpart command, I've now added the following to my /include/configs/at91sam9rlek.h file: #define CFG_NAND_BOOT #define CONFIG_JFFS2_NAND 1 #define CONFIG_JFFS2_CMDLINE #define CONFIG_CMD_JFFS2 #define CONFIG_CMD_MTDPARTS #define CONFIG_MTD_DEVICE #define MTDIDS_DEFAULT nand0=nand_flash #define MTDPARTS_DEFAULT mtdparts=nand_flash:-(jffs2) #define CONFIG_SYS_MAX_FLASH_BANKS 1 #undef CONFIG_CMD_FLASH U-boot compiles cleanly, but I find that after U-Boot loads on my embedded hardware, the mtdids and mtdparts variables are not set in the U-Boot environment. However, since these are environment variables, I find that this can be done at the U-Boot command line: U-Boot nand info Device 0: nand0, sector size 256 KiB U-Boot setenv mtdids nand0=nand_flash U-Boot setenv mtdparts mtdparts=nand_flash:-(jffs2) U-Boot chpart nand0,0 partition changed to nand0,0 U-Boot ls Scanning JFFS2 FS: ls: Failed to scan JFFSv2 file structure U-Boot fsload ### JFFS2 loading 'uImage' to 0x2200 Scanning JFFS2 FS: load: Failed to scan JFFSv2 file structure ### JFFS2 LOAD ERROR0 for uImage! Of course, fsload cannot load the uImage, since I am working with a blank flash and there is no image pre-loaded on the flash. Using the saveenv command, I intend to save these environment variables. Continuing on, I will load an image on the blank flash, and then I will try to load the Linux kernel. I will then post my results on this mailing list as a response. I have two additional questions associated with booting the kernel from NAND flash on my custom hardware: (1) Does replacing jffs2_1pass.c with jffs2_nand_1pass.c in the fs/jffs2 directory influence the robustness of the fsload code? (2) Does it take a long time to load the Linux kernel from a JFFS2 filesystem on NAND flash using the fsload command (i.e. http://old.nabble.com/Performance-in-Booting-Linux-w--Device-Tree-via-U-Boot-out-of-JFFS2-on-NAND-td15879327.html), or has this been cleaned up in the current u-boot-2010.09 code? Nicholas ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Booting kernel from NAND flash on AT91SAM9 custom board using fsload
On Tue, 29 Mar 2011 14:35:26 -0600 Nicholas Kinar n.ki...@usask.ca wrote: I have two additional questions associated with booting the kernel from NAND flash on my custom hardware: (1) Does replacing jffs2_1pass.c with jffs2_nand_1pass.c in the fs/jffs2 directory influence the robustness of the fsload code? (2) Does it take a long time to load the Linux kernel from a JFFS2 filesystem on NAND flash using the fsload command (i.e. http://old.nabble.com/Performance-in-Booting-Linux-w--Device-Tree-via-U-Boot-out-of-JFFS2-on-NAND-td15879327.html), or has this been cleaned up in the current u-boot-2010.09 code? I haven't used U-Boot's jffs2 support (the previous answer was from reading the source code), so I can't help here, sorry. -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Booting kernel from NAND flash on AT91SAM9 custom board using fsload
On 29/03/2011 2:46 PM, Scott Wood wrote: On Tue, 29 Mar 2011 14:35:26 -0600 Nicholas Kinarn.ki...@usask.ca wrote: I have two additional questions associated with booting the kernel from NAND flash on my custom hardware: (1) Does replacing jffs2_1pass.c with jffs2_nand_1pass.c in the fs/jffs2 directory influence the robustness of the fsload code? (2) Does it take a long time to load the Linux kernel from a JFFS2 filesystem on NAND flash using the fsload command (i.e. http://old.nabble.com/Performance-in-Booting-Linux-w--Device-Tree-via-U-Boot-out-of-JFFS2-on-NAND-td15879327.html), or has this been cleaned up in the current u-boot-2010.09 code? I haven't used U-Boot's jffs2 support (the previous answer was from reading the source code), so I can't help here, sorry. -Scott That is fine, Scott; your previous answer was extremely helpful, and I think that I am now well on my way to booting the Linux kernel from NAND flash on my new embedded system. Thanks again, Nicholas ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Booting kernel from NAND flash on AT91SAM9 custom board using fsload
Dear Nicholas Kinar, In message 4d92428e.6030...@usask.ca you wrote: (1) Does replacing jffs2_1pass.c with jffs2_nand_1pass.c in the fs/jffs2 directory influence the robustness of the fsload code? JFFS2 is more or less deprecated these days. FOr new projects, we recommend to use UBI/ UBIFS instead. (2) Does it take a long time to load the Linux kernel from a JFFS2 filesystem on NAND flash using the fsload command (i.e. JFFS2 has always been slow, especially when mounting larger file systems. This is one of the resons we recommend UBIFS instead. or has this been cleaned up in the current u-boot-2010.09 code? v2010.09 is in no way current. The latest release available at this moment is v2010.12, and v2011.03 is a mere few days aways. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de It seems intuitively obvious to me, which means that it might be wrong. -- Chris Torek ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] ARM: Add support for displaying second ethaddr in 'bdinfo' command
Signed-off-by: Gray Remlin gryr...@gmail.com --- common/cmd_bdinfo.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index bba7374..c0553d5 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -340,6 +340,9 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #if defined(CONFIG_CMD_NET) print_eth(0); +#if defined(CONFIG_HAS_ETH1) + print_eth(1); +#endif printf (ip_addr = %pI4\n, bd-bi_ip_addr); #endif printf (baudrate= %d bps\n, bd-bi_baudrate); -- 1.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Booting kernel from NAND flash on AT91SAM9 custom board using fsload
On 29/03/2011 3:05 PM, Wolfgang Denk wrote: Dear Nicholas Kinar, In message4d92428e.6030...@usask.ca you wrote: (1) Does replacing jffs2_1pass.c with jffs2_nand_1pass.c in the fs/jffs2 directory influence the robustness of the fsload code? JFFS2 is more or less deprecated these days. FOr new projects, we recommend to use UBI/ UBIFS instead. (2) Does it take a long time to load the Linux kernel from a JFFS2 filesystem on NAND flash using the fsload command (i.e. JFFS2 has always been slow, especially when mounting larger file systems. This is one of the resons we recommend UBIFS instead. or has this been cleaned up in the current u-boot-2010.09 code? v2010.09 is in no way current. The latest release available at this moment is v2010.12, and v2011.03 is a mere few days aways. Best regards, Wolfgang Denk Thanks for your response, Wolfgang - I will switch the file system to UBI/UBIFS, and then post back what I've done. I've been looking in the include/configs/sheevaplug.h directory, and I think that this small embedded computer is now using UBIFS as the NAND flash file system. So changing the configs for my embedded system should be reasonably straightforward. I would assume that the fsload command will also work with UBIFS as well. In my custom system, At91Bootstrap is situated on SPI Dataflash. The At91Bootstrap loads U-Boot from the same Dataflash. Then, I would like U-Boot to load the Linux kernel from the UBI file system on a large 2 GByte NAND flash. This should be much better than using JFFS2 on the large NAND flash. Nicholas ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ARM: Add support for displaying second ethaddr in 'bdinfo' command
Dear Gray Remlin, In message 1301433395-25203-1-git-send-email-gryr...@gmail.com you wrote: Signed-off-by: Gray Remlin gryr...@gmail.com --- common/cmd_bdinfo.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) Why limit this to eth1addr? What's the chances that ARM systems may have more than 2 network interfaces? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Everything should be made as simple as possible, but not simpler. - Albert Einstein ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Booting kernel from NAND flash on AT91SAM9 custom board using fsload
Dear Nicholas Kinar, In message 4d92531e.4030...@usask.ca you wrote: I would assume that the fsload command will also work with UBIFS as well. No. UBIFS uses it's own command set; you will use ubifsload instead. In my custom system, At91Bootstrap is situated on SPI Dataflash. The At91Bootstrap loads U-Boot from the same Dataflash. Then, I would like U-Boot to load the Linux kernel from the UBI file system on a large 2 GByte NAND flash. This should be much better than using JFFS2 on the large NAND flash. Indeed. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de One day, said a dull voice from down below, I'm going to be back in form again and you're going to be very sorry you said that. For a very long time. I might even go so far as to make even more Time just for you to be sorry in. - Terry Pratchett, _Small Gods_ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ARM: Add support for displaying second ethaddr in 'bdinfo' command
On 03/29/2011 10:49 PM, Wolfgang Denk wrote: Dear Gray Remlin, In message1301433395-25203-1-git-send-email-gryr...@gmail.com you wrote: Signed-off-by: Gray Remlingryr...@gmail.com --- common/cmd_bdinfo.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) Why limit this to eth1addr? What's the chances that ARM systems may have more than 2 network interfaces? Best regards, Wolfgang Denk Good question, I have already asked myself this, so I have stuck with what I do know. 1. It has had the one ethaddr limit for a (relatively) long time, which it seems no-one else 'required'\'submitted a patch' to change it. 2. I only know (with my very limited knowledge) of ARM boards with a maximum of two interfaces as standard. 3. Why limit it to six (as in other parts of the source) ? My answer: It is not my place to dictate policy, that is the role of the Project Manager. And no, that is not a 'cop-out', it is the only way to avoid anarchy. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RFC] [PATCH] arm: arm926ejs: use ELF relocations
dear: i am using u-boot 2011.03-rc1 compiled by CS arm-none-eabi-gcc 4.5.1 board at91sam9263ek_norflash_boot_config i using gdb 6.8.1 debug it when u-boot compiled i found an error /dzg/crosstool/4.5.1/bin/.arm-none-eabi-ld: warning: creating a DT_TEXTREL in object. /dzg/x86/insight-6.8-1/gdb/insight -se u-boot BFD: /dzg/arm/u-boot/u-boot-2011.03-rc1/u-boot: invalid string offset 37 = 0 for section `' BFD: /dzg/arm/u-boot/u-boot-2011.03-rc1/u-boot: invalid string offset 32 = 0 for section `' BFD: /dzg/arm/u-boot/u-boot-2011.03-rc1/u-boot: invalid string offset 53 = 0 for section `' BFD: /dzg/arm/u-boot/u-boot-2011.03-rc1/u-boot: invalid string offset 1 = 0 for section `' BFD: /dzg/arm/u-boot/u-boot-2011.03-rc1/u-boot: invalid string offset 20 = 0 for section `' BFD: /dzg/arm/u-boot/u-boot-2011.03-rc1/u-boot: invalid string offset 82 = 0 for section `' BFD: /dzg/arm/u-boot/u-boot-2011.03-rc1/u-boot: invalid string offset 67 = 0 for section `' when i set breakpoint such as b board_init_f it seems to show wrong line number at line 132 i also found this version of u-boot change board_init_f to run in flash why dose it? in version 2010.09 it run after relocated in ram i found the linker link init_fnc_t *init_sequence[] functions with address like 0x23fx what does the linker do with -pie option does it link the functions run in flash with addr like 0xa? do you test eldk 4.2 compiled with this board and run in norflash? thanks best regards ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] without board level config.mk How to add CPPFLAGS
Use CFLAGS_$(BCURDIR) if you want to set this for all files in a specific directory, or CFLAGS_$(BCURDIR)/$(@F) if you want to set this for a single file only. Thanks ! -- Best Regards, zzs ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH RFC v2] Fix build problems caused by _end - __bss_end__ rename
Hi Wolfgang, On Wed, Mar 30, 2011 at 3:51 AM, Wolfgang Denk w...@denx.de wrote: Dear Po-Yu Chuang, In message 1301402371-8697-1-git-send-email...@denx.de I wrote: Commit 44c6e65 rename _end to __bss_end__ broke building of a large number of systems (at least all PowerPC?): libstubs.o: In function `app_startup': examples/standalone/stubs.c:197: undefined reference to `__bss_end__' The rename should not be done for the files in the examples/standalone/ directory, as these are not using the code from start.S, but do their own BSS clearing, and either use their own linker scripts or the ones provided by the compilers. Signed-off-by: Wolfgang Denk w...@denx.de --- V2: Instead of messing with linker defines, revert the patch in question for the files in examples/standalone/ as suggested by Albert Aribaud. (Thanks!) Only now I realize that you submitted the very same patch before. Stupid me. Does that mean that we have an agreement that this hould be the fix then? If yes, I would like to pull this in (Po-Yu Chuang's patch, that is). Do you agree? Your commit message is better. Please just use your v2 as is. :-) Thanks, Po-Yu Chuang ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC] [PATCH] arm: arm926ejs: use ELF relocations
Hi, (how is this an RFC or PATCH? There is none in this mail) Le 30/03/2011 01:13, du zhigang a écrit : dear: i am using u-boot 2011.03-rc1 compiled by CS arm-none-eabi-gcc 4.5.1 board at91sam9263ek_norflash_boot_config i using gdb 6.8.1 debug it when u-boot compiledi found an error /dzg/crosstool/4.5.1/bin/.arm-none-eabi-ld: warning: creating a DT_TEXTREL in object. /dzg/x86/insight-6.8-1/gdb/insight -se u-boot BFD: /dzg/arm/u-boot/u-boot-2011.03-rc1/u-boot: invalid string offset 37 = 0 for section `' BFD: /dzg/arm/u-boot/u-boot-2011.03-rc1/u-boot: invalid string offset 32 = 0 for section `' BFD: /dzg/arm/u-boot/u-boot-2011.03-rc1/u-boot: invalid string offset 53 = 0 for section `' BFD: /dzg/arm/u-boot/u-boot-2011.03-rc1/u-boot: invalid string offset 1 = 0 for section `' BFD: /dzg/arm/u-boot/u-boot-2011.03-rc1/u-boot: invalid string offset 20 = 0 for section `' BFD: /dzg/arm/u-boot/u-boot-2011.03-rc1/u-boot: invalid string offset 82 = 0 for section `' BFD: /dzg/arm/u-boot/u-boot-2011.03-rc1/u-boot: invalid string offset 67 = 0 for section `' when i set breakpoint such as b board_init_f it seems to show wrong line number at line 132 i also found this version of u-boot change board_init_f to run in flash why dose it? in version 2010.09 it run after relocated in ram i found the linker linkinit_fnc_t *init_sequence[] functions with address like 0x23fx All this is the normal result of ARM relocation introduction, which I sense you already know judging from the subject of your post. what does the linker do with -pie option does it link the functions run in flash with addr like 0xa? Not exactly -- a toolchain has no notion of flash vs RAM. The -pie option, as the binutil documentation states, produces a relocatable binary. do you test eldk 4.2 compiled with this board and run in norflash? This is formally the board maintainer's work; see MAINTAINERS. However, many other ARM boards are tested with ELDK 4.2 or CodeSourcery 2010q1 for instance. Note that you can provide patches which the maintainer will just have to Ack, as well. thanks best regards Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot