summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* MA-8622 - [brillo] fix uboot compile warnings and code style warningsfang hui2016-08-25-145/+108
| | | | | | | | | | . in f_fastboot.c, rename global var ptable to g_ptable . fix compile warnings in fsl_caam.c, f_fastboot.c, fastboot_lock_unlock.c . fix code style warnings in fsl_caam.c, f_fastboot.c, fastboot_lock_unlock.c Signed-off-by: fang hui <hui.fang@freescale.com>
* MA-8541 env update will overwrite the uboot binaryChen Guoyin2016-08-11-13/+13
| | | | | | | | The uboot binary for auto 6q board may exceed the 512k The env offset need to be larger thn the uboot binary size Extend the env offset to 768k for all imx6/7 boards Signed-off-by: Chen Guoyin <guoyin.chen@freescale.com>
* mmc: update MMC_ERASE argument to match Linux kernel.Eric Nelson2016-08-09-2/+7
| | | | | | | | | | | | | | | | | | | | Table 41 of the JEDEC standard for eMMC says that bit 31 of the command argument is obsolete when issuing the ERASE command (CMD38) on page 115 of this document: http://www.jedec.org/sites/default/files/docs/jesd84-B45.pdf The SD Card Association Physical Layer Simplified Specification also makes no mention of the use of bit 31. https://www.sdcard.org/downloads/pls/part1_410.pdf The Linux kernel distinguishes between secure (bit 31 set) and non-secure erase, and this patch copies the macro names from include/linux/mmc/core.h. Tested-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Eric Nelson <eric@nelint.com> Tested-by: Hector Palacios <hector.palacios@digi.com> (cherry picked from commit 1aa2d074a7acda61eb43e654ced21c139703633c)
* MA-8418 fix return value check for get_device_and_partitionWinter Wang2016-07-29-52/+51
| | | | | | | | | | | | | if the lock/unlock partitions are not created, reboot will fail with "boota: bad boot image magic". get_device_and_partition will return negtive value if error, fix this return value check if there is no lock/unlock related partitions, or block_write in fastboot_set_lock_stat may destroy boot partition. refine code indentation. Signed-off-by: Winter Wang <wente.wang@nxp.com>
* MA-8425 fastboot: return OKAY in fastboot eraseHaoran Wang2016-07-25-0/+4
| | | | | | | | | | | | | | | | | | fastboot host end will erase the ext4 partition before flash them. This is enable into fastboot when it can get ext4 partition by "getvar partition-type". Because by default "fastboot erase" will get FAIL result so the "fastboot flash" process will be end by the failure. As "fastboot flash" will overwrite the partition so we don't need to erase partition. Return OKAY will let the "fastboot flash" continue. This patch also refined fastboot lock/unlock codes. Signed-off-by: Haoran Wang <Haoran.Wang@freescale.com>
* MA-7875-4 Support fastboot getvar commandsWang Haoran2016-07-21-2/+88
| | | | | | | | | | | | | | | Support below fastboot getvar commands: o version-baseband o version-bootloader o product o off-mode-charge o variant o battery-voltage o battery-soc-ok o partition-size:<partition name> o partition-type:< partition name> Signed-off-by: Wang Haoran <Haoran.Wang@freescale.com>
* MA-7875-3 Support fastboot lock/unlock in i.MX6ULWang Haoran2016-07-21-0/+10
| | | | | | | | | Enable fastboot lock/unlock for Brillo in i.MX6UL platforms include: o Pico i.MX6UL o EVK i.MX6UL 14x14 Signed-off-by: Wang Haoran <Haoran.Wang@freescale.com>
* MA-7875-2 Support fastboot lock/unlock in i.MX6 platformWang Haoran2016-07-21-0/+45
| | | | | | | | | | | Enable fastboot lock/unlock support for Android in i.MX6 platform include: o i.MX6QP/Q/DL sabresd o i.MX6QP/Q/DL sabreauto (non NAND) o i.MX6SX sabresd o i.MX6SX sabreauto (nan NAND) Signed-off-by: Wang Haoran <Haoran.Wang@freescale.com>
* MA-7875-1 Support fastboot lock&unlock in u-bootWang Haoran2016-07-21-5/+600
| | | | | | | | | Support "fastboot flashing/oem lock/unlock" command. Support "fastboot getvar secure/unlocked" command. Protect the lock/unlock status by CAAM-Keyblob. Signed-off-by: Wang Haoran <Haoran.Wang@freescale.com>
* MA-7875 Enable CAAM for i.MX6Wang Haoran2016-07-21-0/+1044
| | | | | | | | | Cherry-pick patch from Renato Frias <b13784@freescale.com> to enable CAAM in U-Boot. Modify the CAAM Keyblob to general memory mode. Signed-off-by: Wang Haoran <Haoran.Wang@freescale.com>
* MA-8381 - [brillo]: brillo_fastboot_test.py failedfang hui2016-07-19-2/+3
| | | | | | | | | | | | | . Change user data partition name from "data" to "userdata". . Support "product" in "getvar" command. . In "getvar", if the variable is not supported, just response with "OKAY", not with "FAILVariable not implemented". Since the test will verify that the return val is 0, and the value is a hollow string. Signed-off-by: fang hui <hui.fang@freescale.com>
* MA-8320 - [brillo] update boot control since structfang hui2016-06-22-8/+22
| | | | | | | | bootloader_message_ab is used for brillo adjust offset of boot_ctl struct. Signed-off-by: fang hui <hui.fang@freescale.com>
* MA-8226 - [brillo] Invalid current slot if no chance to load kernelfang hui2016-05-31-3/+59
| | | | | | | | | | Due to "Brillo Boot Loader Requirements", if kernel is not valid or authentic, should invalid current slot. So can try other slot. This fix the failure of pts case brillo_BootLoader:check_bootloader_fallback_on_invalid Signed-off-by: fang hui <hui.fang@freescale.com>
* MA-7633-1 [Android-SD-EMMC] enable BCB partition in androidzhang sanshan2016-04-29-222/+384
| | | | | | | | 1 Add some APIs to operate BCB/command. 2 Add action to check the command of BCB. It can cover the case that power down when do factory-reset\ota in recovery mode. Signed-off-by: zhang sanshan <b51434@freescale.com>
* MA-7373 - [brillo]: store slot meta data in a raw partition, no file system.fang hui2016-04-29-99/+284
| | | | | | | | | | | | | | | Partition name change from slotmeta to misc. Read/write raw data on partition misc, not use ext4 file system. Store meta in bootloader_message.slot_suffix, as defined in bootable/recovery/bootloader.h The first 4 bytes of boot_ctl are defined as magic number. Also, modify code to remove warning in drivers/usb/gadget/bootctrl.c warning: implicit declaration of function 'do_read' Signed-off-by: fang hui <b31070@freescale.com>
* MA-7251 - [evk_6ul]: Support boot conctrol for brillofang hui2016-04-29-26/+566
| | | | | | | | | brillo need bootlader support boot control. bootlader can choose which slot(partition) to boot based on it's tactic. The commit support boot control for evk6ul Signed-off-by: fang hui <hui.fang@nxp.com>
* MA-7717 - [pico-emmc]: support emmc pico boardfang hui2016-03-16-4/+18
| | | | | | | Change SD1 to 8-bit SD card detect is supposed to be GPIO1_19 Signed-off-by: fang hui <hui.fang@freescale.com>
* MLK-12442: imx: mx6qarm2: lpddr2 set dram 2 channel fixed modeAdrian Alonso2016-03-16-4/+25
| | | | | | | | | | | | | Setup MMDC in two channel fixed mode Initialize dram banks for two channel fixed mode DRAM bank = 0x00000000 -> start = 0x10000000 -> size = 0x20000000 DRAM bank = 0x00000001 -> start = 0x80000000 -> size = 0x20000000 Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
* MLK-12375 imx: mx6ul: fix PMIC_STBY_REQ settinng for TO1.1Peng Fan2016-03-16-6/+8
| | | | | | TO1.1 already fixed this PMIC_STBY_REQ open drain issue. Signed-off-by: Peng Fan <peng.fan@nxp.com>
* MLK-12371-2: imx: mx7dsabresd: fix POR reset failed after DDR enter retentionRobin Gong2016-03-16-0/+12
| | | | | | Since DDR enter retention mode after kernel enter DSM mode, we have to exit DDR retention mode before uboot boot, so add this in DCD and plugin code. Signed-off-by: Robin Gong <yibin.gong@nxp.com>
* MLK-12371-1: imx: mx7d_12x12_lpddr3_arm2: fix POR reset failed after DDR ↵Robin Gong2016-03-16-2/+17
| | | | | | | | | | enter retention Since DDR enter retention mode after kernel enter DSM mode, we have to exit DDR retention mode before uboot boot, so add this in DCD and plugin code. Meanwhile correct the HW_ANADIG_SNVS_MISC_CTRL setting to avoid touching other bits. Signed-off-by: Robin Gong <yibin.gong@nxp.com>
* MLK-12393: imx: mx6qamr2: update lpddr2 dcd programming aid settingsAdrian Alonso2016-03-16-5/+5
| | | | | | | | | | | | | | | Adjust optimal valid clock cycles for 400Mhz operation Adjust valid clock cycles before self-refresh exit tCKSRX Adjust valid clock cycles after self-refresh entry tCKSRE Set MMDC1_MPZQHWCCTRL upper 16 bits to default reset value DDR calibration script http://sw-stash.freescale.net/projects/IMX/repos/ddr-scripts-rel/commits/040ee38ba9ad238fcb6053b663746d51321abb69 Test result: Stress test passed. Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
* MLK-12346 imx: mx7d: switch to use DRAM_PLL, but not DRAM_ALT_CLK_ROOTPeng Fan2016-03-16-24/+79
| | | | | | | To simplify kernel clock management, we switch to use DRAM_PLL for DRAM controller and DDR PHY, but not use DRAM_ALT_CLK_ROOT. Signed-off-by: Peng Fan <peng.fan@nxp.com>
* MLK-12329-2 imx7d: Add build target for TO1.0Ye Li2016-03-16-0/+42
| | | | | | | | Since only DDR script changed, create build target for SD boot as example to use TO1.0. All default build target for 7D platforms are for TO1.1. Signed-off-by: Ye Li <ye.li@nxp.com>
* MLK-12329-1 imx7d: Update DDR script for TO1.1Ye Li2016-03-16-24/+998
| | | | | | | | | | | | | | | | | | | | On i.MX7D TO1.1, design team adds a mux cell at the CKE path to fix the suspend mode reset issue, but seems it add extra delay on CKE path, so CKE-CK timing violated. When DDR enters self-refresh or retention for long time(> 15seconds per testing on some boards), DDR data corruption occured, not able to decrease CKE delay, so we have to add extra delay on all other signals to balance it. DDR script needs to be fine-tuned according to this hardware change. For DDR3, since the timing margin is not good, we have to decrease the DDR frequency from 533Mhz to 400Mhz. Compass link: http://compass.freescale.net/livelink/livelink?func=ll&objid=235010235&objAction=browse&sort=name Test: Overnight tests passed on all changed boards. Signed-off-by: Ye Li <ye.li@nxp.com>
* MLK-12296 imx: mx7dsabresd: Change default env for M4 boot to TCMYe Li2016-03-16-13/+24
| | | | | | | | | | | | Since the QSPI needs to rework on this board, at default the QSPI is disabled. So bind the M4 QSPI boot with QSPI enabled u-boot image, set default M4 boot to TCM. Need to use TCM m4 image at default. Additional, on SDB there is only one QSPI flash. Considering the A7 QSPI boot case, we have to move M4 image to 1M offset to give enough space for u-boot and env. Signed-off-by: Ye Li <ye.li@nxp.com>
* MLK-12261 MX6DQ{P}/DL:SABRESD Fix bmode eMMC failureYe Li2016-03-16-1/+1
| | | | | | | | | | The BOOTCFG value used by bmode for SABRESD eMMC boot are actually for SD card. Fixed the value to correct one. The issue was fixed in 2014.04 u-boot, but that patch seems missed during porting to 2015.04. Signed-off-by: Ye Li <ye.li@nxp.com>
* MA-7455-2 Workaround to pass compile for picoHaoran Wang2016-03-16-0/+1
| | | | | | | | | We have some vendor specific codes in board/freescale/common which the picoimx configs also need them when Android or Brillo configs is enabled. So added the folder in Makefile to pass the compile. Signed-off-by: Haoran Wang <Haoran.Wang@freescale.com>
* MA-7455-1 Pico: modify Pico configuration for Brillo.Haoran Wang2016-03-16-2/+8
| | | | | | Modify the picosom to be suit for Brillo configurations. Signed-off-by: Haoran Wang <Haoran.Wang@freescale.com>
* MA-7455 Import picosom boot codesHaoran Wang2016-03-16-0/+1329
| | | | | | | | Imported the picosom boot codes and board configs from technexion. Signed-off-by: Tapani Utriainen <tapani@technexion.com> Signed-off-by: Haoran Wang <Haoran.Wang@freescale.com>
* MLK-12195 imx: mx6/7 define CONFIG_SYS_VSNPRINTFPeng Fan2016-03-16-2/+6
| | | | | | | Define CONFIG_SYS_VSNPRINTF to use snprintf, but not sprintf. Coverity ID: 17926. Signed-off-by: Peng Fan <peng.fan@nxp.com>
* MLK-12206 common: usb: fix check conditionPeng Fan2016-03-16-1/+1
| | | | | | | | | | | | | | We support max 16 endpoints, but endpoint starts from 0. So we need to use >= 16 but not > 16 to check whether we already reach max endpoints or not. Coverity ID 17955: Out-of-bounds read (OVERRUN) 37. overrun-local: Overrunning array dev->config.if_desc[ifno].ep_desc of 16 9-byte elements at element index 16 (byte offset 144) using index epno (which evaluates to 16). Signed-off-by: Peng Fan <peng.fan@nxp.com>
* MLK-12201 common: env: fix out of bounds readPeng Fan2016-03-16-1/+1
| | | | | | | | | We should use ARRAY_SIZE, but not directly sizeof, otherwise we may access memory that is not belong the array env_flags_varaccess_mask. Coverity ID: 17949 Signed-off-by: Peng Fan <peng.fan@nxp.com>
* MLK-12200 common: cli_simple: use strlcpy instead of strcpyPeng Fan2016-03-16-1/+2
| | | | | | | | | Report Coverity log: Destination buffer too small (STRING_OVERFLOW) string_overflow: You might overrun the 1024 byte destination string lastcommand by writing 1025 bytes from console_buffer Signed-off-by: Peng Fan <peng.fan@nxp.com>
* MLK-12199 common:env fix unintialized scalar valuePeng Fan2016-03-16-1/+11
| | | | | | | Reported by coverity ID: 17900 17902 Using uninitialized value e. Field e.flags is uninitialized when calling hsearch_r Signed-off-by: Peng Fan <peng.fan@nxp.com>
* MLK-12214 NAND:apbh_dma: Fix logically dead code issueYe.Li2016-03-16-3/+3
| | | | | | | | | | The list_first_entry always assumes the list is not empty, it won't return NULL pointer when the list is empty. So the "if (pdesc == NULL)" becomes a dead code. Fix the issue by calling the list_empty before the list_first_entry. (Coverity CID 29934) Signed-off-by: Ye.Li <ye.li@nxp.com>
* MLK-12246: mtd: nand: fix the read from pointer after free issueHan Xu2016-03-16-2/+2
| | | | | | | Fix a read from pointer after free issue in nand error handling path, which was found by coverity. Signed-off-by: Han Xu <han.xu@nxp.com>
* MLK-12209 mmc: cast u8 to unsigned long long to avoid unexpected errorHaibo Chen2016-03-16-12/+12
| | | | | | | | | | | | | | | | | unsigned long long data might have strange data if first bit of u8 data was 1. this patch cast it to (unsigned long long) ex) u8 data8; u64 data64; data8 = 0x80; data64 = (data8 << 24); // 0xffffffff80000000 data64 = (((unsigned long long)data8) << 24); // 0x80000000; (reported by Coverity) Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
* common: env: initialize scalar variablePeng Fan2016-03-16-0/+2
| | | | | | | | | | | | | | | | | Before calling hsearch_r, initialize callback entry to NULL. Coverity log: " Uninitialized scalar variable (UNINIT) uninit_use_in_call: Using uninitialized value e. Field e.callback is uninitialized when calling hsearch_r. " Reported-by: Coverity Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> (cherry picked from commit 5a6894397a657edec5d0cf4e20968cc66a368c51)
* common: nvedit: use snprintf instead of sprintfPeng Fan2016-03-16-1/+1
| | | | | | | | | | | | | | | | | Use snprintf to replace sprintf. Coverity log: " Unbounded source buffer (STRING_SIZE) string_size: Passing string init_val of unknown size to sprintf. " Reported-by: Coverity Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com> (cherry picked from commit 5d49b4cdf9417b88476567c8ec78ff185d84b10f)
* common: cli: avoid memory leakPeng Fan2016-03-16-1/+1
| | | | | | | | | | | Whether CONFIG_SYS_HUSH_PARSER is defined or not, should always check to free 'buff' to avoid memory leak. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Tom Rini <trini@konsulko.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Simon Glass <sjg@chromium.org> (cherry picked from commit 09a788624dbe32aeeb0d74c97c0965303eb96d8c)
* MLK-12156 mx6ul: Update iomux head file to version 151130Ye.Li2016-03-16-0/+25
| | | | | | | The latest iomux head file generated by tool has added some new pinmux settings. Update the mx6ul_pins.h to this version. Signed-off-by: Ye.Li <ye.li@nxp.com>
* common: cli_hush: avoid memory leakPeng Fan2016-03-16-2/+7
| | | | | | | | | | Need to free memory avoid memory leak, when error. Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> (cherry picked from commit c6bb23c819b5dcbc5c3491673f5e408c0b9c38b3)
* common: miiphyutil: avoid memory leakPeng Fan2016-03-16-0/+2
| | | | | | | | | | | | | | | | | | | The following code will alloc memory for new_dev and ldev: " new_dev = mdio_alloc(); ldev = malloc(sizeof(*ldev)); " Either new_dev or ldev is NULL, directly return, but this may leak memory. So before return, using free(ldev) and mdio_free(new_dev) to avoid leaking memory, also free can handle NULL pointer. Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> (cherry picked from commit 746da1bd42aa5ecc47898399514c9c76d0329706)
* common: mmc: unsigned char compared against 0Peng Fan2016-03-16-1/+1
| | | | | | | | | | | | | | | "enable" is unsigned char type and its value will not be negative, so discard "enable < 0". Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Cc: Diego Santa Cruz <Diego.SantaCruz@spinetix.com> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Andrew Gabbasov <andrew_gabbasov@mentor.com> Cc: Simon Glass <sjg@chromium.org> Cc: Stefano Babic <sbabic@denx.de> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> (cherry picked from commit 678e9316d48f78d162f705846b6f6eeab4aa5dd0)
* common: miiphyutil: no need to check name of mii_devPeng Fan2016-03-16-1/+1
| | | | | | | | | | | | | | The entry name of mii_dev is an array not pointer, so no need to check. Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> (cherry picked from commit d39449b110c8da47bf5b8dc372bd5cd1c33a1a67)
* common: image-fdt: correct fdt_blob for IMAGE_FORMAT_LEGACYPeng Fan2016-03-16-1/+1
| | | | | | | | | | | | | | | | | | If condition of "(load == image_start || load == image_data)" is true, should use "fdt_addr = load;", but not "fdt_blob = (char *)image_data;", or fdt_blob will be overridden by "fdt_blob = map_sysmem(fdt_addr, 0);" at the end of the switch case. Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Cc: Simon Glass <sjg@chromium.org> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Max Krummenacher <max.krummenacher@toradex.com> Cc: Marek Vasut <marex@denx.de> Cc: Suriyan Ramasami <suriyan.r@gmail.com> Cc: Paul Kocialkowski <contact@paulk.fr> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> (cherry picked from commit 2ea47be02f356ff275fa5c50392ea510ddb4a96c)
* common: cli_hush: avoid dead codePeng Fan2016-03-16-1/+1
| | | | | | | | | | | | | | | | Condition "(value == NULL && ++value == NULL)" actully will always return false. Instead, use condition "(value == NULL || *(value + 1) == 0)" to detect such expression "c=". To "c=", *(value + 1) is 0, so directly return -1, but not continue. Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Cc: Rabin Vincent <rabin@rab.in> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> (cherry picked from commit aa722529635c16c52d9d609122fecc96ec8d03e4)
* common: bootm: check return value of strict_strtoulPeng Fan2016-03-16-1/+4
| | | | | | | | | | | | | | | Before continue, check return value of strict_strtoul. Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Simon Glass <sjg@chromium.org> Cc: Jan Kiszka <jan.kiszka@siemens.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: York Sun <yorksun@freescale.com> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> (cherry picked from commit bc3c89b1308281edceb67051a44026545dc7b505)
* net: mdio: Add mdio_free() and mdio_unregister() APIBin Meng2016-03-16-0/+21
| | | | | | | | Currently there is no API to uninitialize mdio. Add two APIs for this. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> (cherry picked from commit cb6baca77bca0ef999203a7ed73bd123e7da062e)