summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeLines
* bootstage: Add bootstage commandSimon Glass2012-10-03-0/+117
| | | | | | | | | Now that there are a few features, add a bootstage command to access them. bootstage report - prints a report bootstage stash/unstash - stashes bootstage records in memory, reads them back Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstage: Add feature to stash/unstash bootstage infoSimon Glass2012-10-03-0/+159
| | | | | | | | | | | | It is useful to be able to write the bootstage information to memory for use by a later utility, or the Linux kernel. Provide a function to do this as well as a function to read bootstage information back and incorporate it into the current table. This also makes it possible for U-Boot to chain to another U-Boot and pass on its bootstage information. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstage: Store boot timings in device treeSimon Glass2012-10-02-6/+89
| | | | | | | | Add an option, CONFIG_BOOTSTAGE_FDT to pass boot timings to the kernel in the device tree, if available. To use this, you must have CONFIG_OF_LIBFDT defined. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstage: Add time accumulation featureSimon Glass2012-10-02-3/+33
| | | | | | | | | | | Sometimes we want to add up the amount of time spent in a particular activity when it is happening in a number of discrete chunks. Add bootstage_start() to mark the start of an acitivity and bootstage_accum() to accumulate the time since the last start. Calling these function in pairs results in the accumulated time being collected. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstage: Export bootstage_add_record() functionSimon Glass2012-10-02-10/+6
| | | | | | | This function is not static, but not exported either. Add a prototype in the header file and move the required enum to the header also. Signed-off-by: Simon Glass <sjg@chromium.org>
* cmd_fat.c: fix build warningAnatolij Gustschin2012-09-29-1/+0
| | | | | | | | | | | | | | Commit cfda5aeab89d73779e26f0d34cf10f64caa67431 (cmd_fat: use common get_device_and_partition function) introduced a warning: cmd_fat.c: In function 'do_fat_fswrite': cmd_fat.c:178:8: warning: unused variable 'ep' [-Wunused-variable] Fix it. Signed-off-by: Anatolij Gustschin <agust@denx.de> Reported-by: Albert ARIBAUD <albert.u.boot@aribaud.net> Tested-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
* common: add zip command supportLei Wen2012-09-29-0/+61
| | | | Signed-off-by: Lei Wen <leiwen@marvell.com>
* Merge branch 'master' of git://git.denx.de/u-boot-netTom Rini2012-09-27-3/+53
|\
| * PXE: FDT: Add support for fdt in PXEChander Kashyap2012-09-27-3/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now DT support is becoming common for all new SoC's. Hence it is better to have option for getting specific FDT from the remote server. This patch adds support for new label i.e. 'fdt'. This will allow to retrieve 'fdt blob' from the remote server. This patch take care for the following scenarios. The usage of fdt is optional. The 'fdt blob' can be retrieved from tftp or can be available locally or can be absent. If 'fdt_addr_r' environment variable is set and 'fdt' label is defined retrieve 'fdt blob' from tftp. 'fdt_addr_r' is then passed along bootm command. If 'fdt_addr' is set and 'fdt blob' is not retrieved from the tftp pass 'fdt_addr' to bootm command. In this case 'fdt blob' will be available at 'fdt_addr'. If 'fdt_addr' is not set and 'fdt blob' is not retrieve from tftp pass NULL to boot command. In this case 'fdt blob' is not required and absent. Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org> Acked-by: Jason Hobbs <jason.hobbs@calxeda.com>
| * net: Improve the speed of netconsoleJoe Hershberger2012-09-24-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously u-boot would initialize the network interface for every network operation and then shut it down again. This makes sense for most operations where the network in not known to be needed soon after the operation is complete. In the case of netconsole, it will use the network for every interaction with the shell or every printf. This means that the network is being reinitialized very often. On many devices, this intialization is very slow. This patch checks for consecutive netconsole actions and leaves the ethernet hardware initialized between them. It will still behave the same old way for all other network operations and any time another network operation happens between netconsole operations. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Cc: Stefano Babic <sbabic@denx.de> Acked-by: Stefano Babic <sbabic@denx.de>
* | SPL: Add support for loading image from ram in SPL.Pavel Machek2012-09-27-0/+22
| | | | | | | | | | Signed-off-by: Pavel Machek <pavel@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: Rework how we inform about un-headered imagesTom Rini2012-09-27-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | First, remove the puts from the case where we don't have an mkimage header as this is somewhat common and intentional for no-arg target images. Second, rework the final switch statement in board_init_r to, in the case of !CONFIG_SPL_OS_BOOT be only about doing debug prints about if we know what the magic is or not (the CONFIG_SPL_OS_BOOT case is unchanged). Then we call jump_to_image_no_args(). This gives us the same behavior as before but with slightly smaller code. Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: Make un-supported boot device puts a debug insteadTom Rini2012-09-27-3/+1
| | | | | | | | Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: Enable use of custom defined U-Boot entry pointStefan Roese2012-09-27-1/+4
| | | | | | | | | | | | | | | | | | By setting CONFIG_SYS_UBOOT_START boards can now use a different entry point for their U-Boot image. So the U-Boot entry point is not fixed to CONFIG_SYS_TEXT_BASE any more. Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: SPI: Enhance spi_spl_load to match the other load functionsTom Rini2012-09-27-2/+2
| | | | | | | | Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: Add option to skip copying of the mkimage headerStefan Roese2012-09-27-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some system (e.g. powerpc), the load-address and entry-point is located at address 0. So the current approach to load the image (payload) including the header to the address "load-address - 64" can't work here. This patch adds an flag to skip this copying including header to the SPL framework. By setting SPL_COPY_PAYLOAD_ONLY, only the playload will be copied. This will be used by the SPL NOR flash driver on powerpc. Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: Add NOR flash booting supportStefan Roese2012-09-27-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | SPL NOR flash booting support is quite simple. Only copying of the images is needed. On MPC5xxx we need to make sure to only use the standard memcpy() implementation and not the MPC5xxx specific one. As the MPC5xxx version has some complexity which is not needed for this SPL booting. Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: NAND: Move arch/arm/cpu/armv7/omap-common/spl_nand.c to common/splTom Rini2012-09-27-0/+101
| | | | | | | | | | | | | | We move the spl_nand_load_image function to common/spl. This will allow for easier integration of SPL-boots-Linux code on other arches. Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: Use image_get_xxx() functions to access header valuesStefan Roese2012-09-27-5/+5
| | | | | | | | | | Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: do not use fix value for u-boot sizeStefano Babic2012-09-27-1/+5
| | | | | | | | | | | | | | | | | | | | If an u-boot image is not found, SPL thinks to load a bare u-boot.bin image with a maximum size of 200KB. Use CONFIG_SYS_MONITOR_LEN instead. Signed-off-by: Stefan Roese <stefan.roese@gmail.com> Signed-off-by: Stefano Babic <sbabic@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: Create arch/arm/lib/spl.c for board_init_f and jump_to_image_linuxTom Rini2012-09-27-35/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In SPL (CONFIG_SPL_FRAMEWORK) board_init_f must setup the stack pointer, clear the BSS and call board_init_r. We mark this as weak as some platforms may need to perform additional initalization at this point. We provide a gd that we know will be in a usable location, once the BSS has been cleared to help with this as well. Finally, we no longer call relocate_code so remove that from the armv7 version. Next, both board_init_f and jump_to_image_linux are going to be inherently arch-specific, so move these versions to arch/arm/lib/spl.c Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: Move the omap SPL framework to common/splTom Rini2012-09-27-0/+336
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a new flag, CONFIG_SPL_FRAMEWORK to opt into the common/spl SPL framework, enable on all of the previously using boards. We move the spl_ymodem.c portion to common/ and spl_mmc.c to drivers/mmc/. We leave the NAND one in-place as we plan to replace it later in this series. We use common/spl to avoid linker problems with respect to merging constant strings in objects. Otherwise all strings in common/ will be linked in and kept which grows SPL in size too much. Signed-off-by: Tom Rini <trini@ti.com>
* | FAT: Make it possible to read from any file positionBenoît Thébaudeau2012-09-26-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When storage devices contain files larger than the embedded RAM, it is useful to be able to read these files by chunks, e.g. for a software update to the embedded NAND Flash from an external storage device (USB stick, SD card, etc.). Hence, this patch makes it possible by adding a new FAT API to read files from a given position. This patch also adds this feature to the fatload command. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
* | env: checkpatch clean env_fatIgor Grinberg2012-09-26-6/+14
| | | | | | | | | | | | env_fat has several checkpatch warnings - clean those up. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
* | env: remove duplicated env_get_char_spec()Igor Grinberg2012-09-26-10/+0
| | | | | | | | | | | | | | | | env_fat and env_remote have an implementation of env_get_char_spec() function that is not different than the default. Remove the duplicated code. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
* | Merge branch 'master' of git://git.denx.de/u-boot-videoTom Rini2012-09-25-70/+83
|\ \
| * | common/lcd: fix build breakage for at91sam9x5ek and trats boardsAnatolij Gustschin2012-09-24-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 203c37b8c5556aad1901ce4954792afd718c7d42 (common lcd: simplify core functions) and commit bfdcc65e1163b4891643c2a670570c478b9af2a4 (common lcd: simplify lcd_display_bitmap) caused build breakage for at91sam9x5ek board configurations and for trats board. Fix these build errors. Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Nikita Kiryanov <nikita@compulab.co.il>
| * | common/lcd: add protection from null bmp pointerNikita Kiryanov2012-09-21-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the bmp pointer is null then U-Boot will get stuck when trying to load the image. What's worse, it will get stuck before the U-Boot shell becomes available to the user, thus making it difficult to correct the situation. To protect from the above scenario, check if the pointer is valid. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
| * | common lcd: simplify lcd_display_bitmapNikita Kiryanov2012-09-05-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move highly platform dependant code into its own functions to reduce the number of #ifdefs in lcd_display_bitmap To avoid breaking the mcc200 board which does not #define CONFIG_CMD_BMP, this patch also implements bmp_display() for mcc200. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
| * | common lcd: simplify core functionsNikita Kiryanov2012-09-05-32/+30
| | | | | | | | | | | | | | | | | | | | | | | | Move highly platform dependant code into its own function to reduce the number of #ifdefs in the bigger functions Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
| * | common lcd: simplify lcd_displayNikita Kiryanov2012-09-05-9/+18
| | | | | | | | | | | | | | | | | | | | | Simplify lcd_display by centralizing code into a funciton Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
| * | common lcd: simplify lcd_logoNikita Kiryanov2012-09-05-11/+1
| | | | | | | | | | | | | | | | | | | | | Simplify lcd_logo by extracting bmp unzip into its own function. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
* | | cmd_part: add partition-related commandStephen Warren2012-09-25-0/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements the following: part uuid mmc 0:1 -> print partition UUID part uuid mmc 0:1 uuid -> set environment variable to partition UUID part list mmc 0 -> list the partitions on the specified device "part uuid" can be useful when writing a bootcmd which searches all known devices for something bootable, and then wants the kernel to use the same partition as the root device, e.g.: part uuid ${devtype} ${devnum}:${rootpart} uuid setenv bootargs root=PARTUUID=${uuid} ... Signed-off-by: Stephen Warren <swarren@nvidia.com>
* | | disk: get_device_and_partition() "auto" partition and cleanupStephen Warren2012-09-25-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework get_device_and_partition() to: a) Implement a new partition ID of "auto", which requests that U-Boot search for the first "bootable" partition, and fall back to the first valid partition if none is found. This way, users don't need to specify an explicit partition in their commands. b) Make use of get_device(). c) Add parameter to indicate whether returning a whole device is acceptable, or whether a partition is mandatory. d) Make error-checking of the user's device-/partition-specification more complete. In particular, if strtoul() doesn't convert all characters, it's an error rather than just ignored. The resultant device/partition returned by the function will be as follows, based on whether the disk has a partition table (ptable) or not, and whether the calling command allows the whole device to be returned or not. (D and P are integers, P >= 1) D D: No ptable: !allow_whole_dev: error allow_whole_dev: device D ptable: device D partition 1 D:0 !allow_whole_dev: error allow_whole_dev: device D D:P No ptable: error ptable: device D partition P D:auto No ptable: !allow_whole_dev: error allow_whole_dev: device D ptable: first partition in device D with bootable flag set. If none, first valid paratition in device D. Note: In order to review this patch, it's probably easiest to simply look at the file contents post-application, rather than reading the patch itself. Signed-off-by: Rob Herring <rob.herring@calxeda.com> [swarren: Rob implemented scanning for bootable partitions. I fixed a couple of issues there, switched the syntax to ":auto", added the error-checking rework, and ":0" syntax for the whole device] Signed-off-by: Stephen Warren <swarren@nvidia.com>
* | | cmd_reiser: use common get_device_and_partition functionRob Herring2012-09-25-64/+17
| | | | | | | | | | | | | | | | | | | | | | | | Convert reiserload and reiserls to use common device and partition parsing function. With the common function "dev:part" can come from the environment and a '-' can be used in that case. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | | cmd_zfs: use common get_device_and_partition functionRob Herring2012-09-25-69/+19
| | | | | | | | | | | | | | | | | | | | | | | | Convert zfsload and zfsls to use common device and partition parsing function. With the common function "dev:part" can come from the environment and a '-' can be used in that case. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | | cmd_disk: use common get_device_and_partition functionRob Herring2012-09-25-58/+19
| | | | | | | | | | | | Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | | cmd_fat: use common get_device_and_partition functionRob Herring2012-09-25-66/+34
| | | | | | | | | | | | | | | | | | | | | | | | Convert fatload, fatls, and fatinfo to use common device and partition parsing function. With the common function "dev:part" can come from the environment and a '-' can be used in that case. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | | cmd_extX: use common get_device_and_partition functionRob Herring2012-09-25-167/+30
| | | | | | | | | | | | | | | | | | | | | | | | Convert ext2/4 load, ls, and write functions to use common device and partition parsing function. With the common function "dev:part" can come from the environment and a '-' can be used in that case. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | | ext4: remove init_fs/deinit_fsRob Herring2012-09-25-23/+6
| | | | | | | | | | | | | | | | | | | | | There's no real need to expose this and it can be removed by using a static allocation. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | | combine block device load commands into common functionRob Herring2012-09-25-409/+187
| | | | | | | | | | | | | | | | | | | | | | | | All the raw block load commands duplicate the same code. Starting with the ide version as it has progress updates convert ide, usb, and scsi boot commands to all use a common version. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | | Merge branch 'master' of git://git.denx.de/u-boot-mpc85xxTom Rini2012-09-25-2/+3
|\ \ \ | |_|/ |/| |
| * | powerpc/CoreNet: add tool to support pbl image build.Shaohui Xie2012-08-23-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provides a tool to build boot Image for PBL(Pre boot loader) which is used on Freescale CoreNet SoCs, PBL can be used to load some instructions and/or data for pre-initialization. The default output image is u-boot.pbl, for more details please refer to doc/README.pblimage. Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
| * | powerpc/corenet_ds: Slave module for boot from PCIELiu Gang2012-08-23-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When boot from PCIE, slave's core should be in holdoff after powered on for some specific requirements. Master will release the slave's core at the right time by PCIE interface. Slave's ucode and ENV can be stored in master's memory space, then slave can fetch them through PCIE interface. For the corenet platform, ucode is for Fman. NOTE: Because the slave can not erase, write master's NOR flash by PCIE interface, so it can not modify the ENV parameters stored in master's NOR flash using "saveenv" or other commands. environment and requirement: master: 1. NOR flash for its own u-boot image, ucode and ENV space. 2. Slave's u-boot image is in master NOR flash. 3. Put the slave's ucode and ENV into it's own memory space. 4. Normally boot from local NOR flash. 5. Configure PCIE system if needed. slave: 1. Just has EEPROM for RCW. No flash for u-boot image, ucode and ENV. 2. Boot location should be set to one PCIE interface by RCW. 3. RCW should configure the SerDes, PCIE interfaces correctly. 4. Must set all the cores in holdoff by RCW. 5. Must be powered on before master's boot. For the slave module, need to finish these processes: 1. Set the boot location to one PCIE interface by RCW. 2. Set a specific TLB entry for the boot process. 3. Set a LAW entry with the TargetID of one PCIE for the boot. 4. Set a specific TLB entry in order to fetch ucode and ENV from master. 5. Set a LAW entry with the TargetID one of the PCIE ports for ucode and ENV. 6. Slave's u-boot image should be generated specifically by make xxxx_SRIO_PCIE_BOOT_config. This will set SYS_TEXT_BASE=0xFFF80000 and other configurations. In addition, the processes are very similar between boot from SRIO and boot from PCIE. Some configurations like the address spaces can be set to the same. So the module of boot from PCIE was added based on the existing module of boot from SRIO, and the following changes were needed: 1. Updated the README.srio-boot-corenet to add descriptions about boot from PCIE, and change the name to README.srio-pcie-boot-corenet. 2. Changed the compile config "xxxx_SRIOBOOT_SLAVE" to "xxxx_SRIO_PCIE_BOOT", and the image builded with "xxxx_SRIO_PCIE_BOOT" can support both the boot from SRIO and from PCIE. 3. Updated other macros and documents if needed to add information about boot from PCIE. Signed-off-by: Liu Gang <Gang.Liu@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
* | | Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2012-09-21-2/+2
|\ \ \
| * | | env_mmc: allow environment to be in an eMMC partitionStephen Warren2012-09-07-8/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | eMMC devices may have hardware-level partitions: 2 boot partitions, up to 4 general partitions, plus the user area. This change introduces optional config variable CONFIG_SYS_MMC_ENV_PART to indicate which partition the environment should be stored in: 0=user, 1=boot0, 2=boot1, 4..7=general0..3. This allows the environment to be kept out of the user area, which simplifies the management of OS-/user-level (MBR/GPT) partitions within the user area. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
| * | | cmd_nand: dump: Align data and OOB buffersThierry Reding2012-09-07-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order for cache invalidation and flushing to work properly, the data and OOB buffers must be aligned to full cache lines. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
* | | | Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini2012-09-21-5/+9
|\ \ \ \
| * | | | usb: do explicit unaligned accessesLucas Stach2012-09-21-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | usb_hub_descriptor has to be packed as it's used for communication with the device. Member wHubCharacteristics violates the natural alignment rules. Use explicit unaligned access functions for this member. Fixes ARMv7 traping while using USB. v2: fix typo found by Thomas Langer v3: rebased on top of u-boot-usb/master Signed-off-by: Lucas Stach <dev@lynxeye.de>
* | | | | Revert "memsize: Fix for bug in memory sizing code"Tom Rini2012-09-21-1/+0
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After further investigation this change is not correct and results in get_ram_size returning incorrectly large values. Reported first by Gerlando Falauto. This reverts commit b8496cced856ff411f1eb2e4eff20f5abe7080b0. Signed-off-by: Tom Rini <trini@ti.com>