09 Jan, 2015

1 commit

  • According to the UEFI Spec (Table 16, section 5.2.3 of the version 2.4 Errata
    B), the protective MBR partition record size must be set to the size of the
    disk minus one, in LBAs.

    However, the current code was setting the size as the total number of LBAs on
    the disk, resulting in an off-by-one error.

    This confused the AM335x ROM code, and will probably confuse other tools as
    well.

    Signed-off-by: Maxime Ripard

    Maxime Ripard
     

18 Dec, 2014

2 commits


27 Nov, 2014

1 commit


06 Jun, 2014

3 commits


13 May, 2014

1 commit


03 Apr, 2014

2 commits

  • Changes in lib/uuid.c to:
    - uuid_str_to_bin()
    - uuid_bin_to_str()

    New parameter is added to specify input/output string format in listed functions
    This change allows easy recognize which UUID type is or should be stored in given
    string array. Binary data of UUID and GUID is always stored in big endian, only
    string representations are different as follows.

    String byte: 0 36
    String char: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    string UUID: be be be be be
    string GUID: le le le be be

    This patch also updates functions calls and declarations in a whole code.

    Signed-off-by: Przemyslaw Marczak
    Cc: Stephen Warren
    Cc: Lukasz Majewski
    Cc: trini@ti.com

    Przemyslaw Marczak
     
  • This commit introduces cleanup for uuid library.
    Changes:
    - move uuidstring conversion functions into lib/uuid.c so they can be
    used by code outside part_efi.c.
    - rename uuid_string() to uuid_bin_to_str() for consistency with existing
    uuid_str_to_bin()
    - add an error return code to uuid_str_to_bin()
    - update existing code to the new library functions.

    Signed-off-by: Przemyslaw Marczak
    Cc: Stephen Warren
    Cc: Lukasz Majewski
    Cc: trini@ti.com

    Przemyslaw Marczak
     

24 Feb, 2014

1 commit

  • The calloc() call was allocating space for the sizeof the struct
    pointer rather than for the struct contents.
    Besides, since this buffer is passed to mmc for writing and some
    platforms may use cache, the legacy_mbr struct should be cache-aligned.

    Signed-off-by: Hector Palacios
    Tested-by: Lukasz Majewski

    Hector Palacios
     

20 Sep, 2013

1 commit

  • the gpt_pte wasn't being freed if it was checked against an invalid
    partition. The resulting memory leakage could make it impossible
    to repeatedly attempt to load non-existent files in a script.

    Also, downgrade the message for not finding an invalid partition
    from a printf() to a debug() so as to minimize message spam in
    perfectly normal situations.

    Signed-off-by: Mark Langsdorf

    Mark Langsdorf
     

24 Jul, 2013

1 commit


16 Jul, 2013

1 commit

  • With CONFIG_SYS_64BIT_LBA, lbaint_t gets defined as a 64-bit type,
    which is required to represent block numbers for storage devices that
    exceed 2TiB (the block size usually is 512B), e.g. recent hard drives

    We now use lbaint_t for partition offset to reflect the lbaint_t change,
    and access partitions beyond or crossing the 2.1TiB limit.
    This required changes to signature of ext4fs_devread(), and type of all
    variables relatives to block sector.

    ext2/ext4 fs uses logical block represented by a 32 bit value. Logical
    block is a multiple of device block sector. To avoid overflow problem
    when calling ext4fs_devread(), we need to cast the sector parameter.

    Signed-off-by: Frédéric Leroy

    Frederic Leroy
     

05 Jun, 2013

1 commit

  • Make sure to never access beyond bounds of either EFI partition name
    or DOS partition name. This situation is happening:

    part.h: disk_partition_t->name is 32-byte long
    part_efi.h: gpt_entry->partition_name is 36-bytes long

    The loop in part_efi.c copies over 36 bytes and thus accesses beyond
    the disk_partition_t->name .

    Fix this by picking the shortest of source and destination arrays and
    make sure the destination array is cleared so the trailing bytes are
    zeroed-out and don't cause issues with string manipulation.

    Signed-off-by: Marek Vasut
    Cc: Tom Rini
    Cc: Simon Glass

    Marek Vasut
     

02 May, 2013

1 commit


03 Apr, 2013

1 commit


15 Mar, 2013

1 commit


14 Dec, 2012

2 commits


22 Oct, 2012

