[U-Boot] [PATCH][v2] driver/nand: Update SRAM initialize logic for IFC.
IFC controller v1.1.0 requires internal SRAM initialize by reading NAND flash. Higher controller versions have provided "SRAM init" bit in NCFGR register space. update SRAM initialize logic to reflect the same. Also print error message in case of Page read error. Signed-off-by: Prabhakar Kushwaha --- Changes for v2: - Updated error handling drivers/mtd/nand/fsl_ifc_nand.c | 35 +++ include/fsl_ifc.h |2 ++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c index 27f5177..280e14e 100644 --- a/drivers/mtd/nand/fsl_ifc_nand.c +++ b/drivers/mtd/nand/fsl_ifc_nand.c @@ -806,12 +806,30 @@ static void fsl_ifc_select_chip(struct mtd_info *mtd, int chip) { } -static void fsl_ifc_sram_init(void) +static int fsl_ifc_sram_init(uint32_t ver) { struct fsl_ifc *ifc = ifc_ctrl->regs; uint32_t cs = 0, csor = 0, csor_8k = 0, csor_ext = 0; + uint32_t ncfgr = 0; long long end_tick; + if (ver > FSL_IFC_V1_1_0) { + ncfgr = ifc_in32(&ifc->ifc_nand.ncfgr); + ifc_out32(&ifc->ifc_nand.ncfgr, ncfgr | IFC_NAND_SRAM_INIT_EN); + + /* wait for SRAM_INIT bit to be clear or timeout */ + end_tick = usec2ticks(IFC_TIMEOUT_MSECS * 1000) + get_ticks(); + while (end_tick > get_ticks()) { + ifc_ctrl->status = + ifc_in32(&ifc->ifc_nand.nand_evter_stat); + + if (!(ifc_ctrl->status & IFC_NAND_SRAM_INIT_EN)) + return 0; + } + printf("fsl-ifc: Failed to Initialise SRAM\n"); + return 1; + } + cs = ifc_ctrl->cs_nand >> IFC_NAND_CSEL_SHIFT; /* Save CSOR and CSOR_ext */ @@ -854,11 +872,18 @@ static void fsl_ifc_sram_init(void) break; } + if (ifc_ctrl->status != IFC_NAND_EVTER_STAT_OPC) { + printf("fsl-ifc: Failed to Initialise SRAM\n"); + return 1; + } + ifc_out32(&ifc->ifc_nand.nand_evter_stat, ifc_ctrl->status); /* Restore CSOR and CSOR_ext */ ifc_out32(&ifc_ctrl->regs->csor_cs[cs].csor, csor); ifc_out32(&ifc_ctrl->regs->csor_cs[cs].csor_ext, csor_ext); + + return 0; } static int fsl_ifc_chip_init(int devnum, u8 *addr) @@ -868,7 +893,7 @@ static int fsl_ifc_chip_init(int devnum, u8 *addr) struct fsl_ifc_mtd *priv; struct nand_ecclayout *layout; uint32_t cspr = 0, csor = 0, ver = 0; - int ret; + int ret = 0; if (!ifc_ctrl) { fsl_ifc_ctrl_init(); @@ -1010,8 +1035,10 @@ static int fsl_ifc_chip_init(int devnum, u8 *addr) } ver = ifc_in32(&ifc_ctrl->regs->ifc_rev); - if (ver == FSL_IFC_V1_1_0) - fsl_ifc_sram_init(); + if (ver >= FSL_IFC_V1_1_0) + ret = fsl_ifc_sram_init(ver); + if (ret) + return ret; ret = nand_scan_ident(mtd, 1, NULL); if (ret) diff --git a/include/fsl_ifc.h b/include/fsl_ifc.h index 630e4b4..b353b04 100644 --- a/include/fsl_ifc.h +++ b/include/fsl_ifc.h @@ -367,6 +367,8 @@ */ /* Auto Boot Mode */ #define IFC_NAND_NCFGR_BOOT0x8000 +/* SRAM INIT EN */ +#define IFC_NAND_SRAM_INIT_EN 0x2000 /* Addressing Mode-ROW0+n/COL0 */ #define IFC_NAND_NCFGR_ADDR_MODE_RC0 0x /* Addressing Mode-ROW0+n/COL0+n */ -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH][v2] driver/nand: Add support of 16K SRAM for IFC 2.0
Internal SRAM has been incresed from 8KB to 16KB for IFC cotroller ver 2.0. Update the page offset calculation logic to support the same. Signed-off-by: Prabhakar Kushwaha --- Changes for v2: rebased the patch drivers/mtd/nand/fsl_ifc_nand.c | 25 + 1 file changed, 25 insertions(+) diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c index 280e14e..fd5f536 100644 --- a/drivers/mtd/nand/fsl_ifc_nand.c +++ b/drivers/mtd/nand/fsl_ifc_nand.c @@ -24,6 +24,7 @@ #endif #define FSL_IFC_V1_1_0 0x0101 +#define FSL_IFC_V2_0_0 0x0200 #define MAX_BANKS CONFIG_SYS_FSL_IFC_BANK_COUNT #define ERR_BYTE 0xFF /* Value returned for read bytes when read failed */ @@ -1040,6 +1041,30 @@ static int fsl_ifc_chip_init(int devnum, u8 *addr) if (ret) return ret; + if (ver >= FSL_IFC_V2_0_0) { + switch (csor & CSOR_NAND_PGS_MASK) { + case CSOR_NAND_PGS_512: + priv->bufnum_mask = 31; + break; + + case CSOR_NAND_PGS_2K: + priv->bufnum_mask = 7; + break; + + case CSOR_NAND_PGS_4K: + priv->bufnum_mask = 3; + break; + + case CSOR_NAND_PGS_8K: + priv->bufnum_mask = 1; + break; + + default: + printf("ifc nand: bad csor %#x: bad page size\n", csor); + return -ENODEV; + } + } + ret = nand_scan_ident(mtd, 1, NULL); if (ret) return ret; -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Refactoring of U-Boot directory structure
Hi Wolfgang, On Thu, 12 Jun 2014 06:41:45 +0200 Wolfgang Denk wrote: > Dear Masahiro, > > In message <20140612131050.963a.aa925...@jp.panasonic.com> you wrote: > > > > [1] Do not split the similar SoC family to various directories > > > > at91 SoC directory exists under arm920t, arm926ejs, armv7 directory. > > To me this actually makes sense, as they are using different CPU cores > (ARMv4t vs. ARMv5te vs. ARMv7). > > > ./arch/arm/cpu/arm920t/at91 > > ./arch/arm/cpu/arm926ejs/at91 > > ./arch/arm/cpu/armv7/at91 > > > > It looks reasonable to collect at91 sources into a single place, > > arch/arm/mach-at91 > > Did you look at the code? Files like lowlevel_init.S, reset.c or > timer.c look pretty much specific to the respective architecture. > What would be the benefit of mixing all this different stuff in a > single directory? No. I am discussing from the generic view. In the current structure, there is no place which at91-common part should go to. Splitting code into various directories loses the motivation of consolidating the common part even if it exists. (Again, just in case, this is generalities. I am not familiar with the at91-specific implementation.) > > That's why Tegra directories are sprinkled under arch/arm/: > > > > arch/arm/cpu/arm720t/tegra-common/ > > arch/arm/cpu/arm720t/tegra20/ > > arch/arm/cpu/arm720t/tegra30/ > > arch/arm/cpu/arm720t/tegra114/ > > arch/arm/cpu/arm720t/tegra124/ > > arch/arm/cpu/armv7/tegra-common/ > > arch/arm/cpu/armv7/tegra20/ > > arch/arm/cpu/armv7/tegra30/ > > arch/arm/cpu/armv7/tegra114/ > > arch/arm/cpu/armv7/tegra124/ > > arch/arm/include/asm/arch-tegra/ > > arch/asm/include/asm/arch-tegra20/ > > arch/asm/include/asm/arch-tegra30/ > > arch/asm/include/asm/arch-tegra114/ > > arch/asm/include/asm/arch-tegra124/ > > > > > > They can be refactored > > > > arch/arm/mach-tegra/ : tegra common part > > arch/arm/mach-tegra/tegra20/ : tegra20-specific > > arch/arm/mach-tegra/tegra30/ : tegra30-specific > > arch/arm/mach-tegra/tegra114/ : tegra114-specific > > arch/arm/mach-tegra/tegra124/ : tegra124-specific > > Again, we have different CPU cores here, and thus pretty much > different code - what would be the benefit of mixing unrelated code > in a single directory? > At lease, they are developed by the same LSI vendor. And the code is maintained by the same person: Besides, arch/arm/cpu/armv7/tegra30/ arch/arm/cpu/armv7/tegra114/ arch/arm/cpu/armv7/tegra124/ are empty. These directories exist just to meet the requirement of arch/${ARCH}/cpu/${CPU}/${SOC} structure. Without those dummy directories, build fails. Best Regards Masahiro Yamada ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] fs/fat: add a parameter: allow_whole_dev to fat_register_device()
Dear Josh Wu, In message <1402552643-13297-1-git-send-email-josh...@atmel.com> you wrote: > For SPL in FAT and envrionment load/save in FAT, to support no partition > table device (whole device is FAT partition). We need specify the partition > number as 0. Sorry, I cannot parse this. What exactly do you mean here? > But in FAT SPL and environment case, when we specify the partition number as > 1, it is reasonable to support the device has no partition table and only a > FAT partition. Why would the expectations in SPL be different from other use cases? > +int fat_register_device(block_dev_desc_t *dev_desc, int part_no, > + bool allow_whole_dev); Please make this an "int" type, and use 0 and 1. Thanks. 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 The Wright Bothers weren't the first to fly. They were just the first not to crash. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] Add ctrlc_ignore environment variable to ignore Ctrl-C
Dear Simon, In message you wrote: > > > - This buffering of data in this patch is intended to solve a specific > > problem that could be avoided by more clever test scripts. Instead > > of just dumping an endless stream of characters to the serial > > console independent of what U-Boot is doing, one should always wit > > for the next CLI prompt before sending the next command. Tools like > > "expect" can do this easily. > > Agreed it could be done that way, but it is so much easier if U-Boot > can behave in a simple way with input. We may end up with more > complicated test scripts although I would prefer that we focus on unit > tests a bit more. As long as we don't support interrupts on all architectures and convert at least the UART drivers to use an interrupt driven mode we will always face the situation that U-Boot will bi strictly single- threaded and just does not read any input while doing something else, like running a command. So all test scripts should consider this behaviour of the input interface. If they send more than one line of text to input, they should do it line by line, and always wait for the CLI prompt first. Yes, this is inconvenient. > Fair enough, I don't disagree with this at all. The use case for > buffering is when you have the LCD running and it is quite slow to > print characters. You then can't type quickly at the keyboard - > U-Boot just gets behind. It happens on snow and seaboard when the > caches are off. Heh. So the obvious solution is to turn the caches on :-) No - I do understand what you want, and why, and I agree that it would be nice to have. 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 I can type faster than I can move a mouse, so I find menu-driven drawing packages time consuming and frustrating. - W. R. Stevens ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] arm, calimain: Add CONFIG_SYS_GENERIC_BOARD
Signed-off-by: Christian Riesch --- include/configs/calimain.h |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/configs/calimain.h b/include/configs/calimain.h index febee45..b27f973 100644 --- a/include/configs/calimain.h +++ b/include/configs/calimain.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 OMICRON electronics GmbH + * Copyright (C) 2011-2014 OMICRON electronics GmbH * * Based on da850evm.h. Original Copyrights follow: * @@ -18,6 +18,7 @@ #define CONFIG_DRIVER_TI_EMAC #define MACH_TYPE_CALIMAIN 3528 #define CONFIG_MACH_TYPE MACH_TYPE_CALIMAIN +#define CONFIG_SYS_GENERIC_BOARD /* * SoC Configuration -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] fs/fat: add a parameter: allow_whole_dev to fat_register_device()
For SPL in FAT and envrionment load/save in FAT, to support no partition table device (whole device is FAT partition). We need specify the partition number as 0. But in FAT SPL and environment case, when we specify the partition number as 1, it is reasonable to support the device has no partition table and only a FAT partition. This patch add a parameter: allow_whole_dev for fat_register_device(). If allow_whole_dev is true, it will enable no partition table device. In FAT SPL and FAT file environment, we call fat_register_device() with allow_whole_dev as true. Other cases we call it with false. Signed-off-by: Josh Wu --- board/cm5200/fwupdate.c|2 +- board/esd/common/auto_update.c |3 +-- board/mcc200/auto_update.c |4 ++-- common/env_fat.c |4 ++-- common/spl/spl_fat.c |2 +- fs/fat/fat.c | 15 +++ include/fat.h |3 ++- 7 files changed, 20 insertions(+), 13 deletions(-) diff --git a/board/cm5200/fwupdate.c b/board/cm5200/fwupdate.c index 06d5023..801d82a 100644 --- a/board/cm5200/fwupdate.c +++ b/board/cm5200/fwupdate.c @@ -120,7 +120,7 @@ static int load_rescue_image(ulong addr) /* Detect partition */ for (partno = -1, i = 0; i < 6; i++) { if (get_partition_info(stor_dev, i, &info) == 0) { - if (fat_register_device(stor_dev, i) == 0) { + if (fat_register_device(stor_dev, i, false) == 0) { /* Check if rescue image is present */ FW_DEBUG("Looking for firmware directory '%s'" " on partition %d\n", fwdir, i); diff --git a/board/esd/common/auto_update.c b/board/esd/common/auto_update.c index 85c3567..d2dd76a 100644 --- a/board/esd/common/auto_update.c +++ b/board/esd/common/auto_update.c @@ -30,7 +30,6 @@ extern int N_AU_IMAGES; #define MAX_LOADSZ 0x1c0 /* externals */ -extern int fat_register_device(block_dev_desc_t *, int); extern int file_fat_detectfs(void); extern long file_fat_read(const char *, void *, unsigned long); long do_fat_read (const char *filename, void *buffer, @@ -390,7 +389,7 @@ int do_auto_update(void) } } - if (fat_register_device (stor_dev, 1) != 0) { + if (fat_register_device(stor_dev, 1, false) != 0) { debug ("Unable to register ide disk 0:1\n"); return -1; } diff --git a/board/mcc200/auto_update.c b/board/mcc200/auto_update.c index 43173ce..6cc12d5 100644 --- a/board/mcc200/auto_update.c +++ b/board/mcc200/auto_update.c @@ -106,7 +106,7 @@ ulong totsize; #define KEYPAD_MASK_HI ((1<<(KEYPAD_COL-1+(KEYPAD_ROW*3-3)))>>8) /* externals */ -extern int fat_register_device(block_dev_desc_t *, int); +extern int fat_register_device(block_dev_desc_t *, int, bool); extern int file_fat_detectfs(void); extern long file_fat_read(const char *, void *, unsigned long); extern int i2c_read (unsigned char, unsigned int, int , unsigned char* , int); @@ -373,7 +373,7 @@ int do_auto_update(void) res = -1; goto xit; } - if (fat_register_device(stor_dev, 1) != 0) { + if (fat_register_device(stor_dev, 1, false) != 0) { debug ("Unable to use USB %d:%d for fatls\n", au_usb_stor_curr_dev, 1); res = -1; diff --git a/common/env_fat.c b/common/env_fat.c index aad0487..b36e08e 100644 --- a/common/env_fat.c +++ b/common/env_fat.c @@ -67,7 +67,7 @@ int saveenv(void) return 1; } - err = fat_register_device(dev_desc, part); + err = fat_register_device(dev_desc, part, true); if (err) { printf("Failed to register %s%d:%d\n", FAT_ENV_INTERFACE, dev, part); @@ -117,7 +117,7 @@ void env_relocate_spec(void) return; } - err = fat_register_device(dev_desc, part); + err = fat_register_device(dev_desc, part, true); if (err) { printf("Failed to register %s%d:%d\n", FAT_ENV_INTERFACE, dev, part); diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c index 56be943..c7a4fd6 100644 --- a/common/spl/spl_fat.c +++ b/common/spl/spl_fat.c @@ -25,7 +25,7 @@ static int spl_register_fat_device(block_dev_desc_t *block_dev, int partition) if (fat_registered) return err; - err = fat_register_device(block_dev, partition); + err = fat_register_device(block_dev, partition, true); if (err) { #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT printf("%s: fat register err - %d\n", __func__, err); diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 54f42ea..ad08cde 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -81,7 +81,8 @@ int fat_set_blk_dev(block_dev_desc_t *dev_desc, disk_partition_t *info) return -1; } -int fat_register_device(
[U-Boot] [PATCH] .gitignore: drop include/asm/proc from ignore pattern
Commit 7d89982b stopped creating symbolic link arch/${arch}/include/asm/proc. arch/.gitignore should be updated. Signed-off-by: Masahiro Yamada Cc: Vasili Galka --- Vasili, Commit 7d89982b is a very good clean-up. Thanks!! arch/.gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/.gitignore b/arch/.gitignore index a1fbe01..2714b86 100644 --- a/arch/.gitignore +++ b/arch/.gitignore @@ -1,2 +1 @@ /*/include/asm/arch -/*/include/asm/proc -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] Add ctrlc_ignore environment variable to ignore Ctrl-C
Hi Wolfgang, On 12 June 2014 01:03, Wolfgang Denk wrote: > Dear Simon, > > In message > you > wrote: >> >> > Hm... ignoring it would mean there is no way to interrupt long running >> > commands. I'm not sure if this is actually an improvement. >> > Eventually we should try to define the wanted behaviour first. >> > My initial feelingis that ^C should terminate a running command nd >> > return us to the shell, but not terminate U-Boot. Outside of sandbox, >> > the only regular way to terminate U-Boot is the "reboot" command. >> > Maybe we should do the same in sandbox? >> >> It is very convenient to terminate U-Boot with Ctrl-C - it makes it >> work like a 'normal' program, and you can still terminate a >> long-running command - it just quits U-Boot just like any other >> command-line utility. When quickly running tests it is helpful. Also >> it is less confusing I think for people who don't know how to exit. > > But that's the point: U-Boot with it's CLI is NOT "a 'normal' program". > It's an interactive tool like a shell or an editor. When you run a > shell (say, bash) as CLI then you also expect that ^C will only > terminate the currently running command, and not exit the shell. I agree that is more correct, although I must admit the current way is much easier to use IMO. And I run a lot of sandbox tests. But as they say, patches welcome :-) I suppose one solution would be to introduce a configuration file for sandbox, as with patman. > >> You can use '-t raw' to get the behaviour you want. Is that good enough? > > This should be the default, I think. > >> U-Boot sandbox does not yet support 'reboot', but 'reset' does quit U-Boot. > > Ah, yes. Typo. I meant "reset", of course. OK, then this is fine. > >> >> I'm not sure if you recall the serial driver buffer patch I sent for >> > >> > I'm afraid I don't. >> >> Actually I think I was thinking of Scott Wood's patch: >> >> http://patchwork.ozlabs.org/patch/90066/ > > Ah, this one. Well, frankly, I don't lioke that for a number of > reasons: > > - We have a ton of different UART drivers.Any such implementation > should be general enough to be usable on more than one type, ideally > completely hardware independent. Yes, it could go at the console level. > - This buffering of data in this patch is intended to solve a specific > problem that could be avoided by more clever test scripts. Instead > of just dumping an endless stream of characters to the serial > console independent of what U-Boot is doing, one should always wit > for the next CLI prompt before sending the next command. Tools like > "expect" can do this easily. Agreed it could be done that way, but it is so much easier if U-Boot can behave in a simple way with input. We may end up with more complicated test scripts although I would prefer that we focus on unit tests a bit more. > - We have to decide what we want. Either we define the serial input > system of U-Boot as intentionally simple, allowing it to work with > minimal resources (like very, very early after reset, long before > relocation to RAM, i. e. without much space on the stack, without > writable data segment, without .bss). Or we want a feature-rich, > powerful input system with maximum data throuhput, buffering, type > ahead, line disciplines, etc. The current implementation is clearly > following the former design ideas, and I think this is OK so. The > second method is indeed more powerful, but quickly caklls for > additional complexity to implement properly - say, interrupt support > for the UART drivers, which means we enter a whole new leel of > complexity. The current implementation is clearly following the > former design ideas, and I think this is OK so. The second method > is indeed more powerful, but quickly caklls for additional > complexity to implement properly - say, interrupt support for the > UART drivers, which means we enter a whole new leel of complexity. Fair enough, I don't disagree with this at all. The use case for buffering is when you have the LCD running and it is quite slow to print characters. You then can't type quickly at the keyboard - U-Boot just gets behind. It happens on snow and seaboard when the caches are off. > >> Yes I wanted to avoid that also. I guess we are left with signal >> handling as the solution. But for now I might just disable Ctrl-C for >> sandbox unless the 'raw' terminal is used. That will allow the tests >> to work correctly at least. > > As mentioned, I think the default behaviour should be different. Understood. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 13/15] tegra: Enable driver model
Enable driver model for Tegra boards. Signed-off-by: Simon Glass Acked-by: Stephen Warren --- Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: - Enable dm command in this patch instead of the next Changes in v2: - Split out a separate patch to enable driver model for tegra include/configs/tegra-common.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h index 129acf2..3b88a83 100644 --- a/include/configs/tegra-common.h +++ b/include/configs/tegra-common.h @@ -19,6 +19,9 @@ #include /* get chip and board defs */ +#define CONFIG_DM +#define CONFIG_CMD_DM + #define CONFIG_SYS_TIMER_RATE 100 #define CONFIG_SYS_TIMER_COUNTER NV_PA_TMRUS_BASE -- 2.0.0.526.g5318336 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 09/15] dm: Cast away the const-ness of the global_data pointer
In a very few cases we need to adjust the driver model root device, such as when setting it up at initialisation. Add a macro to make this easier. Signed-off-by: Simon Glass --- Changes in v6: - Make DM_ROOT and DM_UCLASS_ROOT simple defines (and rename them) Changes in v5: None Changes in v4: None Changes in v3: - Fix typo in commit subject Changes in v2: - Add new patch to deal with const-ness of the global_data pointer drivers/core/root.c | 6 +++--- drivers/core/uclass.c| 2 +- include/dm/device-internal.h | 4 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/core/root.c b/drivers/core/root.c index f31be72..1cbb096 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -43,9 +43,9 @@ int dm_init(void) dm_warn("Virtual root driver already exists!\n"); return -EINVAL; } - INIT_LIST_HEAD(&gd->uclass_root); + INIT_LIST_HEAD(&DM_UCLASS_ROOT_NON_CONST); - ret = device_bind_by_name(NULL, &root_info, &gd->dm_root); + ret = device_bind_by_name(NULL, &root_info, &DM_ROOT_NON_CONST); if (ret) return ret; @@ -56,7 +56,7 @@ int dm_scan_platdata(void) { int ret; - ret = lists_bind_drivers(gd->dm_root); + ret = lists_bind_drivers(DM_ROOT_NON_CONST); if (ret == -ENOENT) { dm_warn("Some drivers were not found\n"); ret = 0; diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index f6867e4..34723ec 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -75,7 +75,7 @@ static int uclass_add(enum uclass_id id, struct uclass **ucp) uc->uc_drv = uc_drv; INIT_LIST_HEAD(&uc->sibling_node); INIT_LIST_HEAD(&uc->dev_head); - list_add(&uc->sibling_node, &gd->uclass_root); + list_add(&uc->sibling_node, &DM_UCLASS_ROOT_NON_CONST); if (uc_drv->init) { ret = uc_drv->init(uc); diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h index ea3df36..26e5cf5 100644 --- a/include/dm/device-internal.h +++ b/include/dm/device-internal.h @@ -84,4 +84,8 @@ int device_remove(struct udevice *dev); */ int device_unbind(struct udevice *dev); +/* Cast away any volatile pointer */ +#define DM_ROOT_NON_CONST (((gd_t *)gd)->dm_root) +#define DM_UCLASS_ROOT_NON_CONST (((gd_t *)gd)->uclass_root) + #endif -- 2.0.0.526.g5318336 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 11/15] dm: Fix printf() strings in the 'dm' command
The values here are int, but the map_to_sysmem() call can return a long. Add a cast to deal with this. Signed-off-by: Simon Glass --- Changes in v6: - Use ulong instead of uint for printing addresses Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: - Add new patch to fix printf() strings in the 'dm' command test/dm/cmd_dm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/dm/cmd_dm.c b/test/dm/cmd_dm.c index 180661b..aa8122c 100644 --- a/test/dm/cmd_dm.c +++ b/test/dm/cmd_dm.c @@ -23,7 +23,7 @@ static int display_succ(struct udevice *in, char *buf) char local[16]; struct udevice *pos, *n, *prev = NULL; - printf("%s- %s @ %08x", buf, in->name, map_to_sysmem(in)); + printf("%s- %s @ %08lx", buf, in->name, (ulong)map_to_sysmem(in)); if (in->flags & DM_FLAG_ACTIVATED) puts(" - activated"); puts("\n"); @@ -62,7 +62,7 @@ static int do_dm_dump_all(cmd_tbl_t *cmdtp, int flag, int argc, struct udevice *root; root = dm_root(); - printf("ROOT %08x\n", map_to_sysmem(root)); + printf("ROOT %08lx\n", (ulong)map_to_sysmem(root)); return dm_dump(root); } @@ -84,8 +84,8 @@ static int do_dm_dump_uclass(cmd_tbl_t *cmdtp, int flag, int argc, for (ret = uclass_first_device(id, &dev); dev; ret = uclass_next_device(&dev)) { - printf(" %s @ %08x:\n", dev->name, - map_to_sysmem(dev)); + printf(" %s @ %08lx:\n", dev->name, + (ulong)map_to_sysmem(dev)); } puts("\n"); } -- 2.0.0.526.g5318336 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 14/15] dm: Tidy up four minor code nits
There is a spelling mistake and two functions are missing comments altogether. Also the flags declaration is correct, but doesn't follow style. Finally, the uclass_get_device() function has some errors in its documentation. Fix these problems. Signed-off-by: Simon Glass Acked-by: Marek Vasut --- Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None include/dm/device.h | 2 +- include/dm/lists.h | 20 include/dm/root.h | 2 +- include/dm/uclass.h | 10 ++ 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/include/dm/device.h b/include/dm/device.h index 19f2039..ae75a3f 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -21,7 +21,7 @@ struct driver_info; #define DM_FLAG_ACTIVATED (1 << 0) /* DM is responsible for allocating and freeing platdata */ -#define DM_FLAG_ALLOC_PDATA(2 << 0) +#define DM_FLAG_ALLOC_PDATA(1 << 1) /** * struct udevice - An instance of a driver diff --git a/include/dm/lists.h b/include/dm/lists.h index 7feba4b..49d87e6 100644 --- a/include/dm/lists.h +++ b/include/dm/lists.h @@ -32,8 +32,28 @@ struct driver *lists_driver_lookup_name(const char *name); */ struct uclass_driver *lists_uclass_lookup(enum uclass_id id); +/** + * lists_bind_drivers() - search for and bind all drivers to parent + * + * This searches the U_BOOT_DEVICE() structures and creates new devices for + * each one. The devices will have @parent as their parent. + * + * @parent: parent driver (root) + * @early_only: If true, bind only drivers with the DM_INIT_F flag. If false + * bind all drivers. + */ int lists_bind_drivers(struct udevice *parent); +/** + * lists_bind_fdt() - bind a device tree node + * + * This creates a new device bound to the given device tree node, with + * @parent as its parent. + * + * @parent: parent driver (root) + * @blob: device tree blob + * @offset: offset of this device tree node + */ int lists_bind_fdt(struct udevice *parent, const void *blob, int offset); #endif diff --git a/include/dm/root.h b/include/dm/root.h index 3018bc8..a4826a6 100644 --- a/include/dm/root.h +++ b/include/dm/root.h @@ -41,7 +41,7 @@ int dm_scan_platdata(void); int dm_scan_fdt(const void *blob); /** - * dm_init() - Initialize Driver Model structures + * dm_init() - Initialise Driver Model structures * * This function will initialize roots of driver tree and class tree. * This needs to be called before anything uses the DM diff --git a/include/dm/uclass.h b/include/dm/uclass.h index 931d9c0..afd9923 100644 --- a/include/dm/uclass.h +++ b/include/dm/uclass.h @@ -26,7 +26,7 @@ * @priv: Private data for this uclass * @uc_drv: The driver for the uclass itself, not to be confused with a * 'struct driver' - * dev_head: List of devices in this uclass (devices are attached to their + * @dev_head: List of devices in this uclass (devices are attached to their * uclass when their bind method is called) * @sibling_node: Next uclass in the linked list of uclasses */ @@ -96,12 +96,14 @@ int uclass_get(enum uclass_id key, struct uclass **ucp); /** * uclass_get_device() - Get a uclass device based on an ID and index * + * The device is probed to activate it ready for use. + * * id: ID to look up * @index: Device number within that uclass (0=first) - * @ucp: Returns pointer to uclass (there is only one per for each ID) + * @devp: Returns pointer to device (there is only one per for each ID) * @return 0 if OK, -ve on error */ -int uclass_get_device(enum uclass_id id, int index, struct udevice **ucp); +int uclass_get_device(enum uclass_id id, int index, struct udevice **devp); /** * uclass_first_device() - Get the first device in a uclass @@ -129,7 +131,7 @@ int uclass_next_device(struct udevice **devp); * * @pos: struct udevice * to hold the current device. Set to NULL when there * are no more devices. - * uc: uclass to scan + * @uc: uclass to scan */ #define uclass_foreach_dev(pos, uc)\ for (pos = list_entry((&(uc)->dev_head)->next, typeof(*pos),\ -- 2.0.0.526.g5318336 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 04/15] Makefile: Support include files for .dts files
Linux supports this, and if we are to have compatible device tree files, U-Boot should also. Avoid giving the device tree files access to U-Boot's include/ directory. Only include/dt-bindings is accessible. Signed-off-by: Simon Glass Acked-by: Stephen Warren Reviewed-by: Masahiro Yamada --- Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: - Create a symlink for each arch to dt-bindings Changes in v2: - Add new patch to support include files for .dts files arch/arm/dts/include/dt-bindings| 1 + arch/microblaze/dts/include/dt-bindings | 1 + arch/sandbox/dts/include/dt-bindings| 1 + arch/x86/dts/include/dt-bindings| 1 + scripts/Makefile.lib| 1 + 5 files changed, 5 insertions(+) create mode 12 arch/arm/dts/include/dt-bindings create mode 12 arch/microblaze/dts/include/dt-bindings create mode 12 arch/sandbox/dts/include/dt-bindings create mode 12 arch/x86/dts/include/dt-bindings diff --git a/arch/arm/dts/include/dt-bindings b/arch/arm/dts/include/dt-bindings new file mode 12 index 000..0cecb3d --- /dev/null +++ b/arch/arm/dts/include/dt-bindings @@ -0,0 +1 @@ +../../../../include/dt-bindings \ No newline at end of file diff --git a/arch/microblaze/dts/include/dt-bindings b/arch/microblaze/dts/include/dt-bindings new file mode 12 index 000..0cecb3d --- /dev/null +++ b/arch/microblaze/dts/include/dt-bindings @@ -0,0 +1 @@ +../../../../include/dt-bindings \ No newline at end of file diff --git a/arch/sandbox/dts/include/dt-bindings b/arch/sandbox/dts/include/dt-bindings new file mode 12 index 000..0cecb3d --- /dev/null +++ b/arch/sandbox/dts/include/dt-bindings @@ -0,0 +1 @@ +../../../../include/dt-bindings \ No newline at end of file diff --git a/arch/x86/dts/include/dt-bindings b/arch/x86/dts/include/dt-bindings new file mode 12 index 000..0cecb3d --- /dev/null +++ b/arch/x86/dts/include/dt-bindings @@ -0,0 +1 @@ +../../../../include/dt-bindings \ No newline at end of file diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index c24c5e8..968123c 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -153,6 +153,7 @@ ld_flags = $(LDFLAGS) $(ldflags-y) # Modified for U-Boot dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc\ -I$(srctree)/arch/$(ARCH)/dts \ +-I$(srctree)/arch/$(ARCH)/dts/include \ -undef -D__DTS__ # Finds the multi-part object the current object will be linked into -- 2.0.0.526.g5318336 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 12/15] tegra: dts: Bring in GPIO bindings from linux
These files are taken from Linux 3.14. Signed-off-by: Simon Glass Acked-by: Stephen Warren --- Changes in v6: None Changes in v5: None Changes in v4: - Remove 64-bit addresses which are not used in U-Boot Changes in v3: - Bring in GPIO bindings for tegra{30,114,124} also Changes in v2: - Add new patch to bring in Tegra device tree files from linux arch/arm/dts/tegra114.dtsi | 21 + arch/arm/dts/tegra124.dtsi | 19 arch/arm/dts/tegra20.dtsi | 15 ++- arch/arm/dts/tegra30.dtsi | 21 + include/dt-bindings/gpio/gpio.h| 15 +++ include/dt-bindings/gpio/tegra-gpio.h | 51 ++ include/dt-bindings/interrupt-controller/arm-gic.h | 22 ++ include/dt-bindings/interrupt-controller/irq.h | 19 8 files changed, 155 insertions(+), 28 deletions(-) create mode 100644 include/dt-bindings/gpio/gpio.h create mode 100644 include/dt-bindings/gpio/tegra-gpio.h create mode 100644 include/dt-bindings/interrupt-controller/arm-gic.h create mode 100644 include/dt-bindings/interrupt-controller/irq.h diff --git a/arch/arm/dts/tegra114.dtsi b/arch/arm/dts/tegra114.dtsi index f52fcf1..59434e0 100644 --- a/arch/arm/dts/tegra114.dtsi +++ b/arch/arm/dts/tegra114.dtsi @@ -1,3 +1,6 @@ +#include +#include + #include "skeleton.dtsi" / { @@ -46,17 +49,17 @@ 0 143 0x04>; }; - gpio: gpio { + gpio: gpio@6000d000 { compatible = "nvidia,tegra114-gpio", "nvidia,tegra30-gpio"; reg = <0x6000d000 0x1000>; - interrupts = <0 32 0x04 - 0 33 0x04 - 0 34 0x04 - 0 35 0x04 - 0 55 0x04 - 0 87 0x04 - 0 89 0x04 - 0 125 0x04>; + interrupts = , +, +, +, +, +, +, +; #gpio-cells = <2>; gpio-controller; #interrupt-cells = <2>; diff --git a/arch/arm/dts/tegra124.dtsi b/arch/arm/dts/tegra124.dtsi index 18a8b24..4561c5f 100644 --- a/arch/arm/dts/tegra124.dtsi +++ b/arch/arm/dts/tegra124.dtsi @@ -1,3 +1,6 @@ +#include +#include + #include "skeleton.dtsi" / { @@ -49,14 +52,14 @@ gpio: gpio@6000d000 { compatible = "nvidia,tegra124-gpio", "nvidia,tegra30-gpio"; reg = <0x6000d000 0x1000>; - interrupts = <0 32 0x04 - 0 33 0x04 - 0 34 0x04 - 0 35 0x04 - 0 55 0x04 - 0 87 0x04 - 0 89 0x04 - 0 125 0x04>; + interrupts = , +, +, +, +, +, +, +; #gpio-cells = <2>; gpio-controller; #interrupt-cells = <2>; diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi index 3805750..a524f6e 100644 --- a/arch/arm/dts/tegra20.dtsi +++ b/arch/arm/dts/tegra20.dtsi @@ -1,3 +1,6 @@ +#include +#include + #include "skeleton.dtsi" / { @@ -139,10 +142,18 @@ gpio: gpio@6000d000 { compatible = "nvidia,tegra20-gpio"; - reg = < 0x6000d000 0x1000 >; - interrupts = < 64 65 66 67 87 119 121 >; + reg = <0x6000d000 0x1000>; + interrupts = , +, +, +, +, +, +; #gpio-cells = <2>; gpio-controller; + #interrupt-cells = <2>; + interrupt-controller; }; pinmux: pinmux@7000 { diff --git a/arch/arm/dts/tegra30.dtsi b/arch/arm/dts/tegra30.dtsi index fee1c36..7be3791 100644 --- a/arch/arm/dts/tegra30.dtsi +++ b/arch/arm/dts/tegra30.dtsi @@ -1,3 +1,6 @@ +#include +#include + #include "skeleton.dtsi" / { @@ -47,17 +50,17 @@ clocks = <&tegra_car 34>; }; - gpio: gpio { + gpio: gpio@6000d000 { compatible = "nvidia,tegra30-gpio"; reg = <0x6000d000 0x1000>; - interrupts = <0 32 0x04 - 0 33 0x04 - 0 34 0x04 - 0 35 0x04 - 0 55 0
[U-Boot] [PATCH v6 10/15] dm: Allow driver model tests only for sandbox
The GPIO tests require the sandbox GPIO driver, so cannot be run on other platforms. Similarly for the 'dm test' command. Signed-off-by: Simon Glass --- Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: - Add new patch to allow driver model tests only for sandbox test/dm/Makefile | 2 ++ test/dm/cmd_dm.c | 11 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test/dm/Makefile b/test/dm/Makefile index 4e9afe6..c0f2135 100644 --- a/test/dm/Makefile +++ b/test/dm/Makefile @@ -15,4 +15,6 @@ obj-$(CONFIG_DM_TEST) += ut.o # subsystem you must add sandbox tests here. obj-$(CONFIG_DM_TEST) += core.o obj-$(CONFIG_DM_TEST) += ut.o +ifneq ($(CONFIG_SANDBOX),) obj-$(CONFIG_DM_GPIO) += gpio.o +endif diff --git a/test/dm/cmd_dm.c b/test/dm/cmd_dm.c index 083f15c..180661b 100644 --- a/test/dm/cmd_dm.c +++ b/test/dm/cmd_dm.c @@ -93,16 +93,23 @@ static int do_dm_dump_uclass(cmd_tbl_t *cmdtp, int flag, int argc, return 0; } +#ifdef CONFIG_DM_TEST static int do_dm_test(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { return dm_test_main(); } +#define TEST_HELP "\ndm test Run tests" +#else +#define TEST_HELP +#endif static cmd_tbl_t test_commands[] = { U_BOOT_CMD_MKENT(tree, 0, 1, do_dm_dump_all, "", ""), U_BOOT_CMD_MKENT(uclass, 1, 1, do_dm_dump_uclass, "", ""), +#ifdef CONFIG_DM_TEST U_BOOT_CMD_MKENT(test, 1, 1, do_dm_test, "", ""), +#endif }; static int do_dm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) @@ -128,6 +135,6 @@ U_BOOT_CMD( dm, 2, 1, do_dm, "Driver model low level access", "tree Dump driver model tree\n" - "dm uclassDump list of instances for each uclass\n" - "dm test Run tests" + "dm uclassDump list of instances for each uclass" + TEST_HELP ); -- 2.0.0.526.g5318336 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 15/15] dm: Expand and improve the device lifecycle docs
The lifecycle of a device is an important part of driver model. Add to the existing documentation and clarify it. Reported-by: Jon Loeliger Signed-off-by: Simon Glass --- Thanks for Jon Loeliger for helping with the text and suggesting improvements. (Jon please comment/adjust to help clarify things further) Changes in v6: - Fix a typo and improve the explanation of platform data alloc/free Changes in v5: - Fix a few more typos Changes in v4: - Minor spelling fixes Changes in v3: None Changes in v2: - Rename struct device to struct udevice - Adjust docs as per Jon's review doc/driver-model/README.txt | 220 ++-- 1 file changed, 213 insertions(+), 7 deletions(-) diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt index 0b295ac..22c3fcb 100644 --- a/doc/driver-model/README.txt +++ b/doc/driver-model/README.txt @@ -222,7 +222,44 @@ device tree) and probe. Platform Data - -Where does the platform data come from? See demo-pdata.c which +Platform data is like Linux platform data, if you are familiar with that. +It provides the board-specific information to start up a device. + +Why is this information not just stored in the device driver itself? The +idea is that the device driver is generic, and can in principle operate on +any board that has that type of device. For example, with modern +highly-complex SoCs it is common for the IP to come from an IP vendor, and +therefore (for example) the MMC controller may be the same on chips from +different vendors. It makes no sense to write independent drivers for the +MMC controller on each vendor's SoC, when they are all almost the same. +Similarly, we may have 6 UARTs in an SoC, all of which are mostly the same, +but lie at different addresses in the address space. + +Using the UART example, we have a single driver and it is instantiated 6 +times by supplying 6 lots of platform data. Each lot of platform data +gives the driver name and a pointer to a structure containing information +about this instance - e.g. the address of the register space. It may be that +one of the UARTS supports RS-485 operation - this can be added as a flag in +the platform data, which is set for this one port and clear for the rest. + +Think of your driver as a generic piece of code which knows how to talk to +a device, but needs to know where it is, any variant/option information and +so on. Platform data provides this link between the generic piece of code +and the specific way it is bound on a particular board. + +Examples of platform data include: + + - The base address of the IP block's register space + - Configuration options, like: + - the SPI polarity and maximum speed for a SPI controller + - the I2C speed to use for an I2C device + - the number of GPIOs available in a GPIO device + +Where does the platform data come from? It is either held in a structure +which is compiled into U-Boot, or it can be parsed from the Device Tree +(see 'Device Tree' below). + +For an example of how it can be compiled in, see demo-pdata.c which sets up a table of driver names and their associated platform data. The data can be interpreted by the drivers however they like - it is basically a communication scheme between the board-specific code and @@ -259,21 +296,30 @@ following device tree fragment: sides = <4>; }; +This means that instead of having lots of U_BOOT_DEVICE() declarations in +the board file, we put these in the device tree. This approach allows a lot +more generality, since the same board file can support many types of boards +(e,g. with the same SoC) just by using different device trees. An added +benefit is that the Linux device tree can be used, thus further simplifying +the task of board-bring up either for U-Boot or Linux devs (whoever gets to +the board first!). The easiest way to make this work it to add a few members to the driver: .platdata_auto_alloc_size = sizeof(struct dm_test_pdata), .ofdata_to_platdata = testfdt_ofdata_to_platdata, - .probe = testfdt_drv_probe, The 'auto_alloc' feature allowed space for the platdata to be allocated -and zeroed before the driver's ofdata_to_platdata method is called. This -method reads the information out of the device tree and puts it in -dev->platdata. Then the probe method is called to set up the device. +and zeroed before the driver's ofdata_to_platdata() method is called. The +ofdata_to_platdata() method, which the driver write supplies, should parse +the device tree node for this device and place it in dev->platdata. Thus +when the probe method is called later (to set up the device ready for use) +the platform data will be present. Note that both methods are optional. If you provide an ofdata_to_platdata -method then it will be called first (after bind). If you provide a probe -method it will be called next. +method then it will be called first (during activation)
[U-Boot] [PATCH v6 01/15] Add an I/O tracing feature
When debugging drivers it is useful to see what I/O accesses were done and in what order. Even if the individual accesses are of little interest it can be useful to verify that the access pattern is consistent each time an operation is performed. In this case a checksum can be used to characterise the operation of a driver. The checksum can be compared across different runs of the operation to verify that the driver is working properly. In particular, when performing major refactoring of the driver, where the access pattern should not change, the checksum provides assurance that the refactoring work has not broken the driver. Add an I/O tracing feature and associated commands to provide this facility. It works by sneaking into the io.h heder for an architecture and redirecting I/O accesses through its tracing mechanism. For now no commands are provided to examine the trace buffer. The format is fairly simple, so 'md' is a reasonable substitute. Note: The checksum feature is only useful for I/O regions where the contents do not change outside of software control. Where this is not suitable you can fall back to manually comparing the addresses. It might be useful to enhance tracing to only checksum the accesses and not the data read/written. Signed-off-by: Simon Glass --- Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: - Remove use of bool in header file to avoid exynos5 build failure Changes in v2: - Add a new patch for an I/O tracing feature README | 23 +++ common/Makefile | 2 + common/cmd_iotrace.c | 73 ++ common/iotrace.c | 169 +++ include/iotrace.h| 104 +++ 5 files changed, 371 insertions(+) create mode 100644 common/cmd_iotrace.c create mode 100644 common/iotrace.c create mode 100644 include/iotrace.h diff --git a/README b/README index 7129df8..d072370 100644 --- a/README +++ b/README @@ -1000,6 +1000,7 @@ The following options need to be configured: CONFIG_CMD_IMLS List all images found in NOR flash CONFIG_CMD_IMLS_NAND* List all images found in NAND flash CONFIG_CMD_IMMAP* IMMR dump support + CONFIG_CMD_IOTRACE * I/O tracing for debugging CONFIG_CMD_IMPORTENV* import an environment CONFIG_CMD_INI * import data from an ini file into the env CONFIG_CMD_IRQ * irqinfo @@ -1171,6 +1172,28 @@ The following options need to be configured: Note that if the GPIO device uses I2C, then the I2C interface must also be configured. See I2C Support, below. +- I/O tracing: + When CONFIG_IO_TRACE is selected, U-Boot intercepts all I/O + accesses and can checksum them or write a list of them out + to memory. See the 'iotrace' command for details. This is + useful for testing device drivers since it can confirm that + the driver behaves the same way before and after a code + change. Currently this is supported on sandbox and arm. To + add support for your architecture, add '#include ' + to the bottom of arch//include/asm/io.h and test. + + Example output from the 'iotrace stats' command is below. + Note that if the trace buffer is exhausted, the checksum will + still continue to operate. + + iotrace is enabled + Start: 1000(buffer start address) + Size: 0001(buffer size) + Offset: 0120(current buffer offset) + Output: 1120(start + offset) + Count: 0018(number of trace records) + CRC32: 9526fb66(CRC32 of all trace records) + - Timestamp Support: When CONFIG_TIMESTAMP is selected, the timestamp diff --git a/common/Makefile b/common/Makefile index 391a8d6..7e192c7 100644 --- a/common/Makefile +++ b/common/Makefile @@ -114,6 +114,7 @@ obj-$(CONFIG_CMD_FUSE) += cmd_fuse.o obj-$(CONFIG_CMD_GETTIME) += cmd_gettime.o obj-$(CONFIG_CMD_GPIO) += cmd_gpio.o obj-$(CONFIG_CMD_I2C) += cmd_i2c.o +obj-$(CONFIG_CMD_IOTRACE) += cmd_iotrace.o obj-$(CONFIG_CMD_HASH) += cmd_hash.o obj-$(CONFIG_CMD_IDE) += cmd_ide.o obj-$(CONFIG_CMD_IMMAP) += cmd_immap.o @@ -261,6 +262,7 @@ obj-$(CONFIG_ANDROID_BOOT_IMAGE) += image-android.o obj-$(CONFIG_OF_LIBFDT) += image-fdt.o obj-$(CONFIG_FIT) += image-fit.o obj-$(CONFIG_FIT_SIGNATURE) += image-sig.o +obj-$(CONFIG_IO_TRACE) += iotrace.o obj-y += memsize.o obj-y += stdio.o diff --git a/common/cmd_iotrace.c b/common/cmd_iotrace.c new file mode 100644 index 000..f54276d --- /dev/null +++ b/common/cmd_iotrace.c @@ -0,0 +1,73 @@ +/* + *
[U-Boot] [PATCH v6 02/15] arm: Support iotrace feature
Support the iotrace feature for ARM, when enabled. Signed-off-by: Simon Glass --- Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: - Add a new patch to enable iotrace for arm arch/arm/include/asm/io.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 6a1f05a..9f35fd6 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -437,4 +437,7 @@ out: #endif /* __mem_isa */ #endif /* __KERNEL__ */ + +#include + #endif /* __ASM_ARM_IO_H */ -- 2.0.0.526.g5318336 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 08/15] dm: Add missing header files in lists and root
These files don't compile in some architectures. Fix it by adding the missing headers. Signed-off-by: Simon Glass --- Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: - Add new patch to add missing header files in lists and root drivers/core/lists.c | 1 + drivers/core/root.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/core/lists.c b/drivers/core/lists.c index 9f2917f..afb59d1 100644 --- a/drivers/core/lists.c +++ b/drivers/core/lists.c @@ -14,6 +14,7 @@ #include #include #include +#include #include struct driver *lists_driver_lookup_name(const char *name) diff --git a/drivers/core/root.c b/drivers/core/root.c index 4977875..f31be72 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include -- 2.0.0.526.g5318336 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 07/15] dm: Use case-insensitive comparison for GPIO banks
We want 'N0' and 'n0' to mean the same thing, so ensure that case is not considered when naming GPIO banks. Signed-off-by: Simon Glass --- Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: - Add new patch to use case-insensitive comparison for GPIO banks drivers/gpio/gpio-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c index fa2c2fb..f1bbc58 100644 --- a/drivers/gpio/gpio-uclass.c +++ b/drivers/gpio/gpio-uclass.c @@ -58,7 +58,7 @@ int gpio_lookup_name(const char *name, struct udevice **devp, uc_priv = dev->uclass_priv; len = uc_priv->bank_name ? strlen(uc_priv->bank_name) : 0; - if (!strncmp(name, uc_priv->bank_name, len)) { + if (!strncasecmp(name, uc_priv->bank_name, len)) { if (strict_strtoul(name + len, 10, &offset)) continue; if (devp) -- 2.0.0.526.g5318336 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 05/15] dm: Rename struct device_id to udevice_id
It is best to avoid having any occurence of 'struct device' in driver model, so rename to achieve this. Signed-off-by: Simon Glass --- Changes in v6: None Changes in v5: None Changes in v4: - Add new patch to rename struct device_id to udevice_id Changes in v3: None Changes in v2: None doc/driver-model/README.txt | 2 +- drivers/core/lists.c| 2 +- drivers/demo/demo-shape.c | 2 +- drivers/demo/demo-simple.c | 2 +- drivers/gpio/sandbox.c | 2 +- include/dm/device.h | 6 +++--- test/dm/test-fdt.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt index a5035be..0b295ac 100644 --- a/doc/driver-model/README.txt +++ b/doc/driver-model/README.txt @@ -315,7 +315,7 @@ is little or no 'driver model' code to write. - Moved some data from code into data structure - e.g. store a pointer to the driver operations structure in the driver, rather than passing it to the driver bind function. -- Rename some structures to make them more similar to Linux (struct device +- Rename some structures to make them more similar to Linux (struct udevice instead of struct instance, struct platdata, etc.) - Change the name 'core' to 'uclass', meaning U-Boot class. It seems that this concept relates to a class of drivers (or a subsystem). We shouldn't diff --git a/drivers/core/lists.c b/drivers/core/lists.c index 205b140..9f2917f 100644 --- a/drivers/core/lists.c +++ b/drivers/core/lists.c @@ -94,7 +94,7 @@ int lists_bind_drivers(struct udevice *parent) * tree error */ static int driver_check_compatible(const void *blob, int offset, - const struct device_id *of_match) + const struct udevice_id *of_match) { int ret; diff --git a/drivers/demo/demo-shape.c b/drivers/demo/demo-shape.c index a68cc10..3fa9c59 100644 --- a/drivers/demo/demo-shape.c +++ b/drivers/demo/demo-shape.c @@ -111,7 +111,7 @@ static int shape_ofdata_to_platdata(struct udevice *dev) return 0; } -static const struct device_id demo_shape_id[] = { +static const struct udevice_id demo_shape_id[] = { { "demo-shape", 0 }, { }, }; diff --git a/drivers/demo/demo-simple.c b/drivers/demo/demo-simple.c index 11def86..2bcb7df 100644 --- a/drivers/demo/demo-simple.c +++ b/drivers/demo/demo-simple.c @@ -32,7 +32,7 @@ static int demo_shape_ofdata_to_platdata(struct udevice *dev) return demo_parse_dt(dev); } -static const struct device_id demo_shape_id[] = { +static const struct udevice_id demo_shape_id[] = { { "demo-simple", 0 }, { }, }; diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c index 09cebe2..75ada5d 100644 --- a/drivers/gpio/sandbox.c +++ b/drivers/gpio/sandbox.c @@ -239,7 +239,7 @@ static int gpio_sandbox_probe(struct udevice *dev) return 0; } -static const struct device_id sandbox_gpio_ids[] = { +static const struct udevice_id sandbox_gpio_ids[] = { { .compatible = "sandbox,gpio" }, { } }; diff --git a/include/dm/device.h b/include/dm/device.h index ec04982..19f2039 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -75,11 +75,11 @@ struct udevice { #define device_active(dev) ((dev)->flags & DM_FLAG_ACTIVATED) /** - * struct device_id - Lists the compatible strings supported by a driver + * struct udevice_id - Lists the compatible strings supported by a driver * @compatible: Compatible string * @data: Data for this compatible string */ -struct device_id { +struct udevice_id { const char *compatible; ulong data; }; @@ -121,7 +121,7 @@ struct device_id { struct driver { char *name; enum uclass_id id; - const struct device_id *of_match; + const struct udevice_id *of_match; int (*bind)(struct udevice *dev); int (*probe)(struct udevice *dev); int (*remove)(struct udevice *dev); diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c index 6eccf11..98e3936 100644 --- a/test/dm/test-fdt.c +++ b/test/dm/test-fdt.c @@ -53,7 +53,7 @@ static int testfdt_drv_probe(struct udevice *dev) return 0; } -static const struct device_id testfdt_ids[] = { +static const struct udevice_id testfdt_ids[] = { { .compatible = "denx,u-boot-fdt-test", .data = DM_TEST_TYPE_FIRST }, -- 2.0.0.526.g5318336 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 06/15] dm: Update README to encourage conversion to driver model
Add a note to encourage people to convert drivers to use driver model. Signed-off-by: Simon Glass --- Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: - Update README to encourage conversion to driver model README | 5 + 1 file changed, 5 insertions(+) diff --git a/README b/README index d072370..fe5cacb 100644 --- a/README +++ b/README @@ -5331,6 +5331,11 @@ Information structure as we define in include/asm-/u-boot.h, and make sure that your definition of IMAP_ADDR uses the same value as your U-Boot configuration in CONFIG_SYS_IMMR. +Note that U-Boot now has a driver model, a unified model for drivers. +If you are adding a new driver, plumb it into driver model. If there +is no uclass available, you are encouraged to create one. See +doc/driver-model. + Configuring the Linux kernel: - -- 2.0.0.526.g5318336 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 03/15] sandbox: Support iotrace feature
Support the iotrace feature for sandbox, and enable it, using some dummy I/O access methods. Signed-off-by: Simon Glass --- Changes in v6: None Changes in v5: None Changes in v4: - Correct typo in CONFIG_CMD_IOTRACE Changes in v3: None Changes in v2: - Add a new patch to enable iotrace for sandbox arch/sandbox/include/asm/io.h | 10 ++ include/configs/sandbox.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/arch/sandbox/include/asm/io.h b/arch/sandbox/include/asm/io.h index 7956041..895fcb8 100644 --- a/arch/sandbox/include/asm/io.h +++ b/arch/sandbox/include/asm/io.h @@ -40,4 +40,14 @@ static inline void unmap_sysmem(const void *vaddr) /* Map from a pointer to our RAM buffer */ phys_addr_t map_to_sysmem(const void *ptr); +/* Define nops for sandbox I/O access */ +#define readb(addr) 0 +#define readw(addr) 0 +#define readl(addr) 0 +#define writeb(v, addr) +#define writew(v, addr) +#define writel(v, addr) + +#include + #endif diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index 6bb2546..fdc8b75 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -16,6 +16,9 @@ #endif +#define CONFIG_IO_TRACE +#define CONFIG_CMD_IOTRACE + #define CONFIG_SYS_TIMER_RATE 100 #define CONFIG_BOOTSTAGE -- 2.0.0.526.g5318336 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 0/15] Collected driver model bug-fixes and docs
This series collects some of the patches from the Tegra GPIO conversion to driver model. That work is still in progress, but the bug fixes and iotracing feature should go into this release I think. Also the documentation improvements may as well follow since the existings docs are proven inadequate. Changes in v6: - Make DM_ROOT and DM_UCLASS_ROOT simple defines (and rename them) - Use ulong instead of uint for printing addresses - Fix a typo and improve the explanation of platform data alloc/free Changes in v5: - Fix a few more typos Changes in v4: - Correct typo in CONFIG_CMD_IOTRACE - Add new patch to rename struct device_id to udevice_id - Remove 64-bit addresses which are not used in U-Boot - Minor spelling fixes Changes in v3: - Remove use of bool in header file to avoid exynos5 build failure - Create a symlink for each arch to dt-bindings - Fix typo in commit subject - Bring in GPIO bindings for tegra{30,114,124} also - Enable dm command in this patch instead of the next Changes in v2: - Add a new patch for an I/O tracing feature - Add a new patch to enable iotrace for arm - Add a new patch to enable iotrace for sandbox - Add new patch to support include files for .dts files - Update README to encourage conversion to driver model - Add new patch to use case-insensitive comparison for GPIO banks - Add new patch to add missing header files in lists and root - Add new patch to deal with const-ness of the global_data pointer - Add new patch to allow driver model tests only for sandbox - Add new patch to fix printf() strings in the 'dm' command - Add new patch to bring in Tegra device tree files from linux - Split out a separate patch to enable driver model for tegra - Rename struct device to struct udevice - Adjust docs as per Jon's review Simon Glass (15): Add an I/O tracing feature arm: Support iotrace feature sandbox: Support iotrace feature Makefile: Support include files for .dts files dm: Rename struct device_id to udevice_id dm: Update README to encourage conversion to driver model dm: Use case-insensitive comparison for GPIO banks dm: Add missing header files in lists and root dm: Cast away the const-ness of the global_data pointer dm: Allow driver model tests only for sandbox dm: Fix printf() strings in the 'dm' command tegra: dts: Bring in GPIO bindings from linux tegra: Enable driver model dm: Tidy up four minor code nits dm: Expand and improve the device lifecycle docs README | 28 +++ arch/arm/dts/include/dt-bindings | 1 + arch/arm/dts/tegra114.dtsi | 21 +- arch/arm/dts/tegra124.dtsi | 19 +- arch/arm/dts/tegra20.dtsi | 15 +- arch/arm/dts/tegra30.dtsi | 21 +- arch/arm/include/asm/io.h | 3 + arch/microblaze/dts/include/dt-bindings| 1 + arch/sandbox/dts/include/dt-bindings | 1 + arch/sandbox/include/asm/io.h | 10 + arch/x86/dts/include/dt-bindings | 1 + common/Makefile| 2 + common/cmd_iotrace.c | 73 +++ common/iotrace.c | 169 doc/driver-model/README.txt| 222 - drivers/core/lists.c | 3 +- drivers/core/root.c| 7 +- drivers/core/uclass.c | 2 +- drivers/demo/demo-shape.c | 2 +- drivers/demo/demo-simple.c | 2 +- drivers/gpio/gpio-uclass.c | 2 +- drivers/gpio/sandbox.c | 2 +- include/configs/sandbox.h | 3 + include/configs/tegra-common.h | 3 + include/dm/device-internal.h | 4 + include/dm/device.h| 8 +- include/dm/lists.h | 20 ++ include/dm/root.h | 2 +- include/dm/uclass.h| 10 +- include/dt-bindings/gpio/gpio.h| 15 ++ include/dt-bindings/gpio/tegra-gpio.h | 51 + include/dt-bindings/interrupt-controller/arm-gic.h | 22 ++ include/dt-bindings/interrupt-controller/irq.h | 19 ++ include/iotrace.h | 104 ++ scripts/Makefile.lib | 1 + test/dm/Makefile | 2 + test/dm/cmd_dm.c | 19 +- test/dm/test-fdt.c | 2 +- 38 files changed, 831 insertions(+), 61 deletions(-) create mode 12 arch/arm/dts/include/dt-bindings create mode 12 arch/microblaze/dts/include/dt-bindings create mode
[U-Boot] [PATCH] patman: Only apply patches when we know the original HEAD
When patman applies the patches it checks out a new branch, uses 'git am' to apply the patches one by one, and then tries to go back to the old branch. If you try this when the branch is 'undefined', this doesn't work as patman cannot restore the correct branch after applying the patches. It seems that 'undefined' is created by git and is persistent after it is created, so that you can end up on quite an old branch. Add a check for the 'undefined' branch to avoid this. Reported-by: Masahiro Yamada Signed-off-by: Simon Glass --- tools/patman/gitutil.py | 4 1 file changed, 4 insertions(+) diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index 3ea256d..7b75c83 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -232,6 +232,10 @@ def ApplyPatches(verbose, args, start_point): print stdout return False old_head = stdout.splitlines()[0] +if old_head == 'undefined': +str = "Invalid HEAD '%s'" % stdout.strip() +print col.Color(col.RED, str) +return False # Checkout the required start point cmd = ['git', 'checkout', 'HEAD~%d' % start_point] -- 2.0.0.526.g5318336 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] driver/nand: Add support of 16K SRAM for IFC 2.0
Internal SRAM has been incresed from 8KB to 16KB for IFC cotroller ver 2.0. Update the page offset calculation logic to support the same. Signed-off-by: Prabhakar Kushwaha --- drivers/mtd/nand/fsl_ifc_nand.c | 25 + 1 file changed, 25 insertions(+) diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c index af32cfc..4e84995 100644 --- a/drivers/mtd/nand/fsl_ifc_nand.c +++ b/drivers/mtd/nand/fsl_ifc_nand.c @@ -24,6 +24,7 @@ #endif #define FSL_IFC_V1_1_0 0x0101 +#define FSL_IFC_V2_0_0 0x0200 #define MAX_BANKS CONFIG_SYS_FSL_IFC_BANK_COUNT #define ERR_BYTE 0xFF /* Value returned for read bytes when read failed */ @@ -1033,6 +1034,30 @@ static int fsl_ifc_chip_init(int devnum, u8 *addr) if (ver >= FSL_IFC_V1_1_0) fsl_ifc_sram_init(ver); + if (ver >= FSL_IFC_V2_0_0) { + switch (csor & CSOR_NAND_PGS_MASK) { + case CSOR_NAND_PGS_512: + priv->bufnum_mask = 31; + break; + + case CSOR_NAND_PGS_2K: + priv->bufnum_mask = 7; + break; + + case CSOR_NAND_PGS_4K: + priv->bufnum_mask = 3; + break; + + case CSOR_NAND_PGS_8K: + priv->bufnum_mask = 1; + break; + + default: + printf("ifc nand: bad csor %#x: bad page size\n", csor); + return -ENODEV; + } + } + ret = nand_scan_ident(mtd, 1, NULL); if (ret) return ret; -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [Patman Bug Report] Patman breaks git-log during git-rebase
Hi Masahiro, On 4 June 2014 04:32, Masahiro Yamada wrote: > Hi Simon, > > On Mon, 2 Jun 2014 20:28:48 -0600 > Simon Glass wrote: > >> Hi Masahiro, >> >> On 2 June 2014 01:44, Masahiro Yamada wrote: >> > Hi Simon, >> > >> > I found an odd behavior of Patman. >> > >> > If I run Patman during "git rebase -i", >> > Patman rewrites git-log, stripping all the Patman-tags. >> > (I lost some important tags such as "Series-changes".) >> > >> > I think git-log should be read-only during Patman operation. >> > I can't understand why Patman needs to directly edit git-log. >> > Is this a fixable problem? >> >> Probably you shouldn't do that. For me patman normally complains that >> it can't find patches to process, and stops. >> >> Can you give me the repeat steps? I think I have seen this before but >> I'm not sure how to make it. >> >> Also, patman never edits commits. I wonder if patman is moving you to >> the wrong commit somehow. Try 'git reflog' to find something to get >> back to. > > > Please try this procedure: Thanks for the steps. > > [1] Let's start our topic branch > > git checkout -b test master > > > [2] Add some commits on the topic branch > > echo a >> README > git add README > git commit > > Input the commit message like this: > ->8- > Test commit 1 > > This is log. Blah Blah. > > Series-to: u-boot@lists.denx.de > Series-version: 2 > Series-changes: 2 >- Blah Blah > -8<- > > echo b >> README > git add README > git commit -m "Test commit 2" > > > [3] Now we have two commits on the branch. Git-log is like this > > git log > commit cedf7627e215135b594cd40b87b8f4a9b80375a6 > Author: Masahiro Yamada > Date: Wed Jun 4 17:15:55 2014 +0900 > > Test commit 2 > > commit 74a2b72c0d4201fc478e530b886c3ab3791a703e > Author: Masahiro Yamada > Date: Wed Jun 4 17:04:57 2014 +0900 > > Test commit 1 > > This is log. Blah Blah. > > Series-to: u-boot@lists.denx.de > Series-version: 2 > Series-changes: 2 > - Blah Blah > > [4] Run "git rebase -i" > > git rebase -i master > > > [5] Edit the first one > > e 74a2b72 test commit 1 > pick cedf762 Test commit 2 > > > [6] Run "git commit --amend" and edit the git-log > > git commit --amend > > Test commit 1 > > This is log. Blah Blah. > Some additional log. <- Add > > Series-to: u-boot@lists.denx.de > Series-version: 2 > Series-changes: 2 > - Blah Blah > > > [7] Run patman > > tools/patman/patman -t -c 1 > > > [8] Cansel the patman and check the git-log > and you will find Patman tags are gone!! By cancel I guess you mean to press 'q' when it asks to send the first email? In that case I end up on an 'undefined' branch. It doesn't have any commits. I then need to do 'git rebase --abort' to get things back to normal, but in that case yes I have lost my changes. > > > git log > > commit 7bfec19aebaaefba9f7062e909fa38c071191b71 > Author: Masahiro Yamada > Date: Wed Jun 4 17:04:57 2014 +0900 > > Test commit 1 > > This is log. Blah Blah. > Some additional log. > > Signed-off-by: Masahiro Yamada > If you give the -a flag it will avoid trying to apply the patches, and the problem does not happen. The problem is that when patman applies the patches it checks out a new branch, uses 'git am' to apply the patches one by one, and then tries to go back to the old branch. Since the branch is called 'undefined' these doesn't really work. It seems that 'undefined' is created by git and is persistent after it is created. It's a bit odd but I may be missing something. Anyway I think I can put in a check for the 'undefined' branch and avoid this. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] Add ctrlc_ignore environment variable to ignore Ctrl-C
Dear Simon, In message you wrote: > > > Hm... ignoring it would mean there is no way to interrupt long running > > commands. I'm not sure if this is actually an improvement. > > Eventually we should try to define the wanted behaviour first. > > My initial feelingis that ^C should terminate a running command nd > > return us to the shell, but not terminate U-Boot. Outside of sandbox, > > the only regular way to terminate U-Boot is the "reboot" command. > > Maybe we should do the same in sandbox? > > It is very convenient to terminate U-Boot with Ctrl-C - it makes it > work like a 'normal' program, and you can still terminate a > long-running command - it just quits U-Boot just like any other > command-line utility. When quickly running tests it is helpful. Also > it is less confusing I think for people who don't know how to exit. But that's the point: U-Boot with it's CLI is NOT "a 'normal' program". It's an interactive tool like a shell or an editor. When you run a shell (say, bash) as CLI then you also expect that ^C will only terminate the currently running command, and not exit the shell. > You can use '-t raw' to get the behaviour you want. Is that good enough? This should be the default, I think. > U-Boot sandbox does not yet support 'reboot', but 'reset' does quit U-Boot. Ah, yes. Typo. I meant "reset", of course. > >> I'm not sure if you recall the serial driver buffer patch I sent for > > > > I'm afraid I don't. > > Actually I think I was thinking of Scott Wood's patch: > > http://patchwork.ozlabs.org/patch/90066/ Ah, this one. Well, frankly, I don't lioke that for a number of reasons: - We have a ton of different UART drivers.Any such implementation should be general enough to be usable on more than one type, ideally completely hardware independent. - This buffering of data in this patch is intended to solve a specific problem that could be avoided by more clever test scripts. Instead of just dumping an endless stream of characters to the serial console independent of what U-Boot is doing, one should always wit for the next CLI prompt before sending the next command. Tools like "expect" can do this easily. - We have to decide what we want. Either we define the serial input system of U-Boot as intentionally simple, allowing it to work with minimal resources (like very, very early after reset, long before relocation to RAM, i. e. without much space on the stack, without writable data segment, without .bss). Or we want a feature-rich, powerful input system with maximum data throuhput, buffering, type ahead, line disciplines, etc. The current implementation is clearly following the former design ideas, and I think this is OK so. The second method is indeed more powerful, but quickly caklls for additional complexity to implement properly - say, interrupt support for the UART drivers, which means we enter a whole new leel of complexity. The current implementation is clearly following the former design ideas, and I think this is OK so. The second method is indeed more powerful, but quickly caklls for additional complexity to implement properly - say, interrupt support for the UART drivers, which means we enter a whole new leel of complexity. > Yes I wanted to avoid that also. I guess we are left with signal > handling as the solution. But for now I might just disable Ctrl-C for > sandbox unless the 'raw' terminal is used. That will allow the tests > to work correctly at least. As mentioned, I think the default behaviour should be different. 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 "The pathology is to want control, not that you ever get it, because of course you never do."- Gregory Bateson ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Driver Model and DTS Parsing
Hi Stephen, On 3 June 2014 12:33, Stephen Warren wrote: > On 06/03/2014 10:04 AM, Simon Glass wrote: >> +Stephen > > I don't think there's anything actionable for me in this email, although > I guess I'll chime in on a couple of points: > > I agree that the current way U-Boot parses DT is completely inadequate. > The only way to parse it is to take a top-down recursive approach, with > each node's driver initiating the parsing of any relevant child nodes. > In other words, exactly how Linux (and likely *BSD, Solaris, ...) do it. See the other thread - that has been my intention all along and is why I avoided adding this to driver model. I've ended up with a helper function only in the implementation I'm fiddling with at present. > > I really don't understand the hang up with GPIOs. Here are the possible > HW situations as I see them: > > 1) > > A single GPIO controller HW module, represented as a single DT node. > > This should be: One node in DT. One DM device. One bind call (assuming > that's the equivalent of Linux's probe()). > > 2) > > A set of completely separate HW modules, each handling N GPIOs. > > This should be: N nodes in DT. N DM devices. N bind calls. > 3) > > A single HW module that's represented in DT as a top-level node for the > HW module and arbitrarily has N child nodes for some arbitrary bank > concept within the HW module: > > This should be: 1 (top-level) node in DT, N child nodes in DT, 1 or N DM > devices, 1 bind call (for just the top-level node). The bind call can > choose whether it creates 1 single DM device object for the top-level > node, or 1 for each of the child node that it manually parses without > additional bind calls. That's an implementation detail in the driver. > > Note that Tegra should fall into case (1) above. I'm not familiar enough > with Exynos HW (which was mentioned in the email I'm replying to but > didn't bother quoting) to have an opinion re: which approach is most > suitable for it. Thanks for this summary which is useful. device_bind() is how child devices are created, so I don't think we want to avoid using that. What's the point? How else are we going to allocate a device? I've basically settled on option 3 for now, with the device defined as a 'GPIO bank'. We then put the banks together (each can be named) to support all GPIOs on the SoC. Exynos happens to have pinctrl definitions for each bank, so we can iterate through these calling device_bind() for each bank. But note that only the top-level pinctrl has a compatible string, so we cannot call device_probe() on the banks - they have no compatible string so don't exist as far as driver model is concerned. Anyway they aren't top-level nodes. Tegra doesn't have much in the device tree for GPIOs - it seems to be all hard-coded in the software. So I ended up with the code you saw which just iterates over a known number of banks, creating a device for each. I don't want to create a separate data structure for 'gpio chip' like Linux for reasons I think I mentioned (briefly it adds a level of indirection, creates an unnecessary structure, hides that structure from 'dm tree' and the like, and sets a precedent of lots of little private data structures that are opaque to the poor user looking at what is in the system). Or at least I'd like to delay that until it is strictly necessary. Let's keep it all visible to driver model, and also save having code we really don't need. I hope that clarifies things. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 07/14] fdt: Add DEV_TREE_BIN option to specify a device tree binary file
Hi Tom, On 11 June 2014 18:18, Tom Rini wrote: [snip] > ... as a follow up (I want to get this in already). Thanks! I'll send a new patch to update this when I finish testing the rebase you asked for. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Refactoring of U-Boot directory structure
Dear Masahiro, In message <20140612131050.963a.aa925...@jp.panasonic.com> you wrote: > > [1] Do not split the similar SoC family to various directories > > at91 SoC directory exists under arm920t, arm926ejs, armv7 directory. To me this actually makes sense, as they are using different CPU cores (ARMv4t vs. ARMv5te vs. ARMv7). > ./arch/arm/cpu/arm920t/at91 > ./arch/arm/cpu/arm926ejs/at91 > ./arch/arm/cpu/armv7/at91 > > It looks reasonable to collect at91 sources into a single place, > arch/arm/mach-at91 Did you look at the code? Files like lowlevel_init.S, reset.c or timer.c look pretty much specific to the respective architecture. What would be the benefit of mixing all this different stuff in a single directory? > That's why Tegra directories are sprinkled under arch/arm/: > > arch/arm/cpu/arm720t/tegra-common/ > arch/arm/cpu/arm720t/tegra20/ > arch/arm/cpu/arm720t/tegra30/ > arch/arm/cpu/arm720t/tegra114/ > arch/arm/cpu/arm720t/tegra124/ > arch/arm/cpu/armv7/tegra-common/ > arch/arm/cpu/armv7/tegra20/ > arch/arm/cpu/armv7/tegra30/ > arch/arm/cpu/armv7/tegra114/ > arch/arm/cpu/armv7/tegra124/ > arch/arm/include/asm/arch-tegra/ > arch/asm/include/asm/arch-tegra20/ > arch/asm/include/asm/arch-tegra30/ > arch/asm/include/asm/arch-tegra114/ > arch/asm/include/asm/arch-tegra124/ > > > They can be refactored > > arch/arm/mach-tegra/ : tegra common part > arch/arm/mach-tegra/tegra20/ : tegra20-specific > arch/arm/mach-tegra/tegra30/ : tegra30-specific > arch/arm/mach-tegra/tegra114/ : tegra114-specific > arch/arm/mach-tegra/tegra124/ : tegra124-specific Again, we have different CPU cores here, and thus pretty much different code - what would be the benefit of mixing unrelated code in a single directory? 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 Boykottiert Microsoft - Kauft Eure Fenster bei OBI! ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] x86: Enable 32-bit build using x86_64 multilib toolchain
On 10 June 2014 09:14, Vasili Galka wrote: > Until now building the x86 arch boards required 32-bit toolchain. As > many x86_64 toolchains come with 32-bit support (multilib) that's a > good idea to enable build with such toolchains. > > The change required was to specify the usage of 32-bit explicitly to > the compiler and the linker (-m32 and -m elf_i386 flags) and locate > the right libgcc path. > > Signed-off-by: Vasili Galka > --- > > For example on x86_64 Ubuntu "sudo apt-get install gcc-multilib" is enough > and no need to install additional 32-bit toolchain. This seems reasonable to me. Acked-by: Simon Glass ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] Add ctrlc_ignore environment variable to ignore Ctrl-C
Hi Wolfgang, On 10 June 2014 01:08, Wolfgang Denk wrote: > Dear Simon, > > In message > you > wrote: >> >> > 1) Looking at sandbox only, we should provide an implementation of >> >ctrlc() that does not consume characters from stdin - I thinkwe >> >should rather be able to react on signals? >> >> Currently there is no signal handling, but we set up the terminal so >> that Cltr-C terminates U-Boot (default) or does not (and it appears as >> a character in the input). It's probably a bit more complicated but it >> should be doable. We can probably just ignore Cltl-C on sandbox for >> now. > > Hm... ignoring it would mean there is no way to interrupt long running > commands. I'm not sure if this is actually an improvement. > Eventually we should try to define the wanted behaviour first. > My initial feelingis that ^C should terminate a running command nd > return us to the shell, but not terminate U-Boot. Outside of sandbox, > the only regular way to terminate U-Boot is the "reboot" command. > Maybe we should do the same in sandbox? It is very convenient to terminate U-Boot with Ctrl-C - it makes it work like a 'normal' program, and you can still terminate a long-running command - it just quits U-Boot just like any other command-line utility. When quickly running tests it is helpful. Also it is less confusing I think for people who don't know how to exit. You can use '-t raw' to get the behaviour you want. Is that good enough? U-Boot sandbox does not yet support 'reboot', but 'reset' does quit U-Boot. > >> > 2) With a general point of view, consuming characters for no good is >> >always wrong and needs to be fixed. >> >> I'm not sure if you recall the serial driver buffer patch I sent for > > I'm afraid I don't. Actually I think I was thinking of Scott Wood's patch: http://patchwork.ozlabs.org/patch/90066/ > >> ns16550 which corrected this problem and also dealt with serial input >> overflow while outputting to the LCD. We might consider resurrecting >> this and doing it at a higher level. Without buffering I don't see any >> way to fix this. > > The 16550 is on the high end side in terms of capabilities. I don;t > thinkwe should "buffer" more than a single character - otherwise it > would be just a tiny step to implementing thingslike line disciplines > and stuff, and I don;t think we need nor want this. Yes I wanted to avoid that also. I guess we are left with signal handling as the solution. But for now I might just disable Ctrl-C for sandbox unless the 'raw' terminal is used. That will allow the tests to work correctly at least. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] arm:board:h2200: Add CONFIG_SYS_GENERIC_BOARD
Signed-off-by: Lukasz Dalek --- include/configs/h2200.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/configs/h2200.h b/include/configs/h2200.h index d026484..5d0b85e 100644 --- a/include/configs/h2200.h +++ b/include/configs/h2200.h @@ -12,6 +12,7 @@ #define MACH_TYPE_H2200341 #define CONFIG_MACH_TYPE MACH_TYPE_H2200 +#define CONFIG_SYS_GENERIC_BOARD #define CONFIG_CPU_PXA25X 1 #define CONFIG_BOARD_H2200 -- 1.8.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] sandbox: change local_irq_save() to macro
On 11 June 2014 23:26, Masahiro Yamada wrote: > local_irq_save() should be a macro, not a function > because local_irq_save() saves flag to the given argument. > > GCC is silent about this issue, but Clang warns: > > In file included from lib/asm-offsets.c:15: > In file included from include/common.h:20: > In file included from include/linux/bitops.h:110: > arch/sandbox/include/asm/bitops.h:59:17: > warning: variable 'flags' is uninitialized when used here > [-Wuninitialized] > local_irq_save(flags); >^ > > That change causes another warning: > > In file included from include/linux/bitops.h:110:0, > from include/common.h:20, > from lib/asm-offsets.c:15: > arch/sandbox/include/asm/bitops.h: In function ātest_and_set_bitā: > arch/sandbox/include/asm/bitops.h:56:16: warning: unused variable āflagsā > [-Wunused-variable] > > So, flags should be set to __always_unused. > > Signed-off-by: Masahiro Yamada > Cc: Simon Glass > Cc: Jeroen Hofstee Acked-by: Simon Glass ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2] sandbox: restore ability to access host fs through standard commands
Hi Stephen, On 11 June 2014 12:20, Stephen Warren wrote: > From: Stephen Warren > > Commit 95fac6ab4589 "sandbox: Use os functions to read host device tree" > removed the ability for get_device_and_partition() to handle the "host" > device type, and redirect accesses to it to the host filesystem. This > broke some unit tests that use this feature. So, revert that change. The > code added back by this patch is slightly different to pacify checkpatch. > > However, we're then left with "host" being both: > - A pseudo device that accesses the hosts real filesystem. > - An emulated block device, which accesses "sectors" inside a file stored > on the host. > > In order to resolve this discrepancy, rename the pseudo device from host > to hostfs, and adjust the unit-tests for this change. > > The "help sb" output is modified to reflect this rename, and state where > the host and hostfs devices should be used. > > Signed-off-by: Stephen Warren One more thing to be complete - can you please update line 17 of test/vboot/vboot_test.sh to use this? You can then test it with something like: make O=sandbox sandbox_config all O=sandbox ./test/vboot/vboot_test.sh Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2] sandbox: terminate os_dirent_ls() result list
On 11 June 2014 12:26, Stephen Warren wrote: > From: Stephen Warren > > Each node in the linked-list that os_dirent_ls() returns has its next > pointer set only when the next node is created. For the last node in the > list, there is no next node, so this never happens, and the next pointer > is never initialized. Explicitly initialize the next pointer so that it > isn't dangling. Without this, "sb ls" might crash. > > Signed-off-by: Stephen Warren Acked-by: Simon Glass ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Refactoring of U-Boot directory structure
Hi. In U-Boot, the directory structure under arch/ is like this arch/${ARCH}/cpu/${CPU}/${SOC} Exception: - ${CPU} is missing for some architectures such as blackfin, sandbox, etc. - There are many boards without ${SOC} My question is, ${SOC} should always depend on ${CPU} ? I think it is reasonable to migrate to the structure like this: arch/${ARCH}/cpu/${CPU} /mach-${foo} /mach-${bar} I think arch/${ARCH}/cpu/${CPU}/${SOC} structure have given us a lot of pain. The problems I want to solve are: [1] Do not split the similar SoC family to various directories at91 SoC directory exists under arm920t, arm926ejs, armv7 directory. ./arch/arm/cpu/arm920t/at91 ./arch/arm/cpu/arm926ejs/at91 ./arch/arm/cpu/armv7/at91 It looks reasonable to collect at91 sources into a single place, arch/arm/mach-at91 [2] Collect C/ASM sources and headers into a single place Now SoC-specific sources are under ./arch/${ARCH}/cpu/${CPU}/${SOC}/ But headers are ./arch/${ARCH}/include/asm/arch-${SOC}/ In the new structure, ./arch/arm/mach-${SOC}/ : C/ASM files ./arch/arm/mach-${SOC}/include/ : Header files [3] Do not create a symbolic link to header dicrectory mkconfig creates a symbolic link to arch/asm/include/asm/arch-${SOC} I dislike creating a symbolic link by configuration and remove it by mrproper. Linux Kernel did that long time ago, but they did away with it. [4] Stop Tegra Tegra uses different CPU for SPL and Normal U-boot. That's why Tegra directories are sprinkled under arch/arm/: arch/arm/cpu/arm720t/tegra-common/ arch/arm/cpu/arm720t/tegra20/ arch/arm/cpu/arm720t/tegra30/ arch/arm/cpu/arm720t/tegra114/ arch/arm/cpu/arm720t/tegra124/ arch/arm/cpu/armv7/tegra-common/ arch/arm/cpu/armv7/tegra20/ arch/arm/cpu/armv7/tegra30/ arch/arm/cpu/armv7/tegra114/ arch/arm/cpu/armv7/tegra124/ arch/arm/include/asm/arch-tegra/ arch/asm/include/asm/arch-tegra20/ arch/asm/include/asm/arch-tegra30/ arch/asm/include/asm/arch-tegra114/ arch/asm/include/asm/arch-tegra124/ They can be refactored arch/arm/mach-tegra/ : tegra common part arch/arm/mach-tegra/tegra20/ : tegra20-specific arch/arm/mach-tegra/tegra30/ : tegra30-specific arch/arm/mach-tegra/tegra114/ : tegra114-specific arch/arm/mach-tegra/tegra124/ : tegra124-specific or maybe arch/arm/plat-tegra/ : tegra common part arch/arm/mach-tegra20/ : tegra20-specific arch/arm/mach-tegra30/ : tegra30-specific arch/arm/mach-tegra114/ : tegra114-specific arch/arm/mach-tegra124/ : tegra124-specific Your comments are welcome! Best Regards Masahiro Yamada ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/4] Reactivate the tracing feature
Hi Masahiro, On 11 June 2014 23:42, Simon Glass wrote: > Hi Masahiro, > > Yes I should remove this otherwise it will at best bloat the code for > SPL. I think it is probably best just to revert that part of the > Makefile. Although actually I'm not sure how to have different flags for everything except SPL and examples/ - any clues? Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] driver/nand:Define MAX_BANKS same as SoC defined for IFC
The number of chip select used by IFC controller vary from one SoC to other. For eg. P1010 has 4, T4240 has 8. Update MAX_BANKS same as SoC defined Signed-off-by: Prabhakar Kushwaha --- drivers/mtd/nand/fsl_ifc_nand.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c index be5a16a..27f5177 100644 --- a/drivers/mtd/nand/fsl_ifc_nand.c +++ b/drivers/mtd/nand/fsl_ifc_nand.c @@ -19,8 +19,12 @@ #include #include +#ifndef CONFIG_SYS_FSL_IFC_BANK_COUNT +#define CONFIG_SYS_FSL_IFC_BANK_COUNT 4 +#endif + #define FSL_IFC_V1_1_0 0x0101 -#define MAX_BANKS 4 +#define MAX_BANKS CONFIG_SYS_FSL_IFC_BANK_COUNT #define ERR_BYTE 0xFF /* Value returned for read bytes when read failed */ #define IFC_TIMEOUT_MSECS 10 /* Maximum number of mSecs to wait for IFC -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] driver/nand: Update SRAM initialize logic for IFC.
IFC controller v1.1.0 requires internal SRAM initialize by reading NAND flash. Higher controller versions have provided "SRAM init" bit in NCFGR register space. update SRAM initialize logic to reflect the same. Also print error message in case of Page read error. Signed-off-by: Prabhakar Kushwaha --- drivers/mtd/nand/fsl_ifc_nand.c | 26 +++--- include/fsl_ifc.h |2 ++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c index 27f5177..af32cfc 100644 --- a/drivers/mtd/nand/fsl_ifc_nand.c +++ b/drivers/mtd/nand/fsl_ifc_nand.c @@ -806,12 +806,29 @@ static void fsl_ifc_select_chip(struct mtd_info *mtd, int chip) { } -static void fsl_ifc_sram_init(void) +static void fsl_ifc_sram_init(uint32_t ver) { struct fsl_ifc *ifc = ifc_ctrl->regs; uint32_t cs = 0, csor = 0, csor_8k = 0, csor_ext = 0; + uint32_t ncfgr = 0; long long end_tick; + if (ver > FSL_IFC_V1_1_0) { + ncfgr = ifc_in32(&ifc->ifc_nand.ncfgr); + ifc_out32(&ifc->ifc_nand.ncfgr, ncfgr | IFC_NAND_SRAM_INIT_EN); + + /* wait for SRAM_INIT bit to be clear or timeout */ + end_tick = usec2ticks(IFC_TIMEOUT_MSECS * 1000) + get_ticks(); + while (end_tick > get_ticks()) { + ifc_ctrl->status = + ifc_in32(&ifc->ifc_nand.nand_evter_stat); + + if (!(ifc_ctrl->status & IFC_NAND_SRAM_INIT_EN)) + return; + } + printf("fsl-ifc: Failed to Initialise SRAM\n"); + } + cs = ifc_ctrl->cs_nand >> IFC_NAND_CSEL_SHIFT; /* Save CSOR and CSOR_ext */ @@ -856,6 +873,9 @@ static void fsl_ifc_sram_init(void) ifc_out32(&ifc->ifc_nand.nand_evter_stat, ifc_ctrl->status); + if (ifc_ctrl->status & ~IFC_NAND_EVTER_STAT_OPC) + printf("fsl-ifc: Failed to Initialise SRAM\n"); + /* Restore CSOR and CSOR_ext */ ifc_out32(&ifc_ctrl->regs->csor_cs[cs].csor, csor); ifc_out32(&ifc_ctrl->regs->csor_cs[cs].csor_ext, csor_ext); @@ -1010,8 +1030,8 @@ static int fsl_ifc_chip_init(int devnum, u8 *addr) } ver = ifc_in32(&ifc_ctrl->regs->ifc_rev); - if (ver == FSL_IFC_V1_1_0) - fsl_ifc_sram_init(); + if (ver >= FSL_IFC_V1_1_0) + fsl_ifc_sram_init(ver); ret = nand_scan_ident(mtd, 1, NULL); if (ret) diff --git a/include/fsl_ifc.h b/include/fsl_ifc.h index 630e4b4..b353b04 100644 --- a/include/fsl_ifc.h +++ b/include/fsl_ifc.h @@ -367,6 +367,8 @@ */ /* Auto Boot Mode */ #define IFC_NAND_NCFGR_BOOT0x8000 +/* SRAM INIT EN */ +#define IFC_NAND_SRAM_INIT_EN 0x2000 /* Addressing Mode-ROW0+n/COL0 */ #define IFC_NAND_NCFGR_ADDR_MODE_RC0 0x /* Addressing Mode-ROW0+n/COL0+n */ -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/4] Reactivate the tracing feature
Hi Masahiro, On 10 June 2014 00:47, Masahiro Yamada wrote: > Hi Simon, > > > On Thu, 5 Jun 2014 12:27:49 -0600 > Simon Glass wrote: > >> This was lost sometime in the Kbuild conversion. Add it back. > > Not lost. > It was moved to examples/Makefile. > > > Prior to Kbuild conversion, config.mk was like this: > > -->8-- > BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%)) > > ifeq ($(findstring examples/,$(BCURDIR)),) > ifeq ($(CONFIG_SPL_BUILD),) > ifdef FTRACE > CFLAGS += -finstrument-functions -DFTRACE > endif > endif > endif > 8<- > > > "-finstrument-functions -DFTRACE" was enabled > only under examples/ directory. > (Do you remember why?) > > That's why I moved it to examples/Makefile > to keep the equivalent behavior. I don't think it is the same. In my code I was trying to make sure there was NO tracing in example directory, and SPL. I think I should go the same way, so will update my patch. > > > > >> diff --git a/config.mk b/config.mk >> index 05864aa..0c45c09 100644 >> --- a/config.mk >> +++ b/config.mk >> @@ -46,6 +46,10 @@ ifdef BOARD >> sinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board >> specific rules >> endif >> >> +ifdef FTRACE >> +PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE >> +endif >> + >> # >> >> RELFLAGS := $(PLATFORM_RELFLAGS) > > > OK. > If you want to enable this flag over the whole source tree, > please remove it from examples/Makefile. OK > > > BTW, > In the description of commit 5c2aeac5ae, > you mentioned tracing feature is not supported by SPL. > > But you are enabling FTRACE also on SPL in this patch. > Are you sure there is no bad impact on SPL? Yes I should remove this otherwise it will at best bloat the code for SPL. I think it is probably best just to revert that part of the Makefile. Thanks for looking at this, saves me another patch... Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 11/15] dm: Fix printf() strings in the 'dm' command
Hi Andre, On 8 June 2014 18:46, Andre Renaud wrote: > On 7 June 2014 07:13, Simon Glass wrote: >> The values here are int, but the map_to_sysmem() call can return a long. >> Add a cast to deal with this. > ... >> - printf("%s- %s @ %08x", buf, in->name, map_to_sysmem(in)); >> + printf("%s- %s @ %08x", buf, in->name, (uint)map_to_sysmem(in)); > > If the argument is a long, shouldn't it be printed as long, rather > than possibly truncated to an int? > printf("%s- %s @ %08lx", buf, in->name, map_to_sysmem(in)); I found that this happened on ARM, where sizeof(int) == sizeof(long) and was conscious that all addresses in U-Boot are 32-bits at present - hmmm is that still true?. But yes that is more correct. I will change it. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 09/15] dm: Cast away the const-ness of the global_data pointer
Hi Marek, On 11 June 2014 23:26, Simon Glass wrote: > Hi Marek, > > > On 8 June 2014 01:00, Marek Vasut wrote: >> On Friday, June 06, 2014 at 09:13:26 PM, Simon Glass wrote: >>> In a very few cases we need to adjust the driver model root device, such as >>> when setting it up at initialisation. Add a macro to make this easier. >>> >>> Signed-off-by: Simon Glass >>> --- >> >> [...] >> >>> - ret = device_bind_by_name(NULL, &root_info, &gd->dm_root); >>> + ret = device_bind_by_name(NULL, &root_info, &DM_ROOT()); >> >> [...] >> >>> +/* Cast away any volatile pointer */ >>> +#define DM_ROOT()(((gd_t *)gd)->dm_root) >>> +#define DM_UCLASS_ROOT() (((gd_t *)gd)->uclass_root) >> >> Can you implement this "DM_ROOT()" macro as a function instead ? I believe >> that'd be much nicer , would have typechecking etc., usual stuff. > > I had a look at this. I don't see how I can do it, but you might have ideas. > > In this function call I need to pass a pointer without its const bit. > I made it const since nothing should change the dm root except driver > model itself. > >>> + ret = device_bind_by_name(NULL, &root_info, &DM_ROOT()); > > In the above line, I don't think I can make it a function. Similarly > one good think about the function is that I can grep for it easily. > > So I'm thinking of using something like this: > > /* Cast away any volatile pointer */ > #define DM_ROOT_NON_CONST (((gd_t *)gd)->dm_root) > #define DM_UCLASS_ROOT_NON_CONST (((gd_t *)gd)->uclass_root) > > It is no-longer a function, but I can easily find it. Plus it is > explicit as to what it is for, with the NON_CONST suffix. Also I forgot to mention that type-checking is pretty pointless since it is a hard-coded variable. If someone changed it lots of other code would break. Also this is an internal dm header file so cannot be accessed outside driver model core. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 09/15] dm: Cast away the const-ness of the global_data pointer
Hi Marek, On 8 June 2014 01:00, Marek Vasut wrote: > On Friday, June 06, 2014 at 09:13:26 PM, Simon Glass wrote: >> In a very few cases we need to adjust the driver model root device, such as >> when setting it up at initialisation. Add a macro to make this easier. >> >> Signed-off-by: Simon Glass >> --- > > [...] > >> - ret = device_bind_by_name(NULL, &root_info, &gd->dm_root); >> + ret = device_bind_by_name(NULL, &root_info, &DM_ROOT()); > > [...] > >> +/* Cast away any volatile pointer */ >> +#define DM_ROOT()(((gd_t *)gd)->dm_root) >> +#define DM_UCLASS_ROOT() (((gd_t *)gd)->uclass_root) > > Can you implement this "DM_ROOT()" macro as a function instead ? I believe > that'd be much nicer , would have typechecking etc., usual stuff. I had a look at this. I don't see how I can do it, but you might have ideas. In this function call I need to pass a pointer without its const bit. I made it const since nothing should change the dm root except driver model itself. >> + ret = device_bind_by_name(NULL, &root_info, &DM_ROOT()); In the above line, I don't think I can make it a function. Similarly one good think about the function is that I can grep for it easily. So I'm thinking of using something like this: /* Cast away any volatile pointer */ #define DM_ROOT_NON_CONST (((gd_t *)gd)->dm_root) #define DM_UCLASS_ROOT_NON_CONST (((gd_t *)gd)->uclass_root) It is no-longer a function, but I can easily find it. Plus it is explicit as to what it is for, with the NON_CONST suffix. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] sandbox: change local_irq_save() to macro
local_irq_save() should be a macro, not a function because local_irq_save() saves flag to the given argument. GCC is silent about this issue, but Clang warns: In file included from lib/asm-offsets.c:15: In file included from include/common.h:20: In file included from include/linux/bitops.h:110: arch/sandbox/include/asm/bitops.h:59:17: warning: variable 'flags' is uninitialized when used here [-Wuninitialized] local_irq_save(flags); ^ That change causes another warning: In file included from include/linux/bitops.h:110:0, from include/common.h:20, from lib/asm-offsets.c:15: arch/sandbox/include/asm/bitops.h: In function ātest_and_set_bitā: arch/sandbox/include/asm/bitops.h:56:16: warning: unused variable āflagsā [-Wunused-variable] So, flags should be set to __always_unused. Signed-off-by: Masahiro Yamada Cc: Simon Glass Cc: Jeroen Hofstee --- Changes in v2: - I forgot to "git add arch/sandbox/include/asm/bitops.h" in v1 Resending. arch/sandbox/include/asm/bitops.h | 5 +++-- arch/sandbox/include/asm/system.h | 5 + 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/sandbox/include/asm/bitops.h b/arch/sandbox/include/asm/bitops.h index 74219c5..e807c4e 100644 --- a/arch/sandbox/include/asm/bitops.h +++ b/arch/sandbox/include/asm/bitops.h @@ -17,6 +17,7 @@ #ifndef __ASM_SANDBOX_BITOPS_H #define __ASM_SANDBOX_BITOPS_H +#include #include #ifdef __KERNEL__ @@ -53,7 +54,7 @@ static inline int __test_and_set_bit(int nr, void *addr) static inline int test_and_set_bit(int nr, void *addr) { - unsigned long flags; + unsigned long __always_unused flags; int out; local_irq_save(flags); @@ -75,7 +76,7 @@ static inline int __test_and_clear_bit(int nr, void *addr) static inline int test_and_clear_bit(int nr, void *addr) { - unsigned long flags; + unsigned long __always_unused flags; int out; local_irq_save(flags); diff --git a/arch/sandbox/include/asm/system.h b/arch/sandbox/include/asm/system.h index 066acc5..02beed3 100644 --- a/arch/sandbox/include/asm/system.h +++ b/arch/sandbox/include/asm/system.h @@ -8,10 +8,7 @@ #define __ASM_SANDBOX_SYSTEM_H /* Define this as nops for sandbox architecture */ -static inline void local_irq_save(unsigned flags __attribute__((unused))) -{ -} - +#define local_irq_save(x) #define local_irq_enable() #define local_irq_disable() #define local_save_flags(x) -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] sandbox: change local_irq_save() to macro
local_irq_save() should be a macro, not a function because local_irq_save() saves flag to the given argument. GCC is silent about this issue, but Clang warns: In file included from lib/asm-offsets.c:15: In file included from include/common.h:20: In file included from include/linux/bitops.h:110: arch/sandbox/include/asm/bitops.h:59:17: warning: variable 'flags' is uninitialized when used here [-Wuninitialized] local_irq_save(flags); ^ That change causes another warning: In file included from include/linux/bitops.h:110:0, from include/common.h:20, from lib/asm-offsets.c:15: arch/sandbox/include/asm/bitops.h: In function ātest_and_set_bitā: arch/sandbox/include/asm/bitops.h:56:16: warning: unused variable āflagsā [-Wunused-variable] So, flags should be set to __always_unused. Signed-off-by: Masahiro Yamada Cc: Simon Glass Cc: Jeroen Hofstee --- arch/sandbox/include/asm/system.h | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/sandbox/include/asm/system.h b/arch/sandbox/include/asm/system.h index 066acc5..02beed3 100644 --- a/arch/sandbox/include/asm/system.h +++ b/arch/sandbox/include/asm/system.h @@ -8,10 +8,7 @@ #define __ASM_SANDBOX_SYSTEM_H /* Define this as nops for sandbox architecture */ -static inline void local_irq_save(unsigned flags __attribute__((unused))) -{ -} - +#define local_irq_save(x) #define local_irq_enable() #define local_irq_disable() #define local_save_flags(x) -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2] sandbox: restore ability to access host fs through standard commands
Hi, Stephen On 6/12/2014 12:20 AM, Stephen Warren wrote: From: Stephen Warren Commit 95fac6ab4589 "sandbox: Use os functions to read host device tree" removed the ability for get_device_and_partition() to handle the "host" device type, and redirect accesses to it to the host filesystem. This broke some unit tests that use this feature. So, revert that change. The code added back by this patch is slightly different to pacify checkpatch. However, we're then left with "host" being both: - A pseudo device that accesses the hosts real filesystem. - An emulated block device, which accesses "sectors" inside a file stored on the host. In order to resolve this discrepancy, rename the pseudo device from host to hostfs, and adjust the unit-tests for this change. The "help sb" output is modified to reflect this rename, and state where the host and hostfs devices should be used. Signed-off-by: Stephen Warren Tested-by: Josh Wu Best Regards, Josh Wu --- V2: * Fix typo due to fixing checkpatch and not recompiling:-( * Fix "help sb" output. --- common/cmd_sandbox.c | 10 ++ disk/part.c | 19 +++ test/command_ut.c| 8 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/common/cmd_sandbox.c b/common/cmd_sandbox.c index 00982b164dd3..3d9fce7e5548 100644 --- a/common/cmd_sandbox.c +++ b/common/cmd_sandbox.c @@ -114,11 +114,13 @@ static int do_sandbox(cmd_tbl_t *cmdtp, int flag, int argc, U_BOOT_CMD( sb, 8, 1, do_sandbox, "Miscellaneous sandbox commands", - "load host[ ] - " + "load hostfs - [ ] - " "load a file from host\n" - "sb ls host - list files on host\n" - "sb save host [] - " + "sb ls hostfs - - list files on host\n" + "sb save hostfs -[] - " "save a file to host\n" "sb bind [] - bind \"host\" device to file\n" - "sb info []- show device binding & info" + "sb info []- show device binding & info\n" + "sb commands use the \"hostfs\" device. The \"host\" device is used\n" + "with standard IO commands such as fatls or ext2load" ); diff --git a/disk/part.c b/disk/part.c index b3097e32f0eb..baceb19c60c7 100644 --- a/disk/part.c +++ b/disk/part.c @@ -510,6 +510,25 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str, int part; disk_partition_t tmpinfo; + /* +* Special-case a psuedo block device "hostfs", to allow access to the +* host's own filesystem. +*/ + if (0 == strcmp(ifname, "hostfs")) { + *dev_desc = NULL; + info->start = 0; + info->size = 0; + info->blksz = 0; + info->bootable = 0; + strcpy((char *)info->type, BOOT_PART_TYPE); + strcpy((char *)info->name, "Sandbox host"); +#ifdef CONFIG_PARTITION_UUIDS + info->uuid[0] = 0; +#endif + + return 0; + } + /* If no dev_part_str, use bootdevice environment variable */ if (!dev_part_str || !strlen(dev_part_str) || !strcmp(dev_part_str, "-")) diff --git a/test/command_ut.c b/test/command_ut.c index b2666bfc182b..ae6466d0ed83 100644 --- a/test/command_ut.c +++ b/test/command_ut.c @@ -165,12 +165,12 @@ static int do_ut_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #ifdef CONFIG_SANDBOX /* File existence */ - HUSH_TEST(e, "-e host - creating_this_file_breaks_uboot_unit_test", n); - run_command("sb save host - creating_this_file_breaks_uboot_unit_test 0 1", 0); - HUSH_TEST(e, "-e host - creating_this_file_breaks_uboot_unit_test", y); + HUSH_TEST(e, "-e hostfs - creating_this_file_breaks_uboot_unit_test", n); + run_command("sb save hostfs - creating_this_file_breaks_uboot_unit_test 0 1", 0); + HUSH_TEST(e, "-e hostfs - creating_this_file_breaks_uboot_unit_test", y); /* Perhaps this could be replaced by an "rm" shell command one day */ assert(!os_unlink("creating_this_file_breaks_uboot_unit_test")); - HUSH_TEST(e, "-e host - creating_this_file_breaks_uboot_unit_test", n); + HUSH_TEST(e, "-e hostfs - creating_this_file_breaks_uboot_unit_test", n); #endif #endif ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v5 15/15] dm: Expand and improve the device lifecycle docs
Hi Jon, On 11 June 2014 10:19, Jon Loeliger wrote: > On Tue, Jun 10, 2014 at 6:53 PM, Simon Glass wrote: >> The lifecycle of a device is an important part of driver model. Add to the >> existing documentation and clarify it. >> >> Reported-by: Jon Loeliger >> >> Signed-off-by: Simon Glass >> --- >> Thanks for Jon Loeliger for helping with the text and >> suggesting improvements. >> >> (Jon please comment/adjust to help clarify things further) > > > This is way betterer now. Thanks! > > > Nit typo: > >> + e. If the driver provides a ofdata_to_platdata() method, then this is > > s/a/an/ > > > >> + >> + Note: for a U_BOOT_DEVICE() declaration, the platform data is supplied as >> + a static pointer and is not allocated. For device tree, the platform >> + data is allocated during activation and freed during dectivation, >> + typically automatically using platdata_auto_alloc_size. But if that value >> + is 0 then U-Boot will not do the allocation/freeing and you will need to >> + do this yourself in your ofdata_to_platdata() and remove() methods. This >> + difference is tracked by the device's DM_FLAG_ALLOC_PDATA flag. > > The first sentence in that paragraph confused me because I knew where it was > supposed to be headed: namely, the deallocation of the platdata. So when it > used the "not allocated" phrase, I was taken aback. > > How about something like this instead?: > > Note: Because the platform data for a U_BOOT_DEVICE() is defined with a > static pointer, it is not de-allocated during the remove() method. For a > device > instantiated using the device tree data, the platform data will be dynamically > allocated, and thus needs to be deallocated during the remove() method. > If the platdata_auto_alloc_size is non-zero, the deallocation happens > automatically > within the DM core. However, when platdata_auto_alloc_size is 0, both the > allocation (in probe() or preferably ofdata_to_platdata()) and the > deallocation > in remove() are the responsibility of the driver author. Thanks, this reads well. > > If you'd like: > > Acked-by: Jon.Loeliger > > Thanks, > jdl Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] mx6: drop ARM errata 742230
Acked-by: Nitin Garg Regards, Nitin Garg -Original Message- From: Shawn Guo [mailto:shawn@freescale.com] Sent: Wednesday, June 11, 2014 3:53 AM To: u-boot@lists.denx.de Cc: Garg Nitin-B37173; Stefano Babic; Guo Shawn-R65073 Subject: [PATCH] mx6: drop ARM errata 742230 Commit e9fd66defd7e (ARM: mx6: define CONFIG_ARM_ERRATA_742230) enables errata 742230 for imx6, because it helps remove one reboot issue. However, this errata does not really apply on imx6, because Cortex-A9 on imx6 is r2p10 while the errata only applies to revisions r1p0..r2p2. At a later time, commit f71cbfe3ca5d (ARM: Add workaround for Cortex-A9 errata 794072) adds support of errata 794072, which applies to all Cortex-A9 revisions. As the workaround for both errata are exactly same, it makes a lot more sense to select 794072 instead of 742230 for imx6. Since we already enable 794072 for imx6, it's time to drop errata 742230 to avoid confusion. Signed-off-by: Shawn Guo --- include/configs/mx6_common.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h index 8a8920f6cc8a..e4a5cc5be1a6 100644 --- a/include/configs/mx6_common.h +++ b/include/configs/mx6_common.h @@ -17,7 +17,6 @@ #ifndef __MX6_COMMON_H #define __MX6_COMMON_H -#define CONFIG_ARM_ERRATA_742230 #define CONFIG_ARM_ERRATA_743622 #define CONFIG_ARM_ERRATA_751472 #define CONFIG_ARM_ERRATA_794072 -- 1.8.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] net: sh-eth: Add support R7S72100 of rmobile
On Wed, Jun 11, 2014 at 10:42 AM, Tom Rini wrote: > > On Mon, Jun 09, 2014 at 06:58:46AM +0900, Nobuhiro Iwamatsu wrote: > > Hi, Tom. > > > > 2014-06-06 22:37 GMT+09:00 Tom Rini : > > > On Fri, Jun 06, 2014 at 11:44:20AM +0900, Nobuhiro Iwamatsu wrote: > > > > > >> ping. > > >> > > >> 2014-01-23 7:52 GMT+09:00 Nobuhiro Iwamatsu < nobuhiro.iwamatsu...@renesas.com>: > > >> > The R7S72100 of ARM SoC that Renesas manufactured has one Ether port. > > >> > This has the same IP SH-Ether. This patch adds support of the R7S72100 > > >> > in SH-Ether. > > >> > > > >> > Signed-off-by: Nobuhiro Iwamatsu > > > > > > I'm fine with this series coming via the sh tree. > > > > > Thank you. I will work. > > BTW, Joe(net custodian) does not have time of maintain net tree? > > How do we patch for net from now ? > > I don't want to put words in his mouth, but, at least for driver rather > than core changes (and this applies to more than just net), there's a > good deal of relevant experience outside of the custodians likely > background anyhow. Agreed... for drivers running on boards that I don't have, I won't be able to comment beyond how the driver interacts with the net stack. I think it can be appropriate to go through the board tree. I'll be back to it fairly soon. Cheers, -Joe ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Pull request: u-boot-sh/rmobile into u-boot-arm/master
Hi, Thanks for your review. 2014-06-10 17:46 GMT+09:00 Albert ARIBAUD : > Hi Nobuhiro, > > On Tue, 10 Jun 2014 16:58:39 +0900, Nobuhiro Iwamatsu > wrote: > >> Dear Albert Aribaud, >> >> Please pull u-boot-sh/rmobile into u-boot-arm/master. >> >> The following changes since commit 0a26e1d6c394aacbf1153977b7348d1dff85db3f: >> >> arm: fix a double-definition error of _start symbol (2014-06-09 >> 10:36:40 +0200) >> >> are available in the git repository at: >> >> git://git.denx.de/u-boot-sh.git rmobile >> >> for you to fetch changes up to a59cdc44a9df0887fbb0d7dd5e6229ac0018785b: >> >> arm: rmobile: lager: Remove NOR-Flash support from boards.cfg >> (2014-06-10 16:49:31 +0900) >> >> >> Nobuhiro Iwamatsu (2): >> arm: rmobile: koelsch: Remove NOR-Flash support from boards.cfg >> arm: rmobile: lager: Remove NOR-Flash support from boards.cfg >> >> boards.cfg | 2 -- >> 1 file changed, 2 deletions(-) > > Isn't the lager commit message slightly wrong, mentioning koelsch > instead of lager at one point? Not that it matters much since we are > finishing removing support here. > Yes, you are right. I will update commit message and resend. > Amicalement, > -- > Albert. Best regards, Nobuhiro -- Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] net: sh-eth: Add support R7S72100 of rmobile
Hi, 2014-06-12 9:30 GMT+09:00 Joe Hershberger : > > On Wed, Jun 11, 2014 at 10:42 AM, Tom Rini wrote: >> >> On Mon, Jun 09, 2014 at 06:58:46AM +0900, Nobuhiro Iwamatsu wrote: >> > Hi, Tom. >> > >> > 2014-06-06 22:37 GMT+09:00 Tom Rini : >> > > On Fri, Jun 06, 2014 at 11:44:20AM +0900, Nobuhiro Iwamatsu wrote: >> > > >> > >> ping. >> > >> >> > >> 2014-01-23 7:52 GMT+09:00 Nobuhiro Iwamatsu >> > >> : >> > >> > The R7S72100 of ARM SoC that Renesas manufactured has one Ether >> > >> > port. >> > >> > This has the same IP SH-Ether. This patch adds support of the >> > >> > R7S72100 >> > >> > in SH-Ether. >> > >> > >> > >> > Signed-off-by: Nobuhiro Iwamatsu >> > > >> > > I'm fine with this series coming via the sh tree. >> > > >> > Thank you. I will work. >> > BTW, Joe(net custodian) does not have time of maintain net tree? >> > How do we patch for net from now ? >> >> I don't want to put words in his mouth, but, at least for driver rather >> than core changes (and this applies to more than just net), there's a >> good deal of relevant experience outside of the custodians likely >> background anyhow. > > Agreed... for drivers running on boards that I don't have, I won't be able > to comment beyond how the driver interacts with the net stack. I think it > can be appropriate to go through the board tree. I see. I was mistaken about the handling of the net tree. Sorry about this. > > I'll be back to it fairly soon. :) > > Cheers, > -Joe Best regards, Nobuhiro -- Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] unsigned int for gpio
Hi Jeroen, On 11 June 2014 15:37, Jeroen Hofstee wrote: > Hello Simon, > > in commit 95a260a9 > > > dm: Enable gpio command to support driver model > > Now that named GPIO banks are supported, along with a way of obtaining > the status of a GPIO (input or output), we can provide an enhanced > GPIO command for driver model. Where the driver provides its own > operation for obtaining the GPIO state, this is used, otherwise a > generic version is sufficient. > > you made the following change: > > - int gpio; > + unsigned int gpio; > > This breaks the code after it though: > > /* turn the gpio name into a gpio number */ > gpio = name_to_gpio(str_gpio); > if (gpio < 0) > goto show_usage; > > And causes warnings with clang like: > > common/cmd_gpio.c:159:11: warning: comparison of unsigned expression < 0 > is always false [-Wtautological-compare] > if (gpio < 0) > ^ ~ > > Do you recall why it is made unsigned? This is because gpio_lookup_name() needs an unsigned (-ve values have no meaning). I think that is what we want ultimately, but perhaps we need to go back to int in the meantime. The simplest fix would probably be to use a separate unsigned variable for the driver model code, and go back to an int for the current (old) code. The difference is that driver model returns a separate error code, whereas the old code combines the GPIO and error into a single value. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] usb: xhci: (likely) fix bracket in if condition
Because of the brackets the & and && is evaluated before the comparison. This is likely not the intention. Change it to test the first and second condition to both be true. cc: Marek Vasut Signed-off-by: Jeroen Hofstee --- fixes a warning: drivers/usb/host/xhci.c:647:32: warning: comparison of constant 2 with boolean expression is always false [-Wtautological-constant-out-of-range-compare] le16_to_cpu(req->index)) > CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS) { ^ ~~ NOT tested, wait for Marek to ack this! --- drivers/usb/host/xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index d1c2e5c..59dc096 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -643,8 +643,8 @@ static int xhci_submit_root(struct usb_device *udev, unsigned long pipe, struct xhci_ctrl *ctrl = udev->controller; struct xhci_hcor *hcor = ctrl->hcor; - if (((req->requesttype & USB_RT_PORT) && -le16_to_cpu(req->index)) > CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS) { + if ((req->requesttype & USB_RT_PORT) && + le16_to_cpu(req->index) > CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS) { printf("The request port(%d) is not configured\n", le16_to_cpu(req->index) - 1); return -EINVAL; -- 1.8.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 07/14] fdt: Add DEV_TREE_BIN option to specify a device tree binary file
Hi Masahiro, On 9 June 2014 23:59, Masahiro Yamada wrote: > Hi Simon, > > > On Mon, 2 Jun 2014 22:04:50 -0600 > Simon Glass wrote: > >> In some cases, an externally-built device tree binary is required to be >> attached to U-Boot. An example is when using image signing, since in that >> case the .dtb file must include the public keys. > > I do not want to expand this argument, but > I am not sure if DTB stands for "device tree binary". > > linux/Documentation often refer it as "device tree blob", > while linux/Documentation/devicetree/booting-without-of.txt > says "device tree block". > > >> Add a DEV_TREE_BIN option to the Makefile, and update the documentation. > > Is it possible to rename it without mentioning _BIN or _BLOB ? > > For example, DTB_PATH=... or EXT_DTB=... > or some other variable name you like. I think EXT_DTB is quite a nice name so I've made that change. > > >> diff --git a/Makefile b/Makefile >> index ece622f..92819bf 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -867,7 +867,7 @@ MKIMAGEFLAGS_u-boot.kwb = -n >> $(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \ >> MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \ >> -R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage >> >> -u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE >> +u-boot.img u-boot.kwb u-boot.pbl: u-boot$(if >> $(CONFIG_OF_SEPARATE),-dtb,).bin FORCE >> $(call if_changed,mkimage) > > The second comma in '(if $(CONFIG_OF_SEPARATE),-dtb,)' is redundant. > OK > > This is duplicating the same image as u-boot-dtb.img > > Your way is that "u-boot.img" includes DTB in some time and doesn't in the > other. > I am not sure which way is better. > But we don't need two rules to generate the equivalent image. > > If you go along with this change, I think it's OK with me. > Please consider removing below in that case: > > > ifeq ($(CONFIG_SPL_FRAMEWORK),y) > ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img > endif > > and > > u-boot-dtb.img: u-boot-dtb.bin FORCE > $(call if_changed,mkimage) I took a look this morning but I'm still not quite sure about this. I will spend some more time to understand it fully. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] common/xyzModem.c: move empty statements to newline
On Wed, Jun 11, 2014 at 01:04:42AM +0200, Jeroen Hofstee wrote: > To prevent a warning for clang the loop without a body > is made more clear by moving it to a line of its own. > This prevents a clang warning. > > cc: sba...@denx.de > Signed-off-by: Jeroen Hofstee Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] common/cli_hush.c: remove unnecessary double braces
On Wed, Jun 11, 2014 at 12:28:47AM +0200, Jeroen Hofstee wrote: > Clang interpretes an if condition like "if ((a = b) == NULL) > as it tries to assign a value in a statement. Hence if you do > "if ((something)) it warns you that you might be confused. > Hence drop the double braces for plane if statements. > > Simon Glass > Signed-off-by: Jeroen Hofstee Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] board:keymile: remove unnecessary double braces
On Wed, Jun 11, 2014 at 12:34:39AM +0200, Jeroen Hofstee wrote: > Clang interpretes an if condition like "if ((a = b) == NULL) > as it tries to assign a value in a statement. Hence if you do > "if ((something)) it warns you that you might be confused. > Hence drop the double braces for plane if statements. > > cc: Holger Brunck > Signed-off-by: Jeroen Hofstee Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] jffs2:jffs2_1pass.c: remove double braces
On Wed, Jun 11, 2014 at 12:40:25AM +0200, Jeroen Hofstee wrote: > Clang interpretes an if condition likeĀ "if ((a = b) == NULL) > as it tries to assign a value in a statement. Hence if you do > "if ((something)) it warns you that you might be confused. > Hence drop the double braces for plane if statements. > > Signed-off-by: Jeroen Hofstee Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] LzmaTools: don't self assign values
On Tue, Jun 10, 2014 at 11:37:23PM +0200, Jeroen Hofstee wrote: > It seems the code tries to trick the compiler the argument > is actually used. However compilers became too smart to > fool them so easily an now warn. Gcc and clang don't seem > to emit a warning when the argument is unused. If so it > should be decorated with unused / (void). > > Signed-off-by: Jeroen Hofstee Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] imximage_hynix.cfg: fix unterminated comment
On Tue, Jun 10, 2014 at 11:16:09PM +0200, Jeroen Hofstee wrote: > cc: Troy Kisky > Signed-off-by: Jeroen Hofstee Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] cosmetic: board: pm9263 rewrite old style stuct init
On Tue, Jun 10, 2014 at 11:12:04PM +0200, Jeroen Hofstee wrote: > this prevent some warnings when compiling with clang > > cc: Stelian Pop > Signed-off-by: Jeroen Hofstee Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] tps6586x.h: fix inclusion guard
On Tue, Jun 10, 2014 at 11:01:58PM +0200, Jeroen Hofstee wrote: > cc: Simon Glass > Signed-off-by: Jeroen Hofstee > Acked-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] kbuild: move spl/Makefile to scripts/Makefile.spl
On Mon, Jun 09, 2014 at 03:14:11PM +0900, Masahiro Yamada wrote: > All files under spl/ and tpl/ are generated during the build process > except spl/Makefile. > > We can simplify clean-rule and git-ignore by moving spl/Makefile > to somewhere else. > > Signed-off-by: Masahiro Yamada Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] cosmetic: atmel: replace old style struct init
On Tue, Jun 10, 2014 at 12:16:23AM +0200, Jeroen Hofstee wrote: > This prevents some warnings when building with clang. > cc:: andreas.de...@googlemail.com > Signed-off-by: Jeroen Hofstee Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Remove ${objtree}/include/asm/proc/ link
On Tue, Jun 10, 2014 at 04:16:14PM +0300, Vasili Galka wrote: > mkconfig links ${objtree}/include/asm/proc/ to > ${srctree}/arch/${arch}/include/asm/proc-armv/. This seems to be a > remnant from the past. Ever since its introduction in 2003 it is used > only in ARM build and always links to same place, so let's simplify > the code, remove it and reference directly where needed. > > Successful MAKEALL for ARM and PowerPC verified on Linux. > > Signed-off-by: Vasili Galka Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] cosmetic: Whitespace fix
On Tue, Jun 10, 2014 at 04:06:52PM +0300, Vasili Galka wrote: > Signed-off-by: Vasili Galka Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,3/3] ext4: correctly zero filename
On Mon, Jun 09, 2014 at 03:29:00PM +0200, Jeroen Hofstee wrote: > Since ALLOC_CACHE_ALIGN_BUFFER declares a char* for filename > sizeof(filename) is not the size of the buffer. Use the already > known length instead. > > cc: Uma Shankar > cc: Manjunatha C Achar > cc: Marek Vasut > Signed-off-by: Jeroen Hofstee > Acked-by: Marek Vasut Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] common: hash: zero end the string instead of the pointer
On Mon, Jun 09, 2014 at 11:02:02AM +0200, Jeroen Hofstee wrote: > if algo->digest_size is zero nothing is set in the str_output > buffer. An attempt is made to zero end the buffer, but the > pointer to the buffer is set to zero instead. I am unaware if > it causes any actual problems, but solves the following warning: > > common/hash.c:217:13: warning: expression which evaluates to zero treated as > a null pointer constant of type 'char *' [-Wnon-literal-null-conversion] > str_ptr = '\0'; > ^~~~ > > cc: Simon Glass > Signed-off-by: Jeroen Hofstee Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] m68k: Fix warnings with gcc 4.6
On Sat, Jun 07, 2014 at 10:07:58PM -0600, Simon Glass wrote: > Most of the warnings seem to be related to using 'int' for size_t. Change > this and fix up the remaining warnings and problems. For bootm, the warning > was masked by others, and there is an actual bug in the code. > > Signed-off-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v2] kbuild, tools: generate wrapper C sources automatically by Makefile
On Fri, Jun 06, 2014 at 02:04:32PM +0900, Masahiro Yamada wrote: > There are many source files shared between U-boot image and tools. > Instead of adding a lot of dummy wrapper files that just include > the corresponding file in lib/ or common/ directory, > Makefile should automatically generate them. > > The original inspiration for this came from > scripts/Makefile.asm-generic of Linux Kernel. > > Signed-off-by: Masahiro Yamada > Acked-by: Simon Glass > Tested-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 1/2] kbuild: remove unnecessary adjustment for Cygwin
On Fri, Jun 06, 2014 at 08:46:44PM +0900, Masahiro Yamada wrote: > "SFX = .exe" was originally added for Cygwin environment. > > It is true that GCC on Cygwin spits executables with .exe extention. > > For example, > > gcc -o foo foo.c > > will generate "foo.exe", not "foo". > > But GNU make is also nicely adjusted for Cygwin. > > For example, > > foo: foo.c > gcc -o $@ $< > > will compare the timestamp between "foo.exe" and "foo.c". > > You do not have to tweak Makefiles like this: > > foo$(SFX): foo.c > gcc -o $@ $< > > And "make clean" works as well without adjustment for Cygwin because > the command "rm foo" on Cygwin will delete both "foo" and "foo.exe". > > In conclusion, makefiles do not need special care for Cygwin. > > Signed-off-by: Masahiro Yamada Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] docs: driver-model: Fix spelling
On Sat, Jun 07, 2014 at 10:35:55AM +1200, Chris Packham wrote: > Signed-off-by: Chris Packham Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 2/2] .gitignore: move *.exe pattern to the top gitignore for Cygwin
On Fri, Jun 06, 2014 at 08:46:45PM +0900, Masahiro Yamada wrote: > GCC on Cygwin generates executables with .exe extension, > for example: > scripts/basic/fixdep.exe > scripts/docproc.exe > > To ignore them, *.exe pattern should be moved > from tools/.gitignore to ./.gitignore > > Signed-off-by: Masahiro Yamada Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] .gitignore: drop *.dts.tmp pattern
On Fri, Jun 06, 2014 at 08:18:37PM +0900, Masahiro Yamada wrote: > This pattern was added by commit cc4f427b to ignore the intermidiate > file for generating DTB. > > When Kbuild was introduced, dts/Makefile was totally re-written. > This ignore pattern is already useless. > > Signed-off-by: Masahiro Yamada Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] kbuild: export HOSTCXX and HOSTCXXFLAGS
On Fri, Jun 06, 2014 at 10:15:27AM +0900, Masahiro Yamada wrote: > Signed-off-by: Masahiro Yamada Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,RESEND,2/3] Add run_command_repeatable()
On Thu, Jun 05, 2014 at 08:07:57PM +0200, Thomas Betker wrote: > run_command() returns 0 on success and 1 on error. However, there are some > invocations which expect 0 or 1 for success (not repeatable or repeatable) > and -1 for error; add run_command_repeatable() for this purpose. > > Signed-off-by: Thomas Betker > Acked-by: Simon Glass > Tested-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] disk: part_dos.c: Add a PBR check when MBR checking fails
On Fri, Jun 06, 2014 at 03:48:26PM +1200, Darwin Dingel wrote: > Bug: SDCard with a messed up partition but still has a FAT signature > intact is readable in Linux but unreadable in uboot with 'fatls'. > > Fix: When partition info checking fails, there is no checking for a > FAT signature (DOS_PBR) which will fail 'fatls'. FAT signature checking > is done when no valid partition is found in partition table. If FAT > signature is found, the disk will be read as PBR and continue > processing. > > Signed-off-by: Darwin Dingel Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,RESEND,3/3] Use run_command_repeatable()
On Thu, Jun 05, 2014 at 08:07:58PM +0200, Thomas Betker wrote: > Replace run_command() by run_command_repeatable() in places which > depend on the return code to indicate repeatability. > > Signed-off-by: Thomas Betker > Acked-by: Simon Glass > Tested-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, RESEND, 1/3] Check run_command() return code properly
On Thu, Jun 05, 2014 at 08:07:56PM +0200, Thomas Betker wrote: > run_command() returns 0 for success, 1 for failure. Fix places which > assume that failure is indicated by a negative return code. > > Signed-off-by: Thomas Betker > Acked-by: Simon Glass > Tested-by: Simon Glass > Tested-by: Stefan Roese Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,v3,13/14] am33xx/omap: Enable FIT support
On Mon, Jun 02, 2014 at 10:04:56PM -0600, Simon Glass wrote: > Enable booting a FIT containing a kernel/device tree. > > Signed-off-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v3, 14/14] am33xx/omap: Add a new board to enable verified boot
On Mon, Jun 02, 2014 at 10:04:57PM -0600, Simon Glass wrote: > Enable verified boot functionality for a new am335x_boneblack_vboot target. > > Signed-off-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 0/14] Minor improvements to secure boot and enable on beaglebone
On Mon, Jun 02, 2014 at 10:04:43PM -0600, Simon Glass wrote: > This series fixes a few problems that have come up since the secure boot > series was merged: > > - A recent commit broken the assumption that u-boot.bin ends at a known > address (thus making things appended to U-Boot inaccessible from the code). > This is fixed for Beaglebone and a few other boards. A new test is added to > the Makefile to ensure that it does not break again. All boards have been > tested to make sure the problem does not appear elsewhere. > > - A way is needed to provide an externally-build device tree binary for > U-Boot. This allows signing to happen outside the U-Boot build system. > > - The .img files generated by an OMAP build need to include the FDT if one > is appended. > > - Adding signatures to an FDT can cause the FDT to run out of space. The > fix is to regenerate the FDT from scratch with different dtc parameters, so > pretty painful. Instead, we automatically expand the FDT. > > The last commit enables verified boot on a Beaglebone Black with a special > configuration. Use 'am335x_boneblack_vboot' for this. This will soon disable > support for legacy images. > > Changes in v3: > - Add new patch to ensure the hash section is inside the image for cm_t335 > - Add new patch to ensure the hash section is inside the image for mx31ads > - Rebase to master and update commit message > - Fix typo in commit message > - Add new patch to improve error handling in fit_common > - Rebase to master > - Also enable LZO and timestamps, plus increase the maximum kernel size > - Use verified boot only on a new board - am335x_boneblack_vboot > > Changes in v2: > - Add new patch to ensure the hash section is inside the image for am335x > - Add new patch to check u-boot.bin size against symbol table > - Update to cover all omap devices > - Adjust for kbuild changes > - Fix line over 80cols > - Move device tree files into arch/arm/dts Note that I applied this directly to master since it's largely TI boards or generic code, I hope you don't mind Albert. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 07/14] fdt: Add DEV_TREE_BIN option to specify a device tree binary file
On Tue, Jun 10, 2014 at 02:59:23PM +0900, Masahiro Yamada wrote: > Hi Simon, > > > On Mon, 2 Jun 2014 22:04:50 -0600 > Simon Glass wrote: > > > In some cases, an externally-built device tree binary is required to be > > attached to U-Boot. An example is when using image signing, since in that > > case the .dtb file must include the public keys. > > I do not want to expand this argument, but > I am not sure if DTB stands for "device tree binary". > > linux/Documentation often refer it as "device tree blob", > while linux/Documentation/devicetree/booting-without-of.txt > says "device tree block". > > > > Add a DEV_TREE_BIN option to the Makefile, and update the documentation. > > Is it possible to rename it without mentioning _BIN or _BLOB ? > > For example, DTB_PATH=... or EXT_DTB=... > or some other variable name you like. Yes. > > diff --git a/Makefile b/Makefile > > index ece622f..92819bf 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -867,7 +867,7 @@ MKIMAGEFLAGS_u-boot.kwb = -n > > $(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \ > > MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \ > > -R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage > > > > -u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE > > +u-boot.img u-boot.kwb u-boot.pbl: u-boot$(if > > $(CONFIG_OF_SEPARATE),-dtb,).bin FORCE > > $(call if_changed,mkimage) > > The second comma in '(if $(CONFIG_OF_SEPARATE),-dtb,)' is redundant. > > > This is duplicating the same image as u-boot-dtb.img > > Your way is that "u-boot.img" includes DTB in some time and doesn't in the > other. > I am not sure which way is better. > But we don't need two rules to generate the equivalent image. > > If you go along with this change, I think it's OK with me. > Please consider removing below in that case: > > > ifeq ($(CONFIG_SPL_FRAMEWORK),y) > ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img > endif > > and > > u-boot-dtb.img: u-boot-dtb.bin FORCE > $(call if_changed,mkimage) ... as a follow up (I want to get this in already). Thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v3, 10/14] mkimage: Automatically make space in FDT when full
On Mon, Jun 02, 2014 at 10:04:53PM -0600, Simon Glass wrote: > When adding hashes or signatures, the target FDT may be full. Detect this > and automatically try again after making 1KB of space. > > Signed-off-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v3, 12/14] am33xx/omap: Enable CONFIG_OF_CONTROL
On Mon, Jun 02, 2014 at 10:04:55PM -0600, Simon Glass wrote: > Add support for device tree control and add device tree files for the > beaglebone black initially. > > Signed-off-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v3, 11/14] arm: ti: Increase malloc size to 16MB for armv7 boards
On Mon, Jun 02, 2014 at 10:04:54PM -0600, Simon Glass wrote: > The current size of 1MB is not enough use to use DFU. Increase it for > ARMv7 boards, all of which should have 32MB or more SDRAM. > > With this change it is possible to do 'dfu mmc 0' on a Beaglebone Black. > > Signed-off-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v3, 09/14] Improve error handling in fit_common
On Mon, Jun 02, 2014 at 10:04:52PM -0600, Simon Glass wrote: > Make the error handling common, and make sure the file is always closed > on error. Rename the parameter to be more description and add comments. > > Signed-off-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v3, 08/14] fdt: Update functions which write to an FDT to return -ENOSPC
On Mon, Jun 02, 2014 at 10:04:51PM -0600, Simon Glass wrote: > When writing values into an FDT it is possible that there will be > insufficient space. If the caller gets a useful error then it can > potentially deal with the situation. > > Adjust these functions to return -ENOSPC when the FDT is full. > > Signed-off-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v3, 06/14] hash: Export the function to show a hash
On Mon, Jun 02, 2014 at 10:04:49PM -0600, Simon Glass wrote: > This function is useful for displaying a hash value, so export it. > > Signed-off-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v3, 05/14] am33xx/omap: Allow cache enable for all Sitara/OMAP
On Mon, Jun 02, 2014 at 10:04:48PM -0600, Simon Glass wrote: > Enable the cache for all devices, unless CONFIG_SYS_DCACHE_OFF is defined. > This speeds up the Beaglebone Black boot considerable. > > (Tested only on Beaglebone Black with SD card boot) > > Signed-off-by: Simon Glass Applied to u-boot/master (and tested on am43xx evm as well), thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v3, 07/14] fdt: Add DEV_TREE_BIN option to specify a device tree binary file
On Mon, Jun 02, 2014 at 10:04:50PM -0600, Simon Glass wrote: > In some cases, an externally-built device tree binary is required to be > attached to U-Boot. An example is when using image signing, since in that > case the .dtb file must include the public keys. > > Add a DEV_TREE_BIN option to the Makefile, and update the documentation. > > Usage is something like: > > make DEV_TREE_BIN=boot/am335x-boneblack-pubkey.dtb > > Signed-off-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v3, 02/14] cm_t335: Fix the U-Boot binary output
On Mon, Jun 02, 2014 at 10:04:45PM -0600, Simon Glass wrote: > Correct the binary output so that image_binary_size is really at the > end of the image. > > Signed-off-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v3, 03/14] mx31ads: Fix the U-Boot binary output
On Mon, Jun 02, 2014 at 10:04:46PM -0600, Simon Glass wrote: > Correct the binary output so that image_binary_size is really at the > end of the image. > > Signed-off-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v3, 01/14] ti: am335x: Fix the U-Boot binary output
On Mon, Jun 02, 2014 at 10:04:44PM -0600, Simon Glass wrote: > This should include the hash so that image_binary_size is really at the > end of the image, and not some 300 bytes earlier. > > Signed-off-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 2/2] tools: include u-boot version of sha256.h
On Fri, May 30, 2014 at 03:45:28PM +0200, Jeroen Hofstee wrote: > When building tools the u-boot specific sha256.h is required, but the > host version of sha256.h is used when present. This leads to build errors > on FreeBSD which does have a system sha256.h include. Like libfdt_env.h > explicitly include u-boot's sha256.h. > > cc: Simon Glass > Signed-off-by: Jeroen Hofstee > Acked-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 1/2] Makefile: fix clang warnings due to clang support
On Fri, May 30, 2014 at 03:45:27PM +0200, Jeroen Hofstee wrote: > Building u-boot tools with clang as a host compiler e.g. on > FreeBSD with `gmake HOSTCC=clang CONFIG_USE_PRIVATE_LIBGCC=y tools` > leads to many warnings [1] for every compiler invocation since > commit 598e2d33. Part of mentioned commit imports linux patches: > > - kbuild: LLVMLinux: Adapt warnings for compilation with clang > - kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang > > No version of clang supports the gcc fno-delete-null-pointer-checks > though, but it is only passed to clang. Gcc does not have the clang > specific Qunused-arguments for the target. Furthermore several > warnings are disabled which aren't encountered in u-boot. Since such > a build has worked for quite some time and works after removing these > changes, just remove the clang specific handling to restore normal > building with clang as hostcc. > > [1] Actual warnings > --- > GEN include/autoconf.mk.dep > arm-freebsd-gcc: unrecognized option '-Qunused-arguments' > > HOSTCC scripts/basic/fixdep > clang: warning: argument unused during compilation: > '-fno-delete-null-pointer-checks' > > cc: Masahiro Yamada > Signed-off-by: Jeroen Hofstee Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 4/4] dfu: add SF backend
From: Stephen Warren This allows SPI Flash to be programmed using DFU. Signed-off-by: Stephen Warren --- drivers/dfu/Makefile | 1 + drivers/dfu/dfu.c| 3 ++ drivers/dfu/dfu_sf.c | 139 +++ include/dfu.h| 22 4 files changed, 165 insertions(+) create mode 100644 drivers/dfu/dfu_sf.c diff --git a/drivers/dfu/Makefile b/drivers/dfu/Makefile index def628dcdcc4..5cc535efdd47 100644 --- a/drivers/dfu/Makefile +++ b/drivers/dfu/Makefile @@ -9,3 +9,4 @@ obj-$(CONFIG_DFU_FUNCTION) += dfu.o obj-$(CONFIG_DFU_MMC) += dfu_mmc.o obj-$(CONFIG_DFU_NAND) += dfu_nand.o obj-$(CONFIG_DFU_RAM) += dfu_ram.o +obj-$(CONFIG_DFU_SF) += dfu_sf.o diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c index 897dfab77be6..6cd3fbb58ae4 100644 --- a/drivers/dfu/dfu.c +++ b/drivers/dfu/dfu.c @@ -413,6 +413,9 @@ static int dfu_fill_entity(struct dfu_entity *dfu, char *s, int alt, } else if (strcmp(interface, "ram") == 0) { if (dfu_fill_entity_ram(dfu, devstr, s)) return -1; + } else if (strcmp(interface, "sf") == 0) { + if (dfu_fill_entity_sf(dfu, devstr, s)) + return -1; } else { printf("%s: Device %s not (yet) supported!\n", __func__, interface); diff --git a/drivers/dfu/dfu_sf.c b/drivers/dfu/dfu_sf.c new file mode 100644 index ..91f6df220b1d --- /dev/null +++ b/drivers/dfu/dfu_sf.c @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include +#include +#include +#include +#include + +static long dfu_get_medium_size_sf(struct dfu_entity *dfu) +{ + return dfu->data.sf.size; +} + +static int dfu_read_medium_sf(struct dfu_entity *dfu, u64 offset, void *buf, + long *len) +{ + return spi_flash_read(dfu->data.sf.dev, offset, *len, buf); +} + +static int dfu_write_medium_sf(struct dfu_entity *dfu, + u64 offset, void *buf, long *len) +{ + int ret; + + ret = spi_flash_erase(dfu->data.sf.dev, offset, *len); + if (ret) + return ret; + + ret = spi_flash_write(dfu->data.sf.dev, offset, *len, buf); + if (ret) + return ret; + + return 0; +} + +static int dfu_flush_medium_sf(struct dfu_entity *dfu) +{ + return 0; +} + +static unsigned int dfu_polltimeout_sf(struct dfu_entity *dfu) +{ + return DFU_DEFAULT_POLL_TIMEOUT; +} + +static void dfu_free_entity_sf(struct dfu_entity *dfu) +{ + spi_flash_free(dfu->data.sf.dev); +} + +static struct spi_flash *parse_dev(char *devstr) +{ + unsigned int bus; + unsigned int cs; + unsigned int speed = CONFIG_SF_DEFAULT_SPEED; + unsigned int mode = CONFIG_SF_DEFAULT_MODE; + char *s, *endp; + struct spi_flash *dev; + + s = strsep(&devstr, ":"); + if (!s || !*s || (bus = simple_strtoul(s, &endp, 0), *endp)) { + printf("Invalid SPI bus %s\n", s); + return NULL; + } + + s = strsep(&devstr, ":"); + if (!s || !*s || (cs = simple_strtoul(s, &endp, 0), *endp)) { + printf("Invalid SPI chip-select %s\n", s); + return NULL; + } + + s = strsep(&devstr, ":"); + if (s && *s) { + speed = simple_strtoul(s, &endp, 0); + if (*endp || !speed) { + printf("Invalid SPI speed %s\n", s); + return NULL; + } + } + + s = strsep(&devstr, ":"); + if (s && *s) { + mode = simple_strtoul(s, &endp, 0); + if (*endp || mode > 3) { + printf("Invalid SPI mode %s\n", s); + return NULL; + } + } + + dev = spi_flash_probe(bus, cs, speed, mode); + if (!dev) { + printf("Failed to create SPI flash at %d:%d:%d:%d\n", + bus, cs, speed, mode); + return NULL; + } + + return dev; +} + +int dfu_fill_entity_sf(struct dfu_entity *dfu, char *devstr, char *s) +{ + char *st; + + dfu->data.sf.dev = parse_dev(devstr); + if (!dfu->data.sf.dev) + return -ENODEV; + + dfu->dev_type = DFU_DEV_SF; + dfu->max_buf_size = dfu->data.sf.dev->sector_size; + + st = strsep(&s, " "); + if (!strcmp(st, "raw")) { + dfu->layout = DFU_RAW_ADDR; + dfu->data.sf.start = simple_strtoul(s, &s, 16); + s++; + dfu->data.sf.size = simple_strtoul(s, &s, 16); + } else { + printf("%s: Memory layout (%s) not supported!\n", __func__, st); + spi_flash_free(dfu->data.sf.dev); + return -1; + } + + dfu->get_medium_size = dfu_get_medium_size_sf; + dfu->read_medium = dfu_read_medium_sf; +