Re: [U-Boot] switching to single .config configuration issues
Hi, On 4 May 2015 at 05:34, Yehuda Yitschak wrote: > Hey Simon > >> -Original Message- >> From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon Glass >> Sent: Sunday, May 03, 2015 21:55 >> To: Yehuda Yitschak >> Cc: Masahiro Yamada; Hanna Hawa; u-boot@lists.denx.de >> Subject: Re: [U-Boot] switching to single .config configuration issues >> >> Hi Yehuda, >> >> On 30 April 2015 at 01:21, Yehuda Yitschak wrote: >> > Hey Masahiro >> > >> >> -Original Message- >> >> From: Masahiro Yamada [mailto:yamada.masah...@socionext.com] >> >> Sent: Thursday, April 30, 2015 4:46 >> >> To: Yehuda Yitschak >> >> Cc: Simon Glass; Hanna Hawa; u-boot@lists.denx.de >> >> Subject: Re: [U-Boot] switching to single .config configuration >> >> issues >> >> >> >> Hi Yehuda, >> >> >> >> >> >> 2015-04-29 14:23 GMT+09:00 Yehuda Yitschak : >> >> > Hey Simon, Masahiro >> >> > >> >> > May I suggest an alternative solution to this issue. >> >> > >> >> > What if each Kconfigs option could be set as "y" (compile for >> >> > u-boot only )or "s" (compile for u-boot and SPL) Just as the kernel >> >> > can set Kconfig >> >> to "y" or "m". >> >> > >> >> > With minor modifications to the Makefile, SPL target will compile >> >> > "obj-s" >> >> and u-boot target will compile "obj-s" and "obj-y" >> >> > >> >> > What do you think ? >> >> >> >> >> >> Interesting. >> >> >> >> A little comments. >> >> >> >> - Is there any possibility that some files should be compiled for SPL >> >> only? >> >>(I do not think we have much.) >> >> >> >>Perhaps, obj-y : for U-boot only >> >> obj-s : for SPL only >> >> oby-ys: for both >> >> I am not sure.. >> > >> > How about "a" (as in all targets) instead of "sy". It will look better >> > in the menuconfig square brackets Maybe TPL should also be added as "t" >> option. >> > >> >> >> >> - This idea is only applicable for bool options. >> >> We still have to keep duplication for int/hex options such as >> >> CONFIG_SPL_TEXT_BASE. >> >> >> >> But, this idea will help clean up much because most of configs are >> boolean. >> >> I am still not sure what sorts of things are getting compiled int SPL, and >> thus >> causing problems. Can you please provide a few details? > > We are looking for a very small SPL image that will fit into internal SRAM. > Therefore we want to compile the minimal set of drivers into the SPL. > We have added all our drivers to Kconfig infrastructure (not mainlined yet) > and so each driver > We add to u-boot (like PCIe) will be added to SPL and would require manual > removal using the dedicated H file I see. Let's see what Masahiro thinks about this. One good thing with this proposal is that we would still only have a single config source file (.config), but I cannot see how it could be implemented without having multiple output autoconf.h files. How many options do you need to add for manual removal? Regards, Simon > >> >> >> >> >> >> >> Best Regards >> >> Masahiro Yamada >> >> >> >> >> >> >> -Original Message- >> >> >> From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon >> >> Glass >> >> >> Sent: Wednesday, April 29, 2015 6:06 >> >> >> To: Hanna Hawa >> >> >> Cc: u-boot@lists.denx.de; Yehuda Yitschak; Masahiro Yamada >> >> >> Subject: Re: switching to single .config configuration issues >> >> >> >> >> >> +Masahiro (new address) >> >> >> >> >> >> Hi Hanna, >> >> >> >> >> >> On 27 April 2015 at 07:43, Hanna Hawa wrote: >> >> >> > Hi everyone, >> >> >> > >> >> >> > >> >> >> > >> >> >> > I’m working on the latest u-boot 2015.04 trying to rebase my >> >> >> > repository to latest code. >> >> >> >> >> >> I would suggest going with upstream/master (targeting 2015.07) >> >> >> since there are several driver model changes since 2015.04 (USB, >> >> >> PCI, Ethernet). There are still patches going in but the bulk of >> >> >> it should be >> >> there. >> >> >> >> >> >> > >> >> >> > And I have question regarding patch e02ee2548afe (kconfig: >> >> >> > switch to single .config configuration) >> >> >> > >> >> >> > >> >> >> > >> >> >> > Issues that I face in the current solution (single .config): >> >> >> > >> >> >> > For my usage most of the CONFIG options will not supported in >> >> >> > the SPL, we need the SPL very tiny and most of the CONFIG will >> >> >> > be enabled in the u-boot, need to undef/disable(set=n) for every >> >> >> > CONFIG in scripts/Makefile.uncmd_spl/ include/config_uncmd_spl.h >> >> >> > >> >> >> > Also for future usage if we want to delete the defines of the >> >> >> > commands from the include file and move it to defconfig file, >> >> >> > then need to undef them in the SPL code. >> >> >> >> >> >> Masahiro is the expert here. The idea is to use SPL-specific >> >> >> options for >> >> SPL. >> >> >> For example CONFIG_SPL_I2C_SUPPORT. This is much the same as >> before. >> >> >> >> >> >> I suggest you create some SPL options for your new features, so >> >> >> that they are only en
Re: [U-Boot] [PATCH] dm: usb: Do not use bus->seq before device_probe(bus)
On 4 May 2015 at 13:37, Simon Glass wrote: > Hi Hans, > > On 4 May 2015 at 13:33, Hans de Goede wrote: >> Do not use bus->seq before device_probe(bus), as bus->seq is not set until >> after the device_probe() call. This fixes u-boot printing: "USB-1: " for >> each bus it scans. >> >> Signed-off-by: Hans de Goede >> --- >> drivers/usb/host/usb-uclass.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c >> index 3655435..dd721cb 100644 >> --- a/drivers/usb/host/usb-uclass.c >> +++ b/drivers/usb/host/usb-uclass.c >> @@ -181,9 +181,8 @@ int usb_init(void) >> >> uclass_foreach_dev(bus, uc) { >> /* init low_level USB */ >> + printf("USB%d: ", count); > > This might be confusing if bus->seq ends up being something else. But > I don't have a better idea and I've been thinking about it for a > while. > > Acked-by: Simon Glass > >> count++; >> - printf("USB"); >> - printf("%d: ", bus->seq); >> ret = device_probe(bus); >> if (ret == -ENODEV) { /* No such device. */ >> puts("Port not available.\n"); >> -- >> 2.3.6 >> > > Regards, > Simon Applied to u-boot-dm, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] dm: i2c-gpio: Remove redundant dm_gpio_set_value() call
On 27 April 2015 at 21:20, Simon Glass wrote: > On 25 April 2015 at 21:05, Axel Lin wrote: >> dm_gpio_set_dir_flags() will also set gpio output value when switching to >> gpio output. So it's not necessary to call dm_gpio_set_value() after >> dm_gpio_set_dir_flags() call. >> >> Signed-off-by: Axel Lin >> --- >> drivers/i2c/i2c-gpio.c | 13 +++-- >> 1 file changed, 7 insertions(+), 6 deletions(-) > > Acked-by: Simon Glass Applied to u-boot-dm, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/3] x86: quark: Implement PIRQ routing
Hi Bin, On 4 May 2015 at 00:27, Bin Meng wrote: > > Hi Simon, > > On Tue, Apr 28, 2015 at 10:05 PM, Simon Glass wrote: > > Hi Bin, > > > > On 27 April 2015 at 00:16, Bin Meng wrote: > >> Intel Quark SoC has the same interrupt routing mechanism as the > >> Queensbay platform, only the difference is that PCI devices' > >> INTA/B/C/D are harcoded and cannot be changed freely. > >> > >> Signed-off-by: Bin Meng > >> > >> --- > >> > >> arch/x86/cpu/quark/Makefile | 2 +- > >> arch/x86/cpu/quark/irq.c | 173 > >> +++ > >> arch/x86/cpu/quark/quark.c | 8 ++ > >> arch/x86/include/asm/arch-quark/device.h | 70 ++--- > >> arch/x86/include/asm/arch-quark/irq.h| 55 ++ > >> arch/x86/include/asm/arch-quark/quark.h | 15 +++ > >> configs/galileo_defconfig| 1 + > >> include/configs/galileo.h| 1 + > >> 8 files changed, 309 insertions(+), 16 deletions(-) > >> create mode 100644 arch/x86/cpu/quark/irq.c > >> create mode 100644 arch/x86/include/asm/arch-quark/irq.h > > > > Before going too far down this path I'd like to see if we can put the > > IRQ data in the device tree. What do you think? > > > > Device tree might work, and we might come up with a standard intel irq > router driver to configure this based on device tree input. But I will > need study more chipset datasheet to do that. OK let's wait for that. It does seem like a job for device tree. Even if we can get a binding that works for modern chips that would be a win. Let me know what you find. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] serial: fdt: add device tree support for pl01x
Hello Masahiro, On 05/01/2015 03:32 PM, vikasm wrote: > Thanks Simon, > > On 05/01/2015 03:02 PM, Simon Glass wrote: >> +Masahiro, for my of_match_ptr() comment below. >> >> Hi Vikas, >> >> On 1 May 2015 at 15:48, Vikas Manocha wrote: >>> This patch adds device tree support for arm pl010/pl011 driver. >>> >>> Signed-off-by: Vikas Manocha >>> --- >>> doc/device-tree-bindings/serial/pl01x.txt |7 + >>> drivers/serial/serial_pl01x.c | 41 >>> - >>> 2 files changed, 47 insertions(+), 1 deletion(-) >>> create mode 100644 doc/device-tree-bindings/serial/pl01x.txt >>> >>> diff --git a/doc/device-tree-bindings/serial/pl01x.txt >>> b/doc/device-tree-bindings/serial/pl01x.txt >>> new file mode 100644 >>> index 000..61c27d1 >>> --- /dev/null >>> +++ b/doc/device-tree-bindings/serial/pl01x.txt >>> @@ -0,0 +1,7 @@ >>> +* ARM AMBA Primecell PL011 & PL010 serial UART >>> + >>> +Required properties: >>> +- compatible: must be "arm,primecell", "arm,pl011" or "arm,pl010" >>> +- reg: exactly one register range with length 0x1000 >>> +- clock: input clock frequency for the UART (used to calculate the baud >>> + rate divisor) >>> diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c >>> index 2124161..ea22cfd 100644 >>> --- a/drivers/serial/serial_pl01x.c >>> +++ b/drivers/serial/serial_pl01x.c >>> @@ -20,6 +20,9 @@ >>> #include >>> #include >>> #include "serial_pl01x_internal.h" >>> +#include >>> + >>> +DECLARE_GLOBAL_DATA_PTR; >>> >>> #ifndef CONFIG_DM_SERIAL >>> >>> @@ -28,7 +31,6 @@ static enum pl01x_type pl01x_type __attribute__ >>> ((section(".data"))); >>> static struct pl01x_regs *base_regs __attribute__ ((section(".data"))); >>> #define NUM_PORTS (sizeof(port)/sizeof(port[0])) >>> >>> -DECLARE_GLOBAL_DATA_PTR; >>> #endif >>> >>> static int pl01x_putc(struct pl01x_regs *regs, char c) >>> @@ -351,9 +353,46 @@ static const struct dm_serial_ops pl01x_serial_ops = { >>> .setbrg = pl01x_serial_setbrg, >>> }; >>> >>> +#ifdef CONFIG_OF_CONTROL >>> +static const struct udevice_id pl01x_serial_id[] ={ >>> + {.compatible = "arm,pl011"}, >>> + {.compatible = "arm,pl010"}, >> You can use: >> >> {.compatible = "arm,pl011", .data = TYPE_PL011}, > Thanks for the suggestion. > >>> + {} >>> +}; >>> + >>> +static int pl01x_serial_ofdata_to_platdata(struct udevice *dev) >>> +{ >>> + struct pl01x_serial_platdata *plat = dev_get_platdata(dev); >>> + fdt_addr_t addr; >>> + const char* type_pl01x; >>> + >>> + addr = fdtdec_get_addr(gd->fdt_blob, dev->of_offset, "reg"); >>> + if (addr == FDT_ADDR_T_NONE) >>> + return -EINVAL; >>> + >>> + plat->base = addr; >>> + plat->clock = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "clock", >>> 1); >>> + type_pl01x = fdt_getprop(gd->fdt_blob, dev->of_offset, \ >>> + "compatible", NULL); >> plat->type = dev_get_driver_data(dev); > completely agree, it would make the code much cleaner. > >>> + if(!strcmp(type_pl01x, "arm,pl011")) >>> + plat->type = TYPE_PL011; >>> + else if(!strcmp(type_pl01x, "arm,pl010")) >>> + plat->type = TYPE_PL010; >>> + else >>> + return -EINVAL; >> Should be able to drop this line. > yes, all the above block. > >>> + >>> + return 0; >>> +} >>> +#endif >>> + >>> U_BOOT_DRIVER(serial_pl01x) = { >>> .name = "serial_pl01x", >>> .id = UCLASS_SERIAL, >>> +#ifdef CONFIG_OF_CONTROL >>> + .of_match = pl01x_serial_id, >>> + .ofdata_to_platdata = pl01x_serial_ofdata_to_platdata, >>> + .platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata), >>> +#endif >> Would be good to get rid of the #ifdef. >> >> I think you can put the last one outside the #ifdef, since >> device_bind() will do the right thing if there is already platform >> data. > ok. > >> For the first one you can do .of_match = of_match_ptr(pl01x_serial_id), > ok, i will check it. > > Rgds, > Vikas > >> But the middle line (ofdata_to_platdata) does need an #ifdef I think. >> Perhaps we could create something similar to of_match_ptr() for this >> case? Any suggestion on this point..can we use of_match_ptr() ? Rgds, Vikas >> >>> .probe = pl01x_serial_probe, >>> .ops= &pl01x_serial_ops, >>> .flags = DM_FLAG_PRE_RELOC, >>> -- >>> 1.7.9.5 >>> >> Regards, >> Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RESEND PATCH v3 09/13] arm: mvebu: Change network init code to allow a more flexible setup
Hi Stefan, On Fri, Apr 24, 2015 at 11:29 PM, Stefan Roese wrote: > With the introduction of the Armada 38x support, its necessary to change > the mvneta ethernet driver init call from always 4 times to a > configurable value. Lets make this init call more flexible by moving > the actually used devices to the config header. > > Additionally this patch takes care of the slightly different base > addresses for the ethernet controllers on A38x. > > Signed-off-by: Stefan Roese > Tested-by: Kevin Smith > Tested-by: Dirk Eibach > --- Acked-by: Joe Hershberger ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] net/phy: refactor RTL8211F initialization
On Fri, Apr 24, 2015 at 3:57 AM, Shengzhou Liu wrote: > RTL8211F needs to enalbe TXDLY for RGMII during > phy initialization, so move it to rtl8211f_config > for early initialization. > > Signed-off-by: Shengzhou Liu > cc: Joe Hershberger > --- Applied to u-boot-net/next, thanks! -Joe ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 23/24] tegra: mmc: Set the removable flag correctly
Hi Simon, On Mon, May 4, 2015 at 12:31 PM, Simon Glass wrote: > If the mmc device is non-removable (as indicated by the device tree), set > the flag so that users of the device know. > > Signed-off-by: Simon Glass > --- Reviewed-by: Joe Hershberger ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 18/24] sandbox: Fix warning in display_options
Hi Simon, On Mon, May 4, 2015 at 12:31 PM, Simon Glass wrote: > This fixes a warning in the print_buffer() function with some toolchains. > > Signed-off-by: Simon Glass > --- Reviewed-by: Joe Hershberger ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 20/24] lcd: Support colour lookup table on 16bpp display in BMP images
Hi Simon, On Mon, May 4, 2015 at 12:31 PM, Simon Glass wrote: > For 16-bit-per-pixel displays it is useful to support 8 bit-per-pixel > images to reduce image size. Add support for this when drawing BMP images. > > Signed-off-by: Simon Glass > --- > > common/lcd.c | 23 --- > include/bmp_layout.h | 4 ++-- > 2 files changed, 22 insertions(+), 5 deletions(-) > > diff --git a/common/lcd.c b/common/lcd.c > index 055c366..2d11578 100644 > --- a/common/lcd.c > +++ b/common/lcd.c > @@ -578,6 +578,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) > unsigned long width, height, byte_width; > unsigned long pwidth = panel_info.vl_col; > unsigned colors, bpix, bmp_bpix; > + int hdr_size; > + bmp_color_table_entry_t *palette = bmp->color_table; > > if (!bmp || !(bmp->header.signature[0] == 'B' && > bmp->header.signature[1] == 'M')) { > @@ -589,6 +591,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) > width = get_unaligned_le32(&bmp->header.width); > height = get_unaligned_le32(&bmp->header.height); > bmp_bpix = get_unaligned_le16(&bmp->header.bit_count); > + hdr_size = get_unaligned_le16(&bmp->header.size); > + debug("hdr_size=%d, bmp_bpix=%d\n", hdr_size, bmp_bpix); > > colors = 1 << bmp_bpix; > > @@ -613,8 +617,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) > return 1; > } > > - debug("Display-bmp: %d x %d with %d colors\n", > - (int)width, (int)height, (int)colors); > + debug("Display-bmp: %d x %d with %d colors, display %d\n", > + (int)width, (int)height, (int)colors, 1 << bpix); > > if (bmp_bpix == 8) > lcd_set_cmap(bmp, colors); > @@ -641,6 +645,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) > cmap_base = configuration_get_cmap(); > #ifdef CONFIG_LCD_BMP_RLE8 > u32 compression = > get_unaligned_le32(&bmp->header.compression); > + debug("compressed %d %d\n", compression, BMP_BI_RLE8); > if (compression == BMP_BI_RLE8) { > if (bpix != 16) { > /* TODO implement render code for bpix != 16 > */ > @@ -663,7 +668,19 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) > if (bpix != 16) { > fb_put_byte(&fb, &bmap); > } else { > - *(uint16_t *)fb = > cmap_base[*(bmap++)]; > + struct bmp_color_table_entry *entry; > + uint val; > + > + if (cmap_base) { > + val = cmap_base[*bmap]; > + } else { > + entry = &palette[*bmap]; > + val = entry->blue >> 3 | > + entry->green >> 2 << > 5 | > + entry->red >> 3 << 11; > + } > + *(uint16_t *)fb = val; > + bmap++; > fb += sizeof(uint16_t) / sizeof(*fb); > } > } > diff --git a/include/bmp_layout.h b/include/bmp_layout.h > index 22b1fbc..47f505c 100644 > --- a/include/bmp_layout.h > +++ b/include/bmp_layout.h > @@ -11,12 +11,12 @@ > #ifndef _BMP_H_ > #define _BMP_H_ > > -typedef struct bmp_color_table_entry { > +typedef struct __packed bmp_color_table_entry { It would be great to drop the typedef here. > __u8blue; > __u8green; > __u8red; > __u8reserved; > -} __attribute__ ((packed)) bmp_color_table_entry_t; > +} bmp_color_table_entry_t; > > /* When accessing these fields, remember that they are stored in little > endian format, so use linux macros, e.g. le32_to_cpu(width) */ > -- Cheers, -Joe ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC] Booting Xen from a FIT - Additional discussion about a refactor
Hi Karl, On 1 May 2015 at 10:21, Karl Apsite wrote: > Hi Simon, > I Added the email listed in the test script to this conversation > Please do add tests for the new functionality - see test/image for some existing tests. Python is preferred if the test is non-trivial. >>> >>> Absolutely, I'll be sure to include some tests in the patch(es).. >> >> Great. This area of U-Boot has had a lot of undocumented or untested >> behaviour. It has got a bit better but your boot function sounds like >> another step in the right direction. > > I took a look at the current set of tests, and I'm not sure what's required to > run them. Is there an undocumented runner in the Makefile? I can run the > specified make target to prepare for the tests it sounds like: > `make O=sandbox sandbox_config` > > However trying to run the script just generated errors about missing images. > > Do you know what's needed to run the script? The instructions are at the top of the script: # # To run this: # # make O=sandbox sandbox_config # make O=sandbox # ./test/image/test-fit.py -u sandbox/u-boot > > Log: > $ test/image/test-imagetools.sh > > Building multi-file image... > # sandbox/tools/mkimage -A x86 -O linux -T multi -n "v1.0-test" -d > sandbox/boot/vmlinuz:sandbox/boot/initrd.img:sandbox/boot/System.map linux.img > test/image/test-imagetools.sh: line 73: sandbox/tools/mkimage: No such file or > directory > done. > > Extracting multi-file image contents... > # sandbox/tools/dumpimage -T multi -i linux.img -p 0 vmlinuz > test/image/test-imagetools.sh: line 73: sandbox/tools/dumpimage: No such file > or > directory > # sandbox/tools/dumpimage -T multi -i linux.img -p 1 initrd.img > test/image/test-imagetools.sh: line 73: sandbox/tools/dumpimage: No such file > or > directory > # sandbox/tools/dumpimage -T multi -i linux.img -p 2 System.map > test/image/test-imagetools.sh: line 73: sandbox/tools/dumpimage: No such file > or > directory > # sandbox/tools/dumpimage -T multi -i linux.img -p 2 System.map -o test_output > test/image/test-imagetools.sh: line 73: sandbox/tools/dumpimage: No such file > or > directory > done. > diff: vmlinuz: No such file or directory > Failed. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC] Booting Xen from a FIT - Additional discussion about a refactor
Hi Karl, On 1 May 2015 at 10:21, Karl Apsite wrote: > Hi Simon, > I Added the email listed in the test script to this conversation > Please do add tests for the new functionality - see test/image for some existing tests. Python is preferred if the test is non-trivial. >>> >>> Absolutely, I'll be sure to include some tests in the patch(es).. >> >> Great. This area of U-Boot has had a lot of undocumented or untested >> behaviour. It has got a bit better but your boot function sounds like >> another step in the right direction. > > I took a look at the current set of tests, and I'm not sure what's required to > run them. Is there an undocumented runner in the Makefile? I can run the > specified make target to prepare for the tests it sounds like: > `make O=sandbox sandbox_config` > > However trying to run the script just generated errors about missing images. > > Do you know what's needed to run the script? The instructions are at the top of the script: > > Log: > $ test/image/test-imagetools.sh > > Building multi-file image... > # sandbox/tools/mkimage -A x86 -O linux -T multi -n "v1.0-test" -d > sandbox/boot/vmlinuz:sandbox/boot/initrd.img:sandbox/boot/System.map linux.img > test/image/test-imagetools.sh: line 73: sandbox/tools/mkimage: No such file or > directory > done. > > Extracting multi-file image contents... > # sandbox/tools/dumpimage -T multi -i linux.img -p 0 vmlinuz > test/image/test-imagetools.sh: line 73: sandbox/tools/dumpimage: No such file > or > directory > # sandbox/tools/dumpimage -T multi -i linux.img -p 1 initrd.img > test/image/test-imagetools.sh: line 73: sandbox/tools/dumpimage: No such file > or > directory > # sandbox/tools/dumpimage -T multi -i linux.img -p 2 System.map > test/image/test-imagetools.sh: line 73: sandbox/tools/dumpimage: No such file > or > directory > # sandbox/tools/dumpimage -T multi -i linux.img -p 2 System.map -o test_output > test/image/test-imagetools.sh: line 73: sandbox/tools/dumpimage: No such file > or > directory > done. > diff: vmlinuz: No such file or directory > Failed. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 19/24] sandbox: Support wide-screen LCD emulation
Hi Joe, On 4 May 2015 at 15:27, Joe Hershberger wrote: > Hi Simon, > > On Mon, May 4, 2015 at 12:31 PM, Simon Glass wrote: >> Increase the LCD size to 1366x768. >> >> Signed-off-by: Simon Glass >> --- > > Is this actually emulated somehow? Maybe I just don't see it since I'm > SSH'ed into my build machine? Yes, plus you need the -l option. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] dm: usb: Copy over usb_device values from usb_scan_device() to final usb_device
On 4 May 2015 at 15:35, Simon Glass wrote: > Hi Hans, > > On 4 May 2015 at 14:28, Simon Glass wrote: >> On 4 May 2015 at 11:19, Hans de Goede wrote: >>> Currently we copy over a number of usb_device values stored in the on stack >>> struct usb_device probed in usb_scan_device() to the final driver-model >>> managed >>> struct usb_device in usb_child_pre_probe() through usb_device_platdata, and >>> then call usb_select_config() to fill in the rest. >>> >>> There are 3 problems with this approach: >>> >>> 1) It does not fill in enough fields before calling usb_select_config(), >>> specifically it does not fill in ep0's maxpacketsize causing a div by zero >>> exception in the ehci driver. >>> >>> 2) It unnecessarily redoes a number of usb requests making usb probing >>> slower >>> >>> 3) Calling usb_select_config() a second time fails on some usb-1 devices >>> plugged into usb-2 hubs, causing u-boot to not recognize these devices. >>> >>> This commit fixes these issues by removing the usb_select_config() call from >>> usb_child_pre_probe(), and instead of copying over things field by field >>> through usb_device_platdata, store a pointer to the in stack usb_device >>> (which is still valid when usb_child_pre_probe() gets called) and copy >>> over the entire struct. >>> >>> Signed-off-by: Hans de Goede >> >> Acked-by: Simon Glass > > But sadly this fails with sandbox. Please do run the driver model tests. Output: 02: dm: usb: Copy over usb_device values from usb_scan_device() to final usb_device sandbox: + sandbox +../drivers/usb/emul/usb-emul-uclass.c: In function ‘usb_emul_find’: +../drivers/usb/emul/usb-emul-uclass.c:125:11: error: ‘struct usb_dev_platdata’ has no member named ‘devnum’ + if (udev->devnum == devnum) { + ^ +In file included from ../drivers/usb/emul/usb-emul-uclass.c:8:0: +../drivers/usb/emul/usb-emul-uclass.c:127:25: error: ‘struct usb_dev_platdata’ has no member named ‘devnum’ + dev->name, udev->devnum); + ^ +../include/common.h:109:26: note: in definition of macro ‘debug_cond’ +printf(pr_fmt(fmt), ##args); \ + ^ +../drivers/usb/emul/usb-emul-uclass.c:126:4: note: in expansion of macro ‘debug’ +debug("%s: Found emulator '%s', addr %d\n", __func__, +^ +../drivers/usb/emul/usb-emul-uclass.c: In function ‘usb_emul_control’: +../drivers/usb/emul/usb-emul-uclass.c:168:8: error: ‘struct usb_dev_platdata’ has no member named ‘devnum’ +plat->devnum = setup->value; +^ +../drivers/usb/emul/usb-emul-uclass.c: In function ‘usb_emul_reset’: +../drivers/usb/emul/usb-emul-uclass.c:253:6: error: ‘struct usb_dev_platdata’ has no member named ‘devnum’ + plat->devnum = 0; + ^ > > Regards, > Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] dm: usb: Copy over usb_device values from usb_scan_device() to final usb_device
Hi Hans, On 4 May 2015 at 14:28, Simon Glass wrote: > On 4 May 2015 at 11:19, Hans de Goede wrote: >> Currently we copy over a number of usb_device values stored in the on stack >> struct usb_device probed in usb_scan_device() to the final driver-model >> managed >> struct usb_device in usb_child_pre_probe() through usb_device_platdata, and >> then call usb_select_config() to fill in the rest. >> >> There are 3 problems with this approach: >> >> 1) It does not fill in enough fields before calling usb_select_config(), >> specifically it does not fill in ep0's maxpacketsize causing a div by zero >> exception in the ehci driver. >> >> 2) It unnecessarily redoes a number of usb requests making usb probing slower >> >> 3) Calling usb_select_config() a second time fails on some usb-1 devices >> plugged into usb-2 hubs, causing u-boot to not recognize these devices. >> >> This commit fixes these issues by removing the usb_select_config() call from >> usb_child_pre_probe(), and instead of copying over things field by field >> through usb_device_platdata, store a pointer to the in stack usb_device >> (which is still valid when usb_child_pre_probe() gets called) and copy >> over the entire struct. >> >> Signed-off-by: Hans de Goede > > Acked-by: Simon Glass But sadly this fails with sandbox. Please do run the driver model tests. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 19/24] sandbox: Support wide-screen LCD emulation
Hi Simon, On Mon, May 4, 2015 at 12:31 PM, Simon Glass wrote: > Increase the LCD size to 1366x768. > > Signed-off-by: Simon Glass > --- Is this actually emulated somehow? Maybe I just don't see it since I'm SSH'ed into my build machine? Thanks, -Joe ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 14/24] sandbox: Correct error handling in state_read_file()
Hi Simon, On Mon, May 4, 2015 at 12:31 PM, Simon Glass wrote: > This function should return a useful error for U-Boot, rather than -1. > > Signed-off-by: Simon Glass > --- Reviewed-by: Joe Hershberger ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] net: Implement random ethaddr fallback in eth.c
On 4 May 2015 at 13:55, Joe Hershberger wrote: > Implement the random ethaddr fallback in eth.c so it is in a common > place and not reimplemented in each board or driver that wants this > behavior. > > Signed-off-by: Joe Hershberger > --- > To function properly in the driver-model case, this patch requires that > https://patchwork.ozlabs.org/patch/467418/ be applied. > > README | 3 ++- > doc/README.enetaddr | 2 ++ > net/Kconfig | 8 > net/eth.c | 12 > 4 files changed, 24 insertions(+), 1 deletion(-) Reviewed-by: Simon Glass ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 10/24] arm: Add a prototype for save_boot_params_ret()
Hi Simon, On Mon, May 4, 2015 at 12:31 PM, Simon Glass wrote: > It is convenient for some boards to implement save_boot_params() in C rather > than assembler. Provide a way to return in this case. > > Signed-off-by: Simon Glass > --- Reviewed-by: Joe Hershberger ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 17/24] sandbox: spi: Add newline to printf() in sandbox_sf_probe
Hi Simon, On Mon, May 4, 2015 at 12:31 PM, Simon Glass wrote: > This printf() should have a newline at the end. Add it. > > Signed-off-by: Simon Glass > --- Reviewed-by: Joe Hershberger ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [VOTING REQUIRED] Re: U-Boot mini summit
On Mon, May 04, 2015 at 05:31:36PM +0200, Wolfgang Denk wrote: > On Tue, 14 Apr 2015 Stefano Babic wrote: > > > Hi everybody, > > > > there were some rumours about next U-Boot mini summit and why there is > > not yet a date. The reason is that we at DENX are thinking about, taking > > into account that the U-Boot community is steadily increased, which is > > the best location for the next summit. We know that a lot of you are in > > US or, generally, outside Europe and maybe it is time to ask everybody > > where the next summit will take place - and maybe the result will not be > > in Europe. > > > > Surely, the summit should be part of an Event organized by the Linux > > Foundation, and taking into account the embedded nature of the > > bootloader, there are two possible candidates: > > > > - ELCE in Dublin, 5-7 October 2015 > > - ELC in San Diego, 4-6 April 2016 > > > > Wolfgang has prepared a "doodle" survey to collect availability and > > preferences. Feel free to add your name to the event(s) you would like > > to participate. > > > > http://doodle.com/8mf8xhhbsugtirpa > > > > This survey runs until 10, May 2015 - after that we will know where to > > meet for the U-Boot summit. > > > > Thanks everybody for improving U-Boot ! > > > > Best regards, > > Stefano Babic > > > I would like to point out that the poll will be ending on Sunday, > i. e. within less than a week, and so far we have just 16 votes, > or only 9 if we exclude the DENX team. > > This cannot be true? Is there really so little interest in a U-Boot > developer meeting? In this case we should probably consider not > doing such an event at all? Or just a tiny one at DENX ;-) > > Not even Tom and the majority of the custodians bothered to vote... > > Are you all sleeping? Hey, WAKE UP, this is YOUR event, if you want > to have it in a location which you can conveniently reach, then speak > up NOW! *snore* Hunh? What? Crap... -- 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 03/24] bootstage: Add IDs for SPI flash reading and decompression
Hi Simon, On Mon, May 4, 2015 at 12:30 PM, Simon Glass wrote: > We maintain an accumulator for time spent reading from SPI flash, since > this can be significant on some platforms. Also add one for decompression > time. > > Signed-off-by: Simon Glass > --- Reviewed-by: Joe Hershberger ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 02/24] dm: usb: Implement usb_detect_change() for driver model
Hi Simon, On Mon, May 4, 2015 at 12:30 PM, Simon Glass wrote: > Support this function with driver model also (CONFIG_DM_USB). > > Signed-off-by: Simon Glass > --- > > drivers/usb/host/usb-uclass.c | 43 > +++ > 1 file changed, 43 insertions(+) > > diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c > index 714bc0e..8445a42 100644 > --- a/drivers/usb/host/usb-uclass.c > +++ b/drivers/usb/host/usb-uclass.c > @@ -555,6 +555,49 @@ int usb_scan_device(struct udevice *parent, int port, > return 0; > } > > +/* > + * Detect if a USB device has been plugged or unplugged. > + */ > +int usb_detect_change(void) > +{ > + struct udevice *hub; > + struct uclass *uc; > + int change = 0; > + int ret; > + > + ret = uclass_get(UCLASS_USB_HUB, &uc); > + if (ret) > + return ret; > + > + uclass_foreach_dev(hub, uc) { > + struct usb_device *udev; > + struct udevice *dev; > + > + if (!device_active(hub)) > + continue; You check this here. > + for (device_find_first_child(hub, &dev); > +dev; > +device_find_next_child(&dev)) { > + struct usb_port_status status; > + > + if (!device_active(hub)) > + continue; How can this be true here? Maybe you meant to check if the "dev" was active? > + > + udev = dev_get_parentdata(hub); Why parent of the hub? Looking for an upstream hub? > + if (usb_get_port_status(udev, udev->portnr, &status) > + < 0) > + /* USB request failed */ > + continue; > + > + if (le16_to_cpu(status.wPortChange) & > + USB_PORT_STAT_C_CONNECTION) > + change++; > + } > + } > + > + return change; > +} > + > int usb_child_post_bind(struct udevice *dev) > { > struct usb_dev_platdata *plat = dev_get_parent_platdata(dev); > -- Thanks, -Joe ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/4] ARM: mmc: bcm283x: Remove get_timer_us() from mmc driver
The get_timer_us() function is something which is no longer existing in case we use generic timer framework, so replace it with get_timer(). Signed-off-by: Marek Vasut Cc: Stephen Warren Cc: Tyler Baker --- drivers/mmc/bcm2835_sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c index 4ec2968..0f81add 100644 --- a/drivers/mmc/bcm2835_sdhci.c +++ b/drivers/mmc/bcm2835_sdhci.c @@ -69,11 +69,11 @@ static inline void bcm2835_sdhci_raw_writel(struct sdhci_host *host, u32 val, * (Which is just as well - otherwise we'd have to nobble the DMA engine * too) */ - while (get_timer_us(bcm_host->last_write) < bcm_host->twoticks_delay) + while (get_timer(bcm_host->last_write) < bcm_host->twoticks_delay) ; writel(val, host->ioaddr + reg); - bcm_host->last_write = get_timer_us(0); + bcm_host->last_write = get_timer(0); } static inline u32 bcm2835_sdhci_raw_readl(struct sdhci_host *host, int reg) -- 2.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/4] ARM: bcm283x: Repair wdog.h
Trivially fix the include check in wdog.h. Signed-off-by: Marek Vasut Cc: Stephen Warren Cc: Tyler Baker --- arch/arm/mach-bcm283x/include/mach/wdog.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-bcm283x/include/mach/wdog.h b/arch/arm/mach-bcm283x/include/mach/wdog.h index beb6a08..cbc350e 100644 --- a/arch/arm/mach-bcm283x/include/mach/wdog.h +++ b/arch/arm/mach-bcm283x/include/mach/wdog.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier:GPL-2.0 */ -#ifndef _BCM2835_TIMER_H -#define _BCM2835_TIMER_H +#ifndef _BCM2835_WDOG_H +#define _BCM2835_WDOG_H #ifdef CONFIG_BCM2836 #define BCM2835_WDOG_PHYSADDR 0x3f10 -- 2.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 4/4] ARM: bcm283x: Switch to generic timer
Switch to generic timer implementation from lib/time.c . This also fixes a signed overflow which was in __udelay() implementation. Signed-off-by: Marek Vasut Cc: Stephen Warren Cc: Tyler Baker --- arch/arm/mach-bcm283x/Makefile | 2 +- arch/arm/mach-bcm283x/timer.c | 58 -- include/configs/rpi-common.h | 6 + 3 files changed, 7 insertions(+), 59 deletions(-) delete mode 100644 arch/arm/mach-bcm283x/timer.c diff --git a/arch/arm/mach-bcm283x/Makefile b/arch/arm/mach-bcm283x/Makefile index ac27d00..f0dadd0 100644 --- a/arch/arm/mach-bcm283x/Makefile +++ b/arch/arm/mach-bcm283x/Makefile @@ -5,4 +5,4 @@ # obj-$(CONFIG_TARGET_RPI) += lowlevel_init.o -obj-y += init.o reset.o timer.o mbox.o phys2bus.o +obj-y += init.o reset.o mbox.o phys2bus.o diff --git a/arch/arm/mach-bcm283x/timer.c b/arch/arm/mach-bcm283x/timer.c deleted file mode 100644 index 017907c..000 --- a/arch/arm/mach-bcm283x/timer.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * (C) Copyright 2012 Stephen Warren - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include -#include -#include - -ulong get_timer_us(ulong base) -{ - struct bcm2835_timer_regs *regs = - (struct bcm2835_timer_regs *)BCM2835_TIMER_PHYSADDR; - - return readl(®s->clo) - base; -} - -ulong get_timer(ulong base) -{ - ulong us = get_timer_us(0); - us /= (100 / CONFIG_SYS_HZ); - us -= base; - return us; -} - -unsigned long long get_ticks(void) -{ - return get_timer(0); -} - -ulong get_tbclk(void) -{ - return CONFIG_SYS_HZ; -} - -void __udelay(unsigned long usec) -{ - ulong endtime; - signed long diff; - - endtime = get_timer_us(0) + usec; - - do { - ulong now = get_timer_us(0); - diff = endtime - now; - } while (diff >= 0); -} diff --git a/include/configs/rpi-common.h b/include/configs/rpi-common.h index 3121ac9..b54cf8b 100644 --- a/include/configs/rpi-common.h +++ b/include/configs/rpi-common.h @@ -8,12 +8,18 @@ #define _RPI_COMMON_H_ #include +#include /* Architecture, CPU, etc.*/ #define CONFIG_SYS_GENERIC_BOARD #define CONFIG_BCM2835 #define CONFIG_ARCH_CPU_INIT #define CONFIG_SYS_DCACHE_OFF + +#define CONFIG_SYS_TIMER_RATE 100 +#define CONFIG_SYS_TIMER_COUNTER \ + (&((struct bcm2835_timer_regs *)BCM2835_TIMER_PHYSADDR)->clo) + /* * 2835 is a SKU in a series for which the 2708 is the first or primary SoC, * so 2708 has historically been used rather than a dedicated 2835 ID. -- 2.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/4] ARM: bcm283x: Reorder timer.h
Reorder the timer.h file so it can be included from board config file. Signed-off-by: Marek Vasut Cc: Stephen Warren Cc: Tyler Baker --- arch/arm/mach-bcm283x/include/mach/timer.h | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-bcm283x/include/mach/timer.h b/arch/arm/mach-bcm283x/include/mach/timer.h index fc7aec7..004c24b 100644 --- a/arch/arm/mach-bcm283x/include/mach/timer.h +++ b/arch/arm/mach-bcm283x/include/mach/timer.h @@ -13,6 +13,14 @@ #define BCM2835_TIMER_PHYSADDR 0x20003000 #endif +#define BCM2835_TIMER_CS_M3(1 << 3) +#define BCM2835_TIMER_CS_M2(1 << 2) +#define BCM2835_TIMER_CS_M1(1 << 1) +#define BCM2835_TIMER_CS_M0(1 << 0) + +#ifndef __ASSEMBLY__ +#include + struct bcm2835_timer_regs { u32 cs; u32 clo; @@ -23,11 +31,8 @@ struct bcm2835_timer_regs { u32 c3; }; -#define BCM2835_TIMER_CS_M3(1 << 3) -#define BCM2835_TIMER_CS_M2(1 << 2) -#define BCM2835_TIMER_CS_M1(1 << 1) -#define BCM2835_TIMER_CS_M0(1 << 0) - extern ulong get_timer_us(ulong base); #endif + +#endif -- 2.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 05/24] dm: i2c: Add a function to find out the chip offset length
Hi Simon, On Mon, May 4, 2015 at 12:30 PM, Simon Glass wrote: > We can currently set this but there is no API function to get it. Add one. > > Signed-off-by: Simon Glass > --- Reviewed-by: Joe Hershberger ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 11/24] arm: spl: Enable detecting when U-Boot is started from SPL
Hi Simon, On Mon, May 4, 2015 at 12:31 PM, Simon Glass wrote: > For secure boot systems it is common to have a read-only U-Boot which starts > the machine and jumps to a read-write U-Boot for actual booting the OS. This > allows the read-write U-Boot to be upgraded without risk of permanently > bricking the machine. In the event that the read-write U-Boot is corrupted, > the read-only U-Boot can detect this with a checksum and boot into a > recovery flow. > > To support this, add a way to detect when U-Boot is run from SPL as opposed > to some other method, such as booted directly (no SPL) or started from > another source (e.g. a primary U-Boot). This works by putting a special value > in r0. > > For now we rely on board-specific code to actually check the register and > set a flag. At some point this could be generalised, perhaps by using a spare > register and passing a flag to _main and/or board_init_f(). > > Signed-off-by: Simon Glass > --- > > include/spl.h | 13 + > 1 file changed, 13 insertions(+) Part of this patch seems to be missing. I don't see how these changes can accomplish what is described in the commit log. > diff --git a/include/spl.h b/include/spl.h > index b2e5bf7..cdd63a7 100644 > --- a/include/spl.h > +++ b/include/spl.h > @@ -11,6 +11,8 @@ > #include > #include > > +/* Value in r0 indicates we booted from U-Boot */ > +#define SPL_RUNNING_FROM_UBOOT 0x13578642 > > /* Boot type */ > #define MMCSD_MODE_UNDEFINED 0 > @@ -82,4 +84,15 @@ int spl_load_image_ext_os(block_dev_desc_t *block_dev, int > partition); > #ifdef CONFIG_SPL_BOARD_INIT > void spl_board_init(void); > #endif > + > +/** > + * spl_was_boot_source() - check if U-Boot booted from SPL > + * > + * This will normally be true, but if U-Boot jumps to second U-Boot, it will > + * be false. This should be implemented by board-specific code. > + * > + * @return true if U-Boot booted from SPL, else false > + */ > +bool spl_was_boot_source(void); > + > #endif > -- Thanks, -Joe ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 04/24] dm: i2c: Implement 'i2c bus' command for driver model
Hi Simon, On Mon, May 4, 2015 at 12:30 PM, Simon Glass wrote: > This command was missed in the conversion. Add it back for driver model. > > Signed-off-by: Simon Glass > --- Reviewed-by: Joe Hershberger > > common/cmd_i2c.c | 63 > +--- > 1 file changed, 55 insertions(+), 8 deletions(-) > > diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c > index ad38cbf..1bc0db8 100644 > --- a/common/cmd_i2c.c > +++ b/common/cmd_i2c.c > @@ -1623,6 +1623,27 @@ int do_edid(cmd_tbl_t *cmdtp, int flag, int argc, char > *const argv[]) > } > #endif /* CONFIG_I2C_EDID */ > > +#ifdef CONFIG_DM_I2C > +static void show_bus(struct udevice *bus) > +{ > + struct udevice *dev; > + > + printf("Bus %d:\t%s", bus->req_seq, bus->name); > + if (device_active(bus)) > + printf(" (active %d)", bus->seq); > + printf("\n"); > + for (device_find_first_child(bus, &dev); > +dev; > +device_find_next_child(&dev)) { > + struct dm_i2c_chip *chip = dev_get_parent_platdata(dev); > + > + printf(" %02x: %s, offset len %x, flags %x\n", > + chip->chip_addr, dev->name, chip->offset_len, > + chip->flags); > + } > +} > +#endif > + > /** > * do_i2c_show_bus() - Handle the "i2c bus" command-line command > * @cmdtp: Command data struct pointer > @@ -1632,20 +1653,30 @@ int do_edid(cmd_tbl_t *cmdtp, int flag, int argc, > char *const argv[]) > * > * Returns zero always. > */ > -#if defined(CONFIG_SYS_I2C) > +#if defined(CONFIG_SYS_I2C) || defined(CONFIG_DM_I2C) > static int do_i2c_show_bus(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > { > - int i; > -#ifndef CONFIG_SYS_I2C_DIRECT_BUS > - int j; > -#endif > - > if (argc == 1) { > /* show all busses */ > +#ifdef CONFIG_DM_I2C > + struct udevice *bus; > + struct uclass *uc; > + int ret; > + > + ret = uclass_get(UCLASS_I2C, &uc); > + if (ret) > + return CMD_RET_FAILURE; > + uclass_foreach_dev(bus, uc) > + show_bus(bus); > +#else > + int i; > + > for (i = 0; i < CONFIG_SYS_NUM_I2C_BUSES; i++) { > printf("Bus %d:\t%s", i, I2C_ADAP_NR(i)->name); > #ifndef CONFIG_SYS_I2C_DIRECT_BUS > + int j; > + > for (j = 0; j < CONFIG_SYS_I2C_MAX_HOPS; j++) { > if (i2c_bus[i].next_hop[j].chip == 0) > break; > @@ -1657,15 +1688,30 @@ static int do_i2c_show_bus(cmd_tbl_t *cmdtp, int > flag, int argc, > #endif > printf("\n"); > } > +#endif > } else { > + int i; > + > /* show specific bus */ > i = simple_strtoul(argv[1], NULL, 10); > +#ifdef CONFIG_DM_I2C > + struct udevice *bus; > + int ret; > + > + ret = uclass_get_device_by_seq(UCLASS_I2C, i, &bus); > + if (ret) { > + printf("Invalid bus %d: err=%d\n", i, ret); > + return CMD_RET_FAILURE; > + } > + show_bus(bus); > +#else > if (i >= CONFIG_SYS_NUM_I2C_BUSES) { > printf("Invalid bus %d\n", i); > return -1; > } > printf("Bus %d:\t%s", i, I2C_ADAP_NR(i)->name); > #ifndef CONFIG_SYS_I2C_DIRECT_BUS > + int j; > for (j = 0; j < CONFIG_SYS_I2C_MAX_HOPS; j++) { > if (i2c_bus[i].next_hop[j].chip == 0) > break; > @@ -1676,6 +1722,7 @@ static int do_i2c_show_bus(cmd_tbl_t *cmdtp, int flag, > int argc, > } > #endif > printf("\n"); > +#endif > } > > return 0; > @@ -1835,7 +1882,7 @@ static int do_i2c_reset(cmd_tbl_t * cmdtp, int flag, > int argc, char * const argv > } > > static cmd_tbl_t cmd_i2c_sub[] = { > -#if defined(CONFIG_SYS_I2C) > +#if defined(CONFIG_SYS_I2C) || defined(CONFIG_DM_I2C) It's too bad we are already on a 3rd model for I2C and the 1st is still kicking around. We have the same problem on the Ethernet phy drivers as soon as I add DM support. I intend to address that one at some point before too long... maybe even before I add DM support. Maybe we need a deadline for this in I2C like we had for common board? > U_BOOT_CMD_MKENT(bus, 1, 1, do_i2c_show_bus, "", ""), > #endif > U_BOOT_CMD_MKENT(crc32, 3, 1, do_i2c_crc, "", ""), > @@ -1902,7 +1949,7 @@ static int do_i2c(cmd_tbl_t * cmdtp, int flag, int > argc, char * const argv[]) > /**
Re: [U-Boot] [PATCH v3] dm: usb: Copy over usb_device values from usb_scan_device() to final usb_device
On 4 May 2015 at 11:19, Hans de Goede wrote: > Currently we copy over a number of usb_device values stored in the on stack > struct usb_device probed in usb_scan_device() to the final driver-model > managed > struct usb_device in usb_child_pre_probe() through usb_device_platdata, and > then call usb_select_config() to fill in the rest. > > There are 3 problems with this approach: > > 1) It does not fill in enough fields before calling usb_select_config(), > specifically it does not fill in ep0's maxpacketsize causing a div by zero > exception in the ehci driver. > > 2) It unnecessarily redoes a number of usb requests making usb probing slower > > 3) Calling usb_select_config() a second time fails on some usb-1 devices > plugged into usb-2 hubs, causing u-boot to not recognize these devices. > > This commit fixes these issues by removing the usb_select_config() call from > usb_child_pre_probe(), and instead of copying over things field by field > through usb_device_platdata, store a pointer to the in stack usb_device > (which is still valid when usb_child_pre_probe() gets called) and copy > over the entire struct. > > Signed-off-by: Hans de Goede Acked-by: Simon Glass ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/3] net: Remove all references to CONFIG_ETHADDR and friends
We really don't want boards defining fixed MAC addresses in their config so we just remove the option to set it in a fixed way. If you must have a MAC address that was not provisioned, then use the random MAC address functionality. Signed-off-by: Joe Hershberger --- README | 16 ++-- doc/README.enetaddr| 2 +- drivers/net/greth.c| 10 +++--- drivers/net/lan91c96.c | 7 --- examples/standalone/README.smc9_eeprom | 23 --- include/configs/M5208EVBE.h| 2 -- include/configs/M5235EVB.h | 2 -- include/configs/M5272C3.h | 2 -- include/configs/M5282EVB.h | 2 -- include/configs/M53017EVB.h| 3 --- include/configs/M5329EVB.h | 2 -- include/configs/M5373EVB.h | 2 -- include/configs/M54418TWR.h| 3 --- include/configs/M54451EVB.h| 2 -- include/configs/M54455EVB.h| 3 --- include/configs/M5475EVB.h | 5 - include/configs/M5485EVB.h | 3 --- include/configs/MPC8536DS.h| 4 include/configs/MPC8540ADS.h | 5 + include/configs/MPC8541CDS.h | 3 --- include/configs/MPC8544DS.h| 2 -- include/configs/MPC8548CDS.h | 6 -- include/configs/MPC8555CDS.h | 5 - include/configs/MPC8560ADS.h | 8 +--- include/configs/MPC8568MDS.h | 4 include/configs/MPC8572DS.h| 6 -- include/configs/MPC8610HPCD.h | 1 - include/configs/MPC8641HPCN.h | 10 +- include/configs/a4m072.h | 1 - include/configs/bct-brettl2.h | 2 -- include/configs/bf518f-ezbrd.h | 2 -- include/configs/bf526-ezbrd.h | 2 -- include/configs/bf527-ezkit.h | 2 -- include/configs/bf533-ezkit.h | 2 -- include/configs/bf533-stamp.h | 2 -- include/configs/bf537-minotaur.h | 2 -- include/configs/bf537-pnav.h | 2 -- include/configs/bf537-srv1.h | 2 -- include/configs/bf537-stamp.h | 2 -- include/configs/bf538f-ezkit.h | 2 -- include/configs/bf548-ezkit.h | 2 -- include/configs/bf561-acvilon.h| 3 --- include/configs/bf561-ezkit.h | 2 -- include/configs/blackstamp.h | 3 --- include/configs/blackvme.h | 3 --- include/configs/br4.h | 3 --- include/configs/cm-bf527.h | 2 -- include/configs/cm-bf533.h | 2 -- include/configs/cm-bf537e.h| 2 -- include/configs/cm-bf537u.h| 2 -- include/configs/cm-bf548.h | 2 -- include/configs/cm-bf561.h | 2 -- include/configs/cobra5272.h| 1 - include/configs/dbau1x00.h | 2 -- include/configs/ea20.h | 3 +-- include/configs/gr_cpci_ax2000.h | 1 - include/configs/gr_ep2s60.h| 10 -- include/configs/gr_xc3s_1500.h | 9 - include/configs/grsim.h| 11 --- include/configs/grsim_leon2.h | 11 --- include/configs/ibf-dsp561.h | 2 -- include/configs/inka4x0.h | 3 --- include/configs/microblaze-generic.h | 1 - include/configs/motionpro.h| 2 -- include/configs/omap3_cairo.h | 1 - include/configs/pb1x00.h | 2 -- include/configs/pr1.h | 2 -- include/configs/sbc405.h | 1 - include/configs/sbc8548.h | 4 include/configs/sbc8641d.h | 10 +- include/configs/scb9328.h | 1 - include/configs/sequoia.h | 9 - include/configs/stxgp3.h | 6 +- include/configs/stxssa.h | 6 +- include/configs/tcm-bf518.h| 2 -- include/configs/tcm-bf537.h| 2 -- include/configs/uniphier.h | 1 - include/configs/v38b.h | 1 - include/configs/work_92105.h | 11 --- include/configs/xaeniax.h | 1 - include/configs/zeus.h | 2 -- include/env_default.h | 18 -- 82 files changed, 13 insertions(+), 317 deletions(-) diff --git a/README b/README index 9e90c4b..fccc394 100644 --- a/README +++ b/README @@ -2113,18 +2113,6 @@ CBFS (Coreboot Filesystem) support Some PHY like Intel LXT971A need extra delay after command issued bef
[U-Boot] [PATCH 1/3] net: Implement random ethaddr fallback in eth.c
Implement the random ethaddr fallback in eth.c so it is in a common place and not reimplemented in each board or driver that wants this behavior. Signed-off-by: Joe Hershberger --- To function properly in the driver-model case, this patch requires that https://patchwork.ozlabs.org/patch/467418/ be applied. README | 3 ++- doc/README.enetaddr | 2 ++ net/Kconfig | 8 net/eth.c | 12 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/README b/README index ee65fdb..9e90c4b 100644 --- a/README +++ b/README @@ -5629,7 +5629,8 @@ o If both the SROM and the environment contain a MAC address, and the warning is printed. o If neither SROM nor the environment contain a MAC address, an error - is raised. + is raised. If CONFIG_NET_RANDOM_ETHADDR is defined, then in this case + a random, locally-assigned MAC is used. If Ethernet drivers implement the 'write_hwaddr' function, valid MAC addresses will be programmed into hardware as part of the initialization process. This diff --git a/doc/README.enetaddr b/doc/README.enetaddr index 0fafd2c..82c9cd5 100644 --- a/doc/README.enetaddr +++ b/doc/README.enetaddr @@ -37,6 +37,8 @@ Correct flow of setting up the MAC address (summarized): environment variable will be used unchanged. If the environment variable is not set, it will be initialized from eth_device->enetaddr, and a warning will be printed. + If both are invalid and CONFIG_NET_RANDOM_ETHADDR is defined, a random, + locally-assigned MAC is written to eth_device->enetaddr. 4. Program the address into hardware if the following conditions are met: a) The relevant driver has a 'write_addr' function b) The user hasn't set an 'ethmacskip' environment variable diff --git a/net/Kconfig b/net/Kconfig index 22b9eaa..a2bd4fe 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -7,4 +7,12 @@ menuconfig NET if NET +config NET_RANDOM_ETHADDR + bool "Random ethaddr if unset" + help + Selecting this will allow the Ethernet interface to function + even when the ethaddr variable for that interface is unset. + A new MAC address will be generated on every boot and it will + not be added to the environment. + endif # if NET diff --git a/net/eth.c b/net/eth.c index 8e6acfe..c4e0878 100644 --- a/net/eth.c +++ b/net/eth.c @@ -529,9 +529,15 @@ static int eth_post_probe(struct udevice *dev) printf("\nWarning: %s using MAC address from ROM\n", dev->name); } else if (is_zero_ethaddr(pdata->enetaddr)) { +#ifdef CONFIG_NET_RANDOM_ETHADDR + net_random_ethaddr(pdata->enetaddr); + printf("\nWarning: %s (eth%d) using random MAC address - %pM\n", + dev->name, dev->seq, pdata->enetaddr); +#else printf("\nError: %s address not set.\n", dev->name); return -EINVAL; +#endif } return 0; @@ -657,9 +663,15 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name, printf("\nWarning: %s using MAC address from net device\n", dev->name); } else if (is_zero_ethaddr(dev->enetaddr)) { +#ifdef CONFIG_NET_RANDOM_ETHADDR + net_random_ethaddr(dev->enetaddr); + printf("\nWarning: %s (eth%d) using random MAC address - %pM\n", + dev->name, eth_number, dev->enetaddr); +#else printf("\nError: %s address not set.\n", dev->name); return -EINVAL; +#endif } if (dev->write_hwaddr && !eth_mac_skip(eth_number)) { -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/3] net: Remove all calls to net_random_ethaddr()
Remove the calls to net_random_ethaddr() that some boards and some drivers are calling. This is now implemented inside of net/eth.c Enable the feature for all boards that previously enabled it. Signed-off-by: Joe Hershberger --- There are a few seemingly unrelated changes to the defconfig files in this patch. These result from actually running savedefconfig to generate the defconfig instead of editing them manually. board/bct-brettl2/bct-brettl2.c | 13 board/bf518f-ezbrd/bf518f-ezbrd.c | 28 ++-- board/bf526-ezbrd/bf526-ezbrd.c | 28 ++-- board/bf527-ezkit/bf527-ezkit.c | 9 +--- board/bf537-minotaur/bf537-minotaur.c | 18 board/bf537-pnav/bf537-pnav.c | 18 board/bf537-srv1/bf537-srv1.c | 19 - board/bf537-stamp/bf537-stamp.c | 28 ++-- board/buffalo/lsxl/lsxl.c | 10 - board/cm-bf527/cm-bf527.c | 11 +- board/cm-bf537e/cm-bf537e.c | 15 - board/cm-bf537u/cm-bf537u.c | 15 - board/dnp5370/dnp5370.c | 28 ++-- board/ip04/ip04.c | 12 --- board/tcm-bf518/tcm-bf518.c | 40 --- board/tcm-bf537/tcm-bf537.c | 15 - configs/bct-brettl2_defconfig | 3 ++- configs/bf518f-ezbrd_defconfig| 2 ++ configs/bf526-ezbrd_defconfig | 2 ++ configs/bf527-ezkit_defconfig | 2 ++ configs/bf537-minotaur_defconfig | 2 ++ configs/bf537-pnav_defconfig | 2 ++ configs/bf537-srv1_defconfig | 2 ++ configs/bf537-stamp_defconfig | 2 ++ configs/cm-bf527_defconfig| 2 ++ configs/cm-bf537e_defconfig | 2 ++ configs/cm-bf537u_defconfig | 2 ++ configs/dnp5370_defconfig | 2 ++ configs/ip04_defconfig| 2 ++ configs/lschlv2_defconfig | 4 +++- configs/lsxhl_defconfig | 4 +++- configs/tcm-bf518_defconfig | 2 ++ configs/tcm-bf537_defconfig | 2 ++ drivers/net/dm9000x.c | 6 -- drivers/net/ftmac110.c| 3 --- include/configs/lsxl.h| 1 - 36 files changed, 66 insertions(+), 290 deletions(-) diff --git a/board/bct-brettl2/bct-brettl2.c b/board/bct-brettl2/bct-brettl2.c index 1f0dfb4..bf7cd62 100644 --- a/board/bct-brettl2/bct-brettl2.c +++ b/board/bct-brettl2/bct-brettl2.c @@ -29,13 +29,6 @@ int checkboard(void) } #ifdef CONFIG_BFIN_MAC -static void board_init_enetaddr(uchar *mac_addr) -{ - puts("Warning: Generating 'random' MAC address\n"); - net_random_ethaddr(mac_addr); - eth_setenv_enetaddr("ethaddr", mac_addr); -} - int board_eth_init(bd_t *bis) { int retry = 3; @@ -107,12 +100,6 @@ static void turn_leds_off(void) /* miscellaneous platform dependent initialisations */ int misc_init_r(void) { -#ifdef CONFIG_BFIN_MAC - uchar enetaddr[6]; - if (!eth_getenv_enetaddr("ethaddr", enetaddr)) - board_init_enetaddr(enetaddr); -#endif - gpio_cfi_flash_init(); init_tlv320aic31(); init_mute_pin(); diff --git a/board/bf518f-ezbrd/bf518f-ezbrd.c b/board/bf518f-ezbrd/bf518f-ezbrd.c index 8ecfbb2..bf4a7db 100644 --- a/board/bf518f-ezbrd/bf518f-ezbrd.c +++ b/board/bf518f-ezbrd/bf518f-ezbrd.c @@ -29,28 +29,14 @@ int checkboard(void) #if defined(CONFIG_BFIN_MAC) static void board_init_enetaddr(uchar *mac_addr) { -#ifdef CONFIG_SYS_NO_FLASH -# define USE_MAC_IN_FLASH 0 -#else -# define USE_MAC_IN_FLASH 1 -#endif - bool valid_mac = false; - - if (USE_MAC_IN_FLASH) { - /* we cram the MAC in the last flash sector */ - uchar *board_mac_addr = (uchar *)0x203F0096; - if (is_valid_ethaddr(board_mac_addr)) { - memcpy(mac_addr, board_mac_addr, 6); - valid_mac = true; - } - } - - if (!valid_mac) { - puts("Warning: Generating 'random' MAC address\n"); - net_random_ethaddr(mac_addr); +#ifndef CONFIG_SYS_NO_FLASH + /* we cram the MAC in the last flash sector */ + uchar *board_mac_addr = (uchar *)0x203F0096; + if (is_valid_ethaddr(board_mac_addr)) { + memcpy(mac_addr, board_mac_addr, 6); + eth_setenv_enetaddr("ethaddr", mac_addr); } - - eth_setenv_enetaddr("ethaddr", mac_addr); +#endif } /* Only the first run of boards had a KSZ switch */ diff --git a/board/bf526-ezbrd/bf526-ezbrd.c b/board/bf526-ezbrd/bf526-ezbrd.c index 0a88491..db1ee28 100644 --- a/board/bf526-ezbrd/bf526-ezbrd.c +++ b/board/bf526-ezbrd/bf526-ezbrd.c @@ -26,28 +26,14 @@ int checkboard(void) #ifdef CONFIG_BFIN_MAC static void board_init_enetaddr(uchar *mac_addr) { -#ifdef CONFIG_SYS
Re: [U-Boot] [PATCH] dm: usb: Do not use bus->seq before device_probe(bus)
Hi Hans, On 4 May 2015 at 13:33, Hans de Goede wrote: > Do not use bus->seq before device_probe(bus), as bus->seq is not set until > after the device_probe() call. This fixes u-boot printing: "USB-1: " for > each bus it scans. > > Signed-off-by: Hans de Goede > --- > drivers/usb/host/usb-uclass.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c > index 3655435..dd721cb 100644 > --- a/drivers/usb/host/usb-uclass.c > +++ b/drivers/usb/host/usb-uclass.c > @@ -181,9 +181,8 @@ int usb_init(void) > > uclass_foreach_dev(bus, uc) { > /* init low_level USB */ > + printf("USB%d: ", count); This might be confusing if bus->seq ends up being something else. But I don't have a better idea and I've been thinking about it for a while. Acked-by: Simon Glass > count++; > - printf("USB"); > - printf("%d: ", bus->seq); > ret = device_probe(bus); > if (ret == -ENODEV) { /* No such device. */ > puts("Port not available.\n"); > -- > 2.3.6 > Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] dm: usb: Do not use bus->seq before device_probe(bus)
Do not use bus->seq before device_probe(bus), as bus->seq is not set until after the device_probe() call. This fixes u-boot printing: "USB-1: " for each bus it scans. Signed-off-by: Hans de Goede --- drivers/usb/host/usb-uclass.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c index 3655435..dd721cb 100644 --- a/drivers/usb/host/usb-uclass.c +++ b/drivers/usb/host/usb-uclass.c @@ -181,9 +181,8 @@ int usb_init(void) uclass_foreach_dev(bus, uc) { /* init low_level USB */ + printf("USB%d: ", count); count++; - printf("USB"); - printf("%d: ", bus->seq); ret = device_probe(bus); if (ret == -ENODEV) { /* No such device. */ puts("Port not available.\n"); -- 2.3.6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 0/1] dm: usb: Copy over usb_device values from usb_scan_device() to final usb_device
Hi Hans, On 4 May 2015 at 13:12, Hans de Goede wrote: > Hi, > > On 04-05-15 19:22, Simon Glass wrote: >> >> Hi Hans, >> >> On 4 May 2015 at 11:19, Hans de Goede wrote: >>> >>> Hi Simon, >>> >>> Here is v3 of my patch to fix the maxpacketsize0 not being set issue I >>> found and related issues. >>> >>> I've added a big fat comment to explain that the usb_device pointer is a >>> hack and should not be used outside of usb-uclass.c as requested. >>> >>> I hope this version is to your liking and you can ack it. >>> >>> Assuming that you do ack it, then my entire dm-usb fixes + ehci set is >>> all acked, and the question becomes how to take uit upstream, I can take >>> the entire set upstream through the sunxi tree, or you can take it >>> upstream through the dm tree. Let me know which way you prefer to move >>> forward with this. >> >> >> I should probably take it through DM. I'll do a pull request once the >> x86 pull request goes in. > > > Ack. > >> But I'm still not sure how it is safe to pass a pointer to a local >> stack variable out through another function. Can you please explain >> that? > > > A function 'a' can safely pass a pointer to an on stack variable to > a function 'b' which it calls, since it is the caller of function 'b', > and as long as code from 'b' is execution we are still within the > lifetime of function 'a' (function 'a' will only end after b has > returned) and as long as execution is within the lifetime of function > 'a' any on stack variables of function 'a' are valid. > > AFAICT usb_child_pre_probe() gets called from the device_probe() > call inside usb_scan_device() so using a pointer to an on stack > variable of usb_scan_device() is valid since we are still executing > within the lifetime of usb_scan_device(). > > Hope this helps to follow my reasoning. > Ah I see. Gosh that is evil. The comment helps. Acked-by: Simon Glass Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 0/1] dm: usb: Copy over usb_device values from usb_scan_device() to final usb_device
Hi, On 04-05-15 19:22, Simon Glass wrote: Hi Hans, On 4 May 2015 at 11:19, Hans de Goede wrote: Hi Simon, Here is v3 of my patch to fix the maxpacketsize0 not being set issue I found and related issues. I've added a big fat comment to explain that the usb_device pointer is a hack and should not be used outside of usb-uclass.c as requested. I hope this version is to your liking and you can ack it. Assuming that you do ack it, then my entire dm-usb fixes + ehci set is all acked, and the question becomes how to take uit upstream, I can take the entire set upstream through the sunxi tree, or you can take it upstream through the dm tree. Let me know which way you prefer to move forward with this. I should probably take it through DM. I'll do a pull request once the x86 pull request goes in. Ack. But I'm still not sure how it is safe to pass a pointer to a local stack variable out through another function. Can you please explain that? A function 'a' can safely pass a pointer to an on stack variable to a function 'b' which it calls, since it is the caller of function 'b', and as long as code from 'b' is execution we are still within the lifetime of function 'a' (function 'a' will only end after b has returned) and as long as execution is within the lifetime of function 'a' any on stack variables of function 'a' are valid. AFAICT usb_child_pre_probe() gets called from the device_probe() call inside usb_scan_device() so using a pointer to an on stack variable of usb_scan_device() is valid since we are still executing within the lifetime of usb_scan_device(). Hope this helps to follow my reasoning. Regards, Hans Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [VOTING REQUIRED] Re: U-Boot mini summit
Hi Wolfgang and all, On 04/05/2015 17:31, Wolfgang Denk wrote: On Tue, 14 Apr 2015 Stefano Babic wrote: Hi everybody, there were some rumours about next U-Boot mini summit and why there is not yet a date. The reason is that we at DENX are thinking about, taking into account that the U-Boot community is steadily increased, which is the best location for the next summit. We know that a lot of you are in US or, generally, outside Europe and maybe it is time to ask everybody where the next summit will take place - and maybe the result will not be in Europe. Surely, the summit should be part of an Event organized by the Linux Foundation, and taking into account the embedded nature of the bootloader, there are two possible candidates: - ELCE in Dublin, 5-7 October 2015 - ELC in San Diego, 4-6 April 2016 Wolfgang has prepared a "doodle" survey to collect availability and preferences. Feel free to add your name to the event(s) you would like to participate. http://doodle.com/8mf8xhhbsugtirpa This survey runs until 10, May 2015 - after that we will know where to meet for the U-Boot summit. Thanks everybody for improving U-Boot ! Best regards, Stefano Babic I would like to point out that the poll will be ending on Sunday, i. e. within less than a week, and so far we have just 16 votes, or only 9 if we exclude the DENX team. This cannot be true? Is there really so little interest in a U-Boot developer meeting? In this case we should probably consider not doing such an event at all? Or just a tiny one at DENX ;-) Not even Tom and the majority of the custodians bothered to vote... Are you all sleeping? Hey, WAKE UP, this is YOUR event, if you want to have it in a location which you can conveniently reach, then speak up NOW! Best regards, Wolfgang Denk i am _very_ interested, sorry but someway lost the first invitation. Will do my best to come. Best regards Angelo Dureghello ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] bringing up u-boot on qemu-x86
Hi Bin, I am one of the students working on adding ACPI support to u-boot for Minnowboard as a part of GSOC-2015. In this endeavor, I have been trying to bring up u-boot on qemu-x86. I request you to guide me as to how this can be done. Regards, Saket Sinha ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 00/26] Improve env var handling for net stack
Hi Tom, On Sun, May 3, 2015 at 3:12 PM, Joe Hershberger wrote: > This includes moving CONFIG_REGEX to Kconfig and adding support for > regex to the env_attr lists (when CONFIG_REGEX is enabled). > > This allows ethaddrs to all be checked for access and format by default. > Also use callbacks to keep network stack variables up to date instead of > polling them on each call to net_loop. > > This is a step in the right direction to refactoring the network stack > to be similar to that of barebox. > > Also added a test command to host unit tests for the env functions. > > Changes in v3: > -Moved test from env subcommand to ut subcommand > -New for version 3 > > Changes in v2: > -Added comments about the use of .flags in the dm eth test > -Added description to README > -Fix bisectability issue > -Fix corner case in reverse_name_search() where searched starts with ' ' > -New for version 2 > -Simplified test for H_PROGRAMMATIC > > Joe Hershberger (26): > sandbox: Enable some ENV commands > kconfig: Move REGEX to Kconfig > sandbox: Enable regex support > env: Fix return values in env_attr_lookup() > env: Simplify the reverse_strstr() interface > env: Allow env_attr_walk to pass a priv * to callback > env: Add regex support to env_attrs > env: Distinguish finer between source of env change > net: Apply default format rules to all ethaddr > net: Use env callbacks for net variables > net: Add default flags for common net env vars > net: Remove duplicate bootfile syncing functionality > net: Handle ethaddr changes as an env callback > test: Generalize the unit test framework > test: Add a common unit test command > test: Move the unit tests to their own menu > test: dm: Don't bail on all tests if one test fails > test: dm: eth: Handle failed test env cleanup > test: Return values from the asserts compatible with cmds > test: dm: Recover the driver model tree after tests > test: env: Add test framework for env > test: env: Add test for verifying env attrs > test: env: Add a test of the new regex behavior for attrs > test: dm: Move the dm tests over to the ut command > sandbox: Cleanup order and extra defines in defconfig > sandbox: Enable env unit tests Would you prefer this to go through u-boot/net or would you prefer to pull it in directly? It has a fair amount of env and test changes. Speaking of, are you the maintainer of the "env" area of the code? Wolfgang used to comment on it primarily, so I don't know if that role went to you along with mainline. Please let me know... Thanks, -Joe ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] mx6cuboxi: Skip usb initialization when booting without HDMI
On 2015-05-04, Fabio Estevam wrote: > Starting USB initialization is useful for those who use Cuboxi/Hummingboard > with HDMI and USB keyboard. > > However, when booting without a HDMI connection we can skip the usb > initialization, which makes the boot faster. > > Signed-off-by: Jon Nettleton > Signed-off-by: Fabio Estevam > --- > Changes since v1: > - Improve commit log (avoid repeating the word 'use'). > > include/configs/mx6cuboxi.h | 16 > 1 file changed, 12 insertions(+), 4 deletions(-) > > diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h > index 4e07f59..b6f9d4e 100644 > --- a/include/configs/mx6cuboxi.h > +++ b/include/configs/mx6cuboxi.h > @@ -80,6 +80,7 @@ > #define CONFIG_VIDEO_LOGO > #define CONFIG_VIDEO_BMP_LOGO > #define CONFIG_IMX_HDMI > +#define CONFIG_CMD_HDMIDETECT > #define CONFIG_IMX_VIDEO_SKIP > #define CONFIG_CONSOLE_MUX > > @@ -94,7 +95,17 @@ > #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 > #define CONFIG_USB_KEYBOARD > #define CONFIG_SYS_USB_EVENT_POLL > -#define CONFIG_PREBOOT "usb start" > +#define CONFIG_PREBOOT \ > + "if hdmidet; then " \ > + "usb start; " \ > + "setenv stdin serial,usbkbd; "\ > + "setenv stdout serial,vga; " \ > + "setenv stderr serial,vga; " \ > + "else " \ > + "setenv stdin serial; " \ > + "setenv stdout serial; " \ > + "setenv stderr serial; " \ > + "fi;" > > #define CONFIG_SYS_NO_FLASH > > @@ -117,9 +128,6 @@ > > #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG > #define CONFIG_EXTRA_ENV_SETTINGS \ > - "stdin=serial,usbkbd\0" \ > - "stdout=serial,vga\0" \ > - "stderr=serial,vga\0" \ > "script=boot.scr\0" \ > "image=zImage\0" \ > "fdtfile=undefined\0" \ > -- > 1.9.1 Tested-By: Vagrant Cascadian signature.asc Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC] FIT: use default configuration, if given configuration is not found
Hi Yegor, On Mon, May 4, 2015 at 2:53 AM, wrote: > From: Yegor Yefremov > > Signed-off-by: Yegor Yefremov > --- > common/image-fit.c |4 > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/common/image-fit.c b/common/image-fit.c > index c61be65..b892d06 100644 > --- a/common/image-fit.c > +++ b/common/image-fit.c > @@ -1547,6 +1547,10 @@ int fit_image_load(bootm_headers_t *images, ulong addr, > } else { > cfg_noffset = fit_conf_get_node(fit, > fit_uname_config); > + > + if (cfg_noffset < 0) { > + cfg_noffset = fit_conf_get_node(fit, NULL); > + } It seems if you ask for a specific configuration that is not available, you should get an error. You can accomplish similar behavior you are implementing here by using the shell to try the default if the specified one returns an error. > } > if (cfg_noffset < 0) { > puts("Could not find configuration node\n"); Cheers, -Joe ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] serial: ns16550: Fix Debug UART initialization for AM335x
Hi Vasili, On 4 May 2015 at 12:04, Vasili Galka wrote: > Fixed the init sequence in debug_uart_init() to match the one in > NS16550_init(). Also, fixed the build by conditionally turning on some > of the required code. > > Signed-off-by: Vasili Galka > --- > drivers/serial/ns16550.c | 20 +++- > 1 file changed, 19 insertions(+), 1 deletion(-) Can you please check that you are using the latest mainline? > > diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c > index 03beab5..7af6bd8 100644 > --- a/drivers/serial/ns16550.c > +++ b/drivers/serial/ns16550.c > @@ -54,7 +54,7 @@ DECLARE_GLOBAL_DATA_PTR; > #define CONFIG_SYS_NS16550_IER 0x00 > #endif /* CONFIG_SYS_NS16550_IER */ > > -#ifdef CONFIG_DM_SERIAL > +#if defined(CONFIG_DM_SERIAL) || defined(CONFIG_DEBUG_UART_NS16550) > > static inline void serial_out_shift(unsigned char *addr, int shift, int > value) > { > @@ -85,6 +85,9 @@ static inline int serial_in_shift(unsigned char *addr, int > shift) > return readb(addr); > #endif > } > +#endif > + > +#if defined(CONFIG_DM_SERIAL) > > static void ns16550_writeb(NS16550_t port, int offset, int value) > { > @@ -255,6 +258,15 @@ void debug_uart_init(void) > CONFIG_BAUDRATE); > > serial_out_shift(&com_port->ier, 0, CONFIG_SYS_NS16550_IER); > +#if defined(CONFIG_OMAP) || defined(CONFIG_AM33XX) || \ > + defined(CONFIG_TI81XX) || defined(CONFIG_AM43XX) > + serial_out_shift(&com_port->mdr1, 0, 0x7); /* mode select reset > TL16C750*/ > +#endif > + serial_out_shift(&com_port->lcr, 0, UART_LCR_BKSE | UART_LCRVAL); > + serial_out_shift(&com_port->dll, 0, 0); > + serial_out_shift(&com_port->dlm, 0, 0); > + serial_out_shift(&com_port->lcr, 0, UART_LCRVAL); > + > serial_out_shift(&com_port->mcr, 0, UART_MCRVAL); > serial_out_shift(&com_port->fcr, 0, UART_FCRVAL); > > @@ -262,6 +274,12 @@ void debug_uart_init(void) > serial_out_shift(&com_port->dll, 0, baud_divisor & 0xff); > serial_out_shift(&com_port->dlm, 0, (baud_divisor >> 8) & 0xff); > serial_out_shift(&com_port->lcr, 0, UART_LCRVAL); > +#if defined(CONFIG_OMAP) || \ > + defined(CONFIG_AM33XX) || defined(CONFIG_SOC_DA8XX) || \ > + defined(CONFIG_TI81XX) || defined(CONFIG_AM43XX) > + /* /16 is proper to hit 115200 with 48MHz */ > + serial_out_shift(&com_port->mdr1, 0, 0); > +#endif /* CONFIG_OMAP */ > } > > static inline void _debug_uart_putc(int ch) > -- > 1.9.1 > Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] serial: ns16550: Fix Debug UART initialization for AM335x
Fixed the init sequence in debug_uart_init() to match the one in NS16550_init(). Also, fixed the build by conditionally turning on some of the required code. Signed-off-by: Vasili Galka --- drivers/serial/ns16550.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 03beab5..7af6bd8 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -54,7 +54,7 @@ DECLARE_GLOBAL_DATA_PTR; #define CONFIG_SYS_NS16550_IER 0x00 #endif /* CONFIG_SYS_NS16550_IER */ -#ifdef CONFIG_DM_SERIAL +#if defined(CONFIG_DM_SERIAL) || defined(CONFIG_DEBUG_UART_NS16550) static inline void serial_out_shift(unsigned char *addr, int shift, int value) { @@ -85,6 +85,9 @@ static inline int serial_in_shift(unsigned char *addr, int shift) return readb(addr); #endif } +#endif + +#if defined(CONFIG_DM_SERIAL) static void ns16550_writeb(NS16550_t port, int offset, int value) { @@ -255,6 +258,15 @@ void debug_uart_init(void) CONFIG_BAUDRATE); serial_out_shift(&com_port->ier, 0, CONFIG_SYS_NS16550_IER); +#if defined(CONFIG_OMAP) || defined(CONFIG_AM33XX) || \ + defined(CONFIG_TI81XX) || defined(CONFIG_AM43XX) + serial_out_shift(&com_port->mdr1, 0, 0x7); /* mode select reset TL16C750*/ +#endif + serial_out_shift(&com_port->lcr, 0, UART_LCR_BKSE | UART_LCRVAL); + serial_out_shift(&com_port->dll, 0, 0); + serial_out_shift(&com_port->dlm, 0, 0); + serial_out_shift(&com_port->lcr, 0, UART_LCRVAL); + serial_out_shift(&com_port->mcr, 0, UART_MCRVAL); serial_out_shift(&com_port->fcr, 0, UART_FCRVAL); @@ -262,6 +274,12 @@ void debug_uart_init(void) serial_out_shift(&com_port->dll, 0, baud_divisor & 0xff); serial_out_shift(&com_port->dlm, 0, (baud_divisor >> 8) & 0xff); serial_out_shift(&com_port->lcr, 0, UART_LCRVAL); +#if defined(CONFIG_OMAP) || \ + defined(CONFIG_AM33XX) || defined(CONFIG_SOC_DA8XX) || \ + defined(CONFIG_TI81XX) || defined(CONFIG_AM43XX) + /* /16 is proper to hit 115200 with 48MHz */ + serial_out_shift(&com_port->mdr1, 0, 0); +#endif /* CONFIG_OMAP */ } static inline void _debug_uart_putc(int ch) -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 12/24] arm: Allow cleanup_before_linux() without disabling caches
On Monday, May 04, 2015 at 07:49:16 PM, Simon Glass wrote: > Hi Marek, Hi Simon, > On 4 May 2015 at 11:36, Marek Vasut wrote: > > On Monday, May 04, 2015 at 07:31:05 PM, Simon Glass wrote: > >> This function is used before jumping to U-Boot, but in that case we > >> don't always want to disable caches. > >> > >> Signed-off-by: Simon Glass > >> Signed-off-by: Vadim Bendebury > > > > In which usecase exactly is this applicable please ? :) > > This is sort-of related to "Enable detecting when U-Boot is started > from SPL" so there are some details there. > > I was able to get SPL to enable the cache and leave it on all the way > through the verified boot flow (read-only and read-write U-Boot) and > it saved about 600ms. So in short this refactor allows you to jump > into U-Boot with the cache still enabled. Sounds good, thanks for clarifying ! Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [VOTING REQUIRED] Re: U-Boot mini summit
On Monday, May 04, 2015 at 05:31:36 PM, Wolfgang Denk wrote: > On Tue, 14 Apr 2015 Stefano Babic wrote: > > Hi everybody, > > > > there were some rumours about next U-Boot mini summit and why there is > > not yet a date. The reason is that we at DENX are thinking about, taking > > into account that the U-Boot community is steadily increased, which is > > the best location for the next summit. We know that a lot of you are in > > US or, generally, outside Europe and maybe it is time to ask everybody > > where the next summit will take place - and maybe the result will not be > > in Europe. > > > > Surely, the summit should be part of an Event organized by the Linux > > Foundation, and taking into account the embedded nature of the > > > > bootloader, there are two possible candidates: > > - ELCE in Dublin, 5-7 October 2015 > > - ELC in San Diego, 4-6 April 2016 > > > > Wolfgang has prepared a "doodle" survey to collect availability and > > preferences. Feel free to add your name to the event(s) you would like > > to participate. > > > > http://doodle.com/8mf8xhhbsugtirpa > > > > This survey runs until 10, May 2015 - after that we will know where to > > meet for the U-Boot summit. > > > > Thanks everybody for improving U-Boot ! > > > > Best regards, > > Stefano Babic > > I would like to point out that the poll will be ending on Sunday, > i. e. within less than a week, and so far we have just 16 votes, > or only 9 if we exclude the DENX team. > > This cannot be true? Is there really so little interest in a U-Boot > developer meeting? In this case we should probably consider not > doing such an event at all? Or just a tiny one at DENX ;-) > > Not even Tom and the majority of the custodians bothered to vote... > > Are you all sleeping? Hey, WAKE UP, this is YOUR event, if you want > to have it in a location which you can conveniently reach, then speak > up NOW! You can also add linuxcon japan into the mix next time :-) Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 01/24] usb: add device connection/disconnection detection
From: Vincent Palatin Provide a function to detect USB device insertion/removal in order to avoid having to do USB enumeration in a tight loop when trying to detect peripheral hotplugging. Signed-off-by: Vincent Palatin Reviewed-by: Stefan Reinauer Tested-by: Stefan Reinauer Signed-off-by: Simon Glass --- common/usb.c | 26 ++ common/usb_hub.c | 2 +- include/usb.h| 2 ++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/common/usb.c b/common/usb.c index a4820d3..bde8f31 100644 --- a/common/usb.c +++ b/common/usb.c @@ -148,6 +148,32 @@ int usb_stop(void) return 0; } +/** + * Detect if a USB device has been plugged or unplugged. + */ +int usb_detect_change(void) +{ + int i, j; + int change = 0; + + for (j = 0; j < USB_MAX_DEVICE; j++) { + for (i = 0; i < usb_dev[j].maxchild; i++) { + struct usb_port_status status; + + if (usb_get_port_status(&usb_dev[j], i + 1, + &status) < 0) + /* USB request failed */ + continue; + + if (le16_to_cpu(status.wPortChange) & + USB_PORT_STAT_C_CONNECTION) + change++; + } + } + + return change; +} + /* * disables the asynch behaviour of the control message. This is used for data * transfers that uses the exclusiv access to the control and bulk messages. diff --git a/common/usb_hub.c b/common/usb_hub.c index c9be530..bbed1c8 100644 --- a/common/usb_hub.c +++ b/common/usb_hub.c @@ -79,7 +79,7 @@ static int usb_get_hub_status(struct usb_device *dev, void *data) data, sizeof(struct usb_hub_status), USB_CNTL_TIMEOUT); } -static int usb_get_port_status(struct usb_device *dev, int port, void *data) +int usb_get_port_status(struct usb_device *dev, int port, void *data) { return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_PORT, 0, port, diff --git a/include/usb.h b/include/usb.h index 1984e8f..25dddb8 100644 --- a/include/usb.h +++ b/include/usb.h @@ -265,6 +265,7 @@ int usb_kbd_deregister(int force); /* routines */ int usb_init(void); /* initialize the USB Controller */ int usb_stop(void); /* stop the USB Controller */ +int usb_detect_change(void); /* detect if a USB device has been (un)plugged */ int usb_set_protocol(struct usb_device *dev, int ifnum, int protocol); @@ -290,6 +291,7 @@ int usb_get_class_descriptor(struct usb_device *dev, int ifnum, int usb_clear_halt(struct usb_device *dev, int pipe); int usb_string(struct usb_device *dev, int index, char *buf, size_t size); int usb_set_interface(struct usb_device *dev, int interface, int alternate); +int usb_get_port_status(struct usb_device *dev, int port, void *data); /* big endian -> little endian conversion */ /* some CPUs are already little endian e.g. the ARM920T */ -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 22/24] tegra: nyan-big: Allow TPM on I2C
On 05/04/2015 11:31 AM, Simon Glass wrote: Enable the I2C3 pins so that the TPM can be used. Can you please update the configuration in tegra-pinmux-scripts and the Linux kernel DT too, then? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 12/24] arm: Allow cleanup_before_linux() without disabling caches
Hi Marek, On 4 May 2015 at 11:36, Marek Vasut wrote: > On Monday, May 04, 2015 at 07:31:05 PM, Simon Glass wrote: >> This function is used before jumping to U-Boot, but in that case we don't >> always want to disable caches. >> >> Signed-off-by: Simon Glass >> Signed-off-by: Vadim Bendebury > > In which usecase exactly is this applicable please ? :) This is sort-of related to "Enable detecting when U-Boot is started from SPL" so there are some details there. I was able to get SPL to enable the cache and leave it on all the way through the verified boot flow (read-only and read-write U-Boot) and it saved about 600ms. So in short this refactor allows you to jump into U-Boot with the cache still enabled. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] powerpc/mpc85xx: Add board support for ucp1020
York, I did my best. :-) Thanks for your patching lessons. Regarding DDR "Raw timing" over "fixed" : No, I don't want to do any changes in this patch, at least now. Probably you notice CONFIG_SYS_DDR_RAW_TIMING is depended on CONFIG_DDR_ECC_ENABLE. And we have some customers would like to set it and some not. May be in a "near future" we will make some common way to do it and will send another patches, but for now we'd like to have u-boot support of our module publicly available with keeping both ways of DDR memory settings. Oleks On 05/04/2015 12:39 PM, York Sun wrote: Oleks, This patch is in much better shape. On 04/29/2015 01:57 PM, Oleksandr G Zhadan wrote: New QorIQ p1020 based board support from Arcturus Networks Inc. http://www.arcturusnetworks.com/products/ucp1020/ Signed-off-by: Michael Durrant Signed-off-by: Oleksandr G Zhadan Series-version: 2 Series-changes: 2 WARNINGs: line over 80 characters are fixed These tags should be removed (automatically by patman). For future patches, if you generate patchs manually, please add version number in subject and remove these tags, and put a change log under --- line. --- Change log goes here. --- /dev/null +++ b/board/Arcturus/ucp1020/ddr.c @@ -0,0 +1,161 @@ +/* + * Copyright 2013-2015 Arcturus Networks, Inc. + * http://www.arcturusnetworks.com/products/ucp1020/ + * based on board/freescale/p1_p2_rdb_pc/spl.c + * original copyright follows: + * Copyright 2013 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_SYS_DDR_RAW_TIMING +#if defined(CONFIG_UCP1020) || defined(CONFIG_UCP1020T1) +/* + * Micron MT41J128M16HA-15E + * */ +dimm_params_t ddr_raw_timing = { + .n_ranks = 1, + .rank_density = 536870912u, + .capacity = 536870912u, + .primary_sdram_width = 32, + .ec_sdram_width = 8, + .registered_dimm = 0, + .mirrored_dimm = 0, + .n_row_addr = 14, + .n_col_addr = 10, + .n_banks_per_sdram_device = 8, + .edc_config = 2, + .burst_lengths_bitmask = 0x0c, + + .tckmin_x_ps = 1650, + .caslat_x = 0x7e << 4,/* 5,6,7,8,9,10 */ + .taa_ps = 14050, + .twr_ps = 15000, + .trcd_ps = 13500, + .trrd_ps = 75000, + .trp_ps = 13500, + .tras_ps = 4, + .trc_ps = 49500, + .trfc_ps = 16, + .twtr_ps = 75000, + .trtp_ps = 75000, + .refresh_rate_ps = 780, + .tfaw_ps = 3, +}; + +#else +#error Missing raw timing data for this board +#endif + +int fsl_ddr_get_dimm_params(dimm_params_t *pdimm, + unsigned int controller_number, + unsigned int dimm_number) +{ + const char dimm_model[] = "Fixed DDR on board"; + + if ((controller_number == 0) && (dimm_number == 0)) { + memcpy(pdimm, &ddr_raw_timing, sizeof(dimm_params_t)); + memset(pdimm->mpart, 0, sizeof(pdimm->mpart)); + memcpy(pdimm->mpart, dimm_model, sizeof(dimm_model) - 1); + } + + return 0; +} +#endif /* CONFIG_SYS_DDR_RAW_TIMING */ Looks like you have raw timing parameters but you didn't use it. it is disabled in your UCP1020.h +#define CONFIG_DDR_ECC_ENABLE +#define CONFIG_SYS_FSL_DDR3 +#ifndef CONFIG_DDR_ECC_ENABLE +#define CONFIG_SYS_DDR_RAW_TIMING +#define CONFIG_DDR_SPD +#endif Raw timing is preferred over fixed parameters. It gives you flexibility to run DDR at different speeds. It is your board. I am not going to force you to pick either. Let me know if you want to update this patch. + +#ifdef CONFIG_SYS_DDR_CS0_BNDS +/* Fixed sdram init -- doesn't use serial presence detect. */ +phys_size_t fixed_sdram(void) +{ + sys_info_t sysinfo; + char buf[32]; + size_t ddr_size; + fsl_ddr_cfg_regs_t ddr_cfg_regs = { + .cs[0].bnds = CONFIG_SYS_DDR_CS0_BNDS, + .cs[0].config = CONFIG_SYS_DDR_CS0_CONFIG, + .cs[0].config_2 = CONFIG_SYS_DDR_CS0_CONFIG_2, +#if CONFIG_CHIP_SELECTS_PER_CTRL > 1 + .cs[1].bnds = CONFIG_SYS_DDR_CS1_BNDS, + .cs[1].config = CONFIG_SYS_DDR_CS1_CONFIG, + .cs[1].config_2 = CONFIG_SYS_DDR_CS1_CONFIG_2, +#endif + .timing_cfg_3 = CONFIG_SYS_DDR_TIMING_3, + .timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0, + .timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1, + .timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2, + .ddr_sdram_cfg = CONFIG_SYS_DDR_CONTROL, + .ddr_sdram_cfg_2 = CONFIG_SYS_DDR_CONTROL_2, + .ddr_sdram_mode = CONFIG_SYS_DDR_MODE_1, + .ddr_sdram_mode_2 = CONFIG_SYS_DDR_MODE_2, + .ddr_sdram_md_cntl = CONFIG_SYS_DDR_MODE_CONTROL, + .ddr_sdram_interval = CONFIG_SYS_DDR_INTERVAL, + .ddr_data_init = CONFIG_SYS_DDR_DATA_
[U-Boot] [PATCH 10/24] arm: Add a prototype for save_boot_params_ret()
It is convenient for some boards to implement save_boot_params() in C rather than assembler. Provide a way to return in this case. Signed-off-by: Simon Glass --- arch/arm/include/asm/system.h | 16 1 file changed, 16 insertions(+) diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 2a5bed2..e584c3b 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h @@ -158,6 +158,22 @@ void flush_l3_cache(void); * void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3); */ +/** + * save_boot_params_ret() - Return from save_boot_params() + * + * If you provide save_boot_params(), then you should jump back to this + * function when done. Try to preserve all registers. + * + * If your implementation of save_boot_params() is in C then it is acceptable + * to simply call save_boot_params_ret() at the end of your function. Since + * there is no link register set up, you cannot just exit the function. U-Boot + * will return to the (initialised) value of lr, and likely crash/hang. + * + * If your implementation of save_boot_params() is in assembler then you + * should use 'b' or 'bx' to return to save_boot_params_ret. + */ +void save_boot_params_ret(void); + #define isb() __asm__ __volatile__ ("" : : : "memory") #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 09/24] arm: Include the .got section in the binary
Commit 47ed5dd0 dropped the .got section from U-Boot binaries. This is needed for some relocations, and causes failures if missing. Add it back. Signed-off-by: Simon Glass --- arch/arm/config.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/config.mk b/arch/arm/config.mk index c005ce4..0550225 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -112,7 +112,8 @@ endif ifdef CONFIG_ARM64 OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn else -OBJCOPYFLAGS += -j .text -j .secure_text -j .rodata -j .hash -j .data -j .got.plt -j .u_boot_list -j .rel.dyn +OBJCOPYFLAGS += -j .text -j .secure_text -j .rodata -j .hash -j .data -j \ + .got -j .got.plt -j .u_boot_list -j .rel.dyn endif ifdef CONFIG_OF_EMBED -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 11/24] arm: spl: Enable detecting when U-Boot is started from SPL
For secure boot systems it is common to have a read-only U-Boot which starts the machine and jumps to a read-write U-Boot for actual booting the OS. This allows the read-write U-Boot to be upgraded without risk of permanently bricking the machine. In the event that the read-write U-Boot is corrupted, the read-only U-Boot can detect this with a checksum and boot into a recovery flow. To support this, add a way to detect when U-Boot is run from SPL as opposed to some other method, such as booted directly (no SPL) or started from another source (e.g. a primary U-Boot). This works by putting a special value in r0. For now we rely on board-specific code to actually check the register and set a flag. At some point this could be generalised, perhaps by using a spare register and passing a flag to _main and/or board_init_f(). Signed-off-by: Simon Glass --- include/spl.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/spl.h b/include/spl.h index b2e5bf7..cdd63a7 100644 --- a/include/spl.h +++ b/include/spl.h @@ -11,6 +11,8 @@ #include #include +/* Value in r0 indicates we booted from U-Boot */ +#define SPL_RUNNING_FROM_UBOOT 0x13578642 /* Boot type */ #define MMCSD_MODE_UNDEFINED 0 @@ -82,4 +84,15 @@ int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition); #ifdef CONFIG_SPL_BOARD_INIT void spl_board_init(void); #endif + +/** + * spl_was_boot_source() - check if U-Boot booted from SPL + * + * This will normally be true, but if U-Boot jumps to second U-Boot, it will + * be false. This should be implemented by board-specific code. + * + * @return true if U-Boot booted from SPL, else false + */ +bool spl_was_boot_source(void); + #endif -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 12/24] arm: Allow cleanup_before_linux() without disabling caches
On Monday, May 04, 2015 at 07:31:05 PM, Simon Glass wrote: > This function is used before jumping to U-Boot, but in that case we don't > always want to disable caches. > > Signed-off-by: Simon Glass > Signed-off-by: Vadim Bendebury In which usecase exactly is this applicable please ? :) Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 24/24] tegra124: Expand SPL space by 8KB
We are getting very close to running out of space in SPL, and with the currently Chrome OS gcc 4.9 we exceed the limit. Add a litle more space. Signed-off-by: Simon Glass --- include/configs/tegra124-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/configs/tegra124-common.h b/include/configs/tegra124-common.h index f2b3774..0347132 100644 --- a/include/configs/tegra124-common.h +++ b/include/configs/tegra124-common.h @@ -30,7 +30,7 @@ /*--- * Physical Memory Map */ -#define CONFIG_SYS_TEXT_BASE 0x8010E000 +#define CONFIG_SYS_TEXT_BASE 0x8011 /* * Memory layout for where various images get loaded by boot scripts: -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 15/24] sandbox: Add missing errno.h includes in a few files
These files use error numbering, so add the include. Signed-off-by: Simon Glass --- arch/sandbox/cpu/start.c | 1 + drivers/misc/i2c_eeprom_emul.c | 1 + drivers/misc/swap_case.c | 1 + 3 files changed, 3 insertions(+) diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index ec01040..0707256 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include diff --git a/drivers/misc/i2c_eeprom_emul.c b/drivers/misc/i2c_eeprom_emul.c index 7343445..4410d03 100644 --- a/drivers/misc/i2c_eeprom_emul.c +++ b/drivers/misc/i2c_eeprom_emul.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include diff --git a/drivers/misc/swap_case.c b/drivers/misc/swap_case.c index f6028ba..3b8aa48 100644 --- a/drivers/misc/swap_case.c +++ b/drivers/misc/swap_case.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 20/24] lcd: Support colour lookup table on 16bpp display in BMP images
For 16-bit-per-pixel displays it is useful to support 8 bit-per-pixel images to reduce image size. Add support for this when drawing BMP images. Signed-off-by: Simon Glass --- common/lcd.c | 23 --- include/bmp_layout.h | 4 ++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/common/lcd.c b/common/lcd.c index 055c366..2d11578 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -578,6 +578,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) unsigned long width, height, byte_width; unsigned long pwidth = panel_info.vl_col; unsigned colors, bpix, bmp_bpix; + int hdr_size; + bmp_color_table_entry_t *palette = bmp->color_table; if (!bmp || !(bmp->header.signature[0] == 'B' && bmp->header.signature[1] == 'M')) { @@ -589,6 +591,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) width = get_unaligned_le32(&bmp->header.width); height = get_unaligned_le32(&bmp->header.height); bmp_bpix = get_unaligned_le16(&bmp->header.bit_count); + hdr_size = get_unaligned_le16(&bmp->header.size); + debug("hdr_size=%d, bmp_bpix=%d\n", hdr_size, bmp_bpix); colors = 1 << bmp_bpix; @@ -613,8 +617,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) return 1; } - debug("Display-bmp: %d x %d with %d colors\n", - (int)width, (int)height, (int)colors); + debug("Display-bmp: %d x %d with %d colors, display %d\n", + (int)width, (int)height, (int)colors, 1 << bpix); if (bmp_bpix == 8) lcd_set_cmap(bmp, colors); @@ -641,6 +645,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) cmap_base = configuration_get_cmap(); #ifdef CONFIG_LCD_BMP_RLE8 u32 compression = get_unaligned_le32(&bmp->header.compression); + debug("compressed %d %d\n", compression, BMP_BI_RLE8); if (compression == BMP_BI_RLE8) { if (bpix != 16) { /* TODO implement render code for bpix != 16 */ @@ -663,7 +668,19 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) if (bpix != 16) { fb_put_byte(&fb, &bmap); } else { - *(uint16_t *)fb = cmap_base[*(bmap++)]; + struct bmp_color_table_entry *entry; + uint val; + + if (cmap_base) { + val = cmap_base[*bmap]; + } else { + entry = &palette[*bmap]; + val = entry->blue >> 3 | + entry->green >> 2 << 5 | + entry->red >> 3 << 11; + } + *(uint16_t *)fb = val; + bmap++; fb += sizeof(uint16_t) / sizeof(*fb); } } diff --git a/include/bmp_layout.h b/include/bmp_layout.h index 22b1fbc..47f505c 100644 --- a/include/bmp_layout.h +++ b/include/bmp_layout.h @@ -11,12 +11,12 @@ #ifndef _BMP_H_ #define _BMP_H_ -typedef struct bmp_color_table_entry { +typedef struct __packed bmp_color_table_entry { __u8blue; __u8green; __u8red; __u8reserved; -} __attribute__ ((packed)) bmp_color_table_entry_t; +} bmp_color_table_entry_t; /* When accessing these fields, remember that they are stored in little endian format, so use linux macros, e.g. le32_to_cpu(width) */ -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 23/24] tegra: mmc: Set the removable flag correctly
If the mmc device is non-removable (as indicated by the device tree), set the flag so that users of the device know. Signed-off-by: Simon Glass --- drivers/mmc/tegra_mmc.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/tegra_mmc.c b/drivers/mmc/tegra_mmc.c index 2cd8cf1..5c9c54a 100644 --- a/drivers/mmc/tegra_mmc.c +++ b/drivers/mmc/tegra_mmc.c @@ -528,7 +528,7 @@ static const struct mmc_ops tegra_mmc_ops = { .getcd = tegra_mmc_getcd, }; -static int do_mmc_init(int dev_index) +static int do_mmc_init(int dev_index, bool removable) { struct mmc_host *host; struct mmc *mmc; @@ -573,6 +573,7 @@ static int do_mmc_init(int dev_index) host->cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT; mmc = mmc_create(&host->cfg, host); + mmc->block_dev.removable = removable; if (mmc == NULL) return -1; @@ -586,7 +587,8 @@ static int do_mmc_init(int dev_index) * @param node Device index (0-3) * @param host Structure to fill in (reg, width, mmc_id) */ -static int mmc_get_config(const void *blob, int node, struct mmc_host *host) +static int mmc_get_config(const void *blob, int node, struct mmc_host *host, + bool *removablep) { debug("%s: node = %d\n", __func__, node); @@ -619,6 +621,7 @@ static int mmc_get_config(const void *blob, int node, struct mmc_host *host) GPIOD_IS_IN); gpio_request_by_name_nodev(blob, node, "power-gpios", 0, &host->pwr_gpio, GPIOD_IS_OUT); + *removablep = !fdtdec_get_bool(blob, node, "non-removable"); debug("%s: found controller at %p, width = %d, periph_id = %d\n", __func__, host->reg, host->width, host->mmc_id); @@ -636,6 +639,7 @@ static int mmc_get_config(const void *blob, int node, struct mmc_host *host) static int process_nodes(const void *blob, int node_list[], int count) { struct mmc_host *host; + bool removable; int i, node; debug("%s: count = %d\n", __func__, count); @@ -649,11 +653,11 @@ static int process_nodes(const void *blob, int node_list[], int count) host = &mmc_host[i]; host->id = i; - if (mmc_get_config(blob, node, host)) { + if (mmc_get_config(blob, node, host, &removable)) { printf("%s: failed to decode dev %d\n", __func__, i); return -1; } - do_mmc_init(i); + do_mmc_init(i, removable); } return 0; } -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 16/24] sandbox: cros_ec: Support EC_CMD_ENTERING_MODE emulation
Emualate this function which is used with Chrome OS verified boot. Signed-off-by: Simon Glass --- drivers/misc/cros_ec_sandbox.c | 2 ++ include/ec_commands.h | 15 +++ 2 files changed, 17 insertions(+) diff --git a/drivers/misc/cros_ec_sandbox.c b/drivers/misc/cros_ec_sandbox.c index df41e82..7509612 100644 --- a/drivers/misc/cros_ec_sandbox.c +++ b/drivers/misc/cros_ec_sandbox.c @@ -459,6 +459,8 @@ static int process_cmd(struct ec_state *ec, case EC_CMD_MKBP_STATE: len = cros_ec_keyscan(ec, resp_data); break; + case EC_CMD_ENTERING_MODE: + break; default: printf(" ** Unknown EC command %#02x\n", req_hdr->command); return -1; diff --git a/include/ec_commands.h b/include/ec_commands.h index 78baab1..7605066 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -1555,6 +1555,21 @@ struct ec_params_sb_wr_block { uint16_t data[32]; } __packed; +/* + * Entering Verified Boot Mode Command + * Default mode is VBOOT_MODE_NORMAL if EC did not receive this command. + * Valid Modes are: normal, developer, and recovery. + */ +#define EC_CMD_ENTERING_MODE 0xb6 + +struct ec_params_entering_mode { + int vboot_mode; +} __packed; + +#define VBOOT_MODE_NORMAL0 +#define VBOOT_MODE_DEVELOPER 1 +#define VBOOT_MODE_RECOVERY 2 + /*/ /* System commands */ -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 17/24] sandbox: spi: Add newline to printf() in sandbox_sf_probe
This printf() should have a newline at the end. Add it. Signed-off-by: Simon Glass --- drivers/mtd/spi/sandbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c index d576d31..895604d 100644 --- a/drivers/mtd/spi/sandbox.c +++ b/drivers/mtd/spi/sandbox.c @@ -129,7 +129,7 @@ static int sandbox_sf_probe(struct udevice *dev) } } if (cs == -1) { - printf("Error: Unknown chip select for device '%s'", + printf("Error: Unknown chip select for device '%s'\n", dev->name); return -EINVAL; } -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 22/24] tegra: nyan-big: Allow TPM on I2C
Enable the I2C3 pins so that the TPM can be used. Signed-off-by: Simon Glass --- board/nvidia/nyan-big/pinmux-config-nyan-big.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/nvidia/nyan-big/pinmux-config-nyan-big.h b/board/nvidia/nyan-big/pinmux-config-nyan-big.h index 9c5fbaa..ddf572f 100644 --- a/board/nvidia/nyan-big/pinmux-config-nyan-big.h +++ b/board/nvidia/nyan-big/pinmux-config-nyan-big.h @@ -234,8 +234,8 @@ static const struct pmux_pingrp_config nyan_big_pingrps[] = { PINCFG(SDMMC4_DAT6_PAA6, SDMMC4, UP, NORMAL, INPUT, DEFAULT, DEFAULT), PINCFG(SDMMC4_DAT7_PAA7, SDMMC4, UP, NORMAL, INPUT, DEFAULT, DEFAULT), PINCFG(PBB0, VGP6,DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), - PINCFG(CAM_I2C_SCL_PBB1, RSVD3, DOWN, TRISTATE, OUTPUT, DISABLE, DEFAULT), - PINCFG(CAM_I2C_SDA_PBB2, RSVD3, DOWN, TRISTATE, OUTPUT, DISABLE, DEFAULT), + PINCFG(CAM_I2C_SCL_PBB1, I2C3,NORMAL, NORMAL, INPUT, ENABLE, DEFAULT), + PINCFG(CAM_I2C_SDA_PBB2, I2C3,NORMAL, NORMAL, INPUT, ENABLE, DEFAULT), PINCFG(PBB3, VGP3,DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), PINCFG(PBB4, VGP4,DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), PINCFG(PBB5, RSVD3, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 21/24] tegra124: Implement spl_was_boot_source()
Add an implementation of this function for Tegra. Signed-off-by: Simon Glass --- arch/arm/mach-tegra/board.c | 16 1 file changed, 16 insertions(+) diff --git a/arch/arm/mach-tegra/board.c b/arch/arm/mach-tegra/board.c index 222de6a..77be211 100644 --- a/arch/arm/mach-tegra/board.c +++ b/arch/arm/mach-tegra/board.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -29,6 +30,21 @@ enum { UART_COUNT = 5, }; +static bool from_spl __attribute__ ((section(".data"))); + +#ifndef CONFIG_SPL_BUILD +void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3) +{ + from_spl = r0 != SPL_RUNNING_FROM_UBOOT; + save_boot_params_ret(); +} +#endif + +bool spl_was_boot_source(void) +{ + return from_spl; +} + #if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE) #if !defined(CONFIG_TEGRA124) #error tegra_cpu_is_non_secure has only been validated on Tegra124 -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 19/24] sandbox: Support wide-screen LCD emulation
Increase the LCD size to 1366x768. Signed-off-by: Simon Glass --- arch/sandbox/dts/sandbox.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sandbox/dts/sandbox.dts b/arch/sandbox/dts/sandbox.dts index efa2097..6bfa735 100644 --- a/arch/sandbox/dts/sandbox.dts +++ b/arch/sandbox/dts/sandbox.dts @@ -70,8 +70,8 @@ lcd { compatible = "sandbox,lcd-sdl"; - xres = <800>; - yres = <600>; + xres = <1366>; + yres = <768>; }; gpio_a: gpios@0 { -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 13/24] sandbox: Add an implementation for cleanup_before_linux_select()
Support this function so we can use Chrome OS verified boot with sandbox. Signed-off-by: Simon Glass --- arch/sandbox/cpu/cpu.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c index 168f2ef..4646f07 100644 --- a/arch/sandbox/cpu/cpu.c +++ b/arch/sandbox/cpu/cpu.c @@ -55,6 +55,11 @@ int cleanup_before_linux(void) return 0; } +int cleanup_before_linux_select(int flags) +{ + return 0; +} + void *map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags) { #ifdef CONFIG_PCI -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 18/24] sandbox: Fix warning in display_options
This fixes a warning in the print_buffer() function with some toolchains. Signed-off-by: Simon Glass --- lib/display_options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/display_options.c b/lib/display_options.c index d5d17b2..495a547 100644 --- a/lib/display_options.c +++ b/lib/display_options.c @@ -123,7 +123,7 @@ int print_buffer(ulong addr, const void *data, uint width, uint count, else x = lb.uc[i] = *(volatile uint8_t *)data; #ifdef CONFIG_SYS_SUPPORT_64BIT_DATA - printf(" %0*" PRIx64, width * 2, x); + printf(" %0*llx", width * 2, (long long)x); #else printf(" %0*x", width * 2, x); #endif -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 04/24] dm: i2c: Implement 'i2c bus' command for driver model
This command was missed in the conversion. Add it back for driver model. Signed-off-by: Simon Glass --- common/cmd_i2c.c | 63 +--- 1 file changed, 55 insertions(+), 8 deletions(-) diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c index ad38cbf..1bc0db8 100644 --- a/common/cmd_i2c.c +++ b/common/cmd_i2c.c @@ -1623,6 +1623,27 @@ int do_edid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) } #endif /* CONFIG_I2C_EDID */ +#ifdef CONFIG_DM_I2C +static void show_bus(struct udevice *bus) +{ + struct udevice *dev; + + printf("Bus %d:\t%s", bus->req_seq, bus->name); + if (device_active(bus)) + printf(" (active %d)", bus->seq); + printf("\n"); + for (device_find_first_child(bus, &dev); +dev; +device_find_next_child(&dev)) { + struct dm_i2c_chip *chip = dev_get_parent_platdata(dev); + + printf(" %02x: %s, offset len %x, flags %x\n", + chip->chip_addr, dev->name, chip->offset_len, + chip->flags); + } +} +#endif + /** * do_i2c_show_bus() - Handle the "i2c bus" command-line command * @cmdtp: Command data struct pointer @@ -1632,20 +1653,30 @@ int do_edid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) * * Returns zero always. */ -#if defined(CONFIG_SYS_I2C) +#if defined(CONFIG_SYS_I2C) || defined(CONFIG_DM_I2C) static int do_i2c_show_bus(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - int i; -#ifndef CONFIG_SYS_I2C_DIRECT_BUS - int j; -#endif - if (argc == 1) { /* show all busses */ +#ifdef CONFIG_DM_I2C + struct udevice *bus; + struct uclass *uc; + int ret; + + ret = uclass_get(UCLASS_I2C, &uc); + if (ret) + return CMD_RET_FAILURE; + uclass_foreach_dev(bus, uc) + show_bus(bus); +#else + int i; + for (i = 0; i < CONFIG_SYS_NUM_I2C_BUSES; i++) { printf("Bus %d:\t%s", i, I2C_ADAP_NR(i)->name); #ifndef CONFIG_SYS_I2C_DIRECT_BUS + int j; + for (j = 0; j < CONFIG_SYS_I2C_MAX_HOPS; j++) { if (i2c_bus[i].next_hop[j].chip == 0) break; @@ -1657,15 +1688,30 @@ static int do_i2c_show_bus(cmd_tbl_t *cmdtp, int flag, int argc, #endif printf("\n"); } +#endif } else { + int i; + /* show specific bus */ i = simple_strtoul(argv[1], NULL, 10); +#ifdef CONFIG_DM_I2C + struct udevice *bus; + int ret; + + ret = uclass_get_device_by_seq(UCLASS_I2C, i, &bus); + if (ret) { + printf("Invalid bus %d: err=%d\n", i, ret); + return CMD_RET_FAILURE; + } + show_bus(bus); +#else if (i >= CONFIG_SYS_NUM_I2C_BUSES) { printf("Invalid bus %d\n", i); return -1; } printf("Bus %d:\t%s", i, I2C_ADAP_NR(i)->name); #ifndef CONFIG_SYS_I2C_DIRECT_BUS + int j; for (j = 0; j < CONFIG_SYS_I2C_MAX_HOPS; j++) { if (i2c_bus[i].next_hop[j].chip == 0) break; @@ -1676,6 +1722,7 @@ static int do_i2c_show_bus(cmd_tbl_t *cmdtp, int flag, int argc, } #endif printf("\n"); +#endif } return 0; @@ -1835,7 +1882,7 @@ static int do_i2c_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv } static cmd_tbl_t cmd_i2c_sub[] = { -#if defined(CONFIG_SYS_I2C) +#if defined(CONFIG_SYS_I2C) || defined(CONFIG_DM_I2C) U_BOOT_CMD_MKENT(bus, 1, 1, do_i2c_show_bus, "", ""), #endif U_BOOT_CMD_MKENT(crc32, 3, 1, do_i2c_crc, "", ""), @@ -1902,7 +1949,7 @@ static int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) /***/ #ifdef CONFIG_SYS_LONGHELP static char i2c_help_text[] = -#if defined(CONFIG_SYS_I2C) +#if defined(CONFIG_SYS_I2C) || defined(CONFIG_DM_I2C) "bus [muxtype:muxaddr:muxchannel] - show I2C bus info\n" #endif "crc32 chip address[.0, .1, .2] count - compute CRC32 checksum\n" -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 07/24] tpm: Rename Infineon TPM to slb9645tt
This name is used in Linux, so use it in U-Boot. Signed-off-by: Simon Glass --- arch/arm/dts/exynos5420-peach-pit.dts | 2 +- arch/arm/dts/exynos5800-peach-pi.dts | 2 +- lib/fdtdec.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/dts/exynos5420-peach-pit.dts b/arch/arm/dts/exynos5420-peach-pit.dts index 7d8fa28..6fe762d 100644 --- a/arch/arm/dts/exynos5420-peach-pit.dts +++ b/arch/arm/dts/exynos5420-peach-pit.dts @@ -79,7 +79,7 @@ i2c@12e1 { /* i2c9 */ clock-frequency = <40>; tpm@20 { -compatible = "infineon,slb9645-tpm"; +compatible = "infineon,slb9645tt"; reg = <0x20>; }; }; diff --git a/arch/arm/dts/exynos5800-peach-pi.dts b/arch/arm/dts/exynos5800-peach-pi.dts index 8c1f616..176ce55 100644 --- a/arch/arm/dts/exynos5800-peach-pi.dts +++ b/arch/arm/dts/exynos5800-peach-pi.dts @@ -72,7 +72,7 @@ i2c@12e1 { /* i2c9 */ clock-frequency = <40>; tpm@20 { -compatible = "infineon,slb9645-tpm"; +compatible = "infineon,slb9645tt"; reg = <0x20>; }; }; diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 14984b7..30573c2 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -65,7 +65,7 @@ static const char * const compat_names[COMPAT_COUNT] = { COMPAT(GENERIC_SPI_FLASH, "spi-flash"), COMPAT(MAXIM_98095_CODEC, "maxim,max98095-codec"), COMPAT(INFINEON_SLB9635_TPM, "infineon,slb9635-tpm"), - COMPAT(INFINEON_SLB9645_TPM, "infineon,slb9645-tpm"), + COMPAT(INFINEON_SLB9645_TPM, "infineon,slb9645tt"), COMPAT(SAMSUNG_EXYNOS5_I2C, "samsung,exynos5-hsi2c"), COMPAT(SANDBOX_LCD_SDL, "sandbox,lcd-sdl"), COMPAT(TI_TPS65090, "ti,tps65090"), -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 08/24] dm: gpio: Fix comment typo in GPIOD_IS_IN
This should say 'in', not 'out'. Signed-off-by: Simon Glass --- include/asm-generic/gpio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 4752ea4..519bb0b 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -115,7 +115,7 @@ struct gpio_desc { unsigned long flags; #define GPIOD_REQUESTED(1 << 0)/* Requested/claimed */ #define GPIOD_IS_OUT (1 << 1)/* GPIO is an output */ -#define GPIOD_IS_IN(1 << 2)/* GPIO is an output */ +#define GPIOD_IS_IN(1 << 2)/* GPIO is an input */ #define GPIOD_ACTIVE_LOW (1 << 3)/* value has active low */ #define GPIOD_IS_OUT_ACTIVE(1 << 4)/* set output active */ -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 05/24] dm: i2c: Add a function to find out the chip offset length
We can currently set this but there is no API function to get it. Add one. Signed-off-by: Simon Glass --- drivers/i2c/i2c-uclass.c | 7 +++ include/i2c.h| 9 - 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/i2c-uclass.c b/drivers/i2c/i2c-uclass.c index f2e95c0..2dfb435 100644 --- a/drivers/i2c/i2c-uclass.c +++ b/drivers/i2c/i2c-uclass.c @@ -396,6 +396,13 @@ int i2c_set_chip_offset_len(struct udevice *dev, uint offset_len) return 0; } +int i2c_get_chip_offset_len(struct udevice *dev) +{ + struct dm_i2c_chip *chip = dev_get_parent_platdata(dev); + + return chip->offset_len; +} + int i2c_deblock(struct udevice *bus) { struct dm_i2c_ops *ops = i2c_get_ops(bus); diff --git a/include/i2c.h b/include/i2c.h index 6fd73fa..9a9e4f7 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -171,8 +171,15 @@ int i2c_get_chip_flags(struct udevice *dev, uint *flagsp); * * @offset_len:New offset length value (typically 1 or 2) */ - int i2c_set_chip_offset_len(struct udevice *dev, uint offset_len); + +/** + * i2c_get_offset_len() - get the offset length for a chip + * + * @return:Current offset length value (typically 1 or 2) + */ +int i2c_get_chip_offset_len(struct udevice *dev); + /** * i2c_deblock() - recover a bus that is in an unknown state * -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 02/24] dm: usb: Implement usb_detect_change() for driver model
Support this function with driver model also (CONFIG_DM_USB). Signed-off-by: Simon Glass --- drivers/usb/host/usb-uclass.c | 43 +++ 1 file changed, 43 insertions(+) diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c index 714bc0e..8445a42 100644 --- a/drivers/usb/host/usb-uclass.c +++ b/drivers/usb/host/usb-uclass.c @@ -555,6 +555,49 @@ int usb_scan_device(struct udevice *parent, int port, return 0; } +/* + * Detect if a USB device has been plugged or unplugged. + */ +int usb_detect_change(void) +{ + struct udevice *hub; + struct uclass *uc; + int change = 0; + int ret; + + ret = uclass_get(UCLASS_USB_HUB, &uc); + if (ret) + return ret; + + uclass_foreach_dev(hub, uc) { + struct usb_device *udev; + struct udevice *dev; + + if (!device_active(hub)) + continue; + for (device_find_first_child(hub, &dev); +dev; +device_find_next_child(&dev)) { + struct usb_port_status status; + + if (!device_active(hub)) + continue; + + udev = dev_get_parentdata(hub); + if (usb_get_port_status(udev, udev->portnr, &status) + < 0) + /* USB request failed */ + continue; + + if (le16_to_cpu(status.wPortChange) & + USB_PORT_STAT_C_CONNECTION) + change++; + } + } + + return change; +} + int usb_child_post_bind(struct udevice *dev) { struct usb_dev_platdata *plat = dev_get_parent_platdata(dev); -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 14/24] sandbox: Correct error handling in state_read_file()
This function should return a useful error for U-Boot, rather than -1. Signed-off-by: Simon Glass --- arch/sandbox/cpu/state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c index 033958c..cae731c 100644 --- a/arch/sandbox/cpu/state.c +++ b/arch/sandbox/cpu/state.c @@ -51,7 +51,7 @@ static int state_read_file(struct sandbox_state *state, const char *fname) ret = os_get_filesize(fname, &size); if (ret < 0) { printf("Cannot find sandbox state file '%s'\n", fname); - return ret; + return -ENOENT; } state->state_fdt = os_malloc(size); if (!state->state_fdt) { -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 03/24] bootstage: Add IDs for SPI flash reading and decompression
We maintain an accumulator for time spent reading from SPI flash, since this can be significant on some platforms. Also add one for decompression time. Signed-off-by: Simon Glass --- include/bootstage.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/bootstage.h b/include/bootstage.h index be44014..fe30ab6 100644 --- a/include/bootstage.h +++ b/include/bootstage.h @@ -195,6 +195,8 @@ enum bootstage_id { BOOTSTAGE_ID_ACCUM_LCD, BOOTSTAGE_ID_ACCUM_SCSI, + BOOTSTAGE_ID_ACCUM_SPI, + BOOTSTAGE_ID_ACCUM_DECOMP, /* a few spare for the user, from here */ BOOTSTAGE_ID_USER, -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 06/24] tpm: Support using driver model with I2C
As a first step towards converting the TPM system to driver model, allow it to work with CONFIG_DM_I2C. Signed-off-by: Simon Glass --- drivers/tpm/tpm.c | 89 +- drivers/tpm/tpm_private.h | 3 ++ drivers/tpm/tpm_tis_i2c.c | 134 +++--- 3 files changed, 170 insertions(+), 56 deletions(-) diff --git a/drivers/tpm/tpm.c b/drivers/tpm/tpm.c index 31761ec..a650892 100644 --- a/drivers/tpm/tpm.c +++ b/drivers/tpm/tpm.c @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -48,10 +49,14 @@ DECLARE_GLOBAL_DATA_PTR; /* TPM configuration */ struct tpm { +#ifdef CONFIG_DM_I2C + struct udevice *dev; +#else int i2c_bus; int slave_addr; - char inited; int old_bus; +#endif + char inited; } tpm; /* Global structure for tpm chip data */ @@ -372,7 +377,7 @@ static unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip, static ssize_t tpm_transmit(const unsigned char *buf, size_t bufsiz) { - ssize_t rc; + int rc; u32 count, ordinal; unsigned long start, stop; @@ -391,9 +396,11 @@ static ssize_t tpm_transmit(const unsigned char *buf, size_t bufsiz) return -E2BIG; } + debug("Calling send\n"); rc = chip->vendor.send(chip, (u8 *)buf, count); + debug(" ... done calling send\n"); if (rc < 0) { - error("tpm_transmit: tpm_send: error %zd\n", rc); + error("tpm_transmit: tpm_send: error %d\n", rc); goto out; } @@ -403,7 +410,7 @@ static ssize_t tpm_transmit(const unsigned char *buf, size_t bufsiz) start = get_timer(0); stop = tpm_calc_ordinal_duration(chip, ordinal); do { - debug("waiting for status...\n"); + debug("waiting for status... %ld %ld\n", start, stop); u8 status = chip->vendor.status(chip); if ((status & chip->vendor.req_complete_mask) == chip->vendor.req_complete_val) { @@ -428,15 +435,30 @@ out_recv: debug("out_recv: reading response...\n"); rc = chip->vendor.recv(chip, (u8 *)buf, TPM_BUFSIZE); if (rc < 0) - error("tpm_transmit: tpm_recv: error %zd\n", rc); + error("tpm_transmit: tpm_recv: error %d\n", rc); out: return rc; } +#ifdef CONFIG_DM_I2C +static int tpm_open_dev(struct udevice *dev) +{ + int rc; + + debug("%s: start\n", __func__); + if (g_chip.is_open) + return -EBUSY; + rc = tpm_vendor_init_dev(dev); + if (rc < 0) + g_chip.is_open = 0; + return rc; +} +#else static int tpm_open(uint32_t dev_addr) { int rc; + if (g_chip.is_open) return -EBUSY; rc = tpm_vendor_init(dev_addr); @@ -444,7 +466,7 @@ static int tpm_open(uint32_t dev_addr) g_chip.is_open = 0; return rc; } - +#endif static void tpm_close(void) { if (g_chip.is_open) { @@ -455,6 +477,7 @@ static void tpm_close(void) static int tpm_select(void) { +#ifndef CONFIG_DM_I2C int ret; tpm.old_bus = i2c_get_bus_num(); @@ -466,11 +489,13 @@ static int tpm_select(void) return -1; } } +#endif return 0; } static int tpm_deselect(void) { +#ifndef CONFIG_DM_I2C int ret; if (tpm.old_bus != i2c_get_bus_num()) { @@ -482,6 +507,7 @@ static int tpm_deselect(void) } } tpm.old_bus = -1; +#endif return 0; } @@ -493,10 +519,9 @@ static int tpm_deselect(void) */ static int tpm_decode_config(struct tpm *dev) { -#ifdef CONFIG_OF_CONTROL const void *blob = gd->fdt_blob; - int node, parent; - int i2c_bus; + int parent; + int node; node = fdtdec_next_compatible(blob, 0, COMPAT_INFINEON_SLB9635_TPM); if (node < 0) { @@ -512,15 +537,48 @@ static int tpm_decode_config(struct tpm *dev) debug("%s: Cannot find node parent\n", __func__); return -1; } +#ifdef CONFIG_DM_I2C + struct udevice *bus; + int chip_addr; + int ret; + + /* +* TODO(s...@chromium.org): Remove this when driver model supports +* TPMs +*/ + ret = uclass_get_device_by_of_offset(UCLASS_I2C, parent, &bus); + if (ret) { + debug("Cannot find bus for node '%s: ret=%d'\n", + fdt_get_name(blob, parent, NULL), ret); + return ret; + } + + chip_addr = fdtdec_get_int(blob, node, "reg", -1); + if (chip_addr == -1) { + debug("Cannot find reg property for node '%s: ret=%d'\n", + fdt_get_name(blob, node, NULL), ret); + return ret; + } + /* +* TODO(s...@chromium.org): Older TPMs will need to use
[U-Boot] [PATCH 12/24] arm: Allow cleanup_before_linux() without disabling caches
This function is used before jumping to U-Boot, but in that case we don't always want to disable caches. Signed-off-by: Simon Glass Signed-off-by: Vadim Bendebury --- arch/arm/cpu/armv7/cpu.c | 47 +-- include/common.h | 15 +++ 2 files changed, 44 insertions(+), 18 deletions(-) diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c index c56417d..0b0e500 100644 --- a/arch/arm/cpu/armv7/cpu.c +++ b/arch/arm/cpu/armv7/cpu.c @@ -24,7 +24,7 @@ void __weak cpu_cache_initialization(void){} -int cleanup_before_linux(void) +int cleanup_before_linux_select(int flags) { /* * this function is called just before we call linux @@ -42,24 +42,30 @@ int cleanup_before_linux(void) icache_disable(); invalidate_icache_all(); - /* -* turn off D-cache -* dcache_disable() in turn flushes the d-cache and disables MMU -*/ - dcache_disable(); - v7_outer_cache_disable(); + if (flags & CBL_DISABLE_CACHES) { + /* + * turn off D-cache + * dcache_disable() in turn flushes the d-cache and disables MMU + */ + dcache_disable(); + v7_outer_cache_disable(); - /* -* After D-cache is flushed and before it is disabled there may -* be some new valid entries brought into the cache. We are sure -* that these lines are not dirty and will not affect our execution. -* (because unwinding the call-stack and setting a bit in CP15 SCTLR -* is all we did during this. We have not pushed anything on to the -* stack. Neither have we affected any static data) -* So just invalidate the entire d-cache again to avoid coherency -* problems for kernel -*/ - invalidate_dcache_all(); + /* + * After D-cache is flushed and before it is disabled there may + * be some new valid entries brought into the cache. We are + * sure that these lines are not dirty and will not affect our + * execution. (because unwinding the call-stack and setting a + * bit in CP15 SCTRL is all we did during this. We have not + * pushed anything on to the stack. Neither have we affected + * any static data) So just invalidate the entire d-cache again + * to avoid coherency problems for kernel + */ + invalidate_dcache_all(); + } else { + flush_dcache_all(); + invalidate_icache_all(); + icache_enable(); + } /* * Some CPU need more cache attention before starting the kernel. @@ -68,3 +74,8 @@ int cleanup_before_linux(void) return 0; } + +int cleanup_before_linux(void) +{ + return cleanup_before_linux_select(CBL_ALL); +} diff --git a/include/common.h b/include/common.h index cde3474..0b21599 100644 --- a/include/common.h +++ b/include/common.h @@ -728,6 +728,21 @@ void invalidate_dcache_range(unsigned long start, unsigned long stop); void invalidate_dcache_all(void); void invalidate_icache_all(void); +enum { + /* Disable caches (else flush caches but leave them active) */ + CBL_DISABLE_CACHES = 1 << 0, + CBL_SHOW_BOOTSTAGE_REPORT = 1 << 1, + + CBL_ALL = 3, +}; + +/** + * Clean up ready for linux + * + * @param flagsFlags to control what is done + */ +int cleanup_before_linux_select(int flags); + /* arch/$(ARCH)/lib/ticks.S */ uint64_t get_ticks(void); void wait_ticks(unsigned long); -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 00/24] Collected fixes and improvements
This series contains a hodge-podge of minor fixes and improvements in various areas. They were found while adjusting mainline Nyan-big to work with Chrome OS verified boot. Rather than send a large number of individual patches I decide to collect them into a series. They should all be independent so can be applied without coordination. Sample of areas covered: - Detect a USB device being connected/disconnected - TPM support with CONFIG_DM_I2C - Detect when U-Boot is started from SPL - ARM binary output and boot tweaks - Small LCD BMP-drawing improvement - Tegra removable MMC support - Various small nits in driver model, sandbox, etc. Simon Glass (23): dm: usb: Implement usb_detect_change() for driver model bootstage: Add IDs for SPI flash reading and decompression dm: i2c: Implement 'i2c bus' command for driver model dm: i2c: Add a function to find out the chip offset length tpm: Support using driver model with I2C tpm: Rename Infineon TPM to slb9645tt dm: gpio: Fix comment typo in GPIOD_IS_IN arm: Include the .got section in the binary arm: Add a prototype for save_boot_params_ret() arm: spl: Enable detecting when U-Boot is started from SPL arm: Allow cleanup_before_linux() without disabling caches sandbox: Add an implementation for cleanup_before_linux_select() sandbox: Correct error handling in state_read_file() sandbox: Add missing errno.h includes in a few files sandbox: cros_ec: Support EC_CMD_ENTERING_MODE emulation sandbox: spi: Add newline to printf() in sandbox_sf_probe sandbox: Fix warning in display_options sandbox: Support wide-screen LCD emulation lcd: Support colour lookup table on 16bpp display in BMP images tegra124: Implement spl_was_boot_source() tegra: nyan-big: Allow TPM on I2C tegra: mmc: Set the removable flag correctly tegra124: Expand SPL space by 8KB Vincent Palatin (1): usb: add device connection/disconnection detection arch/arm/config.mk | 3 +- arch/arm/cpu/armv7/cpu.c | 47 + arch/arm/dts/exynos5420-peach-pit.dts | 2 +- arch/arm/dts/exynos5800-peach-pi.dts | 2 +- arch/arm/include/asm/system.h | 16 +++ arch/arm/mach-tegra/board.c| 16 +++ arch/sandbox/cpu/cpu.c | 5 + arch/sandbox/cpu/start.c | 1 + arch/sandbox/cpu/state.c | 2 +- arch/sandbox/dts/sandbox.dts | 4 +- board/nvidia/nyan-big/pinmux-config-nyan-big.h | 4 +- common/cmd_i2c.c | 63 ++-- common/lcd.c | 23 - common/usb.c | 26 + common/usb_hub.c | 2 +- drivers/i2c/i2c-uclass.c | 7 ++ drivers/misc/cros_ec_sandbox.c | 2 + drivers/misc/i2c_eeprom_emul.c | 1 + drivers/misc/swap_case.c | 1 + drivers/mmc/tegra_mmc.c| 12 ++- drivers/mtd/spi/sandbox.c | 2 +- drivers/tpm/tpm.c | 89 +--- drivers/tpm/tpm_private.h | 3 + drivers/tpm/tpm_tis_i2c.c | 134 + drivers/usb/host/usb-uclass.c | 43 include/asm-generic/gpio.h | 2 +- include/bmp_layout.h | 4 +- include/bootstage.h| 2 + include/common.h | 15 +++ include/configs/tegra124-common.h | 2 +- include/ec_commands.h | 15 +++ include/i2c.h | 9 +- include/spl.h | 13 +++ include/usb.h | 2 + lib/display_options.c | 2 +- lib/fdtdec.c | 2 +- 36 files changed, 472 insertions(+), 106 deletions(-) -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 0/1] dm: usb: Copy over usb_device values from usb_scan_device() to final usb_device
Hi Hans, On 4 May 2015 at 11:19, Hans de Goede wrote: > Hi Simon, > > Here is v3 of my patch to fix the maxpacketsize0 not being set issue I > found and related issues. > > I've added a big fat comment to explain that the usb_device pointer is a > hack and should not be used outside of usb-uclass.c as requested. > > I hope this version is to your liking and you can ack it. > > Assuming that you do ack it, then my entire dm-usb fixes + ehci set is > all acked, and the question becomes how to take uit upstream, I can take > the entire set upstream through the sunxi tree, or you can take it > upstream through the dm tree. Let me know which way you prefer to move > forward with this. I should probably take it through DM. I'll do a pull request once the x86 pull request goes in. But I'm still not sure how it is safe to pass a pointer to a local stack variable out through another function. Can you please explain that? Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] AM335x configurations - console output at early stages lost
On 4 May 2015 at 11:17, Vasili Galka wrote: > Hi Simon, > > On Mon, May 4, 2015 at 7:52 PM, Vasili Galka wrote: >> >> Hi Simon, >> >> >> On Mon, May 4, 2015 at 7:45 PM, Simon Glass wrote: >>> >>> Hi Vasili, >>> >>> On 4 May 2015 at 10:21, Vasili Galka wrote: >>> > >>> > Hi Simon, >>> > >>> > On Thu, Apr 30, 2015 at 3:38 AM, Simon Glass wrote: >>> >> >>> >> Hi Vasili, >>> >> >>> >> On 29 April 2015 at 10:57, Vasili Galka wrote: >>> >> > Hi Tom, >>> >> > >>> >> > I’m working on rebasing an old U-Boot branch for our company’s >>> >> > AM335x >>> >> > based board upon the current U-Boot release (v2015.04). Our branch >>> >> > was >>> >> > initially based on the v2013.10 release (the ti/am335x/ board was >>> >> > taken as reference). >>> >> > >>> >> > After making all the code compile, I discovered there was a change >>> >> > in >>> >> > the U-Boot initialization sequence, introduced by commit >>> >> > a6b541b09022acb6f7c2754100ae26bd44eed1d9, that prevents our code >>> >> > from >>> >> > working: >>> >> > >>> >> > Prior to the above mentioned commit, the console serial port was >>> >> > initialized at a very early stage in the >>> >> > armv7/am335x/board.c:s_init() >>> >> > function (calling preloader_console_init()). Roughly saying, it was >>> >> > the first thing done by the SPL code. This made quite much sense, as >>> >> > it enabled all the code afterwards to output status/debugging info >>> >> > to >>> >> > the console. >>> >> > Moving the preloader_console_init() call to spl_board_init() caused >>> >> > it >>> >> > to be run at a very "late" stage (as part of the board_init_r() >>> >> > function). AFAIU, now all the code that runs till then has no >>> >> > ability >>> >> > for any console output. >>> >> > For example, in our particular case, the DDR configuration code (in >>> >> > sdram_init()) reads the DDR type from an I2C EEPROM. Obviously, if >>> >> > something goes wrong in this process, we would like to report it to >>> >> > the console. >>> >> > >>> >> > I understand there was a good reason for the mentioned commit (the >>> >> > GD), however, as you see, we have also lost some important >>> >> > functionality with it. I would appreciate your advice on how to >>> >> > solve >>> >> > it. >>> >> >>> >> It would certainly be very useful and it would be great if we could >>> >> printf() from as soon as we have a stack (and perhaps printch() even >>> >> earlier). I think it can be done, but I have not put in the time to >>> >> figure it out. >>> >> >>> >> You could take a look at CONFIG_DEBUG_UART which at least allows >>> >> primitive UART access before gd is set up. I wonder if we could do >>> >> something like change printf() /purchatr() to use this when gd is >>> >> NULL? >>> >> >>> >> Regards, >>> >> Simon >>> > >>> > >>> > Thanks for the suggestion! I'm attempting to make it work. >>> > Was the "Debug UART" code (added in >>> > 21d004368fc8a4da07147c58dfe9a4e16d4ab761) ever tested on AM335x? It does >>> > not >>> > seem to work for me, I'm currently debugging in attempt to understand the >>> > cause. >>> >>> From memory I think I did test it locally but did not send patches to >>> enable it. >>> >>> You will need to enable DEBUG_UART_NS16550, and supply suitable values >>> for DEBUG_UART_BASE and DEBUG_UART_CLOCK. >>> >>> But the debug UART code (in ns16550.c) is really simple so it should >>> not be possible to debug it. >>> >>> I think it would be good to have the DEBUG_UART_... options in the >>> board's defconfig file, even though CONFIG_DEBUG_UART itself is >>> disabled. Then people can enable it easily when they want to use the >>> debug UART. >>> >>> Regards, >>> Simon >> >> >> Yes, of course, please see below the changes I applied. I expected to see >> a character written on to the UART, but I see nothing. So I attempt to >> compare the new serial code to the old one (from 2013) that definitely >> works. >> >> Best, >> Vasili >> >> ... > > > I've altered the debug_uart_init() to mimic the behaviour of NS16550_init() > more closely and it fixed the problem. I'll send a clean patch shortly. Great! The code is a bit of a mess, hoping we can simplify it once everything moves to driver model. - Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 0/1] dm: usb: Copy over usb_device values from usb_scan_device() to final usb_device
Hi Simon, Here is v3 of my patch to fix the maxpacketsize0 not being set issue I found and related issues. I've added a big fat comment to explain that the usb_device pointer is a hack and should not be used outside of usb-uclass.c as requested. I hope this version is to your liking and you can ack it. Assuming that you do ack it, then my entire dm-usb fixes + ehci set is all acked, and the question becomes how to take uit upstream, I can take the entire set upstream through the sunxi tree, or you can take it upstream through the dm tree. Let me know which way you prefer to move forward with this. Regards, Hans ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3] dm: usb: Copy over usb_device values from usb_scan_device() to final usb_device
Currently we copy over a number of usb_device values stored in the on stack struct usb_device probed in usb_scan_device() to the final driver-model managed struct usb_device in usb_child_pre_probe() through usb_device_platdata, and then call usb_select_config() to fill in the rest. There are 3 problems with this approach: 1) It does not fill in enough fields before calling usb_select_config(), specifically it does not fill in ep0's maxpacketsize causing a div by zero exception in the ehci driver. 2) It unnecessarily redoes a number of usb requests making usb probing slower 3) Calling usb_select_config() a second time fails on some usb-1 devices plugged into usb-2 hubs, causing u-boot to not recognize these devices. This commit fixes these issues by removing the usb_select_config() call from usb_child_pre_probe(), and instead of copying over things field by field through usb_device_platdata, store a pointer to the in stack usb_device (which is still valid when usb_child_pre_probe() gets called) and copy over the entire struct. Signed-off-by: Hans de Goede --- drivers/usb/host/usb-uclass.c | 30 +- include/usb.h | 19 ++- 2 files changed, 19 insertions(+), 30 deletions(-) diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c index 714bc0e..c25db2f 100644 --- a/drivers/usb/host/usb-uclass.c +++ b/drivers/usb/host/usb-uclass.c @@ -535,12 +535,7 @@ int usb_scan_device(struct udevice *parent, int port, } plat = dev_get_parent_platdata(dev); debug("%s: Probing '%s', plat=%p\n", __func__, dev->name, plat); - plat->devnum = udev->devnum; - plat->speed = udev->speed; - plat->slot_id = udev->slot_id; - plat->portnr = port; - debug("** device '%s': stashing slot_id=%d\n", dev->name, - plat->slot_id); + plat->udev = udev; priv->next_addr++; ret = device_probe(dev); if (ret) { @@ -599,25 +594,18 @@ int usb_get_bus(struct udevice *dev, struct udevice **busp) int usb_child_pre_probe(struct udevice *dev) { - struct udevice *bus; struct usb_device *udev = dev_get_parentdata(dev); struct usb_dev_platdata *plat = dev_get_parent_platdata(dev); - int ret; - ret = usb_get_bus(dev, &bus); - if (ret) - return ret; - udev->controller_dev = bus; - udev->dev = dev; - udev->devnum = plat->devnum; - udev->slot_id = plat->slot_id; - udev->portnr = plat->portnr; - udev->speed = plat->speed; - debug("** device '%s': getting slot_id=%d\n", dev->name, plat->slot_id); + /* +* Copy over all the values set in the on stack struct usb_device in +* usb_scan_device() to our final struct usb_device for this dev. +*/ + *udev = *(plat->udev); + /* And clear plat->udev as it will not be valid for long */ + plat->udev = NULL; - ret = usb_select_config(udev); - if (ret) - return ret; + udev->dev = dev; return 0; } diff --git a/include/usb.h b/include/usb.h index 1984e8f..22ea491 100644 --- a/include/usb.h +++ b/include/usb.h @@ -571,20 +571,21 @@ struct usb_platdata { * This is used by sandbox to provide emulation data also. * * @id:ID used to match this device - * @speed: Stores the speed associated with a USB device - * @devnum:Device address on the USB bus - * @slot_id: USB3 slot ID, which is separate from the device address - * @portnr:Port number of this device on its parent hub, numbered from 1 - * (0 mean this device is the root hub) + * @udev: usb-uclass internal use only do NOT use * @strings: List of descriptor strings (for sandbox emulation purposes) * @desc_list: List of descriptors (for sandbox emulation purposes) */ struct usb_dev_platdata { struct usb_device_id id; - enum usb_device_speed speed; - int devnum; - int slot_id; - int portnr; /* Hub port number, 1..n */ + /* +* This pointer is used to pass the usb_device used in usb_scan_device, +* to get the usb descriptors before the driver is known, to the +* actual udevice once the driver is known and the udevice is created. +* This will be NULL except during probe, do NOT use. +* +* This should eventually go away. +*/ + struct usb_device *udev; #ifdef CONFIG_SANDBOX struct usb_string *strings; /* NULL-terminated list of descriptor pointers */ -- 2.3.6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] AM335x configurations - console output at early stages lost
Hi Simon, On Mon, May 4, 2015 at 7:52 PM, Vasili Galka wrote: > Hi Simon, > > > On Mon, May 4, 2015 at 7:45 PM, Simon Glass wrote: > >> Hi Vasili, >> >> On 4 May 2015 at 10:21, Vasili Galka wrote: >> > >> > Hi Simon, >> > >> > On Thu, Apr 30, 2015 at 3:38 AM, Simon Glass wrote: >> >> >> >> Hi Vasili, >> >> >> >> On 29 April 2015 at 10:57, Vasili Galka wrote: >> >> > Hi Tom, >> >> > >> >> > I’m working on rebasing an old U-Boot branch for our company’s AM335x >> >> > based board upon the current U-Boot release (v2015.04). Our branch >> was >> >> > initially based on the v2013.10 release (the ti/am335x/ board was >> >> > taken as reference). >> >> > >> >> > After making all the code compile, I discovered there was a change in >> >> > the U-Boot initialization sequence, introduced by commit >> >> > a6b541b09022acb6f7c2754100ae26bd44eed1d9, that prevents our code from >> >> > working: >> >> > >> >> > Prior to the above mentioned commit, the console serial port was >> >> > initialized at a very early stage in the >> armv7/am335x/board.c:s_init() >> >> > function (calling preloader_console_init()). Roughly saying, it was >> >> > the first thing done by the SPL code. This made quite much sense, as >> >> > it enabled all the code afterwards to output status/debugging info to >> >> > the console. >> >> > Moving the preloader_console_init() call to spl_board_init() caused >> it >> >> > to be run at a very "late" stage (as part of the board_init_r() >> >> > function). AFAIU, now all the code that runs till then has no ability >> >> > for any console output. >> >> > For example, in our particular case, the DDR configuration code (in >> >> > sdram_init()) reads the DDR type from an I2C EEPROM. Obviously, if >> >> > something goes wrong in this process, we would like to report it to >> >> > the console. >> >> > >> >> > I understand there was a good reason for the mentioned commit (the >> >> > GD), however, as you see, we have also lost some important >> >> > functionality with it. I would appreciate your advice on how to solve >> >> > it. >> >> >> >> It would certainly be very useful and it would be great if we could >> >> printf() from as soon as we have a stack (and perhaps printch() even >> >> earlier). I think it can be done, but I have not put in the time to >> >> figure it out. >> >> >> >> You could take a look at CONFIG_DEBUG_UART which at least allows >> >> primitive UART access before gd is set up. I wonder if we could do >> >> something like change printf() /purchatr() to use this when gd is >> >> NULL? >> >> >> >> Regards, >> >> Simon >> > >> > >> > Thanks for the suggestion! I'm attempting to make it work. >> > Was the "Debug UART" code (added in >> 21d004368fc8a4da07147c58dfe9a4e16d4ab761) ever tested on AM335x? It does >> not seem to work for me, I'm currently debugging in attempt to understand >> the cause. >> >> From memory I think I did test it locally but did not send patches to >> enable it. >> >> You will need to enable DEBUG_UART_NS16550, and supply suitable values >> for DEBUG_UART_BASE and DEBUG_UART_CLOCK. >> >> But the debug UART code (in ns16550.c) is really simple so it should >> not be possible to debug it. >> >> I think it would be good to have the DEBUG_UART_... options in the >> board's defconfig file, even though CONFIG_DEBUG_UART itself is >> disabled. Then people can enable it easily when they want to use the >> debug UART. >> >> Regards, >> Simon >> > > Yes, of course, please see below the changes I applied. I expected to see > a character written on to the UART, but I see nothing. So I attempt to > compare the new serial code to the old one (from 2013) that definitely > works. > > Best, > Vasili > > ... > I've altered the debug_uart_init() to mimic the behaviour of NS16550_init() more closely and it fixed the problem. I'll send a clean patch shortly. Many thanks! Best regards, Vasili ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] mx6cuboxi: Skip usb initialization when booting without HDMI
Starting USB initialization is useful for those who use Cuboxi/Hummingboard with HDMI and USB keyboard. However, when booting without a HDMI connection we can skip the usb initialization, which makes the boot faster. Signed-off-by: Jon Nettleton Signed-off-by: Fabio Estevam --- Changes since v1: - Improve commit log (avoid repeating the word 'use'). include/configs/mx6cuboxi.h | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h index 4e07f59..b6f9d4e 100644 --- a/include/configs/mx6cuboxi.h +++ b/include/configs/mx6cuboxi.h @@ -80,6 +80,7 @@ #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_BMP_LOGO #define CONFIG_IMX_HDMI +#define CONFIG_CMD_HDMIDETECT #define CONFIG_IMX_VIDEO_SKIP #define CONFIG_CONSOLE_MUX @@ -94,7 +95,17 @@ #define CONFIG_USB_MAX_CONTROLLER_COUNT2 #define CONFIG_USB_KEYBOARD #define CONFIG_SYS_USB_EVENT_POLL -#define CONFIG_PREBOOT "usb start" +#define CONFIG_PREBOOT \ + "if hdmidet; then " \ + "usb start; " \ + "setenv stdin serial,usbkbd; "\ + "setenv stdout serial,vga; " \ + "setenv stderr serial,vga; " \ + "else " \ + "setenv stdin serial; " \ + "setenv stdout serial; " \ + "setenv stderr serial; " \ + "fi;" #define CONFIG_SYS_NO_FLASH @@ -117,9 +128,6 @@ #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG #define CONFIG_EXTRA_ENV_SETTINGS \ - "stdin=serial,usbkbd\0" \ - "stdout=serial,vga\0" \ - "stderr=serial,vga\0" \ "script=boot.scr\0" \ "image=zImage\0" \ "fdtfile=undefined\0" \ -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] mx6cuboxi: Skip usb initialization when booting without HDMI
Starting USB initialization is useful for users that use Cuboxi/Hummingboard using HDMI and USB keyboard. However, when booting without a HDMI connection we can skip the usb initialization, which makes the boot faster. Signed-off-by: Jon Nettleton Signed-off-by: Fabio Estevam --- include/configs/mx6cuboxi.h | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h index 4e07f59..b6f9d4e 100644 --- a/include/configs/mx6cuboxi.h +++ b/include/configs/mx6cuboxi.h @@ -80,6 +80,7 @@ #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_BMP_LOGO #define CONFIG_IMX_HDMI +#define CONFIG_CMD_HDMIDETECT #define CONFIG_IMX_VIDEO_SKIP #define CONFIG_CONSOLE_MUX @@ -94,7 +95,17 @@ #define CONFIG_USB_MAX_CONTROLLER_COUNT2 #define CONFIG_USB_KEYBOARD #define CONFIG_SYS_USB_EVENT_POLL -#define CONFIG_PREBOOT "usb start" +#define CONFIG_PREBOOT \ + "if hdmidet; then " \ + "usb start; " \ + "setenv stdin serial,usbkbd; "\ + "setenv stdout serial,vga; " \ + "setenv stderr serial,vga; " \ + "else " \ + "setenv stdin serial; " \ + "setenv stdout serial; " \ + "setenv stderr serial; " \ + "fi;" #define CONFIG_SYS_NO_FLASH @@ -117,9 +128,6 @@ #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG #define CONFIG_EXTRA_ENV_SETTINGS \ - "stdin=serial,usbkbd\0" \ - "stdout=serial,vga\0" \ - "stderr=serial,vga\0" \ "script=boot.scr\0" \ "image=zImage\0" \ "fdtfile=undefined\0" \ -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 09/10] sunxi: Add softwinner astar mid756 A33 tablet board defconfig
Hi, On 05/04/2015 05:48 PM, Chen-Yu Tsai wrote: On Thu, Apr 16, 2015 at 4:01 AM, Ian Campbell wrote: On Tue, 2015-04-14 at 18:07 +0200, Hans de Goede wrote: From: Vishnu Patekar The Astar MID756 is a 7" tablet using the A33 SoC with a 800x480 LCD screen, 512M RAM, 8G ROM and integrated sdio wifi. Sorry for digging up old stuff, but this board seems to be poorly named. It is clearly a relative of the Q8 family, having Q8_A23_A33_V1.6 printed on the board. "Softwinner astar-rda" does not really identify the board, rather just the kernel. "Softwinner" is seen in all Allwinner stock kernels. "RDA" likely means the kernel is a variant with support for the RDA WiFi chip. I would label this as another Q8H revision. The board has similar dimensions and layout to previous ones. I tend to agree I would welcome a patch to rename it, please coordinate this with the board MAINTAINER. Regards, Hans ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] AM335x configurations - console output at early stages lost
Hi Simon, On Mon, May 4, 2015 at 7:45 PM, Simon Glass wrote: > Hi Vasili, > > On 4 May 2015 at 10:21, Vasili Galka wrote: > > > > Hi Simon, > > > > On Thu, Apr 30, 2015 at 3:38 AM, Simon Glass wrote: > >> > >> Hi Vasili, > >> > >> On 29 April 2015 at 10:57, Vasili Galka wrote: > >> > Hi Tom, > >> > > >> > I’m working on rebasing an old U-Boot branch for our company’s AM335x > >> > based board upon the current U-Boot release (v2015.04). Our branch was > >> > initially based on the v2013.10 release (the ti/am335x/ board was > >> > taken as reference). > >> > > >> > After making all the code compile, I discovered there was a change in > >> > the U-Boot initialization sequence, introduced by commit > >> > a6b541b09022acb6f7c2754100ae26bd44eed1d9, that prevents our code from > >> > working: > >> > > >> > Prior to the above mentioned commit, the console serial port was > >> > initialized at a very early stage in the armv7/am335x/board.c:s_init() > >> > function (calling preloader_console_init()). Roughly saying, it was > >> > the first thing done by the SPL code. This made quite much sense, as > >> > it enabled all the code afterwards to output status/debugging info to > >> > the console. > >> > Moving the preloader_console_init() call to spl_board_init() caused it > >> > to be run at a very "late" stage (as part of the board_init_r() > >> > function). AFAIU, now all the code that runs till then has no ability > >> > for any console output. > >> > For example, in our particular case, the DDR configuration code (in > >> > sdram_init()) reads the DDR type from an I2C EEPROM. Obviously, if > >> > something goes wrong in this process, we would like to report it to > >> > the console. > >> > > >> > I understand there was a good reason for the mentioned commit (the > >> > GD), however, as you see, we have also lost some important > >> > functionality with it. I would appreciate your advice on how to solve > >> > it. > >> > >> It would certainly be very useful and it would be great if we could > >> printf() from as soon as we have a stack (and perhaps printch() even > >> earlier). I think it can be done, but I have not put in the time to > >> figure it out. > >> > >> You could take a look at CONFIG_DEBUG_UART which at least allows > >> primitive UART access before gd is set up. I wonder if we could do > >> something like change printf() /purchatr() to use this when gd is > >> NULL? > >> > >> Regards, > >> Simon > > > > > > Thanks for the suggestion! I'm attempting to make it work. > > Was the "Debug UART" code (added in > 21d004368fc8a4da07147c58dfe9a4e16d4ab761) ever tested on AM335x? It does > not seem to work for me, I'm currently debugging in attempt to understand > the cause. > > From memory I think I did test it locally but did not send patches to > enable it. > > You will need to enable DEBUG_UART_NS16550, and supply suitable values > for DEBUG_UART_BASE and DEBUG_UART_CLOCK. > > But the debug UART code (in ns16550.c) is really simple so it should > not be possible to debug it. > > I think it would be good to have the DEBUG_UART_... options in the > board's defconfig file, even though CONFIG_DEBUG_UART itself is > disabled. Then people can enable it easily when they want to use the > debug UART. > > Regards, > Simon > Yes, of course, please see below the changes I applied. I expected to see a character written on to the UART, but I see nothing. So I attempt to compare the new serial code to the old one (from 2013) that definitely works. Best, Vasili --- diff --git a/arch/arm/cpu/armv7/am33xx/board.c b/arch/arm/cpu/armv7/am33xx/board.c index 67bef23..79026d4 100644 --- a/arch/arm/cpu/armv7/am33xx/board.c +++ b/arch/arm/cpu/armv7/am33xx/board.c @@ -35,6 +35,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -297,6 +298,11 @@ void s_init(void) set_uart_mux_conf(); setup_clocks_for_console(); uart_soft_reset(); +#ifdef CONFIG_DEBUG_UART +debug_uart_init(); +printch('A'); +for(;;); +#endif #if defined(CONFIG_NOR_BOOT) || defined(CONFIG_QSPI_BOOT) /* TODO: This does not work, gd is not available yet */ gd->baudrate = CONFIG_BAUDRATE; diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 03beab5..7674433 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -54,7 +54,7 @@ DECLARE_GLOBAL_DATA_PTR; #define CONFIG_SYS_NS16550_IER 0x00 #endif /* CONFIG_SYS_NS16550_IER */ -#ifdef CONFIG_DM_SERIAL +#if defined(CONFIG_DM_SERIAL) || defined(CONFIG_DEBUG_UART_NS16550) static inline void serial_out_shift(unsigned char *addr, int shift, int value) { @@ -85,6 +85,9 @@ static inline int serial_in_shift(unsigned char *addr, int shift) return readb(addr); #endif } +#endif + +#if defined(CONFIG_DM_SERIAL) static void ns16550_writeb(NS16550_t port, int offset, int value) { diff --git a/include/configs/vm_am335x.h b/include/configs/vm_am335x.h index 9725c3f..3a1abc9 100644 --- a/include/configs/vm_am335x.h +++
Re: [U-Boot] AM335x configurations - console output at early stages lost
Hi Vasili, On 4 May 2015 at 10:21, Vasili Galka wrote: > > Hi Simon, > > On Thu, Apr 30, 2015 at 3:38 AM, Simon Glass wrote: >> >> Hi Vasili, >> >> On 29 April 2015 at 10:57, Vasili Galka wrote: >> > Hi Tom, >> > >> > I’m working on rebasing an old U-Boot branch for our company’s AM335x >> > based board upon the current U-Boot release (v2015.04). Our branch was >> > initially based on the v2013.10 release (the ti/am335x/ board was >> > taken as reference). >> > >> > After making all the code compile, I discovered there was a change in >> > the U-Boot initialization sequence, introduced by commit >> > a6b541b09022acb6f7c2754100ae26bd44eed1d9, that prevents our code from >> > working: >> > >> > Prior to the above mentioned commit, the console serial port was >> > initialized at a very early stage in the armv7/am335x/board.c:s_init() >> > function (calling preloader_console_init()). Roughly saying, it was >> > the first thing done by the SPL code. This made quite much sense, as >> > it enabled all the code afterwards to output status/debugging info to >> > the console. >> > Moving the preloader_console_init() call to spl_board_init() caused it >> > to be run at a very "late" stage (as part of the board_init_r() >> > function). AFAIU, now all the code that runs till then has no ability >> > for any console output. >> > For example, in our particular case, the DDR configuration code (in >> > sdram_init()) reads the DDR type from an I2C EEPROM. Obviously, if >> > something goes wrong in this process, we would like to report it to >> > the console. >> > >> > I understand there was a good reason for the mentioned commit (the >> > GD), however, as you see, we have also lost some important >> > functionality with it. I would appreciate your advice on how to solve >> > it. >> >> It would certainly be very useful and it would be great if we could >> printf() from as soon as we have a stack (and perhaps printch() even >> earlier). I think it can be done, but I have not put in the time to >> figure it out. >> >> You could take a look at CONFIG_DEBUG_UART which at least allows >> primitive UART access before gd is set up. I wonder if we could do >> something like change printf() /purchatr() to use this when gd is >> NULL? >> >> Regards, >> Simon > > > Thanks for the suggestion! I'm attempting to make it work. > Was the "Debug UART" code (added in 21d004368fc8a4da07147c58dfe9a4e16d4ab761) > ever tested on AM335x? It does not seem to work for me, I'm currently > debugging in attempt to understand the cause. From memory I think I did test it locally but did not send patches to enable it. You will need to enable DEBUG_UART_NS16550, and supply suitable values for DEBUG_UART_BASE and DEBUG_UART_CLOCK. But the debug UART code (in ns16550.c) is really simple so it should not be possible to debug it. I think it would be good to have the DEBUG_UART_... options in the board's defconfig file, even though CONFIG_DEBUG_UART itself is disabled. Then people can enable it easily when they want to use the debug UART. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [VOTING REQUIRED] Re: U-Boot mini summit
Hi Wolfgang, On Mon, May 4, 2015 at 10:31 AM, Wolfgang Denk wrote: > On Tue, 14 Apr 2015 Stefano Babic wrote: > >> Hi everybody, >> >> there were some rumours about next U-Boot mini summit and why there is >> not yet a date. The reason is that we at DENX are thinking about, taking >> into account that the U-Boot community is steadily increased, which is >> the best location for the next summit. We know that a lot of you are in >> US or, generally, outside Europe and maybe it is time to ask everybody >> where the next summit will take place - and maybe the result will not be >> in Europe. >> >> Surely, the summit should be part of an Event organized by the Linux >> Foundation, and taking into account the embedded nature of the >> bootloader, there are two possible candidates: >> >> - ELCE in Dublin, 5-7 October 2015 >> - ELC in San Diego, 4-6 April 2016 >> >> Wolfgang has prepared a "doodle" survey to collect availability and >> preferences. Feel free to add your name to the event(s) you would like >> to participate. >> >> http://doodle.com/8mf8xhhbsugtirpa >> >> This survey runs until 10, May 2015 - after that we will know where to >> meet for the U-Boot summit. >> >> Thanks everybody for improving U-Boot ! >> >> Best regards, >> Stefano Babic > > > I would like to point out that the poll will be ending on Sunday, > i. e. within less than a week, and so far we have just 16 votes, > or only 9 if we exclude the DENX team. > > This cannot be true? Is there really so little interest in a U-Boot > developer meeting? In this case we should probably consider not > doing such an event at all? Or just a tiny one at DENX ;-) > > Not even Tom and the majority of the custodians bothered to vote... > > Are you all sleeping? Hey, WAKE UP, this is YOUR event, if you want > to have it in a location which you can conveniently reach, then speak > up NOW! I was sleeping... I missed that email. Thanks for CC'ing me. I've voted now. Cheers, -Joe ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] powerpc/mpc85xx: Add board support for ucp1020
Oleks, This patch is in much better shape. On 04/29/2015 01:57 PM, Oleksandr G Zhadan wrote: > New QorIQ p1020 based board support from Arcturus Networks Inc. > http://www.arcturusnetworks.com/products/ucp1020/ > > Signed-off-by: Michael Durrant > Signed-off-by: Oleksandr G Zhadan > > Series-version: 2 > > Series-changes: 2 > WARNINGs: line over 80 characters are fixed These tags should be removed (automatically by patman). For future patches, if you generate patchs manually, please add version number in subject and remove these tags, and put a change log under --- line. > > --- Change log goes here. > --- /dev/null > +++ b/board/Arcturus/ucp1020/ddr.c > @@ -0,0 +1,161 @@ > +/* > + * Copyright 2013-2015 Arcturus Networks, Inc. > + * http://www.arcturusnetworks.com/products/ucp1020/ > + * based on board/freescale/p1_p2_rdb_pc/spl.c > + * original copyright follows: > + * Copyright 2013 Freescale Semiconductor, Inc. > + * > + * SPDX-License-Identifier: GPL-2.0+ > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#ifdef CONFIG_SYS_DDR_RAW_TIMING > +#if defined(CONFIG_UCP1020) || defined(CONFIG_UCP1020T1) > +/* > + * Micron MT41J128M16HA-15E > + * */ > +dimm_params_t ddr_raw_timing = { > + .n_ranks = 1, > + .rank_density = 536870912u, > + .capacity = 536870912u, > + .primary_sdram_width = 32, > + .ec_sdram_width = 8, > + .registered_dimm = 0, > + .mirrored_dimm = 0, > + .n_row_addr = 14, > + .n_col_addr = 10, > + .n_banks_per_sdram_device = 8, > + .edc_config = 2, > + .burst_lengths_bitmask = 0x0c, > + > + .tckmin_x_ps = 1650, > + .caslat_x = 0x7e << 4, /* 5,6,7,8,9,10 */ > + .taa_ps = 14050, > + .twr_ps = 15000, > + .trcd_ps = 13500, > + .trrd_ps = 75000, > + .trp_ps = 13500, > + .tras_ps = 4, > + .trc_ps = 49500, > + .trfc_ps = 16, > + .twtr_ps = 75000, > + .trtp_ps = 75000, > + .refresh_rate_ps = 780, > + .tfaw_ps = 3, > +}; > + > +#else > +#error Missing raw timing data for this board > +#endif > + > +int fsl_ddr_get_dimm_params(dimm_params_t *pdimm, > + unsigned int controller_number, > + unsigned int dimm_number) > +{ > + const char dimm_model[] = "Fixed DDR on board"; > + > + if ((controller_number == 0) && (dimm_number == 0)) { > + memcpy(pdimm, &ddr_raw_timing, sizeof(dimm_params_t)); > + memset(pdimm->mpart, 0, sizeof(pdimm->mpart)); > + memcpy(pdimm->mpart, dimm_model, sizeof(dimm_model) - 1); > + } > + > + return 0; > +} > +#endif /* CONFIG_SYS_DDR_RAW_TIMING */ Looks like you have raw timing parameters but you didn't use it. it is disabled in your UCP1020.h +#define CONFIG_DDR_ECC_ENABLE +#define CONFIG_SYS_FSL_DDR3 +#ifndef CONFIG_DDR_ECC_ENABLE +#define CONFIG_SYS_DDR_RAW_TIMING +#define CONFIG_DDR_SPD +#endif Raw timing is preferred over fixed parameters. It gives you flexibility to run DDR at different speeds. It is your board. I am not going to force you to pick either. Let me know if you want to update this patch. > + > +#ifdef CONFIG_SYS_DDR_CS0_BNDS > +/* Fixed sdram init -- doesn't use serial presence detect. */ > +phys_size_t fixed_sdram(void) > +{ > + sys_info_t sysinfo; > + char buf[32]; > + size_t ddr_size; > + fsl_ddr_cfg_regs_t ddr_cfg_regs = { > + .cs[0].bnds = CONFIG_SYS_DDR_CS0_BNDS, > + .cs[0].config = CONFIG_SYS_DDR_CS0_CONFIG, > + .cs[0].config_2 = CONFIG_SYS_DDR_CS0_CONFIG_2, > +#if CONFIG_CHIP_SELECTS_PER_CTRL > 1 > + .cs[1].bnds = CONFIG_SYS_DDR_CS1_BNDS, > + .cs[1].config = CONFIG_SYS_DDR_CS1_CONFIG, > + .cs[1].config_2 = CONFIG_SYS_DDR_CS1_CONFIG_2, > +#endif > + .timing_cfg_3 = CONFIG_SYS_DDR_TIMING_3, > + .timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0, > + .timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1, > + .timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2, > + .ddr_sdram_cfg = CONFIG_SYS_DDR_CONTROL, > + .ddr_sdram_cfg_2 = CONFIG_SYS_DDR_CONTROL_2, > + .ddr_sdram_mode = CONFIG_SYS_DDR_MODE_1, > + .ddr_sdram_mode_2 = CONFIG_SYS_DDR_MODE_2, > + .ddr_sdram_md_cntl = CONFIG_SYS_DDR_MODE_CONTROL, > + .ddr_sdram_interval = CONFIG_SYS_DDR_INTERVAL, > + .ddr_data_init = CONFIG_SYS_DDR_DATA_INIT, > + .ddr_sdram_clk_cntl = CONFIG_SYS_DDR_CLK_CTRL, > + .ddr_init_addr = CONFIG_SYS_DDR_INIT_ADDR, > + .ddr_init_ext_addr = CONFIG_SYS_DDR_INIT_EXT_ADDR, > + .timing_cfg_4 = CONFIG_SYS_DDR_TIMING_4, > + .timing_cfg_5 = CONFIG_SYS_DDR_TIMING_5, > + .ddr_zq_cntl = CONFIG_SYS_DDR_ZQ_CONTROL, > + .ddr_wrlvl_cntl = CONFIG_SYS_DDR_WRLVL_CONTROL, > + .ddr_sr_cntr = CONFIG_SYS_DDR_SR_CNTR
Re: [U-Boot] AM335x configurations - console output at early stages lost
Hi Simon, On Thu, Apr 30, 2015 at 3:38 AM, Simon Glass wrote: > Hi Vasili, > > On 29 April 2015 at 10:57, Vasili Galka wrote: > > Hi Tom, > > > > I’m working on rebasing an old U-Boot branch for our company’s AM335x > > based board upon the current U-Boot release (v2015.04). Our branch was > > initially based on the v2013.10 release (the ti/am335x/ board was > > taken as reference). > > > > After making all the code compile, I discovered there was a change in > > the U-Boot initialization sequence, introduced by commit > > a6b541b09022acb6f7c2754100ae26bd44eed1d9, that prevents our code from > > working: > > > > Prior to the above mentioned commit, the console serial port was > > initialized at a very early stage in the armv7/am335x/board.c:s_init() > > function (calling preloader_console_init()). Roughly saying, it was > > the first thing done by the SPL code. This made quite much sense, as > > it enabled all the code afterwards to output status/debugging info to > > the console. > > Moving the preloader_console_init() call to spl_board_init() caused it > > to be run at a very "late" stage (as part of the board_init_r() > > function). AFAIU, now all the code that runs till then has no ability > > for any console output. > > For example, in our particular case, the DDR configuration code (in > > sdram_init()) reads the DDR type from an I2C EEPROM. Obviously, if > > something goes wrong in this process, we would like to report it to > > the console. > > > > I understand there was a good reason for the mentioned commit (the > > GD), however, as you see, we have also lost some important > > functionality with it. I would appreciate your advice on how to solve > > it. > > It would certainly be very useful and it would be great if we could > printf() from as soon as we have a stack (and perhaps printch() even > earlier). I think it can be done, but I have not put in the time to > figure it out. > > You could take a look at CONFIG_DEBUG_UART which at least allows > primitive UART access before gd is set up. I wonder if we could do > something like change printf() /purchatr() to use this when gd is > NULL? > > Regards, > Simon > Thanks for the suggestion! I'm attempting to make it work. Was the "Debug UART" code (added in 21d004368fc8a4da07147c58dfe9a4e16d4ab761) ever tested on AM335x? It does not seem to work for me, I'm currently debugging in attempt to understand the cause. Regards, Vasili ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 2/2] mx6cuboxi: Pull down PAD_ENET_RXD0/RXD1
Hi Fabio, On 04/05/2015 16:22, Fabio Estevam wrote: > Configure PAD_ENET_RXD0/RXD1 pads as pull down because these pads are directly > connected to the Atheros 8035/8030 although they should be functional > only in the RMII mode - 8030. > > Signed-off-by: Rabeeh Khoury > Signed-off-by: Fabio Estevam > --- Applied to u-boot-imx, thanks ! Best regards, Stefano Babic -- = DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/2] mx6cuboxi: Fix Ethernet PHY detection problem
Hi Fabio, On 04/05/2015 16:22, Fabio Estevam wrote: > mx6cuboxi sometimes fails to recognize the Ethernet PHY: > > Net: Phy 0 not found > > The explanation for this behavior comes from from Rabeeh Khoury: > > "The LED_ACT pin on the carrier-one boards had a pull down that > forces the phy address to 0x0; where on CuBox-i and the production > HummingBoard that pin is connected directly to LED that depending > on the pull down strength of the LED it might be sampled as '0' or '1' thus > the phy address might appear as either address 0x0 or 0x4." > > "This is AR8035 implementation; in reset stage the LED pin is configured as > input, and pull up/down does matter. In this case it configures the PHY > address. > > After reset is deasserted the same LED pin becomes output and then > according to the previous pull/up it should be active high/low" > > One way to properly fix this behavior is to place external pull-up/down > resistors in the LED line, but from a software standpoint we can fix it > by telling phy_find_by_mask() to scan the PHY at addresses > 0x0 and 0x4. > > Reported-by: Vagrant Cascadian > Signed-off-by: Rabeeh Khoury > Signed-off-by: Fabio Estevam > --- Applied to u-boot-imx, thanks ! Best regards, Stefano Babic -- = DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 2/2] mx6cuboxi: Pull down PAD_ENET_RXD0/RXD1
On 2015-05-04, Fabio Estevam wrote: > Configure PAD_ENET_RXD0/RXD1 pads as pull down because these pads are directly > connected to the Atheros 8035/8030 although they should be functional > only in the RMII mode - 8030. > > Signed-off-by: Rabeeh Khoury > Signed-off-by: Fabio Estevam > --- > Changes since v1: > - None > board/solidrun/mx6cuboxi/mx6cuboxi.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c > b/board/solidrun/mx6cuboxi/mx6cuboxi.c > index ff018e1..8fb6004 100644 > --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c > +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c > @@ -134,6 +134,8 @@ static iomux_v3_cfg_t const enet_pads[] = { > IOMUX_PADS(PAD_RGMII_RD2__RGMII_RD2 | MUX_PAD_CTRL(ENET_PAD_CTRL)), > IOMUX_PADS(PAD_RGMII_RD3__RGMII_RD3 | MUX_PAD_CTRL(ENET_PAD_CTRL)), > IOMUX_PADS(PAD_RGMII_RX_CTL__RGMII_RX_CTL | > MUX_PAD_CTRL(ENET_PAD_CTRL_PD)), > + IOMUX_PADS(PAD_ENET_RXD0__GPIO1_IO27 | MUX_PAD_CTRL(ENET_PAD_CTRL_PD)), > + IOMUX_PADS(PAD_ENET_RXD1__GPIO1_IO26 | MUX_PAD_CTRL(ENET_PAD_CTRL_PD)), > }; > > static void setup_iomux_enet(void) > -- > 1.9.1 Tested on cubox-i4pro and hummingboard-i2ex. Tested-By: Vagrant Cascadian signature.asc Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v2, 1/2] mx6cuboxi: Fix Ethernet PHY detection problem
On 2015-05-04, Fabio Estevam wrote: > mx6cuboxi sometimes fails to recognize the Ethernet PHY: > > Net: Phy 0 not found > > The explanation for this behavior comes from from Rabeeh Khoury: > > "The LED_ACT pin on the carrier-one boards had a pull down that > forces the phy address to 0x0; where on CuBox-i and the production > HummingBoard that pin is connected directly to LED that depending > on the pull down strength of the LED it might be sampled as '0' or '1' thus > the phy address might appear as either address 0x0 or 0x4." > > "This is AR8035 implementation; in reset stage the LED pin is configured as > input, and pull up/down does matter. In this case it configures the PHY > address. > > After reset is deasserted the same LED pin becomes output and then > according to the previous pull/up it should be active high/low" > > One way to properly fix this behavior is to place external pull-up/down > resistors in the LED line, but from a software standpoint we can fix it > by telling phy_find_by_mask() to scan the PHY at addresses > 0x0 and 0x4. > > Reported-by: Vagrant Cascadian > Signed-off-by: Rabeeh Khoury > Signed-off-by: Fabio Estevam > --- > Changes since v1: > - Explain what the proper hardware fix would be as suggested by Nikolay > - Remove error message from fec_probe as this function already prints on > error. > > board/solidrun/mx6cuboxi/mx6cuboxi.c | 29 - > 1 file changed, 28 insertions(+), 1 deletion(-) > > diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c > b/board/solidrun/mx6cuboxi/mx6cuboxi.c > index 9aa0259..e83d2fe 100644 > --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c > +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -152,9 +153,14 @@ int board_phy_config(struct phy_device *phydev) > return 0; > } > > +/* On Cuboxi Ethernet PHY can be located at addresses 0x0 or 0x4 */ > +#define ETH_PHY_MASK ((1 << 0x0) | (1 << 0x4)) > + > int board_eth_init(bd_t *bis) > { > struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR; > + struct mii_dev *bus; > + struct phy_device *phydev; > > int ret = enable_fec_anatop_clock(ENET_25MHZ); > if (ret) > @@ -165,7 +171,28 @@ int board_eth_init(bd_t *bis) > > setup_iomux_enet(); > > - return cpu_eth_init(bis); > + bus = fec_get_miibus(IMX_FEC_BASE, -1); > + if (!bus) > + return -EINVAL; > + > + phydev = phy_find_by_mask(bus, ETH_PHY_MASK, PHY_INTERFACE_MODE_RGMII); > + if (!phydev) { > + ret = -EINVAL; > + goto free_bus; > + } > + > + debug("using phy at address %d\n", phydev->addr); > + ret = fec_probe(bis, -1, IMX_FEC_BASE, bus, phydev); > + if (ret) > + goto free_phydev; > + > + return 0; > + > +free_phydev: > + free(phydev); > +free_bus: > + free(bus); > + return ret; > } > > #ifdef CONFIG_VIDEO_IPUV3 > -- > 1.9.1 Tested on cubox-i4pro and hummingboard-i2ex. Tested-By: Vagrant Cascadian signature.asc Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 09/10] sunxi: Add softwinner astar mid756 A33 tablet board defconfig
On Thu, Apr 16, 2015 at 4:01 AM, Ian Campbell wrote: > On Tue, 2015-04-14 at 18:07 +0200, Hans de Goede wrote: >> From: Vishnu Patekar >> >> The Astar MID756 is a 7" tablet using the A33 SoC with a 800x480 LCD screen, >> 512M RAM, 8G ROM and integrated sdio wifi. Sorry for digging up old stuff, but this board seems to be poorly named. It is clearly a relative of the Q8 family, having Q8_A23_A33_V1.6 printed on the board. "Softwinner astar-rda" does not really identify the board, rather just the kernel. "Softwinner" is seen in all Allwinner stock kernels. "RDA" likely means the kernel is a variant with support for the RDA WiFi chip. I would label this as another Q8H revision. The board has similar dimensions and layout to previous ones. Regards ChenYu P.S. I've ordered a Q8 style A33 tablet which should arrive soon. We'll see what board variant it has inside. >> Also see: http://linux-sunxi.org/Softwinner_astar-rda >> >> Signed-off-by: Vishnu Patekar >> Signed-off-by: Hans de Goede > > Acked-by: Ian Campbell > > > ___ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] hummingboard: Remove mx6solo specific support
Hi Stefano, On Mon, Apr 27, 2015 at 9:05 PM, Tom Rini wrote: > On Mon, Apr 27, 2015 at 09:20:52AM -0300, Fabio Estevam wrote: >> Hummingboard dual, dual-lite and solo are now supported via SPL mechanism. >> >> Remove the previous hummingboard support, which does not use SPL and >> supported >> only the solo variant. >> >> Signed-off-by: Fabio Estevam > > Reviewed-by: Tom Rini Are you fine with this series? Thanks, Fabio Estevam ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm: mvebu: Remove "u-boot.kwb" CONFIG_BUILD_TARGET for non-SPL targets
Hi Simon, On 04.05.2015 17:35, Simon Glass wrote: On 4 May 2015 at 09:31, Stefan Roese wrote: By removing this default build target, the "u-boot.kwb" target is not automatically generated. This fixes a temporary build error when using out-of-tree builds, as buildman does per default (reported by Simon). When the full SPL support is added for these targets with the DDR training code, the "u-boot-spl.kwb" image will be generated automatically. Users providing a special bin_hdr binary (binary.0) file can always add this binary file and generate the full firmware image by issuing the "make u-boot.kwb" command directly. Signed-off-by: Stefan Roese Cc: Simon Glass Cc: Prafulla Wadaskar Cc: Luka Perkov --- arch/arm/mach-mvebu/include/mach/config.h | 2 -- 1 file changed, 2 deletions(-) Reviewed-by: Simon Glass How/when is this series being applied? Pretty soon. Luka mentioned to me off-list, that he planned to apply and push this series last weekend. Hopefully he will find the time to do it early this week. Luka, can you please add this patch to the series as well? Thanks, Stefan ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [VOTING REQUIRED] Re: U-Boot mini summit
On Tue, 14 Apr 2015 Stefano Babic wrote: > Hi everybody, > > there were some rumours about next U-Boot mini summit and why there is > not yet a date. The reason is that we at DENX are thinking about, taking > into account that the U-Boot community is steadily increased, which is > the best location for the next summit. We know that a lot of you are in > US or, generally, outside Europe and maybe it is time to ask everybody > where the next summit will take place - and maybe the result will not be > in Europe. > > Surely, the summit should be part of an Event organized by the Linux > Foundation, and taking into account the embedded nature of the > bootloader, there are two possible candidates: > > - ELCE in Dublin, 5-7 October 2015 > - ELC in San Diego, 4-6 April 2016 > > Wolfgang has prepared a "doodle" survey to collect availability and > preferences. Feel free to add your name to the event(s) you would like > to participate. > > http://doodle.com/8mf8xhhbsugtirpa > > This survey runs until 10, May 2015 - after that we will know where to > meet for the U-Boot summit. > > Thanks everybody for improving U-Boot ! > > Best regards, > Stefano Babic I would like to point out that the poll will be ending on Sunday, i. e. within less than a week, and so far we have just 16 votes, or only 9 if we exclude the DENX team. This cannot be true? Is there really so little interest in a U-Boot developer meeting? In this case we should probably consider not doing such an event at all? Or just a tiny one at DENX ;-) Not even Tom and the majority of the custodians bothered to vote... Are you all sleeping? Hey, WAKE UP, this is YOUR event, if you want to have it in a location which you can conveniently reach, then speak up NOW! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Only in our dreams we are free. The rest of the time we need wages. - Terry Pratchett, _Wyrd Sisters_ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm: mvebu: Remove "u-boot.kwb" CONFIG_BUILD_TARGET for non-SPL targets
Hi Stefan, On 4 May 2015 at 09:31, Stefan Roese wrote: > > By removing this default build target, the "u-boot.kwb" target is not > automatically generated. This fixes a temporary build error when using > out-of-tree builds, as buildman does per default (reported by Simon). > > When the full SPL support is added for these targets with the DDR training > code, the "u-boot-spl.kwb" image will be generated automatically. > > Users providing a special bin_hdr binary (binary.0) file can always add > this binary file and generate the full firmware image by issuing the > "make u-boot.kwb" command directly. > > Signed-off-by: Stefan Roese > Cc: Simon Glass > Cc: Prafulla Wadaskar > Cc: Luka Perkov > --- > arch/arm/mach-mvebu/include/mach/config.h | 2 -- > 1 file changed, 2 deletions(-) Reviewed-by: Simon Glass How/when is this series being applied? Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] arm: mvebu: Remove "u-boot.kwb" CONFIG_BUILD_TARGET for non-SPL targets
By removing this default build target, the "u-boot.kwb" target is not automatically generated. This fixes a temporary build error when using out-of-tree builds, as buildman does per default (reported by Simon). When the full SPL support is added for these targets with the DDR training code, the "u-boot-spl.kwb" image will be generated automatically. Users providing a special bin_hdr binary (binary.0) file can always add this binary file and generate the full firmware image by issuing the "make u-boot.kwb" command directly. Signed-off-by: Stefan Roese Cc: Simon Glass Cc: Prafulla Wadaskar Cc: Luka Perkov --- arch/arm/mach-mvebu/include/mach/config.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm/mach-mvebu/include/mach/config.h b/arch/arm/mach-mvebu/include/mach/config.h index b326ec0..9dde710 100644 --- a/arch/arm/mach-mvebu/include/mach/config.h +++ b/arch/arm/mach-mvebu/include/mach/config.h @@ -35,8 +35,6 @@ /* Add target to build it automatically upon "make" */ #ifdef CONFIG_SPL #define CONFIG_BUILD_TARGET"u-boot-spl.kwb" -#else -#define CONFIG_BUILD_TARGET"u-boot.kwb" #endif /* end of 16M scrubbed by training in bootrom */ -- 2.4.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Please pull u-boot-sunxi master
Hi Tom, Please pull u-boot-sunxi/master into master for the second round of sunxi work, highlights: -A33 SoC support (full support including otg & display) -Move ALL sunxi boards over to the driver-model for serial, gpio and ethernet -Preparation work for moving the sunxi-ehci USB host support over to the driver-model (and later on add support for the ohci companion) The following changes since commit ace97d26176a3ebc9ec07738450de93eea35975c: Merge branch 'zynq' of git://www.denx.de/git/u-boot-microblaze (2015-04-29 06:46:33 -0400) are available in the git repository at: http://git.denx.de/u-boot-sunxi.git for you to fetch changes up to fd01ae1384a67c354eb53fc8a4c1e0d519014ae8: sunxi: usb: Protect phy-init and phy-power-on against multiple calls (2015-05-04 16:51:55 +0200) Hans de Goede (36): sunxi: Also set Auxiliary Ctl SMP bit in SPL sunxi: usbc: Remove unused irq field sunxi: Introduce a hidden SUNXI_GEN_SUNxI Kconfig bool sunxi: s/sun8i/sun8i_a23/ sunxi: Add support for A33 PLL11 (second DRAM pll) sunxi: Add Ippo_q8h_v1_2_a33_1024x600 defconfig sunxi: Do not build i2c support when we've no i2c controllers sunxi: mmc: Fix card-detect gpio handling to work with the driver-model sunxi: usbc: Fix vbus gpio handling to work with the driver-model sunxi: display: Fix gpio handling to work with the driver-model sunxi: soft-i2c: Fix gpio handling to work with the driver-model sunxi: gpio: Add compatible strings for all supported SoCs sunxi: gpio: Build sunxi_name_to_gpio_bank for driver-model code too sunxi: axp: Change axp_gpio_foo prototypes to match gpio uclass ops sunxi: axp: Move axp pmic register helpers to a separate file sunxi: axp: Add support for i2c based PMICs to the pmic-bus helpers sunxi: axp: Move axp gpio code to a separate axpi-gpio driver sunxi: axp: Add driver-model support to the axp_gpio code sunxi: gmac: Move sunxi_gmac_initialize proto out of netdev.h sunxi: emac: port to phylib sunxi: emac: Prepare for driver-model support sunxi: emac: Rename DMA_CPU_TRRESHOLD to EMAC_RX_BUFSIZE sunxi: emac: Add driver model support sunxi: dts: Sync all dts files with upstream kernel sunxi: dts: Add dts files which have been submitted but not yet merged upstream sunxi: dts: Add minimal dts files for board which lack a dts sofar sunxi: dts: Add a CONFIG_DEFAULT_DEVICE_TREE setting to all sunxi boards sunxi: Move all boards to the driver-model sunxi: emac: Remove non driver-model code sunxi: axp: Remove non driver-model support from the axp gpio code sunxi: usb: Move setup of host controller clocks to the host controller drivers sunxi: usb: Remove sunxi_usbc_get_io_base function sunxi: usb: Rename sunxi_usbc_foo functions to sunxi_usb_phy_bar sunxi: usb: Rename the usbc.? files to usb_phy.? sunxi: usb: Do not call phy_probe from hcd code sunxi: usb: Protect phy-init and phy-power-on against multiple calls Jan Kiszka (1): sun7i: Remove duplicate call to psci_arch_init Simon Glass (2): sunxi: gpio: Rename GPIOs to include a 'P' prefix sunxi: gpio: Add temporary implementation of name_to_gpio() Vishnu Patekar (3): sunxi: Add a33 dram init code sunxi: Add basic A33 basic support sunxi: Add softwinner astar mid756 A33 tablet board defconfig arch/arm/Kconfig |5 + arch/arm/cpu/armv7/sunxi/Makefile |9 +- arch/arm/cpu/armv7/sunxi/board.c | 22 +- arch/arm/cpu/armv7/sunxi/clock_sun6i.c | 18 + arch/arm/cpu/armv7/sunxi/cpu_info.c|6 +- .../armv7/sunxi/{dram_sun8i.c => dram_sun8i_a23.c} |0 arch/arm/cpu/armv7/sunxi/dram_sun8i_a33.c | 363 +++ arch/arm/cpu/armv7/sunxi/pmic_bus.c| 112 +++ arch/arm/cpu/armv7/sunxi/psci.S|1 - arch/arm/cpu/armv7/sunxi/usb_phy.c | 304 ++ arch/arm/cpu/armv7/sunxi/usbc.c| 308 -- arch/arm/dts/Makefile | 73 +- arch/arm/dts/axp209.dtsi | 97 ++ arch/arm/dts/sun4i-a10-a1000.dts | 198 arch/arm/dts/sun4i-a10-ba10-tvbox.dts | 154 +++ arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts | 135 +++ arch/arm/dts/sun4i-a10-cubieboard.dts | 223 arch/arm/dts/sun4i-a10-gemei-g9.dts| 176 arch/arm/dts/sun4i-a10-hackberry.dts | 166 +++ arch/arm/dts/sun4i-a10-hyundai-a7hd.dts| 113 +++ arch/arm/dts/sun4i-a10-inet-3f.dts | 29 + arch/arm/dts/sun4i-a10-inet-3w.dts | 29 + arch/arm/dts/sun4i-a10-inet97fv2.dts | 128 +++ arch/arm/dts/sun4