]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Merge branch 'master' of git://git.denx.de/u-boot-arm
authorTom Rini <trini@ti.com>
Sat, 22 Jun 2013 11:38:12 +0000 (07:38 -0400)
committerTom Rini <trini@ti.com>
Sat, 22 Jun 2013 11:38:12 +0000 (07:38 -0400)
1  2 
Makefile
board/ti/am335x/board.c
drivers/mmc/mmc.c
drivers/mtd/spi/spi_flash.c
include/configs/am335x_evm.h
include/configs/exynos5250-dt.h
include/fdtdec.h
include/mmc.h
lib/fdtdec.c

diff --combined Makefile
index 693b3f27646621e353e4a52a96f768d70de4d5db,b1e5d5f52ea9dcca2e6751df9d7c0f851784469e..fdaddb93936bc0e4134d1c309ffeb4aae9b7554e
+++ b/Makefile
@@@ -22,9 -22,9 +22,9 @@@
  #
  
  VERSION = 2013
 -PATCHLEVEL = 04
 +PATCHLEVEL = 07
  SUBLEVEL =
 -EXTRAVERSION =
 +EXTRAVERSION = -rc1
  ifneq "$(SUBLEVEL)" ""
  U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
  else
@@@ -743,6 -743,13 +743,13 @@@ tools: $(VERSION_FILE) $(TIMESTAMP_FILE
        $(MAKE) -C $@ all
  endif # config.mk
  
+ # ARM relocations should all be R_ARM_RELATIVE.
+ checkarmreloc: $(obj)u-boot
+       @if test "R_ARM_RELATIVE" != \
+               "`readelf -r $< | cut -d ' ' -f 4 | grep R_ARM | sort -u`"; \
+               then echo "$< contains relocations other than \
+               R_ARM_RELATIVE"; false; fi
  $(VERSION_FILE):
                @mkdir -p $(dir $(VERSION_FILE))
                @( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \
diff --combined board/ti/am335x/board.c
index 638cc4d68b2ad5238443c6c180f378e66278b826,fb98df0f847e5235cb05bd23df52857f3a724323..fdbe26cde116b81e0bf7e1c41d233cd3d36e5f87
@@@ -38,9 -38,6 +38,6 @@@
  DECLARE_GLOBAL_DATA_PTR;
  
  static struct wd_timer *wdtimer = (struct wd_timer *)WDT_BASE;
- #ifdef CONFIG_SPL_BUILD
- static struct uart_sys *uart_base = (struct uart_sys *)DEFAULT_UART_BASE;
- #endif
  
  /* MII mode defines */
  #define MII_MODE_ENABLE               0x0
@@@ -126,28 -123,7 +123,7 @@@ static int read_eeprom(void
        return 0;
  }
  
- /* UART Defines */
  #ifdef CONFIG_SPL_BUILD
- #define UART_RESET            (0x1 << 1)
- #define UART_CLK_RUNNING_MASK 0x1
- #define UART_SMART_IDLE_EN    (0x1 << 0x3)
- static void rtc32k_enable(void)
- {
-       struct rtc_regs *rtc = (struct rtc_regs *)RTC_BASE;
-       /*
-        * Unlock the RTC's registers.  For more details please see the
-        * RTC_SS section of the TRM.  In order to unlock we need to
-        * write these specific values (keys) in this order.
-        */
-       writel(0x83e70b13, &rtc->kick0r);
-       writel(0x95a4f1e0, &rtc->kick1r);
-       /* Enable the RTC 32K OSC by setting bits 3 and 6. */
-       writel((1 << 3) | (1 << 6), &rtc->osc);
- }
  static const struct ddr_data ddr2_data = {
        .datardsratio0 = ((MT47H128M16RT25E_RD_DQS<<30) |
                          (MT47H128M16RT25E_RD_DQS<<20) |
@@@ -297,15 -273,6 +273,15 @@@ static struct emif_regs ddr3_evm_emif_r
        .emif_ddr_phy_ctlr_1 = MT41J512M8RH125_EMIF_READ_LATENCY |
                                PHY_EN_DYN_PWRDN,
  };
 +
 +#ifdef CONFIG_SPL_OS_BOOT
 +int spl_start_uboot(void)
 +{
 +      /* break into full u-boot on 'c' */
 +      return (serial_tstc() && serial_getc() == 'c');
 +}
 +#endif
 +
  #endif
  
  /*
@@@ -339,9 -306,6 +315,6 @@@ void s_init(void
        /* Enable RTC32K clock */
        rtc32k_enable();
  
-       /* UART softreset */
-       u32 regVal;
  #ifdef CONFIG_SERIAL1
        enable_uart0_pin_mux();
  #endif /* CONFIG_SERIAL1 */
        enable_uart5_pin_mux();
  #endif /* CONFIG_SERIAL6 */
  
-       regVal = readl(&uart_base->uartsyscfg);
-       regVal |= UART_RESET;
-       writel(regVal, &uart_base->uartsyscfg);
-       while ((readl(&uart_base->uartsyssts) &
-               UART_CLK_RUNNING_MASK) != UART_CLK_RUNNING_MASK)
-               ;
-       /* Disable smart idle */
-       regVal = readl(&uart_base->uartsyscfg);
-       regVal |= UART_SMART_IDLE_EN;
-       writel(regVal, &uart_base->uartsyscfg);
+       uart_soft_reset();
  
        gd = &gdata;
  
diff --combined drivers/mmc/mmc.c
index e6a296a5762c939736d47aed83529f113c983635,a492bbb41f5faef7b0d6369de605a8bc5d163d91..83d2df7744465678d6f161b26d4d976251b77252
@@@ -301,12 -301,10 +301,12 @@@ mmc_write_blocks(struct mmc *mmc, ulon
                return 0;
        }
  
 -      if (blkcnt > 1)
 -              cmd.cmdidx = MMC_CMD_WRITE_MULTIPLE_BLOCK;
 -      else
 +      if (blkcnt == 0)
 +              return 0;
 +      else if (blkcnt == 1)
                cmd.cmdidx = MMC_CMD_WRITE_SINGLE_BLOCK;
 +      else
 +              cmd.cmdidx = MMC_CMD_WRITE_MULTIPLE_BLOCK;
  
        if (mmc->high_capacity)
                cmd.cmdarg = start;
@@@ -702,49 -700,16 +702,49 @@@ static int mmc_change_freq(struct mmc *
        return 0;
  }
  
 +static int mmc_set_capacity(struct mmc *mmc, int part_num)
 +{
 +      switch (part_num) {
 +      case 0:
 +              mmc->capacity = mmc->capacity_user;
 +              break;
 +      case 1:
 +      case 2:
 +              mmc->capacity = mmc->capacity_boot;
 +              break;
 +      case 3:
 +              mmc->capacity = mmc->capacity_rpmb;
 +              break;
 +      case 4:
 +      case 5:
 +      case 6:
 +      case 7:
 +              mmc->capacity = mmc->capacity_gp[part_num - 4];
 +              break;
 +      default:
 +              return -1;
 +      }
 +
 +      mmc->block_dev.lba = lldiv(mmc->capacity, mmc->read_bl_len);
 +
 +      return 0;
 +}
 +
  int mmc_switch_part(int dev_num, unsigned int part_num)
  {
        struct mmc *mmc = find_mmc_device(dev_num);
 +      int ret;
  
        if (!mmc)
                return -1;
  
 -      return mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
 -                        (mmc->part_config & ~PART_ACCESS_MASK)
 -                        | (part_num & PART_ACCESS_MASK));
 +      ret = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
 +                       (mmc->part_config & ~PART_ACCESS_MASK)
 +                       | (part_num & PART_ACCESS_MASK));
 +      if (ret)
 +              return ret;
 +
 +      return mmc_set_capacity(mmc, part_num);
  }
  
  int mmc_getcd(struct mmc *mmc)
@@@ -952,7 -917,7 +952,7 @@@ static void mmc_set_bus_width(struct mm
  
  static int mmc_startup(struct mmc *mmc)
  {
 -      int err;
 +      int err, i;
        uint mult, freq;
        u64 cmult, csize, capacity;
        struct mmc_cmd cmd;
                cmult = (mmc->csd[2] & 0x00038000) >> 15;
        }
  
 -      mmc->capacity = (csize + 1) << (cmult + 2);
 -      mmc->capacity *= mmc->read_bl_len;
 +      mmc->capacity_user = (csize + 1) << (cmult + 2);
 +      mmc->capacity_user *= mmc->read_bl_len;
 +      mmc->capacity_boot = 0;
 +      mmc->capacity_rpmb = 0;
 +      for (i = 0; i < 4; i++)
 +              mmc->capacity_gp[i] = 0;
  
        if (mmc->read_bl_len > MMC_MAX_BLOCK_LEN)
                mmc->read_bl_len = MMC_MAX_BLOCK_LEN;
                                        | ext_csd[EXT_CSD_SEC_CNT + 3] << 24;
                        capacity *= MMC_MAX_BLOCK_LEN;
                        if ((capacity >> 20) > 2 * 1024)
 -                              mmc->capacity = capacity;
 +                              mmc->capacity_user = capacity;
                }
  
                switch (ext_csd[EXT_CSD_REV]) {
                if ((ext_csd[EXT_CSD_PARTITIONING_SUPPORT] & PART_SUPPORT) ||
                    ext_csd[EXT_CSD_BOOT_MULT])
                        mmc->part_config = ext_csd[EXT_CSD_PART_CONF];
 +
 +              mmc->capacity_boot = ext_csd[EXT_CSD_BOOT_MULT] << 17;
 +
 +              mmc->capacity_rpmb = ext_csd[EXT_CSD_RPMB_MULT] << 17;
 +
 +              for (i = 0; i < 4; i++) {
 +                      int idx = EXT_CSD_GP_SIZE_MULT + i * 3;
 +                      mmc->capacity_gp[i] = (ext_csd[idx + 2] << 16) +
 +                              (ext_csd[idx + 1] << 8) + ext_csd[idx];
 +                      mmc->capacity_gp[i] *=
 +                              ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE];
 +                      mmc->capacity_gp[i] *= ext_csd[EXT_CSD_HC_WP_GRP_SIZE];
 +              }
        }
  
 +      err = mmc_set_capacity(mmc, mmc->part_num);
 +      if (err)
 +              return err;
 +
        if (IS_SD(mmc))
                err = sd_change_freq(mmc);
        else
