+ printf ("## Loading init Ramdisk from FIT "
+ "Image at %08lx ...\n", rd_addr);
+
+ show_boot_progress (120);
+ if (!fit_check_format (fit_hdr)) {
+ puts ("Bad FIT ramdisk image format!\n");
+ show_boot_progress (-120);
+ return 0;
+ }
+ show_boot_progress (121);
+
+ if (!fit_uname_ramdisk) {
+ /*
+ * no ramdisk image node unit name, try to get config
+ * node first. If config unit node name is NULL
+ * fit_conf_get_node() will try to find default config node
+ */
+ show_boot_progress (122);
+ cfg_noffset = fit_conf_get_node (fit_hdr, fit_uname_config);
+ if (cfg_noffset < 0) {
+ puts ("Could not find configuration node\n");
+ show_boot_progress (-122);
+ return 0;
+ }
+ fit_uname_config = fdt_get_name (fit_hdr, cfg_noffset, NULL);
+ printf (" Using '%s' configuration\n", fit_uname_config);
+
+ rd_noffset = fit_conf_get_ramdisk_node (fit_hdr, cfg_noffset);
+ fit_uname_ramdisk = fit_get_name (fit_hdr, rd_noffset, NULL);
+ } else {
+ /* get ramdisk component image node offset */
+ show_boot_progress (123);
+ rd_noffset = fit_image_get_node (fit_hdr, fit_uname_ramdisk);
+ }
+ if (rd_noffset < 0) {
+ puts ("Could not find subimage node\n");
+ show_boot_progress (-124);
+ return 0;
+ }
+
+ printf (" Trying '%s' ramdisk subimage\n", fit_uname_ramdisk);
+
+ show_boot_progress (125);
+ if (!fit_check_ramdisk (fit_hdr, rd_noffset, arch, images->verify))
+ return 0;
+
+ /* get ramdisk image data address and length */
+ if (fit_image_get_data (fit_hdr, rd_noffset, &data, &size)) {
+ puts ("Could not find ramdisk subimage data!\n");
+ show_boot_progress (-127);
+ return 0;
+ }
+ show_boot_progress (128);
+
+ rd_data = (ulong)data;
+ rd_len = size;
+
+ if (fit_image_get_load (fit_hdr, rd_noffset, &rd_load)) {
+ puts ("Can't get ramdisk subimage load address!\n");
+ show_boot_progress (-129);
+ return 0;
+ }
+ show_boot_progress (129);
+
+ images->fit_hdr_rd = fit_hdr;
+ images->fit_uname_rd = fit_uname_ramdisk;
+ images->fit_noffset_rd = rd_noffset;
+ break;