bootm: uImage initrd fix support
Fix multiple issues: - arm: loadaddr hardcode to 0x0 if valid - uncompress the ramdisk (U-Boot do not do so) - image_sdram_flush: wrong start address when expending the resource - bootm: load the initrd to ram where this is done at arch level Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAABAgAGBQJQKKQ2AAoJEOrjwV5ZMRf2jRUP/Rds7GxtSahRyFWivgay2mxV QIlT196El44RAc/DCHxZAdg1lAirBteBMUEX4NGPO3sDxsXiaZK2hg8ac9j6BXkS GY0r+K183jFwwFg3WwZoeEwPo9z/zxUzm4d50HmMafBSBI1XnLTdJ9iV4Ejj6iaa dirHm9PZTvTKyS1ojWR1WYKeobSYUJpouWxGyzWINOIpZWx8t9+natqTVYY1pOiy N6sSLq/j0tlfDWWHoo4H++Oh3y4npIj+UHYNdmz8ZuMjrO5vxjGlKVtauNBB9eUb n+XRahsNp9BQveXPbRgwQChGCPbNGyc1xg1zyu3uD6DUeKC/+OvACZJSCJBNCOYS LjN7PIS23hvqSkWTiAJpt+RdVdos3A9CPjQWfh4KWCQRWTZfHeHVGfWXMJL2YAEw twyX5JHRs1EcNCay2Raqj67O81V1OowVq5/qL8cuIV3eDQy1KcjMd10A6s/qJ9zV aEc/qXKrh7pMoY4MJDebVP7nkXCXgxj6g43ByYjIcMT4fJlao621LinzyAvhpiEW aLdjIojTROCIUQbTY1O8L2YV7GpMurkaS4koV/t3rpJIO1TuZ3jck4jxXCfDfLDv TD/+fB8F+Usoh7UUZ6RSKEgB3ZTCMor4DVnYbQxktyuNiRKeuAkzBWKuXnswAoMN Jl2WPqgxv90ftJT0TMek =th8z -----END PGP SIGNATURE----- Merge tag 'bootm_fix' of git://git.jcrosoft.org/barebox bootm: uImage initrd fix support Fix multiple issues: - arm: loadaddr hardcode to 0x0 if valid - uncompress the ramdisk (U-Boot do not do so) - image_sdram_flush: wrong start address when expending the resource - bootm: load the initrd to ram where this is done at arch level Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This commit is contained in:
commit
3f96b4938c
|
@ -58,7 +58,9 @@ static int __do_bootm_linux(struct image_data *data, int swap)
|
|||
|
||||
kernel = data->os_res->start + data->os_entry;
|
||||
|
||||
if (data->initrd_file && data->initrd_address == UIMAGE_INVALID_ADDRESS) {
|
||||
initrd_start = data->initrd_address;
|
||||
|
||||
if (data->initrd_file && initrd_start == UIMAGE_INVALID_ADDRESS) {
|
||||
initrd_start = data->os_res->start + SZ_8M;
|
||||
|
||||
if (bootm_verbose(data)) {
|
||||
|
|
|
@ -126,14 +126,6 @@ static int bootm_open_initrd_uimage(struct image_data *data)
|
|||
if (data->initrd_address == UIMAGE_SOME_ADDRESS)
|
||||
data->initrd_address = data->initrd->header.ih_load;
|
||||
|
||||
if (data->initrd_address != UIMAGE_INVALID_ADDRESS) {
|
||||
data->initrd_res = uimage_load_to_sdram(data->initrd,
|
||||
data->initrd_num,
|
||||
data->initrd_address);
|
||||
if (!data->initrd_res)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -334,7 +334,8 @@ int uimage_load(struct uimage_handle *handle, unsigned int image_no,
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (hdr->ih_comp == IH_COMP_NONE)
|
||||
/* if ramdisk U-Boot expect to ignore the compression type */
|
||||
if (hdr->ih_comp == IH_COMP_NONE || hdr->ih_type == IH_TYPE_RAMDISK)
|
||||
uncompress_fn = uncompress_copy;
|
||||
else
|
||||
uncompress_fn = uncompress;
|
||||
|
@ -355,8 +356,9 @@ static struct resource *uimage_resource;
|
|||
static int uimage_sdram_flush(void *buf, unsigned int len)
|
||||
{
|
||||
if (uimage_size + len > resource_size(uimage_resource)) {
|
||||
resource_size_t start = resource_size(uimage_resource);
|
||||
resource_size_t start = uimage_resource->start;
|
||||
resource_size_t size = resource_size(uimage_resource) + len;
|
||||
|
||||
release_sdram_region(uimage_resource);
|
||||
|
||||
uimage_resource = request_sdram_region("uimage",
|
||||
|
|
Loading…
Reference in New Issue