@@@ -1503,3 -1447,137 +1503,137 @@@ int mmc_initialize(bd_t *bis
        do_preinit();
        return 0;
  }
+ #ifdef CONFIG_SUPPORT_EMMC_BOOT
+ /*
+  * This function changes the size of boot partition and the size of rpmb
+  * partition present on EMMC devices.
+  *
+  * Input Parameters:
+  * struct *mmc: pointer for the mmc device strcuture
+  * bootsize: size of boot partition
+  * rpmbsize: size of rpmb partition
+  *
+  * Returns 0 on success.
+  */
+ int mmc_boot_partition_size_change(struct mmc *mmc, unsigned long bootsize,
+                               unsigned long rpmbsize)
+ {
+       int err;
+       struct mmc_cmd cmd;
+       /* Only use this command for raw EMMC moviNAND. Enter backdoor mode */
+       cmd.cmdidx = MMC_CMD_RES_MAN;
+       cmd.resp_type = MMC_RSP_R1b;
+       cmd.cmdarg = MMC_CMD62_ARG1;
+       err = mmc_send_cmd(mmc, &cmd, NULL);
+       if (err) {
+               debug("mmc_boot_partition_size_change: Error1 = %d\n", err);
+               return err;
+       }
+       /* Boot partition changing mode */
+       cmd.cmdidx = MMC_CMD_RES_MAN;
+       cmd.resp_type = MMC_RSP_R1b;
+       cmd.cmdarg = MMC_CMD62_ARG2;
+       err = mmc_send_cmd(mmc, &cmd, NULL);
+       if (err) {
+               debug("mmc_boot_partition_size_change: Error2 = %d\n", err);
+               return err;
+       }
+       /* boot partition size is multiple of 128KB */
+       bootsize = (bootsize * 1024) / 128;
+       /* Arg: boot partition size */
+       cmd.cmdidx = MMC_CMD_RES_MAN;
+       cmd.resp_type = MMC_RSP_R1b;
+       cmd.cmdarg = bootsize;
+       err = mmc_send_cmd(mmc, &cmd, NULL);
+       if (err) {
+               debug("mmc_boot_partition_size_change: Error3 = %d\n", err);
+               return err;
+       }
+       /* RPMB partition size is multiple of 128KB */
+       rpmbsize = (rpmbsize * 1024) / 128;
+       /* Arg: RPMB partition size */
+       cmd.cmdidx = MMC_CMD_RES_MAN;
+       cmd.resp_type = MMC_RSP_R1b;
+       cmd.cmdarg = rpmbsize;
+       err = mmc_send_cmd(mmc, &cmd, NULL);
+       if (err) {
+               debug("mmc_boot_partition_size_change: Error4 = %d\n", err);
+               return err;
+       }
+       return 0;
+ }
+ /*
+  * This function shall form and send the commands to open / close the
+  * boot partition specified by user.
+  *
+  * Input Parameters:
+  * ack: 0x0 - No boot acknowledge sent (default)
+  *    0x1 - Boot acknowledge sent during boot operation
+  * part_num: User selects boot data that will be sent to master
+  *    0x0 - Device not boot enabled (default)
+  *    0x1 - Boot partition 1 enabled for boot
+  *    0x2 - Boot partition 2 enabled for boot
+  * access: User selects partitions to access
+  *    0x0 : No access to boot partition (default)
+  *    0x1 : R/W boot partition 1
+  *    0x2 : R/W boot partition 2
+  *    0x3 : R/W Replay Protected Memory Block (RPMB)
+  *
+  * Returns 0 on success.
+  */
+ int mmc_boot_part_access(struct mmc *mmc, u8 ack, u8 part_num, u8 access)
+ {
+       int err;
+       struct mmc_cmd cmd;
+       /* Boot ack enable, boot partition enable , boot partition access */
+       cmd.cmdidx = MMC_CMD_SWITCH;
+       cmd.resp_type = MMC_RSP_R1b;
+       cmd.cmdarg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) |
+                       (EXT_CSD_PART_CONF << 16) |
+                       ((EXT_CSD_BOOT_ACK(ack) |
+                       EXT_CSD_BOOT_PART_NUM(part_num) |
+                       EXT_CSD_PARTITION_ACCESS(access)) << 8);
+       err = mmc_send_cmd(mmc, &cmd, NULL);
+       if (err) {
+               if (access) {
+                       debug("mmc boot partition#%d open fail:Error1 = %d\n",
+                             part_num, err);
+               } else {
+                       debug("mmc boot partition#%d close fail:Error = %d\n",
+                             part_num, err);
+               }
+               return err;
+       }
+       if (access) {
+               /* 4bit transfer mode at booting time. */
+               cmd.cmdidx = MMC_CMD_SWITCH;
+               cmd.resp_type = MMC_RSP_R1b;
+               cmd.cmdarg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) |
+                               (EXT_CSD_BOOT_BUS_WIDTH << 16) |
+                               ((1 << 0) << 8);
+               err = mmc_send_cmd(mmc, &cmd, NULL);
+               if (err) {
+                       debug("mmc boot partition#%d open fail:Error2 = %d\n",
+                             part_num, err);
+                       return err;
+               }
+       }
+       return 0;
+ }
+ #endif
index 0e38f594819073f91ee6bcaa3215c64fd46233ff,6507aa34bb4e82de466fa04eca7e6e303b22fedd..9991d47a468e0a07f323213de933c793f5257632
@@@ -124,6 -124,9 +124,6 @@@ int spi_flash_cmd_write_multi(struct sp
                }
        }
  
 -      debug("SF: program %s %zu bytes @ %#x\n",
 -            ret ? "failure" : "success", len, offset);
 -
        spi_release_bus(flash->spi);
        return ret;
  }
@@@ -147,10 -150,8 +147,10 @@@ int spi_flash_cmd_read_fast(struct spi_
        u8 cmd[5];
  
        /* Handle memory-mapped SPI */
 -      if (flash->memory_map)
 +      if (flash->memory_map) {
                memcpy(data, flash->memory_map + offset, len);
 +              return 0;
 +      }
  
        cmd[0] = CMD_READ_ARRAY_FAST;
        spi_flash_addr(offset, cmd);
@@@ -204,7 -205,7 +204,7 @@@ int spi_flash_cmd_wait_ready(struct spi
  
  int spi_flash_cmd_erase(struct spi_flash *flash, u32 offset, size_t len)
  {
 -      u32 start, end, erase_size;
 +      u32 end, erase_size;
        int ret;
        u8 cmd[4];
  
                cmd[0] = CMD_ERASE_4K;
        else
                cmd[0] = CMD_ERASE_64K;
 -      start = offset;
 -      end = start + len;
 +      end = offset + len;
  
        while (offset < end) {
                spi_flash_addr(offset, cmd);
                        goto out;
        }
  
 -      debug("SF: Successfully erased %zu bytes @ %#x\n", len, start);
 -
   out:
        spi_release_bus(flash->spi);
        return ret;
@@@ -342,6 -346,9 +342,9 @@@ static const struct 
  #ifdef CONFIG_SPI_FLASH_EON
        { 0, 0x1c, spi_flash_probe_eon, },
  #endif
+ #ifdef CONFIG_SPI_FLASH_GIGADEVICE
+       { 0, 0xc8, spi_flash_probe_gigadevice, },
+ #endif
  #ifdef CONFIG_SPI_FLASH_MACRONIX
        { 0, 0xc2, spi_flash_probe_macronix, },
  #endif
index d1246f7c73836fe0d6a714650b8b3d93998e1676,7cc3ef24acc30717e2252cb442dd5bd3e755ccb1..9c3c2cd56717d3c3b463892d344800ee03e8cf1c
@@@ -60,7 -60,7 +60,7 @@@
        "rdaddr=0x81000000\0" \
        "bootdir=/boot\0" \
        "bootfile=uImage\0" \
-       "fdtfile=\0" \
+       "fdtfile=undefined\0" \
        "console=ttyO0,115200n8\0" \
        "optargs=\0" \
        "mtdids=" MTDIDS_DEFAULT "\0" \
                "if test $board_name = A33515BB; then " \
                        "setenv fdtfile am335x-evm.dtb; fi; " \
                "if test $board_name = A335X_SK; then " \
-                       "setenv fdtfile am335x-evmsk.dtb; fi\0" \
+                       "setenv fdtfile am335x-evmsk.dtb; fi " \
+               "if test $fdtfile = undefined; then " \
+                       "echo WARNING: Could not determine device tree to use; fi; \0"
  #endif
  
  #define CONFIG_BOOTCOMMAND \
  #define CONFIG_SPL
  #define CONFIG_SPL_FRAMEWORK
  /*
 - * Place the image at the start of the ROM defined image space and leave
 - * space for SRAM scratch entries (see arch/arm/include/omap_common.h).
 + * Place the image at the start of the ROM defined image space.
   * We limit our size to the ROM-defined downloaded image area, and use the
   * rest of the space for stack.
   */
 -#define CONFIG_SPL_TEXT_BASE          0x402F0500
 +#define CONFIG_SPL_TEXT_BASE          0x402F0400
  #define CONFIG_SPL_MAX_SIZE           (0x4030C000 - CONFIG_SPL_TEXT_BASE)
  #define CONFIG_SPL_STACK              CONFIG_SYS_INIT_SP_ADDR
  
 -#define CONFIG_SPL_BSS_START_ADDR     0x80000000
 +#define CONFIG_SPL_OS_BOOT
 +
 +#define CONFIG_SPL_BSS_START_ADDR     0x80a00000
  #define CONFIG_SPL_BSS_MAX_SIZE               0x80000         /* 512 KB */
  
  #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR       0x300 /* address 0x60000 */
  #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS    0x200 /* 256 KB */
  #define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION  1
  #define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME      "u-boot.img"
 +
 +#ifdef CONFIG_SPL_OS_BOOT
 +/* fat */
 +#define CONFIG_SPL_FAT_LOAD_KERNEL_NAME               "uImage"
 +#define CONFIG_SPL_FAT_LOAD_ARGS_NAME         "args"
 +#define CONFIG_SYS_SPL_ARGS_ADDR              (PHYS_DRAM_1 + 0x100)
 +
 +/* raw mmc */
 +#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR       0x500 /* address 0xa0000 */
 +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x8   /* address 0x1000 */
 +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS        8     /* 4KB */
 +
 +/* nand */
 +#define CONFIG_CMD_SPL_NAND_OFS                       0x240000 /* end of u-boot */
 +#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS               0x280000
 +#define CONFIG_CMD_SPL_WRITE_SIZE             0x1000
 +
 +/* spl export command */
 +#define CONFIG_CMD_SPL
 +#endif
 +
  #define CONFIG_SPL_MMC_SUPPORT
  #define CONFIG_SPL_FAT_SUPPORT
  #define CONFIG_SPL_I2C_SUPPORT
  #define CONFIG_SPL_GPIO_SUPPORT
  #define CONFIG_SPL_YMODEM_SUPPORT
  #define CONFIG_SPL_NET_SUPPORT
 +#define CONFIG_SPL_ENV_SUPPORT
  #define CONFIG_SPL_NET_VCI_STRING     "AM335x U-Boot SPL"
  #define CONFIG_SPL_ETH_SUPPORT
  #define CONFIG_SPL_SPI_SUPPORT
   * other needs.
   */
  #define CONFIG_SYS_TEXT_BASE          0x80800000
 -#define CONFIG_SYS_SPL_MALLOC_START   0x80208000
 +#define CONFIG_SYS_SPL_MALLOC_START   0x80a08000
  #define CONFIG_SYS_SPL_MALLOC_SIZE    0x100000
  
  /* Since SPL did pll and ddr initialization for us,
  #define MTDPARTS_DEFAULT              "mtdparts=omap2-nand.0:128k(SPL)," \
                                        "128k(SPL.backup1)," \
                                        "128k(SPL.backup2)," \
 -                                      "128k(SPL.backup3),1920k(u-boot)," \
 +                                      "128k(SPL.backup3),1792k(u-boot)," \
 +                                      "128k(u-boot-spl-os)," \
                                        "128k(u-boot-env),5m(kernel),-(rootfs)"
  #define CONFIG_NAND_OMAP_GPMC
  #define GPMC_NAND_ECC_LP_x16_LAYOUT   1
index 41d6cf9d15f7fd50ad3f087244bea6f6d23f57e8,9b97d4fb04b86c7db32a55f8bb37018e15dd4494..163243572f745303b6d2ce9d1729456d975e4b46
  #define CONFIG_EXTRA_ENV_SETTINGS \
        EXYNOS_DEVICE_SETTINGS
  
- #define TZPC_BASE_OFFSET              0x10000
  /* SD/MMC configuration */
  #define CONFIG_GENERIC_MMC
  #define CONFIG_MMC
  #define CONFIG_SDHCI
  #define CONFIG_S5P_SDHCI
+ #define CONFIG_DWMMC
+ #define CONFIG_EXYNOS_DWMMC
+ #define CONFIG_SUPPORT_EMMC_BOOT
  
  #define CONFIG_BOARD_EARLY_INIT_F
  
  /* TPM */
  #define CONFIG_TPM
  #define CONFIG_CMD_TPM
 -#define CONFIG_INFINEON_TPM_I2C
 -#define CONFIG_INFINEON_TPM_I2C_BUS 3
 -#define CONFIG_INFINEON_TPM_I2C_ADDR 0x20
 +#define CONFIG_TPM_TIS_I2C
 +#define CONFIG_TPM_TIS_I2C_BUS_NUMBER 3
 +#define CONFIG_TPM_TIS_I2C_SLAVE_ADDR 0x20
  
  /* MMC SPL */
  #define CONFIG_SPL
  #define SPI_FLASH_UBOOT_POS           (CONFIG_SEC_FW_SIZE + CONFIG_BL1_SIZE)
  
  #define CONFIG_DOS_PARTITION
+ #define CONFIG_EFI_PARTITION
+ #define CONFIG_CMD_PART
+ #define CONFIG_PARTITION_UUIDS
  
  #define CONFIG_IRAM_STACK     0x02050000
  
  #define CONFIG_CMD_SF
  #define CONFIG_CMD_SPI
  #define CONFIG_SPI_FLASH_WINBOND
+ #define CONFIG_SPI_FLASH_GIGADEVICE
  #define CONFIG_SF_DEFAULT_MODE                SPI_MODE_0
  #define CONFIG_SF_DEFAULT_SPEED               50000000
  #define EXYNOS5_SPI_NUM_CONTROLLERS   5
diff --combined include/fdtdec.h
index 1ece6122f5dfa1e0db21b2e4809267b780db1678,bc3b89bc0fdaa6cd1afc85e1331491f7058aceba..8845e294b91e0e1efdf05cd0b9305d4e019908c6
@@@ -89,11 -89,11 +89,12 @@@ enum fdt_compat_id 
        COMPAT_SAMSUNG_EXYNOS_TMU,      /* Exynos TMU */
        COMPAT_SAMSUNG_EXYNOS_FIMD,     /* Exynos Display controller */
        COMPAT_SAMSUNG_EXYNOS5_DP,      /* Exynos Display port controller */
+       COMPAT_SAMSUNG_EXYNOS5_DWMMC,   /* Exynos5 DWMMC controller */
        COMPAT_MAXIM_MAX77686_PMIC,     /* MAX77686 PMIC */
        COMPAT_GENERIC_SPI_FLASH,       /* Generic SPI Flash chip */
        COMPAT_MAXIM_98095_CODEC,       /* MAX98095 Codec */
        COMPAT_INFINEON_SLB9635_TPM,    /* Infineon SLB9635 TPM */
 +      COMPAT_INFINEON_SLB9645_TPM,    /* Infineon SLB9645 TPM */
  
        COMPAT_COUNT,
  };
diff --combined include/mmc.h
index ea198d87b7a3228d8310c49d90f18004e3ac0565,f88f672f111fee172e655167b0284e5b7521774d..583c30e270fa1c4af7af70c089143a8494cdbb78
  #define MMC_CMD_APP_CMD                       55
  #define MMC_CMD_SPI_READ_OCR          58
  #define MMC_CMD_SPI_CRC_ON_OFF                59
+ #define MMC_CMD_RES_MAN                       62
+ #define MMC_CMD62_ARG1                        0xefac62ec
+ #define MMC_CMD62_ARG2                        0xcbaea7
  
  #define SD_CMD_SEND_RELATIVE_ADDR     3
  #define SD_CMD_SWITCH_FUNC            6
  /*
   * EXT_CSD fields
   */
 +#define EXT_CSD_GP_SIZE_MULT          143     /* R/W */
  #define EXT_CSD_PARTITIONING_SUPPORT  160     /* RO */
 +#define EXT_CSD_RPMB_MULT             168     /* RO */
  #define EXT_CSD_ERASE_GROUP_DEF               175     /* R/W */
+ #define EXT_CSD_BOOT_BUS_WIDTH                177
  #define EXT_CSD_PART_CONF             179     /* R/W */
  #define EXT_CSD_BUS_WIDTH             183     /* R/W */
  #define EXT_CSD_HS_TIMING             185     /* R/W */
  #define EXT_CSD_REV                   192     /* RO */
  #define EXT_CSD_CARD_TYPE             196     /* RO */
  #define EXT_CSD_SEC_CNT                       212     /* RO, 4 bytes */
 +#define EXT_CSD_HC_WP_GRP_SIZE                221     /* RO */
  #define EXT_CSD_HC_ERASE_GRP_SIZE     224     /* RO */
  #define EXT_CSD_BOOT_MULT             226     /* RO */
  
  #define EXT_CSD_BUS_WIDTH_4   1       /* Card is in 4 bit mode */
  #define EXT_CSD_BUS_WIDTH_8   2       /* Card is in 8 bit mode */
  
+ #define EXT_CSD_BOOT_ACK_ENABLE                       (1 << 6)
+ #define EXT_CSD_BOOT_PARTITION_ENABLE         (1 << 3)
+ #define EXT_CSD_PARTITION_ACCESS_ENABLE               (1 << 0)
+ #define EXT_CSD_PARTITION_ACCESS_DISABLE      (0 << 0)
+ #define EXT_CSD_BOOT_ACK(x)           (x << 6)
+ #define EXT_CSD_BOOT_PART_NUM(x)      (x << 3)
+ #define EXT_CSD_PARTITION_ACCESS(x)   (x << 0)
  #define R1_ILLEGAL_COMMAND            (1 << 22)
  #define R1_APP_CMD                    (1 << 5)
  
  /* Maximum block size for MMC */
  #define MMC_MAX_BLOCK_LEN     512
  
+ /* The number of MMC physical partitions.  These consist of:
+  * boot partitions (2), general purpose partitions (4) in MMC v4.4.
+  */
+ #define MMC_NUM_BOOT_PARTITION        2
  struct mmc_cid {
        unsigned long psn;
        unsigned short oid;
@@@ -266,10 -284,6 +287,10 @@@ struct mmc 
        uint write_bl_len;
        uint erase_grp_size;
        u64 capacity;
 +      u64 capacity_user;
 +      u64 capacity_boot;
 +      u64 capacity_rpmb;
 +      u64 capacity_gp[4];
        block_dev_desc_t block_dev;
        int (*send_cmd)(struct mmc *mmc,
                        struct mmc_cmd *cmd, struct mmc_data *data);
@@@ -298,6 -312,11 +319,11 @@@ int mmc_switch_part(int dev_num, unsign
  int mmc_getcd(struct mmc *mmc);
  int mmc_getwp(struct mmc *mmc);
  void spl_mmc_load(void) __noreturn;
+ /* Function to change the size of boot partition and rpmb partitions */
+ int mmc_boot_partition_size_change(struct mmc *mmc, unsigned long bootsize,
+                                       unsigned long rpmbsize);
+ /* Function to send commands to open/close the specified boot partition */
+ int mmc_boot_part_access(struct mmc *mmc, u8 ack, u8 part_num, u8 access);
  
  /**
   * Start device initialization and return immediately; it does not block on
diff --combined lib/fdtdec.c
index 005ad3d535fbdc32211bd93757858bfce26c411d,e3142cbdfe55a8950889b77d2a2f857d20203a1b..ad25a0c9c929627b43e10761d42d679e07e05b77
@@@ -62,11 -62,11 +62,12 @@@ static const char * const compat_names[
        COMPAT(SAMSUNG_EXYNOS_TMU, "samsung,exynos-tmu"),
        COMPAT(SAMSUNG_EXYNOS_FIMD, "samsung,exynos-fimd"),
        COMPAT(SAMSUNG_EXYNOS5_DP, "samsung,exynos5-dp"),
+       COMPAT(SAMSUNG_EXYNOS5_DWMMC, "samsung,exynos5250-dwmmc"),
        COMPAT(MAXIM_MAX77686_PMIC, "maxim,max77686_pmic"),
        COMPAT(GENERIC_SPI_FLASH, "spi-flash"),
        COMPAT(MAXIM_98095_CODEC, "maxim,max98095-codec"),
        COMPAT(INFINEON_SLB9635_TPM, "infineon,slb9635-tpm"),
 +      COMPAT(INFINEON_SLB9645_TPM, "infineon,slb9645-tpm"),
  };
  
  const char *fdtdec_get_compatible(enum fdt_compat_id id)