Re: [U-Boot] [PATCH] config_distro_bootcmd.h: add note on error handling
On Tue, Mar 10, 2015 at 03:40:58PM -0600, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com This should make it more clear why there appear to be C pre-processor symbols in the file that contain mixed case. They're really error messages. Suggested-by: Simon Glass s...@chromium.org Signed-off-by: Stephen Warren swar...@nvidia.com Reviewed-by: Tom Rini tr...@konsulko.com -- 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 V6 05/11] ARM: OMAP: Change set_pl310_ctrl_reg to be generic
On Mon, Mar 09, 2015 at 05:12:03PM -0500, Nishanth Menon wrote: set_pl310_ctrl_reg does use the Secure Monitor Call (SMC) to setup PL310 control register, however, that is something that is generic enough to be used for OMAP5 generation of processors as well. The only difference being the service being invoked for the function. So, convert the service to a macro and use a generic name (same as that used in Linux for some consistency). While at that, also add a data barrier which is necessary as per recommendation. While at this, smc #0 is maintained as handcoded assembly thanks to various gcc version eccentricities, discussion thread: http://marc.info/?t=14254216681r=1w=2 Signed-off-by: Nishanth Menon n...@ti.com Reviewed-by: Tom Rini tr...@konsulko.com -- 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 V6 06/11] ARM: OMAP3: Rename omap3.h to omap.h to be generic as all SoCs
On Mon, Mar 09, 2015 at 05:12:04PM -0500, Nishanth Menon wrote: This is in preperation of using generic cross OMAP code. Signed-off-by: Nishanth Menon n...@ti.com Reviewed-by: Tom Rini tr...@konsulko.com -- 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 V6 07/11] ARM: OMAP3: Get rid of omap3_gp_romcode_call and replace with omap_smc1
On Wed, Mar 11, 2015 at 11:00 AM, Tom Rini tr...@konsulko.com wrote: On Wed, Mar 11, 2015 at 10:53:41AM -0500, Nishanth Menon wrote: On Wed, Mar 11, 2015 at 10:48 AM, Tom Rini tr...@konsulko.com wrote: On Mon, Mar 09, 2015 at 05:12:05PM -0500, Nishanth Menon wrote: omap_smc1 is now generic enough to remove duplicate omap3_gp_romcode_call logic that omap3 introduced. As part of this change, move to using the generic lowlevel_init.S for omap3 as well. Signed-off-by: Nishanth Menon n...@ti.com Reviewed-by: Tom Rini tr...@konsulko.com But I've always wondered, does OMAP3 not actually pass in the same info in the same location / manner as OMAP4 and later? For smc call, the calls are similar, but the parameters change Right, sorry but I mean for boot params as that's what's still being omap3-specific in lowlevel_init.S There seemed to be differences w.r.t bootdevice detection logic which seems to be extensive in omap3 :( had'nt dug too much there :( -- --- Regards, Nishanth Menon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v5 04/14] ARM: Factor out reusable psci_cpu_entry
On Mon, Mar 09, 2015 at 08:00:14AM +0100, Jan Kiszka wrote: _sunxi_cpu_entry can be converted completely into a reusable psci_cpu_entry. Tegra124 will use it as well. As with psci_disable_smp, also the enabling is designed to be overloaded in cased SMP is not controlled via ACTLR. CC: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Jan Kiszka jan.kis...@siemens.com Reviewed-by: Tom Rini tr...@konsulko.com -- 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 v5 01/14] sun7i: Remove duplicate call to psci_arch_init
On Mon, Mar 09, 2015 at 08:00:11AM +0100, Jan Kiszka wrote: This is already invoked a few cycles later in monitor mode by _secure_monitor. Drop it here, it serves no purpose. For clarity, because of the vector tables? Reviewed-by: Tom Rini tr...@konsulko.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] fastboot: check for alias when looking up partition by name
Implement an alias name check for devices where GPT limitations prevent user-friendly partition names such as boot, system and cache. Or, where the actual partition name doesn't match a standard partition name used commonly with fastboot. To set an alias, add an environment setting as follows: fastboot_partition_alias_alias partition name=actual partition name Example: fastboot_partition_alias_boot=LNX Signed-off-by: Michael Scott michael.sc...@linaro.org Cc: Steve Rae s...@broadcom.com Cc: Lukasz Majewski l.majew...@samsung.com --- common/fb_mmc.c | 26 -- doc/README.android-fastboot | 9 + 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/common/fb_mmc.c b/common/fb_mmc.c index 75899e4..0c48cf9 100644 --- a/common/fb_mmc.c +++ b/common/fb_mmc.c @@ -33,6 +33,28 @@ void fastboot_okay(const char *s) strncat(response_str, s, RESPONSE_LEN - 4 - 1); } +static int get_partition_info_efi_by_name_or_alias(block_dev_desc_t *dev_desc, + const char *name, disk_partition_t *info) +{ + int ret; + + ret = get_partition_info_efi_by_name(dev_desc, name, info); + if (ret) { + /* strlen(fastboot_partition_alias_) + 32(part_name) + 1 */ + char env_alias_name[25 + 32 + 1]; + char *aliased_part_name; + + /* check for alias */ + strcpy(env_alias_name, fastboot_partition_alias_); + strncat(env_alias_name, name, 32); + aliased_part_name = getenv(env_alias_name); + if (aliased_part_name != NULL) + ret = get_partition_info_efi_by_name(dev_desc, + aliased_part_name, info); + } + return ret; +} + static void write_raw_image(block_dev_desc_t *dev_desc, disk_partition_t *info, const char *part_name, void *buffer, unsigned int download_bytes) @@ -98,7 +120,7 @@ void fb_mmc_flash_write(const char *cmd, void *download_buffer, printf( success\n); fastboot_okay(); return; - } else if (get_partition_info_efi_by_name(dev_desc, cmd, info)) { + } else if (get_partition_info_efi_by_name_or_alias(dev_desc, cmd, info)) { error(cannot find partition: '%s'\n, cmd); fastboot_fail(cannot find partition); return; @@ -136,7 +158,7 @@ void fb_mmc_erase(const char *cmd, char *response) return; } - ret = get_partition_info_efi_by_name(dev_desc, cmd, info); + ret = get_partition_info_efi_by_name_or_alias(dev_desc, cmd, info); if (ret) { error(cannot find partition: '%s', cmd); fastboot_fail(cannot find partition); diff --git a/doc/README.android-fastboot b/doc/README.android-fastboot index 5526a43..04411e9 100644 --- a/doc/README.android-fastboot +++ b/doc/README.android-fastboot @@ -50,6 +50,15 @@ buffer should be as large as possible for a platform. The location of the buffer and size are set with CONFIG_USB_FASTBOOT_BUF_ADDR and CONFIG_USB_FASTBOOT_BUF_SIZE. +Fastboot partition aliases can also be defined for devices where GPT +limitations prevent user-friendly partition names such as boot, system +and cache. Or, where the actual partition name doesn't match a standard +partition name used commonly with fastboot. Current implentation checks +aliases when accessing partitions by name (flash_write and erase functions). +To define a partition alias add an environment variable similar to: +fastboot_partition_alias_alias partition name=actual partition name +Example: fastboot_partition_alias_boot=LNX + In Action = Enter into fastboot by executing the fastboot command in u-boot and you -- 2.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V6 09/11] ARM: OMAP5 / DRA7: Setup L2 Aux Control Register with recommended configuration
On Mon, Mar 09, 2015 at 05:12:07PM -0500, Nishanth Menon wrote: Update to existing recommendation for L2ACTLR configuration to prevent system instability and optimize performance. These apply to both OMAP5 and DRA7. Reported-by: Vivek Chengalvala vchengalv...@ti.com Signed-off-by: Nishanth Menon n...@ti.com Reviewed-by: Tom Rini tr...@konsulko.com -- 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 V6 07/11] ARM: OMAP3: Get rid of omap3_gp_romcode_call and replace with omap_smc1
On Mon, Mar 09, 2015 at 05:12:05PM -0500, Nishanth Menon wrote: omap_smc1 is now generic enough to remove duplicate omap3_gp_romcode_call logic that omap3 introduced. As part of this change, move to using the generic lowlevel_init.S for omap3 as well. Signed-off-by: Nishanth Menon n...@ti.com Reviewed-by: Tom Rini tr...@konsulko.com But I've always wondered, does OMAP3 not actually pass in the same info in the same location / manner as OMAP4 and later? -- 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 v5 13/14] tegra124: Reserve secure RAM using MC_SECURITY_CFG{0, 1}_0
On Mon, Mar 09, 2015 at 08:00:23AM +0100, Jan Kiszka wrote: From: Ian Campbell i...@hellion.org.uk These registers can be used to prevent non-secure world from accessing a megabyte aligned region of RAM, use them to protect the u-boot secure monitor code. At first I tried to do this from s_init(), however this inexplicably causes u-boot's networking (e.g. DHCP) to fail, while networking under Linux was fine. So instead I have added a new weak arch function protect_secure_section() called from relocate_secure_section() and reserved the region there. This is better overall since it defers the reservation until after the sec vs. non-sec decision (which can be influenced by an envvar) has been made when booting the os. Signed-off-by: Ian Campbell i...@hellion.org.uk [Jan: tiny style adjustment] Signed-off-by: Jan Kiszka jan.kis...@siemens.com Reviewed-by: Tom Rini tr...@konsulko.com -- 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 v5 09/14] tegra: Make tegra_powergate_power_on public
On Mon, Mar 09, 2015 at 08:00:19AM +0100, Jan Kiszka wrote: Will be used for unpowergating CPUs. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Reviewed-by: Tom Rini tr...@konsulko.com -- 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 v5 12/14] jetson-tk1: Add PSCI configuration options and reserve secure code
On Mon, Mar 09, 2015 at 08:00:22AM +0100, Jan Kiszka wrote: From: Ian Campbell i...@hellion.org.uk The secure world code is relocated to the MB just below the top of 4G, we reserve it in the FDT (by setting CONFIG_ARMV7_SECURE_RESERVE_SIZE) but it is not protected in h/w. See next patch. Signed-off-by: Ian Campbell i...@hellion.org.uk Signed-off-by: Jan Kiszka jan.kis...@siemens.com Reviewed-by: Tom Rini tr...@konsulko.com -- 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 v5 08/14] virt-dt: Allow reservation of secure region when in a RAM carveout
On Mon, Mar 09, 2015 at 08:00:18AM +0100, Jan Kiszka wrote: In this case the secure code lives in RAM, and hence the memory node in the device tree needs to be adjusted. This avoids that the OS will map and possibly access the reservation. Add support for setting CONFIG_ARMV7_SECURE_RESERVE_SIZE to carve out such a region. We only support cutting off memory from the beginning or the end of a RAM bank as we do not want to increase their number (which would happen if punching a hole) for simplicity reasons This will be used in a subsequent patch for Jetson-TK1. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- arch/arm/cpu/armv7/virt-dt.c | 29 + My concern here is that this looks a lot like things we would re-use on armv8 and we're making them potentially needlessly v7-centric. If nothing else, the function names should be generic and this be the v7 implementation of them, yes? -- 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 v5 11/14] tegra124: Add PSCI support for Tegra124
On Mon, Mar 09, 2015 at 08:00:21AM +0100, Jan Kiszka wrote: This is based on Thierry Reding's work and uses Ian Campell's preparatory patches. It comes with full support for CPU_ON/OFF PSCI services. The algorithm used in this version for turning CPUs on and off was proposed by Peter De Schrijver and Thierry Reding in http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/210881. It consists of first enabling CPU1..3 via the PMC, just to powergate them again with the help of the Flow Controller. Once the Flow Controller is in place, we can leave the PMC alone while processing CPU_ON and CPU_OFF PSCI requests. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Reviewed-by: Tom Rini tr...@konsulko.com -- 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 v5 06/14] ARM: Put target PC for PSCI CPU_ON on per-CPU stack
On Mon, Mar 09, 2015 at 08:00:16AM +0100, Jan Kiszka wrote: Use a per-CPU variable for saving the target PC during CPU_ON operations. This allows us to run this service independently on targets that have more than 2 cores and also core-local power control. CC: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Jan Kiszka jan.kis...@siemens.com Reviewed-by: Tom Rini tr...@konsulko.com -- 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 V6 11/11] ARM: OMAP3: rx51: Enable workaround for ARM errata 454179, 430973, 621766
On Mon, Mar 09, 2015 at 05:12:09PM -0500, Nishanth Menon wrote: RX51 has a secure logic which uses different parameters compared to traditional implementation. So, make the generic secure acr write over-ride-able by board file and refactor rx51 code to use this. While at it, enable the OMAP3 specific errata code for 454179, 430973, 621766. Signed-off-by: Nishanth Menon n...@ti.com Reviewed-by: Tom Rini tr...@konsulko.com But I'd really like to see a test on real hardware, Pali? -- 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 v5 02/14] ARM: Factor out common psci_get_cpu_id
On Mon, Mar 09, 2015 at 08:00:12AM +0100, Jan Kiszka wrote: Will be required for obtaining the ID of the current CPU in shared PSCI functions. The default implementation requires a dense ID space and only supports a single cluster. Therefore, the functions can be overloaded in cases where these assumptions do not hold. CC: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Jan Kiszka jan.kis...@siemens.com Reviewed-by: Tom Rini tr...@konsulko.com -- 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 V6 02/11] ARM: Introduce erratum workaround for 454179
On Mon, Mar 09, 2015 at 05:12:00PM -0500, Nishanth Menon wrote: 454179: Stale prediction may inhibit target address misprediction on next predicted taken branch Impacts: Every Cortex-A8 processors with revision lower than r2p1 Work around: Set IBE and disable branch size mispredict to 1 Also provide a hook for SoC specific handling to take place if needed. Based on ARM errata Document revision 20.0 (13 Nov 2010) Signed-off-by: Nishanth Menon n...@ti.com Reviewed-by: Tom Rini tr...@konsulko.com -- 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 V6 04/11] ARM: Introduce erratum workaround for 621766
On Mon, Mar 09, 2015 at 05:12:02PM -0500, Nishanth Menon wrote: 621766: Under a specific set of conditions, executing a sequence of NEON or vfp load instructions can cause processor deadlock Impacts: Every Cortex-A8 processors with revision lower than r2p1 Work around: Set L1NEON to 1 Based on ARM errata Document revision 20.0 (13 Nov 2010) Signed-off-by: Nishanth Menon n...@ti.com Reviewed-by: Tom Rini tr...@konsulko.com -- 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 V6 00/11] ARM: OMAP3-DRA7: CP15 erratum workarounds and improvements
On Mon, Mar 09, 2015 at 05:11:58PM -0500, Nishanth Menon wrote: The sixth revision should be proper, I hope. (skipping all the blurb and pointing to v1 for the blurb). Changes since v5: - omap_smc1 is now in omap_common.h - I hope we can pick up Matt's Tested-by tag from previous rev.. http://article.gmane.org/gmane.comp.boot-loaders.u-boot/214277 In the future please collect those :) Or would that be too different from kernel policy? -- 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] Please pull u-boot-tegra.git/master
THanks, Tom. -Original Message- From: Tom Rini [mailto:tr...@konsulko.com] Sent: Tuesday, March 10, 2015 5:56 PM To: Tom Warren Cc: Tom Warren; Albert ARIBAUD; u-boot@lists.denx.de; Stephen Warren; Marcel Ziswiler Subject: Re: [U-Boot] Please pull u-boot-tegra.git/master * PGP Signed by an unknown key On Tue, Mar 10, 2015 at 10:25:03PM +, Tom Warren wrote: Albert – are you getting these emails? I know they’re bouncing from the list (need to find a mailer that doesn’t use MIME64), but I haven’t heard back from you for the last 2 PRs. FWIW, you can make git send-email do the sending of the PR and that may help. Esp since it looks like you already have gmail setup to know your work email (if not it's an easy enough thing to make it send from it, I did it back at TI even). Should I send these to Tom Rini instead? Please let me know. Yeah, I'm doing ARM SoC PRs now. Tom From: Tom Warren [mailto:tomcwarren3...@gmail.com] Sent: Thursday, March 05, 2015 4:27 PM To: Albert ARIBAUD Cc: u-boot@lists.denx.de; Marcel Ziswiler; Stephen Warren; Tom Warren Subject: Please pull u-boot-tegra.git/master Albert, Please pull u-boot-tegra.git/master into ARM master. ./MAKEALL -s tegra is clean. Stephen confirmed that Jetson-TK1 looks OK. NOTE: This PR includes some of Stephen's patches from a previous PR that never went in AFAICT (Sent Feb 3rd). I'm sending this from my Gmail account since my work Outlook always bounces from the list due to base64 MIME errors. The following changes since commit 02251eefc95c477f4ff6aa7568dfd4be7c69c31f: ARM: HYP/non-sec: relocation before enable secondary cores (2015-03-01 16:33:21 +0100) are available in the git repository at: git://git.denx.de/u-boot-tegra.githttp://git.denx.de/u-boot-tegra.git master for you to fetch changes up to d5338c693e6a35a7108c184839d688a7377d117c: apalis/colibri_t30: add misc cmds increase buf sizes and max args (2015-03-04 10:09:02 -0700) Applied to u-boot/master, thanks! -- Tom * Unknown Key * 0x56D6FECD --- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. --- ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v5 10/14] tegra: Add ap_pm_init hook
On Mon, Mar 09, 2015 at 08:00:20AM +0100, Jan Kiszka wrote: This function will be used to initialize CPU power management for Tegra SOCs. For now it does nothing. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Reviewed-by: Tom Rini tr...@konsulko.com -- 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 v5 07/14] tegra124: Add more registers to struct mc_ctlr
On Mon, Mar 09, 2015 at 08:00:17AM +0100, Jan Kiszka wrote: From: Ian Campbell i...@hellion.org.uk I will need mc_security_cfg0/1 in a future patch and I added the rest while debugging, so thought I might as well commit them. Signed-off-by: Ian Campbell i...@hellion.org.uk Signed-off-by: Jan Kiszka jan.kis...@siemens.com Reviewed-by: Tom Rini tr...@konsulko.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 4/4] common/lcd_console: introduce display/framebuffer rotation
From: Hannes Petermaier hannes.peterma...@br-automation.com Sometimes, for example if the display is mounted in portrait mode or even if it mounted landscape but rotated by 180 degrees, we need to rotate our content of the display respectively the framebuffer, so that user can read the messages who are printed out. For this we introduce the feature called CONFIG_LCD_ROTATION, this may be defined in the board-configuration if needed. After this the lcd_console will be initialized with a given rotation from vl_rot out of vidinfo_t which is provided by the board specific code. If CONFIG_LCD_ROTATION is not defined, the console will be initialized with 0 degrees rotation - the screen behaves like the days before. Signed-off-by: Hannes Petermaier hannes.peterma...@br-automation.com Signed-off-by: Hannes Petermaier oe5...@oevsv.at --- README| 17 +++ common/lcd.c | 22 ++-- common/lcd_console.c | 333 - include/lcd.h |1 + include/lcd_console.h |9 +- 5 files changed, 309 insertions(+), 73 deletions(-) diff --git a/README b/README index 3c4a2e6..a95b1e8 100644 --- a/README +++ b/README @@ -1933,6 +1933,23 @@ CBFS (Coreboot Filesystem) support the console jump but can help speed up operation when scrolling is slow. + CONFIG_LCD_ROTATION + + Sometimes, for example if the display is mounted in portrait + mode or even if it mounted landscape but rotated by 180degree, + we need to rotate our content of the display respectively the + framebuffer, so that user can read the messages who are printed + out. + For this we introduce the feature called CONFIG_LCD_ROTATION, + this may be defined in the board-configuration if needed. After + this the lcd_console will be initialized with a given rotation + from vl_rot out of vidinfo_t which is provided by the board + specific code. + + If CONFIG_LCD_ROTATION is not defined, the console will be + initialized with 0degree rotation - the screen behaves like the + days before. + CONFIG_LCD_BMP_RLE8 Support drawing of RLE8-compressed bitmaps on the LCD. diff --git a/common/lcd.c b/common/lcd.c index f33942c..dfa4c69 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -167,7 +167,6 @@ int drv_lcd_init(void) void lcd_clear(void) { - short console_rows, console_cols; int bg_color; char *s; ulong addr; @@ -211,16 +210,21 @@ void lcd_clear(void) } #endif #endif - /* Paint the logo and retrieve LCD base address */ - debug([LCD] Drawing the logo...\n); -#if defined(CONFIG_LCD_LOGO) !defined(CONFIG_LCD_INFO_BELOW_LOGO) - console_rows = (panel_info.vl_row - BMP_LOGO_HEIGHT); - console_rows /= VIDEO_FONT_HEIGHT; + /* setup text-console */ + debug([LCD] setting up console...\n); +#ifdef CONFIG_LCD_ROTATION + lcd_init_console(lcd_base, +panel_info.vl_col, +panel_info.vl_row, +panel_info.vl_rot); #else - console_rows = panel_info.vl_row / VIDEO_FONT_HEIGHT; + lcd_init_console(lcd_base, +panel_info.vl_col, +panel_info.vl_row, +0); #endif - console_cols = panel_info.vl_col / VIDEO_FONT_WIDTH; - lcd_init_console(lcd_base, console_rows, console_cols); + /* Paint the logo and retrieve LCD base address */ + debug([LCD] Drawing the logo...\n); if (do_splash) { s = getenv(splashimage); if (s) { diff --git a/common/lcd_console.c b/common/lcd_console.c index cac77be..6199c9a 100644 --- a/common/lcd_console.c +++ b/common/lcd_console.c @@ -2,6 +2,7 @@ * (C) Copyright 2001-2014 * DENX Software Engineering -- w...@denx.de * Compulab Ltd - http://compulab.co.il/ + * Bernecker Rainer Industrieelektronik GmbH - http://www.br-automation.com * * SPDX-License-Identifier:GPL-2.0+ */ @@ -10,26 +11,27 @@ #include lcd.h #include video_font.h/* Get font data, width and height */ -#define CONSOLE_ROW_SIZE (VIDEO_FONT_HEIGHT * lcd_line_length) -#define CONSOLE_ROW_FIRST cons.lcd_address -#define CONSOLE_SIZE (CONSOLE_ROW_SIZE * cons.rows) +#define PIXLBYTES (NBYTES(LCD_BPP)) + +#if LCD_BPP == LCD_COLOR16 + #define fbptr_t ushort +#elif LCD_BPP == LCD_COLOR32 + #define fbptr_t u32 +#else + #define fbptr_t uchar +#endif struct console_t { short curr_col, curr_row; short cols, rows; void *lcd_address; + u32 lcdsizex, lcdsizey; + void (*fp_putc_xy)(ushort x, ushort y, char c); + void (*fp_console_moverow)(u32 rowdst, u32 rowsrc); +
Re: [U-Boot] [PATCH V6 00/11] ARM: OMAP3-DRA7: CP15 erratum workarounds and improvements
On Wed, Mar 11, 2015 at 10:51:12AM -0500, Nishanth Menon wrote: On Wed, Mar 11, 2015 at 10:48 AM, Tom Rini tr...@konsulko.com wrote: On Mon, Mar 09, 2015 at 05:11:58PM -0500, Nishanth Menon wrote: The sixth revision should be proper, I hope. (skipping all the blurb and pointing to v1 for the blurb). Changes since v5: - omap_smc1 is now in omap_common.h - I hope we can pick up Matt's Tested-by tag from previous rev.. http://article.gmane.org/gmane.comp.boot-loaders.u-boot/214277 In the future please collect those :) Or would that be too different from kernel policy? I did change code as per rev5 review comments, so was'nt too sure if i could carry the tested-by tag over.. Ah yes. Matt, would you have time to test it all again? Thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Regression in bootcmd handling in v2015.04-rc3?
On 03/11/2015 03:21 PM, Karsten Merker wrote: On Wed, Mar 11, 2015 at 02:31:07PM -0600, Stephen Warren wrote: For manual booting, I would expect to always run the device-specific command (e.g. bootcmd_usb0 or bootcmd_mmc1) rather than the device-type-specific command (e.g. usb_boot, mmc_boot). I'm not sure how the type-generic commands ever worked without variables such as ${devnum} set, since they all pass ${devnum} to a variety of commands in addition to the new part list. Perhaps those commands default to devnum==0 if the parameter is missing, and you never wanted to boot e.g. from mmc 1 instead of mmc 0? Yes, indeed - my boards only have a single instance of all devices. I have just tried to single-step through the bootcmd framework in u-boot 2014.10 (which is what Debian 8 will release with and where run usb_boot works). All commands used there work when ${devnum} is empty and then default to 0, while the later-added part list fails without an explictly set ${devnum}. As a result I will need to update the Debian installation documentation. As I would like to do it right this time ;-), I just would like to get the confirmation that the device-specific commands, such as run bootcmd_usb0, are an official interface that is going to stay in future u-boot versions, or - if they are not - get the information what is the offical method for booting from a specific device at the prompt. We don't actually have an official specification of that at present. doc/README.distro should probably cover this but doesn't. Suffice to say, I use those macros all the time, and I intended them to be used this way when I wrote the boot scripts. So, if I notice a change that stops them from working without extremely good reason, I'll complain. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] mx6: Set shared override bit in PL310 AUX_CTRL register
From: Fabio Estevam fabio.este...@freescale.com Having bit 22 cleared in the PL310 Auxiliary Control register (shared attribute override enable) has the side effect of transforming Normal Shared Non-cacheable reads into Cacheable no-allocate reads. Coherent DMA buffers in Linux always have a Cacheable alias via the kernel linear mapping and the processor can speculatively load cache lines into the PL310 controller. With bit 22 cleared, Non-cacheable reads would unexpectedly hit such cache lines leading to buffer corruption. This was inspired by a patch from Catalin Marinas [1] and also from recent discussions in the linux-arm-kernel list [2] where Russell King and Rob Herring suggested that bootloaders should initialize the cache. [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2010-November/031810.html [2] https://lkml.org/lkml/2015/2/20/199 Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- arch/arm/cpu/armv7/mx6/soc.c | 8 arch/arm/include/asm/pl310.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c index ef02972..5aab305 100644 --- a/arch/arm/cpu/armv7/mx6/soc.c +++ b/arch/arm/cpu/armv7/mx6/soc.c @@ -506,6 +506,14 @@ void v7_outer_cache_enable(void) struct pl310_regs *const pl310 = (struct pl310_regs *)L2_PL310_BASE; unsigned int val; + + /* +* Set bit 22 in the auxiliary control register. If this bit +* is cleared, PL310 treats Normal Shared Non-cacheable +* accesses as Cacheable no-allocate. +*/ + setbits_le32(pl310-pl310_aux_ctrl, L310_SHARED_ATT_OVERRIDE_ENABLE); + #if defined CONFIG_MX6SL struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR; val = readl(iomux-gpr[11]); diff --git a/arch/arm/include/asm/pl310.h b/arch/arm/include/asm/pl310.h index ddc245b..de7650e 100644 --- a/arch/arm/include/asm/pl310.h +++ b/arch/arm/include/asm/pl310.h @@ -16,6 +16,8 @@ #define L2X0_STNDBY_MODE_EN(1 0) #define L2X0_CTRL_EN 1 +#define L310_SHARED_ATT_OVERRIDE_ENABLE(1 22) + struct pl310_regs { u32 pl310_cache_id; u32 pl310_cache_type; -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V6 07/11] ARM: OMAP3: Get rid of omap3_gp_romcode_call and replace with omap_smc1
Le mercredi 11 mars 2015 à 11:04 -0500, Nishanth Menon a écrit : On Wed, Mar 11, 2015 at 11:00 AM, Tom Rini tr...@konsulko.com wrote: On Wed, Mar 11, 2015 at 10:53:41AM -0500, Nishanth Menon wrote: On Wed, Mar 11, 2015 at 10:48 AM, Tom Rini tr...@konsulko.com wrote: On Mon, Mar 09, 2015 at 05:12:05PM -0500, Nishanth Menon wrote: omap_smc1 is now generic enough to remove duplicate omap3_gp_romcode_call logic that omap3 introduced. As part of this change, move to using the generic lowlevel_init.S for omap3 as well. Signed-off-by: Nishanth Menon n...@ti.com Reviewed-by: Tom Rini tr...@konsulko.com But I've always wondered, does OMAP3 not actually pass in the same info in the same location / manner as OMAP4 and later? For smc call, the calls are similar, but the parameters change Right, sorry but I mean for boot params as that's what's still being omap3-specific in lowlevel_init.S There seemed to be differences w.r.t bootdevice detection logic which seems to be extensive in omap3 :( had'nt dug too much there :( As far as I can see, the main difference is that omap4/5 are using SRAM to store various bits such as the boot device (OMAP_SRAM_SCRATCH_BOOT_PARAMS). On omap3, that logic is not used and a global variable (omap3_boot_device) is there instead. We could easily make that logic fit omap3 as well and get rid of the global variable. I also see a few functions from omap-common's hwinit-common.c that could be reused on omap3. I could start looking into that, even though again, I don't have many OMAP devices to test with. -- Paul Kocialkowski, Replicant developer Replicant is a fully free Android distribution running on several devices, a free software mobile operating system putting the emphasis on freedom and privacy/security. Website: http://www.replicant.us/ Blog: http://blog.replicant.us/ Wiki/tracker/forums: http://redmine.replicant.us/ signature.asc Description: This is a digitally signed message part ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Regression in bootcmd handling in v2015.04-rc3?
On 03/11/2015 02:20 PM, Karsten Merker wrote: On Wed, Mar 04, 2015 at 08:53:37PM +0100, Karsten Merker wrote: On Tue, Mar 03, 2015 at 06:31:37PM -0500, Tom Rini wrote: I've pushed v2015.04-rc3 out to the repository and tarballs should exist soon. [...] As always, if anything is broken please speak up. Hello, I have tested v2015.04-rc3 and have stumbled over a problem with the distro_bootcmd framework when trying to boot from a specific device at the u-boot command prompt by using run device_boot. Autobooting without user interruption of the boot process works fine: ... Interrupting the boot sequence and then manually executing e.g. run usb_boot results in a ** Bad device specification usb devplist ** error message: sunxi# run usb_boot USB device 0: Vendor: Intenso Rev: Prod: Rainbow Type: Removable Hard Disk Capacity: 7620.0 MB = 7.4 GB (15605760 x 512) ** Bad device specification usb devplist ** sunxi# The reason for this is that in this constellation ${devnum} is undefined, which leads to a failure of the part list ${devtype} ${devnum} devplist command in ${scan_dev_for_boot_part}. Older versions of u-boot did not use the part list command, so this problem did not occur there. Using run bootcmd_usb0 instead of run usb_boot works, but my understanding (which may of course be wrong) was that the user is expected to use run device_boot for booting from a specific device at the u-boot command prompt, and that has worked without problems in previous u-boot versions. Hello, as my original email appears to have fallen through the cracks, I'd like to ask again whether using run device_boot is officially expected to work or not. If it is not, what is the officially supported way for a user to boot from a certain device at the u-boot prompt? Should people use setenv boot_targets foo; run bootcmd instead? Sorry, I didn't see the original email. For manual booting, I would expect to always run the device-specific command (e.g. bootcmd_usb0 or bootcmd_mmc1) rather than the device-type-specific command (e.g. usb_boot, mmc_boot). I'm not sure how the type-generic commands ever worked without variables such as ${devnum} set, since they all pass ${devnum} to a variety of commands in addition to the new part list. Perhaps those commands default to devnum==0 if the parameter is missing, and you never wanted to boot e.g. from mmc 1 instead of mmc 0? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V6 07/11] ARM: OMAP3: Get rid of omap3_gp_romcode_call and replace with omap_smc1
Le mercredi 11 mars 2015 à 17:16 -0400, Tom Rini a écrit : On Wed, Mar 11, 2015 at 09:26:43PM +0100, Paul Kocialkowski wrote: Le mercredi 11 mars 2015 à 11:04 -0500, Nishanth Menon a écrit : On Wed, Mar 11, 2015 at 11:00 AM, Tom Rini tr...@konsulko.com wrote: On Wed, Mar 11, 2015 at 10:53:41AM -0500, Nishanth Menon wrote: On Wed, Mar 11, 2015 at 10:48 AM, Tom Rini tr...@konsulko.com wrote: On Mon, Mar 09, 2015 at 05:12:05PM -0500, Nishanth Menon wrote: omap_smc1 is now generic enough to remove duplicate omap3_gp_romcode_call logic that omap3 introduced. As part of this change, move to using the generic lowlevel_init.S for omap3 as well. Signed-off-by: Nishanth Menon n...@ti.com Reviewed-by: Tom Rini tr...@konsulko.com But I've always wondered, does OMAP3 not actually pass in the same info in the same location / manner as OMAP4 and later? For smc call, the calls are similar, but the parameters change Right, sorry but I mean for boot params as that's what's still being omap3-specific in lowlevel_init.S There seemed to be differences w.r.t bootdevice detection logic which seems to be extensive in omap3 :( had'nt dug too much there :( As far as I can see, the main difference is that omap4/5 are using SRAM to store various bits such as the boot device (OMAP_SRAM_SCRATCH_BOOT_PARAMS). On omap3, that logic is not used and a global variable (omap3_boot_device) is there instead. We could easily make that logic fit omap3 as well and get rid of the global variable. I also see a few functions from omap-common's hwinit-common.c that could be reused on omap3. I could start looking into that, even though again, I don't have many OMAP devices to test with. Right, but is the data format the same or did it change, in what we're reading? The boot structure is very similar (at least between omap3 and omap4). This is chapter 27.4.8.4 Image Execution of the OMAP4430 TRM and chapter 26.4.8.4 Image Execution of the OMAP36xx TRM. There is some padding difference between omap3 and omap4, but nothing we can't deal with in omap-common.c's save_omap_boot_params: some offsets are already defined at omap_boot.h, we probably just need to adjust those for omap3. signature.asc Description: This is a digitally signed message part ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Regression in bootcmd handling in v2015.04-rc3? (was: [ANN] U-Boot v2015.04-rc3 released)
On Wed, Mar 11, 2015 at 09:20:46PM +0100, Karsten Merker wrote: On Wed, Mar 04, 2015 at 08:53:37PM +0100, Karsten Merker wrote: On Tue, Mar 03, 2015 at 06:31:37PM -0500, Tom Rini wrote: I've pushed v2015.04-rc3 out to the repository and tarballs should exist soon. [...] As always, if anything is broken please speak up. Hello, I have tested v2015.04-rc3 and have stumbled over a problem with the distro_bootcmd framework when trying to boot from a specific device at the u-boot command prompt by using run device_boot. Autobooting without user interruption of the boot process works fine: U-Boot SPL 2015.04-rc3 (Mar 04 2015 - 19:43:43) DRAM: 1024 MiB CPU: 96000Hz, AXI/AHB/APB: 3/2/2 U-Boot 2015.04-rc3 (Mar 04 2015 - 19:43:43) Allwinner Technology CPU: Allwinner A20 (SUN7I) I2C: ready DRAM: 1 GiB MMC: SUNXI SD/MMC: 0 *** Warning - bad CRC, using default environment In:serial Out: serial Err: serial SCSI: SUNXI SCSI INIT SATA link 0 timeout. AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode flags: ncq stag pm led clo only pmp pio slum part ccc apst Net: dwmac.1c5 starting USB... USB0: USB EHCI 1.00 scanning bus 0 for devices... 2 USB Device(s) found USB1: USB EHCI 1.00 scanning bus 1 for devices... 1 USB Device(s) found scanning usb for storage devices... 1 Storage Device(s) found Hit any key to stop autoboot: 0 switch to partitions #0, OK mmc0 is current device scanning bus for devices... Found 0 device(s). SCSI device 0: Device 0: not available USB device 0: Device 0: Vendor: Intenso Rev: Prod: Rainbow Type: Removable Hard Disk Capacity: 7620.0 MB = 7.4 GB (15605760 x 512) ... is now current device Scanning usb 0:1... Found U-Boot script /boot.scr reading /boot.scr 1263 bytes read in 22 ms (55.7 KiB/s) ## Executing script at 4310 [...] Interrupting the boot sequence and then manually executing e.g. run usb_boot results in a ** Bad device specification usb devplist ** error message: sunxi# run usb_boot USB device 0: Vendor: Intenso Rev: Prod: Rainbow Type: Removable Hard Disk Capacity: 7620.0 MB = 7.4 GB (15605760 x 512) ** Bad device specification usb devplist ** sunxi# The reason for this is that in this constellation ${devnum} is undefined, which leads to a failure of the part list ${devtype} ${devnum} devplist command in ${scan_dev_for_boot_part}. Older versions of u-boot did not use the part list command, so this problem did not occur there. Using run bootcmd_usb0 instead of run usb_boot works, but my understanding (which may of course be wrong) was that the user is expected to use run device_boot for booting from a specific device at the u-boot command prompt, and that has worked without problems in previous u-boot versions. Hello, as my original email appears to have fallen through the cracks, I'd like to ask again whether using run device_boot is officially expected to work or not. If it is not, what is the officially supported way for a user to boot from a certain device at the u-boot prompt? Should people use setenv boot_targets foo; run bootcmd instead? Can you git bisect down to the problem commit and then we can poke the authors and other folks with a strong opinion on the distro bootcmd bits? Thanks again! -- 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] 4K padding of ARM DT blob
On Wed, Mar 11, 2015 at 01:01:12PM -0600, Simon Glass wrote: Hi, On 10 March 2015 at 23:48, Masahiro Yamada yamada.masah...@socionext.com wrote: Hi Yehuda, Tom, Simon, 2015-03-07 0:12 GMT+09:00 Tom Rini tr...@konsulko.com: On Thu, Mar 05, 2015 at 06:20:35PM +, Yehuda Yitschak wrote: Hey Tom In arch/arm/dts/Makfile: line 56 DTC_FLAGS += -R 4 -p 0x1000 this tell the dtc tool to add a 4K padding to the device tree blob. i can't figure out why this is needed. Its creating a 4KB penalty on the dtb file so i guess it has some justification. That's interesting and I don't see a corresponding thing in the kernel. Masahiro? This dates back to the introduction of the Makefile and that's you in the git log, thanks! Not me! I just converted the Makefile into Kbuild style. The option -R 4 -p 0x1000 was introduced by: commit bbb0b128c3956ac549471addc314702fbe0ace63 Author: Simon Glass s...@chromium.org Date: Sat Oct 15 05:48:21 2011 + fdt: Add support for embedded device tree (CONFIG_OF_EMBED) Simon, Looks like the 4K padding was introduced by you. Can you explain why? I think at the time perhaps we were thinking of modifying the FDT in early U-Boot init, but that did not happen. I think it can be dropped. Using my time machine I just sent a patch to do this a few weeks ago: http://patchwork.ozlabs.org/patch/444847/ As part of your start-on-rockchip series (Thanks, btw) :) -- 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 V6 07/11] ARM: OMAP3: Get rid of omap3_gp_romcode_call and replace with omap_smc1
On Wed, Mar 11, 2015 at 09:26:43PM +0100, Paul Kocialkowski wrote: Le mercredi 11 mars 2015 à 11:04 -0500, Nishanth Menon a écrit : On Wed, Mar 11, 2015 at 11:00 AM, Tom Rini tr...@konsulko.com wrote: On Wed, Mar 11, 2015 at 10:53:41AM -0500, Nishanth Menon wrote: On Wed, Mar 11, 2015 at 10:48 AM, Tom Rini tr...@konsulko.com wrote: On Mon, Mar 09, 2015 at 05:12:05PM -0500, Nishanth Menon wrote: omap_smc1 is now generic enough to remove duplicate omap3_gp_romcode_call logic that omap3 introduced. As part of this change, move to using the generic lowlevel_init.S for omap3 as well. Signed-off-by: Nishanth Menon n...@ti.com Reviewed-by: Tom Rini tr...@konsulko.com But I've always wondered, does OMAP3 not actually pass in the same info in the same location / manner as OMAP4 and later? For smc call, the calls are similar, but the parameters change Right, sorry but I mean for boot params as that's what's still being omap3-specific in lowlevel_init.S There seemed to be differences w.r.t bootdevice detection logic which seems to be extensive in omap3 :( had'nt dug too much there :( As far as I can see, the main difference is that omap4/5 are using SRAM to store various bits such as the boot device (OMAP_SRAM_SCRATCH_BOOT_PARAMS). On omap3, that logic is not used and a global variable (omap3_boot_device) is there instead. We could easily make that logic fit omap3 as well and get rid of the global variable. I also see a few functions from omap-common's hwinit-common.c that could be reused on omap3. I could start looking into that, even though again, I don't have many OMAP devices to test with. Right, but is the data format the same or did it change, in what we're reading? -- 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] 4K padding of ARM DT blob
Hi, On 10 March 2015 at 23:48, Masahiro Yamada yamada.masah...@socionext.com wrote: Hi Yehuda, Tom, Simon, 2015-03-07 0:12 GMT+09:00 Tom Rini tr...@konsulko.com: On Thu, Mar 05, 2015 at 06:20:35PM +, Yehuda Yitschak wrote: Hey Tom In arch/arm/dts/Makfile: line 56 DTC_FLAGS += -R 4 -p 0x1000 this tell the dtc tool to add a 4K padding to the device tree blob. i can't figure out why this is needed. Its creating a 4KB penalty on the dtb file so i guess it has some justification. That's interesting and I don't see a corresponding thing in the kernel. Masahiro? This dates back to the introduction of the Makefile and that's you in the git log, thanks! Not me! I just converted the Makefile into Kbuild style. The option -R 4 -p 0x1000 was introduced by: commit bbb0b128c3956ac549471addc314702fbe0ace63 Author: Simon Glass s...@chromium.org Date: Sat Oct 15 05:48:21 2011 + fdt: Add support for embedded device tree (CONFIG_OF_EMBED) Simon, Looks like the 4K padding was introduced by you. Can you explain why? I think at the time perhaps we were thinking of modifying the FDT in early U-Boot init, but that did not happen. I think it can be dropped. Using my time machine I just sent a patch to do this a few weeks ago: http://patchwork.ozlabs.org/patch/444847/ Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Add bootscript support to esbc_validate.
On 03/11/2015 11:44 AM, Scott Wood wrote: On Wed, 2015-03-11 at 10:50 -0700, York Sun wrote: On 03/11/2015 03:39 AM, Gupta Ruchika-R66431 wrote: Hi York, -Original Message- From: Sun York-R58495 Sent: Tuesday, March 10, 2015 10:03 PM To: Gupta Ruchika-R66431; Rana Gaurav-B46163; u-boot@lists.denx.de Cc: Wood Scott-B07421; Bansal Aneesh-B39320 Subject: Re: [PATCH] Add bootscript support to esbc_validate. On 03/10/2015 09:25 AM, Gupta Ruchika-R66431 wrote: Hi York, -Original Message- From: Sun York-R58495 Sent: Tuesday, March 10, 2015 9:45 PM To: Rana Gaurav-B46163; u-boot@lists.denx.de Cc: Wood Scott-B07421; Gupta Ruchika-R66431; Bansal Aneesh-B39320 Subject: Re: [PATCH] Add bootscript support to esbc_validate. On 03/10/2015 01:38 AM, Gaurav Rana wrote: 1. Default environment will be used for secure boot flow which can't be edited or saved. 2. Command for secure boot is predefined in the default environment which will run on autoboot (and autoboot is the only option allowed in case of secure boot) and it looks like this: #define CONFIG_SECBOOT \ setenv bs_hdraddr 0xe8e0; \ esbc_validate $bs_hdraddr;\ source $img_addr; \ esbc_halt; #endif 3. Boot Script can contain esbc_validate commands and bootm command. Uboot source command used in default secure boot command will run the bootscript. 4. Command esbc_halt added to ensure either bootm executes after validation of images or core should just spin. What's the purpose of esbc_halt? Once it enters the spin, how to get it out? The purpose of bootscript is to validate the next level images and then pass control to it, so bootscript must contain a bootm command. We don't expect control to return back to u-boot. Hence a command esbc_halt is introduced which would make the core spin and not provide uboot prompt in case bootscript doesn't pass control to next level image. For secure chain of trust, only validated bootscript should be allowed to execute and be responsible for passing control to next level image. Ruchika, Do you expect secure boot to run automatically once u-boot reaches the prompt and the source $img_addr to actually boot the OS? You put esbc_halt as a fall-back to catch failure above? It doesn't sounds very secure to me. The bootscript is first validated. Only an authenticated user, who has the private key can sign the bootscript. Thus validating bootscript is important in secure boot chain of trust. You are right regarding fallback as esbc_halt. In the esbc_halt implementation, we will add code to clear security secrets on the chip, and issue a reset. We will send a separate patch for that. Wouldn't it be possible to call a reset/hang/panic when the validation fails, before source $img_addr? I'd assume it already has that, but it's still good to have something to deal with the case where the script returns due to some failure. If that's the case, I am OK with the addition of esbc_halt command. York ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Add bootscript support to esbc_validate.
On 03/11/2015 03:39 AM, Gupta Ruchika-R66431 wrote: Hi York, -Original Message- From: Sun York-R58495 Sent: Tuesday, March 10, 2015 10:03 PM To: Gupta Ruchika-R66431; Rana Gaurav-B46163; u-boot@lists.denx.de Cc: Wood Scott-B07421; Bansal Aneesh-B39320 Subject: Re: [PATCH] Add bootscript support to esbc_validate. On 03/10/2015 09:25 AM, Gupta Ruchika-R66431 wrote: Hi York, -Original Message- From: Sun York-R58495 Sent: Tuesday, March 10, 2015 9:45 PM To: Rana Gaurav-B46163; u-boot@lists.denx.de Cc: Wood Scott-B07421; Gupta Ruchika-R66431; Bansal Aneesh-B39320 Subject: Re: [PATCH] Add bootscript support to esbc_validate. On 03/10/2015 01:38 AM, Gaurav Rana wrote: 1. Default environment will be used for secure boot flow which can't be edited or saved. 2. Command for secure boot is predefined in the default environment which will run on autoboot (and autoboot is the only option allowed in case of secure boot) and it looks like this: #define CONFIG_SECBOOT \ setenv bs_hdraddr 0xe8e0; \ esbc_validate $bs_hdraddr;\ source $img_addr; \ esbc_halt; #endif 3. Boot Script can contain esbc_validate commands and bootm command. Uboot source command used in default secure boot command will run the bootscript. 4. Command esbc_halt added to ensure either bootm executes after validation of images or core should just spin. What's the purpose of esbc_halt? Once it enters the spin, how to get it out? The purpose of bootscript is to validate the next level images and then pass control to it, so bootscript must contain a bootm command. We don't expect control to return back to u-boot. Hence a command esbc_halt is introduced which would make the core spin and not provide uboot prompt in case bootscript doesn't pass control to next level image. For secure chain of trust, only validated bootscript should be allowed to execute and be responsible for passing control to next level image. Ruchika, Do you expect secure boot to run automatically once u-boot reaches the prompt and the source $img_addr to actually boot the OS? You put esbc_halt as a fall-back to catch failure above? It doesn't sounds very secure to me. The bootscript is first validated. Only an authenticated user, who has the private key can sign the bootscript. Thus validating bootscript is important in secure boot chain of trust. You are right regarding fallback as esbc_halt. In the esbc_halt implementation, we will add code to clear security secrets on the chip, and issue a reset. We will send a separate patch for that. Wouldn't it be possible to call a reset/hang/panic when the validation fails, before source $img_addr? York ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Add bootscript support to esbc_validate.
On Wed, 2015-03-11 at 10:50 -0700, York Sun wrote: On 03/11/2015 03:39 AM, Gupta Ruchika-R66431 wrote: Hi York, -Original Message- From: Sun York-R58495 Sent: Tuesday, March 10, 2015 10:03 PM To: Gupta Ruchika-R66431; Rana Gaurav-B46163; u-boot@lists.denx.de Cc: Wood Scott-B07421; Bansal Aneesh-B39320 Subject: Re: [PATCH] Add bootscript support to esbc_validate. On 03/10/2015 09:25 AM, Gupta Ruchika-R66431 wrote: Hi York, -Original Message- From: Sun York-R58495 Sent: Tuesday, March 10, 2015 9:45 PM To: Rana Gaurav-B46163; u-boot@lists.denx.de Cc: Wood Scott-B07421; Gupta Ruchika-R66431; Bansal Aneesh-B39320 Subject: Re: [PATCH] Add bootscript support to esbc_validate. On 03/10/2015 01:38 AM, Gaurav Rana wrote: 1. Default environment will be used for secure boot flow which can't be edited or saved. 2. Command for secure boot is predefined in the default environment which will run on autoboot (and autoboot is the only option allowed in case of secure boot) and it looks like this: #define CONFIG_SECBOOT \ setenv bs_hdraddr 0xe8e0; \ esbc_validate $bs_hdraddr;\ source $img_addr; \ esbc_halt; #endif 3. Boot Script can contain esbc_validate commands and bootm command. Uboot source command used in default secure boot command will run the bootscript. 4. Command esbc_halt added to ensure either bootm executes after validation of images or core should just spin. What's the purpose of esbc_halt? Once it enters the spin, how to get it out? The purpose of bootscript is to validate the next level images and then pass control to it, so bootscript must contain a bootm command. We don't expect control to return back to u-boot. Hence a command esbc_halt is introduced which would make the core spin and not provide uboot prompt in case bootscript doesn't pass control to next level image. For secure chain of trust, only validated bootscript should be allowed to execute and be responsible for passing control to next level image. Ruchika, Do you expect secure boot to run automatically once u-boot reaches the prompt and the source $img_addr to actually boot the OS? You put esbc_halt as a fall-back to catch failure above? It doesn't sounds very secure to me. The bootscript is first validated. Only an authenticated user, who has the private key can sign the bootscript. Thus validating bootscript is important in secure boot chain of trust. You are right regarding fallback as esbc_halt. In the esbc_halt implementation, we will add code to clear security secrets on the chip, and issue a reset. We will send a separate patch for that. Wouldn't it be possible to call a reset/hang/panic when the validation fails, before source $img_addr? I'd assume it already has that, but it's still good to have something to deal with the case where the script returns due to some failure. -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] No console output once kernel starts loading.
On Wed, Mar 11, 2015 at 2:29 PM, DaveKucharczyk david.kucharc...@gmail.com wrote: My question is: Is it ok to remove machine type when using a newer version of u-boot and linux? Yes, it is OK. With dt we no longer have to add the machine type numbers. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] config_distro_bootcmd.h: add note on error handling
On Wed, Mar 11, 2015 at 10:22:23AM -0600, Stephen Warren wrote: On 03/11/2015 09:51 AM, Tom Rini wrote: On Tue, Mar 10, 2015 at 03:40:58PM -0600, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com This should make it more clear why there appear to be C pre-processor symbols in the file that contain mixed case. They're really error messages. Suggested-by: Simon Glass s...@chromium.org Signed-off-by: Stephen Warren swar...@nvidia.com Reviewed-by: Tom Rini tr...@konsulko.com Thanks. It looks like you usually apply the patches to this file rather than acking it for someone else to take. Was your reviewed-by just a hint you're waiting for e.g. Simon to review it too? Yes, thanks :) -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] mmc: fsl_esdhc fix register offset
On Wed, Mar 11, 2015 at 01:03:16PM -0300, Fabio Estevam wrote: On Wed, Mar 11, 2015 at 10:55 AM, Pantelis Antoniou pa...@antoniou-consulting.com wrote: Although I agree with fixing this, I’m kinda scared about how fragile structs for describing hardware registers are. Agreed! But we’re stuck with it I guess. Yes, it seems this is mandatory in U-boot. Kernel does not have such requirement and the standard way there is to use (base + offset) for register accesses. So this is one of those topics that long term, I'd like to change U-Boot for but it's both a giant change and something we need to do a lot of prep-work for still. The long ago argument for why U-Boot does things the way it does boils down to type checking. The kernel gets this I think with a combination of sparse and other preprocessor magic / checks. We'll also need to migrate once device model work is farther along and people want more seriously to look at splitting out a runs-many-places U-Boot from a must be board-centric, pretty much SPL. -- 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 RESEND] tegra: Remove tegra_spl_gpio_direction_output declaration from header file
On 11 March 2015 at 01:16, Axel Lin axel@ingics.com wrote: This function is deleted by commit 2fccd2d96bad tegra: Convert tegra GPIO driver to use driver model. Signed-off-by: Axel Lin axel@ingics.com --- I forgot adding Tom Warren in CC in my previous mail. So here is a resend. arch/arm/include/asm/arch-tegra/gpio.h | 9 - 1 file changed, 9 deletions(-) diff --git a/arch/arm/include/asm/arch-tegra/gpio.h b/arch/arm/include/asm/arch-tegra/gpio.h index 7334e0c..daf5698 100644 --- a/arch/arm/include/asm/arch-tegra/gpio.h +++ b/arch/arm/include/asm/arch-tegra/gpio.h @@ -28,15 +28,6 @@ struct tegra_gpio_config { }; /** - * tegra_spl_gpio_direction_output() - set the output value of a GPIO - * - * This function is only used from SPL on seaboard, which needs to enable a - * GPIO to get the UART running. It could be done in U-Boot rather than SPL, - * but for now, this gets it working - */ -int tegra_spl_gpio_direction_output(int gpio, int value); - -/** * Configure a list of GPIOs * * @param config List of GPIO configurations -- 1.9.1 Acked-by: Simon Glass s...@chromium.org ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] config_distro_bootcmd.h: add note on error handling
On 10 March 2015 at 15:40, Stephen Warren swar...@wwwdotorg.org wrote: From: Stephen Warren swar...@nvidia.com This should make it more clear why there appear to be C pre-processor symbols in the file that contain mixed case. They're really error messages. Suggested-by: Simon Glass s...@chromium.org Signed-off-by: Stephen Warren swar...@nvidia.com --- include/config_distro_bootcmd.h | 16 1 file changed, 16 insertions(+) diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 07a0b3b23472..73f093f9eaf5 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -10,6 +10,22 @@ #ifndef _CONFIG_CMD_DISTRO_BOOTCMD_H #define _CONFIG_CMD_DISTRO_BOOTCMD_H +/* + * A note on error handling: It is possible for BOOT_TARGET_DEVICES to + * reference a device that is not enabled in the U-Boot configuration, e.g. + * it may include MMC in the list without CONFIG_CMD_MMC being enabled. Given + * that BOOT_TARGET_DEVICES is a macro that's expanded by the C pre-processor + * at compile time, it's not possible to detect and report such problems via + * a simple #ifdef/#error combination. Still, the code needs to report errors. + * The best way I've found to do this is to make BOOT_TARGET_DEVICES expand to + * reference a non-existent symbol, and have the name of that symbol encode + * the error message. Consequently, this file contains references to e.g. + * BOOT_TARGET_DEVICES_references_MMC_without_CONFIG_CMD_MMC. Given the + * prevalence of capitals here, this looks like a pre-processor macro and + * hence seems like it should be all capitals, but it's really an error + * message that includes some other pre-processor symbols in the text. + */ + /* We need the part command */ #define CONFIG_PARTITION_UUIDS #define CONFIG_CMD_PART Very clear thank you. Reviewed-by: Simon Glass s...@chromium.org ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] README: remove description about driver model configuration options (again)
On 11 March 2015 at 02:34, Masahiro Yamada yamada.masah...@socionext.com wrote: The Driver Model description in README was removed by commit 65eb659e56fa (README: remove description about driver model configuration options), and was revived by mistake by commit b79dadf846e5 when resolving the conflict. Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com Cc: Tom Rini tr...@konsulko.com --- README | 113 - 1 file changed, 113 deletions(-) Acked-by: Simon Glass s...@chromium.org ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 03/27] net: Provide a function to get the current MAC address
The current implementation exposes the eth_device struct to code that needs to access the MAC address. Add a wrapper function for this to abstract away the pointer for this operation. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None arch/mips/mach-au1x00/au1x00_eth.c | 2 +- arch/powerpc/cpu/mpc8260/ether_fcc.c | 2 +- arch/powerpc/cpu/mpc85xx/ether_fcc.c | 2 +- arch/powerpc/cpu/mpc8xx/scc.c| 2 +- include/net.h| 8 net/net.c| 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/mips/mach-au1x00/au1x00_eth.c b/arch/mips/mach-au1x00/au1x00_eth.c index 39c5b6b..a47f088 100644 --- a/arch/mips/mach-au1x00/au1x00_eth.c +++ b/arch/mips/mach-au1x00/au1x00_eth.c @@ -238,7 +238,7 @@ static int au1x00_init(struct eth_device* dev, bd_t * bd){ } /* Put mac addr in little endian */ -#define ea eth_get_dev()-enetaddr +#define ea eth_get_ethaddr() *mac_addr_high = (ea[5] 8) | (ea[4] ) ; *mac_addr_low = (ea[3] 24) | (ea[2] 16) | (ea[1] 8) | (ea[0] ) ; diff --git a/arch/powerpc/cpu/mpc8260/ether_fcc.c b/arch/powerpc/cpu/mpc8260/ether_fcc.c index f9f15b5..f777ba1 100644 --- a/arch/powerpc/cpu/mpc8260/ether_fcc.c +++ b/arch/powerpc/cpu/mpc8260/ether_fcc.c @@ -299,7 +299,7 @@ static int fec_init(struct eth_device* dev, bd_t *bis) * it unique by setting a few bits in the upper byte of the * non-static part of the address. */ -#define ea eth_get_dev()-enetaddr +#define ea eth_get_ethaddr() pram_ptr-fen_paddrh = (ea[5] 8) + ea[4]; pram_ptr-fen_paddrm = (ea[3] 8) + ea[2]; pram_ptr-fen_paddrl = (ea[1] 8) + ea[0]; diff --git a/arch/powerpc/cpu/mpc85xx/ether_fcc.c b/arch/powerpc/cpu/mpc85xx/ether_fcc.c index 166dc9e..58d4bfb 100644 --- a/arch/powerpc/cpu/mpc85xx/ether_fcc.c +++ b/arch/powerpc/cpu/mpc85xx/ether_fcc.c @@ -338,7 +338,7 @@ static int fec_init(struct eth_device* dev, bd_t *bis) * it unique by setting a few bits in the upper byte of the * non-static part of the address. */ -#define ea eth_get_dev()-enetaddr +#define ea eth_get_ethaddr() pram_ptr-fen_paddrh = (ea[5] 8) + ea[4]; pram_ptr-fen_paddrm = (ea[3] 8) + ea[2]; pram_ptr-fen_paddrl = (ea[1] 8) + ea[0]; diff --git a/arch/powerpc/cpu/mpc8xx/scc.c b/arch/powerpc/cpu/mpc8xx/scc.c index 251966b..66e4014 100644 --- a/arch/powerpc/cpu/mpc8xx/scc.c +++ b/arch/powerpc/cpu/mpc8xx/scc.c @@ -339,7 +339,7 @@ static int scc_init (struct eth_device *dev, bd_t * bis) pram_ptr-sen_gaddr3 = 0x0; /* Group Address Filter 3 (unused) */ pram_ptr-sen_gaddr4 = 0x0; /* Group Address Filter 4 (unused) */ -#define ea eth_get_dev()-enetaddr +#define ea eth_get_ethaddr() pram_ptr-sen_paddrh = (ea[5] 8) + ea[4]; pram_ptr-sen_paddrm = (ea[3] 8) + ea[2]; pram_ptr-sen_paddrl = (ea[1] 8) + ea[0]; diff --git a/include/net.h b/include/net.h index 43e3d28..6c76976 100644 --- a/include/net.h +++ b/include/net.h @@ -111,6 +111,14 @@ struct eth_device *eth_get_dev(void) { return eth_current; } + +static inline unsigned char *eth_get_ethaddr(void) +{ + if (eth_current) + return eth_current-enetaddr; + return NULL; +} + extern struct eth_device *eth_get_dev_by_name(const char *devname); extern struct eth_device *eth_get_dev_by_index(int index); /* get dev @ index */ extern int eth_get_dev_index(void);/* get the device index */ diff --git a/net/net.c b/net/net.c index b60ce62..4b3c90e 100644 --- a/net/net.c +++ b/net/net.c @@ -275,7 +275,7 @@ static void NetInitLoop(void) env_changed_id = env_id; } if (eth_get_dev()) - memcpy(NetOurEther, eth_get_dev()-enetaddr, 6); + memcpy(NetOurEther, eth_get_ethaddr(), 6); return; } -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 20/27] dm: eth: Add support for ethprime env var
The ethprime env var is used to indicate the starting device if none is specified in ethact. Also support aliases specified in the ethprime var. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: None Changes in v5: -Fix compile error on !DM_ETH Changes in v4: -Load from ethprime on eth_initialize() Changes in v3: -Added support for ethprime Changes in v2: None net/eth.c | 29 - test/dm/eth.c | 20 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/net/eth.c b/net/eth.c index a2e6f34..b6c2af3 100644 --- a/net/eth.c +++ b/net/eth.c @@ -360,6 +360,18 @@ int eth_initialize(void) printf(No ethernet found.\n); bootstage_error(BOOTSTAGE_ID_NET_ETH_START); } else { + char *ethprime = getenv(ethprime); + struct udevice *prime_dev = NULL; + + if (ethprime) + prime_dev = eth_get_dev_by_name(ethprime); + if (prime_dev) { + eth_set_dev(prime_dev); + eth_current_changed(); + } else { + eth_set_dev(NULL); + } + bootstage_mark(BOOTSTAGE_ID_NET_ETH_INIT); do { if (num_devices) @@ -367,6 +379,9 @@ int eth_initialize(void) printf(eth%d: %s, dev-seq, dev-name); + if (ethprime dev == prime_dev) + printf( [PRIME]); + eth_write_hwaddr(dev); uclass_next_device(dev); @@ -915,8 +930,20 @@ void eth_set_current(void) act = getenv(ethact); env_changed_id = env_id; } - if (act != NULL) + + if (act == NULL) { + char *ethprime = getenv(ethprime); + void *dev = NULL; + + if (ethprime) + dev = eth_get_dev_by_name(ethprime); + if (dev) + eth_set_dev(dev); + else + eth_set_dev(NULL); + } else { eth_set_dev(eth_get_dev_by_name(act)); + } eth_current_changed(); } diff --git a/test/dm/eth.c b/test/dm/eth.c index 5688b71..96e3c46 100644 --- a/test/dm/eth.c +++ b/test/dm/eth.c @@ -60,3 +60,23 @@ static int dm_test_eth_alias(struct dm_test_state *dms) return 0; } DM_TEST(dm_test_eth_alias, DM_TESTF_SCAN_FDT); + +static int dm_test_eth_prime(struct dm_test_state *dms) +{ + NetPingIP = string_to_ip(1.1.2.2); + + /* Expected to be eth@10003000 because of ethprime variable */ + setenv(ethact, NULL); + setenv(ethprime, eth5); + ut_assertok(NetLoop(PING)); + ut_asserteq_str(eth@10003000, getenv(ethact)); + + /* Expected to be eth@10002000 because it is first */ + setenv(ethact, NULL); + setenv(ethprime, NULL); + ut_assertok(NetLoop(PING)); + ut_asserteq_str(eth@10002000, getenv(ethact)); + + return 0; +} +DM_TEST(dm_test_eth_prime, DM_TESTF_SCAN_FDT); -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 15/27] dm: eth: Pass the packet pointer as a parameter to recv
Stop forcing drivers to call net_process_received_packet() - formerly called NetReceive(). Now the uclass will handle calling the driver for each packet until the driver errors or has nothing to return. The uclass will then pass the good packets off to the network stack by calling net_process_received_packet(). Signed-off-by: Joe Hershberger joe.hershber...@ni.com --- Changes in v6: -Swallow -EAGAIN error in eth_rx() -Updated function documentation Changes in v5: -New to v5 Changes in v4: None Changes in v3: None Changes in v2: None include/net.h | 6 -- net/eth.c | 15 ++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/include/net.h b/include/net.h index 31ef1ff..241a096 100644 --- a/include/net.h +++ b/include/net.h @@ -95,7 +95,9 @@ struct eth_pdata { * * start: Prepare the hardware to send and receive packets * send: Send the bytes passed in packet as a packet on the wire - * recv: Check if the hardware received a packet. Call the network stack if so + * recv: Check if the hardware received a packet. If so, set the pointer to the + * packet buffer in the packetp parameter. If not, return an error or 0 to + * indicate that the hardware receive FIFO is empty * stop: Stop the hardware from looking for packets - may be called even if * state == PASSIVE * mcast: Join or leave a multicast group (for TFTP) - optional @@ -110,7 +112,7 @@ struct eth_pdata { struct eth_ops { int (*start)(struct udevice *dev); int (*send)(struct udevice *dev, void *packet, int length); - int (*recv)(struct udevice *dev); + int (*recv)(struct udevice *dev, uchar **packetp); void (*stop)(struct udevice *dev); #ifdef CONFIG_MCAST_TFTP int (*mcast)(struct udevice *dev, const u8 *enetaddr, int join); diff --git a/net/eth.c b/net/eth.c index 1abf027..058c55a 100644 --- a/net/eth.c +++ b/net/eth.c @@ -259,6 +259,9 @@ int eth_send(void *packet, int length) int eth_rx(void) { struct udevice *current; + uchar *packet; + int ret; + int i; current = eth_get_dev(); if (!current) @@ -267,7 +270,17 @@ int eth_rx(void) if (!device_active(current)) return -EINVAL; - return eth_get_ops(current)-recv(current); + /* Process up to 32 packets at one time */ + for (i = 0; i 32; i++) { + ret = eth_get_ops(current)-recv(current, packet); + if (ret 0) + net_process_received_packet(packet, ret); + else + break; + } + if (ret == -EAGAIN) + ret = 0; + return ret; } static int eth_write_hwaddr(struct udevice *dev) -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 18/27] test: dm: eth: Add tests for the eth dm implementation
Add a test for the eth uclass using the sandbox eth driver. Verify basic functionality of the network stack / eth uclass by exercising the ping function. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: -Added dm eth testing Changes in v2: None test/dm/Makefile | 1 + test/dm/eth.c| 38 ++ test/dm/test.dts | 18 ++ 3 files changed, 57 insertions(+) create mode 100644 test/dm/eth.c diff --git a/test/dm/Makefile b/test/dm/Makefile index 1d9148f..b2eb989 100644 --- a/test/dm/Makefile +++ b/test/dm/Makefile @@ -17,6 +17,7 @@ obj-$(CONFIG_DM_TEST) += ut.o obj-$(CONFIG_DM_TEST) += core.o obj-$(CONFIG_DM_TEST) += ut.o ifneq ($(CONFIG_SANDBOX),) +obj-$(CONFIG_DM_ETH) += eth.o obj-$(CONFIG_DM_GPIO) += gpio.o obj-$(CONFIG_DM_I2C) += i2c.o obj-$(CONFIG_DM_SPI_FLASH) += sf.o diff --git a/test/dm/eth.c b/test/dm/eth.c new file mode 100644 index 000..04ccf49 --- /dev/null +++ b/test/dm/eth.c @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2015 National Instruments + * + * (C) Copyright 2015 + * Joe Hershberger joe.hershber...@ni.com + * + * SPDX-License-Identifier:GPL-2.0 + */ + +#include common.h +#include dm.h +#include dm/test.h +#include dm/ut.h +#include fdtdec.h +#include malloc.h +#include net.h + +DECLARE_GLOBAL_DATA_PTR; + +static int dm_test_eth(struct dm_test_state *dms) +{ + NetPingIP = string_to_ip(1.1.2.2); + + setenv(ethact, eth@10002000); + ut_assertok(NetLoop(PING)); + ut_asserteq_str(eth@10002000, getenv(ethact)); + + setenv(ethact, eth@10003000); + ut_assertok(NetLoop(PING)); + ut_asserteq_str(eth@10003000, getenv(ethact)); + + setenv(ethact, eth@10004000); + ut_assertok(NetLoop(PING)); + ut_asserteq_str(eth@10004000, getenv(ethact)); + + return 0; +} +DM_TEST(dm_test_eth, DM_TESTF_SCAN_FDT); diff --git a/test/dm/test.dts b/test/dm/test.dts index 84024a4..2f68cdf 100644 --- a/test/dm/test.dts +++ b/test/dm/test.dts @@ -149,4 +149,22 @@ }; }; + eth@10002000 { + compatible = sandbox,eth; + reg = 0x10002000 0x1000; + fake-host-hwaddr = 0x00 0x00 0x66 0x44 0x22 0x00; + }; + + eth@10003000 { + compatible = sandbox,eth; + reg = 0x10003000 0x1000; + fake-host-hwaddr = 0x00 0x00 0x66 0x44 0x22 0x11; + }; + + eth@10004000 { + compatible = sandbox,eth; + reg = 0x10004000 0x1000; + fake-host-hwaddr = 0x00 0x00 0x66 0x44 0x22 0x22; + }; + }; -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 07/27] net: Change return codes from net/eth.c to use errorno constants
Many functions returned -1 previously. Change them to return appropriate error codes. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reported-by: Simon Glass s...@chromium.org Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: None Changes in v5: None Changes in v4: -New to v4 Changes in v3: None Changes in v2: None net/eth.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/eth.c b/net/eth.c index 84919e0..9ad15cd 100644 --- a/net/eth.c +++ b/net/eth.c @@ -227,7 +227,7 @@ int eth_unregister(struct eth_device *dev) /* No device */ if (!eth_devices) - return -1; + return -ENODEV; for (cur = eth_devices; cur-next != eth_devices cur-next != dev; cur = cur-next) @@ -235,7 +235,7 @@ int eth_unregister(struct eth_device *dev) /* Device not found */ if (cur-next != dev) - return -1; + return -ENODEV; cur-next = dev-next; @@ -368,7 +368,7 @@ int eth_init(bd_t *bis) if (!eth_current) { puts(No ethernet found.\n); - return -1; + return -ENODEV; } /* Sync environment with network devices */ @@ -397,7 +397,7 @@ int eth_init(bd_t *bis) eth_try_another(0); } while (old_current != eth_current); - return -1; + return -ETIMEDOUT; } void eth_halt(void) @@ -413,7 +413,7 @@ void eth_halt(void) int eth_send(void *packet, int length) { if (!eth_current) - return -1; + return -ENODEV; return eth_current-send(eth_current, packet, length); } @@ -421,7 +421,7 @@ int eth_send(void *packet, int length) int eth_rx(void) { if (!eth_current) - return -1; + return -ENODEV; return eth_current-recv(eth_current); } -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 11/27] net: Access mapped physmem in net functions
Previously the net functions would access memory assuming physmem did not need to be mapped. In sandbox, that's not the case. Now we map the physmem specified by the user in loadaddr to the buffer that represents that space. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: None Changes in v5: -Include new mapmem.h header -Unmap memory for consistency Changes in v4: -New to v4 Changes in v3: None Changes in v2: None net/nfs.c | 6 +- net/tftp.c | 6 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/net/nfs.c b/net/nfs.c index 381b75f..8e05ae5 100644 --- a/net/nfs.c +++ b/net/nfs.c @@ -26,6 +26,7 @@ #include command.h #include net.h #include malloc.h +#include mapmem.h #include nfs.h #include bootp.h @@ -93,7 +94,10 @@ store_block(uchar *src, unsigned offset, unsigned len) } else #endif /* CONFIG_SYS_DIRECT_FLASH_NFS */ { - (void)memcpy((void *)(load_addr + offset), src, len); + void *ptr = map_sysmem(load_addr + offset, len); + + memcpy(ptr, src, len); + unmap_sysmem(ptr); } if (NetBootFileXferSize (offset+len)) diff --git a/net/tftp.c b/net/tftp.c index 0a2c533..51c67be 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -8,6 +8,7 @@ #include common.h #include command.h +#include mapmem.h #include net.h #include tftp.h #include bootp.h @@ -184,7 +185,10 @@ store_block(int block, uchar *src, unsigned len) } else #endif /* CONFIG_SYS_DIRECT_FLASH_TFTP */ { - (void)memcpy((void *)(load_addr + offset), src, len); + void *ptr = map_sysmem(load_addr + offset, len); + + memcpy(ptr, src, len); + unmap_sysmem(ptr); } #ifdef CONFIG_MCAST_TFTP if (Multicast) -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 01/27] test: dm: Reorder the objects to build
Signed-off-by: Joe Hershberger joe.hershber...@ni.com Acked-by: Simon Glass s...@chromium.org --- Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: -Reorder dm test makefile Changes in v2: None test/dm/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/dm/Makefile b/test/dm/Makefile index 612aa95..1d9148f 100644 --- a/test/dm/Makefile +++ b/test/dm/Makefile @@ -18,7 +18,7 @@ obj-$(CONFIG_DM_TEST) += core.o obj-$(CONFIG_DM_TEST) += ut.o ifneq ($(CONFIG_SANDBOX),) obj-$(CONFIG_DM_GPIO) += gpio.o -obj-$(CONFIG_DM_SPI) += spi.o -obj-$(CONFIG_DM_SPI_FLASH) += sf.o obj-$(CONFIG_DM_I2C) += i2c.o +obj-$(CONFIG_DM_SPI_FLASH) += sf.o +obj-$(CONFIG_DM_SPI) += spi.o endif -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 05/27] net: Remove unneeded extern in net.h
Many of the functions in net.h were preceded extern needlessly. Removing them to limit the number of checkpatch.pl complaints. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: -Fix compile error on boards with CONFIG_API enabled Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None include/net.h | 90 +-- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/include/net.h b/include/net.h index 6c76976..51ed5b0 100644 --- a/include/net.h +++ b/include/net.h @@ -97,11 +97,11 @@ struct eth_device { void *priv; }; -extern int eth_initialize(bd_t *bis); /* Initialize network subsystem */ -extern int eth_register(struct eth_device* dev);/* Register network device */ -extern int eth_unregister(struct eth_device *dev);/* Remove network device */ -extern void eth_try_another(int first_restart);/* Change the device */ -extern void eth_set_current(void); /* set nterface to ethcur var */ +int eth_initialize(bd_t *bis); /* Initialize network subsystem */ +int eth_register(struct eth_device *dev);/* Register network device */ +int eth_unregister(struct eth_device *dev);/* Remove network device */ +void eth_try_another(int first_restart); /* Change the device */ +void eth_set_current(void);/* set nterface to ethcur var */ /* get the current device MAC */ extern struct eth_device *eth_current; @@ -119,12 +119,12 @@ static inline unsigned char *eth_get_ethaddr(void) return NULL; } -extern struct eth_device *eth_get_dev_by_name(const char *devname); -extern struct eth_device *eth_get_dev_by_index(int index); /* get dev @ index */ -extern int eth_get_dev_index(void);/* get the device index */ -extern void eth_parse_enetaddr(const char *addr, uchar *enetaddr); -extern int eth_getenv_enetaddr(char *name, uchar *enetaddr); -extern int eth_setenv_enetaddr(char *name, const uchar *enetaddr); +struct eth_device *eth_get_dev_by_name(const char *devname); +struct eth_device *eth_get_dev_by_index(int index); /* get dev @ index */ +int eth_get_dev_index(void); /* get the device index */ +void eth_parse_enetaddr(const char *addr, uchar *enetaddr); +int eth_getenv_enetaddr(char *name, uchar *enetaddr); +int eth_setenv_enetaddr(char *name, const uchar *enetaddr); /* * Get the hardware address for an ethernet interface . @@ -135,20 +135,20 @@ extern int eth_setenv_enetaddr(char *name, const uchar *enetaddr); * Returns: * Return true if the address is valid. */ -extern int eth_getenv_enetaddr_by_index(const char *base_name, int index, - uchar *enetaddr); +int eth_getenv_enetaddr_by_index(const char *base_name, int index, +uchar *enetaddr); -extern int usb_eth_initialize(bd_t *bi); -extern int eth_init(bd_t *bis);/* Initialize the device */ -extern int eth_send(void *packet, int length);/* Send a packet */ +int usb_eth_initialize(bd_t *bi); +int eth_init(bd_t *bis); /* Initialize the device */ +int eth_send(void *packet, int length); /* Send a packet */ #ifdef CONFIG_API -extern int eth_receive(void *packet, int length); /* Receive a packet*/ +int eth_receive(void *packet, int length); /* Receive a packet*/ extern void (*push_packet)(void *packet, int length); #endif -extern int eth_rx(void); /* Check for received packets */ -extern void eth_halt(void);/* stop SCC */ -extern char *eth_get_name(void); /* get name of current device */ +int eth_rx(void); /* Check for received packets */ +void eth_halt(void); /* stop SCC */ +char *eth_get_name(void); /* get name of current device */ /* Set active state */ static inline __attribute__((always_inline)) int eth_init_state_only(bd_t *bis) @@ -469,25 +469,25 @@ extern IPaddr_t Mcast_addr; #endif /* Initialize the network adapter */ -extern void net_init(void); -extern int NetLoop(enum proto_t); +void net_init(void); +int NetLoop(enum proto_t); /* Shutdown adapters and cleanup */ -extern voidNetStop(void); +void NetStop(void); /* Load failed. Start again. */ -extern voidNetStartAgain(void); +void NetStartAgain(void); /* Get size of the ethernet header when we send */ -extern int NetEthHdrSize(void); +intNetEthHdrSize(void); /* Set ethernet header; returns the size of the header */ -extern int NetSetEther(uchar *, uchar *, uint); -extern int net_update_ether(struct ethernet_hdr *et, uchar *addr, uint prot); +int NetSetEther(uchar *, uchar *, uint); +int net_update_ether(struct ethernet_hdr *et, uchar *addr, uint prot); /* Set IP header */ -extern void net_set_ip_header(uchar *pkt, IPaddr_t dest, IPaddr_t source); -extern void
[U-Boot] davinci: LCDK board
I have a build of u-boot for the TI LCDK (the successor to the Hawkboard). It is based on: * The LCDK code TI supplied against 2012.04.01 * The now-departed Hawkboard build in mainline prior to 2015.04 * The current da850evm build. It is built against the generic board framework. It works well enough for me the way I want to use it (conversion post-build with a TI utility for flashing into NAND), but I haven't tried any of the other options yet (e.g. booting off SD). I'd like to get it into mainline; my question is what is the best way from where I am? Just post the patch as it is to the list? Find someone else to play with off list (any volunteers?). Go through more of the target options first? Thanks, -- Peter Howard p...@northern-ridge.com.au ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] mmc: fsl_esdhc: Add support for DDR mode
Volodymyr, On Tue, Jan 20, 2015 at 1:16 PM, Volodymyr Riazantsev volodymyr.riazant...@globallogic.com wrote: diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h index e0528ce..29b72b2 100644 --- a/include/configs/mx6_common.h +++ b/include/configs/mx6_common.h @@ -28,6 +28,8 @@ #define CONFIG_SYS_PL310_BASE L2_PL310_BASE #endif +#define CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE Shouldn't this be defined per board config file instead? Stefan, Does your board work if CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE is removed from mx6_common.h? Regards, Fabio Estevam ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 19/27] dm: eth: Add support for aliases
Allow network devices to be referred to as eth0 instead of eth@12345678 when specified in ethact. Add tests to verify this behavior. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: None Changes in v5: -Added a comment about devname -Only check for alias if the name is long enough Changes in v4: -Use only the seq from DM to find aliases Changes in v3: -Added support for aliases Changes in v2: None include/configs/sandbox.h | 2 +- include/net.h | 5 + net/eth.c | 50 ++- test/dm/eth.c | 24 +++ test/dm/test.dts | 4 +++- 5 files changed, 74 insertions(+), 11 deletions(-) diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index 9189f6a..caf9f5a 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -174,7 +174,7 @@ #define SANDBOX_ETH_SETTINGS ethaddr=00:00:11:22:33:44\0 \ eth1addr=00:00:11:22:33:45\0 \ - eth2addr=00:00:11:22:33:46\0 \ + eth5addr=00:00:11:22:33:46\0 \ ipaddr=1.2.3.4\0 #define CONFIG_EXTRA_ENV_SETTINGS SANDBOX_SERIAL_SETTINGS \ diff --git a/include/net.h b/include/net.h index 241a096..baccd47 100644 --- a/include/net.h +++ b/include/net.h @@ -124,6 +124,11 @@ struct eth_ops { #define eth_get_ops(dev) ((struct eth_ops *)(dev)-driver-ops) struct udevice *eth_get_dev(void); /* get the current device */ +/* + * The devname can be either an exact name given by the driver or device tree + * or it can be an alias of the form eth%d + */ +struct udevice *eth_get_dev_by_name(const char *devname); unsigned char *eth_get_ethaddr(void); /* get the current device MAC */ /* Used only when NetConsole is enabled */ int eth_init_state_only(void); /* Set active state */ diff --git a/net/eth.c b/net/eth.c index 058c55a..a2e6f34 100644 --- a/net/eth.c +++ b/net/eth.c @@ -135,6 +135,39 @@ static void eth_set_dev(struct udevice *dev) eth_get_uclass_priv()-current = dev; } +/* + * Find the udevice that either has the name passed in as devname or has an + * alias named devname. + */ +struct udevice *eth_get_dev_by_name(const char *devname) +{ + int seq = -1; + char *endp = NULL; + const char *startp = NULL; + struct udevice *it; + struct uclass *uc; + + /* Must be longer than 3 to be an alias */ + if (strlen(devname) strlen(eth)) { + startp = devname + strlen(eth); + seq = simple_strtoul(startp, endp, 10); + } + + uclass_get(UCLASS_ETH, uc); + uclass_foreach_dev(it, uc) { + /* We need the seq to be valid, so make sure it's probed */ + device_probe(it); + /* +* Check for the name or the sequence number to match +*/ + if (strcmp(it-name, devname) == 0 || + (endp startp it-seq == seq)) + return it; + } + + return NULL; +} + unsigned char *eth_get_ethaddr(void) { struct eth_pdata *pdata; @@ -421,6 +454,7 @@ UCLASS_DRIVER(eth) = { .pre_remove = eth_pre_remove, .priv_auto_alloc_size = sizeof(struct eth_uclass_priv), .per_device_auto_alloc_size = sizeof(struct eth_device_priv), + .flags = DM_UC_FLAG_SEQ_ALIAS, }; #endif @@ -453,6 +487,11 @@ static void eth_set_current_to_next(void) eth_current = eth_current-next; } +static void eth_set_dev(struct eth_device *dev) +{ + eth_current = dev; +} + struct eth_device *eth_get_dev_by_name(const char *devname) { struct eth_device *dev, *target_dev; @@ -869,7 +908,6 @@ void eth_set_current(void) { static char *act; static int env_changed_id; - void *old_current; int env_id; env_id = get_env_id(); @@ -877,14 +915,8 @@ void eth_set_current(void) act = getenv(ethact); env_changed_id = env_id; } - if (act != NULL) { - old_current = eth_get_dev(); - do { - if (strcmp(eth_get_name(), act) == 0) - return; - eth_set_current_to_next(); - } while (old_current != eth_get_dev()); - } + if (act != NULL) + eth_set_dev(eth_get_dev_by_name(act)); eth_current_changed(); } diff --git a/test/dm/eth.c b/test/dm/eth.c index 04ccf49..5688b71 100644 --- a/test/dm/eth.c +++ b/test/dm/eth.c @@ -36,3 +36,27 @@ static int dm_test_eth(struct dm_test_state *dms) return 0; } DM_TEST(dm_test_eth, DM_TESTF_SCAN_FDT); + +static int dm_test_eth_alias(struct dm_test_state *dms) +{ + NetPingIP = string_to_ip(1.1.2.2); +
[U-Boot] [PATCH v6 13/27] dm: eth: Add basic driver model support to Ethernet stack
First just add support for MAC drivers. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: None Changes in v5: -Add a note to doc/README.drivers.eth about its obsolescence -Expanded the Kconfig help -Moved dm/ header -Use local var for priv in eth_get_dev() Changes in v4: --Don't prevent eth_initialize on driver model --If current == NULL, always check if there is a device available in eth_get_dev --Include ethprime handling in eth_initialize --Look up MAC address in post-probe --Move env init call from uclass init to eth_initialize --Print the alias in eth_initialize --Use eth_initialize to probe all devices and write_hwaddr -Add a helper function for eth_uclass_priv -Add documentation to the structures -Add eth_get_ops helper -Change -1 returns to error constants -Change puts to printf -Redo the seq / probe implementation -Remove bd_t *bis from dm eth_ops init function -Remove checks for driver==NULL -Remove priv pointer in per-device priv struct (drivers already get their own directly from DM) -Rename halt() to stop() in ops -Rename init() to start() in ops -Stop handling selecting a new current in pre-unbind as it will now work itself out by clearing the pointer Changes in v3: --Fail init if not activated --Fail probe if ethaddr not set -Allow current eth dev to be NULL -Correct failure chaining from bind to probe to init -Correct the pre_unbind logic -Fixed blank line formatting for variable declaration -Update ethaddr from env unconditionally on init -Use set current to select the current device regardless of the previous selection Changes in v2: -Cause an invalid name to fail binding -Changed eth_uclass_priv local var names to be uc_priv -Move the hwaddr to platdata so that its memory is allocated at bind when we need it -Prevent device from being probed before used by a command (i.e. before eth_init()). -Rebase on top of dm/master -Removed extra parentheses -Stop maintaining our own index and use DM seq now that it works for our needs -Update error codes -Updated comments common/cmd_bdinfo.c| 2 + doc/README.drivers.eth | 6 + drivers/net/Kconfig| 9 ++ include/dm/uclass-id.h | 1 + include/net.h | 52 net/eth.c | 346 - 6 files changed, 410 insertions(+), 6 deletions(-) diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index aa81da2..b4cce25 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -34,6 +34,7 @@ static void print_eth(int idx) printf(%-12s= %s\n, name, val); } +#ifndef CONFIG_DM_ETH __maybe_unused static void print_eths(void) { @@ -52,6 +53,7 @@ static void print_eths(void) printf(current eth = %s\n, eth_get_name()); printf(ip_addr = %s\n, getenv(ipaddr)); } +#endif __maybe_unused static void print_lnum(const char *name, unsigned long long value) diff --git a/doc/README.drivers.eth b/doc/README.drivers.eth index eb83038..98728bc 100644 --- a/doc/README.drivers.eth +++ b/doc/README.drivers.eth @@ -1,3 +1,9 @@ +!!! WARNING !!! + +This guide describes to the old way of doing things. No new Ethernet drivers +should be implemented this way. All new drivers should be written against the +U-Boot core driver model. See doc/driver-model/README.txt + --- Ethernet Driver Guide --- diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index e69de29..94cf099 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -0,0 +1,9 @@ +config DM_ETH + bool Enable Driver Model for Ethernet drivers + depends on DM + help + Enable driver model for Ethernet. + + The eth_*() interface will be implemented by the UC_ETH class + This is currently implemented in net/eth.c + Look in include/net.h for details. diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h index 91bb90d..ad96682 100644 --- a/include/dm/uclass-id.h +++ b/include/dm/uclass-id.h @@ -34,6 +34,7 @@ enum uclass_id { UCLASS_I2C_GENERIC, /* Generic I2C device */ UCLASS_I2C_EEPROM, /* I2C EEPROM device */ UCLASS_MOD_EXP, /* RSA Mod Exp device */ + UCLASS_ETH, /* Ethernet device */ UCLASS_COUNT, UCLASS_INVALID = -1, diff --git a/include/net.h b/include/net.h index ae0f31a..fff82cb 100644 --- a/include/net.h +++ b/include/net.h @@ -78,6 +78,57 @@ enum eth_state_t { ETH_STATE_ACTIVE }; +#ifdef CONFIG_DM_ETH +/** + * struct eth_pdata - Platform data for Ethernet MAC controllers + * + * @iobase: The base address of the hardware registers + * @enetaddr: The Ethernet MAC address that is loaded from EEPROM or env + */ +struct eth_pdata { + phys_addr_t iobase; + unsigned char enetaddr[6]; +}; + +/** + * struct eth_ops - functions of Ethernet MAC controllers + * + * start: Prepare the hardware to send and receive packets + * send:
[U-Boot] [PATCH v6 0/27] Add Driver Model support to network stack
Add support for the Ethernet MAC controllers. Phy support will come later. Switching from RFC to a patch series to be applied to dm/master as a staging area for this series to make it happen more quickly when the window opens. If desired, let me know which of the non-DM related prerequisite patches are wanted for this release. I've added unit tests to verify functionality. There is an additional driver for sandbox that bridges to the RAW Ethernet API in Linux which lets you test with real traffic. It now supports localhost as well (the 'lo' interface). Changes in v6: -Add function comments -Addressed nits -Check array index bounds -Fix compile error on boards with CONFIG_API enabled -Fix compile errors for other boards due to removed parameters -Swallow -EAGAIN error in eth_rx() -Updated function documentation Changes in v5: -Add a note to doc/README.drivers.eth about its obsolescence -Add details about lo support to the README -Added a comment about devname -Added a test for skipping un-probe-able devices -Added comments about test cases -Added fallback for setting promiscuous mode -Added help to Kconfig -Added help to the sandbox eth mock driver Kconfig entry -Added more details and examples in the README -Check for NULL when reading fdt for host interface -Check for malloc failure -Expanded the Kconfig help -Fix compile error on !DM_ETH -Fixed warning from missing declaration -Include new mapmem.h header -Moved dm/ header -Moved to a separate header mapmem.h -New to v5 -Only check for alias if the name is long enough -Remove cast of pointer passed to free -Remove socket timeout -Remove the empty sb_eth_raw_remove function -Return -errno in from send and recv -Return errno from recv -Separate init to 2 helper static functions -Set the socket to non-blocking -Simplify sandbox eth driver by switching from int array to byte array -Switch priv from packet buffer to a pointer to net_rx_packets[0] -Switched to function to control state of mock driver -Unmap memory for consistency -Use INADDR_LOOPBACK -Use a function call to change mock driver behavior -Use local var for priv in eth_get_dev() -Use more verbose comments -Use net_rx_packets instead of a stack buffer Changes in v4: --Don't prevent eth_initialize on driver model --If current == NULL, always check if there is a device available in eth_get_dev --Include ethprime handling in eth_initialize --Look up MAC address in post-probe --Move env init call from uclass init to eth_initialize --Print the alias in eth_initialize --Use eth_initialize to probe all devices and write_hwaddr -Add a helper function for eth_uclass_priv -Add ability to disable ping reply in sandbox eth driver -Add comments to priv struct definition -Add documentation to the structures -Add eth_get_ops helper -Added comments to README.sandbox -Added support for the 'lo' network interface -Added testing for ethrotate -Change -1 returns to error constants -Change puts to printf -Clean up the interface to sandbox's eth-raw-os by passing priv to raw-os -Cleaned up sandbox EXTRA_ENV define -Cleanup var definition order -Fix compile regression in !DM_ETH case -Fixed the MAC address limitation (now all traffic uses MAC address from env) -Load from ethprime on eth_initialize() -Move os file to arch -Moved config to Kconfig -New to v4 -Redo the seq / probe implementation -Remove bd_t *bis from dm eth_ops init function -Remove checks for driver==NULL -Remove priv pointer in per-device priv struct (drivers already get their own directly from DM) -Removed checks on priv != NULL and added protection in uclass instead -Rename halt() to stop() in ops -Rename init() to start() in ops -Stop handling selecting a new current in pre-unbind as it will now work itself out by clearing the pointer -Updated expected behavior based on changes to the NetLoop -Use accessors for platdata and priv -Use only the seq from DM to find aliases Changes in v3: --Fail init if not activated --Fail probe if ethaddr not set -Added 2 more ethaddr to sandbox -Added dm eth testing -Added support for aliases -Added support for ethprime -Added testing for netretry -Allow current eth dev to be NULL -Correct failure chaining from bind to probe to init -Correct the pre_unbind logic -Fixed blank line formatting for variable declaration -Made the os raw packet support for sandbox eth build and work. -Move the get_dev_by_* protos to also be !DM_ETH like the impl -Prevent a crash if memory is not allocated -Print which device in the debug write hwaddr -Reorder dm test makefile -Update ethaddr from env unconditionally on init -Use set current to select the current device regardless of the previous selection Changes in v2: -Added the raw packet proof-of-concept patch. -Cause an invalid name to fail binding -Change printfs to debug in sandbox driver -Changed eth_uclass_priv local var names to be uc_priv -Move fake hwaddr to the device tree -Move static data to priv -Move the hwaddr to platdata so that its memory is allocated at
[U-Boot] [PATCH v6 06/27] net: Refactor in preparation for driver model
Move some things around and organize things so that the driver model implementation will fit in more easily. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: None Changes in v5: -Fixed warning from missing declaration Changes in v4: -Fix compile regression in !DM_ETH case Changes in v3: -Move the get_dev_by_* protos to also be !DM_ETH like the impl Changes in v2: None include/net.h | 68 +- net/eth.c | 79 --- 2 files changed, 78 insertions(+), 69 deletions(-) diff --git a/include/net.h b/include/net.h index 51ed5b0..fdf6860 100644 --- a/include/net.h +++ b/include/net.h @@ -97,13 +97,9 @@ struct eth_device { void *priv; }; -int eth_initialize(bd_t *bis); /* Initialize network subsystem */ int eth_register(struct eth_device *dev);/* Register network device */ int eth_unregister(struct eth_device *dev);/* Remove network device */ -void eth_try_another(int first_restart); /* Change the device */ -void eth_set_current(void);/* set nterface to ethcur var */ -/* get the current device MAC */ extern struct eth_device *eth_current; static inline __attribute__((always_inline)) @@ -111,7 +107,10 @@ struct eth_device *eth_get_dev(void) { return eth_current; } +struct eth_device *eth_get_dev_by_name(const char *devname); +struct eth_device *eth_get_dev_by_index(int index); /* get dev @ index */ +/* get the current device MAC */ static inline unsigned char *eth_get_ethaddr(void) { if (eth_current) @@ -119,8 +118,37 @@ static inline unsigned char *eth_get_ethaddr(void) return NULL; } -struct eth_device *eth_get_dev_by_name(const char *devname); -struct eth_device *eth_get_dev_by_index(int index); /* get dev @ index */ +/* Set active state */ +static inline __attribute__((always_inline)) int eth_init_state_only(bd_t *bis) +{ + eth_get_dev()-state = ETH_STATE_ACTIVE; + + return 0; +} +/* Set passive state */ +static inline __attribute__((always_inline)) void eth_halt_state_only(void) +{ + eth_get_dev()-state = ETH_STATE_PASSIVE; +} + +/* + * Set the hardware address for an ethernet interface based on 'eth%daddr' + * environment variable (or just 'ethaddr' if eth_number is 0). + * Args: + * base_name - base name for device (normally eth) + * eth_number - value of %d (0 for first device of this type) + * Returns: + * 0 is success, non-zero is error status from driver. + */ +int eth_write_hwaddr(struct eth_device *dev, const char *base_name, +int eth_number); + +int usb_eth_initialize(bd_t *bi); + +int eth_initialize(bd_t *bis); /* Initialize network subsystem */ +void eth_try_another(int first_restart); /* Change the device */ +void eth_set_current(void);/* set nterface to ethcur var */ + int eth_get_dev_index(void); /* get the device index */ void eth_parse_enetaddr(const char *addr, uchar *enetaddr); int eth_getenv_enetaddr(char *name, uchar *enetaddr); @@ -138,7 +166,6 @@ int eth_setenv_enetaddr(char *name, const uchar *enetaddr); int eth_getenv_enetaddr_by_index(const char *base_name, int index, uchar *enetaddr); -int usb_eth_initialize(bd_t *bi); int eth_init(bd_t *bis); /* Initialize the device */ int eth_send(void *packet, int length); /* Send a packet */ @@ -148,32 +175,7 @@ extern void (*push_packet)(void *packet, int length); #endif int eth_rx(void); /* Check for received packets */ void eth_halt(void); /* stop SCC */ -char *eth_get_name(void); /* get name of current device */ - -/* Set active state */ -static inline __attribute__((always_inline)) int eth_init_state_only(bd_t *bis) -{ - eth_get_dev()-state = ETH_STATE_ACTIVE; - - return 0; -} -/* Set passive state */ -static inline __attribute__((always_inline)) void eth_halt_state_only(void) -{ - eth_get_dev()-state = ETH_STATE_PASSIVE; -} - -/* - * Set the hardware address for an ethernet interface based on 'eth%daddr' - * environment variable (or just 'ethaddr' if eth_number is 0). - * Args: - * base_name - base name for device (normally eth) - * eth_number - value of %d (0 for first device of this type) - * Returns: - * 0 is success, non-zero is error status from driver. - */ -int eth_write_hwaddr(struct eth_device *dev, const char *base_name, -int eth_number); +const char *eth_get_name(void);/* get name of current device */ #ifdef CONFIG_MCAST_TFTP int eth_mcast_join(IPaddr_t mcast_addr, u8 join); diff --git a/net/eth.c b/net/eth.c index 65e8c77..84919e0 100644 --- a/net/eth.c +++ b/net/eth.c @@ -55,6 +55,14 @@ static inline int eth_setenv_enetaddr_by_index(const char *base_name, int index, return eth_setenv_enetaddr(enetvar,
[U-Boot] [PATCH v6 09/27] net: Remove the bd* parameter from net stack functions
This value is not used by the network stack and is available in the global data, so stop passing it around. For the one legacy function that still expects it (init op on old Ethernet drivers) pass in the global pointer version directly to avoid changing that interface. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reported-by: Simon Glass s...@chromium.org Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: -Fix compile errors for other boards due to removed parameters Changes in v5: None Changes in v4: -New to v4 Changes in v3: None Changes in v2: None api/api_net.c | 2 +- arch/arm/lib/board.c | 2 +- arch/avr32/lib/board.c| 2 +- arch/m68k/lib/board.c | 4 ++-- arch/nds32/lib/board.c| 2 +- arch/openrisc/lib/board.c | 2 +- arch/powerpc/lib/board.c | 2 +- arch/sh/lib/board.c | 2 +- arch/sparc/lib/board.c| 2 +- board/BuS/eb_cpux9k2/cpux9k2.c| 2 +- board/BuS/vl_ma2sc/vl_ma2sc.c | 2 +- board/atmel/at91sam9261ek/at91sam9261ek.c | 2 +- board/egnite/ethernut5/ethernut5.c| 2 +- board/ronetix/pm9261/pm9261.c | 2 +- board/ronetix/pm9g45/pm9g45.c | 2 +- common/board_r.c | 2 +- common/spl/spl_net.c | 2 +- drivers/net/netconsole.c | 4 ++-- include/net.h | 6 +++--- net/eth.c | 12 +++- net/net.c | 7 +++ 21 files changed, 33 insertions(+), 32 deletions(-) diff --git a/api/api_net.c b/api/api_net.c index 7b3805e..04e4f4a 100644 --- a/api/api_net.c +++ b/api/api_net.c @@ -37,7 +37,7 @@ int dev_open_net(void *cookie) if (!dev_valid_net(cookie)) return API_ENODEV; - if (eth_init(gd-bd) 0) + if (eth_init() 0) return API_EIO; return 0; diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index f606255..37ea6e9 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -644,7 +644,7 @@ void board_init_r(gd_t *id, ulong dest_addr) #endif #if defined(CONFIG_CMD_NET) puts(Net: ); - eth_initialize(gd-bd); + eth_initialize(); #if defined(CONFIG_RESET_PHY_R) debug(Reset Ethernet PHY\n); reset_phy(); diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c index 99aa96e..aacfcbf 100644 --- a/arch/avr32/lib/board.c +++ b/arch/avr32/lib/board.c @@ -244,7 +244,7 @@ void board_init_r(gd_t *new_gd, ulong dest_addr) #endif #if defined(CONFIG_CMD_NET) puts(Net: ); - eth_initialize(gd-bd); + eth_initialize(); #endif #ifdef CONFIG_GENERIC_ATMEL_MCI diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c index 9caff73..c54a3f7 100644 --- a/arch/m68k/lib/board.c +++ b/arch/m68k/lib/board.c @@ -566,10 +566,10 @@ void board_init_r (gd_t *id, ulong dest_addr) #if defined(CONFIG_CMD_NET) WATCHDOG_RESET(); #if defined(FEC_ENET) - eth_init(bd); + eth_init(); #endif puts (Net: ); - eth_initialize (bd); + eth_initialize(); #endif #ifdef CONFIG_POST diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c index 4c06a48..24a09bc 100644 --- a/arch/nds32/lib/board.c +++ b/arch/nds32/lib/board.c @@ -383,7 +383,7 @@ void board_init_r(gd_t *id, ulong dest_addr) #if defined(CONFIG_CMD_NET) puts(Net: ); - eth_initialize(gd-bd); + eth_initialize(); #if defined(CONFIG_RESET_PHY_R) debug(Reset Ethernet PHY\n); reset_phy(); diff --git a/arch/openrisc/lib/board.c b/arch/openrisc/lib/board.c index 2346685..c26cc8f 100644 --- a/arch/openrisc/lib/board.c +++ b/arch/openrisc/lib/board.c @@ -128,7 +128,7 @@ void board_init(void) #if defined(CONFIG_CMD_NET) puts(NET: ); - eth_initialize(bd); + eth_initialize(); #endif /* main_loop */ diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c index 91645d3..5ea29cc 100644 --- a/arch/powerpc/lib/board.c +++ b/arch/powerpc/lib/board.c @@ -890,7 +890,7 @@ void board_init_r(gd_t *id, ulong dest_addr) #if defined(CONFIG_CMD_NET) WATCHDOG_RESET(); puts(Net: ); - eth_initialize(bd); + eth_initialize(); #endif #if defined(CONFIG_CMD_NET) defined(CONFIG_RESET_PHY_R) diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c index 1eb7afb..6dad3c7 100644 --- a/arch/sh/lib/board.c +++ b/arch/sh/lib/board.c @@ -178,7 +178,7 @@ void sh_generic_init(void) #endif #if defined(CONFIG_CMD_NET) puts(Net: ); - eth_initialize(gd-bd); + eth_initialize(); #endif /* CONFIG_CMD_NET */ while (1) { diff --git a/arch/sparc/lib/board.c b/arch/sparc/lib/board.c index b311a94..d2ac6bc 100644 --- a/arch/sparc/lib/board.c +++
[U-Boot] [PATCH v6 22/27] sandbox: eth: Add ability to disable ping reply in sandbox eth driver
This is needed to test the netretry functionality (make the command fail on a sandbox eth device). Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: -Add function comments -Check array index bounds Changes in v5: -Use a function call to change mock driver behavior Changes in v4: -Add ability to disable ping reply in sandbox eth driver Changes in v3: None Changes in v2: None arch/sandbox/include/asm/eth.h | 15 +++ drivers/net/sandbox.c | 17 + 2 files changed, 32 insertions(+) create mode 100644 arch/sandbox/include/asm/eth.h diff --git a/arch/sandbox/include/asm/eth.h b/arch/sandbox/include/asm/eth.h new file mode 100644 index 000..4b79ede --- /dev/null +++ b/arch/sandbox/include/asm/eth.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2015 National Instruments + * + * (C) Copyright 2015 + * Joe Hershberger joe.hershber...@ni.com + * + * SPDX-License-Identifier:GPL-2.0 + */ + +#ifndef __ETH_H +#define __ETH_H + +void sandbox_eth_disable_response(int index, bool disable); + +#endif /* __ETH_H */ diff --git a/drivers/net/sandbox.c b/drivers/net/sandbox.c index cb69a95..db115d0 100644 --- a/drivers/net/sandbox.c +++ b/drivers/net/sandbox.c @@ -29,6 +29,19 @@ struct eth_sandbox_priv { int recv_packet_length; }; +static bool disabled[8] = {false}; + +/* + * sandbox_eth_disable_response() + * + * index - The alias index (also DM seq number) + * disable - If non-zero, ignore sent packets and don't send mock response + */ +void sandbox_eth_disable_response(int index, bool disable) +{ + disabled[index] = disable; +} + static int sb_eth_start(struct udevice *dev) { struct eth_sandbox_priv *priv = dev_get_priv(dev); @@ -48,6 +61,10 @@ static int sb_eth_send(struct udevice *dev, void *packet, int length) debug(eth_sandbox: Send packet %d\n, length); + if (dev-seq = 0 dev-seq ARRAY_SIZE(disabled) + disabled[dev-seq]) + return 0; + if (ntohs(eth-et_protlen) == PROT_ARP) { struct arp_hdr *arp = packet + ETHER_HDR_SIZE; -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 12/27] cmd: net: Clean up return codes
The return codes in common/cmd_net.c had a number of inconsistencies. Update them to all use the enum from command.h Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: None Changes in v5: -New to v5 Changes in v4: None Changes in v3: None Changes in v2: None common/cmd_net.c | 45 + 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/common/cmd_net.c b/common/cmd_net.c index 09489d4..3f52edc 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -44,10 +44,7 @@ U_BOOT_CMD( #ifdef CONFIG_CMD_TFTPPUT int do_tftpput(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - int ret; - - ret = netboot_common(TFTPPUT, cmdtp, argc, argv); - return ret; + return netboot_common(TFTPPUT, cmdtp, argc, argv); } U_BOOT_CMD( @@ -217,7 +214,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, if (strict_strtoul(argv[1], 16, save_addr) 0 || strict_strtoul(argv[2], 16, save_size) 0) { printf(Invalid address/size\n); - return cmd_usage(cmdtp); + return CMD_RET_USAGE; } copy_filename(BootFile, argv[3], sizeof(BootFile)); break; @@ -230,7 +227,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, if ((size = NetLoop(proto)) 0) { bootstage_error(BOOTSTAGE_ID_NET_NETLOOP_OK); - return 1; + return CMD_RET_FAILURE; } bootstage_mark(BOOTSTAGE_ID_NET_NETLOOP_OK); @@ -240,7 +237,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, /* done if no file was loaded (no errors though) */ if (size == 0) { bootstage_error(BOOTSTAGE_ID_NET_LOADED); - return 0; + return CMD_RET_SUCCESS; } /* flush cache */ @@ -250,10 +247,10 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, rcode = bootm_maybe_autostart(cmdtp, argv[0]); - if (rcode 0) - bootstage_error(BOOTSTAGE_ID_NET_DONE_ERR); - else + if (rcode == CMD_RET_SUCCESS) bootstage_mark(BOOTSTAGE_ID_NET_DONE); + else + bootstage_error(BOOTSTAGE_ID_NET_DONE_ERR); return rcode; } @@ -261,7 +258,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, static int do_ping(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { if (argc 2) - return -1; + return CMD_RET_USAGE; NetPingIP = string_to_ip(argv[1]); if (NetPingIP == 0) @@ -269,12 +266,12 @@ static int do_ping(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (NetLoop(PING) 0) { printf(ping failed; host %s is not alive\n, argv[1]); - return 1; + return CMD_RET_FAILURE; } printf(host %s is alive\n, argv[1]); - return 0; + return CMD_RET_SUCCESS; } U_BOOT_CMD( @@ -313,12 +310,12 @@ int do_cdp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) r = NetLoop(CDP); if (r 0) { printf(cdp failed; perhaps not a CISCO switch?\n); - return 1; + return CMD_RET_FAILURE; } cdp_update_env(); - return 0; + return CMD_RET_SUCCESS; } U_BOOT_CMD( @@ -337,13 +334,13 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) NetNtpServerIP = getenv_IPaddr(ntpserverip); if (NetNtpServerIP == 0) { printf(ntpserverip not set\n); - return (1); + return CMD_RET_FAILURE; } } else { NetNtpServerIP = string_to_ip(argv[1]); if (NetNtpServerIP == 0) { printf(Bad NTP server IP address\n); - return (1); + return CMD_RET_FAILURE; } } @@ -356,10 +353,10 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (NetLoop(SNTP) 0) { printf(SNTP failed: host %pI4 not responding\n, NetNtpServerIP); - return 1; + return CMD_RET_FAILURE; } - return 0; + return CMD_RET_SUCCESS; } U_BOOT_CMD( @@ -389,7 +386,7 @@ int do_dns(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) */ if (strlen(argv[1]) = 255) { printf(dns error: hostname too long\n); - return 1; + return CMD_RET_FAILURE; } NetDNSResolve = argv[1]; @@ -401,10 +398,10 @@ int do_dns(cmd_tbl_t *cmdtp, int flag,
[U-Boot] [PATCH v6 04/27] net: Rename helper function to be more clear
Make it clear that the helper is checking the addr, not setting it. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None net/eth.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/net/eth.c b/net/eth.c index eac4f7b..65e8c77 100644 --- a/net/eth.c +++ b/net/eth.c @@ -153,11 +153,6 @@ static void eth_current_changed(void) setenv(ethact, NULL); } -static int eth_address_set(unsigned char *addr) -{ - return memcmp(addr, \0\0\0\0\0\0, 6); -} - int eth_write_hwaddr(struct eth_device *dev, const char *base_name, int eth_number) { @@ -166,9 +161,9 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name, eth_getenv_enetaddr_by_index(base_name, eth_number, env_enetaddr); - if (eth_address_set(env_enetaddr)) { - if (eth_address_set(dev-enetaddr) - memcmp(dev-enetaddr, env_enetaddr, 6)) { + if (!is_zero_ether_addr(env_enetaddr)) { + if (!is_zero_ether_addr(dev-enetaddr) + memcmp(dev-enetaddr, env_enetaddr, 6)) { printf(\nWarning: %s MAC addresses don't match:\n, dev-name); printf(Address in SROM is %pM\n, @@ -183,7 +178,7 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name, dev-enetaddr); printf(\nWarning: %s using MAC address from net device\n, dev-name); - } else if (!(eth_address_set(dev-enetaddr))) { + } else if (is_zero_ether_addr(dev-enetaddr)) { printf(\nError: %s address not set.\n, dev-name); return -EINVAL; -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 08/27] net: Use int instead of u8 for boolean flag
On some archs masking the parameter is inefficient, so don't use u8. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reported-by: Simon Glass s...@chromium.org Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: None Changes in v5: None Changes in v4: -New to v4 Changes in v3: None Changes in v2: None include/net.h | 2 +- net/eth.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/net.h b/include/net.h index fdf6860..cec5612 100644 --- a/include/net.h +++ b/include/net.h @@ -178,7 +178,7 @@ void eth_halt(void);/* stop SCC */ const char *eth_get_name(void);/* get name of current device */ #ifdef CONFIG_MCAST_TFTP -int eth_mcast_join(IPaddr_t mcast_addr, u8 join); +int eth_mcast_join(IPaddr_t mcast_addr, int join); u32 ether_crc(size_t len, unsigned char const *p); #endif diff --git a/net/eth.c b/net/eth.c index 9ad15cd..b86994e 100644 --- a/net/eth.c +++ b/net/eth.c @@ -321,7 +321,7 @@ int eth_initialize(bd_t *bis) * mcast_addr: multicast ipaddr from which multicast Mac is made * join: 1=join, 0=leave. */ -int eth_mcast_join(IPaddr_t mcast_ip, u8 join) +int eth_mcast_join(IPaddr_t mcast_ip, int join) { u8 mcast_mac[6]; if (!eth_current || !eth_current-mcast) -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 26/27] sandbox: eth: Add support for using the 'lo' interface
The 'lo' interface on Linux doesn't support thinks like ARP or link-layer access like we use to talk to a normal network interface. A higher-level network API must be used to access localhost. As written, this interface is limited to not supporting ICMP since the API doesn't allow the socket to be opened for all IP traffic and be able to receive at the same time. UDP is far more useful to test with, so it was selected over ICMP. Ping won't work, but things like TFTP should work. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: None Changes in v5: -Add details about lo support to the README -Remove socket timeout -Separate init to 2 helper static functions -Set the socket to non-blocking -Use INADDR_LOOPBACK -Use more verbose comments Changes in v4: -Added support for the 'lo' network interface Changes in v3: None Changes in v2: None arch/sandbox/cpu/eth-raw-os.c | 113 +- arch/sandbox/dts/sandbox.dts | 10 +++ arch/sandbox/include/asm/eth-raw-os.h | 10 ++- board/sandbox/README.sandbox | 22 +++ drivers/net/sandbox-raw.c | 71 - 5 files changed, 221 insertions(+), 5 deletions(-) diff --git a/arch/sandbox/cpu/eth-raw-os.c b/arch/sandbox/cpu/eth-raw-os.c index 601205a..b76a731 100644 --- a/arch/sandbox/cpu/eth-raw-os.c +++ b/arch/sandbox/cpu/eth-raw-os.c @@ -12,6 +12,8 @@ #include fcntl.h #include net/if.h #include netinet/in.h +#include netinet/ip.h +#include netinet/udp.h #include stdio.h #include stdlib.h #include string.h @@ -20,10 +22,11 @@ #include sys/socket.h #include unistd.h +#include arpa/inet.h #include linux/if_ether.h #include linux/if_packet.h -int sandbox_eth_raw_os_start(const char *ifname, unsigned char *ethmac, +static int _raw_packet_start(const char *ifname, unsigned char *ethmac, struct eth_sandbox_raw_priv *priv) { struct sockaddr_ll *device; @@ -89,14 +92,114 @@ int sandbox_eth_raw_os_start(const char *ifname, unsigned char *ethmac, return 0; } +static int _local_inet_start(struct eth_sandbox_raw_priv *priv) +{ + struct sockaddr_in *device; + int ret; + int flags; + int one = 1; + + /* Prepare device struct */ + priv-device = malloc(sizeof(struct sockaddr_in)); + if (priv-device == NULL) + return -ENOMEM; + device = priv-device; + memset(device, 0, sizeof(struct sockaddr_in)); + device-sin_family = AF_INET; + device-sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + /** +* Open socket +* Since we specify UDP here, any incoming ICMP packets will +* not be received, so things like ping will not work on this +* localhost interface. +*/ + priv-sd = socket(AF_INET, SOCK_RAW, IPPROTO_UDP); + if (priv-sd 0) { + printf(Failed to open socket: %d %s\n, errno, + strerror(errno)); + return -errno; + } + + /* Make the socket non-blocking */ + flags = fcntl(priv-sd, F_GETFL, 0); + fcntl(priv-sd, F_SETFL, flags | O_NONBLOCK); + + /* Include the UDP/IP headers on send and receive */ + ret = setsockopt(priv-sd, IPPROTO_IP, IP_HDRINCL, one, +sizeof(one)); + if (ret 0) { + printf(Failed to set header include option: %d %s\n, errno, + strerror(errno)); + return -errno; + } + priv-local_bind_sd = -1; + priv-local_bind_udp_port = 0; + return 0; +} + +int sandbox_eth_raw_os_start(const char *ifname, unsigned char *ethmac, + struct eth_sandbox_raw_priv *priv) +{ + if (priv-local) + return _local_inet_start(priv); + else + return _raw_packet_start(ifname, ethmac, priv); +} + int sandbox_eth_raw_os_send(void *packet, int length, - const struct eth_sandbox_raw_priv *priv) + struct eth_sandbox_raw_priv *priv) { int retval; + struct udphdr *udph = packet + sizeof(struct iphdr); if (!priv-sd || !priv-device) return -EINVAL; + /* +* This block of code came about when testing tftp on the localhost +* interface. When using the RAW AF_INET API, the network stack is still +* in play responding to incoming traffic based on open ports. Since +* it is raw (at the IP layer, no Ethernet) the network stack tells the +* TFTP server that the port it responded to is closed. This causes the +* TFTP transfer to be aborted. This block of code inspects the outgoing +* packet as formulated by the u-boot network stack to determine the +* source port (that the TFTP server will send packets back to) and +* opens a typical UDP socket on that port,
[U-Boot] [PATCH v6 27/27] net: Improve error handling
Take a pass at plumbing errors through to the users of the network stack Currently only the start() function errors will be returned from NetLoop(). recv() tends not to have errors, so that is likely not worth adding. send() certainly can return errors, but this patch does not attempt to plumb them yet. halt() is not expected to error. Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: None Changes in v5: -New to v5 Changes in v4: None Changes in v3: None Changes in v2: None include/net.h | 3 ++- net/eth.c | 56 net/net.c | 26 ++ test/dm/eth.c | 4 ++-- 4 files changed, 70 insertions(+), 19 deletions(-) diff --git a/include/net.h b/include/net.h index baccd47..a60ff03 100644 --- a/include/net.h +++ b/include/net.h @@ -541,7 +541,7 @@ int NetLoop(enum proto_t); void NetStop(void); /* Load failed. Start again. */ -void NetStartAgain(void); +intNetStartAgain(void); /* Get size of the ethernet header when we send */ intNetEthHdrSize(void); @@ -611,6 +611,7 @@ static inline void net_set_state(enum net_loop_state state) /* Transmit a packet */ static inline void NetSendPacket(uchar *pkt, int len) { + /* Currently no way to return errors from eth_send() */ (void) eth_send(pkt, len); } diff --git a/net/eth.c b/net/eth.c index b6c2af3..13b7723 100644 --- a/net/eth.c +++ b/net/eth.c @@ -98,6 +98,9 @@ struct eth_uclass_priv { struct udevice *current; }; +/* eth_errno - This stores the most recent failure code from DM functions */ +static int eth_errno; + static struct eth_uclass_priv *eth_get_uclass_priv(void) { struct uclass *uc; @@ -118,20 +121,32 @@ static void eth_set_current_to_next(void) uclass_first_device(UCLASS_ETH, uc_priv-current); } +/* + * Typically this will simply return the active device. + * In the case where the most recent active device was unset, this will attempt + * to return the first device. If that device doesn't exist or fails to probe, + * this function will return NULL. + */ struct udevice *eth_get_dev(void) { struct eth_uclass_priv *uc_priv; uc_priv = eth_get_uclass_priv(); if (!uc_priv-current) - uclass_first_device(UCLASS_ETH, + eth_errno = uclass_first_device(UCLASS_ETH, uc_priv-current); return uc_priv-current; } +/* + * Typically this will just store a device pointer. + * In case it was not probed, we will attempt to do so. + * dev may be NULL to unset the active device. + */ static void eth_set_dev(struct udevice *dev) { - device_probe(dev); + if (dev !device_active(dev)) + eth_errno = device_probe(dev); eth_get_uclass_priv()-current = dev; } @@ -155,7 +170,14 @@ struct udevice *eth_get_dev_by_name(const char *devname) uclass_get(UCLASS_ETH, uc); uclass_foreach_dev(it, uc) { - /* We need the seq to be valid, so make sure it's probed */ + /* +* We need the seq to be valid, so try to probe it. +* If the probe fails, the seq will not match since it will be +* -1 instead of what we are looking for. +* We don't care about errors from probe here. Either they won't +* match an alias or it will match a literal name and we'll pick +* up the error when we try to probe again in eth_set_dev(). +*/ device_probe(it); /* * Check for the name or the sequence number to match @@ -221,6 +243,7 @@ int eth_init(void) { struct udevice *current; struct udevice *old_current; + int ret = -ENODEV; current = eth_get_dev(); if (!current) { @@ -243,22 +266,29 @@ int eth_init(void) else memset(pdata-enetaddr, 0, 6); - if (eth_get_ops(current)-start(current) = 0) { + ret = eth_get_ops(current)-start(current); + if (ret = 0) { struct eth_device_priv *priv = current-uclass_priv; priv-state = ETH_STATE_ACTIVE; return 0; } - } + } else + ret = eth_errno; + debug(FAIL\n); - /* This will ensure the new current attempted to probe */ + /* +* If ethrotate is enabled, this will change current, +* otherwise we will drop out of this while loop immediately +*/ eth_try_another(0); + /* This will ensure the new current attempted to probe */
Re: [U-Boot] [PATCH v2] mmc: fsl_esdhc: Add support for DDR mode
Fabio, Yes, it was too optimistic to enable it for all i.MX6 base devices, I'll submit patch for disable it by default. Vendors can enable it separately for custom boards. Stefan, Please let me know if you have any results with debug patches. BR, Volodymyr. http://www.globallogic.com/email_disclaimer.txt On Wed, Mar 11, 2015 at 7:42 PM, Fabio Estevam feste...@gmail.com wrote: Volodymyr, On Tue, Jan 20, 2015 at 1:16 PM, Volodymyr Riazantsev volodymyr.riazant...@globallogic.com wrote: diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h index e0528ce..29b72b2 100644 --- a/include/configs/mx6_common.h +++ b/include/configs/mx6_common.h @@ -28,6 +28,8 @@ #define CONFIG_SYS_PL310_BASE L2_PL310_BASE #endif +#define CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE Shouldn't this be defined per board config file instead? Stefan, Does your board work if CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE is removed from mx6_common.h? Regards, Fabio Estevam ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] MAKEALL: Don't try to print size when ./u-boot is deleted
In the case of BUILD_NBUILDS 1, MAKEALL would try to print the size immediately after the u-boot binary is deleted by the call to: make -s clean Move the size print to before the clean Signed-off-by: Joe Hershberger joe.hershber...@ni.com --- MAKEALL | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MAKEALL b/MAKEALL index c5f665f..5483b38 100755 --- a/MAKEALL +++ b/MAKEALL @@ -655,6 +655,13 @@ build_target() { RC=1 fi + OBJS=${output_dir}/u-boot + if [ -e ${output_dir}/spl/u-boot-spl ]; then + OBJS=${OBJS} ${output_dir}/spl/u-boot-spl + fi + + ${CROSS_COMPILE}size ${OBJS} | tee -a ${LOG_DIR}/$target.MAKELOG + if [ $BUILD_MANY == 1 ] ; then trap - TERM @@ -679,13 +686,6 @@ build_target() { fi fi - OBJS=${output_dir}/u-boot - if [ -e ${output_dir}/spl/u-boot-spl ]; then - OBJS=${OBJS} ${output_dir}/spl/u-boot-spl - fi - - ${CROSS_COMPILE}size ${OBJS} | tee -a ${LOG_DIR}/$target.MAKELOG - [ -e ${LOG_DIR}/${target}.ERR ] cat ${LOG_DIR}/${target}.ERR touch ${donep}${build_idx} -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V6 00/11] ARM: OMAP3-DRA7: CP15 erratum workarounds and improvements
On Wed, Mar 11, 2015 at 12:00:59PM -0400, Tom Rini wrote: On Wed, Mar 11, 2015 at 10:51:12AM -0500, Nishanth Menon wrote: On Wed, Mar 11, 2015 at 10:48 AM, Tom Rini tr...@konsulko.com wrote: On Mon, Mar 09, 2015 at 05:11:58PM -0500, Nishanth Menon wrote: The sixth revision should be proper, I hope. (skipping all the blurb and pointing to v1 for the blurb). Changes since v5: - omap_smc1 is now in omap_common.h - I hope we can pick up Matt's Tested-by tag from previous rev.. http://article.gmane.org/gmane.comp.boot-loaders.u-boot/214277 In the future please collect those :) Or would that be too different from kernel policy? I did change code as per rev5 review comments, so was'nt too sure if i could carry the tested-by tag over.. Ah yes. Matt, would you have time to test it all again? Thanks! Yes. Reconfirmed that v6 is working properly on both beagles. The xM has the erratum workaround applied and the omap3530 beagleboard does not have it applied as expected. Feel free to keep my Tested-by. -Matt 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] mx6: Set shared override bit in PL310 AUX_CTRL register
On Wed, Mar 11, 2015 at 05:12:12PM -0300, Fabio Estevam wrote: From: Fabio Estevam fabio.este...@freescale.com Having bit 22 cleared in the PL310 Auxiliary Control register (shared attribute override enable) has the side effect of transforming Normal Shared Non-cacheable reads into Cacheable no-allocate reads. Coherent DMA buffers in Linux always have a Cacheable alias via the kernel linear mapping and the processor can speculatively load cache lines into the PL310 controller. No, this is wrong. They do not. CMA remaps pages to be non-cacheable rather than the old technique where the above statement was true. There's some corner cases which make that less effective than it once was, and as I've already said, those need to be fixed. The reason that these were missed is because all the ARM CMA work bypassed me - CMA on ARM has had zero review from the point of view of the ARM architecture, so it's not surprising it gets stuff like this wrong. Once that's fixed, setting bit 22 is not necessary. -- FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up according to speedtest.net. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] ARM: UniPhier: adjust device trees for business transfer
Panasonic's System LSI products, UniPhier SoC family, have been transferred to Socionext Inc. Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com --- arch/arm/dts/uniphier-ph1-ld4-ref.dts | 7 --- arch/arm/dts/uniphier-ph1-ld4.dtsi | 27 ++- arch/arm/dts/uniphier-ph1-pro4-ref.dts | 7 --- arch/arm/dts/uniphier-ph1-pro4.dtsi | 33 + arch/arm/dts/uniphier-ph1-sld3-ref.dts | 7 --- arch/arm/dts/uniphier-ph1-sld3.dtsi | 27 ++- arch/arm/dts/uniphier-ph1-sld8-ref.dts | 7 --- arch/arm/dts/uniphier-ph1-sld8.dtsi | 27 ++- arch/arm/dts/uniphier-ref-daughter.dtsi | 3 ++- drivers/i2c/i2c-uniphier-f.c| 7 --- drivers/i2c/i2c-uniphier.c | 7 --- drivers/serial/serial_uniphier.c| 7 --- drivers/usb/host/ehci-uniphier.c| 5 +++-- lib/fdtdec.c| 2 +- 14 files changed, 93 insertions(+), 80 deletions(-) diff --git a/arch/arm/dts/uniphier-ph1-ld4-ref.dts b/arch/arm/dts/uniphier-ph1-ld4-ref.dts index d479be1..d972c02 100644 --- a/arch/arm/dts/uniphier-ph1-ld4-ref.dts +++ b/arch/arm/dts/uniphier-ph1-ld4-ref.dts @@ -2,7 +2,8 @@ * Device Tree Source for UniPhier PH1-LD4 Reference Board * * Copyright (C) 2014-2015 Panasonic Corporation - * Author: Masahiro Yamada yamad...@jp.panasonic.com + * Copyright (C) 2015 Socionext Inc. + * Author: Masahiro Yamada yamada.masah...@socionext.com * * SPDX-License-Identifier:GPL-2.0+ */ @@ -12,8 +13,8 @@ /include/ uniphier-ref-daughter.dtsi / { - model = Panasonic UniPhier PH1-LD4 Reference Board; - compatible = panasonic,ph1-ld4-ref, panasonic,ph1-ld4; + model = UniPhier PH1-LD4 Reference Board; + compatible = socionext,ph1-ld4-ref, socionext,ph1-ld4; memory { device_type = memory; diff --git a/arch/arm/dts/uniphier-ph1-ld4.dtsi b/arch/arm/dts/uniphier-ph1-ld4.dtsi index 8ed7bbf..c200838 100644 --- a/arch/arm/dts/uniphier-ph1-ld4.dtsi +++ b/arch/arm/dts/uniphier-ph1-ld4.dtsi @@ -2,7 +2,8 @@ * Device Tree Source for UniPhier PH1-LD4 SoC * * Copyright (C) 2014-2015 Panasonic Corporation - * Author: Masahiro Yamada yamad...@jp.panasonic.com + * Copyright (C) 2015 Socionext Inc. + * Author: Masahiro Yamada yamada.masah...@socionext.com * * SPDX-License-Identifier:GPL-2.0+ */ @@ -10,7 +11,7 @@ /include/ skeleton.dtsi / { - compatible = panasonic,ph1-ld4; + compatible = socionext,ph1-ld4; cpus { #address-cells = 1; @@ -30,35 +31,35 @@ ranges; uart0: serial@54006800 { - compatible = panasonic,uniphier-uart; + compatible = socionext,uniphier-uart; status = disabled; reg = 0x54006800 0x20; clock-frequency = 36864000; }; uart1: serial@54006900 { - compatible = panasonic,uniphier-uart; + compatible = socionext,uniphier-uart; status = disabled; reg = 0x54006900 0x20; clock-frequency = 36864000; }; uart2: serial@54006a00 { - compatible = panasonic,uniphier-uart; + compatible = socionext,uniphier-uart; status = disabled; reg = 0x54006a00 0x20; clock-frequency = 36864000; }; uart3: serial@54006b00 { - compatible = panasonic,uniphier-uart; + compatible = socionext,uniphier-uart; status = disabled; reg = 0x54006b00 0x20; clock-frequency = 36864000; }; i2c0: i2c@5840 { - compatible = panasonic,uniphier-i2c; + compatible = socionext,uniphier-i2c; #address-cells = 1; #size-cells = 0; reg = 0x5840 0x40; @@ -67,7 +68,7 @@ }; i2c1: i2c@5848 { - compatible = panasonic,uniphier-i2c; + compatible = socionext,uniphier-i2c; #address-cells = 1; #size-cells = 0; reg = 0x5848 0x40; @@ -76,7 +77,7 @@ }; i2c2: i2c@5850 { - compatible = panasonic,uniphier-i2c; + compatible = socionext,uniphier-i2c; #address-cells = 1; #size-cells = 0; reg = 0x5850 0x40; @@ -85,7 +86,7 @@
[U-Boot] [PATCH] README: remove description about driver model configuration options (again)
The Driver Model description in README was removed by commit 65eb659e56fa (README: remove description about driver model configuration options), and was revived by mistake by commit b79dadf846e5 when resolving the conflict. Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com Cc: Tom Rini tr...@konsulko.com --- README | 113 - 1 file changed, 113 deletions(-) diff --git a/README b/README index 08283f5..53f437f 100644 --- a/README +++ b/README @@ -697,119 +697,6 @@ The following options need to be configured: impossible actions will be skipped if the CPU is in NS mode, such as ARM architectural timer initialization. -- Driver Model - Driver model is a new framework for devices in U-Boot - introduced in early 2014. U-Boot is being progressively - moved over to this. It offers a consistent device structure, - supports grouping devices into classes and has built-in - handling of platform data and device tree. - - To enable transition to driver model in a relatively - painful fashion, each subsystem can be independently - switched between the legacy/ad-hoc approach and the new - driver model using the options below. Also, many uclass - interfaces include compatibility features which may be - removed once the conversion of that subsystem is complete. - As a result, the API provided by the subsystem may in fact - not change with driver model. - - See doc/driver-model/README.txt for more information. - - CONFIG_DM - - Enable driver model. This brings in the core support, - including scanning of platform data on start-up. If - CONFIG_OF_CONTROL is enabled, the device tree will be - scanned also when available. - - CONFIG_CMD_DM - - Enable driver model test commands. These allow you to print - out the driver model tree and the uclasses. - - CONFIG_DM_DEMO - - Enable some demo devices and the 'demo' command. These are - really only useful for playing around while trying to - understand driver model in sandbox. - - CONFIG_SPL_DM - - Enable driver model in SPL. You will need to provide a - suitable malloc() implementation. If you are not using the - full malloc() enabled by CONFIG_SYS_SPL_MALLOC_START, - consider using CONFIG_SYS_MALLOC_SIMPLE. In that case you - must provide CONFIG_SYS_MALLOC_F_LEN to set the size. - In most cases driver model will only allocate a few uclasses - and devices in SPL, so 1KB should be enable. See - CONFIG_SYS_MALLOC_F_LEN for more details on how to enable - it. - - CONFIG_DM_SERIAL - - Enable driver model for serial. This replaces - drivers/serial/serial.c with the serial uclass, which - implements serial_putc() etc. The uclass interface is - defined in include/serial.h. - - CONFIG_DM_GPIO - - Enable driver model for GPIO access. The standard GPIO - interface (gpio_get_value(), etc.) is then implemented by - the GPIO uclass. Drivers provide methods to query the - particular GPIOs that they provide. The uclass interface - is defined in include/asm-generic/gpio.h. - - CONFIG_DM_SPI - - Enable driver model for SPI. The SPI slave interface - (spi_setup_slave(), spi_xfer(), etc.) is then implemented by - the SPI uclass. Drivers provide methods to access the SPI - buses that they control. The uclass interface is defined in - include/spi.h. The existing spi_slave structure is attached - as 'parent data' to every slave on each bus. Slaves - typically use driver-private data instead of extending the - spi_slave structure. - - CONFIG_DM_SPI_FLASH - - Enable driver model for SPI flash. This SPI flash interface - (spi_flash_probe(), spi_flash_write(), etc.) is then - implemented by the SPI flash uclass. There is one standard - SPI flash driver which knows how to probe most chips - supported by U-Boot. The uclass interface is defined in - include/spi_flash.h, but is currently fully compatible - with the old interface to avoid confusion and duplication - during the transition parent. SPI and SPI flash must be - enabled together (it is not possible to use driver model - for
Re: [U-Boot] [PATCH] Add bootscript support to esbc_validate.
Hi York, -Original Message- From: Sun York-R58495 Sent: Tuesday, March 10, 2015 10:03 PM To: Gupta Ruchika-R66431; Rana Gaurav-B46163; u-boot@lists.denx.de Cc: Wood Scott-B07421; Bansal Aneesh-B39320 Subject: Re: [PATCH] Add bootscript support to esbc_validate. On 03/10/2015 09:25 AM, Gupta Ruchika-R66431 wrote: Hi York, -Original Message- From: Sun York-R58495 Sent: Tuesday, March 10, 2015 9:45 PM To: Rana Gaurav-B46163; u-boot@lists.denx.de Cc: Wood Scott-B07421; Gupta Ruchika-R66431; Bansal Aneesh-B39320 Subject: Re: [PATCH] Add bootscript support to esbc_validate. On 03/10/2015 01:38 AM, Gaurav Rana wrote: 1. Default environment will be used for secure boot flow which can't be edited or saved. 2. Command for secure boot is predefined in the default environment which will run on autoboot (and autoboot is the only option allowed in case of secure boot) and it looks like this: #define CONFIG_SECBOOT \ setenv bs_hdraddr 0xe8e0; \ esbc_validate $bs_hdraddr;\ source $img_addr; \ esbc_halt; #endif 3. Boot Script can contain esbc_validate commands and bootm command. Uboot source command used in default secure boot command will run the bootscript. 4. Command esbc_halt added to ensure either bootm executes after validation of images or core should just spin. What's the purpose of esbc_halt? Once it enters the spin, how to get it out? The purpose of bootscript is to validate the next level images and then pass control to it, so bootscript must contain a bootm command. We don't expect control to return back to u-boot. Hence a command esbc_halt is introduced which would make the core spin and not provide uboot prompt in case bootscript doesn't pass control to next level image. For secure chain of trust, only validated bootscript should be allowed to execute and be responsible for passing control to next level image. Ruchika, Do you expect secure boot to run automatically once u-boot reaches the prompt and the source $img_addr to actually boot the OS? You put esbc_halt as a fall-back to catch failure above? It doesn't sounds very secure to me. The bootscript is first validated. Only an authenticated user, who has the private key can sign the bootscript. Thus validating bootscript is important in secure boot chain of trust. You are right regarding fallback as esbc_halt. In the esbc_halt implementation, we will add code to clear security secrets on the chip, and issue a reset. We will send a separate patch for that. Ruchika I am hoping other reviewers can chime in and give comments. York ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2] pci/layerscape: fix link and class issues to support ls2085a
1. LS2085a provides PCIE_LUT_DBG register rather than PCIE_LDBG to show the link status, so the patch fixes it. 2. Increase the delay time to make sure that link training has finished. 3. Return invalid value when accessing multi-function device 4. For LS2085a DBI_RO_WR_EN bit is cleared as default, so we must set this bit before change DBI register value. Signed-off-by: Roy Zang tie-fei.z...@freescale.com Signed-off-by: Minghuan Lian minghuan.l...@freescale.com --- drivers/pci/pcie_layerscape.c | 47 ++- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/drivers/pci/pcie_layerscape.c b/drivers/pci/pcie_layerscape.c index 15e3546..8330380 100644 --- a/drivers/pci/pcie_layerscape.c +++ b/drivers/pci/pcie_layerscape.c @@ -50,11 +50,20 @@ #define PCIE_ATU_FUNC(x) (((x) 0x7) 16) #define PCIE_ATU_UPPER_TARGET 0x91C +/* LUT registers */ +#define PCIE_LUT_BASE 0x8 +#define PCIE_LUT_DBG 0x7FC + +#define PCIE_DBI_RO_WR_EN 0x8bc + #define PCIE_LINK_CAP 0x7c #define PCIE_LINK_SPEED_MASK 0xf #define PCIE_LINK_STA 0x82 -#define PCIE_DBI_SIZE (4 * 1024) /* 4K */ +#define LTSSM_STATE_MASK 0x3f +#define LTSSM_PCIE_L0 0x11 /* L0 state */ + +#define PCIE_DBI_SIZE 0x10 /* 1M */ struct ls_pcie { int idx; @@ -104,8 +113,6 @@ struct ls_pcie_info { /* PEX1/2 Misc Ports Status Register */ #define LTSSM_STATE_SHIFT 20 -#define LTSSM_STATE_MASK 0x3f -#define LTSSM_PCIE_L0 0x11 /* L0 state */ static int ls_pcie_link_state(struct ls_pcie *pcie) { @@ -122,18 +129,18 @@ static int ls_pcie_link_state(struct ls_pcie *pcie) return 1; } #else -#define PCIE_LDBG 0x7FC - static int ls_pcie_link_state(struct ls_pcie *pcie) { u32 state; - state = readl(pcie-dbi + PCIE_LDBG); - if (state) - return 1; + state = readl(pcie-dbi + PCIE_LUT_BASE + PCIE_LUT_DBG) + LTSSM_STATE_MASK; + if (state LTSSM_PCIE_L0) { + debug(PCIe link error. LTSSM=0x%02x.\n, state); + return 0; + } - debug(PCIe link error.\n); - return 0; + return 1; } #endif @@ -149,7 +156,11 @@ static int ls_pcie_link_up(struct ls_pcie *pcie) /* Try to download speed to gen1 */ cap = readl(pcie-dbi + PCIE_LINK_CAP); writel((cap (~PCIE_LINK_SPEED_MASK)) | 1, pcie-dbi + PCIE_LINK_CAP); - udelay(2000); + /* +* Notice: the following delay has critical impact on link training +* if too short (30ms) the link doesn't get up. +*/ + mdelay(100); state = ls_pcie_link_state(pcie); if (state) return state; @@ -251,6 +262,10 @@ static int ls_pcie_addr_valid(struct pci_controller *hose, pci_dev_t d) if (PCI_DEV(d) 0) return -EINVAL; + /* Controller does not support multi-function in RC mode */ + if ((PCI_BUS(d) == hose-first_busno) (PCI_FUNC(d) 0)) + return -EINVAL; + return 0; } @@ -327,8 +342,12 @@ static void ls_pcie_setup_ctrl(struct ls_pcie *pcie, pci_hose_write_config_dword(hose, dev, PCI_BASE_ADDRESS_0, 0); /* program correct class for RC */ + writel(1, pcie-dbi + PCIE_DBI_RO_WR_EN); pci_hose_write_config_word(hose, dev, PCI_CLASS_DEVICE, PCI_CLASS_BRIDGE_PCI); +#ifndef CONFIG_LS102XA + writel(0, pcie-dbi + PCIE_DBI_RO_WR_EN); +#endif } int ls_pcie_init_ctrl(int busno, enum srds_prtcl dev, struct ls_pcie_info *info) @@ -417,9 +436,9 @@ int ls_pcie_init_ctrl(int busno, enum srds_prtcl dev, struct ls_pcie_info *info) } /* Print the negotiated PCIe link width */ - pci_hose_read_config_word(hose, dev, PCIE_LINK_STA, temp16); - printf(x%d gen%d, regs @ 0x%lx\n, (temp16 0x3f0) 4, - (temp16 0xf), info-regs); + pci_hose_read_config_word(hose, pdev, PCIE_LINK_STA, temp16); + printf(x%d gen%d, regs @ 0x%lx\n, (temp16 0x3f0) 4, + (temp16 0xf), info-regs); if (ep_mode) return busno; -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] arm: armada-xp: Fix SPL for AXP by using save_boot_params_ret
Patch e11c6c27 (arm: Allow lr to be saved by board code) introduced a different method to return from save_boot_params(). The SPL support for AXP has been pulled and changing to this new method is now required for SPL to work correctly. Signed-off-by: Stefan Roese s...@denx.de Cc: Simon Glass s...@chromium.org Cc: Luka Perkov luka.per...@sartura.hr --- arch/arm/cpu/armv7/armada-xp/lowlevel_spl.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/cpu/armv7/armada-xp/lowlevel_spl.S b/arch/arm/cpu/armv7/armada-xp/lowlevel_spl.S index 1febd7b..6c5e544 100644 --- a/arch/arm/cpu/armv7/armada-xp/lowlevel_spl.S +++ b/arch/arm/cpu/armv7/armada-xp/lowlevel_spl.S @@ -7,7 +7,7 @@ #include linux/linkage.h ENTRY(save_boot_params) - bx lr + b save_boot_params_ret ENDPROC(save_boot_params) /* -- 2.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] autoboot.c: Add feature to stop autobooting via SHA256 encrypted password
This patch adds the feature to only stop the autobooting, and therefor boot into the U-Boot prompt, when the input string / password matches a values that is encypted via a SHA256 hash and saved in the environment. This feature is enabled by defined these config options: CONFIG_AUTOBOOT_KEYED CONFIG_AUTOBOOT_STOP_STR_SHA256 Signed-off-by: Stefan Roese s...@denx.de --- common/autoboot.c | 45 - 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/common/autoboot.c b/common/autoboot.c index c27cc2c..4635551 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -12,6 +12,7 @@ #include fdtdec.h #include menu.h #include post.h +#include u-boot/sha256.h DECLARE_GLOBAL_DATA_PTR; @@ -35,6 +36,11 @@ static int abortboot_keyed(int bootdelay) { int abort = 0; uint64_t etime = endtick(bootdelay); +#if defined(CONFIG_AUTOBOOT_STOP_STR_SHA256) + const char *sha_env_str = getenv(bootstopkeysha256); + u8 sha_env[SHA256_SUM_LEN]; + u8 sha[SHA256_SUM_LEN]; +#else struct { char *str; u_int len; @@ -46,10 +52,11 @@ static int abortboot_keyed(int bootdelay) { .str = getenv(bootstopkey), .retry = 0 }, { .str = getenv(bootstopkey2), .retry = 0 }, }; + u_int presskey_max = 0; +#endif char presskey[MAX_DELAY_STOP_STR]; u_int presskey_len = 0; - u_int presskey_max = 0; u_int i; #ifndef CONFIG_ZERO_BOOTDELAY_CHECK @@ -61,6 +68,41 @@ static int abortboot_keyed(int bootdelay) printf(CONFIG_AUTOBOOT_PROMPT); # endif +#if defined(CONFIG_AUTOBOOT_STOP_STR_SHA256) + if (sha_env_str == NULL) + sha_env_str = CONFIG_AUTOBOOT_STOP_STR_SHA256; + + /* +* Generate the binary value from the environment hash value +* so that we can compare this value with the computed hash +* from the user input +*/ + for (i = 0; i SHA256_SUM_LEN; i++) { + char chr[3]; + + strncpy(chr, sha_env_str[i * 2], 2); + sha_env[i] = simple_strtoul(chr, NULL, 16); + } + + /* +* We don't know how long the stop-string is, so we need to +* generate the sha256 hash upon each input character and +* compare the value with the one saved in the environment +*/ + do { + if (tstc()) { + presskey[presskey_len++] = getc(); + + /* Calculate sha256 upon each new char */ + sha256_csum_wd((unsigned char *)presskey, presskey_len, + sha, CHUNKSZ_SHA256); + + /* And check if sha matches saved value in env */ + if (memcmp(sha, sha_env, SHA256_SUM_LEN) == 0) + abort = 1; + } + } while (!abort get_ticks() = etime); +#else # ifdef CONFIG_AUTOBOOT_DELAY_STR if (delaykey[0].str == NULL) delaykey[0].str = CONFIG_AUTOBOOT_DELAY_STR; @@ -124,6 +166,7 @@ static int abortboot_keyed(int bootdelay) } } } while (!abort get_ticks() = etime); +#endif if (!abort) debug_bootkeys(key timeout\n); -- 2.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] cmd_led: Extend led command to support blinking and more leds
This patch extends the U-Boot led command to support automatic blinking by setting a blink frequency in milliseconds. Additionally the number of supported LEDs is increased to 6 (0...5). This will be used by the PCA9551 LED driver. Signed-off-by: Stefan Roese s...@denx.de --- common/cmd_led.c | 48 +-- drivers/misc/status_led.c | 14 ++ include/status_led.h | 1 + 3 files changed, 53 insertions(+), 10 deletions(-) diff --git a/common/cmd_led.c b/common/cmd_led.c index 172bc30..b0f1a61 100644 --- a/common/cmd_led.c +++ b/common/cmd_led.c @@ -39,6 +39,12 @@ static const led_tbl_t led_commands[] = { #ifdef STATUS_LED_BIT3 { 3, STATUS_LED_BIT3, NULL, NULL, NULL }, #endif +#ifdef STATUS_LED_BIT4 + { 4, STATUS_LED_BIT4, NULL, NULL, NULL }, +#endif +#ifdef STATUS_LED_BIT5 + { 5, STATUS_LED_BIT5, NULL, NULL, NULL }, +#endif #endif #ifdef STATUS_LED_GREEN { green, STATUS_LED_GREEN, green_led_off, green_led_on, NULL }, @@ -55,30 +61,39 @@ static const led_tbl_t led_commands[] = { { NULL, 0, NULL, NULL, NULL } }; -enum led_cmd { LED_ON, LED_OFF, LED_TOGGLE }; +enum led_cmd { LED_ON, LED_OFF, LED_TOGGLE, LED_BLINK }; enum led_cmd get_led_cmd(char *var) { - if (strcmp(var, off) == 0) { + if (strcmp(var, off) == 0) return LED_OFF; - } - if (strcmp(var, on) == 0) { + if (strcmp(var, on) == 0) return LED_ON; - } if (strcmp(var, toggle) == 0) return LED_TOGGLE; + if (strcmp(var, blink) == 0) + return LED_BLINK; + return -1; } +/* + * LED drivers providing a blinking LED functionality, like the + * PCA9551, can override this empty weak function + */ +void __weak __led_blink(led_id_t mask, int freq) +{ +} + int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int i, match = 0; enum led_cmd cmd; + int freq; /* Validate arguments */ - if ((argc != 3)) { + if ((argc 3) || (argc 4)) return CMD_RET_USAGE; - } cmd = get_led_cmd(argv[2]); if (cmd 0) { @@ -109,6 +124,13 @@ int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) led_commands[i].toggle(); else __led_toggle(led_commands[i].mask); + break; + case LED_BLINK: + if (argc != 4) + return CMD_RET_USAGE; + + freq = simple_strtoul(argv[3], NULL, 10); + __led_blink(led_commands[i].mask, freq); } /* Need to set only 1 led if led_name wasn't 'all' */ if (strcmp(all, argv[1]) != 0) @@ -125,7 +147,7 @@ int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } U_BOOT_CMD( - led, 3, 1, do_led, + led, 4, 1, do_led, [ #ifdef CONFIG_BOARD_SPECIFIC_LED #ifdef STATUS_LED_BIT @@ -140,6 +162,12 @@ U_BOOT_CMD( #ifdef STATUS_LED_BIT3 3| #endif +#ifdef STATUS_LED_BIT4 + 4| +#endif +#ifdef STATUS_LED_BIT5 + 5| +#endif #endif #ifdef STATUS_LED_GREEN green| @@ -153,6 +181,6 @@ U_BOOT_CMD( #ifdef STATUS_LED_BLUE blue| #endif - all] [on|off|toggle], - [led_name] [on|off|toggle] sets or clears led(s) + all] [on|off|toggle|blink] [blink-freq in ms], + [led_name] [on|off|toggle|blink] sets or clears led(s) ); diff --git a/drivers/misc/status_led.c b/drivers/misc/status_led.c index ed9adb2..9869d98 100644 --- a/drivers/misc/status_led.c +++ b/drivers/misc/status_led.c @@ -53,6 +53,20 @@ led_dev_t led_dev[] = { 0, }, #endif +#if defined(STATUS_LED_BIT4) +{ STATUS_LED_BIT4, + STATUS_LED_STATE4, + STATUS_LED_PERIOD4, + 0, +}, +#endif +#if defined(STATUS_LED_BIT5) +{ STATUS_LED_BIT5, + STATUS_LED_STATE5, + STATUS_LED_PERIOD5, + 0, +}, +#endif }; #define MAX_LED_DEV(sizeof(led_dev)/sizeof(led_dev_t)) diff --git a/include/status_led.h b/include/status_led.h index 27f4bdf..a5e35df 100644 --- a/include/status_led.h +++ b/include/status_led.h @@ -105,6 +105,7 @@ typedef unsigned long led_id_t; extern void __led_toggle (led_id_t mask); extern void __led_init (led_id_t mask, int state); extern void __led_set (led_id_t mask, int state); +void __led_blink(led_id_t mask, int freq); #else # error Status LED configuration missing #endif -- 2.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] misc: led: Add PCA9551 LED driver
This patch adds a driver for the PCA9551 LED controller. Originated-by: Timo Herbrecher t.herbrec...@gateware.de Signed-off-by: Stefan Roese s...@denx.de --- drivers/misc/Kconfig | 14 + drivers/misc/Makefile | 1 + drivers/misc/pca9551_led.c | 147 + 3 files changed, 162 insertions(+) create mode 100644 drivers/misc/pca9551_led.c diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 36a8f0d..b8884ec 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -61,3 +61,17 @@ config CONFIG_FSL_SEC_MON system states. Security Monitor can be transitioned on any security failures, like software violations or hardware security violations. + +config PCA9551_LED + bool Enable PCA9551 LED driver + depends on TARGET_TQMA6 + help + Enable driver for PCA9551 LED controller. This controller + is connected via I2C. So I2C needs to be enabled. + +config PCA9551_I2C_ADDR + hex I2C address of PCA9551 LED controller + depends on PCA9551_LED + default 0x60 + help + The I2C address of the PCA9551 LED controller. diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index 6028cd4..149e686 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -29,3 +29,4 @@ obj-$(CONFIG_STATUS_LED) += status_led.o obj-$(CONFIG_TWL4030_LED) += twl4030_led.o obj-$(CONFIG_FSL_IFC) += fsl_ifc.o obj-$(CONFIG_FSL_SEC_MON) += fsl_sec_mon.o +obj-$(CONFIG_PCA9551_LED) += pca9551_led.o diff --git a/drivers/misc/pca9551_led.c b/drivers/misc/pca9551_led.c new file mode 100644 index 000..273cc53 --- /dev/null +++ b/drivers/misc/pca9551_led.c @@ -0,0 +1,147 @@ +/* + * Copyright (C) 2015 Stefan Roese s...@denx.de + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include common.h +#include i2c.h + +#ifndef CONFIG_PCA9551_I2C_ADDR +#error CONFIG_PCA9551_I2C_ADDR not defined! +#endif + +#define PCA9551_REG_INPUT 0x00/* Input register (read only) */ +#define PCA9551_REG_PSC0 0x01/* Frequency prescaler 0 */ +#define PCA9551_REG_PWM0 0x02/* PWM0 */ +#define PCA9551_REG_PSC1 0x03/* Frequency prescaler 1 */ +#define PCA9551_REG_PWM1 0x04/* PWM1 */ +#define PCA9551_REG_LS00x05/* LED0 to LED3 selector */ +#define PCA9551_REG_LS10x06/* LED4 to LED7 selector */ + +#define PCA9551_CTRL_AI(1 4)/* Auto-increment flag */ + +#define PCA9551_LED_STATE_ON 0x00 +#define PCA9551_LED_STATE_OFF 0x01 +#define PCA9551_LED_STATE_BLINK0 0x02 +#define PCA9551_LED_STATE_BLINK1 0x03 + +struct pca9551_blink_rate { + u8 psc; /* Frequency preescaler, see PCA9551_7.pdf p. 6 */ + u8 pwm; /* Pulse width modulation, see PCA9551_7.pdf p. 6 */ +} __packed; + +static int freq0, freq1; + +static int pca9551_led_get_state(int led, int *state) +{ + unsigned int reg; + u8 shift, buf; + + if (led 0 || led 7) { + return -1; + } else if (led 4) { + reg = PCA9551_REG_LS0; + shift = led 1; + } else { + reg = PCA9551_REG_LS1; + shift = (led - 4) 1; + } + + if (i2c_read(CONFIG_PCA9551_I2C_ADDR, reg, 1, buf, 1)) + return -1; + + *state = (buf shift) 0x03; + return 0; +} + +static int pca9551_led_set_state(int led, int state) +{ + unsigned int reg; + u8 shift, buf, mask; + + if (led 0 || led 7) { + return -1; + } else if (led 4) { + reg = PCA9551_REG_LS0; + shift = led 1; + } else { + reg = PCA9551_REG_LS1; + shift = (led - 4) 1; + } + mask = 0x03 shift; + + if (i2c_read(CONFIG_PCA9551_I2C_ADDR, reg, 1, buf, 1)) + return -1; + + buf = (buf ~mask) | ((state 0x03) shift); + + if (i2c_write(CONFIG_PCA9551_I2C_ADDR, reg, 1, buf, 1)) + return -1; + + return 0; +} + +static int pca9551_led_set_blink_rate(int idx, struct pca9551_blink_rate rate) +{ + unsigned int reg; + + switch (idx) { + case 0: + reg = PCA9551_REG_PSC0; + break; + case 1: + reg = PCA9551_REG_PSC1; + break; + default: + return -1; + } + reg |= PCA9551_CTRL_AI; + + if (i2c_write(CONFIG_PCA9551_I2C_ADDR, reg, 1, (u8 *)rate, 2)) + return -1; + + return 0; +} + +/* + * Functions referenced by cmd_led.c + */ +void __led_set(led_id_t mask, int state) +{ + if (state == STATUS_LED_OFF) + pca9551_led_set_state(mask, PCA9551_LED_STATE_OFF); + else + pca9551_led_set_state(mask, PCA9551_LED_STATE_ON); +} + +void __led_toggle(led_id_t mask) +{ + int state = 0; + + pca9551_led_get_state(mask, state); +
[U-Boot] [PATCH] bootcount: Add dcache flush to bootcount_store()
Without this dcache_flush the updated bootcounter may not be saved to its location. This was detected on an iMX.6 platform using the OCRAM (internal SRAM) as bootcounter storage area. And issuing reset from within U-Boot cause the bootcounter to stay on its initial value. Signed-off-by: Stefan Roese s...@denx.de --- drivers/bootcount/bootcount.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bootcount/bootcount.c b/drivers/bootcount/bootcount.c index e0343f7..b3e79de 100644 --- a/drivers/bootcount/bootcount.c +++ b/drivers/bootcount/bootcount.c @@ -57,9 +57,11 @@ __weak void bootcount_store(ulong a) #if defined(CONFIG_SYS_BOOTCOUNT_SINGLEWORD) raw_bootcount_store(reg, (BOOTCOUNT_MAGIC 0x) | a); + flush_dcache_range((u32)reg, (u32)reg + 4); #else raw_bootcount_store(reg, a); raw_bootcount_store(reg + 4, BOOTCOUNT_MAGIC); + flush_dcache_range((u32)reg, (u32)reg + 8); #endif } -- 2.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] T2080QDS/PCIe: Soft Reset PCIe for down-training issue
T2080QDS PEX1/Slot#1 will down-train from x4 to x2, Soft reset PCIe can fix this issue, this is a workaround. Signed-off-by: Zhao Qiang b45...@freescale.com --- changes for v2 - modify the commit message drivers/pci/fsl_pci_init.c | 17 + include/configs/T208xQDS.h | 1 + 2 files changed, 18 insertions(+) diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c index 231b075..327fa7d 100644 --- a/drivers/pci/fsl_pci_init.c +++ b/drivers/pci/fsl_pci_init.c @@ -481,6 +481,23 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info) #endif } +#ifdef CONFIG_FSL_PCIE_T2080QDS_RESET + int i; + /* assert PCIe reset */ + setbits_be32(pci-pdb_stat, 0x0800); + (void) in_be32(pci-pdb_stat); + udelay(1000); + /* clear PCIe reset */ + clrbits_be32(pci-pdb_stat, 0x0800); + asm(sync;isync); + for (i = 0; i 100 ltssm PCI_LTSSM_L0; i++) { + pci_hose_read_config_word(hose, dev, PCI_LTSSM, + ltssm); + udelay(1000); + } + +#endif + #ifdef CONFIG_SYS_P4080_ERRATUM_PCIE_A003 if (enabled == 0) { serdes_corenet_t *srds_regs = (void *)CONFIG_SYS_FSL_CORENET_SERDES_ADDR; diff --git a/include/configs/T208xQDS.h b/include/configs/T208xQDS.h index 395472b..851b4f9 100644 --- a/include/configs/T208xQDS.h +++ b/include/configs/T208xQDS.h @@ -558,6 +558,7 @@ unsigned long get_board_ddr_clk(void); #define CONFIG_PCIE2 /* PCIE controler 2 */ #define CONFIG_PCIE3 /* PCIE controler 3 */ #define CONFIG_PCIE4 /* PCIE controler 4 */ +#define CONFIG_FSL_PCIE_T2080QDS_RESET #define CONFIG_FSL_PCI_INIT/* Use common FSL init code */ #define CONFIG_SYS_PCI_64BIT /* enable 64-bit PCI resources */ /* controller 1, direct to uli, tgtid 3, Base address 2 */ -- 2.1.0.27.g96db324 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2] Exynos: Clock: Fix exynos5_get_periph_rate for I2C.
Commit 2e82e9252695a612ab0cbf40fa0c7368515f6506 'Exynos: Clock: Cleanup soc_get_periph_rate' introduced a bug in I2C config. This patch makes cros_ec keyboard working again on Samsung Chromebook (snow). Changes in V2: reorder lines as requested by Joonyoung Shim. Signed-off-by: Guillaume GARDET guillaume.gar...@free.fr Cc: Akshay Saraswat aksha...@samsung.com Cc: Minkyu Kang mk7.k...@samsung.com Cc: Joonyoung Shim jy0922.s...@samsung.com --- arch/arm/cpu/armv7/exynos/clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/cpu/armv7/exynos/clock.c b/arch/arm/cpu/armv7/exynos/clock.c index c6455c2..2984867 100644 --- a/arch/arm/cpu/armv7/exynos/clock.c +++ b/arch/arm/cpu/armv7/exynos/clock.c @@ -423,8 +423,8 @@ static unsigned long exynos5_get_periph_rate(int peripheral) case PERIPH_ID_I2C6: case PERIPH_ID_I2C7: src = EXYNOS_SRC_MPLL; - div = readl(clk-div_top0); - sub_div = readl(clk-div_top1); + div = readl(clk-div_top1); + sub_div = readl(clk-div_top0); break; default: debug(%s: invalid peripheral %d, __func__, peripheral); -- 1.8.4.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v5 00/14] Add PSCI support for Jetson TK1/Tegra124 + CNTFRQ fix
On Mon, 2015-03-09 at 08:00 +0100, Jan Kiszka wrote: Changes in v4: - rebased over master - implemented psci_get_cpu_id as weak function - implemented psci_disable/enable_smp as weak functions - adjusted register interface of psci_get_cpu_stack_top This version (+ the non-cached memory init fix) can also be found at https://github.com/siemens/u-boot/tree/jetson-tk1-v5. Tested-by: Ian Campbell i...@hellion.org.uk Ian. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot PATCH 1/3] gpio: pcf8575: Add pcf8575 driver to control gpio lines
On Tuesday 10 March 2015 09:33 PM, Tom Rini wrote: On Tue, Mar 10, 2015 at 08:41:21PM +0530, Vignesh R wrote: TI's pcf8575 is a 16-bit I2C based GPIO expander.The device features a 16-bit quasi-bidirectional I/O ports. Each quasi-bidirectional I/O can be used as an input or output without the use of a data-direction control signal. The I/Os should be high before being used as inputs. This driver is based on pcf857x driver available in Linux 4.0 kernel. It supports basic reading and writing of gpio pins. For attribution of stuff ported from the kernel please see http://www.denx.de/wiki/view/U-Boot/Patches#Attributing_Code_Copyrights_Sign [snip] diff --git a/drivers/gpio/pcf8575.c b/drivers/gpio/pcf8575.c new file mode 100644 index ..1ee92a29760a --- /dev/null +++ b/drivers/gpio/pcf8575.c @@ -0,0 +1,248 @@ +/* + * PCF8575 I2C GPIO EXPANDER DRIVER + * + * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed as is WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ Please use SPDX tags for new files, thanks. And right up front, this driver isn't using device model, please re-work and update to use that framework, thanks! Thanks for reviewing. I can switch to device model, but DRA72 does not support device tree and hence I will not be able use device model based pcf driver in my use-case. One approach is that, I will re-write driver to support both deprecated gpio APIs (like gpio_get_value) and gpio device model APIs (dm_gpio_ops). Is this approach okay? But, somebody will have to test the dm_gpio_ops implementations as DRA72 does not support DT. Regards Vignesh ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] x86: crownbay: Enable saving environment in SPI flash
Saving U-Boot's environment in SPI flash on Intel CrownBay board. Signed-off-by: Bin Meng bmeng...@gmail.com --- include/configs/crownbay.h | 8 1 file changed, 8 insertions(+) diff --git a/include/configs/crownbay.h b/include/configs/crownbay.h index b927b1c..4a74f82 100644 --- a/include/configs/crownbay.h +++ b/include/configs/crownbay.h @@ -56,4 +56,12 @@ #undef CONFIG_VIDEO #undef CONFIG_CFB_CONSOLE +/* Environment configuration */ +#undef CONFIG_ENV_IS_NOWHERE +#undef CONFIG_ENV_SIZE +#define CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_ENV_SIZE0x1000 +#define CONFIG_ENV_SECT_SIZE 0x1000 +#define CONFIG_ENV_OFFSET 0 + #endif /* __CONFIG_H */ -- 1.8.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2] x86: galileo: Enable saving environment in SPI flash
Saving U-Boot's environment in SPI flash on Intel Galileo board. Signed-off-by: Bin Meng bmeng...@gmail.com --- include/configs/galileo.h | 8 1 file changed, 8 insertions(+) diff --git a/include/configs/galileo.h b/include/configs/galileo.h index 65a2c3e..288acf3 100644 --- a/include/configs/galileo.h +++ b/include/configs/galileo.h @@ -62,4 +62,12 @@ #define CONFIG_DW_ALTDESCRIPTOR #define CONFIG_PHYLIB +/* Environment configuration */ +#undef CONFIG_ENV_IS_NOWHERE +#undef CONFIG_ENV_SIZE +#define CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_ENV_SIZE0x1000 +#define CONFIG_ENV_SECT_SIZE 0x1000 +#define CONFIG_ENV_OFFSET 0 + #endif /* __CONFIG_H */ -- 1.8.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] sf: Correct the macros as per new array fast read command
Correct the macros as per insertion of array fast read command CMD_READ_ARRAY_FAST in spi_read_cmds_array in file sf_probe.c Signed-off-by: Siva Durga Prasad Paladugu siva...@xilinx.com --- include/spi.h | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/spi.h b/include/spi.h index c58e453..7829063 100644 --- a/include/spi.h +++ b/include/spi.h @@ -38,11 +38,12 @@ /* SPI RX operation modes */ #define SPI_OPM_RX_AS (1 0) -#define SPI_OPM_RX_DOUT(1 1) -#define SPI_OPM_RX_DIO (1 2) -#define SPI_OPM_RX_QOF (1 3) -#define SPI_OPM_RX_QIOF(1 4) -#define SPI_OPM_RX_EXTN(SPI_OPM_RX_AS | SPI_OPM_RX_DOUT | \ +#define SPI_OPM_RX_AF (1 1) +#define SPI_OPM_RX_DOUT(1 2) +#define SPI_OPM_RX_DIO (1 3) +#define SPI_OPM_RX_QOF (1 4) +#define SPI_OPM_RX_QIOF(1 5) +#define SPI_OPM_RX_EXTN(SPI_OPM_RX_AS | SPI_OPM_RX_AF | SPI_OPM_RX_DOUT | \ SPI_OPM_RX_DIO | SPI_OPM_RX_QOF | \ SPI_OPM_RX_QIOF) -- 2.1.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] sf: Poll both the read status and flag status
Poll both the Read status and Flag status registers for sucessful erase and program operations for the Micron devices with E_FSR flag set in params table. Signed-off-by: Siva Durga Prasad Paladugu siva...@xilinx.com --- drivers/mtd/spi/sf_ops.c | 32 +--- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c index 34bc54e..38592f5 100644 --- a/drivers/mtd/spi/sf_ops.c +++ b/drivers/mtd/spi/sf_ops.c @@ -154,21 +154,17 @@ static void spi_flash_dual_flash(struct spi_flash *flash, u32 *addr) } #endif -int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout) +static int spi_flash_poll_status(struct spi_slave *spi, unsigned long timeout, +u8 cmd, u8 poll_bit) { - struct spi_slave *spi = flash-spi; unsigned long timebase; unsigned long flags = SPI_XFER_BEGIN; int ret; u8 status; u8 check_status = 0x0; - u8 poll_bit = STATUS_WIP; - u8 cmd = flash-poll_cmd; - if (cmd == CMD_FLAG_STATUS) { - poll_bit = STATUS_PEC; + if (cmd == CMD_FLAG_STATUS) check_status = poll_bit; - } #ifdef CONFIG_SF_DUAL_FLASH if (spi-flags SPI_XFER_U_PAGE) @@ -204,6 +200,28 @@ int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout) return -1; } +int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout) +{ + struct spi_slave *spi = flash-spi; + int ret; + u8 poll_bit = STATUS_WIP; + u8 cmd = CMD_READ_STATUS; + + ret = spi_flash_poll_status(spi, timeout, cmd, poll_bit); + if (ret 0) + return ret; + + if (flash-poll_cmd == CMD_FLAG_STATUS) { + poll_bit = STATUS_PEC; + cmd = CMD_FLAG_STATUS; + ret = spi_flash_poll_status(spi, timeout, cmd, poll_bit); + if (ret 0) + return ret; + } + + return 0; +} + int spi_flash_write_common(struct spi_flash *flash, const u8 *cmd, size_t cmd_len, const void *buf, size_t buf_len) { -- 2.1.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] mmc: fsl_esdhc fix register offset
On Wednesday, March 11, 2015 at 03:17:00 AM, Peng Fan wrote: Hi, Marek On 3/11/2015 10:03 AM, Marek Vasut wrote: On Wednesday, March 11, 2015 at 01:58:37 AM, Peng Fan wrote: Hi, Marek Hi! On 3/10/2015 9:45 PM, Marek Vasut wrote: On Tuesday, March 10, 2015 at 08:35:46 AM, Peng Fan wrote: Commit f022d36e8a4517b2a9d25ff2d75bd2459d0c68b1 introduces error register offset. Change the char reserved3[59] to char reserved3[56]. Signed-off-by: Peng Fan peng@freescale.com This should probably be applied to 2015.04 . What are the symptoms of this bug please ? I just found the reserved3 size is wrong, did not do test. From the driver, only the entry 'scr' of fsl_esdhc below reserved3 is used, so the offset of scr is wrong if using `char reserved3[59]` Uh, is the patch tested at all on real hardware ? Still not test on real hardware. From commit f022d36e8a4517b2a9d25ff2d75bd2459d0c68b1, uintadsaddr;/* ADMA system address register */ - charreserved2[160]; /* reserved */ + charreserved2[100]; /* reserved */ + uintvendorspec; /* Vendor Specific register */ + charreserved3[59]; /* reserved */ uinthostver;/* Host controller version register */ It's clear that 160 bytes does not equal with (100 + 4 + 59)bytes. Hi! I agree with the change, I'm just not very impressed by patches that are completely untested. If you could do a quick boot on some machine before sending, that'd be nice. Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/4] common/lcd_console: cleanup lcd_drawchars/lcd_putc_xy
From: Hannes Petermaier hannes.peterma...@br-automation.com the capability of drawing some *str with count from lcd_drawchars is unnary. It is always called from lcd_putc_xy with one character of and count = 1. So we simply rename lcd_drawchars into lcd_putc_xy and remove the loops inside. Signed-off-by: Hannes Petermaier hannes.peterma...@br-automation.com Signed-off-by: Hannes Petermaier oe5...@oevsv.at --- common/lcd_console.c | 23 +++ 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/common/lcd_console.c b/common/lcd_console.c index 8bf83b9..243b7c5 100644 --- a/common/lcd_console.c +++ b/common/lcd_console.c @@ -55,18 +55,17 @@ int lcd_get_screen_columns(void) return console_cols; } -static void lcd_drawchars(ushort x, ushort y, uchar *str, int count) +static void lcd_putc_xy(ushort x, ushort y, char c) { uchar *dest; ushort row; int fg_color, bg_color; + int i; dest = (uchar *)(lcd_console_address + y * lcd_line_length + x * NBITS(LCD_BPP) / 8); for (row = 0; row VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) { - uchar *s = str; - int i; #if LCD_BPP == LCD_COLOR16 ushort *d = (ushort *)dest; #elif LCD_BPP == LCD_COLOR32 @@ -77,25 +76,17 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, int count) fg_color = lcd_getfgcolor(); bg_color = lcd_getbgcolor(); - for (i = 0; i count; ++i) { - uchar c, bits; - c = *s++; - bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row]; + uchar bits; + bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row]; - for (c = 0; c 8; ++c) { - *d++ = (bits 0x80) ? fg_color : bg_color; - bits = 1; - } + for (i = 0; i 8; ++i) { + *d++ = (bits 0x80) ? fg_color : bg_color; + bits = 1; } } } -static inline void lcd_putc_xy(ushort x, ushort y, uchar c) -{ - lcd_drawchars(x, y, c, 1); -} - static void console_scrollup(void) { const int rows = CONFIG_CONSOLE_SCROLL_LINES; -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] mmc: fsl_esdhc fix register offset
On Tue, Mar 10, 2015 at 4:35 AM, Peng Fan peng@freescale.com wrote: Commit f022d36e8a4517b2a9d25ff2d75bd2459d0c68b1 introduces error register offset. Change the char reserved3[59] to char reserved3[56]. Signed-off-by: Peng Fan peng@freescale.com On a imx6sl-warp: Tested-by: Fabio Estevam fabio.este...@freescale.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/4] common/lcd_console: move single static variables into common (static) structure
From: Hannes Petermaier hannes.peterma...@br-automation.com For coming implementation of lcd_console rotation, we will need some more variables for holding information about framebuffer size, rotation, ... For better readability we catch all them into a common structure. Signed-off-by: Hannes Petermaier hannes.peterma...@br-automation.com Signed-off-by: Hannes Petermaier oe5...@oevsv.at --- common/lcd_console.c | 76 +- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/common/lcd_console.c b/common/lcd_console.c index b7dda7a..cac77be 100644 --- a/common/lcd_console.c +++ b/common/lcd_console.c @@ -11,48 +11,49 @@ #include video_font.h/* Get font data, width and height */ #define CONSOLE_ROW_SIZE (VIDEO_FONT_HEIGHT * lcd_line_length) -#define CONSOLE_ROW_FIRST lcd_console_address -#define CONSOLE_SIZE (CONSOLE_ROW_SIZE * console_rows) +#define CONSOLE_ROW_FIRST cons.lcd_address +#define CONSOLE_SIZE (CONSOLE_ROW_SIZE * cons.rows) -static short console_curr_col; -static short console_curr_row; -static short console_cols; -static short console_rows; -static void *lcd_console_address; +struct console_t { + short curr_col, curr_row; + short cols, rows; + void *lcd_address; +}; +static struct console_t cons; void lcd_init_console(void *address, int rows, int cols) { - console_curr_col = 0; - console_curr_row = 0; - console_cols = cols; - console_rows = rows; - lcd_console_address = address; + memset(cons, 0, sizeof(cons)); + cons.cols = cols; + cons.rows = rows; + cons.lcd_address = address; + } void lcd_set_col(short col) { - console_curr_col = col; + cons.curr_col = col; } void lcd_set_row(short row) { - console_curr_row = row; + cons.curr_row = row; } void lcd_position_cursor(unsigned col, unsigned row) { - console_curr_col = min_t(short, col, console_cols - 1); - console_curr_row = min_t(short, row, console_rows - 1); + cons.curr_col = min_t(short, col, cons.cols - 1); + cons.curr_row = min_t(short, row, cons.rows - 1); } int lcd_get_screen_rows(void) { - return console_rows; + return cons.rows; } int lcd_get_screen_columns(void) { - return console_cols; + return cons.cols; } static void lcd_putc_xy(ushort x, ushort y, char c) @@ -63,7 +64,7 @@ static void lcd_putc_xy(ushort x, ushort y, char c) int bg_color = lcd_getbgcolor(); int i; - dest = (uchar *)(lcd_console_address + + dest = (uchar *)(cons.lcd_address + y * lcd_line_length + x * NBITS(LCD_BPP) / 8); for (row = 0; row VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) { @@ -91,7 +92,7 @@ static void console_scrollup(void) /* Copy up rows ignoring those that will be overwritten */ memcpy(CONSOLE_ROW_FIRST, - lcd_console_address + CONSOLE_ROW_SIZE * rows, + cons.lcd_address + CONSOLE_ROW_SIZE * rows, CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows); /* Clear the last rows */ @@ -99,7 +100,7 @@ static void console_scrollup(void) memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows, bg_color, CONSOLE_ROW_SIZE * rows); #else - u32 *ppix = lcd_console_address + + u32 *ppix = cons.lcd_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows; u32 i; for (i = 0; @@ -109,27 +110,27 @@ static void console_scrollup(void) } #endif lcd_sync(); - console_curr_row -= rows; + cons.curr_row -= rows; } static inline void console_back(void) { - if (--console_curr_col 0) { - console_curr_col = console_cols - 1; - if (--console_curr_row 0) - console_curr_row = 0; + if (--cons.curr_col 0) { + cons.curr_col = cons.cols - 1; + if (--cons.curr_row 0) + cons.curr_row = 0; } - lcd_putc_xy(console_curr_col * VIDEO_FONT_WIDTH, - console_curr_row * VIDEO_FONT_HEIGHT, ' '); + lcd_putc_xy(cons.curr_col * VIDEO_FONT_WIDTH, + cons.curr_row * VIDEO_FONT_HEIGHT, ' '); } static inline void console_newline(void) { - console_curr_col = 0; + cons.curr_col = 0; /* Check if we need to scroll the terminal */ - if (++console_curr_row = console_rows) + if (++cons.curr_row = cons.rows) console_scrollup(); else lcd_sync(); @@ -145,18 +146,17 @@ void lcd_putc(const char c) switch (c) { case '\r': - console_curr_col = 0; - + cons.curr_col = 0; return; case '\n': console_newline(); return; case '\t': /*
[U-Boot] [PATCH 2/4] common/lcd_console: ask only one-time for bg/fg-color per call
From: Hannes Petermaier hannes.peterma...@br-automation.com Don't call the lcd_getfgcolor and lcd_getbgcolor within the draw-loop, this only wastes time. Signed-off-by: Hannes Petermaier hannes.peterma...@br-automation.com Signed-off-by: Hannes Petermaier oe5...@oevsv.at --- common/lcd_console.c |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/common/lcd_console.c b/common/lcd_console.c index 243b7c5..b7dda7a 100644 --- a/common/lcd_console.c +++ b/common/lcd_console.c @@ -59,7 +59,8 @@ static void lcd_putc_xy(ushort x, ushort y, char c) { uchar *dest; ushort row; - int fg_color, bg_color; + int fg_color = lcd_getfgcolor(); + int bg_color = lcd_getbgcolor(); int i; dest = (uchar *)(lcd_console_address + @@ -73,10 +74,6 @@ static void lcd_putc_xy(ushort x, ushort y, char c) #else uchar *d = dest; #endif - - fg_color = lcd_getfgcolor(); - bg_color = lcd_getbgcolor(); - uchar bits; bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row]; -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm: armada-xp: Fix SPL for AXP by using save_boot_params_ret
Hi Stefan, On Wed, Mar 11, 2015 at 12:05:04PM +0100, Stefan Roese wrote: Patch e11c6c27 (arm: Allow lr to be saved by board code) introduced a different method to return from save_boot_params(). The SPL support for AXP has been pulled and changing to this new method is now required for SPL to work correctly. Signed-off-by: Stefan Roese s...@denx.de Cc: Simon Glass s...@chromium.org Cc: Luka Perkov luka.per...@sartura.hr --- arch/arm/cpu/armv7/armada-xp/lowlevel_spl.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Applied to marvell's master branch. Thank you. Luka ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Vexpress64: Fix the compiling error when CONFIG_ARMV8_MULTIENTRY defined
-Original Message- From: U-Boot [mailto:u-boot-boun...@lists.denx.de] On Behalf Of FengHua Sent: Wednesday, March 11, 2015 6:38 PM To: Linus Walleij Cc: U-Boot Mailing List Subject: Re: [U-Boot] [PATCH] Vexpress64: Fix the compiling error when CONFIG_ARMV8_MULTIENTRY defined -Original Messages- From: Linus Walleij linus.wall...@linaro.org Sent Time: 2015-03-10 18:08:03 (Tuesday) To: David Feng feng...@phytium.com.cn Cc: U-Boot Mailing List u-boot@lists.denx.de, Tom Rini tr...@ti.com, Albert ARIBAUD albert.u.b...@aribaud.net Subject: Re: [PATCH] Vexpress64: Fix the compiling error when CONFIG_ARMV8_MULTIENTRY defined On Tue, Mar 10, 2015 at 3:08 AM, feng...@phytium.com.cn wrote: From: David Feng feng...@phytium.com.cn CPU_RELEASE_ADDR should be defined when CONFIG_ARMV8_MULTIENTRY is used. Signed-off-by: David Feng feng...@phytium.com.cn As asked earlier: how can I test this with FVP or the base model? I usually use Foundation Model. I'm very interested in doing this as I guess it involves starting U-Boot at EL3 on bare metal and I really want to try this. +/* SMP Spin Table Definitions */ +#ifdef CONFIG_BASE_FVP +#define CPU_RELEASE_ADDR (CONFIG_SYS_SDRAM_BASE + 0x03f0) +#else +#define CPU_RELEASE_ADDR (CONFIG_SYS_SDRAM_BASE + 0x7fff0) +#endif Where are these address defines coming from? It's just hard coded and should be the same value with that in DTS. Do these spin tables exist in a standard ARM FVP or base model? I get the impression that a secondary operating system is being booted on the secondary CPU at one of these addresses, but why is it running at these addresses specifically, and is that something coming with these simulators, or is it some image that is loaded on the side, that the community does not have access to? PSCI is not implemented in uboot-armv8. If booting u-boot on bare-metal only spin table can be used. All we do is describing booting method(spin table) and cpu release address in DTS. Linux kernel get cpu release address from DTS also. Arnab's patches enable PSCI for amrv8 on u-boot: http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/207882 We have tested the same on ARMv8 foundation model as well. Regards, Bhupesh ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot PATCH 1/3] gpio: pcf8575: Add pcf8575 driver to control gpio lines
On Wed, Mar 11, 2015 at 02:19:32PM +0530, Vignesh R wrote: On Tuesday 10 March 2015 09:33 PM, Tom Rini wrote: On Tue, Mar 10, 2015 at 08:41:21PM +0530, Vignesh R wrote: TI's pcf8575 is a 16-bit I2C based GPIO expander.The device features a 16-bit quasi-bidirectional I/O ports. Each quasi-bidirectional I/O can be used as an input or output without the use of a data-direction control signal. The I/Os should be high before being used as inputs. This driver is based on pcf857x driver available in Linux 4.0 kernel. It supports basic reading and writing of gpio pins. For attribution of stuff ported from the kernel please see http://www.denx.de/wiki/view/U-Boot/Patches#Attributing_Code_Copyrights_Sign [snip] diff --git a/drivers/gpio/pcf8575.c b/drivers/gpio/pcf8575.c new file mode 100644 index ..1ee92a29760a --- /dev/null +++ b/drivers/gpio/pcf8575.c @@ -0,0 +1,248 @@ +/* + * PCF8575 I2C GPIO EXPANDER DRIVER + * + * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed as is WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ Please use SPDX tags for new files, thanks. And right up front, this driver isn't using device model, please re-work and update to use that framework, thanks! Thanks for reviewing. I can switch to device model, but DRA72 does not support device tree and hence I will not be able use device model based pcf driver in my use-case. Starting the move to DT is very easy, I would swear. For example, am335x_boneblack_vboot switches am335x over to DM and includes a device tree, but it's only used for the verified boot part now. -- 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] MinnowBoard Max uboot
Thank you, can you keep me updated if possible. Tom -Original Message- From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon Glass Sent: Tuesday, March 10, 2015 1:21 PM To: Beaman, Thomas Cc: u-boot@lists.denx.de; Bin Meng; gabriel huau Subject: Re: MinnowBoard Max uboot Hi Tom, On 10 March 2015 at 05:24, Beaman, Thomas thomas.bea...@xerox.com wrote: Hi Simon, Do you know what will be the timeframe of when someone may be able to look at this in more detail. I will be able to help test any updates if needed I will take a look once I have things lined up for the next release, likely mid April. Regards, Simon Thanks, Tom -Original Message- From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon Glass Sent: Monday, March 09, 2015 11:49 AM To: Beaman, Thomas Cc: u-boot@lists.denx.de; Bin Meng; gabriel huau Subject: Re: MinnowBoard Max uboot +Bin and Gabriel Hi Tom, On 9 March 2015 at 08:08, Beaman, Thomas thomas.bea...@xerox.com wrote: Hi Simon, I see you have put support for the MinnowBoard Max in the u-boot mainline. Thanks this is a very useful addition. I have been able to follow your readme and build a working bare metal uboot. Using the built uboot I can load and bring up a Linux Kernel. What I noticed from the running kernel is that only one of the two cores on the E3825 is running. In the power PC uboots I usually see a section for the multiple cores in the .dts file. My questions is how do I get both CPUs running on this board. Is it a uboot .dts file setup that will enable this, or is something in the kernel start up that does this. As a test I boot the same kernel using the EFI BIOS on the minnow board and both CPUs are running. Any suggestions or comments you have would be welcomed. My guess is that the LAPIC CPU start-up is missing. It isn't 100% clear what the FSP does and does not do, but perhaps it does not do that. I did make something of a start on this with ivybridge but it isn't complete, and it seems to be needed here. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] T2080QDS/PCIe: Soft Reset PCIe for down-training issue
Hi Zhao, -Original Message- From: U-Boot [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Zhao Qiang Sent: Wednesday, March 11, 2015 2:42 PM To: u-boot@lists.denx.de; Sun York-R58495 Cc: Zhao Qiang-B45475 Subject: [U-Boot] [PATCH v2] T2080QDS/PCIe: Soft Reset PCIe for down-training issue T2080QDS PEX1/Slot#1 will down-train from x4 to x2, Soft reset PCIe can fix this issue, this is a workaround. Signed-off-by: Zhao Qiang b45...@freescale.com --- changes for v2 - modify the commit message drivers/pci/fsl_pci_init.c | 17 + include/configs/T208xQDS.h | 1 + 2 files changed, 18 insertions(+) diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c index 231b075..327fa7d 100644 --- a/drivers/pci/fsl_pci_init.c +++ b/drivers/pci/fsl_pci_init.c @@ -481,6 +481,23 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info) #endif } +#ifdef CONFIG_FSL_PCIE_T2080QDS_RESET + int i; + /* assert PCIe reset */ + setbits_be32(pci-pdb_stat, 0x0800); + (void) in_be32(pci-pdb_stat); + udelay(1000); + /* clear PCIe reset */ + clrbits_be32(pci-pdb_stat, 0x0800); + asm(sync;isync); + for (i = 0; i 100 ltssm PCI_LTSSM_L0; i++) { + pci_hose_read_config_word(hose, dev, PCI_LTSSM, + ltssm); + udelay(1000); + } + +#endif + #ifdef CONFIG_SYS_P4080_ERRATUM_PCIE_A003 if (enabled == 0) { serdes_corenet_t *srds_regs = (void *)CONFIG_SYS_FSL_CORENET_SERDES_ADDR; diff --git a/include/configs/T208xQDS.h b/include/configs/T208xQDS.h index 395472b..851b4f9 100644 --- a/include/configs/T208xQDS.h +++ b/include/configs/T208xQDS.h @@ -558,6 +558,7 @@ unsigned long get_board_ddr_clk(void); #define CONFIG_PCIE2 /* PCIE controler 2 */ #define CONFIG_PCIE3 /* PCIE controler 3 */ #define CONFIG_PCIE4 /* PCIE controler 4 */ +#define CONFIG_FSL_PCIE_T2080QDS_RESET do we really require this new define? Can we not manage with CONFIG_FSL_PCIE_RESET? -prabhakar ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] drivers:usb: Add device-tree fixup to identify socs having dual phy
Identify soc(s) having dual phy so as to add utmi_dual as phy_mode for all these socs. This is required for supporting deel-sleep feature in linux for usb driver Signed-off-by: Ramneek Mehresh ramneek.mehr...@freescale.com Signed-off-by: Nikhil Badola nikhil.bad...@freescale.com --- drivers/usb/host/ehci-fsl.c | 7 ++- include/fsl_usb.h | 32 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 5d4288d..ed83eb4 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -259,7 +259,7 @@ static int fdt_fixup_usb_erratum(void *blob, const char *prop_erratum, void fdt_fixup_dr_usb(void *blob, bd_t *bd) { static const char * const modes[] = { host, peripheral, otg }; - static const char * const phys[] = { ulpi, utmi }; + static const char * const phys[] = { ulpi, utmi, utmi_dual }; int usb_erratum_a006261_off = -1; int usb_erratum_a007075_off = -1; int usb_erratum_a007792_off = -1; @@ -303,6 +303,9 @@ void fdt_fixup_dr_usb(void *blob, bd_t *bd) dr_phy_type = phys[phy_idx]; } + if (has_dual_phy()) + dr_phy_type = phys[2]; + usb_mode_off = fdt_fixup_usb_mode_phy_type(blob, dr_mode_type, NULL, usb_mode_off); @@ -325,6 +328,7 @@ void fdt_fixup_dr_usb(void *blob, bd_t *bd) if (usb_erratum_a006261_off 0) return; } + if (has_erratum_a007075()) { usb_erratum_a007075_off = fdt_fixup_usb_erratum (blob, @@ -333,6 +337,7 @@ void fdt_fixup_dr_usb(void *blob, bd_t *bd) if (usb_erratum_a007075_off 0) return; } + if (has_erratum_a007792()) { usb_erratum_a007792_off = fdt_fixup_usb_erratum (blob, diff --git a/include/fsl_usb.h b/include/fsl_usb.h index d251f5d..d24ffa7 100644 --- a/include/fsl_usb.h +++ b/include/fsl_usb.h @@ -87,6 +87,33 @@ struct ccsr_usb_phy { /* USB Erratum Checking code */ #ifdef CONFIG_PPC +static inline bool has_dual_phy(void) +{ + u32 svr = get_svr(); + u32 soc = SVR_SOC_VER(svr); + + switch (soc) { + case SVR_T1023: + case SVR_T1024: + case SVR_T1013: + case SVR_T1014: + return IS_SVR_REV(svr, 1, 0); + case SVR_T1040: + case SVR_T1042: + case SVR_T1020: + case SVR_T1022: + case SVR_T2080: + case SVR_T2081: + return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1); + case SVR_T4240: + case SVR_T4160: + case SVR_T4080: + return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); + } + + return false; +} + static inline bool has_erratum_a006261(void) { u32 svr = get_svr(); @@ -165,6 +192,11 @@ static inline bool has_erratum_a007792(void) } #else +static inline bool has_dual_phy(void) +{ + return false; +} + static inline bool has_erratum_a006261(void) { return false; -- 1.7.11.7 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2] drivers:usb:fsl: Add affected SOCs for USB Erratum A007792
Add following affected SOCs and their personalities for USB Erratum A007792 : T1040 Rev 1.1 T1024 Rev 1.0 Signed-off-by: Nikhil Badola nikhil.bad...@freescale.com --- include/fsl_usb.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/fsl_usb.h b/include/fsl_usb.h index d24ffa7..92751dd 100644 --- a/include/fsl_usb.h +++ b/include/fsl_usb.h @@ -182,8 +182,13 @@ static inline bool has_erratum_a007792(void) case SVR_T4240: case SVR_T4160: return IS_SVR_REV(svr, 2, 0); - case SVR_T1040: + case SVR_T1024: + case SVR_T1023: return IS_SVR_REV(svr, 1, 0); + case SVR_T1040: + case SVR_T1042: + case SVR_T1020: + case SVR_T1022: case SVR_T2080: case SVR_T2081: return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1); -- 1.7.11.7 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] pci/layerscape: move pcie_layerscape.h out of arm include
The patch moves pcie_layerscape.h out of arm include to top level include folder so that it can be shared on other Socs. Signed-off-by: Minghuan Lian minghuan.l...@freescale.com --- arch/arm/include/asm/pcie_layerscape.h | 13 - board/freescale/ls1021atwr/ls1021atwr.c | 3 ++- drivers/pci/pcie_layerscape.c | 2 +- include/pcie_layerscape.h | 13 + 4 files changed, 16 insertions(+), 15 deletions(-) delete mode 100644 arch/arm/include/asm/pcie_layerscape.h create mode 100644 include/pcie_layerscape.h diff --git a/arch/arm/include/asm/pcie_layerscape.h b/arch/arm/include/asm/pcie_layerscape.h deleted file mode 100644 index fb08578..000 --- a/arch/arm/include/asm/pcie_layerscape.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright 2014 Freescale Semiconductor, Inc. - * - * SPDX-License-Identifier:GPL-2.0+ - */ - -#ifndef __PCIE_LAYERSCAPE_H_ -#define __PCIE_LAYERSCAPE_H_ - -void pci_init_board(void); -void ft_pcie_setup(void *blob, bd_t *bd); - -#endif diff --git a/board/freescale/ls1021atwr/ls1021atwr.c b/board/freescale/ls1021atwr/ls1021atwr.c index fb8525f..2d5c29c 100644 --- a/board/freescale/ls1021atwr/ls1021atwr.c +++ b/board/freescale/ls1021atwr/ls1021atwr.c @@ -12,7 +12,6 @@ #include asm/arch/clock.h #include asm/arch/fsl_serdes.h #include asm/arch/ls102xa_stream_id.h -#include asm/pcie_layerscape.h #include mmc.h #include fsl_esdhc.h #include fsl_ifc.h @@ -21,6 +20,8 @@ #include tsec.h #include fsl_sec.h #include spl.h +#include pcie_layerscape.h + #ifdef CONFIG_U_QE #include ../../../drivers/qe/qe.h #endif diff --git a/drivers/pci/pcie_layerscape.c b/drivers/pci/pcie_layerscape.c index bcad8f2..15e3546 100644 --- a/drivers/pci/pcie_layerscape.c +++ b/drivers/pci/pcie_layerscape.c @@ -11,7 +11,7 @@ #include asm/io.h #include errno.h #include malloc.h -#include asm/pcie_layerscape.h +#include pcie_layerscape.h #ifndef CONFIG_SYS_PCI_MEMORY_BUS #define CONFIG_SYS_PCI_MEMORY_BUS CONFIG_SYS_SDRAM_BASE diff --git a/include/pcie_layerscape.h b/include/pcie_layerscape.h new file mode 100644 index 000..fb08578 --- /dev/null +++ b/include/pcie_layerscape.h @@ -0,0 +1,13 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#ifndef __PCIE_LAYERSCAPE_H_ +#define __PCIE_LAYERSCAPE_H_ + +void pci_init_board(void); +void ft_pcie_setup(void *blob, bd_t *bd); + +#endif -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] T2080QDS/PCIe: Soft Reset PCIe for down-training issue
-Original Message- From: Kushwaha Prabhakar-B32579 Sent: Wednesday, March 11, 2015 8:12 PM To: Zhao Qiang-B45475; u-boot@lists.denx.de; Sun York-R58495 Cc: Zhao Qiang-B45475 Subject: RE: [U-Boot] [PATCH v2] T2080QDS/PCIe: Soft Reset PCIe for down- training issue Hi Zhao, -Original Message- From: U-Boot [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Zhao Qiang Sent: Wednesday, March 11, 2015 2:42 PM To: u-boot@lists.denx.de; Sun York-R58495 Cc: Zhao Qiang-B45475 Subject: [U-Boot] [PATCH v2] T2080QDS/PCIe: Soft Reset PCIe for down-training issue T2080QDS PEX1/Slot#1 will down-train from x4 to x2, Soft reset PCIe can fix this issue, this is a workaround. Signed-off-by: Zhao Qiang b45...@freescale.com --- changes for v2 - modify the commit message drivers/pci/fsl_pci_init.c | 17 + include/configs/T208xQDS.h | 1 + 2 files changed, 18 insertions(+) diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c index 231b075..327fa7d 100644 --- a/drivers/pci/fsl_pci_init.c +++ b/drivers/pci/fsl_pci_init.c @@ -481,6 +481,23 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info) #endif } +#ifdef CONFIG_FSL_PCIE_T2080QDS_RESET + int i; + /* assert PCIe reset */ + setbits_be32(pci-pdb_stat, 0x0800); + (void) in_be32(pci-pdb_stat); + udelay(1000); + /* clear PCIe reset */ + clrbits_be32(pci-pdb_stat, 0x0800); + asm(sync;isync); + for (i = 0; i 100 ltssm PCI_LTSSM_L0; i++) { + pci_hose_read_config_word(hose, dev, PCI_LTSSM, + ltssm); + udelay(1000); + } + +#endif + #ifdef CONFIG_SYS_P4080_ERRATUM_PCIE_A003 if (enabled == 0) { serdes_corenet_t *srds_regs = (void *)CONFIG_SYS_FSL_CORENET_SERDES_ADDR; diff --git a/include/configs/T208xQDS.h b/include/configs/T208xQDS.h index 395472b..851b4f9 100644 --- a/include/configs/T208xQDS.h +++ b/include/configs/T208xQDS.h @@ -558,6 +558,7 @@ unsigned long get_board_ddr_clk(void); #define CONFIG_PCIE2 /* PCIE controler 2 */ #define CONFIG_PCIE3 /* PCIE controler 3 */ #define CONFIG_PCIE4 /* PCIE controler 4 */ +#define CONFIG_FSL_PCIE_T2080QDS_RESET do we really require this new define? Can we not manage with CONFIG_FSL_PCIE_RESET? Sounds good, I will modify as you said if there are no other comments. -prabhakar -Zhao Qiang ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v6 25/27] sandbox: Enable DHCP and IP defrag
This is now testable via the eth-raw interface Signed-off-by: Joe Hershberger joe.hershber...@ni.com Reviewed-by: Simon Glass s...@chromium.org --- Changes in v6: None Changes in v5: None Changes in v4: -New to v4 Changes in v3: None Changes in v2: None include/configs/sandbox.h | 8 1 file changed, 8 insertions(+) diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index caf9f5a..034050e 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -127,6 +127,14 @@ #include config_cmd_default.h #define CONFIG_CMD_PING +#define CONFIG_CMD_DHCP +#define CONFIG_BOOTP_DNS +#define CONFIG_BOOTP_DNS2 +#define CONFIG_BOOTP_GATEWAY +#define CONFIG_BOOTP_SEND_HOSTNAME +#define CONFIG_BOOTP_SERVERIP +#define CONFIG_BOOTP_SUBNETMASK +#define CONFIG_IP_DEFRAG #define CONFIG_CMD_HASH #define CONFIG_HASH_VERIFY -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot