15 Mar, 2016

2 commits

  • Q901 is PMOS, LCD_nPWREN should be at low voltage then output is 3V3.
    If LCD_nPWREN is high, output is 2.4V which is not correct.

    Signed-off-by: Peng Fan
    (cherry picked from commit b54bb7111af62a19a8aa930f8bbcf03f9515b863)

    Peng Fan
     
  • Fix 74LV OE gpio index. pinmux is correct, but gpio index
    is wrong, so gpio output will not have effect, since we
    use wrong GPIO5_IO18, but not correct GPIO5_IO8.

    And at the end of the initialization of 74lv init, should
    keep OE voltage level at LOW, but not high.

    Signed-off-by: Peng Fan
    (cherry picked from commit be7654b4cd7edd456ca8d5df3a51cc04ee2fb8f4)

    Peng Fan
     

04 Mar, 2016

38 commits

  • Need the CONFIG_MX6 for using the mx6_ecspi_fused funtion, otherwise will
    break build for other platforms like MX7.

    Signed-off-by: Ye Li
    (cherry picked from commit 9433975cef6a5aef3ff4709ebe68ba97f78740f0)

    Ye Li
     
  • Some type style problems found by review-commits for previous patch
    MLK-12483, fix them in this patch and re-check.

    Signed-off-by: Ye Li
    (cherry picked from commit 8ada91778f7f28dd33b80f515a35d09c1398933c)

    Ye Li
     
  • Since the MX6UL/SL/SX only has one DDR channel, in CCM_CCDR register the bit[17]
    for mmdc_ch0 is reserved and its proper state should be 1. When clear this bit,
    the periph_clk_sel cannot be set and that CDHIPR[periph_clk_sel_busy] handshake
    never clears.

    Signed-off-by: Ye Li
    (cherry picked from commit 4c3e6cd60f1f15061b391965ebc1ccb158129286)

    Ye Li
     
  • Enable the configurations CONFIG_MODULE_FUSE and CONFIG_OF_SYSTEM_SETUP for
    module fuse check. And modify board level codes for SD, FEC and EIM.

    Signed-off-by: Ye Li
    (cherry picked from commit f9d57bc73807d14062721a793a2a55be69aa4973)

    Ye Li
     
  • Add the fuse checking in drivers, when the module is disabled in fuse,
    the driver will not work.

    Changed drivers: BEE, GPMI, APBH-DMA, ESDHC, FEC, QSPI, ECSPI, I2C,
    USB-EHCI, GIS, LCDIF.

    Signed-off-by: Ye Li
    (cherry picked from commit 61789a160ae023ba6f7d37da74be957d22505736)

    Ye Li
     
  • Implement a functionality to read the soc fuses and check if any module
    is fused. For fused module, we have to disable it in u-boot dynamically,
    and change the its node in FDT to "disabled" status before starting the kernel.

    In this patch, we implement the ft_system_setup for FDT fixup. This function will
    be called during boot process or by "fdt systemsetup" command.

    To enable the module fuse checking, two configurations must be defined:
    CONFIG_MODULE_FUSE
    CONFIG_OF_SYSTEM_SETUP

    Signed-off-by: Ye Li
    (cherry picked from commit 2bce02298d755af0ef7b2aaecc56bcebc1fda61b)

    Ye Li
     
  • When using ft_system_setup, the return value fdt_ret is not assigned,
    so the fdt_strerror(fdt_ret) uses a uninitialized value.

    Signed-off-by: Ye Li
    (cherry picked from commit 00667ac75d28fc580b8bcb5db356a7c75f44f02c)

    Ye Li
     
  • The fdt command "fdt systemsetup" can't work because the do_fdt check the
    start char 's' for command "fdt set". So the fdt systemsetup will also go into
    the "fdt set" in fault. Fix this problem by checking the whole word "set" for
    "fdt set" command.

    Signed-off-by: Ye Li
    (cherry picked from commit 771dab97f93e1ab07a5f2f29f1622528b9477969)

    Ye Li
     
  • TO1.1 already fixed this PMIC_STBY_REQ open drain issue.

    Signed-off-by: Peng Fan
    (cherry picked from commit ca666cbc2bff17744f652de72ca258ff9c5275e6)

    Peng Fan
     
  • 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
     
  • 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
     
  • 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
     
  • 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
     
  • 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
     
  • 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
     
  • Modify the picosom to be suit for Brillo configurations.

    Signed-off-by: Haoran Wang

    Haoran Wang
     
  • Imported the picosom boot codes and board
    configs from technexion.

    Signed-off-by: Tapani Utriainen
    Signed-off-by: Haoran Wang

    Haoran Wang
     
  • Define CONFIG_SYS_VSNPRINTF to use snprintf, but not sprintf.
    Coverity ID: 17926.

    Signed-off-by: Peng Fan

    Peng Fan
     
  • 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
     
  • 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
     
  • 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
     
  • 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
     
  • 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
     
  • 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
     
  • 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
     
  • 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
    Cc: Tom Rini
    Cc: Simon Glass
    (cherry picked from commit 5a6894397a657edec5d0cf4e20968cc66a368c51)

    Peng Fan
     
  • 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
    Cc: Tom Rini
    Cc: Simon Glass
    Reviewed-by: Joe Hershberger
    (cherry picked from commit 5d49b4cdf9417b88476567c8ec78ff185d84b10f)

    Peng Fan
     
  • Whether CONFIG_SYS_HUSH_PARSER is defined or not, should always
    check to free 'buff' to avoid memory leak.

    Signed-off-by: Peng Fan
    Cc: Tom Rini
    Cc: Masahiro Yamada
    Cc: Simon Glass
    (cherry picked from commit 09a788624dbe32aeeb0d74c97c0965303eb96d8c)

    Peng Fan
     
  • 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
     
  • Need to free memory avoid memory leak, when error.

    Signed-off-by: Peng Fan
    Reviewed-by: Simon Glass
    Cc: Simon Glass
    Cc: Tom Rini
    (cherry picked from commit c6bb23c819b5dcbc5c3491673f5e408c0b9c38b3)

    Peng Fan
     
  • 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
    Cc: Joe Hershberger
    Cc: Simon Glass
    Cc: Bin Meng
    Reviewed-by: Bin Meng
    Acked-by: Joe Hershberger
    (cherry picked from commit 746da1bd42aa5ecc47898399514c9c76d0329706)

    Peng Fan
     
  • "enable" is unsigned char type and its value will not be
    negative, so discard "enable < 0".

    Signed-off-by: Peng Fan
    Cc: Diego Santa Cruz
    Cc: Pantelis Antoniou
    Cc: Andrew Gabbasov
    Cc: Simon Glass
    Cc: Stefano Babic
    Cc: Tom Rini
    Reviewed-by: Simon Glass
    (cherry picked from commit 678e9316d48f78d162f705846b6f6eeab4aa5dd0)

    Peng Fan
     
  • The entry name of mii_dev is an array not pointer, so
    no need to check.

    Signed-off-by: Peng Fan
    Cc: Joe Hershberger
    Cc: Simon Glass
    Cc: Bin Meng
    Reviewed-by: Simon Glass
    Acked-by: Joe Hershberger
    Reviewed-by: Bin Meng
    (cherry picked from commit d39449b110c8da47bf5b8dc372bd5cd1c33a1a67)

    Peng Fan
     
  • 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
    Cc: Simon Glass
    Cc: Joe Hershberger
    Cc: Max Krummenacher
    Cc: Marek Vasut
    Cc: Suriyan Ramasami
    Cc: Paul Kocialkowski
    Cc: Tom Rini
    Reviewed-by: Simon Glass
    (cherry picked from commit 2ea47be02f356ff275fa5c50392ea510ddb4a96c)

    Peng Fan
     
  • 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
    Cc: Rabin Vincent
    Cc: Simon Glass
    Cc: Tom Rini
    Reviewed-by: Simon Glass
    (cherry picked from commit aa722529635c16c52d9d609122fecc96ec8d03e4)

    Peng Fan
     
  • Before continue, check return value of strict_strtoul.

    Signed-off-by: Peng Fan
    Cc: Albert Aribaud
    Cc: Simon Glass
    Cc: Jan Kiszka
    Cc: Joe Hershberger
    Cc: Hans de Goede
    Cc: York Sun
    Cc: Tom Rini
    Reviewed-by: Simon Glass
    (cherry picked from commit bc3c89b1308281edceb67051a44026545dc7b505)

    Peng Fan
     
  • Currently there is no API to uninitialize mdio. Add two APIs for this.

    Signed-off-by: Bin Meng
    Acked-by: Joe Hershberger
    (cherry picked from commit cb6baca77bca0ef999203a7ed73bd123e7da062e)

    Bin Meng
     
  • Introudce wp_enable. If want to check WPSPL, then in board code,
    need to set wp_enable to 1.

    Take i.MX6UL for example, to some boards, they do not use WP singal,
    so they does not configure USDHC1_WP_SELECT_INPUT, and its default
    value is 0(GPIO1_IO02). However GPIO1_IO02 is muxed for i2c usage and
    SION bit set. So USDHC controller can always get wp signal and WPSPL
    shows write protect and blocks driver continuing. This is not what
    we want to see, so add wp_enable, and if set to 0, just omit the
    WPSPL checking and this does not effect normal working of usdhc
    controller.

    Suggested-by: Ye.Li
    Signed-off-by: Peng Fan

    Peng Fan