Newer
Older
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
* offset.
*
* returns:
* image node offset when found (>=0)
* negative number on failure (FDT_ERR_* code)
*/
int fit_conf_get_kernel_node (const void *fit, int noffset)
{
return __fit_conf_get_prop_node (fit, noffset, FIT_KERNEL_PROP);
}
/**
* fit_conf_get_ramdisk_node - get ramdisk image node offset that corresponds to
* a given configuration
* @fit: pointer to the FIT format image header
* @noffset: configuration node offset
*
* fit_conf_get_ramdisk_node() retrives ramdisk image node unit name from
* configuration FIT_KERNEL_PROP property and translates it to the node
* offset.
*
* returns:
* image node offset when found (>=0)
* negative number on failure (FDT_ERR_* code)
*/
int fit_conf_get_ramdisk_node (const void *fit, int noffset)
{
return __fit_conf_get_prop_node (fit, noffset, FIT_RAMDISK_PROP);
}
/**
* fit_conf_get_fdt_node - get fdt image node offset that corresponds to
* a given configuration
* @fit: pointer to the FIT format image header
* @noffset: configuration node offset
*
* fit_conf_get_fdt_node() retrives fdt image node unit name from
* configuration FIT_KERNEL_PROP property and translates it to the node
* offset.
*
* returns:
* image node offset when found (>=0)
* negative number on failure (FDT_ERR_* code)
*/
int fit_conf_get_fdt_node (const void *fit, int noffset)
{
return __fit_conf_get_prop_node (fit, noffset, FIT_FDT_PROP);
}
/**
* fit_conf_print - prints out the FIT configuration details
* @fit: pointer to the FIT format image header
Marian Balakowicz
committed
* @noffset: offset of the configuration node
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
* @p: pointer to prefix string
*
* fit_conf_print() lists all mandatory properies for the processed
* configuration node.
*
* returns:
* no returned results
*/
void fit_conf_print (const void *fit, int noffset, const char *p)
{
char *desc;
char *uname;
int ret;
/* Mandatory properties */
ret = fit_get_desc (fit, noffset, &desc);
printf ("%s Description: ", p);
if (ret)
printf ("unavailable\n");
else
printf ("%s\n", desc);
uname = (char *)fdt_getprop (fit, noffset, FIT_KERNEL_PROP, NULL);
printf ("%s Kernel: ", p);
if (uname == NULL)
printf ("unavailable\n");
else
printf ("%s\n", uname);
/* Optional properties */
uname = (char *)fdt_getprop (fit, noffset, FIT_RAMDISK_PROP, NULL);
if (uname)
printf ("%s Init Ramdisk: %s\n", p, uname);
uname = (char *)fdt_getprop (fit, noffset, FIT_FDT_PROP, NULL);
if (uname)
printf ("%s FDT: %s\n", p, uname);
}
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
/**
* fit_check_ramdisk - verify FIT format ramdisk subimage
* @fit_hdr: pointer to the FIT ramdisk header
* @rd_noffset: ramdisk subimage node offset within FIT image
* @arch: requested ramdisk image architecture type
* @verify: data CRC verification flag
*
* fit_check_ramdisk() verifies integrity of the ramdisk subimage and from
* specified FIT image.
*
* returns:
* 1, on success
* 0, on failure
*/
#ifndef USE_HOSTCC
static int fit_check_ramdisk (const void *fit, int rd_noffset, uint8_t arch, int verify)
{
fit_image_print (fit, rd_noffset, " ");
if (verify) {
puts (" Verifying Hash Integrity ... ");
if (!fit_image_check_hashes (fit, rd_noffset)) {
puts ("Bad Data Hash\n");
show_boot_progress (-125);
return 0;
}
puts ("OK\n");
}
show_boot_progress (126);
if (!fit_image_check_os (fit, rd_noffset, IH_OS_LINUX) ||
!fit_image_check_arch (fit, rd_noffset, arch) ||
!fit_image_check_type (fit, rd_noffset, IH_TYPE_RAMDISK)) {
printf ("No Linux %s Ramdisk Image\n",
genimg_get_arch_name(arch));
show_boot_progress (-126);
return 0;
}
show_boot_progress (127);
return 1;
}
#endif /* USE_HOSTCC */
#endif /* CONFIG_FIT */