Re: [U-Boot] [PATCH 1/3 v2] net: emaclite: Setup RX/TX ping pong for every instance
Michal Simek wrote: Setup RX/TX ping-pong buffer for every emaclite IP separately. The next patch move initialization directly to board code. Signed-off-by: Michal Simek mon...@monstr.eu --- v2: Fix coding style violations --- drivers/net/xilinx_emaclite.c | 123 ++-- 1 files changed, 68 insertions(+), 55 deletions(-) Any comment? If not please add them to mainline tree. I have two more follow-up patches for emaclite. Thanks, Michal -- Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Pull request - microblaze
Dear Wolfgang Denk, please pull the following changes to your tree. Thanks, Michal The following changes since commit 0841ca90f22d73b0ea4642ef1ce33d879bb2f3ff: Wolfgang Denk (1): arm920t/s3c24x0/usb_ohci.c: fix warning: variable ... set but not used are available in the git repository at: git://www.denx.de/git/u-boot-microblaze.git master Michal Simek (5): microblaze: Call common console_init_f initialization function microblaze: Support flashes on lower addresses microblaze: Initialize jumptable and console microblaze: Fix unaligned.h for endians microblaze: Copy bootfile from variables arch/microblaze/include/asm/processor.h | 32 ++- arch/microblaze/include/asm/unaligned.h | 17 +--- arch/microblaze/lib/board.c | 16 +++ 3 files changed, 48 insertions(+), 17 deletions(-) -- Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] microblaze - serial multi
Hi, my uartlite serial multi patch is upstream that's why I can enable serial multi for microblaze. There is one issue with serial.h where are spaces at the start of a line. I just follow coding style there. If you require to fix it, I will do it. Thanks, Michal ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] microblaze: Enable SERIAL_MULTI
Enable support for SERIAL_MULTI. Microblaze can use uart16550 and uartlite drivers. Signed-off-by: Michal Simek mon...@monstr.eu --- Note: Follow serial.h conding style. --- arch/microblaze/lib/board.c |4 include/configs/microblaze-generic.h |2 ++ include/serial.h |2 +- 3 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c index ca5882d..64089c8 100644 --- a/arch/microblaze/lib/board.c +++ b/arch/microblaze/lib/board.c @@ -32,6 +32,7 @@ #include stdio_dev.h #include net.h #include asm/processor.h +#include serial.h DECLARE_GLOBAL_DATA_PTR; @@ -110,6 +111,9 @@ void board_init (void) monitor_flash_len = __end - __text_start; +#ifdef CONFIG_SERIAL_MULTI + serial_initialize(); +#endif /* * The Malloc area is immediately below the monitor copy in DRAM * aka CONFIG_SYS_MONITOR_BASE - Note there is no need for reloc_off diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 6b3fd76..89657189 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -31,6 +31,8 @@ #defineCONFIG_MICROBLAZE 1 #defineMICROBLAZE_V5 1 +#define CONFIG_SERIAL_MULTI 1 + /* uart */ #ifdef XILINX_UARTLITE_BASEADDR # define CONFIG_XILINX_UARTLITE diff --git a/include/serial.h b/include/serial.h index 5926244..f047d2f 100644 --- a/include/serial.h +++ b/include/serial.h @@ -31,7 +31,7 @@ extern struct serial_device * default_serial_console (void); defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \ defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \ defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \ -defined(CONFIG_TEGRA2) +defined(CONFIG_TEGRA2) || defined(CONFIG_MICROBLAZE) extern struct serial_device serial0_device; extern struct serial_device serial1_device; #if defined(CONFIG_SYS_NS16550_SERIAL) -- 1.7.5.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/5 v2] microblaze: Fix unaligned.h for endians
Mike Frysinger wrote: Acked-by: Mike Frysinger vap...@gentoo.org -mike Thanks. Michal -- Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/2]: OMAP3 SPL updates
Hi Tom, On 10/10/11 05:01, Tom Rini wrote: On Sun, Oct 9, 2011 at 2:21 AM, Igor Grinberg grinb...@compulab.co.il wrote: On 10/07/11 02:28, Tom Rini wrote: On Tue, Oct 4, 2011 at 7:59 AM, Tom Rini tr...@ti.com wrote: Hey all, The following short series does two things. First, it re-works where we do memory initalization in SPL for OMAP3 to be board-specific. This is needed since in many cases (beagleboard, omap3evm) what timings we set depend on what hardware we detect ourself to be running on. Second, along those same lines what omap_rev_string tells us is doing to be board specific as well so provide a weak version in the common omap SPL code and lets it be replaced as needed. Please disregard this version, I need to do a full v3 with the right set of board_early_sdrc_init, sorry for the noise. While I was looking at the series, I've got similar thoughts. May be this should be facilitated by providing kind of framework for the board file only to set the right settings and not duplicate the board_early_sdrc_init() function (with changed values)? The problem is that what to do is very board specific. For example for beagleboard we need to probe the nand driver to see what package we have and then pick from at least 3, maybe 4 or 5 (I don't have the code in front of me) settings. This only means that the framework (or just a common function call) should be flexible enough to let the board choose the right configuration in runtime. After all the DRAM controller should be initialized by the same sequence just with different values. That said, perhaps a function that takes the series of values that do change would be a little clearer in the end so I'll give that a spin once I've gotten beagle and omap3evm spun up again (and maybe finally gotten NAND SPL working there, it seems to be an omap3-specific issue sadly). How about a something like board_get_dram_params() (defined weak) implemented by a board file and a call added to current DRAM controller initialization sequence? -- Regards, Igor. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 05/13] I2c: add missing i2c_set_bus_num to mxc_i2c
Hello Stefano, Stefano Babic wrote: The function i2c_set_bus_num() is used on most SOCs. The driver does not support multiple I2C busses, and an empty function is added to be compatible with general code (example: PMIC driver). Signed-off-by: Stefano Babic sba...@denx.de Cc: Heiko Schocher h...@denx.de --- drivers/i2c/mxc_i2c.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) Hmm... it would be better to add a weak function in u-boot/common/cmd_i2c.c ... as it is done for i2c_set_bus_speed() and i2c_get_bus_speed() functions. bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 05/13] I2c: add missing i2c_set_bus_num to mxc_i2c
On 10/10/2011 10:50 AM, Heiko Schocher wrote: Hello Stefano, Stefano Babic wrote: The function i2c_set_bus_num() is used on most SOCs. The driver does not support multiple I2C busses, and an empty function is added to be compatible with general code (example: PMIC driver). Signed-off-by: Stefano Babic sba...@denx.de Cc: Heiko Schocher h...@denx.de --- drivers/i2c/mxc_i2c.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) Hmm... it would be better to add a weak function in u-boot/common/cmd_i2c.c ... as it is done for i2c_set_bus_speed() and i2c_get_bus_speed() functions. Good idea, I missed it..changed in V2. Stefano -- = DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: off...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 05/13] i2c: Create common default i2c_set_bus_num() function
New default, weak i2c_set_bus_num() function. Signed-off-by: Stefano Babic sba...@denx.de Cc: Heiko Schocher h...@denx.de --- Changes since V1: - add a weak function i2c_set_bus_num() to cmd_i2c.c instead of adding a dummy function to mxc_i2c.c. (Heiko Schocher) common/cmd_i2c.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c index 3ea75f7..0f925d1 100644 --- a/common/cmd_i2c.c +++ b/common/cmd_i2c.c @@ -158,6 +158,14 @@ int __def_i2c_set_bus_speed(unsigned int speed) int i2c_set_bus_speed(unsigned int) __attribute__((weak, alias(__def_i2c_set_bus_speed))); +int __def_i2c_set_bus_num(unsigned int bus) +{ + return 0; +} +int i2c_set_bus_num(unsigned int) + __attribute__((weak, alias(__def_i2c_set_bus_num))); + + /* * get_alen: small parser helper function to get address length * returns the address length -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] microblaze: Enable SERIAL_MULTI
On 10/10/11, Michal Simek mon...@monstr.eu wrote: Enable support for SERIAL_MULTI. Microblaze can use uart16550 and uartlite drivers. Signed-off-by: Michal Simek mon...@monstr.eu --- Note: Follow serial.h conding style. --- arch/microblaze/lib/board.c |4 include/configs/microblaze-generic.h |2 ++ include/serial.h |2 +- 3 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c index ca5882d..64089c8 100644 --- a/arch/microblaze/lib/board.c +++ b/arch/microblaze/lib/board.c @@ -32,6 +32,7 @@ #include stdio_dev.h #include net.h #include asm/processor.h +#include serial.h DECLARE_GLOBAL_DATA_PTR; @@ -110,6 +111,9 @@ void board_init (void) monitor_flash_len = __end - __text_start; +#ifdef CONFIG_SERIAL_MULTI + serial_initialize(); +#endif /* * The Malloc area is immediately below the monitor copy in DRAM * aka CONFIG_SYS_MONITOR_BASE - Note there is no need for reloc_off diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 6b3fd76..89657189 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -31,6 +31,8 @@ #define CONFIG_MICROBLAZE 1 #define MICROBLAZE_V5 1 +#define CONFIG_SERIAL_MULTI 1 + /* uart */ #ifdef XILINX_UARTLITE_BASEADDR # define CONFIG_XILINX_UARTLITE diff --git a/include/serial.h b/include/serial.h index 5926244..f047d2f 100644 --- a/include/serial.h +++ b/include/serial.h @@ -31,7 +31,7 @@ extern struct serial_device * default_serial_console (void); defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \ defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \ defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \ -defined(CONFIG_TEGRA2) +defined(CONFIG_TEGRA2) || defined(CONFIG_MICROBLAZE) Am I the only one that thinks this is all really ugly? extern struct serial_device serial0_device; extern struct serial_device serial1_device; #if defined(CONFIG_SYS_NS16550_SERIAL) -- 1.7.5.4 Regards, Graeme ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 05/13] i2c: Create common default i2c_set_bus_num() function
Hello Stefano, Stefano Babic wrote: New default, weak i2c_set_bus_num() function. Signed-off-by: Stefano Babic sba...@denx.de Cc: Heiko Schocher h...@denx.de --- Changes since V1: - add a weak function i2c_set_bus_num() to cmd_i2c.c instead of adding a dummy function to mxc_i2c.c. (Heiko Schocher) common/cmd_i2c.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c index 3ea75f7..0f925d1 100644 --- a/common/cmd_i2c.c +++ b/common/cmd_i2c.c @@ -158,6 +158,14 @@ int __def_i2c_set_bus_speed(unsigned int speed) int i2c_set_bus_speed(unsigned int) __attribute__((weak, alias(__def_i2c_set_bus_speed))); +int __def_i2c_set_bus_num(unsigned int bus) +{ + return 0; +} +int i2c_set_bus_num(unsigned int) + __attribute__((weak, alias(__def_i2c_set_bus_num))); + + Please just one new line ;-) Beside of this, you get my: Acked-by: Heiko Schocher h...@denx.de /* * get_alen: small parser helper function to get address length * returns the address length Thanks! bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Introduce generic TPM support in u-boot
Dear Vadim Bendebury, In message 20111010025327.119eb40...@eskimo.mtv.corp.google.com you wrote: TPM (Trusted Platform Module) is an integrated circuit and software platform that provides computer manufacturers with the core components of a subsystem used to assure authenticity, integrity and confidentiality. This driver supports version 1.2 of the TCG (Trusted Computing Group) specifications. The TCG specification defines several so called localities in a TPM chip, to be controlled by different software layers. When used on a typical x86 platform during the firmware phase, only locality 0 can be accessed by the CPU, so this driver even while supporting the locality concept presumes that only locality zero is used. This implementation is loosely based on the article Writing a TPM Device Driver published on http://ptgmedia.pearsoncmg.com and a submission by Stefan Berger on Qemu-devel mailing list (http://lists.gnu.org/archive/html/qemu-devel). Compiling this driver with DEBUG defined will generate trace of all accesses to TMP registers. This driver has been tested and is being used in three different functional ChromeOS machines (Pinetrail and Sandy Bridge Intel chipsets) all using the same Infineon SLB 9635 TT 1.2 device. A u-boot cli command allowing access to the TPM was also implemented and will be submitted separately. Change-Id: I22a33c3e5b2e20eec9557a7621bd463b30389d73 Signed-off-by: Vadim Bendebury vben...@chromium.org CC: Wolfgang Denk w...@denx.de ... As is, there are no users of this code, so it would be just dead code. Please resubmit in a patch series that also includes code to use this feature. +++ b/drivers/tpm/Makefile @@ -0,0 +1,27 @@ +# Copyright (c) 2011 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. There is no LICENSE file. Please provide exact license information; for details please see bullet # 1 at http://www.denx.de/wiki/view/U-Boot/Patches#Notes Please fix globally. +/* #define DEBUG */ Please remove dead code like this. +#define PREFIX lpc_tpm: +#define TPM_DEBUG(fmt, args...) \ + if (TPM_DEBUG_ON) { \ + printf(PREFIX); \ + printf(fmt , ##args); \ + } Can you not use standard debug() code? +#ifndef CONFIG_TPM_TIS_BASE_ADDRESS +/* Base TPM address standard for x86 systems */ +#define CONFIG_TPM_TIS_BASE_ADDRESS0xfed4 +#endif I think this should be removed. +#define TIS_REG(LOCALITY, REG) \ + (void *)(CONFIG_TPM_TIS_BASE_ADDRESS + (LOCALITY 12) + REG) We do not allow to access device registers through base address + offset. Please always use C structs instead. ... +/* TPM access functions are carved out to make tracing easier. */ +static u32 tpm_read(int locality, u32 reg) +{ + u32 value; + /* + * Data FIFO register must be read and written in byte access mode, + * otherwise the FIFO values are returned 4 bytes at a time. + */ Please insert blank line between declarations and code. Please fix globally. ... + /* this will have to be converted into debug printout */ + TPM_DEBUG(Found TPM %s by %s\n, device_name, vendor_name); Is this comment still correct? +int tis_init(void) +{ + if (tis_probe()) + return TPM_DRIVER_ERR; + return 0; +} Or simply: return tis_probe(); 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 Hegel was right when he said that we learn from history that man can never learn anything from history. - George Bernard Shaw ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V3 05/13] i2c: Create common default i2c_set_bus_num() function
New default, weak i2c_set_bus_num() function. Signed-off-by: Stefano Babic sba...@denx.de Cc: Heiko Schocher h...@denx.de --- Changes since V2: - codestyling: drop newline (Heiko Schocher) Changes since V1: - add a weak function i2c_set_bus_num() to cmd_i2c.c instead of adding a dummy function to mxc_i2c.c. (Heiko Schocher) common/cmd_i2c.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c index 3ea75f7..8baa541 100644 --- a/common/cmd_i2c.c +++ b/common/cmd_i2c.c @@ -158,6 +158,13 @@ int __def_i2c_set_bus_speed(unsigned int speed) int i2c_set_bus_speed(unsigned int) __attribute__((weak, alias(__def_i2c_set_bus_speed))); +int __def_i2c_set_bus_num(unsigned int bus) +{ + return 0; +} +int i2c_set_bus_num(unsigned int) + __attribute__((weak, alias(__def_i2c_set_bus_num))); + /* * get_alen: small parser helper function to get address length * returns the address length -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Introduce generic TPM support in u-boot
Dear Mike Frysinger, In message 20111018.30473.vap...@gentoo.org you wrote: simplify this with one line: #define tpm_debug(fmt, args...) debug(lpc_tpm: fmt, ## args) This would break as soon as anybody passes a variable for fmt. 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 In an infinite universe all things are possible, including the possi- bility that the universe does not exist. - Terry Pratchett, _The Dark Side of the Sun_ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] microblaze: Enable SERIAL_MULTI
Graeme Russ wrote: On 10/10/11, Michal Simek mon...@monstr.eu wrote: Enable support for SERIAL_MULTI. Microblaze can use uart16550 and uartlite drivers. Signed-off-by: Michal Simek mon...@monstr.eu --- Note: Follow serial.h conding style. --- arch/microblaze/lib/board.c |4 include/configs/microblaze-generic.h |2 ++ include/serial.h |2 +- 3 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c index ca5882d..64089c8 100644 --- a/arch/microblaze/lib/board.c +++ b/arch/microblaze/lib/board.c @@ -32,6 +32,7 @@ #include stdio_dev.h #include net.h #include asm/processor.h +#include serial.h DECLARE_GLOBAL_DATA_PTR; @@ -110,6 +111,9 @@ void board_init (void) monitor_flash_len = __end - __text_start; +#ifdef CONFIG_SERIAL_MULTI +serial_initialize(); +#endif /* * The Malloc area is immediately below the monitor copy in DRAM * aka CONFIG_SYS_MONITOR_BASE - Note there is no need for reloc_off diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 6b3fd76..89657189 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -31,6 +31,8 @@ #define CONFIG_MICROBLAZE 1 #define MICROBLAZE_V5 1 +#define CONFIG_SERIAL_MULTI 1 + /* uart */ #ifdef XILINX_UARTLITE_BASEADDR # define CONFIG_XILINX_UARTLITE diff --git a/include/serial.h b/include/serial.h index 5926244..f047d2f 100644 --- a/include/serial.h +++ b/include/serial.h @@ -31,7 +31,7 @@ extern struct serial_device * default_serial_console (void); defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \ defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \ defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \ -defined(CONFIG_TEGRA2) +defined(CONFIG_TEGRA2) || defined(CONFIG_MICROBLAZE) Am I the only one that thinks this is all really ugly? I hope you mean serial.h not mb code. I agree with you but not sure if we can remove all ifdefs there. Thanks, Michal -- Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] UBI: init eba tables before wl when attaching a device
This fixes that u-boot gets stuck when a bitflip was detected during ubi part ubi_device. If a bitflip was detected UBI tries to copy the PEB to a different place. This needs that the eba table are initialized, but this was done after the wear levelling worker detects the bitflip. So changes the initialisation of these two tasks in u-boot. This is a u-boot specific patch and not needed in the linux layer, because due to commit 1b1f9a9d00447d UBI: Ensure that background thread operations are really executed we schedule these tasks in place and not as in linux after the inital task which schedule this new task is finished. Signed-off-by: Holger Brunck holger.bru...@keymile.com cc: Stefan Roese s...@denx.de --- drivers/mtd/ubi/build.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 3ea0e6c..d144ac2 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -476,21 +476,21 @@ static int attach_by_scanning(struct ubi_device *ubi) if (err) goto out_si; - err = ubi_wl_init_scan(ubi, si); - if (err) - goto out_vtbl; - err = ubi_eba_init_scan(ubi, si); if (err) goto out_wl; + err = ubi_wl_init_scan(ubi, si); + if (err) + goto out_vtbl; + ubi_scan_destroy_si(si); return 0; -out_wl: - ubi_wl_close(ubi); out_vtbl: vfree(ubi-vtbl); +out_wl: + ubi_wl_close(ubi); out_si: ubi_scan_destroy_si(si); return err; -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled
On 10/06/2011 01:36 AM, Ilya Yanok wrote: DaVinci EMAC is present on TI AM35xx SoCs (ARMv7) which run with D-Cache enabled by default. So we have to take care and flush/invalidate the cache before/after the DMA operations. Signed-off-by: Ilya Yanok ya...@emcraft.com Hi Ilya, --- drivers/net/davinci_emac.c | 47 1 files changed, 47 insertions(+), 0 deletions(-) diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 222a0d0..b787213 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c @@ -96,6 +96,40 @@ static volatile u_int8_t active_phy_addr = 0xff; phy_tphy; +#ifdef DAVINCI_EMAC_DCACHE +static inline void davinci_flush(void *addr, int size) +{ + flush_dcache_range((unsigned long)addr, + (unsigned long)addr + size); +} There is no check with the cache linesize. I get this error: ERROR: v7_dcache_inval_range - stop address is not aligned - 0x5c0200a0 Should we not be sure that size is rounded up to align with the cache line size ? Best regards, Stefano Babic -- = DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: off...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] mpc86xx: implement clocks command
From: Prabhakar Lad prabhakar.cse...@gmail.com print the clock information while booting causes additional delay. Implemented the clocks command for printing the CPU, MPX, DDR and LBC frequency info. Signed-off-by: Prabhakar Lad prabhakar.cse...@gmail.com --- arch/powerpc/cpu/mpc86xx/cpu.c | 50 ++- 1 files changed, 33 insertions(+), 17 deletions(-) diff --git a/arch/powerpc/cpu/mpc86xx/cpu.c b/arch/powerpc/cpu/mpc86xx/cpu.c index ffcc8e6..32f9932 100644 --- a/arch/powerpc/cpu/mpc86xx/cpu.c +++ b/arch/powerpc/cpu/mpc86xx/cpu.c @@ -46,7 +46,6 @@ void board_reset(void) __attribute__((weak, alias(__board_reset))); int checkcpu(void) { - sys_info_t sysinfo; uint pvr, svr; uint ver; uint major, minor; @@ -88,22 +87,6 @@ checkcpu(void) printf(, Version: %d.%d, (0x%08x)\n, major, minor, pvr); - get_sys_info(sysinfo); - - puts(Clock Configuration:\n); - printf( CPU:%-4s MHz, , strmhz(buf1, sysinfo.freqProcessor)); - printf(MPX:%-4s MHz\n, strmhz(buf1, sysinfo.freqSystemBus)); - printf( DDR:%-4s MHz (%s MT/s data rate), , - strmhz(buf1, sysinfo.freqSystemBus / 2), - strmhz(buf2, sysinfo.freqSystemBus)); - - if (sysinfo.freqLocalBus LCRR_CLKDIV) { - printf(LBC:%-4s MHz\n, strmhz(buf1, sysinfo.freqLocalBus)); - } else { - printf(LBC: unknown (LCRR[CLKDIV] = 0x%02lx)\n, - sysinfo.freqLocalBus); - } - puts(L1:D-cache 32 KB enabled\n); puts( I-cache 32 KB enabled\n); @@ -219,3 +202,36 @@ void setup_ddr_bat(phys_addr_t dram_size) write_bat(DBAT0, batu, CONFIG_SYS_DBAT0L); write_bat(IBAT0, batu, CONFIG_SYS_IBAT0L); } + +/* + * Dump some core clocks. + */ +int mpc8xx_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + sys_info_t sysinfo; + + get_sys_info(sysinfo); + + printf( CPU:%-4s MHz, , strmhz(buf1, sysinfo.freqProcessor)); + printf(MPX:%-4s MHz\n, strmhz(buf1, sysinfo.freqSystemBus)); + printf( DDR:%-4s MHz (%s MT/s data rate), , + strmhz(buf1, sysinfo.freqSystemBus / 2), + strmhz(buf2, sysinfo.freqSystemBus)); + + if (sysinfo.freqLocalBus LCRR_CLKDIV) { + printf(LBC:%-4s MHz\n, strmhz(buf1, sysinfo.freqLocalBus)); + } else { + printf(LBC: unknown (LCRR[CLKDIV] = 0x%02lx)\n, + sysinfo.freqLocalBus); + } + + return 0; +} + +/***/ + +U_BOOT_CMD( + clocks, CONFIG_SYS_MAXARGS, 1, mpc8xx_showclocks, + Clock Configuration, + clocks +); -- 1.7.0.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RESEND PATCH] mpc86xx: implement clocks command
From: Prabhakar Lad prabhakar.cse...@gmail.com print the clock information while booting causes additional delay. Implemented the clocks command for printing the CPU, MPX, DDR and LBC frequency info. Signed-off-by: Prabhakar Lad prabhakar.cse...@gmail.com --- arch/powerpc/cpu/mpc86xx/cpu.c | 50 ++- 1 files changed, 33 insertions(+), 17 deletions(-) diff --git a/arch/powerpc/cpu/mpc86xx/cpu.c b/arch/powerpc/cpu/mpc86xx/cpu.c index ffcc8e6..32f9932 100644 --- a/arch/powerpc/cpu/mpc86xx/cpu.c +++ b/arch/powerpc/cpu/mpc86xx/cpu.c @@ -46,7 +46,6 @@ void board_reset(void) __attribute__((weak, alias(__board_reset))); int checkcpu(void) { - sys_info_t sysinfo; uint pvr, svr; uint ver; uint major, minor; @@ -88,22 +87,6 @@ checkcpu(void) printf(, Version: %d.%d, (0x%08x)\n, major, minor, pvr); - get_sys_info(sysinfo); - - puts(Clock Configuration:\n); - printf( CPU:%-4s MHz, , strmhz(buf1, sysinfo.freqProcessor)); - printf(MPX:%-4s MHz\n, strmhz(buf1, sysinfo.freqSystemBus)); - printf( DDR:%-4s MHz (%s MT/s data rate), , - strmhz(buf1, sysinfo.freqSystemBus / 2), - strmhz(buf2, sysinfo.freqSystemBus)); - - if (sysinfo.freqLocalBus LCRR_CLKDIV) { - printf(LBC:%-4s MHz\n, strmhz(buf1, sysinfo.freqLocalBus)); - } else { - printf(LBC: unknown (LCRR[CLKDIV] = 0x%02lx)\n, - sysinfo.freqLocalBus); - } - puts(L1:D-cache 32 KB enabled\n); puts( I-cache 32 KB enabled\n); @@ -219,3 +202,36 @@ void setup_ddr_bat(phys_addr_t dram_size) write_bat(DBAT0, batu, CONFIG_SYS_DBAT0L); write_bat(IBAT0, batu, CONFIG_SYS_IBAT0L); } + +/* + * Dump some core clocks. + */ +int mpc8xx_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + sys_info_t sysinfo; + + get_sys_info(sysinfo); + + printf( CPU:%-4s MHz, , strmhz(buf1, sysinfo.freqProcessor)); + printf(MPX:%-4s MHz\n, strmhz(buf1, sysinfo.freqSystemBus)); + printf( DDR:%-4s MHz (%s MT/s data rate), , + strmhz(buf1, sysinfo.freqSystemBus / 2), + strmhz(buf2, sysinfo.freqSystemBus)); + + if (sysinfo.freqLocalBus LCRR_CLKDIV) { + printf(LBC:%-4s MHz\n, strmhz(buf1, sysinfo.freqLocalBus)); + } else { + printf(LBC: unknown (LCRR[CLKDIV] = 0x%02lx)\n, + sysinfo.freqLocalBus); + } + + return 0; +} + +/***/ + +U_BOOT_CMD( + clocks, CONFIG_SYS_MAXARGS, 1, mpc8xx_showclocks, + Clock Configuration, + clocks +); -- 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] microblaze: Enable SERIAL_MULTI
Dear Michal Simek, In message 4e92ce64.5000...@monstr.eu you wrote: defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \ defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \ defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \ -defined(CONFIG_TEGRA2) +defined(CONFIG_TEGRA2) || defined(CONFIG_MICROBLAZE) Am I the only one that thinks this is all really ugly? I hope you mean serial.h not mb code. I agree with you but not sure if we can remove all ifdefs there. The long list of device specific ifdef's should be converted into a single ifdef testing for a specific feature instead. 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 He only drinks when he gets depressed. Why does he get depressed? Sometimes it's because he hasn't had a drink. - Terry Pratchett, _Men at Arms_ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 1/4] macb: initial support for Cadence GEM
The Cadence GEM is based on the MACB Ethernet controller but has a few small changes with regards to register and bitfield placement. This patch detects the presence of a GEM by reading the module ID register and setting a flag appropriately. This handles the new HW address, USRIO and hash register base register locations in GEM. Signed-off-by: Dave Aldridge fovs...@gmail.com --- Changes for v2: - Cleaned up issues reported by checkpatch drivers/net/macb.c | 18 +++- drivers/net/macb.h | 55 2 files changed, 67 insertions(+), 6 deletions(-) diff --git a/drivers/net/macb.c b/drivers/net/macb.c index c63eea9..89491c8 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -88,6 +88,7 @@ struct macb_dma_desc { struct macb_device { void*regs; + int is_gem; unsigned intrx_tail; unsigned inttx_head; @@ -473,18 +474,19 @@ static int macb_init(struct eth_device *netdev, bd_t *bd) defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \ defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \ defined(CONFIG_AT91SAM9XE) - macb_writel(macb, USRIO, MACB_BIT(RMII) | MACB_BIT(CLKEN)); + macb_or_gem_writel(macb, USRIO, (MACB_BIT(RMII) | +MACB_BIT(CLKEN))); #else - macb_writel(macb, USRIO, 0); + macb_or_gem_writel(macb, USRIO, 0); #endif #else #ifdefined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \ defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \ defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \ defined(CONFIG_AT91SAM9XE) - macb_writel(macb, USRIO, MACB_BIT(CLKEN)); + macb_or_gem_writel(macb, USRIO, MACB_BIT(CLKEN)); #else - macb_writel(macb, USRIO, MACB_BIT(MII)); + macb_or_gem_writel(macb, USRIO, MACB_BIT(MII)); #endif #endif /* CONFIG_RMII */ @@ -524,9 +526,9 @@ static int macb_write_hwaddr(struct eth_device *dev) /* set hardware address */ hwaddr_bottom = dev-enetaddr[0] | dev-enetaddr[1] 8 | dev-enetaddr[2] 16 | dev-enetaddr[3] 24; - macb_writel(macb, SA1B, hwaddr_bottom); + macb_or_gem_writel(macb, SA1B, hwaddr_bottom); hwaddr_top = dev-enetaddr[4] | dev-enetaddr[5] 8; - macb_writel(macb, SA1T, hwaddr_top); + macb_or_gem_writel(macb, SA1T, hwaddr_top); return 0; } @@ -581,6 +583,10 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr) macb_writel(macb, NCFGR, ncfgr); + /* Cadence GEM has a module ID of 2. */ + if (MACB_BFEXT(IDNUM, macb_readl(macb, MID)) == 0x2) + macb-is_gem = 1; + eth_register(netdev); #if defined(CONFIG_CMD_MII) diff --git a/drivers/net/macb.h b/drivers/net/macb.h index f92a20c..a2913f2 100644 --- a/drivers/net/macb.h +++ b/drivers/net/macb.h @@ -71,6 +71,15 @@ #define MACB_TPQ 0x00bc #define MACB_USRIO 0x00c0 #define MACB_WOL 0x00c4 +#define MACB_MID 0x00fc + +/* GEM register offsets. */ +#define GEM_NCFGR 0x0004 +#define GEM_USRIO 0x000c +#define GEM_HRB0x0080 +#define GEM_HRT0x0084 +#define GEM_SA1B 0x0088 +#define GEM_SA1T 0x008C /* Bitfields in NCR */ #define MACB_LB_OFFSET 0 @@ -240,6 +249,12 @@ #define MACB_WOL_MTI_OFFSET19 #define MACB_WOL_MTI_SIZE 1 +/* Bitfields in MID */ +#define MACB_IDNUM_OFFSET 16 +#define MACB_IDNUM_SIZE16 +#define MACB_REV_OFFSET0 +#define MACB_REV_SIZE 16 + /* Constants for CLK */ #define MACB_CLK_DIV8 0 #define MACB_CLK_DIV16 1 @@ -266,10 +281,50 @@ MACB_##name##_OFFSET)) \ | MACB_BF(name,value)) +#define GEM_BIT(name) \ + (1 GEM_##name##_OFFSET) +#define GEM_BF(name, value)\ + (((value) ((1 GEM_##name##_SIZE) - 1)) \ + GEM_##name##_OFFSET) +#define GEM_BFEXT(name, value)\ + (((value) GEM_##name##_OFFSET) \ + ((1 GEM_##name##_SIZE) - 1)) +#define GEM_BFINS(name, value, old)\ + (((old) ~(((1 GEM_##name##_SIZE) - 1) \ +GEM_##name##_OFFSET))\ +| GEM_BF(name, value)) + /* Register access macros */ #define macb_readl(port,reg) \
[U-Boot] [PATCH v2 4/4] macb: allow GEM to have configurable receive buffer size
GEM has configurable receive buffer sizes so requires this to be programmed up. Signed-off-by: Dave Aldridge fovs...@gmail.com --- drivers/net/macb.c | 19 +++ drivers/net/macb.h |5 + 2 files changed, 24 insertions(+), 0 deletions(-) diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 36f0a0f..de52c09 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -436,6 +436,23 @@ static int macb_phy_init(struct macb_device *macb) } } +/* + * Configure the receive DMA engine to use the correct receive buffer size. + * This is a configurable parameter for GEM. + */ +static void macb_configure_dma(struct macb_device *macb) +{ + u32 dmacfg; + u32 rx_ring_buf_size = CONFIG_SYS_MACB_RX_BUFFER_SIZE / + CONFIG_SYS_MACB_RX_RING_SIZE; + + if (macb-is_gem) { + dmacfg = gem_readl(macb, DMACFG) ~GEM_BF(RXBS, -1L); + dmacfg |= GEM_BF(RXBS, rx_ring_buf_size / 64); + gem_writel(macb, DMACFG, dmacfg); + } +} + static int macb_init(struct eth_device *netdev, bd_t *bd) { struct macb_device *macb = to_macb(netdev); @@ -465,6 +482,8 @@ static int macb_init(struct eth_device *netdev, bd_t *bd) } macb-rx_tail = macb-tx_head = macb-tx_tail = 0; + macb_configure_dma(macb); + macb_writel(macb, RBQP, macb-rx_ring_dma); macb_writel(macb, TBQP, macb-tx_ring_dma); diff --git a/drivers/net/macb.h b/drivers/net/macb.h index c0759cf..e0fbd46 100644 --- a/drivers/net/macb.h +++ b/drivers/net/macb.h @@ -76,6 +76,7 @@ /* GEM register offsets. */ #define GEM_NCFGR 0x0004 #define GEM_USRIO 0x000c +#define GEM_DMACFG 0x0010 #define GEM_HRB0x0080 #define GEM_HRT0x0084 #define GEM_SA1B 0x0088 @@ -165,6 +166,10 @@ #define GEM_DBW64 1 #define GEM_DBW128 2 +/* Bitfields in DMACFG. */ +#define GEM_RXBS_OFFSET16 +#define GEM_RXBS_SIZE 8 + /* Bitfields in NSR */ #define MACB_NSR_LINK_OFFSET 0 #define MACB_NSR_LINK_SIZE 1 -- 1.7.3.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 3/4] macb: support DMA bus widths 32 bits
Some GEM implementations may support DMA bus widths up to 128 bits. We can get the maximum supported DMA bus width from the design configuration register so use that to program the device up. Signed-off-by: Dave Aldridge fovs...@gmail.com --- drivers/net/macb.c | 25 + drivers/net/macb.h | 18 ++ 2 files changed, 43 insertions(+), 0 deletions(-) diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 07d1ba8..36f0a0f 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -574,6 +574,27 @@ static u32 macb_mdc_clk_div(struct macb_device *macb, int id) return ncfgr; } +/* + * Get the DMA bus width field of the network configuration register that we + * should program. We find the width from decoding the design configuration + * register to find the maximum supported data bus width. + */ +static u32 macb_dbw(struct macb_device *macb) +{ + if (!macb-is_gem) + return 0; + + switch (GEM_BFEXT(DBWDEF, gem_readl(macb, DCFG1))) { + case 4: + return GEM_BF(DBW, GEM_DBW128); + case 2: + return GEM_BF(DBW, GEM_DBW64); + case 1: + default: + return GEM_BF(DBW, GEM_DBW32); + } +} + int macb_eth_initialize(int id, void *regs, unsigned int phy_addr) { struct macb_device *macb; @@ -614,6 +635,10 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr) /* Set MII management clock divider */ ncfgr = macb_mdc_clk_div(macb, id); + + /* Set up the DMA bus width */ + ncfgr |= macb_dbw(macb); + macb_writel(macb, NCFGR, ncfgr); eth_register(netdev); diff --git a/drivers/net/macb.h b/drivers/net/macb.h index b08a057..c0759cf 100644 --- a/drivers/net/macb.h +++ b/drivers/net/macb.h @@ -80,6 +80,13 @@ #define GEM_HRT0x0084 #define GEM_SA1B 0x0088 #define GEM_SA1T 0x008C +#define GEM_DCFG1 0x0280 +#define GEM_DCFG2 0x0284 +#define GEM_DCFG3 0x0288 +#define GEM_DCFG4 0x028c +#define GEM_DCFG5 0x0290 +#define GEM_DCFG6 0x0294 +#define GEM_DCFG7 0x0298 /* Bitfields in NCR */ #define MACB_LB_OFFSET 0 @@ -150,6 +157,13 @@ /* GEM specific NCFGR bitfields. */ #define GEM_CLK_OFFSET 18 #define GEM_CLK_SIZE 3 +#define GEM_DBW_OFFSET 21 +#define GEM_DBW_SIZE 2 + +/* Constants for data bus width. */ +#define GEM_DBW32 0 +#define GEM_DBW64 1 +#define GEM_DBW128 2 /* Bitfields in NSR */ #define MACB_NSR_LINK_OFFSET 0 @@ -259,6 +273,10 @@ #define MACB_REV_OFFSET0 #define MACB_REV_SIZE 16 +/* Bitfields in DCFG1. */ +#define GEM_DBWDEF_OFFSET 25 +#define GEM_DBWDEF_SIZE3 + /* Constants for CLK */ #define MACB_CLK_DIV8 0 #define MACB_CLK_DIV16 1 -- 1.7.3.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled
Hi Stefano, On 10.10.2011 16:35, Stefano Babic wrote: +#ifdef DAVINCI_EMAC_DCACHE +static inline void davinci_flush(void *addr, int size) +{ +flush_dcache_range((unsigned long)addr, +(unsigned long)addr + size); +} There is no check with the cache linesize. I get this error: ERROR: v7_dcache_inval_range - stop address is not aligned - 0x5c0200a0 Should we not be sure that size is rounded up to align with the cache line size ? Surely we should. Actually it's not the size that has to be aligned but the buffer itself. Is there any generic API to get the cache line size? For now I've just hardcoded the 64 byte alignment but this seems to be not perfect solution... Regards, Ilya. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled
On 10/10/2011 03:03 PM, Ilya Yanok wrote: Hi Stefano, Hi Ilya, On 10.10.2011 16:35, Stefano Babic wrote: +#ifdef DAVINCI_EMAC_DCACHE +static inline void davinci_flush(void *addr, int size) +{ + flush_dcache_range((unsigned long)addr, + (unsigned long)addr + size); +} There is no check with the cache linesize. I get this error: ERROR: v7_dcache_inval_range - stop address is not aligned - 0x5c0200a0 Should we not be sure that size is rounded up to align with the cache line size ? Surely we should. Actually it's not the size that has to be aligned but the buffer itself. Is there any generic API to get the cache line size? There is a CONFIG_SYS_CACHELINE_SIZE. However, I see recent patches that can help in our case ( cache: add ALLOC_CACHE_ALIGN_BUFFER macro): http://patchwork.ozlabs.org/patch/117698/ Wolfgang replied he has already applied, but I have not yet seen on u-boot TOT. Regards, Stefano -- = DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: off...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled
Dear Stefano Babic, In message 4e92f05f.4030...@denx.de you wrote: There is a CONFIG_SYS_CACHELINE_SIZE. However, I see recent patches that can help in our case ( cache: add ALLOC_CACHE_ALIGN_BUFFER macro): http://patchwork.ozlabs.org/patch/117698/ Wolfgang replied he has already applied, but I have not yet seen on u-boot TOT. See the rest of the thread. I had applied this patch set to a loal tree, but it was breaking hundreds of systems, so had to back out the patches again. I'm eager to get this code in myself, but it needs to be compile-clean at least and harmless to all boards that don't actually reference that code. 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 modem is a baudy house. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] NAND: davinci: choose correct 1-bit h/w ECC reg
On Mon, Sep 26, 2011 at 04:02:30PM +, Laurence Withers wrote: In nand_davinci_readecc(), select the correct NANDFnECC register based on CONFIG_SYS_NAND_CS rather than hardcoding the choice of NANDF1ECC. This allows 1-bit hardware ECC to work with chip select other than CS2. Note this now matches the usage in nand_davinci_enable_hwecc(), which already had the correct handling, and allows refactoring to a single function encapsulating the register read. Without this fix, writing NAND pages to a chip not wired to CS2 would result in in the ECC calculation always returning FF for each 512-byte segment, and reading back a correctly written page (one with ECC intact) would always fail. With this fix, the ECC is written and verified correctly. Signed-off-by: Laurence Withers lwith...@guralp.com Does anybody have any comments on this bugfix? If not, can it be accepted? Many thanks, and bye for now, -- Laurence Withers, lwith...@guralp.comhttp://www.guralp.com/ Direct tel:+447753988197 or tel:+44408643 Software Engineer General support queries: supp...@guralp.com CMG-DCM CMG-EAM CMG-NAM ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] (no subject)
Hi victor, how to reset or re program this part item s29gl064n90tf103.. can you please help me Do you really expect us that we understand what your problem us? I for one have got no clue what you want to do and so I seen no way in helping you. If you want help from others, a well posed question[1] will be a neccessary prerequisite. Cheers Detlev [1] http://catb.org/~esr/faqs/smart-questions.html -- Per Anhalter durch die Galaxis hat den gewissen Effekt, den auch eine Sendung von Monty Python auslöst; es läßt alles, was direkt danach in Radio, im Fern- sehen oder sonstwo auftaucht, absolut lächerlich wirken. Es hat dieses gewisse Etwas, das alles in einem gereinigten Licht erscheinen läßt. - Robert Cushman -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 1/2] mmc: change magic number to macro define
Hi Wolfgang, On Fri, Oct 7, 2011 at 1:39 AM, Wolfgang Denk w...@denx.de wrote: Dear Lei Wen, In message calzhosrhbf2vmu5olp3hwh4yq4xfip19ajd24gn4sy-rm6b...@mail.gmail.com you wrote: The ext_csd current usage in mmc.c is not too much, here I mean only few of the fields of the ext_csd is used, also fully definition of ext_csd member would seems so huge a structure at its appearence... So macro may looks more concise and could parse from its meaning easily eno= ugh. We do not accept (typeless) register offset definitions. Please use a struct, so the compiler has a chance to perform type checking. I check the code again, and find there is a reason for previous defined macro to use. That is those register offset defined as macro may need later passing as a function parameter like: err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING, 1); So if the ext_csd change to structure, maybe the function call here don't looks like so concise as before... What do you think for this? Thanks, Lei ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Introduce generic TPM support in u-boot
On Monday 10 October 2011 06:50:31 Wolfgang Denk wrote: Mike Frysinger wrote: simplify this with one line: #define tpm_debug(fmt, args...) debug(lpc_tpm: fmt, ## args) This would break as soon as anybody passes a variable for fmt. true, but tpm_debug() is local to this file, and if no one does that here, then i don't think it's a problem. using variables to hold format strings is fairly uncommon. -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] microblaze: Enable SERIAL_MULTI
On Monday 10 October 2011 08:57:28 Wolfgang Denk wrote: Michal Simek wrote: defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \ defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \ defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \ -defined(CONFIG_TEGRA2) +defined(CONFIG_TEGRA2) || defined(CONFIG_MICROBLAZE) Am I the only one that thinks this is all really ugly? I hope you mean serial.h not mb code. I agree with you but not sure if we can remove all ifdefs there. The long list of device specific ifdef's should be converted into a single ifdef testing for a specific feature instead. it's driver specific code in this file, so it doesn't make much sense to have the board config define something just to get these prototypes i do agree that this multi serial code is all very ugly ... -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V3 05/13] i2c: Create common default i2c_set_bus_num() function
On Monday 10 October 2011 06:50:12 Stefano Babic wrote: +int __def_i2c_set_bus_num(unsigned int bus) +{ + return 0; +} +int i2c_set_bus_num(unsigned int) + __attribute__((weak, alias(__def_i2c_set_bus_num))); any reason this can't just be: __weak int i2c_set_bus_num(unsigned int bus) { return 0; } i can understand having a default func when it actually does something, but i don't see much value in a stub that returns 0 -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled
On Monday 10 October 2011 09:39:16 Wolfgang Denk wrote: Stefano Babic wrote: There is a CONFIG_SYS_CACHELINE_SIZE. However, I see recent patches that can help in our case ( cache: add ALLOC_CACHE_ALIGN_BUFFER macro): http://patchwork.ozlabs.org/patch/117698/ Wolfgang replied he has already applied, but I have not yet seen on u-boot TOT. See the rest of the thread. I had applied this patch set to a loal tree, but it was breaking hundreds of systems, so had to back out the patches again. I'm eager to get this code in myself, but it needs to be compile-clean at least and harmless to all boards that don't actually reference that code. sorry, but the rest of what thread ? i missed that there were issues and was wondering why they weren't in the published master branch yet ... -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] mx31pdk: Remove unneeded config
Hi Wolfgang, On Tue, Sep 13, 2011 at 8:10 AM, Stefano Babic sba...@denx.de wrote: On 09/12/2011 06:32 PM, Fabio Estevam wrote: Currently there are two config options for building a U-boot binary for MX31PDK: make mx31pdk_config or, make mx31pdk_nand_config mx31pdk_config was developed first when no NAND SPL support was available for MX31 and it requires that the U-boot binary is loaded into RAM via JTAG and it forces SKIP_LOWLEVEL_INIT. mx31pdk_nand_config was added later and it allows booting from NAND Flash. Leave just one config option called mx31pdk so that it produces a binary that can boot from NAND Flash. Signed-off-by: Fabio Estevam fabio.este...@freescale.com Agree, nand is the only way to boot this board. Acked-by: Stefano Babic sba...@denx.de Ping? Regards, Fabio Estevam ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V3 05/13] i2c: Create common default i2c_set_bus_num() function
On 10/10/2011 05:19 PM, Mike Frysinger wrote: On Monday 10 October 2011 06:50:12 Stefano Babic wrote: Hi Mike, +int __def_i2c_set_bus_num(unsigned int bus) +{ +return 0; +} +int i2c_set_bus_num(unsigned int) +__attribute__((weak, alias(__def_i2c_set_bus_num))); any reason this can't just be: __weak int i2c_set_bus_num(unsigned int bus) { return 0; } i can understand having a default func when it actually does something, but i don't see much value in a stub that returns 0 It seems to me that this is the commonly used style in u-boot. The same happens for the i2c_init_board, some lines before, and in a lot of other modules: void __def_i2c_init_board(void) { return; } void i2c_init_board(void) __attribute__((weak, alias(__def_i2c_init_board))); Simply grepping in u-boot code, the default function is defined even if it does nothing, Regards, Stefano -- = DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: off...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/3] USB keyboard driver rework (round 2)
This series reworks the common/usb_kbd.c driver. The code in the driver was messy so this is mostly cleanup and reorganisation. NOTE: I don't consider it a V2 of the previous series because the patch 1/2 from the old series is no longer present and there were also some changes in the dead code introduced by this series (coding style fixes). This depends on previous patches: [PATCH V2] USB: Add functionality to poll the USB keyboard via control EP Message-Id: 1316977237-8709-1-git-send-email-marek.va...@gmail.com [PATCH V2] USB: Add usb_event_poll() to get keyboards working with EHCI Message-Id: 1316977676-10284-1-git-send-email-marek.va...@gmail.com Cc: Mike Frysinger vap...@gentoo.org Cc: Remy Bohmer li...@bohmer.net Cc: Wolfgang Denk w...@denx.de Marek Vasut (3): USB: Squash checkpatch warnings in usb_kbd.c USB: Rework usb_kbd.c USB: Drop dead code from usb_kbd.c common/usb_kbd.c | 976 +++--- 1 files changed, 346 insertions(+), 630 deletions(-) -- 1.7.6.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/3] USB: Drop dead code from usb_kbd.c
Signed-off-by: Marek Vasut marek.va...@gmail.com Cc: Mike Frysinger vap...@gentoo.org Cc: Remy Bohmer li...@bohmer.net Cc: Wolfgang Denk w...@denx.de --- common/usb_kbd.c | 379 -- 1 files changed, 0 insertions(+), 379 deletions(-) diff --git a/common/usb_kbd.c b/common/usb_kbd.c index 94c8894..670d953 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -506,382 +506,3 @@ int usb_kbd_deregister(void) return 1; #endif } - -#if 0 -struct usb_hid_descriptor { - unsigned char bLength; - unsigned char bDescriptorType; /* 0x21 for HID */ - unsigned short bcdHID; /* release number */ - unsigned char bCountryCode; - unsigned char bNumDescriptors; - unsigned char bReportDescriptorType; - unsigned short wDescriptorLength; -} __packed; - -/* - * We parse each description item into this structure. Short items data - * values are expanded to 32-bit signed int, long items contain a pointer - * into the data area. - */ - -struct hid_item { - unsigned char format; - unsigned char size; - unsigned char type; - unsigned char tag; - union { - unsigned char u8; - chars8; - unsigned short u16; - short s16; - unsigned long u32; - longs32; - unsigned char *longdata; - } data; -}; - -/* - * HID report item format - */ - -#define HID_ITEM_FORMAT_SHORT 0 -#define HID_ITEM_FORMAT_LONG 1 - -/* - * Special tag indicating long items - */ - -#define HID_ITEM_TAG_LONG 15 - - -static struct usb_hid_descriptor usb_kbd_hid_desc; - -void usb_kbd_display_hid(struct usb_hid_descriptor *hid) -{ - printf(USB_HID_DESC:\n); - printf( bLenght 0x%x\n, hid-bLength); - printf( bcdHID0x%x\n, hid-bcdHID); - printf( bCountryCode %d\n, hid-bCountryCode); - printf( bNumDescriptors 0x%x\n, hid-bNumDescriptors); - printf( bReportDescriptorType 0x%x\n, hid-bReportDescriptorType); - printf( wDescriptorLength 0x%x\n, hid-wDescriptorLength); -} - - -/* - * Fetch a report description item from the data stream. We support long - * items, though they are not used yet. - */ - -static int fetch_item(unsigned char *start, unsigned char *end, - struct hid_item *item) -{ - if ((end - start) 0) { - unsigned char b = *start++; - item-type = (b 2) 3; - item-tag = (b 4) 15; - if (item-tag == HID_ITEM_TAG_LONG) { - item-format = HID_ITEM_FORMAT_LONG; - if ((end - start) = 2) { - item-size = *start++; - item-tag = *start++; - if ((end - start) = item-size) { - item-data.longdata = start; - start += item-size; - return item-size; - } - } - } else { - item-format = HID_ITEM_FORMAT_SHORT; - item-size = b 3; - switch (item-size) { - case 0: - return item-size; - case 1: - if ((end - start) = 1) { - item-data.u8 = *start++; - return item-size; - } - break; - case 2: - if ((end - start) = 2) { - item-data.u16 = le16_to_cpu( - (unsigned short *)start); - start += 2; - return item-size; - } - case 3: - item-size++; - if ((end - start) = 4) { - item-data.u32 = le32_to_cpu( - (unsigned long *)start); - start += 4; - return item-size; - } - } - } - } - return -1; -} - -/* - * HID report descriptor item type (prefix bit 2, 3) - */ - -#define HID_ITEM_TYPE_MAIN 0 -#define HID_ITEM_TYPE_GLOBAL 1 -#define HID_ITEM_TYPE_LOCAL2 -#define HID_ITEM_TYPE_RESERVED 3 -/* - * HID report descriptor main item tags - */ - -#define HID_MAIN_ITEM_TAG_INPUT8 -#define HID_MAIN_ITEM_TAG_OUTPUT 9 -#define
[U-Boot] [PATCH 1/3] USB: Squash checkpatch warnings in usb_kbd.c
Signed-off-by: Marek Vasut marek.va...@gmail.com Cc: Mike Frysinger vap...@gentoo.org Cc: Remy Bohmer li...@bohmer.net Cc: Wolfgang Denk w...@denx.de --- common/usb_kbd.c | 608 -- 1 files changed, 319 insertions(+), 289 deletions(-) diff --git a/common/usb_kbd.c b/common/usb_kbd.c index 503d175..0679420 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -32,70 +32,74 @@ #undef USB_KBD_DEBUG /* - * if overwrite_console returns 1, the stdin, stderr and stdout + * If overwrite_console returns 1, the stdin, stderr and stdout * are switched to the serial port, else the settings in the * environment are used */ #ifdef CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE -extern int overwrite_console (void); +extern int overwrite_console(void); #else -int overwrite_console (void) +int overwrite_console(void) { - return (0); + return 0; } #endif -#ifdef USB_KBD_DEBUG -#defineUSB_KBD_PRINTF(fmt,args...) printf (fmt ,##args) +#ifdef USB_KBD_DEBUG +#define USB_KBD_PRINTF(fmt, args...) printf(fmt, ##args) #else -#define USB_KBD_PRINTF(fmt,args...) +#define USB_KBD_PRINTF(fmt, args...) #endif -#define REPEAT_RATE 40/4 /* 40msec - 25cps */ -#define REPEAT_DELAY 10 /* 10 x REAPEAT_RATE = 400msec */ +#define REPEAT_RATE(40/4) /* 40msec - 25cps */ +#define REPEAT_DELAY 10 /* 10 x REPEAT_RATE = 400msec */ #define NUM_LOCK 0x53 -#define CAPS_LOCK 0x39 -#define SCROLL_LOCK 0x47 +#define CAPS_LOCK 0x39 +#define SCROLL_LOCK0x47 /* Modifier bits */ #define LEFT_CNTR 0 -#define LEFT_SHIFT 1 +#define LEFT_SHIFT 1 #define LEFT_ALT 2 #define LEFT_GUI 3 -#define RIGHT_CNTR 4 -#define RIGHT_SHIFT5 +#define RIGHT_CNTR 4 +#define RIGHT_SHIFT5 #define RIGHT_ALT 6 #define RIGHT_GUI 7 -#define USB_KBD_BUFFER_LEN 0x20 /* size of the keyboardbuffer */ +#define USB_KBD_BUFFER_LEN 0x20/* size of the keyboardbuffer */ -static volatile char usb_kbd_buffer[USB_KBD_BUFFER_LEN]; -static volatile int usb_in_pointer = 0; -static volatile int usb_out_pointer = 0; +static char usb_kbd_buffer[USB_KBD_BUFFER_LEN]; +static int usb_in_pointer; +static int usb_out_pointer; unsigned char new[8]; unsigned char old[8]; int repeat_delay; -#define DEVNAME usbkbd -static unsigned char num_lock = 0; -static unsigned char caps_lock = 0; -static unsigned char scroll_lock = 0; -static unsigned char ctrl = 0; +#define DEVNAMEusbkbd +static unsigned char num_lock; +static unsigned char caps_lock; +static unsigned char scroll_lock; +static unsigned char ctrl; -static unsigned char leds __attribute__ ((aligned (0x4))); +static unsigned char leds __attribute__((aligned(0x4))); static unsigned char usb_kbd_numkey[] = { -'1', '2', '3', '4', '5', '6', '7', '8', '9', '0','\r',0x1b,'\b','\t',' ', '-', -'=', '[', ']','\\', '#', ';', '\'', '`', ',', '.', '/' + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', + '\r', 0x1b, '\b', '\t', ' ', '-', '=', '[', ']', + '\\', '#', ';', '\'', '`', ',', '.', '/' }; + static unsigned char usb_kbd_numkey_shifted[] = { -'!', '@', '#', '$', '%', '^', '', '*', '(', ')','\r',0x1b,'\b','\t',' ', '_', -'+', '{', '}', '|', '~', ':', '', '~', '', '', '?' + '!', '@', '#', '$', '%', '^', '', '*', '(', ')', + '\r', 0x1b, '\b', '\t', ' ', '_', '+', '{', '}', + '|', '~', ':', '', '~', '', '', '?' }; + static int usb_kbd_irq_worker(struct usb_device *dev); /** @@ -122,18 +126,17 @@ static inline void usb_kbd_poll_for_event(struct usb_device *dev) /* puts character in the queue and sets up the in and out pointer */ static void usb_kbd_put_queue(char data) { - if((usb_in_pointer+1)==USB_KBD_BUFFER_LEN) { - if(usb_out_pointer==0) { + if ((usb_in_pointer+1) == USB_KBD_BUFFER_LEN) { + if (usb_out_pointer == 0) return; /* buffer full */ - } else{ - usb_in_pointer=0; - } + else + usb_in_pointer = 0; } else { - if((usb_in_pointer+1)==usb_out_pointer) + if ((usb_in_pointer+1) == usb_out_pointer) return; /* buffer full */ usb_in_pointer++; } - usb_kbd_buffer[usb_in_pointer]=data; + usb_kbd_buffer[usb_in_pointer] = data; return; } @@ -148,10 +151,10 @@ static int usb_kbd_testc(void) usb_kbd_poll_for_event(usb_kbd_dev); - if(usb_in_pointer==usb_out_pointer) - return(0); /* no data */ + if (usb_in_pointer == usb_out_pointer) + return 0; /* no data */ else - return(1); + return 1; } /* gets
[U-Boot] [PATCH 2/3] USB: Rework usb_kbd.c
* Support dynamic allocation of devices * Passing data via usb device privptr * Reorder functions to avoid forward declarations * Introduce generic polling mechanism to fix musb and ehci-hcd breakage due to using extern new; to access keyboard driver data! Signed-off-by: Marek Vasut marek.va...@gmail.com Cc: Mike Frysinger vap...@gentoo.org Cc: Remy Bohmer li...@bohmer.net Cc: Wolfgang Denk w...@denx.de --- common/usb_kbd.c | 593 ++ 1 files changed, 329 insertions(+), 264 deletions(-) diff --git a/common/usb_kbd.c b/common/usb_kbd.c index 0679420..94c8894 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -25,12 +25,18 @@ * */ #include common.h +#include malloc.h #include stdio_dev.h #include asm/byteorder.h #include usb.h -#undef USB_KBD_DEBUG +#ifdef USB_KBD_DEBUG +#define USB_KBD_PRINTF(fmt, args...) printf(fmt, ##args) +#else +#define USB_KBD_PRINTF(fmt, args...) +#endif + /* * If overwrite_console returns 1, the stdin, stderr and stdout * are switched to the serial port, else the settings in the @@ -45,351 +51,258 @@ int overwrite_console(void) } #endif -#ifdef USB_KBD_DEBUG -#define USB_KBD_PRINTF(fmt, args...) printf(fmt, ##args) -#else -#define USB_KBD_PRINTF(fmt, args...) -#endif - - -#define REPEAT_RATE(40/4) /* 40msec - 25cps */ -#define REPEAT_DELAY 10 /* 10 x REPEAT_RATE = 400msec */ +/* Keyboard sampling rate */ +#define REPEAT_RATE(40 / 4)/* 40msec - 25cps */ +#define REPEAT_DELAY 10 /* 10 x REPEAT_RATE = 400msec */ #define NUM_LOCK 0x53 #define CAPS_LOCK 0x39 #define SCROLL_LOCK0x47 - /* Modifier bits */ -#define LEFT_CNTR 0 -#define LEFT_SHIFT 1 -#define LEFT_ALT 2 -#define LEFT_GUI 3 -#define RIGHT_CNTR 4 -#define RIGHT_SHIFT5 -#define RIGHT_ALT 6 -#define RIGHT_GUI 7 - -#define USB_KBD_BUFFER_LEN 0x20/* size of the keyboardbuffer */ - -static char usb_kbd_buffer[USB_KBD_BUFFER_LEN]; -static int usb_in_pointer; -static int usb_out_pointer; - -unsigned char new[8]; -unsigned char old[8]; -int repeat_delay; +#define LEFT_CNTR (1 0) +#define LEFT_SHIFT (1 1) +#define LEFT_ALT (1 2) +#define LEFT_GUI (1 3) +#define RIGHT_CNTR (1 4) +#define RIGHT_SHIFT(1 5) +#define RIGHT_ALT (1 6) +#define RIGHT_GUI (1 7) + +/* Size of the keyboard buffer */ +#define USB_KBD_BUFFER_LEN 0x20 + +/* Device name */ #define DEVNAMEusbkbd -static unsigned char num_lock; -static unsigned char caps_lock; -static unsigned char scroll_lock; -static unsigned char ctrl; - -static unsigned char leds __attribute__((aligned(0x4))); -static unsigned char usb_kbd_numkey[] = { +/* Keyboard maps */ +static const unsigned char usb_kbd_numkey[] = { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '\r', 0x1b, '\b', '\t', ' ', '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',', '.', '/' }; -static unsigned char usb_kbd_numkey_shifted[] = { +static const unsigned char usb_kbd_numkey_shifted[] = { '!', '@', '#', '$', '%', '^', '', '*', '(', ')', '\r', 0x1b, '\b', '\t', ' ', '_', '+', '{', '}', '|', '~', ':', '', '~', '', '', '?' }; +/* + * NOTE: It's important for the NUM, CAPS, SCROLL-lock bits to be in this + * order. See usb_kbd_setled() function! + */ +#define USB_KBD_NUMLOCK(1 0) +#define USB_KBD_CAPSLOCK (1 1) +#define USB_KBD_SCROLLLOCK (1 2) +#define USB_KBD_CTRL (1 3) -static int usb_kbd_irq_worker(struct usb_device *dev); - -/** - * Interrupt polling - **/ -static inline void usb_kbd_poll_for_event(struct usb_device *dev) -{ -#ifdefined(CONFIG_SYS_USB_EVENT_POLL) - usb_event_poll(); - usb_kbd_irq_worker(dev); -#elif defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP) - struct usb_interface *iface; - iface = dev-config.if_desc[0]; - usb_get_report(dev, iface-desc.bInterfaceNumber, - 1, 1, new, sizeof(new)); - if (memcmp(old, new, sizeof(new))) - usb_kbd_irq_worker(dev); -#endif -} +#define USB_KBD_LEDMASK\ + (USB_KBD_NUMLOCK | USB_KBD_CAPSLOCK | USB_KBD_SCROLLLOCK) -/** - * Queue handling - **/ -/* puts character in the queue and sets up the in and out pointer */ -static void usb_kbd_put_queue(char data) -{ - if ((usb_in_pointer+1) == USB_KBD_BUFFER_LEN) { - if (usb_out_pointer == 0) - return; /* buffer full */ - else - usb_in_pointer = 0; - } else { -
Re: [U-Boot] [PATCH] mx31pdk: Remove unneeded config
On 10/10/2011 05:28 PM, Fabio Estevam wrote: Hi Wolfgang, On Tue, Sep 13, 2011 at 8:10 AM, Stefano Babic sba...@denx.de wrote: On 09/12/2011 06:32 PM, Fabio Estevam wrote: Currently there are two config options for building a U-boot binary for MX31PDK: make mx31pdk_config or, make mx31pdk_nand_config mx31pdk_config was developed first when no NAND SPL support was available for MX31 and it requires that the U-boot binary is loaded into RAM via JTAG and it forces SKIP_LOWLEVEL_INIT. mx31pdk_nand_config was added later and it allows booting from NAND Flash. Leave just one config option called mx31pdk so that it produces a binary that can boot from NAND Flash. Signed-off-by: Fabio Estevam fabio.este...@freescale.com Agree, nand is the only way to boot this board. Acked-by: Stefano Babic sba...@denx.de Ping? Sorry, your patch is in my queue and I have not yet merged because I needed the other patches (Makefile: remove mx31pdk exception and Makefile: drop imx31_phycore from general Makefile) to apply it. They are now in mainline, so I can merge it. Best regards, Stefano Babic -- = DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: off...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] mx31pdk: Remove unneeded config
On 09/12/2011 06:32 PM, Fabio Estevam wrote: Currently there are two config options for building a U-boot binary for MX31PDK: make mx31pdk_config or, make mx31pdk_nand_config mx31pdk_config was developed first when no NAND SPL support was available for MX31 and it requires that the U-boot binary is loaded into RAM via JTAG and it forces SKIP_LOWLEVEL_INIT. mx31pdk_nand_config was added later and it allows booting from NAND Flash. Leave just one config option called mx31pdk so that it produces a binary that can boot from NAND Flash. Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- Applied to u-boot-imx, thanks. Best regards, Stefano Babic -- = DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: off...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 4/4] tegra2: Add support for Ventana
Simon Glass wrote at Friday, October 07, 2011 6:03 PM: On Thu, Oct 6, 2011 at 10:53 AM, Stephen Warren swar...@nvidia.com wrote: Ventana is a board which is very similar to Seaboard. Support it by re-using board/nvidia/seaboard/seaboard.c with minor run-time conditionals. ... diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c index be6ed12..260a56d 100644 --- a/board/nvidia/seaboard/seaboard.c +++ b/board/nvidia/seaboard/seaboard.c @@ -31,10 +31,10 @@ #endif /* - * Routine: gpio_config_uart + * Routine: gpio_config_uart_seaboard * Description: Force GPIO_PI3 low on Seaboard so UART4 works. */ -void gpio_config_uart(void) +void gpio_config_uart_seaboard(void) { int gp = GPIO_PI3; struct gpio_ctlr *gpio = (struct gpio_ctlr *)NV_PA_GPIO_BASE; @@ -55,6 +55,13 @@ void gpio_config_uart(void) writel(val, bank-gpio_dir_out[GPIO_PORT(gp)]); } +void gpio_config_uart(void) +{ + if (machine_is_ventana()) + return; + gpio_config_uart_seaboard(); +} Would it not be better to define a new board file ventana.c, as has been done with harmony? Is it because you are wanting to share gpio_config_mmc()? But you have written it out again for Harmony. Ventana and Seaboard are extremely similar boards; even as more features are supported, I imagine that a separate seaboard.c and ventana.c would continue to be mostly identical. The Linux kernel board files support Ventana within the Seaboard board file (alongside a few other similar boards) for this reason. Yes, harmony.c has its own copy of pin_mux_mmc()/board_mmc_init(); that's because Harmony's MMC configuration is at least partially different to Seaboard/Ventana's. -- nvpublic ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 1/2] mmc: change magic number to macro define
Dear Lei Wen, In message CALZhoSQbvKj0MtqryeHX-4LkvQJR2=b9u_m4yjjfm1mjv2m...@mail.gmail.com you wrote: So macro may looks more concise and could parse from its meaning easily eno= ugh. We do not accept (typeless) register offset definitions. Please use a struct, so the compiler has a chance to perform type checking. I check the code again, and find there is a reason for previous defined macro to use. That is those register offset defined as macro may need later passing as a function parameter like: err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING, 1); I don;t see that any register (which now would be an address in a struct insteadd of being an offset to be added to a base address) would be passed as parameter to mmc_switch(). So this is not an issue at all. So if the ext_csd change to structure, maybe the function call here don't looks like so concise as before... What do you think for this? The EXT_CSD field definitions are completely independent of the way how you access the registers. 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 This message was made from 100% recycled electrons. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] microblaze: Enable SERIAL_MULTI
Dear Mike Frysinger, In message 201110101118.05350.vap...@gentoo.org you wrote: defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \ defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \ defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \ -defined(CONFIG_TEGRA2) +defined(CONFIG_TEGRA2) || defined(CONFIG_MICROBLAZE) Am I the only one that thinks this is all really ugly? I hope you mean serial.h not mb code. I agree with you but not sure if we can remove all ifdefs there. The long list of device specific ifdef's should be converted into a single ifdef testing for a specific feature instead. it's driver specific code in this file, so it doesn't make much sense to have the board config define something just to get these prototypes It could be a CPU specific header file, then. 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 Deliver yesterday, code today, think tomorrow. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled
Dear Mike Frysinger, In message 201110101124.22548.vap...@gentoo.org you wrote: See the rest of the thread. I had applied this patch set to a loal tree, but it was breaking hundreds of systems, so had to back out the patches again. I'm eager to get this code in myself, but it needs to be compile-clean at least and harmless to all boards that don't actually reference that code. sorry, but the rest of what thread ? i missed that there were issues and was wondering why they weren't in the published master branch yet ... There are actually three parts to this storey: Thisi s the original patch series, which I applied to a local test branch with the intention to pull into mainline: 10/04 Anton Staaf[U-Boot] [PATCH v2 0/7] Add cache line alignment support http://article.gmane.org/gmane.comp.boot-loaders.u-boot/111026 Then I noticed that this broke all PPC4xx boards, and asked Stefan to fix this problem. Stefan did: 10/07 Stefan Roese [PATCH 1/2] ppc: Include asm/cache.h in common.h http://article.gmane.org/gmane.comp.boot-loaders.u-boot/111482 When PPC was building again, I tested it on ARM (which I assumed was OK, given that this was Anton's primary architecture). That was when I finally gave up, see 10/09 To:Anton Staaf Re: [U-Boot] [PATCH v2 0/7] Add cache line alignment support http://article.gmane.org/gmane.comp.boot-loaders.u-boot/111713 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 Maintain an awareness for contribution -- to your schedule, your project, our company. - A Group of Employees ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] mx31pdk: Remove unneeded config
Dear Fabio Estevam, In message caomzo5c0pe3f+4h8t7svpsfucjufp_-z27zzqrobynnvy5s...@mail.gmail.com you wrote: Ping? Pong. What's up? This is i.MX, and I haven't seen any ARM (nor even i.MX) pull requests yet. 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 Lead me not into temptation... I can find it myself. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V3 05/13] i2c: Create common default i2c_set_bus_num() function
On Monday 10 October 2011 11:31:39 Stefano Babic wrote: On 10/10/2011 05:19 PM, Mike Frysinger wrote: On Monday 10 October 2011 06:50:12 Stefano Babic wrote: +int __def_i2c_set_bus_num(unsigned int bus) +{ + return 0; +} +int i2c_set_bus_num(unsigned int) + __attribute__((weak, alias(__def_i2c_set_bus_num))); any reason this can't just be: __weak int i2c_set_bus_num(unsigned int bus) { return 0; } i can understand having a default func when it actually does something, but i don't see much value in a stub that returns 0 It seems to me that this is the commonly used style in u-boot. The same happens for the i2c_init_board, some lines before, and in a lot of other modules: void __def_i2c_init_board(void) { return; } void i2c_init_board(void) __attribute__((weak, alias(__def_i2c_init_board))); Simply grepping in u-boot code, the default function is defined even if it does nothing, i believe we have two standards. i'm not sure which gets used more, or if it's just a wash. i think it makes sense to have an accessible default func if it does something useful, but not if it's just a stub. in the __def/weak style above, unless people use --gc-sections when linking (i think we've got many people doing this now, but not all), you end up with dead code in the binary. in the code i proposed, the func gets discarded both when using --gc-sections and when not. -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] microblaze: Enable SERIAL_MULTI
On Monday 10 October 2011 13:35:13 Wolfgang Denk wrote: Mike Frysinger wrote: defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \ defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \ defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \ -defined(CONFIG_TEGRA2) +defined(CONFIG_TEGRA2) || defined(CONFIG_MICROBLAZE) Am I the only one that thinks this is all really ugly? I hope you mean serial.h not mb code. I agree with you but not sure if we can remove all ifdefs there. The long list of device specific ifdef's should be converted into a single ifdef testing for a specific feature instead. it's driver specific code in this file, so it doesn't make much sense to have the board config define something just to get these prototypes It could be a CPU specific header file, then. some of these drivers are shared across SoCs/arches :) -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled
On Monday 10 October 2011 13:44:21 Wolfgang Denk wrote: Mike Frysinger wrote: See the rest of the thread. I had applied this patch set to a loal tree, but it was breaking hundreds of systems, so had to back out the patches again. I'm eager to get this code in myself, but it needs to be compile-clean at least and harmless to all boards that don't actually reference that code. sorry, but the rest of what thread ? i missed that there were issues and was wondering why they weren't in the published master branch yet ... There are actually three parts to this storey: Thisi s the original patch series, which I applied to a local test branch with the intention to pull into mainline: 10/04 Anton Staaf[U-Boot] [PATCH v2 0/7] Add cache line alignment support http://article.gmane.org/gmane.comp.boot-loaders.u-boot/111026 Then I noticed that this broke all PPC4xx boards, and asked Stefan to fix this problem. Stefan did: 10/07 Stefan Roese [PATCH 1/2] ppc: Include asm/cache.h in common.h http://article.gmane.org/gmane.comp.boot-loaders.u-boot/111482 When PPC was building again, I tested it on ARM (which I assumed was OK, given that this was Anton's primary architecture). That was when I finally gave up, see 10/09 To:Anton Staaf Re: [U-Boot] [PATCH v2 0/7] Add cache line alignment support http://article.gmane.org/gmane.comp.boot-loaders.u-boot/111713 blah, this is the one e-mail in that thread that went into my trash somehow. i'll follow up in the original posting; thanks. -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled
On Mon, Oct 10, 2011 at 10:44 AM, Wolfgang Denk w...@denx.de wrote: Dear Mike Frysinger, In message 201110101124.22548.vap...@gentoo.org you wrote: See the rest of the thread. I had applied this patch set to a loal tree, but it was breaking hundreds of systems, so had to back out the patches again. I'm eager to get this code in myself, but it needs to be compile-clean at least and harmless to all boards that don't actually reference that code. sorry, but the rest of what thread ? i missed that there were issues and was wondering why they weren't in the published master branch yet ... There are actually three parts to this storey: Thisi s the original patch series, which I applied to a local test branch with the intention to pull into mainline: 10/04 Anton Staaf [U-Boot] [PATCH v2 0/7] Add cache line alignment support http://article.gmane.org/gmane.comp.boot-loaders.u-boot/111026 Then I noticed that this broke all PPC4xx boards, and asked Stefan to fix this problem. Stefan did: 10/07 Stefan Roese [PATCH 1/2] ppc: Include asm/cache.h in common.h http://article.gmane.org/gmane.comp.boot-loaders.u-boot/111482 When PPC was building again, I tested it on ARM (which I assumed was OK, given that this was Anton's primary architecture). That was when I finally gave up, see Yes, the patches expose the fact that almost no boards define CONFIG_SYS_CACHELINE_SIZE. I am working on a solution for this. My first thought is to add defines for CONFIG_SYS_CACHELINE_SIZE in all of the arch cache.h files that currently do not have them. This would be all cache.h files other than the PPC one. But this could be a huge amount of work to look up all of the arch cacheline sizes. So I am thinking of putting in a wrong, but large power of two so that boards will build and probably work. But will certainly need to be fixed up... Another solution would be to do the above and define CONFIG_SYS_CACHELINE_SIZE as a large (128?) value and then indicate that that config is to deprecated in favor of Mikes suggestion of using the Linux CACHE BITS defines. Then we can move boards over to that mechanism over time, and in the mean time all boards will compile, and architectures/boards that correctly define their cacheline size will function correctly, and architectures/boards that use the large default will most likely function correctly... -Anton 10/09 To:Anton Staaf Re: [U-Boot] [PATCH v2 0/7] Add cache line alignment support http://article.gmane.org/gmane.comp.boot-loaders.u-boot/111713 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 Maintain an awareness for contribution -- to your schedule, your project, our company. - A Group of Employees ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 05/13] i2c: Create common default i2c_set_bus_num() function
On Mon, Oct 10, 2011 at 4:35 AM, Stefano Babic sba...@denx.de wrote: New default, weak i2c_set_bus_num() function. Signed-off-by: Stefano Babic sba...@denx.de Cc: Heiko Schocher h...@denx.de I would prefer to see a new set of I2C functions that take a bus number as a parameter, so that we can eliminate i2c_set_bus_num() (and the global variable it modifies) altogether. -- Timur Tabi Linux kernel developer at Freescale ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 0/20] New 'sandbox' test architecture for U-Boot
This patch set points towards a possible way to improve the test infrastructure in U-Boot. The goal is to have a test suite that can run in a minute or two on a Linux PC and test all non-platform code. This set aims to be just enough boot to U-Boot to a command prompt. You can type help; anything else will probably segfault :-) Press Ctrl-C or type 'reset' to exit. This patch set does not include some other code I have been playing around with, like a SPI flash driver and sandbox 'state' (so the state can be examined and modified to test failure modes and the like). $ ./u-boot U-Boot 2011.09-rc1-00041-ge50de7d-dirty (Sep 17 2011 - 08:17:40) DRAM: 128 MiB Using default environment In:serial Out: serial Err: serial Detail == We can break the U-Boot code base into two parts: 1. Platform code, which is SOC-specifc. At present this is the CPU init (arch/xxx/cpu/...) and SOC-specific drivers (mostly in the drivers directory). There is also a small amount of generic CPU code in arch/xxx/lib and some board-specific code/drivers (e.g. drivers not within the SOC). 2. Portable/Generic U-Boot code, which is cross-platform. This includes many drivers, the various commands, file system support, things like the MMC, USB and network stacks, etc. My focus in this patch set is the second part of the code base - all the code which is not platform-specific, but can still have bugs. Proposal To a large extent, testing of this part of the code base could simply be built on one or more of the available platforms. We could then run the tests on that platform, and announce that the code base works fine on that platform. Obviously the platform needs to support all possible features of U-Boot. However, this approach fails to take advantage of two useful properties of this code: - It is cross-platform, and even runs on x86 - It is standalone, requiring no OS libraries to run For speed, debugging and convenience, it would be nice to run U-Boot under a generic Linux environment on a workstation, and test all the generic non-platform code. The basic problem with this is that the non-platform code requires the platform code to operate. Even the x86 platform code is designed for standalone operation on a particular x86 board, and is not suitable for running under x86 Linux. To get around this I propose that we create a new ‘sandbox’ architecture. We write code in ‘arch/sandbox’ which can run under Linux. Since all the non-platform code will happily run under this new ‘architecture’, we can then write tests which run quickly under x86 Linux (or another Linux for that matter). This U-Boot 'architecture' should build natively on any 32/64-bit Linux machine since it just uses standard Linux system calls. Calls to Linux would be entirely within this arch/sandbox subdirectory. Benefit === What will this buy us? Well we can do things like: - Create a test SPI flash device, which is file-backed. Use this to write a test of the cmd_sf layer by issuing a series of commands and making sure that the correct SPI flash contents is obtained - Create a test MMC or IDE device, backed by a file. Use this to issue ext2 and fat commands to manipulate the filesystem. Then loopback mount the file and check from Linux that U-Boot did the right thing - Create a test Ethernet device with a mocked remote host attached. Use this to issue network commands like bootp and tftp and check that the correct results are obtained. Ultimately (one day) we might have a set of unit tests for U-Boot which can run to very quickly check that a patch does not break the core U-Boot code. Building make ARCH=sandbox sandbox_config make ARCH=sandbox all (The lds script is targeted for bfd and might not work with the gold linker) Comments Comments are welcome and I have cc'd those who showed an interest to my initial email. My goal is to create a real patch set in the next few weeks. Please excuse the checkpatch violations, many of which seem to be less than useful. This code is a bit rough in places, but I want comments on it before polishing. There are a few strange things needed in the build as well, which I hope to improve. Checkpatch notes: The first patch generates a list of 34 checkpatch warnings. warning: arch/sandbox/include/asm/global_data.h,38: do not add new typedefs (This is the typedef for gd_t which I think is needed.) warning: arch/sandbox/include/asm/global_data.h,64: storage class should be at the beginning of the declaration (This line is: which I need to keep, so that various files can declare that pointer.) warning: arch/sandbox/include/asm/posix_types.h,22: do not add new typedefs warning: arch/sandbox/include/asm/posix_types.h,23: do not add new typedefs warning: arch/sandbox/include/asm/posix_types.h,24: do not add new typedefs warning: arch/sandbox/include/asm/posix_types.h,25: do not add new typedefs warning: arch/sandbox/include/asm/posix_types.h,26: do not add new typedefs
Re: [U-Boot] [PATCH 1/3] USB: Squash checkpatch warnings in usb_kbd.c
Acked-by: Mike Frysinger vap...@gentoo.org -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 15/20] sandbox: Add serial uart
This uart simply writes to stdout and reads from stdin. We might imagine instead buffering the data so that a test interface can check output and inject input. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v4: - Remove serial_exit() drivers/serial/Makefile |1 + drivers/serial/sandbox.c | 63 ++ 2 files changed, 64 insertions(+), 0 deletions(-) create mode 100644 drivers/serial/sandbox.c diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile index 1dcc1c7..6309549 100644 --- a/drivers/serial/Makefile +++ b/drivers/serial/Makefile @@ -53,6 +53,7 @@ COBJS-$(CONFIG_SA1100_SERIAL) += serial_sa1100.o COBJS-$(CONFIG_S3C24X0_SERIAL) += serial_s3c24x0.o COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o +COBJS-$(CONFIG_SANDBOX_SERIAL) += sandbox.o COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o COBJS-$(CONFIG_TEGRA2) += serial_tegra2.o diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c new file mode 100644 index 000..0d65587 --- /dev/null +++ b/drivers/serial/sandbox.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * 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 + */ + +/* + * This provide a test serial port. It provides an emulated serial port where + * a test program and read out the serial output and inject serial input for + * U-Boot. + */ + +#include common.h +#include os.h + +int serial_init(void) +{ + return 0; +} + +void serial_setbrg(void) +{ +} + +void serial_putc(const char ch) +{ + os_write(1, ch, 1); +} + +void serial_puts(const char *str) +{ + while (*str) + serial_putc(*str++); +} + +int serial_getc(void) +{ + char buf; + int count; + + count = os_read(0, buf, 1); + return count == 1 ? buf : 0; +} + +int serial_tstc(void) +{ + return 0; +} -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 04/20] sandbox: Add compiler defines to support a 64-bit x86_64 platform
This sets __WORDSIZE to 8 correctly on 64-bit machines. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: - Update commit message to remove 'temporary' - Allow __WORDSIZE to be defined in Makefile / elsewhere include/compiler.h | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/include/compiler.h b/include/compiler.h index 4e047c7..dc1a259 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -111,11 +111,21 @@ typedef unsigned int uint; #include linux/types.h #include asm/byteorder.h +#if __SIZEOF_LONG__ == 8 +# define __WORDSIZE64 +#elif __SIZEOF_LONG__ == 4 +# define __WORDSIZE32 +#elif !defined __WORDSIZE +#error __SIZEOF_LONG__ has unexpected value +#endif + /* Types for `void *' pointers. */ #if __WORDSIZE == 64 typedef unsigned long int uintptr_t; -#else +#elif __WORDSIZE == 32 typedef unsigned intuintptr_t; +#else +#error __WORDSIZE has unexpected value #endif #endif -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 14/20] sandbox: Add main program
Add a main program so that we can run U-Boot. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v4: - Move main() into arch/sandbox/cpu/start.c arch/sandbox/cpu/Makefile |2 +- arch/sandbox/cpu/start.c | 33 + 2 files changed, 34 insertions(+), 1 deletions(-) create mode 100644 arch/sandbox/cpu/start.c diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile index 1a0b260..e5e860b 100644 --- a/arch/sandbox/cpu/Makefile +++ b/arch/sandbox/cpu/Makefile @@ -30,7 +30,7 @@ include $(TOPDIR)/config.mk LIB= $(obj)lib$(CPU).o -COBJS := cpu.o os.o +COBJS := cpu.o start.o os.o SRCS := $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c new file mode 100644 index 000..685793e --- /dev/null +++ b/arch/sandbox/cpu/start.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * 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 + +int main(int argc, char *argv[]) +{ + /* +* Do pre- and post-relocation init, then start up U-Boot. This will +* never return. +*/ + board_init_f(0); + + return 0; +} -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 09/20] sandbox: Add bootm support
This adds sandbox architecture support to bootm, although it is probably not useful to load sandbox code into the address space and execute it. This change at least make the file build correctly on 64-bit machines. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: - Fix cast of int to pointer instead of just removing the code common/cmd_bootm.c |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index c2e8038..bb9b698 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -438,9 +438,8 @@ static int bootm_start_standalone(ulong iflag, int argc, char * const argv[]) setenv(filesize, buf); return 0; } - appl = (int (*)(int, char * const []))ntohl(images.ep); + appl = (int (*)(int, char * const []))(ulong)ntohl(images.ep); (*appl)(argc-1, argv[1]); - return 0; } @@ -464,14 +463,14 @@ static cmd_tbl_t cmd_bootm_sub[] = { int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int ret = 0; - int state; + long state; cmd_tbl_t *c; boot_os_fn *boot_fn; c = find_cmd_tbl(argv[1], cmd_bootm_sub[0], ARRAY_SIZE(cmd_bootm_sub)); if (c) { - state = (int)c-cmd; + state = (long)c-cmd; /* treat start special since it resets the state machine */ if (state == BOOTM_STATE_START) { -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 19/20] Add generic gpio.h in asm-generic
Since we want want to have a standard GPIO interface, this adds a definition for this into include/asm-generic/gpio.h. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v5: - Move the introduction of include/asm-generic/gpio.h into a separate commit - Add comments to GPIO functions include/asm-generic/gpio.h | 74 1 files changed, 74 insertions(+), 0 deletions(-) create mode 100644 include/asm-generic/gpio.h diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h new file mode 100644 index 000..a1ebb28 --- /dev/null +++ b/include/asm-generic/gpio.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * 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 + */ + +/* + * Generic GPIO API for U-Boot + * + * GPIOs are numbered from 0 to GPIO_COUNT-1 which value is defined + * by the SOC/architecture. + * + * Each GPIO can be an input or output. If an input then its value can + * be read as 0 or 1. If an output then its value can be set to 0 or 1. + * If you try to write an input then the value is undefined. If you try + * to read an output, barring something very unusual, you will get + * back the value of the output that you previously set. + * + * In some cases the operation may fail, for example if the GPIO number + * is out of range, or the GPIO is not available because its pin is + * being used by another function. In that case, functions may return + * an error value of -1. + */ + +/** + * Make a GPIO an input. + * + * @param gp GPIO number + * @return 0 if ok, -1 on error + */ +int gpio_direction_input(int gp); + +/** + * Make a GPIO an output, and set its value. + * + * @param gp GPIO number + * @param valueGPIO value (0 for low or 1 for high) + * @return 0 if ok, -1 on error + */ +int gpio_direction_output(int gp, int value); + +/** + * Get a GPIO's value. This will work whether the GPIO is an input + * or an output. + * + * @param gp GPIO number + * @return 0 if low, 1 if high, -1 on error + */ +int gpio_get_value(int gp); + +/** + * Set an output GPIO's value. The GPIO must already be an output of + * this function may have no effect. + * + * @param gp GPIO number + * @param valueGPIO value (0 for low or 1 for high) + * @return 0 if ok, -1 on error + */ +int gpio_set_value(int gp, int value); -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 02/20] Fix use of int as pointer in image.c
It is better to use %p in this case. Signed-off-by: Simon Glass s...@chromium.org Acked-by: Mike Frysinger vap...@gentoo.org --- Changes in v2: - Split this change out from 'Add architecture image support' common/image.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/image.c b/common/image.c index d38ce4a..fc475cd 100644 --- a/common/image.c +++ b/common/image.c @@ -1581,7 +1581,7 @@ int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *imag goto error; } - printf ( Booting using the fdt blob at 0x%x\n, (int)fdt_blob); + printf( Booting using the fdt blob at 0x%p\n, fdt_blob); } else if (images-legacy_hdr_valid image_check_type (images-legacy_hdr_os_copy, IH_TYPE_MULTI)) { @@ -1600,7 +1600,7 @@ int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *imag if (fdt_len) { fdt_blob = (char *)fdt_data; - printf ( Booting using the fdt at 0x%x\n, (int)fdt_blob); + printf( Booting using the fdt at 0x%p\n, fdt_blob); if (fdt_check_header (fdt_blob) != 0) { fdt_error (image is not a fdt); -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 01/20] sandbox: Add architecture header files
This adds required header files for the sandbox architecture, and a basic description of what sandbox is (README.sandbox). Signed-off-by: Simon Glass s...@chromium.org --- Changes in v6: - Remove volatile keyword from arch/sandbox/include/asm/bitops.h arch/sandbox/include/asm/bitops.h | 162 + arch/sandbox/include/asm/byteorder.h | 40 +++ arch/sandbox/include/asm/config.h | 26 + arch/sandbox/include/asm/global_data.h| 66 arch/sandbox/include/asm/io.h | 41 +++ arch/sandbox/include/asm/posix_types.h| 57 ++ arch/sandbox/include/asm/ptrace.h | 38 +++ arch/sandbox/include/asm/string.h | 23 arch/sandbox/include/asm/system.h | 36 +++ arch/sandbox/include/asm/types.h | 72 + arch/sandbox/include/asm/u-boot-sandbox.h | 38 +++ arch/sandbox/include/asm/u-boot.h | 61 +++ arch/sandbox/include/asm/unaligned.h | 23 doc/README.sandbox| 53 ++ include/common.h |3 + 15 files changed, 739 insertions(+), 0 deletions(-) create mode 100644 arch/sandbox/include/asm/bitops.h create mode 100644 arch/sandbox/include/asm/byteorder.h create mode 100644 arch/sandbox/include/asm/config.h create mode 100644 arch/sandbox/include/asm/global_data.h create mode 100644 arch/sandbox/include/asm/io.h create mode 100644 arch/sandbox/include/asm/posix_types.h create mode 100644 arch/sandbox/include/asm/ptrace.h create mode 100644 arch/sandbox/include/asm/string.h create mode 100644 arch/sandbox/include/asm/system.h create mode 100644 arch/sandbox/include/asm/types.h create mode 100644 arch/sandbox/include/asm/u-boot-sandbox.h create mode 100644 arch/sandbox/include/asm/u-boot.h create mode 100644 arch/sandbox/include/asm/unaligned.h create mode 100644 doc/README.sandbox diff --git a/arch/sandbox/include/asm/bitops.h b/arch/sandbox/include/asm/bitops.h new file mode 100644 index 000..74219c5 --- /dev/null +++ b/arch/sandbox/include/asm/bitops.h @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * + * Copyright 1995, Russell King. + * Various bits and pieces copyrights include: + * Linus Torvalds (test_bit). + * + * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1). + * + * Please note that the code in this file should never be included + * from user space. Many of these are not implemented in assembler + * since they would be too costly. Also, they require priviledged + * instructions (which are not available from user mode) to ensure + * that they are atomic. + */ + +#ifndef __ASM_SANDBOX_BITOPS_H +#define __ASM_SANDBOX_BITOPS_H + +#include asm/system.h + +#ifdef __KERNEL__ + +#define smp_mb__before_clear_bit() do { } while (0) +#define smp_mb__after_clear_bit() do { } while (0) + +/* + * Function prototypes to keep gcc -Wall happy. + */ +extern void set_bit(int nr, void *addr); + +extern void clear_bit(int nr, void *addr); + +extern void change_bit(int nr, void *addr); + +static inline void __change_bit(int nr, void *addr) +{ + unsigned long mask = BIT_MASK(nr); + unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); + + *p ^= mask; +} + +static inline int __test_and_set_bit(int nr, void *addr) +{ + unsigned long mask = BIT_MASK(nr); + unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); + unsigned long old = *p; + + *p = old | mask; + return (old mask) != 0; +} + +static inline int test_and_set_bit(int nr, void *addr) +{ + unsigned long flags; + int out; + + local_irq_save(flags); + out = __test_and_set_bit(nr, addr); + local_irq_restore(flags); + + return out; +} + +static inline int __test_and_clear_bit(int nr, void *addr) +{ + unsigned long mask = BIT_MASK(nr); + unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); + unsigned long old = *p; + + *p = old ~mask; + return (old mask) != 0; +} + +static inline int test_and_clear_bit(int nr, void *addr) +{ + unsigned long flags; + int out; + + local_irq_save(flags); + out = __test_and_clear_bit(nr, addr); + local_irq_restore(flags); + + return out; +} + +extern int test_and_change_bit(int nr, void *addr); + +static inline int __test_and_change_bit(int nr, void *addr) +{ + unsigned long mask = BIT_MASK(nr); + unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); + unsigned long old = *p; + + *p = old ^ mask; + return (old mask) != 0; +} + +extern int find_first_zero_bit(void *addr, unsigned size); +extern int find_next_zero_bit(void *addr, int size, int offset); + +/* + * This routine doesn't need to be atomic. + */ +static inline int test_bit(int nr, const void *addr) +{ + return ((unsigned char *) addr)[nr 3] (1U (nr 7)); +} + +/* + *
[U-Boot] [PATCH v6 07/20] sandbox: Add sandbox board
This adds basic files for the sandbox board. The lds file is very simple since we can rely mostly on the linker defaults. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: - Remove clean and dist-clean targets from Makefile - Move lds script out of the board directory Changes in v4: - Remove board/sandbox/common directory as it is not used Changes in v5: - Simplify the declaration of gd_t in sandbox's board.c board/sandbox/sandbox/Makefile | 42 + board/sandbox/sandbox/sandbox.c | 49 +++ boards.cfg |1 + 3 files changed, 92 insertions(+), 0 deletions(-) create mode 100644 board/sandbox/sandbox/Makefile create mode 100644 board/sandbox/sandbox/sandbox.c diff --git a/board/sandbox/sandbox/Makefile b/board/sandbox/sandbox/Makefile new file mode 100644 index 000..6366a07 --- /dev/null +++ b/board/sandbox/sandbox/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (c) 2011 The Chromium OS Authors. +# +# 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 Foundatio; 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 := $(BOARD).o + +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +$(LIB):$(obj).depend $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/sandbox/sandbox/sandbox.c b/board/sandbox/sandbox/sandbox.c new file mode 100644 index 000..95a5045 --- /dev/null +++ b/board/sandbox/sandbox/sandbox.c @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * 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 + +/* + * Pointer to initial global data area + * + * Here we initialize it. + */ +gd_t *gd; + +void flush_cache(unsigned long start, unsigned long size) +{ +} + +ulong get_timer(ulong base) +{ + return 0; +} + +int timer_init(void) +{ + return 0; +} + +int dram_init(void) +{ + gd-ram_size = CONFIG_DRAM_SIZE; + return 0; +} diff --git a/boards.cfg b/boards.cfg index 65482ac..38779bd 100644 --- a/boards.cfg +++ b/boards.cfg @@ -264,6 +264,7 @@ tcm-bf518blackfinblackfin tcm-bf537blackfinblackfin eNET x86 x86eNET- sc520 eNET:SYS_TEXT_BASE=0x3804 eNET_SRAMx86 x86eNET- sc520 eNET:SYS_TEXT_BASE=0x1900 +sandbox sandbox sandbox sandbox sandbox- idmr m68kmcf52x2 TASREG m68kmcf52x2 tasreg esd M5208EVBEm68kmcf52x2 m5208evbe freescale -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 03/20] sandbox: Add architecture image support
We won't actually load an image with this architecture, but we still need to define it. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v3: - Add architecture image support for sandbox Changes in v5: - Define IH_ARCH_DEFAULT which is now required arch/sandbox/include/asm/u-boot.h |3 +++ include/image.h |1 + 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/sandbox/include/asm/u-boot.h b/arch/sandbox/include/asm/u-boot.h index 7d91847..166ef14 100644 --- a/arch/sandbox/include/asm/u-boot.h +++ b/arch/sandbox/include/asm/u-boot.h @@ -58,4 +58,7 @@ typedef struct bd_info { } bi_dram[CONFIG_NR_DRAM_BANKS]; } bd_t; +/* For image.h:image_check_target_arch() */ +#define IH_ARCH_DEFAULT IH_ARCH_SANDBOX + #endif /* _U_BOOT_H_ */ diff --git a/include/image.h b/include/image.h index cca1cc5..b7caaa6 100644 --- a/include/image.h +++ b/include/image.h @@ -106,6 +106,7 @@ #define IH_ARCH_BLACKFIN 16 /* Blackfin */ #define IH_ARCH_AVR32 17 /* AVR32*/ #define IH_ARCH_ST200 18 /* STMicroelectronics ST200 */ +#define IH_ARCH_SANDBOX19 /* Sandbox architecture (test only) */ /* * Image Types -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 16/20] sandbox: Add basic config file
This basic provides required features along with a basic command set. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: - Remove CONFIG_SYS_SDRAM_BASE which is always 0 for sandbox boards - Fix #definetab - Remove CONFIG_LMB Changes in v4: - Add CONFIG_SYS_SDRAM_SIZE for size of emulated SDRAM - Add #ifdef protection around sandbox.h header file include/configs/sandbox.h | 85 + 1 files changed, 85 insertions(+), 0 deletions(-) create mode 100644 include/configs/sandbox.h diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h new file mode 100644 index 000..0230256 --- /dev/null +++ b/include/configs/sandbox.h @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * 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 + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#define CONFIG_NR_DRAM_BANKS 1 +#define CONFIG_DRAM_SIZE (128 20) + +/* Number of bits in a C 'long' on this architecture */ +#define CONFIG_SANDBOX_BITS_PER_LONG 64 + +/* + * Size of malloc() pool, although we don't actually use this yet. + */ +#define CONFIG_SYS_MALLOC_LEN (4 20) /* 4MB */ + +#define CONFIG_SYS_PROMPT =/* Command Prompt */ +#define CONFIG_SYS_HUSH_PARSER +#define CONFIG_SYS_PROMPT_HUSH_PS2 +#define CONFIG_SYS_LONGHELP/* #undef to save memory */ +#define CONFIG_SYS_CBSIZE 1024/* Console I/O Buffer Size */ + +/* Print Buffer Size */ +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) +#define CONFIG_SYS_MAXARGS 16 + +/* turn on command-line edit/c/auto */ +#define CONFIG_CMDLINE_EDITING +#define CONFIG_COMMAND_HISTORY +#define CONFIG_AUTOCOMPLETE + +#define CONFIG_ENV_SIZE8192 +#define CONFIG_ENV_IS_NOWHERE + +#define CONFIG_SYS_HZ 1000 + +/* Memory things - we don't really want a memory test */ +#define CONFIG_SYS_LOAD_ADDR 0x1000 +#define CONFIG_SYS_MEMTEST_START 0x1000 +#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x1000) +#define CONFIG_PHYS_64BIT + +/* Size of our emulated memory */ +#define CONFIG_SYS_SDRAM_SIZE (128 20) + +#define CONFIG_BAUDRATE115200 +#define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\ + 115200} +#define CONFIG_SANDBOX_SERIAL + +#define CONFIG_SYS_NO_FLASH + +/* include default commands */ +#include config_cmd_default.h + +/* We don't have networking support yet */ +#undef CONFIG_CMD_NET +#undef CONFIG_CMD_NFS + +#define CONFIG_BOOTARGS + +#define CONFIG_EXTRA_ENV_SETTINGS stdin=serial\0 \ + stdout=serial\0 \ + stderr=serial\0 + +#endif -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 06/20] sandbox: Add architecture lib files
These files are taken from the ARM board implementation and then reduced to remove unneeded cruft. Ideally we would work towards unifying arch/xxx/lib files, particularly board.c. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: - Fix commit message typo, sadly - Remove ARM cruft from Makefile - Remove version_string and make display_banner() call display_options() - Tidy up DRAM logic (but I think it is still needed to fit in with U-Boot) - Remove use of CONFIG_SYS_NO_FLASH - Make board_init_f() call board_init_r() for now - Make board_init_r() call main_loop() for now Changes in v4: - Add CONFIG_SYS_SDRAM_SIZE for size of emulated SDRAM - Drop CONFIG_POST support - Drop call to board_init() - Remove printing of memory setup which is meaningless in sandbox arch/sandbox/lib/Makefile | 51 arch/sandbox/lib/board.c | 276 + arch/sandbox/lib/interrupts.c | 39 ++ 3 files changed, 366 insertions(+), 0 deletions(-) create mode 100644 arch/sandbox/lib/Makefile create mode 100644 arch/sandbox/lib/board.c create mode 100644 arch/sandbox/lib/interrupts.c diff --git a/arch/sandbox/lib/Makefile b/arch/sandbox/lib/Makefile new file mode 100644 index 000..fbe579b --- /dev/null +++ b/arch/sandbox/lib/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (c) 2011 The Chromium OS Authors. +# +# (C) Copyright 2002-2006 +# 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$(ARCH).o + +COBJS-y+= board.o +COBJS-y+= interrupts.o + +SRCS := $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS-y)) + +# Always build libsandbox.o +TARGETS:= $(LIB) + +all: $(TARGETS) + +$(LIB):$(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/arch/sandbox/lib/board.c b/arch/sandbox/lib/board.c new file mode 100644 index 000..1fd8fa6 --- /dev/null +++ b/arch/sandbox/lib/board.c @@ -0,0 +1,276 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * + * (C) Copyright 2002-2006 + * Wolfgang Denk, DENX Software Engineering, w...@denx.de. + * + * (C) Copyright 2002 + * Sysgo Real-Time Solutions, GmbH www.elinos.com + * Marius Groeger mgroe...@sysgo.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 + */ + +/* + * This file was taken from ARM and changed to remove things we don't + * need. This is most of it, so have tried to avoid being over-zealous! + * For example, we want to have an emulation of the 'DRAM' used by + * U-Boot. + * + * has been talk upstream of unifying the architectures w.r.t board.c, + * so the less change here the better. + */ + +#include common.h +#include command.h +#include malloc.h +#include stdio_dev.h +#include timestamp.h +#include version.h +#include serial.h + +DECLARE_GLOBAL_DATA_PTR; + +/ + * Init Utilities * + + * Some of this code should be moved into the core functions, + * or dropped completely, + * but let's get it working (again) first... +
[U-Boot] [PATCH v6 13/20] sandbox: Add OS dependent layer
We want to keep all OS-dependent code in once place, with a simple interface to U-Boot. For now, this is that place. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: - Move os layer into arch/sandbox - Remove clean and dist-clean targets from Makefile - Try and fail to remove the global -I/usr/include Changes in v3: - Add os_exit() which always exits with success for now - Add function comments to header file - Call os_exit() in do_reset() - Move cpu files into arch/sandbox/cpu Changes in v4: - Allow os_exit() to exit with a non-zero return code arch/sandbox/cpu/Makefile |5 ++- arch/sandbox/cpu/cpu.c|7 ++-- arch/sandbox/cpu/os.c | 55 ++ include/os.h | 73 + 4 files changed, 135 insertions(+), 5 deletions(-) create mode 100644 arch/sandbox/cpu/os.c create mode 100644 include/os.h diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile index 8dfa828..1a0b260 100644 --- a/arch/sandbox/cpu/Makefile +++ b/arch/sandbox/cpu/Makefile @@ -23,11 +23,14 @@ # MA 02111-1307 USA # +# os.c is build in the system environment, so needs standard includes +CPPFLAGS_arch/sandbox/cpu/os.o += -I/usr/include + include $(TOPDIR)/config.mk LIB= $(obj)lib$(CPU).o -COBJS := cpu.o +COBJS := cpu.o os.o SRCS := $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c index 554cae8..c7bf8a9 100644 --- a/arch/sandbox/cpu/cpu.c +++ b/arch/sandbox/cpu/cpu.c @@ -20,15 +20,14 @@ */ #include common.h +#include os.h DECLARE_GLOBAL_DATA_PTR; int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - /* -* This is considered normal termination for now. We wil call os_exit() -* when available. -*/ + /* This is considered normal termination for now */ + os_exit(0); return 0; } diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c new file mode 100644 index 000..6c175d4 --- /dev/null +++ b/arch/sandbox/cpu/os.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * 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 fcntl.h +#include stdlib.h +#include unistd.h +#include sys/types.h +#include sys/stat.h + +#include os.h + +/* Operating System Interface */ + +ssize_t os_read(int fd, void *buf, size_t count) +{ + return read(fd, buf, count); +} + +ssize_t os_write(int fd, const void *buf, size_t count) +{ + return write(fd, buf, count); +} + +int os_open(const char *pathname, int flags) +{ + return open(pathname, flags); +} + +int os_close(int fd) +{ + return close(fd); +} + +void os_exit(int exit_code) +{ + exit(exit_code); +} diff --git a/include/os.h b/include/os.h new file mode 100644 index 000..3ea6d2d --- /dev/null +++ b/include/os.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * 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 + */ + +/* + * Operating System Interface + * + * This provides access to useful OS routines from the sandbox architecture + */ + +/** + * Access to the OS read() system call + * + * \param fd File descriptor as returned by os_open() + * \param buf Buffer to place data + * \param countNumber of bytes to read + * \return number of bytes read, or -1 on error + */ +ssize_t os_read(int fd, void *buf, size_t count); + +/** + *
[U-Boot] [PATCH v6 20/20] sandbox: Makefile changes to build sandbox architecture
At this point U-Boot will build and run on x86 under Linux. The idea is to define a new architecture called 'sandbox', alongside ARM and x86. This runs natively on Linux to suit the host machine. All hardware access is either omitted or emulated. The purpose of this system is to test the bulk of the non-hardware-specific U-Boot code. We can mock the SPI flash, GPIOs, UART and keyboard, then test that U-Boot behaves as we wish. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: - Rebase to master - Tidy top-level Makefile to minimise changes Changes in v4: - Drop board/sandbox/common/board.c for now (no board_init() needed) - Move main() into start.c to remove one ifdef from the top level Makefile - Fix up Makefile for non-sandbox builds Makefile |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/Makefile b/Makefile index aa78310..053d030 100644 --- a/Makefile +++ b/Makefile @@ -403,12 +403,20 @@ $(obj)u-boot.ubl: $(obj)u-boot-nand.bin $(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \ -e $(CONFIG_SYS_TEXT_BASE) -d $ $@ +ifeq ($(CONFIG_SANDBOX),y) +GEN_UBOOT = \ + cd $(LNDIR) $(CC) $(SYMS) -T $(obj)u-boot.lds \ + -Wl,--start-group $(__LIBS) -Wl,--end-group \ + $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map -o u-boot +else GEN_UBOOT = \ UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \ sed -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\ cd $(LNDIR) $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__OBJS) \ --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \ -Map u-boot.map -o u-boot +endif + $(obj)u-boot: depend \ $(SUBDIRS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds $(GEN_UBOOT) -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 10/20] sandbox: Disable built-in malloc
We prefer to U-Boot's malloc but for now it is easier to use the C library's version. Signed-off-by: Simon Glass s...@chromium.org --- common/Makefile |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/common/Makefile b/common/Makefile index 371a0d9..fee6de1 100644 --- a/common/Makefile +++ b/common/Makefile @@ -29,7 +29,9 @@ LIB = $(obj)libcommon.o ifndef CONFIG_SPL_BUILD COBJS-y += main.o COBJS-y += command.o +ifndef CONFIG_SANDBOX COBJS-y += dlmalloc.o +endif COBJS-y += exports.o COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o COBJS-y += image.o -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 12/20] sandbox: Force command sections to be 4-byte aligned
By default sections are 16-byte aligned on some architectures, but the command name structure (struct cmd_tbl_s) does not have padding to 16 bytes. We use the linker to collect elements of an array of these structures and then at run-time we want this array to be accessible. If the linker puts padding between elements then we cannot access the array properly. This change reduces the alignment to 4-bytes so that the command table can be accessed correctly on any architecture. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v4: - Add more info to command section alignment commit include/command.h |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/include/command.h b/include/command.h index f1accd0..c270110 100644 --- a/include/command.h +++ b/include/command.h @@ -117,7 +117,8 @@ extern int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); #define CMD_FLAG_REPEAT0x0001 /* repeat last command */ #define CMD_FLAG_BOOTD 0x0002 /* command is from bootd*/ -#define Struct_Section __attribute__ ((unused,section (.u_boot_cmd))) +#define Struct_Section __attribute__((unused, section(.u_boot_cmd), \ + aligned(4))) #ifdef CONFIG_AUTO_COMPLETE # define _CMD_COMPLETE(x) x, -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 11/20] sandbox: Disable standalone/API support
This is less useful on the sandbox architecture since we can simply link all our code with U-Boot. However some interest has been expressed in implementing this support. For now, it is disabled. Signed-off-by: Simon Glass s...@chromium.org --- Makefile |9 ++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index cd6fc8c..4de2103 100644 --- a/Makefile +++ b/Makefile @@ -137,9 +137,7 @@ unexport CDPATH # The tools are needed early, so put this first # Don't include stuff already done in $(LIBS) -SUBDIRS= tools \ - examples/standalone \ - examples/api +SUBDIRS= tools .PHONY : $(SUBDIRS) $(VERSION_FILE) @@ -156,6 +154,11 @@ sinclude $(obj)include/autoconf.mk include $(obj)include/config.mk export ARCH CPU BOARD VENDOR SOC +ifndef CONFIG_SANDBOX +SUBDIRS += examples/standalone \ + examples/api +endif + # set default to nothing for native builds ifeq ($(HOSTARCH),$(ARCH)) CROSS_COMPILE ?= -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 05/20] sandbox: Add cpu files
This is an initial implementation with all functions defined but not working. The lds file is very simple since we can mostly rely on the linker defaults. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: - Remove setting of LDSCRIPT (top level Makefile does this anyway) - Add comment to do_reset() to justify the sandbox implementation - Move lds script into cpu/sandbox Changes in v3: - Change do_reset() back to what it was - Move cpu files into arch/sandbox/cpu arch/sandbox/config.mk | 20 + arch/sandbox/cpu/Makefile | 47 arch/sandbox/cpu/cpu.c | 63 +++ arch/sandbox/cpu/u-boot.lds | 34 +++ 4 files changed, 164 insertions(+), 0 deletions(-) create mode 100644 arch/sandbox/config.mk create mode 100644 arch/sandbox/cpu/Makefile create mode 100644 arch/sandbox/cpu/cpu.c create mode 100644 arch/sandbox/cpu/u-boot.lds diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk new file mode 100644 index 000..ab33026 --- /dev/null +++ b/arch/sandbox/config.mk @@ -0,0 +1,20 @@ +# Copyright (c) 2011 The Chromium OS Authors. +# 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 + +PLATFORM_CPPFLAGS += -DCONFIG_SANDBOX -D__SANDBOX__ diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile new file mode 100644 index 000..8dfa828 --- /dev/null +++ b/arch/sandbox/cpu/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (c) 2011 The Chromium OS Authors. +# +# (C) Copyright 2000-2003 +# 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$(CPU).o + +COBJS := cpu.o + +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +all: $(obj).depend $(LIB) + +$(LIB):$(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c new file mode 100644 index 000..554cae8 --- /dev/null +++ b/arch/sandbox/cpu/cpu.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * 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 + +DECLARE_GLOBAL_DATA_PTR; + +int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + /* +* This is considered normal termination for now. We wil call os_exit() +* when available. +*/ + return 0; +} + +/* delay x useconds */ +void __udelay(unsigned
[U-Boot] [PATCH v6 18/20] Adjust dependency rules to permit per-file flags
The dependency rules are currently done in a shell 'for' loop. This does not permit Makefile variables to adjust preprocessor flags as is done with normal compile flags, using the CFLAGS_path/file.o syntax. This change moves the dependency generation into the Makefile itself, and permits a CPPFLAGS_path/file.o to adjust preprocessor flags on a file or directory basis. The CPPFLAGS_... variable is also folded into CFLAGS during the build. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v3: - Change U-Boot's dependency generation to permit per-file flags Changes in v4: - 'Improve' dependency generation to deal with source files containing paths - Make sure that clobber target removes all dependency files Changes in v5: - Fix dependency output to include $(obj) for out-of-tree builds .gitignore |2 +- Makefile |2 +- config.mk |7 +++ rules.mk | 44 +--- 4 files changed, 42 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 289ffab..1bea75f 100644 --- a/.gitignore +++ b/.gitignore @@ -40,7 +40,7 @@ # Generated files # -*.depend +*.depend* /LOG /errlog /reloc_off diff --git a/Makefile b/Makefile index 4de2103..aa78310 100644 --- a/Makefile +++ b/Makefile @@ -953,7 +953,7 @@ clean: | xargs rm -f clobber: clean - @find $(OBJTREE) -type f \( -name '*.depend' \ + @find $(OBJTREE) -type f \( -name '*.depend*' \ -o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \ -print0 \ | xargs -0 rm -f diff --git a/config.mk b/config.mk index e2b440d..3fa9eef 100644 --- a/config.mk +++ b/config.mk @@ -277,6 +277,13 @@ export CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%)) ALL_AFLAGS = $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR)) ALL_CFLAGS = $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) +EXTRA_CPPFLAGS = $(CPPFLAGS_$(BCURDIR)/$(@F)) $(CPPFLAGS_$(BCURDIR)) +ALL_CFLAGS += $(EXTRA_CPPFLAGS) + +# The _DEP version uses the $ file target (for dependency generation) +# See rules.mk +EXTRA_CPPFLAGS_DEP = $(CPPFLAGS_$(BCURDIR)/$(addsuffix .o,$(basename $))) \ + $(CPPFLAGS_$(BCURDIR)) $(obj)%.s: %.S $(CPP) $(ALL_AFLAGS) -o $@ $ $(obj)%.o: %.S diff --git a/rules.mk b/rules.mk index d79fcd3..22562f3 100644 --- a/rules.mk +++ b/rules.mk @@ -25,17 +25,39 @@ _depend: $(obj).depend -$(obj).depend: $(src)Makefile $(TOPDIR)/config.mk $(SRCS) $(HOSTSRCS) - @rm -f $@ - @touch $@ - @for f in $(SRCS); do \ - g=`basename $$f | sed -e 's/\(.*\)\.[[:alnum:]_]/\1.o/'`; \ - $(CC) -M $(CPPFLAGS) -MQ $(obj)$$g $$f $@ ; \ - done - @for f in $(HOSTSRCS); do \ - g=`basename $$f | sed -e 's/\(.*\)\.[[:alnum:]_]/\1.o/'`; \ - $(HOSTCC) -M $(HOSTCPPFLAGS) -MQ $(obj)$$g $$f $@ ; \ - done +# Split the source files into two camps: those in the current directory, and +# those somewhere else. For the first camp we want to support CPPFLAGS_fname +# and for the second we don't / can't. +PWD_SRCS := $(filter $(notdir $(SRCS)),$(SRCS)) +OTHER_SRCS := $(filter-out $(notdir $(SRCS)),$(SRCS)) + +# This is a list of dependency files to generate +DEPS := $(basename $(patsubst %,$(obj).depend.%,$(PWD_SRCS))) + +# Join all the dependencies into a single file, in three parts +# 1 .Concatenate all the generated depend files together +# 2. Add in the deps from OTHER_SRCS which we couldn't process +# 3. Add in the HOSTSRCS +$(obj).depend: $(src)Makefile $(TOPDIR)/config.mk $(DEPS) $(HOSTSRCS) + cat /dev/null $(DEPS) $@ + @for f in $(OTHER_SRCS); do \ + g=`basename $$f | sed -e 's/\(.*\)\.[[:alnum:]_]/\1.o/'`; \ + $(CC) -M $(CPPFLAGS) -MQ $(obj)$$g $$f $@ ; \ + done + @for f in $(HOSTSRCS); do \ + g=`basename $$f | sed -e 's/\(.*\)\.[[:alnum:]_]/\1.o/'`; \ + $(HOSTCC) -M $(HOSTCPPFLAGS) -MQ $(obj)$$g $$f $@ ; \ + done + +MAKE_DEPEND = $(CC) -M $(CPPFLAGS) $(EXTRA_CPPFLAGS_DEP) \ + -MQ $(addsuffix .o,$(obj)$(basename $)) $ $@ + + +$(obj).depend.%: %.c + $(MAKE_DEPEND) + +$(obj).depend.%: %.S + $(MAKE_DEPEND) $(HOSTOBJS): $(obj)%.o: %.c $(HOSTCC) $(HOSTCFLAGS) $(HOSTCFLAGS_$(@F)) $(HOSTCFLAGS_$(BCURDIR)) -o $@ $ -c -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 17/20] Use uintptr_t for 32/64-bit compatibility
This fixes a few problems when building on 64-bit machines. Signed-off-by: Simon Glass s...@chromium.org --- common/cmd_mem.c |2 +- common/fdt_support.c |8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/cmd_mem.c b/common/cmd_mem.c index e84cc4e..28476d7 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -937,7 +937,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (readback != val) { printf (\nMem error @ 0x%08X: found %08lX, expected %08lX\n, - (uint)addr, readback, val); + (uint)(uintptr_t)addr, readback, val); errs++; if (ctrlc()) { putc ('\n'); diff --git a/common/fdt_support.c b/common/fdt_support.c index 46aa842..bc279f5 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -495,7 +495,7 @@ int fdt_resize(void *blob) total = fdt_num_mem_rsv(blob); for (i = 0; i total; i++) { fdt_get_mem_rsv(blob, i, addr, size); - if (addr == (uint64_t)(u32)blob) { + if (addr == (uintptr_t)blob) { fdt_del_mem_rsv(blob, i); break; } @@ -511,14 +511,14 @@ int fdt_resize(void *blob) fdt_size_dt_strings(blob) + 5 * sizeof(struct fdt_reserve_entry); /* Make it so the fdt ends on a page boundary */ - actualsize = ALIGN(actualsize + ((uint)blob 0xfff), 0x1000); - actualsize = actualsize - ((uint)blob 0xfff); + actualsize = ALIGN(actualsize + ((uintptr_t)blob 0xfff), 0x1000); + actualsize = actualsize - ((uintptr_t)blob 0xfff); /* Change the fdt header to reflect the correct size */ fdt_set_totalsize(blob, actualsize); /* Add the new reservation */ - ret = fdt_add_mem_rsv(blob, (uint)blob, actualsize); + ret = fdt_add_mem_rsv(blob, (uintptr_t)blob, actualsize); if (ret 0) return ret; -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 08/20] sandbox: Add board info for architecture
This is required for the bdinfo command to work. This also cleans up the #ifdef mess for ethernet and lnum a little. Signed-off-by: Simon Glass s...@chromium.org --- common/cmd_bdinfo.c | 34 ++ 1 files changed, 30 insertions(+), 4 deletions(-) diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 6051120..0faca6f 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -31,11 +31,14 @@ DECLARE_GLOBAL_DATA_PTR; static void print_num(const char *, ulong); -#if !(defined(CONFIG_ARM) || defined(CONFIG_M68K)) || defined(CONFIG_CMD_NET) +#if !(defined(CONFIG_ARM) || defined(CONFIG_M68K) || defined(CONFIG_SANDBOX)) + || defined(CONFIG_CMD_NET) +#define HAVE_PRINT_ETH static void print_eth(int idx); #endif -#if (!defined(CONFIG_ARM) !defined(CONFIG_X86)) +#if (!defined(CONFIG_ARM) !defined(CONFIG_X86) !defined(CONFIG_SANDBOX)) +#define HAVE_PRINT_LNUM static void print_lnum(const char *, u64); #endif @@ -413,6 +416,29 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; } +#elif defined(CONFIG_SANDBOX) + +int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + int i; + bd_t *bd = gd-bd; + + print_num(boot_params, (ulong)bd-bi_boot_params); + + for (i = 0; i CONFIG_NR_DRAM_BANKS; ++i) { + print_num(DRAM bank, i); + print_num(- start, bd-bi_dram[i].start); + print_num(- size, bd-bi_dram[i].size); + } + +#if defined(CONFIG_CMD_NET) + print_eth(0); + printf(ip_addr = %pI4\n, bd-bi_ip_addr); +#endif + print_num(FB base , gd-fb_base); + return 0; +} + #else #error a case for this architecture does not exist! #endif @@ -422,7 +448,7 @@ static void print_num(const char *name, ulong value) printf(%-12s= 0x%08lX\n, name, value); } -#if !(defined(CONFIG_ARM) || defined(CONFIG_M68K)) || defined(CONFIG_CMD_NET) +#ifdef HAVE_PRINT_ETH static void print_eth(int idx) { char name[10], *val; @@ -437,7 +463,7 @@ static void print_eth(int idx) } #endif -#if (!defined(CONFIG_ARM) !defined(CONFIG_X86)) +#ifdef HAVE_PRINT_LNUM static void print_lnum(const char *name, u64 value) { printf(%-12s= 0x%.8llX\n, name, value); -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/3] USB: Rework usb_kbd.c
On Monday 10 October 2011 11:34:26 Marek Vasut wrote: --- a/common/usb_kbd.c +++ b/common/usb_kbd.c -#undef USB_KBD_DEBUG +#ifdef USB_KBD_DEBUG +#define USB_KBD_PRINTF(fmt, args...) printf(fmt, ##args) +#else +#define USB_KBD_PRINTF(fmt, args...) +#endif could we possibly just get rid of USB_KBD_PRINTF() altogether ? delete this chunk and convert everything else to debug() ? -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/3] USB: Drop dead code from usb_kbd.c
Acked-by: Mike Frysinger vap...@gentoo.org -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 05/13] i2c: Create common default i2c_set_bus_num() function
On Monday 10 October 2011 13:53:48 Tabi Timur-B04825 wrote: On Mon, Oct 10, 2011 at 4:35 AM, Stefano Babic sba...@denx.de wrote: New default, weak i2c_set_bus_num() function. Signed-off-by: Stefano Babic sba...@denx.de Cc: Heiko Schocher h...@denx.de I would prefer to see a new set of I2C functions that take a bus number as a parameter, so that we can eliminate i2c_set_bus_num() (and the global variable it modifies) altogether. i think that'd require a much larger rework of the framework and thus would be better to do in addition to Stefano's work rather than in place of ? -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] microblaze: Enable SERIAL_MULTI
Dear Mike Frysinger, In message 201110101352.15660.vap...@gentoo.org you wrote: it's driver specific code in this file, so it doesn't make much sense to have the board config define something just to get these prototypes It could be a CPU specific header file, then. some of these drivers are shared across SoCs/arches :) So put the #define in the CPU specific header files for all SoCs/arches that use this driver :-) 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 On a clear disk you can seek forever. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] Move timestamp and version files into 'generated' subdir
There is a rather subtle build problem where the build time stamp is not updated for out-of-tree builds if there exists an in-tree build which has a valid timestamp file. So if you do an in-tree build, then an out-of-tree build your timestamp will not change. The correct timestamp_autogenerated.h lives in the object tree, but it is not always found there. The source still lives in the source tree and when compiling version.h, it includes timestamp_autogenerated.h. Since the current directory is always searched first, this will come from the source tree rather than the object tree if it exists there. This affects dependency generation also, which means that common/cmd_version.o will not even be rebuilt if you have ever done an in-tree build. A similar problem exists with the version file. This change moves both files into the 'generated' subdir, which is already used for asm-offsets.h. Then timestamp.h and version.h are updated to include the files from there. There are other places where these generated files are included, but I cannot see why these don't just use the timestamp.h and version.h headers. So this change also tidies that up. I have tested this with in- and out-of-tree builds, but not SPL. I have looked at various other options for fixing this, including sed on the dep files, -I- and -include flags to gcc, but I don't think they can be made to work. Comments welcome. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: - Remove {timestamp,version}_autogenerated.h from include/.gitignore Makefile |5 +++-- arch/arm/cpu/armv7/omap-common/spl.c |3 +-- arch/arm/cpu/armv7/omap-common/spl_mmc.c |3 +-- arch/arm/cpu/armv7/omap-common/spl_nand.c |3 +-- drivers/serial/usbtty.h |2 +- include/.gitignore|2 -- include/timestamp.h |2 +- include/version.h |2 +- 8 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index cd6fc8c..f69ea25 100644 --- a/Makefile +++ b/Makefile @@ -30,8 +30,8 @@ U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) else U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION) endif -TIMESTAMP_FILE = $(obj)include/timestamp_autogenerated.h -VERSION_FILE = $(obj)include/version_autogenerated.h +TIMESTAMP_FILE = $(obj)include/generated/timestamp_autogenerated.h +VERSION_FILE = $(obj)include/generated/version_autogenerated.h HOSTARCH := $(shell uname -m | \ sed -e s/i.86/x86/ \ @@ -456,6 +456,7 @@ $(obj)spl/u-boot-spl.bin: depend $(MAKE) -C spl all $(TIMESTAMP_FILE): + @mkdir -p $(dir $@) @LC_ALL=C date +'#define U_BOOT_DATE %b %d %C%y' $@ @LC_ALL=C date +'#define U_BOOT_TIME %T' $@ diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c index c76fea6..01fd58a 100644 --- a/arch/arm/cpu/armv7/omap-common/spl.c +++ b/arch/arm/cpu/armv7/omap-common/spl.c @@ -29,8 +29,7 @@ #include nand.h #include mmc.h #include fat.h -#include timestamp_autogenerated.h -#include version_autogenerated.h +#include version.h #include asm/omap_common.h #include asm/arch/mmc_host_def.h #include i2c.h diff --git a/arch/arm/cpu/armv7/omap-common/spl_mmc.c b/arch/arm/cpu/armv7/omap-common/spl_mmc.c index 1d1e50c..6f5b43e 100644 --- a/arch/arm/cpu/armv7/omap-common/spl_mmc.c +++ b/arch/arm/cpu/armv7/omap-common/spl_mmc.c @@ -28,8 +28,7 @@ #include asm/arch/sys_proto.h #include mmc.h #include fat.h -#include timestamp_autogenerated.h -#include version_autogenerated.h +#include version.h #include asm/omap_common.h #include asm/arch/mmc_host_def.h diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c b/arch/arm/cpu/armv7/omap-common/spl_nand.c index af02a59..38d06b1 100644 --- a/arch/arm/cpu/armv7/omap-common/spl_nand.c +++ b/arch/arm/cpu/armv7/omap-common/spl_nand.c @@ -25,8 +25,7 @@ #include asm/utils.h #include asm/arch/sys_proto.h #include nand.h -#include timestamp_autogenerated.h -#include version_autogenerated.h +#include version.h #include asm/omap_common.h diff --git a/drivers/serial/usbtty.h b/drivers/serial/usbtty.h index a23169a..14961c1 100644 --- a/drivers/serial/usbtty.h +++ b/drivers/serial/usbtty.h @@ -37,7 +37,7 @@ #include usb/spr_udc.h #endif -#include version_autogenerated.h +#include version.h /* If no VendorID/ProductID is defined in config.h, pretend to be Linux * DO NOT Reuse this Vendor/Product setup with protocol incompatible devices */ diff --git a/include/.gitignore b/include/.gitignore index 77594e5..ec224c5 100644 --- a/include/.gitignore +++ b/include/.gitignore @@ -3,5 +3,3 @@ /bmp_logo.h /config.h /config.mk -/timestamp_autogenerated.h -/version_autogenerated.h diff --git a/include/timestamp.h b/include/timestamp.h index b2f4cf4..05a6658 100644 --- a/include/timestamp.h +++ b/include/timestamp.h
Re: [U-Boot] [PATCH V2 05/13] i2c: Create common default i2c_set_bus_num() function
Mike Frysinger wrote: i think that'd require a much larger rework of the framework and thus would be better to do in addition to Stefano's work rather than in place of ? Hmmm... I guess it would be easier to do the rework eventually if i2c_set_bus_num() is universal, instead of just for PowerPC. -- Timur Tabi Linux kernel developer at Freescale ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled
Dear Anton Staaf, In message CAF6FioWbLz9JKBnj5sJGALtj=bjylnbfvunna6fe62y42t6...@mail.gmail.com you wrote: When PPC was building again, I tested it on ARM (which I assumed was OK, given that this was Anton's primary architecture). =A0That was when I finally gave up, see Yes, the patches expose the fact that almost no boards define CONFIG_SYS_CACHELINE_SIZE. Um... - ls include/configs/* | wc -l 577 - grep CONFIG_SYS_CACHELINE_SIZE include/configs/* | wc -l 199 So that's more than one third of all boards - most of them PPC... I am working on a solution for this. My first thought is to add defines for CONFIG_SYS_CACHELINE_SIZE in all of the arch cache.h files that currently do not have them. This would be all cache.h files other than the PPC one. But this could be a huge amount of work to look up all of the arch cacheline sizes. So I am thinking of putting in a wrong, but large power of two so that boards will build and probably work. But will certainly need to be fixed up... Please don't - bogus stuff that appears to be working is known to never get fixed. Let's rather break the boards - this enforces the needed clean-up. Another solution would be to do the above and define CONFIG_SYS_CACHELINE_SIZE as a large (128?) value and then indicate that that config is to deprecated in favor of Mikes suggestion of using the Linux CACHE BITS defines. Then we can move boards over to that mechanism over time, and in the mean time all boards will compile, and architectures/boards that correctly define their cacheline size will function correctly, and architectures/boards that use the large default will most likely function correctly... At least a big, dfat build warning must be issued, then (but only one, not a loong list). 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 We don't have to protect the environment -- the Second Coming is at hand. - James Watt ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/3] USB: Rework usb_kbd.c
On Monday, October 10, 2011 08:24:48 PM Mike Frysinger wrote: On Monday 10 October 2011 11:34:26 Marek Vasut wrote: --- a/common/usb_kbd.c +++ b/common/usb_kbd.c -#undef USB_KBD_DEBUG +#ifdef USB_KBD_DEBUG +#define USB_KBD_PRINTF(fmt, args...) printf(fmt, ##args) +#else +#define USB_KBD_PRINTF(fmt, args...) +#endif could we possibly just get rid of USB_KBD_PRINTF() altogether ? delete this chunk and convert everything else to debug() ? -mike I'll squash all these in the subsequence gcc4.6, rework debug() macro patch. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/3] USB: Rework usb_kbd.c
On Monday 10 October 2011 14:33:47 Marek Vasut wrote: On Monday, October 10, 2011 08:24:48 PM Mike Frysinger wrote: On Monday 10 October 2011 11:34:26 Marek Vasut wrote: --- a/common/usb_kbd.c +++ b/common/usb_kbd.c -#undef USB_KBD_DEBUG +#ifdef USB_KBD_DEBUG +#define USB_KBD_PRINTF(fmt, args...) printf(fmt, ##args) +#else +#define USB_KBD_PRINTF(fmt, args...) +#endif could we possibly just get rid of USB_KBD_PRINTF() altogether ? delete this chunk and convert everything else to debug() ? I'll squash all these in the subsequence gcc4.6, rework debug() macro patch. WFM Acked-by: Mike Frysinger vap...@gentoo.org -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled
On Mon, Oct 10, 2011 at 11:31 AM, Wolfgang Denk w...@denx.de wrote: Dear Anton Staaf, In message CAF6FioWbLz9JKBnj5sJGALtj=bjylnbfvunna6fe62y42t6...@mail.gmail.com you wrote: When PPC was building again, I tested it on ARM (which I assumed was OK, given that this was Anton's primary architecture). =A0That was when I finally gave up, see Yes, the patches expose the fact that almost no boards define CONFIG_SYS_CACHELINE_SIZE. Um... - ls include/configs/* | wc -l 577 - grep CONFIG_SYS_CACHELINE_SIZE include/configs/* | wc -l 199 So that's more than one third of all boards - most of them PPC... Yes, sorry, I should have said almost no architectures define it, PPC being the exception. I am working on a solution for this. My first thought is to add defines for CONFIG_SYS_CACHELINE_SIZE in all of the arch cache.h files that currently do not have them. This would be all cache.h files other than the PPC one. But this could be a huge amount of work to look up all of the arch cacheline sizes. So I am thinking of putting in a wrong, but large power of two so that boards will build and probably work. But will certainly need to be fixed up... Please don't - bogus stuff that appears to be working is known to never get fixed. Let's rather break the boards - this enforces the needed clean-up. Yes, that's my feeling as well. Another solution would be to do the above and define CONFIG_SYS_CACHELINE_SIZE as a large (128?) value and then indicate that that config is to deprecated in favor of Mikes suggestion of using the Linux CACHE BITS defines. Then we can move boards over to that mechanism over time, and in the mean time all boards will compile, and architectures/boards that correctly define their cacheline size will function correctly, and architectures/boards that use the large default will most likely function correctly... At least a big, dfat build warning must be issued, then (but only one, not a loong list). Would you be OK with a build warning for the lack of definition of CONFIG_SYS_CACHELINE_SIZE like I have now if it only happened once per board? I could move it from common.h to a c file that is always built. Perhaps I could add a checks.c file to libgeneric? I'm not really sure if that's the right place for it. Do you have a suggestion? This new file would include asm/cache.h and then common.h. It would then have a #ifdef to check for CONFIG_SYS_CACHELINE_SIZE. So any arch that defined it in it's asm/cache.h or any board that defined it in it's config file would be OK. All other boards would generate a single compiler warning when building that file. What do you think? I would have to add a couple of empty asm/cache.h files for the architectures that don't currently have them. Thanks, Anton 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 We don't have to protect the environment -- the Second Coming is at hand. - James Watt ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3] Move timestamp and version files into 'generated' subdir
There is a rather subtle build problem where the build time stamp is not updated for out-of-tree builds if there exists an in-tree build which has a valid timestamp file. So if you do an in-tree build, then an out-of-tree build your timestamp will not change. The correct timestamp_autogenerated.h lives in the object tree, but it is not always found there. The source still lives in the source tree and when compiling version.h, it includes timestamp_autogenerated.h. Since the current directory is always searched first, this will come from the source tree rather than the object tree if it exists there. This affects dependency generation also, which means that common/cmd_version.o will not even be rebuilt if you have ever done an in-tree build. A similar problem exists with the version file. This change moves both files into the 'generated' subdir, which is already used for asm-offsets.h. Then timestamp.h and version.h are updated to include the files from there. There are other places where these generated files are included, but I cannot see why these don't just use the timestamp.h and version.h headers. So this change also tidies that up. I have tested this with in- and out-of-tree builds, but not SPL. I have looked at various other options for fixing this, including sed on the dep files, -I- and -include flags to gcc, but I don't think they can be made to work. Comments welcome. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: - Remove {timestamp,version}_autogenerated.h from include/.gitignore Changes in v3: - Rebase to master: a recent commit has tidied up one part of this patch Makefile |4 ++-- arch/arm/cpu/armv7/omap-common/spl.c |3 +-- arch/arm/cpu/armv7/omap-common/spl_mmc.c |3 +-- arch/arm/cpu/armv7/omap-common/spl_nand.c |3 +-- drivers/serial/usbtty.h |2 +- include/.gitignore|2 -- include/timestamp.h |2 +- include/version.h |2 +- 8 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 5db2e0e..dd59922 100644 --- a/Makefile +++ b/Makefile @@ -30,8 +30,8 @@ U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) else U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION) endif -TIMESTAMP_FILE = $(obj)include/timestamp_autogenerated.h -VERSION_FILE = $(obj)include/version_autogenerated.h +TIMESTAMP_FILE = $(obj)include/generated/timestamp_autogenerated.h +VERSION_FILE = $(obj)include/generated/version_autogenerated.h HOSTARCH := $(shell uname -m | \ sed -e s/i.86/x86/ \ diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c index c76fea6..01fd58a 100644 --- a/arch/arm/cpu/armv7/omap-common/spl.c +++ b/arch/arm/cpu/armv7/omap-common/spl.c @@ -29,8 +29,7 @@ #include nand.h #include mmc.h #include fat.h -#include timestamp_autogenerated.h -#include version_autogenerated.h +#include version.h #include asm/omap_common.h #include asm/arch/mmc_host_def.h #include i2c.h diff --git a/arch/arm/cpu/armv7/omap-common/spl_mmc.c b/arch/arm/cpu/armv7/omap-common/spl_mmc.c index 1d1e50c..6f5b43e 100644 --- a/arch/arm/cpu/armv7/omap-common/spl_mmc.c +++ b/arch/arm/cpu/armv7/omap-common/spl_mmc.c @@ -28,8 +28,7 @@ #include asm/arch/sys_proto.h #include mmc.h #include fat.h -#include timestamp_autogenerated.h -#include version_autogenerated.h +#include version.h #include asm/omap_common.h #include asm/arch/mmc_host_def.h diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c b/arch/arm/cpu/armv7/omap-common/spl_nand.c index af02a59..38d06b1 100644 --- a/arch/arm/cpu/armv7/omap-common/spl_nand.c +++ b/arch/arm/cpu/armv7/omap-common/spl_nand.c @@ -25,8 +25,7 @@ #include asm/utils.h #include asm/arch/sys_proto.h #include nand.h -#include timestamp_autogenerated.h -#include version_autogenerated.h +#include version.h #include asm/omap_common.h diff --git a/drivers/serial/usbtty.h b/drivers/serial/usbtty.h index a23169a..14961c1 100644 --- a/drivers/serial/usbtty.h +++ b/drivers/serial/usbtty.h @@ -37,7 +37,7 @@ #include usb/spr_udc.h #endif -#include version_autogenerated.h +#include version.h /* If no VendorID/ProductID is defined in config.h, pretend to be Linux * DO NOT Reuse this Vendor/Product setup with protocol incompatible devices */ diff --git a/include/.gitignore b/include/.gitignore index 77594e5..ec224c5 100644 --- a/include/.gitignore +++ b/include/.gitignore @@ -3,5 +3,3 @@ /bmp_logo.h /config.h /config.mk -/timestamp_autogenerated.h -/version_autogenerated.h diff --git a/include/timestamp.h b/include/timestamp.h index b2f4cf4..05a6658 100644 --- a/include/timestamp.h +++ b/include/timestamp.h @@ -24,7 +24,7 @@ #define__TIMESTAMP_H__ #ifndef DO_DEPS_ONLY -#include timestamp_autogenerated.h +#include generated/timestamp_autogenerated.h #endif #endif /* __TIMESTAMP_H__ */ diff
[U-Boot] WARNING: space prohibited between function name and open parenthesis '('
I'm getting a lot of the following when running checkpatch: WARNING: space prohibited between function name and open parenthesis '(' Should I ignore these? So far, I've written completely new code such that it doesn't trigger this warning, but where editing existing code (e.g. just changing the name of a function), I've avoided fixing this checkpatch warning so it's more obvious what my diff is doing; equally, fixing this would cause the lines I edit to be inconsistent with those around them. Any guidance appreciated. Thanks. -- nvpublic ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/4] Buffer overruns in printf
Hi, On Mon, Sep 26, 2011 at 11:52 PM, Albert ARIBAUD albert.u.b...@aribaud.net wrote: On 27/09/2011 00:28, Scott Wood wrote: - users who actually wisht to limit outpout ca use either You say actually wish to limit output as if let it corrupt memory if it's too large is the normal thing to want. What I meant was users who actually want to limit output explicitly by truncating it rather than implicitly by always outputting small enough text or crafting limitations in the format string specifiers, ... -scott Amicalement, -- Albert. Just to follow up this thread, I am going to drop the network patch and resubmit the rest of it. This will make snprintf() available in U-Boot. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Move timestamp and version files into 'generated' subdir
Hi Mike, On Fri, Oct 7, 2011 at 6:05 PM, Mike Frysinger vap...@gentoo.org wrote: i like generated headers all being in the same place however, you forgot to update include/.gitignore :) -mike OK I did this and sent a new patch set to remove those lines, and a third (oops) since someone has already fixed the Makefile. Things move quickly around here! Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 1/3] Add limits.h to hold basic limits
This brings a basic limits.h implementation into U-Boot. Signed-off-by: Simon Glass s...@chromium.org --- fs/ubifs/ubifs.h |4 +--- include/limits.h | 40 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 include/limits.h diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 0af471a..e7b6e43 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -311,9 +311,7 @@ struct file { #define MAX_LFS_FILESIZE 0x7fffUL #endif -#define INT_MAX((int)(~0U1)) -#define INT_MIN(-INT_MAX - 1) -#define LLONG_MAX ((long long)(~0ULL1)) +#include limits.h /* * These are the fs-independent mount-flags: up to 32 flags are supported diff --git a/include/limits.h b/include/limits.h new file mode 100644 index 000..1021291 --- /dev/null +++ b/include/limits.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. + * 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 + */ + +#ifndef __LIMITS_H +#define __LIMITS_H + +/* Keep all our limits in one place */ + +#define USHRT_MAX ((u16)(~0U)) +#define SHRT_MAX ((s16)(USHRT_MAX1)) +#define SHRT_MIN ((s16)(-SHRT_MAX - 1)) +#define INT_MAX((int)(~0U1)) +#define INT_MIN(-INT_MAX - 1) +#define UINT_MAX (~0U) +#define LONG_MAX ((long)(~0UL1)) +#define LONG_MIN (-LONG_MAX - 1) +#define ULONG_MAX (~0UL) +#define LLONG_MAX ((long long)(~0ULL1)) +#define LLONG_MIN (-LLONG_MAX - 1) +#define ULLONG_MAX (~0ULL) + +#endif -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 3/3] Make printf and vprintf safe from buffer overruns
From: Sonny Rao sonny...@chromium.org From: Sonny Rao sonny...@chromium.org utilize the added vscnprintf functions to avoid buffer overruns The implementation is fairly dumb in that it doesn't detect that the buffer is too small, but at least will not cause crashes. Signed-off-by: Sonny Rao sonny...@chromium.org --- Changes in v2: - Use sizeof(printbuffer) instead of CONFIG_SYS_PBSIZE - Drop patch which changes network code to use snprintf() common/console.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/console.c b/common/console.c index f17875e..1177f7d 100644 --- a/common/console.c +++ b/common/console.c @@ -212,7 +212,7 @@ int serial_printf(const char *fmt, ...) /* For this to work, printbuffer must be larger than * anything we ever want to print. */ - i = vsprintf(printbuffer, fmt, args); + i = vscnprintf(printbuffer, sizeof(printbuffer), fmt, args); va_end(args); serial_puts(printbuffer); @@ -281,7 +281,7 @@ int fprintf(int file, const char *fmt, ...) /* For this to work, printbuffer must be larger than * anything we ever want to print. */ - i = vsprintf(printbuffer, fmt, args); + i = vscnprintf(printbuffer, sizeof(printbuffer), fmt, args); va_end(args); /* Send to desired file */ @@ -426,7 +426,7 @@ int printf(const char *fmt, ...) /* For this to work, printbuffer must be larger than * anything we ever want to print. */ - i = vsprintf(printbuffer, fmt, args); + i = vscnprintf(printbuffer, sizeof(printbuffer), fmt, args); va_end(args); /* Print the string */ @@ -447,7 +447,7 @@ int vprintf(const char *fmt, va_list args) /* For this to work, printbuffer must be larger than * anything we ever want to print. */ - i = vsprintf(printbuffer, fmt, args); + i = vscnprintf(printbuffer, sizeof(printbuffer), fmt, args); /* Print the string */ puts(printbuffer); @@ -514,7 +514,7 @@ inline void dbg(const char *fmt, ...) /* For this to work, printbuffer must be larger than * anything we ever want to print. */ - i = vsprintf(printbuffer, fmt, args); + i = vsnprintf(printbuffer, sizeof(printbuffer), fmt, args); va_end(args); if ((screen + sizeof(screen) - 1 - cursor) -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 2/3] Add safe vsnprintf and snprintf library functions
From: Sonny Rao sonny...@chromium.org From: Sonny Rao sonny...@chromium.org These functions are useful in U-Boot because they allow a graceful failure rather than an unpredictable stack overflow when printf() buffers are exceeded. Mostly copied from the Linux kernel. I copied vscnprintf and scnprintf so we can change printf and vprintf to use the safe implementation but still return the correct values. Signed-off-by: Sonny Rao sonny...@chromium.org --- include/common.h |8 ++- lib/vsprintf.c | 316 ++ 2 files changed, 256 insertions(+), 68 deletions(-) diff --git a/include/common.h b/include/common.h index eb19a44..4e74855 100644 --- a/include/common.h +++ b/include/common.h @@ -699,9 +699,15 @@ unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base) long simple_strtol(const char *cp,char **endp,unsigned int base); void panic(const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2), noreturn)); -intsprintf(char * buf, const char *fmt, ...) +intsprintf(char *buf, const char *fmt, ...) __attribute__ ((format (__printf__, 2, 3))); +intsnprintf(char *buf, size_t size, const char *fmt, ...) + __attribute__ ((format (__printf__, 3, 4))); +intscnprintf(char *buf, size_t size, const char *fmt, ...) + __attribute__ ((format (__printf__, 3, 4))); intvsprintf(char *buf, const char *fmt, va_list args); +intvsnprintf(char *buf, size_t size, const char *fmt, va_list args); +intvscnprintf(char *buf, size_t size, const char *fmt, va_list args); /* lib/strmhz.c */ char * strmhz(char *buf, unsigned long hz); diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 79dead3..bac6f30 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -16,6 +16,7 @@ #include errno.h #include common.h +#include limits.h #if !defined (CONFIG_PANIC_HANG) #include command.h #endif @@ -289,7 +290,8 @@ static noinline char* put_dec(char *buf, unsigned NUM_TYPE num) #define SMALL 32 /* Must be 32 == 0x20 */ #define SPECIAL64 /* 0x */ -static char *number(char *buf, unsigned NUM_TYPE num, int base, int size, int precision, int type) +static char *number(char *buf, char *end, unsigned NUM_TYPE num, + int base, int size, int precision, int type) { /* we are called with base 8, 10 or 16, only, thus don't need G... */ static const char digits[16] = 0123456789ABCDEF; /* GHIJKLMNOPQRSTUVWXYZ; */ @@ -351,37 +353,63 @@ static char *number(char *buf, unsigned NUM_TYPE num, int base, int size, int pr precision = i; /* leading space padding */ size -= precision; - if (!(type (ZEROPAD+LEFT))) - while(--size = 0) - *buf++ = ' '; + if (!(type (ZEROPAD+LEFT))) { + while (--size = 0) { + if (buf end) + *buf = ' '; + ++buf; + } + } /* sign */ - if (sign) - *buf++ = sign; + if (sign) { + if (buf end) + *buf = sign; + ++buf; + } /* 0x / 0 prefix */ if (need_pfx) { - *buf++ = '0'; - if (base == 16) - *buf++ = ('X' | locase); + if (buf end) + *buf = '0'; + ++buf; + if (base == 16) { + if (buf end) + *buf = ('X' | locase); + ++buf; + } } /* zero or space padding */ if (!(type LEFT)) { char c = (type ZEROPAD) ? '0' : ' '; - while (--size = 0) - *buf++ = c; + while (--size = 0) { + if (buf end) + *buf = c; + ++buf; + } } /* hmm even more zero padding? */ - while (i = --precision) - *buf++ = '0'; + while (i = --precision) { + if (buf end) + *buf = '0'; + ++buf; + } /* actual digits of result */ - while (--i = 0) - *buf++ = tmp[i]; + while (--i = 0) { + if (buf end) + *buf = tmp[i]; + ++buf; + + } /* trailing space padding */ - while (--size = 0) - *buf++ = ' '; + while (--size = 0) { + if (buf end) + *buf = ' '; + ++buf; + } return buf; } -static char *string(char *buf, char *s, int field_width, int precision, int flags) +static char *string(char *buf, char *end, char *s, int field_width, + int precision, int flags) { int len,
[U-Boot] [PATCH v2 0/3] Buffer overruns in printf
The printf family of functions in U-Boot cannot deal with a situation where the caller provides a buffer which turns out to be too small for the format string. This can result in buffer overflows, stack overflows and other bad behavior. This patch series tidies this up in the common vsprintf.c code. You can find a discussion of the Linux / U-Boot licensing issues here: http://patchwork.ozlabs.org/patch/116161/ Code Size Impact (From Simon Glass s...@chromium.org) With my ARMv7 compiler (gcc-4.4.3_cos_gg_53174) the code size increase is 328 bytes, about 10% increase to code size vsprintf.o. The newly added functions (snprintf, vscnprintf, scnprintf) are a total of 116 bytes. The changes to number(), string() and vsprintf() to make them respect an end pointer increase size by 80, 20 and 80 bytes respectively. Total text size for existing vsprintf.o functions goes from 0xc10 (3088) to 0xd58 (3416), or 328 bytes. Of this 116 bytes is the new functions and the rest is dealing with the end pointer. There is no data. Changes in v2: - Use sizeof(printbuffer) instead of CONFIG_SYS_PBSIZE - Drop patch which changes network code to use snprintf() Simon Glass (1): Add limits.h to hold basic limits Sonny Rao (2): Add safe vsnprintf and snprintf library functions Make printf and vprintf safe from buffer overruns common/console.c | 10 +- fs/ubifs/ubifs.h |4 +- include/common.h |8 ++- include/limits.h | 40 +++ lib/vsprintf.c | 316 ++ 5 files changed, 302 insertions(+), 76 deletions(-) create mode 100644 include/limits.h -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] mcx: support for HTKW mcx board
Hi Igor, thanks for your comments, I'll post the updated patches soon. Regards, Ilya. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] imx: fix coding style
Fix checkpatch warning and errors in several i.MX related files. Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- arch/arm/cpu/arm1136/mx31/timer.c | 22 +++-- arch/arm/cpu/arm1136/mx35/generic.c |2 +- arch/arm/cpu/arm926ejs/mx25/generic.c | 110 +- arch/arm/cpu/arm926ejs/mx25/reset.c |2 +- arch/arm/cpu/arm926ejs/mx25/timer.c | 16 ++-- arch/arm/cpu/arm926ejs/mx27/reset.c |2 +- arch/arm/cpu/arm926ejs/mx27/timer.c | 14 ++-- arch/arm/cpu/armv7/mx5/soc.c| 10 +-- arch/arm/include/asm/arch-mx5/sys_proto.h | 10 +++ board/davedenx/qong/qong.c | 10 +- board/freescale/mx31ads/mx31ads.c |2 +- board/karo/tx25/tx25.c |2 +- board/logicpd/imx27lite/imx27lite.c |6 +- board/logicpd/imx31_litekit/imx31_litekit.c |2 +- 14 files changed, 109 insertions(+), 101 deletions(-) diff --git a/arch/arm/cpu/arm1136/mx31/timer.c b/arch/arm/cpu/arm1136/mx31/timer.c index 717a2b7..d3a461e 100644 --- a/arch/arm/cpu/arm1136/mx31/timer.c +++ b/arch/arm/cpu/arm1136/mx31/timer.c @@ -43,7 +43,10 @@ DECLARE_GLOBAL_DATA_PTR; -/* time is measured in 1 / CONFIG_SYS_HZ seconds, tick is internal timer period */ +/* time is measured in 1 / CONFIG_SYS_HZ seconds, + * tick is internal timer period + */ + #ifdef CONFIG_MX31_TIMER_HIGH_PRECISION /* ~0.4% error - measured with stop-watch on 100s boot-delay */ static inline unsigned long long tick_to_time(unsigned long long tick) @@ -68,7 +71,8 @@ static inline unsigned long long us_to_tick(unsigned long long us) } #else /* ~2% error */ -#define TICK_PER_TIME ((CONFIG_MX31_CLK32 + CONFIG_SYS_HZ / 2) / CONFIG_SYS_HZ) +#define TICK_PER_TIME ((CONFIG_MX31_CLK32 + CONFIG_SYS_HZ / 2) \ + / CONFIG_SYS_HZ) #define US_PER_TICK(100 / CONFIG_MX31_CLK32) static inline unsigned long long tick_to_time(unsigned long long tick) @@ -91,7 +95,7 @@ static inline unsigned long long us_to_tick(unsigned long long us) #endif /* The 32768Hz 32-bit timer overruns in 131072 seconds */ -int timer_init (void) +int timer_init(void) { int i; @@ -106,7 +110,7 @@ int timer_init (void) return 0; } -unsigned long long get_ticks (void) +unsigned long long get_ticks(void) { ulong now = GPTCNT; /* current tick value */ @@ -119,7 +123,7 @@ unsigned long long get_ticks (void) return gd-tbl; } -ulong get_timer_masked (void) +ulong get_timer_masked(void) { /* * get_ticks() returns a long long (64 bit), it wraps in @@ -130,13 +134,13 @@ ulong get_timer_masked (void) return tick_to_time(get_ticks()); } -ulong get_timer (ulong base) +ulong get_timer(ulong base) { - return get_timer_masked () - base; + return get_timer_masked() - base; } /* delay x useconds AND preserve advance timestamp value */ -void __udelay (unsigned long usec) +void __udelay(unsigned long usec) { unsigned long long tmp; ulong tmo; @@ -148,7 +152,7 @@ void __udelay (unsigned long usec) /*NOP*/; } -void reset_cpu (ulong addr) +void reset_cpu(ulong addr) { struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE; wdog-wcr = WDOG_ENABLE; diff --git a/arch/arm/cpu/arm1136/mx35/generic.c b/arch/arm/cpu/arm1136/mx35/generic.c index fcfaba5..1b9809b 100644 --- a/arch/arm/cpu/arm1136/mx35/generic.c +++ b/arch/arm/cpu/arm1136/mx35/generic.c @@ -240,7 +240,7 @@ unsigned int mxc_get_main_clock(enum mxc_main_clocks clk) } break; case IPG_CLK: - ret_val = get_ipg_clk();; + ret_val = get_ipg_clk(); break; case IPG_PER_CLK: ret_val = get_ipg_per_clk(); diff --git a/arch/arm/cpu/arm926ejs/mx25/generic.c b/arch/arm/cpu/arm926ejs/mx25/generic.c index 8e60a26..c045a0b 100644 --- a/arch/arm/cpu/arm926ejs/mx25/generic.c +++ b/arch/arm/cpu/arm926ejs/mx25/generic.c @@ -39,7 +39,7 @@ * f = 2 * f_ref * *pd + 1 */ -static unsigned int imx_decode_pll (unsigned int pll, unsigned int f_ref) +static unsigned int imx_decode_pll(unsigned int pll, unsigned int f_ref) { unsigned int mfi = (pll CCM_PLL_MFI_SHIFT) CCM_PLL_MFI_MASK; @@ -52,57 +52,57 @@ static unsigned int imx_decode_pll (unsigned int pll, unsigned int f_ref) mfi = mfi = 5 ? 5 : mfi; - return lldiv (2 * (u64) f_ref * (mfi * (mfd + 1) + mfn), + return lldiv(2 * (u64) f_ref * (mfi * (mfd + 1) + mfn), (mfd + 1) * (pd + 1)); } -static ulong imx_get_mpllclk (void) +static ulong imx_get_mpllclk(void) { struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE; ulong fref = 2400; - return imx_decode_pll (readl (ccm-mpctl), fref); + return
Re: [U-Boot] [PATCH v3] Move timestamp and version files into 'generated' subdir
Acked-by: Mike Frysinger vap...@gentoo.org -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/5] usb:gadget:s5p USB Device Controller (UDC) implementation
On 10/09/2011 02:43 PM, Wolfgang Denk wrote: Dear Lukasz Majewski, In message 20111007093950.17d94287@lmajewski.digital.local you wrote: Most warnings are related to lines over 80 characters. This code is a debug code. As fair as I remember debug print code shall not be break in Linux kernel for easier debugging. Can you please point me to the respective entry in the CodingStyle file? Note the last sentence: Chapter 2: Breaking long lines and strings Coding style is all about readability and maintainability using commonly available tools. The limit on the length of lines is 80 columns and this is a strongly preferred limit. Statements longer than 80 columns will be broken into sensible chunks, unless exceeding 80 columns significantly increases readability and does not hide information. Descendants are always substantially shorter than the parent and are placed substantially to the right. The same applies to function headers with a long argument list. However, never break user-visible strings such as printk messages, because that breaks the ability to grep for them. -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Introduce generic TPM support in u-boot
Wolfgang, thank you for your comments, I'll address them in a follow-up submission, but I have a question regarding the register access (and the issue was indeed brought up by vapier@ at an earlier review on a different submission). On Mon, Oct 10, 2011 at 3:45 AM, Wolfgang Denk w...@denx.de wrote: +#define TIS_REG(LOCALITY, REG) \ + (void *)(CONFIG_TPM_TIS_BASE_ADDRESS + (LOCALITY 12) + REG) We do not allow to access device registers through base address + offset. Please always use C structs instead. so, this chip has five different areas (localities) which have the same structure, and are mapped at certain regular offsets inside the chip. thus the structure describing the chip would be something like struct locality { u16 field_a; u8 field_b; u32 field_c; .. u8 padding[padding size]; } __packed; struct tmp_chip { struct locality localities[5]; } __packed; which is very compiler dependent, but probably not the only place in u-boot, so I could live with that if you could. Yet another inconvenience though is the requirement to be able to trace accesses to the registers. Some of the registers can be accessed in 32 bit mode or 8 bit mode, and this determines how many bytes get sent into/read from a data fifo. The tracing function should be able to tell what mode the register was accessed in. A way I see to do it through a structure layout is to define the same fields through unions. What I am getting at is that the code is much better readable as it is now even though it is in violation of the 'use structure to access registers' requirement. Or maybe I am missing an obvious way to do it? Can you please elaborate, cheers, /vb ... +/* TPM access functions are carved out to make tracing easier. */ +static u32 tpm_read(int locality, u32 reg) +{ + u32 value; + /* + * Data FIFO register must be read and written in byte access mode, + * otherwise the FIFO values are returned 4 bytes at a time. + */ Please insert blank line between declarations and code. Please fix globally. ... + /* this will have to be converted into debug printout */ + TPM_DEBUG(Found TPM %s by %s\n, device_name, vendor_name); Is this comment still correct? +int tis_init(void) +{ + if (tis_probe()) + return TPM_DRIVER_ERR; + return 0; +} Or simply: return tis_probe(); 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 Hegel was right when he said that we learn from history that man can never learn anything from history. - George Bernard Shaw ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 0/6] tegra2: Add more clock/pinmux functionality
Hi Albert, On Tue, Sep 27, 2011 at 9:04 AM, Simon Glass s...@chromium.org wrote: Hi Albert, On Tue, Sep 27, 2011 at 12:21 AM, Albert ARIBAUD albert.u.b...@aribaud.net wrote: Hi Simon, On 26/09/2011 19:06, Simon Glass wrote: Hi Albert, On Wed, Sep 21, 2011 at 3:40 PM, Simon Glasss...@chromium.org wrote: This adds to the basic clock functionality already available. The concept of a peripheral ID is introduced, and all peripheral clock access is done using this ID. Functions are provided to start, query and adjust peripheral clocks, including automatic selection of the best available clock based on the requested rate (this replaces hard-coded divisors). On the pinmux side we can now select functions for pin groups using the new pinmux_set_func() function. Expanded functions are provided to adjust and query PLL clocks. With a full compliment of clock and pinmux functions, it should no longer be necessary for board/driver code to directly access clock registers. This change removes all such accesses. This functionality will be used for I2C, SPI, LCD, USB, keyboard, NAND and other drivers for Tegra2. At then end is a patch to enable MMC on Seaboard, to make it all worthwhile. Note: These patches include a definition of assert() which I will happily remove if the one sent upstream is accepted. Changes in v2: - Remove assert() which is now in common.h Simon Glass (6): tegra2: Rename CLOCK_PLL_ID to CLOCK_ID tegra2: Clean up board code a little tegra2: Add more clock functions tegra2: Rename PIN_ to PINGRP_ tegra2: Add more pinmux functions tegra2: Enable MMC for Seaboard Are these ready to apply, do you think? They would appear to. Only these are not bug fixes, and so close to a release, I am going to add them in /next, not /master. Yes, definitely /next, thanks. Now that the release is over, is it possible to get these applied please? Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] arm: Tidy up of PRAM init to use getenv_f()
It seems that few people use CONFIG_PRAM on ARM. The getenv_r() function has been renamed to getenv_f(). Signed-off-by: Simon Glass s...@chromium.org --- arch/arm/lib/board.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index 1fe3751..653345f 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -317,7 +317,7 @@ void board_init_f(ulong bootflag) /* * reserve protected RAM */ - i = getenv_r(pram, (char *)tmp, sizeof(tmp)); + i = getenv_f(pram, (char *)tmp, sizeof(tmp)); reg = (i 0) ? simple_strtoul((const char *)tmp, NULL, 10) : CONFIG_PRAM; addr -= (reg 10);/* size is in kB */ -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] NAND: davinci: choose correct 1-bit h/w ECC reg
On 09/26/2011 11:02 AM, Laurence Withers wrote: In nand_davinci_readecc(), select the correct NANDFnECC register based on CONFIG_SYS_NAND_CS rather than hardcoding the choice of NANDF1ECC. This allows 1-bit hardware ECC to work with chip select other than CS2. Note this now matches the usage in nand_davinci_enable_hwecc(), which already had the correct handling, and allows refactoring to a single function encapsulating the register read. Without this fix, writing NAND pages to a chip not wired to CS2 would result in in the ECC calculation always returning FF for each 512-byte segment, and reading back a correctly written page (one with ECC intact) would always fail. With this fix, the ECC is written and verified correctly. Signed-off-by: Laurence Withers lwith...@guralp.com --- Changes for v2: Add Signed-off-by to commit message. --- drivers/mtd/nand/davinci_nand.c | 26 +- 1 files changed, 13 insertions(+), 13 deletions(-) Applied to u-boot-nand-flash -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] WARNING: space prohibited between function name and open parenthesis '('
Dear Stephen Warren, In message 74cdbe0f657a3d45afbb94109fb122ff173b23b...@hqmail01.nvidia.com you wrote: I'm getting a lot of the following when running checkpatch: WARNING: space prohibited between function name and open parenthesis '(' Should I ignore these? No, these should be fixed. So far, I've written completely new code such that it doesn't trigger this warning, but where editing existing code (e.g. just changing the name of a function), I've avoided fixing this checkpatch warning so it's more obvious what my diff is doing; equally, fixing this would cause the lines I edit to be inconsistent with those around them. Any guidance appreciated. Thanks. The normal procedure is to submit a [COSMETIC] patch first that fixes the coding style issues of the affected file (and _only_ these), and then submit a chackpatch-clean patch with the actual changes. 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 EARTH smog | bricks AIR -- mud -- FIRE soda water | tequila WATER ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot