]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
Merge git://git.denx.de/u-boot-dm
authorTom Rini <trini@konsulko.com>
Mon, 14 Mar 2016 23:21:44 +0000 (19:21 -0400)
committerTom Rini <trini@konsulko.com>
Mon, 14 Mar 2016 23:21:44 +0000 (19:21 -0400)
1  2 
cmd/disk.c
common/spl/spl_mmc.c
include/common.h
include/configs/UCP1020.h
include/configs/sandbox.h
include/spl.h

diff --combined cmd/disk.c
index 106f2d1a3b50a17c562a64e334987f2096beacce,e0219f810e381d0dcd6584903b787ec7d38a80c1..2fd1717e6a44680107f2c242ab29855a9baaad41
@@@ -20,9 -20,9 +20,9 @@@ int common_diskboot(cmd_tbl_t *cmdtp, c
  #if defined(CONFIG_IMAGE_FORMAT_LEGACY)
        image_header_t *hdr;
  #endif
-       block_dev_desc_t *dev_desc;
+       struct blk_desc *dev_desc;
  
 -#if defined(CONFIG_FIT)
 +#if CONFIG_IS_ENABLED(FIT)
        const void *fit_hdr = NULL;
  #endif
  
  
        bootstage_mark(BOOTSTAGE_ID_IDE_BOOT_DEVICE);
  
-       part = get_device_and_partition(intf, (argc == 3) ? argv[2] : NULL,
+       part = blk_get_device_part_str(intf, (argc == 3) ? argv[2] : NULL,
                                        &dev_desc, &info, 1);
        if (part < 0) {
                bootstage_error(BOOTSTAGE_ID_IDE_TYPE);
                return 1;
        }
  
-       dev = dev_desc->dev;
+       dev = dev_desc->devnum;
        bootstage_mark(BOOTSTAGE_ID_IDE_TYPE);
  
        printf("\nLoading from %s device %d, partition %d: "
@@@ -56,7 -56,7 +56,7 @@@
              ", Block Size: %ld\n",
              info.start, info.size, info.blksz);
  
-       if (dev_desc->block_read(dev_desc, info.start, 1, (ulong *)addr) != 1) {
+       if (blk_dread(dev_desc, info.start, 1, (ulong *)addr) != 1) {
                printf("** Read error on %d:%d\n", dev, part);
                bootstage_error(BOOTSTAGE_ID_IDE_PART_READ);
                return 1;
@@@ -82,7 -82,7 +82,7 @@@
                cnt = image_get_image_size(hdr);
                break;
  #endif
 -#if defined(CONFIG_FIT)
 +#if CONFIG_IS_ENABLED(FIT)
        case IMAGE_FORMAT_FIT:
                fit_hdr = (const void *) addr;
                puts("Fit image detected...\n");
        cnt /= info.blksz;
        cnt -= 1;
  
-       if (dev_desc->block_read(dev_desc, info.start + 1, cnt,
-                                (ulong *)(addr + info.blksz)) != cnt) {
+       if (blk_dread(dev_desc, info.start + 1, cnt,
+                     (ulong *)(addr + info.blksz)) != cnt) {
                printf("** Read error on %d:%d\n", dev, part);
                bootstage_error(BOOTSTAGE_ID_IDE_READ);
                return 1;
        }
        bootstage_mark(BOOTSTAGE_ID_IDE_READ);
  
 -#if defined(CONFIG_FIT)
 +#if CONFIG_IS_ENABLED(FIT)
        /* This cannot be done earlier,
         * we need complete FIT image in RAM first */
        if (genimg_get_format((void *) addr) == IMAGE_FORMAT_FIT) {
diff --combined common/spl/spl_mmc.c
index 94821421dcde959a227d045f7fd1dc4260503aa7,5204f5258f0492e4f97e8f793f3fbf2ec9ff0be8..c0e76be09abb48d67579e589f1befe704eae7a97
  
  DECLARE_GLOBAL_DATA_PTR;
  
 +static int mmc_load_legacy(struct mmc *mmc, ulong sector,
 +                         struct image_header *header)
 +{
 +      u32 image_size_sectors;
 +      unsigned long count;
 +
 +      spl_parse_image_header(header);
 +      /* convert size to sectors - round up */
 +      image_size_sectors = (spl_image.size + mmc->read_bl_len - 1) /
 +                           mmc->read_bl_len;
 +
 +      /* Read the header too to avoid extra memcpy */
 +      count = mmc->block_dev.block_read(&mmc->block_dev, sector,
 +                                        image_size_sectors,
 +                                        (void *)(ulong)spl_image.load_addr);
 +      debug("read %x sectors to %x\n", image_size_sectors,
 +            spl_image.load_addr);
 +      if (count != image_size_sectors)
 +              return -EIO;
 +
 +      return 0;
 +}
 +
 +#ifdef CONFIG_SPL_LOAD_FIT
 +static ulong h_spl_load_read(struct spl_load_info *load, ulong sector,
 +                           ulong count, void *buf)
 +{
 +      struct mmc *mmc = load->dev;
 +
 +      return mmc->block_dev.block_read(&mmc->block_dev, sector, count, buf);
 +}
 +#endif
 +
  static int mmc_load_image_raw_sector(struct mmc *mmc, unsigned long sector)
  {
        unsigned long count;
 -      u32 image_size_sectors;
        struct image_header *header;
 +      int ret = 0;
  
        header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
                                         sizeof(struct image_header));
  
        /* read image header to find the image size & load address */
        count = mmc->block_dev.block_read(&mmc->block_dev, sector, 1, header);
 -      debug("read sector %lx, count=%lu\n", sector, count);
 -      if (count == 0)
 +      debug("hdr read sector %lx, count=%lu\n", sector, count);
 +      if (count == 0) {
 +              ret = -EIO;
                goto end;
 +      }
  
 -      if (image_get_magic(header) != IH_MAGIC) {
 +      switch (image_get_magic(header)) {
 +      case IH_MAGIC:
 +              ret = mmc_load_legacy(mmc, sector, header);
 +              break;
 +#ifdef CONFIG_SPL_LOAD_FIT
 +      case FDT_MAGIC: {
 +              struct spl_load_info load;
 +
 +              debug("Found FIT\n");
 +              load.dev = mmc;
 +              load.priv = NULL;
 +              load.bl_len = mmc->read_bl_len;
 +              load.read = h_spl_load_read;
 +              ret = spl_load_simple_fit(&load, sector, header);
 +              break;
 +      }
 +#endif
 +      default:
                puts("bad magic\n");
                return -1;
        }
  
 -      spl_parse_image_header(header);
 -
 -      /* convert size to sectors - round up */
 -      image_size_sectors = (spl_image.size + mmc->read_bl_len - 1) /
 -                           mmc->read_bl_len;
 -
 -      /* Read the header too to avoid extra memcpy */
 -      count = mmc->block_dev.block_read(&mmc->block_dev, sector,
 -                                        image_size_sectors,
 -                                        (void *)(ulong)spl_image.load_addr);
 -      debug("read %x sectors to %x\n", image_size_sectors,
 -            spl_image.load_addr);
 -
  end:
 -      if (count == 0) {
 +      if (ret) {
  #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
                puts("spl: mmc block read error\n");
  #endif
@@@ -161,7 -122,7 +161,7 @@@ static int mmc_load_image_raw_partition
        disk_partition_t info;
        int err;
  
-       err = get_partition_info(&mmc->block_dev, partition, &info);
+       err = part_get_info(&mmc->block_dev, partition, &info);
        if (err) {
  #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
                puts("spl: partition error\n");
diff --combined include/common.h
index 3e1a4c98b718523c7e94b95d05f7649bfed1a5b9,1317f9b9e78e1b42c9780421a48d18d4ad27bceb..f9f4605dba6458fe4984a7c4b7aeef11d82c65d7
@@@ -596,8 -596,12 +596,8 @@@ void      upmconfig     (unsigned int, unsig
  ulong get_tbclk     (void);
  void  reset_misc    (void);
  void  reset_cpu     (ulong addr);
 -#if defined (CONFIG_OF_LIBFDT) && defined (CONFIG_OF_BOARD_SETUP)
  void ft_cpu_setup(void *blob, bd_t *bd);
 -#ifdef CONFIG_PCI
  void ft_pci_setup(void *blob, bd_t *bd);
 -#endif
 -#endif
  
  void smp_set_core_boot_addr(unsigned long addr, int corenr);
  void smp_kick_all_cpus(void);
@@@ -656,8 -660,10 +656,8 @@@ int get_serial_clock(void)
  #if defined(CONFIG_MPC85xx)
  typedef MPC85xx_SYS_INFO sys_info_t;
  void  get_sys_info  ( sys_info_t * );
 -#  if defined(CONFIG_OF_LIBFDT)
 -      void ft_fixup_cpu(void *, u64);
 -      void ft_fixup_num_cores(void *);
 -#  endif
 +void ft_fixup_cpu(void *, u64);
 +void ft_fixup_num_cores(void *);
  #endif
  #if defined(CONFIG_MPC86xx)
  typedef MPC86xx_SYS_INFO sys_info_t;
@@@ -807,7 -813,7 +807,7 @@@ void gzwrite_progress_finish(int retcod
   *                            for files under 4GiB
   */
  int gzwrite(unsigned char *src, int len,
-           struct block_dev_desc *dev,
+           struct blk_desc *dev,
            unsigned long szwritebuf,
            u64 startoffs,
            u64 szexpected);
index b08072401b6da0ec3866e8ca2ca627285a943a31,c21af1ced64f54f7269a8830c5125ef9b75d1c01..139e6297306768bbf91f5141dee2af249d196d18
  /* Use the HUSH parser */
  #define CONFIG_SYS_HUSH_PARSER
  
 -/*
 - * Pass open firmware flat tree
 - */
 -#define CONFIG_OF_LIBFDT
 -#define CONFIG_OF_BOARD_SETUP
 -#define CONFIG_OF_STDOUT_VIA_ALIAS
 -
 -/* new uImage format support */
 -#define CONFIG_FIT
 -#define CONFIG_FIT_VERBOSE    /* enable fit_format_{error,warning}() */
 -
  /* I2C */
  #define CONFIG_SYS_I2C
  #define CONFIG_SYS_I2C_FSL
  #define CONFIG_CMD_REGINFO
  #define CONFIG_CMD_ERRATA
  #define CONFIG_CMD_CRAMFS
- #define CONFIG_CRAMFS_CMDLINE
  
  /*
   * USB
index d59beb80dd32c5be33ada3bdfc28bc3db8726473,b7090c81334957cb9dcbdf52227cbb211ec52998..cc224674421994158088cf7b32c0c4c664d2a300
@@@ -28,6 -28,7 +28,6 @@@
  /* Number of bits in a C 'long' on this architecture */
  #define CONFIG_SANDBOX_BITS_PER_LONG  64
  
 -#define CONFIG_OF_LIBFDT
  #define CONFIG_LMB
  #define CONFIG_CMD_FDT
  #define CONFIG_ANDROID_BOOT_IMAGE
@@@ -43,6 -44,8 +43,8 @@@
  #define CONFIG_CMD_FAT
  #define CONFIG_CMD_EXT4
  #define CONFIG_CMD_EXT4_WRITE
+ #define CONFIG_CMD_CBFS
+ #define CONFIG_CMD_CRAMFS
  #define CONFIG_CMD_PART
  #define CONFIG_DOS_PARTITION
  #define CONFIG_HOST_MAX_DEVICES 4
  
  #define CONFIG_CMD_GPT
  #define CONFIG_PARTITION_UUIDS
- #define CONFIG_EFI_PARTITION
+ #define CONFIG_AMIGA_PARTITION
  #define CONFIG_DOS_PARTITION
+ #define CONFIG_EFI_PARTITION
+ #define CONFIG_ISO_PARTITION
+ #define CONFIG_MAC_PARTITION
  
  /*
   * Size of malloc() pool, before and after relocation
diff --combined include/spl.h
index 16f2f6a9ee710e818c0856c27090dc6ca2698016,c62887af0eddf29b9c4f17fdd93eef327f59c4f9..de4f70a377313bec73e9cee638d67a1ce09b61e4
@@@ -29,24 -29,6 +29,24 @@@ struct spl_image_info 
        u32 flags;
  };
  
 +/*
 + * Information required to load data from a device
 + *
 + * @dev: Pointer to the device, e.g. struct mmc *
 + * @priv: Private data for the device
 + * @bl_len: Block length for reading in bytes
 + * @read: Function to call to read from the device
 + */
 +struct spl_load_info {
 +      void *dev;
 +      void *priv;
 +      int bl_len;
 +      ulong (*read)(struct spl_load_info *load, ulong sector, ulong count,
 +                    void *buf);
 +};
 +
 +int spl_load_simple_fit(struct spl_load_info *info, ulong sector, void *fdt);
 +
  #define SPL_COPY_PAYLOAD_ONLY 1
  
  extern struct spl_image_info spl_image;
@@@ -90,14 -72,16 +90,16 @@@ int spl_usb_load_image(void)
  int spl_sata_load_image(void);
  
  /* SPL FAT image functions */
- int spl_load_image_fat(block_dev_desc_t *block_dev, int partition, const char *filename);
- int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition);
+ int spl_load_image_fat(struct blk_desc *block_dev, int partition,
+                      const char *filename);
+ int spl_load_image_fat_os(struct blk_desc *block_dev, int partition);
  
  void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image);
  
  /* SPL EXT image functions */
- int spl_load_image_ext(block_dev_desc_t *block_dev, int partition, const char *filename);
- int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition);
+ int spl_load_image_ext(struct blk_desc *block_dev, int partition,
+                      const char *filename);
+ int spl_load_image_ext_os(struct blk_desc *block_dev, int partition);
  
  /**
   * spl_init() - Set up device tree and driver model in SPL if enabled