25 Jan, 2014

1 commit


10 Jan, 2014

1 commit


09 Jan, 2014

2 commits


22 Nov, 2013

1 commit

  • nand_ecclayout is present in mtd.h at Linux.
    Move this structure to mtd.h to comply with Linux.

    Also, increase the ecc placement locations to 640 to suport device having
    writesize/oobsize of 8KB/640B. This means that the maximum oobsize has gone
    up to 640 bytes and consequently the maximum ecc placement locations have
    also gone up to 640.

    Changes from Prabhabkar's version (squashed into one patch to preserve
    bisectability):
    - Added _LARGE to MTD_MAX_*_ENTRIES

    This makes the names match current Linux source, and resolves
    a conflict between
    http://patchwork.ozlabs.org/patch/280488/
    and
    http://patchwork.ozlabs.org/patch/284513/

    The former was posted first and is closer to matching Linux, but
    unlike Linux it does not add _LARGE to the names. The second adds
    _LARGE to one of the names, and depends on it in a subsequent patch
    (http://patchwork.ozlabs.org/patch/284512/).

    - Made max oobfree/eccpos configurable, and used this on tricorder,
    alpr, ASH405, T4160QDS, and T4240QDS (these boards failed to build
    for me without doing so, due to a size increase).

    On tricorder SPL, this saves 2576 bytes (and makes the SPL build
    again) versus the new default of 640 eccpos and 32 oobfree, and
    saves 336 bytes versus the old default of 128 eccpos and 8 oobfree.

    Signed-off-by: Prabhakar Kushwaha
    CC: Vipin Kumar
    [scottwood@freescale.com: changes as described above]
    Signed-off-by: Scott Wood
    Cc: Thomas Weber
    Cc: Matthias Fuchs
    Cc: Stefan Roese
    Cc: York Sun
    Cc: Tom Rini
    Reviewed-by: Stefan Roese

    Prabhakar Kushwaha
     

09 Nov, 2013

1 commit

  • Linux Kernel abolished include/linux/config.h long time ago.
    (around version v2.6.18..v2.6.19)

    We don't need to provide Linux copatibility any more.

    This commit deletes include/linux/config.h
    and fixes source files not to include this.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

21 Oct, 2013

5 commits


10 Oct, 2013

1 commit

  • Linux modified the MTD driver interface in commit edbc4540 (with the
    same name as this commit). The effect is that calls to mtd_read will
    not return -EUCLEAN if the number of ECC-corrected bit errors is below
    a certain threshold, which defaults to the strength of the ECC. This
    allows -EUCLEAN to stop indicating "some bits were corrected" and begin
    indicating "a large number of bits were corrected, the data held in
    this region of flash may be lost soon". UBI makes use of this and when
    -EUCLEAN is returned from mtd_read it will move data to another block
    of flash. Without adopting this interface change UBI on U-boot attempts
    to move data between blocks every time a single bit is corrected using
    the ECC, which is a very common occurance on some devices.

    For some devices where bit errors are common enough, UBI can get stuck
    constantly moving data around because each block it attempts to use has
    a single bit error. This condition is hit when wear_leveling_worker
    attempts to move data from one PEB to another in response to an
    -EUCLEAN/UBI_IO_BITFLIPS error. When this happens ubi_eba_copy_leb is
    called to perform the data copy, and after the data is written it is
    read back to check its validity. If that read returns UBI_IO_BITFLIPS
    (in response to an MTD -EUCLEAN) then ubi_eba_copy_leb returns 1 to
    wear_leveling worker, which then proceeds to schedule the destination
    PEB for erasure. This leads to erase_worker running on the PEB, and
    following a successful erase wear_leveling_worker is called which
    begins this whole cycle all over again. The end result is that (without
    UBI debug output enabled) the boot appears to simply hang whilst in
    reality U-boot busily works away at destroying a block of the NAND
    flash. Debug output from this situation:

    UBI DBG: ensure_wear_leveling: schedule scrubbing
    UBI DBG: wear_leveling_worker: scrub PEB 1027 to PEB 4083
    UBI DBG: ubi_io_read_vid_hdr: read VID header from PEB 1027
    UBI DBG: ubi_io_read: read 4096 bytes from PEB 1027:4096
    UBI DBG: ubi_eba_copy_leb: copy LEB 0:0, PEB 1027 to PEB 4083
    UBI DBG: ubi_eba_copy_leb: read 1040384 bytes of data
    UBI DBG: ubi_io_read: read 1040384 bytes from PEB 1027:8192
    UBI: fixable bit-flip detected at PEB 1027
    UBI DBG: ubi_io_write_vid_hdr: write VID header to PEB 4083
    UBI DBG: ubi_io_write: write 4096 bytes to PEB 4083:4096
    UBI DBG: ubi_io_read_vid_hdr: read VID header from PEB 4083
    UBI DBG: ubi_io_read: read 4096 bytes from PEB 4083:4096
    UBI DBG: ubi_io_write: write 4096 bytes to PEB 4083:8192
    UBI DBG: ubi_io_read: read 4096 bytes from PEB 4083:8192
    UBI: fixable bit-flip detected at PEB 4083
    UBI DBG: schedule_erase: schedule erasure of PEB 4083, EC 55, torture 0
    UBI DBG: erase_worker: erase PEB 4083 EC 55
    UBI DBG: sync_erase: erase PEB 4083, old EC 55
    UBI DBG: do_sync_erase: erase PEB 4083
    UBI DBG: sync_erase: erased PEB 4083, new EC 56
    UBI DBG: ubi_io_write_ec_hdr: write EC header to PEB 4083
    UBI DBG: ubi_io_write: write 4096 bytes to PEB 4083:0
    UBI DBG: ensure_wear_leveling: schedule scrubbing
    UBI DBG: wear_leveling_worker: scrub PEB 1027 to PEB 4083
    ...

    This patch adopts the interface change as in Linux commit edbc4540 in
    order to avoid such situations. Given that none of the drivers under
    drivers/mtd return -EUCLEAN, this should only affect those using
    software ECC. I have tested that it works on a board which is
    currently out of tree, but which I hope to be able to begin
    upstreaming soon.

    Signed-off-by: Paul Burton
    Acked-by: Stefan Roese

    Paul Burton
     

07 Oct, 2013

1 commit

  • The modelist data uses the list definition but the 'list.h' header
    were not being included. The build failure is bellow:

    ,----
    | In file included from yyyy.c:16:0:
    | .../u-boot/include/linux/fb.h:503:19: error: field 'modelist' has incomplete type
    | struct list_head modelist; /* mode list */
    | ^
    | make[1]: *** [yyyy.o] Error 1
    | make[1]: Leaving directory `.../u-boot/board/xxx/yyyy'
    | make: *** [board/xxx/yyyy/libyyyy.o] Error 2
    `----

    Signed-off-by: Otavio Salvador

    Otavio Salvador
     

24 Sep, 2013

2 commits


07 Sep, 2013

2 commits


22 Aug, 2013

1 commit


24 Jul, 2013

1 commit


01 Jul, 2013

1 commit

  • while playing with dfu, I tapped in an unaligned access
    when doing on the host side a "lsusb -d [vendornr]: -v"
    I get on the board:

    GADGET DRIVER: usb_dnl_dfu
    data abort

    MAYBE you should read doc/README.arm-unaligned-accesses

    pc : [] lr : []
    sp : 8ef40d18 ip : 00000005 fp : 00000000
    r10: 00000000 r9 : 47401410 r8 : 8ef40f38
    r7 : 8ef4aae8 r6 : 0000000a r5 : 8ef4ab28 r4 : 8ef4ab80
    r3 : 0000000a r2 : 00000006 r1 : 00000006 r0 : 8ef4aae8
    Flags: Nzcv IRQs off FIQs on Mode SVC_32
    Resetting CPU ...

    reason is that in the "struct usb_composite_dev" the
    "struct usb_device_descriptor desc;" is on an odd address,
    and this struct gets accessed in
    drivers/usb/gadget/composite.c device_qual()

    Fix it, by align this var "struct desc" fix to an aligned
    address.

    Signed-off-by: Heiko Schocher
    Cc: Marek Vasut
    Cc: Samuel Egli

    Heiko Schocher
     

25 Jun, 2013

1 commit


13 Jun, 2013

1 commit

  • Use unaligned access to fetch wMaxPacketSize in usb_endpoint_maxp()
    api.
    In its absence we see following data abort message:
    ==============================================================
    data abort

    MAYBE you should read doc/README.arm-unaligned-accesses

    pc : [] lr : []
    sp : bf37c7b0 ip : 0000002f fp : 00000000
    r10: 00000000 r9 : 00000002 r8 : bf37fecc
    r7 : 00000001 r6 : bf7d8931 r5 : bf7d891c r4 : bf7d8800
    r3 : bf7d65b0 r2 : 00000002 r1 : bf7d65b4 r0 : 00000027
    Flags: nZCv IRQs off FIQs off Mode SVC_32
    Resetting CPU ...

    resetting ...
    ==============================================================

    Signed-off-by: Vivek Gautam
    Cc: Ilya Yanok
    Cc: Marek Vasut

    Vivek Gautam
     

01 Jun, 2013

2 commits

  • Tom Rini
     
  • This patch is essentially an update of u-boot MTD subsystem to
    the state of Linux-3.7.1 with exclusion of some bits:

    - the update is concentrated on NAND, no onenand or CFI/NOR/SPI
    flashes interfaces are updated EXCEPT for API changes.

    - new large NAND chips support is there, though some updates
    have got in Linux-3.8.-rc1, (which will follow on top of this patch).

    To produce this update I used tag v3.7.1 of linux-stable repository.

    The update was made using application of relevant patches,
    with changes relevant to U-Boot-only stuff sticked together
    to keep bisectability. Then all changes were grouped together
    to this patch.

    Signed-off-by: Sergey Lapin
    [scottwood@freescale.com: some eccstrength and build fixes]
    Signed-off-by: Scott Wood

    Sergey Lapin
     

06 May, 2013

2 commits

  • This patch adds a driver for the diskonchip G4 nand flash device. It is based
    on the driver from the linux kernel.

    This also includes a separate SPL driver. A separate SPL driver is used because
    the device operates in a different mode (reliable mode) when loading a boot
    image, and also because the storage format of the boot image is different from
    normal data (pages are stored redundantly). The SPL driver basically mimics how
    a typical IPL reads data from the device. The special operating mode and
    storage format are used to compensate for the fact that the IPL does not contain
    the BCH ecc decoding algorithm (due to size constraints). Although the u-boot
    SPL *could* use ecc, it operates like an IPL for the sake of simplicity and
    uniformity, since the IPL and SPL share the task of loading the u-boot image.
    As a side benefit, the SPL driver is very small.

    [port from linux kernel 3.4 commit 570469f3bde7f71cc1ece07a18d54a05b6a8775d]

    Signed-off-by: Mike Dunn

    Mike Dunn
     
  • This patch adds the bitrev library from the linux kernel. This is a simple
    algorithm that uses an 8 bit look-up table to reverse the bits in data types of
    8, 16, or 32 bit widths. The docg4 nand flash driver uses it.

    [port from linux kernel v3.9 commit 7ee32a6d30d1c8a3b7a07a6269da8f0a08662927]
    [originally added: v2.6.20 by commit a5cfc1ec58a07074dacb6aa8c79eff864c966d12]

    Signed-off-by: Mike Dunn

    Mike Dunn
     

02 Apr, 2013

1 commit

  • 'bool' is defined in random places. This patch consolidates them into a
    single header file include/linux/types.h, using stdbool.h introduced in C99.

    All other #define, typedef and enum are removed. They are all consistent with
    true = 1, false = 0.

    Replace FALSE, False with false. Replace TRUE, True with true.
    Skip *.py, *.php, lib/* files.

    Signed-off-by: York Sun

    York Sun
     

14 Dec, 2012

1 commit

  • isspace() and strim() are not in the typical user-mode string.h, so
    put them in a separate compilation unit so that they can be built into
    tools that need them independent of the other common string functions.

    This allows code shared by u-boot and the linux user-mode tools to link.

    Signed-off-by: Joe Hershberger

    Joe Hershberger
     

12 Dec, 2012

1 commit

  • strncasecmp() is present as strnicmp() but disabled. Make it available
    and define strcasecmp() also. There is a only a small performance penalty
    to having strcasecmp() call strncasecmp(), so do this instead of a
    standalone function, to save code space.

    Update the prototype in arch-specific headers as needed to avoid warnings.

    Signed-off-by: Simon Glass

    Simon Glass
     

30 Nov, 2012

1 commit

  • When __BYTEORDER_HAS_U64__ is not defined, we got warning following:

    -----
    /tmp/include/linux/byteorder/little_endian.h: In function ‘__cpu_to_be64p’:
    /tmp/include/linux/byteorder/little_endian.h:71:2: warning: implicit declaration of function ‘__swab64p’
    [-Wimplicit-function-declaration]
    -----

    Usually, __arch__swab64* required for __fswab64, __swab64p and __swab64s
    is defined. Therefore, __BYTEORDER_HAS_U64__ is unnecessary.
    This removes __BYTEORDER_HAS_U64__.

    Signed-off-by: Nobuhiro Iwamatsu
    CC: Kim Phillips
    Reviewed-by: Kim Phillips

    Nobuhiro Iwamatsu
     

27 Nov, 2012

2 commits


20 Nov, 2012

2 commits

  • Existing U-Boot musb driver has no support for the new gadget framework
    and also seems to have other limitations. As gadget framework is ported
    from Linux it seems pretty natural to port musb gadget driver as well.

    This driver supports both host and peripheral modes.

    This is not a replacement for current musb driver (at least now) as
    there are still some consumers of the old UDC interface.

    No DMA operation support included, CONFIG_MUSB_PIO_ONLY should be
    defined.

    Virtual root hub device is not implemented.

    Known problems: with no devices connected usb_lowlevel_start() fails.

    Signed-off-by: Ilya Yanok

    Ilya Yanok
     
  • Signed-off-by: Ilya Yanok

    Ilya Yanok
     

05 Nov, 2012

4 commits

  • hack to avoid:

    /opt/gcc-4.6.3-nolibc/powerpc-linux/bin/../lib/gcc/powerpc-linux/4.6.3/include/stddef.h:413:9: warning: preprocessor token offsetof redefined
    u-boot/include/linux/stddef.h:20:9: this was the original definition

    tried protecting with __KERNEL__, and #including compiler.h first.

    Even tried include dir reordering to no avail:

    +++ b/config.mk
    @@ -194,7 +194,11 @@ OBJCFLAGS += --gap-fill=0xff
    gccincdir := $(shell $(CC) -print-file-name=include)

    CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS) \
    - -D__KERNEL__
    + -D__KERNEL__ \
    + -I $(gccincdir) \
    + -nostdinc
    +
    +# -isystem $(gccincdir) \

    # Enable garbage collection of un-used sections for SPL
    ifeq ($(CONFIG_SPL_BUILD),y)
    @@ -227,8 +231,7 @@ CPPFLAGS += -I$(OBJTREE)/include2 -I$(OBJTREE)/include
    endif

    CPPFLAGS += -I$(TOPDIR)/include
    -CPPFLAGS += -fno-builtin -ffreestanding -nostdinc \
    - -isystem $(gccincdir) -pipe $(PLATFORM_CPPFLAGS)
    +CPPFLAGS += -fno-builtin -ffreestanding -pipe $(PLATFORM_CPPFLAGS)

    Signed-off-by: Kim Phillips

    Kim Phillips
     
  • include/linux/unaligned/generic.h:5:9: warning: preprocessor token __force redefined
    include/linux/compiler.h:10:10: this was the original definition

    fixup __force definitions in compat.h code appears to be placed
    there as a cover up from a code import from linux when u-boot didn't yet
    have a compiler.h, introduced by commit
    b1b4e89a0f3b75854c39a62cae41bad56d210adf "Add LZO decompressor support".

    Signed-off-by: Kim Phillips

    Kim Phillips
     
  • include/linux/compat.h:4:9: warning: preprocessor token __user redefined
    include/linux/compiler.h:7:10: this was the original definition
    include/linux/compat.h:5:9: warning: preprocessor token __iomem redefined
    include/linux/compiler.h:12:10: this was the original definition

    fixup __iomem, __user definitions in compat.h code appears to be placed
    there as a cover up from a code import from linux when u-boot didn't yet
    have a compiler.h, introduced by commit
    932394ac43e2e778e664eeb6e456fecd0fae6e59 "Rewrite of NAND code based on
    what is in 2.6.12 Linux kernel".

    Signed-off-by: Kim Phillips

    Kim Phillips
     
  • u-boot's byteorder headers did not contain endianness attributions
    for use with sparse, causing a lot of false positives. Import the
    kernel's latest definitions, and enable them by including compiler.h
    and types.h. They come with 'const' added for some swab functions, so
    fix those up, too:

    include/linux/byteorder/big_endian.h:46:2: warning: passing argument 1 of '__swab64p' discards 'const' qualifier from pointer target type [enabled by default]

    Also, note: u-boot's historic __BYTE_ORDER definition has been
    preserved (for the time being at least).

    We also remove ad-hoc barrier() definitions, since we're including
    compiler.h in files that hadn't in the past:

    macb.c:54:0: warning: "barrier" redefined [enabled by default]

    In addition, including compiler.h in byteorder changes the 'noinline'
    definition to expand to __attribute__((noinline)). This fixes
    arch/powerpc/lib/bootm.c:

    bootm.c:329:16: error: attribute '__attribute__': unknown attribute
    bootm.c:329:16: error: expected ')' before '__attribute__'
    bootm.c:329:25: error: expected identifier or '(' before ')' token

    powerpc sparse builds yield:

    include/common.h:356:22: error: marked inline, but without a definition

    the unknown-reason inlining without a definition is considered obsolete
    given it was part of the 2002 initial commit, and no arm version was
    'fixed.'

    also fixed:
    ydirectenv.h:60:0: warning: "inline" redefined [enabled by default]

    and:

    Configuring for devconcenter - Board: intip, Options: DEVCONCENTER
    make[1]: *** [4xx_ibm_ddr2_autocalib.o] Error 1
    make: *** [arch/powerpc/cpu/ppc4xx/libppc4xx.o] Error 2
    powerpc-fsl-linux-size: './u-boot': No such file
    4xx_ibm_ddr2_autocalib.c: In function 'DQS_autocalibration':
    include/asm/ppc4xx-sdram.h:1407:13: sorry, unimplemented: inlining failed in call to 'ppc4xx_ibm_ddr2_register_dump': function body not available
    4xx_ibm_ddr2_autocalib.c:1243:32: sorry, unimplemented: called from here

    and:

    In file included from crc32.c:50:0:
    crc32table.h:4:1: warning: implicit declaration of function '___constant_swab32' [-Wimplicit-function-declaration]
    crc32table.h:4:1: error: initializer element is not constant
    crc32table.h:4:1: error: (near initialization for 'crc32table_le[0]')

    Signed-off-by: Kim Phillips
    [trini: Remove '#endif' in include/common.h around setenv portion]
    Signed-off-by: Tom Rini

    Kim Phillips
     

16 Oct, 2012

1 commit

  • Copied from Linux kernel:
    commit 8f7c2c37319a81ef4c2bfdec67b1ccd5744d97e4
    Date: Wed Apr 8 16:58:57 2009 +0800

    Pull in the __stringify() macro from Linux kernel. This macro is usually used to
    convert numbers to strings at preprocessor level, yet it is not limited only to
    that. This is useful as it allows higher usage of puts() in favour of printf().

    Signed-off-by: Marek Vasut
    Cc: Wolfgang Denk

    Marek Vasut
     

22 Sep, 2012

1 commit