1 commit


17 Oct, 2012

5 commits


26 Sep, 2012

2 commits


22 Jun, 2012

1 commit


07 Dec, 2011

1 commit

  • Fix errors noticed after enabling CONFIG_EFI_PARTITION
    for the OMAP3 EVM board:

    part_efi.c: In function 'print_part_efi':
    part_efi.c:133:5: warning: passing argument 3 of 'is_gpt_valid'
    from incompatible pointer type
    part_efi.c:95:12: note: expected 'struct gpt_header *' but arg
    ument is of type 'struct gpt_header **'
    part_efi.c: In function 'get_partition_info_efi':
    part_efi.c:173:4: warning: passing argument 3 of 'is_gpt_valid
    ' from incompatible pointer type
    part_efi.c:95:12: note: expected 'struct gpt_header *' but arg
    ument is of type 'struct gpt_header **'
    part_efi.c: In function 'alloc_read_gpt_entries':
    part_efi.c:384:18: error: 'CONFIG_SYS_CACHELINE_SIZE' undeclare
    d (first use in this function)

    Signed-off-by: Sanjeev Premi
    Cc: Tom Rini
    Cc: Anton staaf
    Signed-off-by: Sandeep Paulraj

    Sanjeev Premi
     

06 Dec, 2011

1 commit

  • Commit deb5ca80275e8cfa74d5680b41204e08a095eca5 "disk: part_efi: fix
    **pgpt_pte == NULL" modified the code to pass "&gpt_head" to
    is_gpt_valid() rather than the previous "gpt_head". However, gpt_head
    is a pointer to the buffer, not the actual buffer, since it was allocated
    using ALLOC_CACHE_ALIGN_BUFFER. This caused is_gpt_valid() to read the
    disk block onto the stack rather than into the buffer, causing the
    code to fail.

    This change reverts that portion of the commit mentioned above.

    Signed-off-by: Stephen Warren
    Acked-by: Doug Anderson
    Tested-by: Simon Glass
    Acked-by: Mike Frysinger
    Tested-by: Anton Staaf

    Stephen Warren
     

28 Oct, 2011

2 commits


25 Oct, 2011

1 commit

  • Currently part_efi.c allocates buffers for the gpt_header, the
    legacy_mbr, and the pte (partition table entry) that may be
    incorrectly aligned for DMA operations.

    This patch uses ALLOC_CACHE_ALIGN_BUFFER for the stack allocated
    buffers and memalign to replace the malloc of the pte.

    Signed-off-by: Anton Staaf
    Cc: Lukasz Majewski
    Cc: Mike Frysinger
    Cc: Albert ARIBAUD
    Acked-by: Mike Frysinger

    Anton staaf
     

07 Oct, 2011

1 commit

  • Previous output:
    Marvell>> mmc part

    Partition Map for MMC device 1 -- Partition Type: EFI

    Part Start LBA End LBA
    gpt1 0x8C00 0xCBFF
    gpt2 0xCC00 0x57BFF
    gpt3 0x57C00 0xA2BFF
    gpt4 0xA2C00 0xECBFDE

    With the patch, the output becomes:
    Marvell>> mmc part

    Partition Map for MMC device 1 -- Partition Type: EFI

    Part Name Start LBA End LBA
    1 ramdisk 0x00008C00 0x0000CBFF
    2 system 0x0000CC00 0x00057BFF
    3 userdata 0x00057C00 0x000A2BFF
    4 remaining 0x000A2C00 0x00ECBFDE

    Signed-off-by: Lei Wen

    Lei Wen
     

10 Aug, 2009

1 commit


04 Apr, 2009

1 commit

  • Mflash is fusion memory device mainly targeted consumer eletronic and
    mobile phone.
    Internally, it have nand flash and other hardware logics and supports
    some different operation (ATA, IO, XIP) modes.

    IO mode is custom mode for the host that doesn't have IDE interface.
    (Many mobile targeted SoC doesn't have IDE bus)

    This driver support mflash IO mode.

    Followings are brief descriptions about IO mode.

    1. IO mode based on ATA protocol and uses some custom command. (read
    confirm, write confirm)
    2. IO mode uses SRAM bus interface.

    Signed-off-by: unsik Kim

    unsik Kim
     

18 Feb, 2009

1 commit


28 Jan, 2009

1 commit


19 Oct, 2008

1 commit