/* Caller need ensure the offset and size to align with page size */
ulong spl_romapi_raw_seekable_read(u32 offset, u32 size, void *buf)
{
- volatile gd_t *pgd = gd;
int ret;
debug("%s 0x%x, size 0x%x\n", __func__, offset, size);
- ret = g_rom_api->download_image(buf, offset, size,
- ((uintptr_t)buf) ^ offset ^ size);
-
- set_gd(pgd);
+ ret = rom_api_download_image(buf, offset, size);
if (ret == ROM_API_OKAY)
return size;
struct spl_boot_device *bootdev,
u32 rom_bt_dev)
{
- volatile gd_t *pgd = gd;
int ret;
u32 offset;
u32 pagesize, size;
struct image_header *header;
u32 image_offset;
- ret = g_rom_api->query_boot_infor(QUERY_IVT_OFF, &offset,
- ((uintptr_t)&offset) ^ QUERY_IVT_OFF);
- ret |= g_rom_api->query_boot_infor(QUERY_PAGE_SZ, &pagesize,
- ((uintptr_t)&pagesize) ^ QUERY_PAGE_SZ);
- ret |= g_rom_api->query_boot_infor(QUERY_IMG_OFF, &image_offset,
- ((uintptr_t)&image_offset) ^ QUERY_IMG_OFF);
-
- set_gd(pgd);
+ ret = rom_api_query_boot_infor(QUERY_IVT_OFF, &offset);
+ ret |= rom_api_query_boot_infor(QUERY_PAGE_SZ, &pagesize);
+ ret |= rom_api_query_boot_infor(QUERY_IMG_OFF, &image_offset);
if (ret != ROM_API_OKAY) {
puts("ROMAPI: Failure query boot infor pagesize/offset\n");
offset = spl_romapi_get_uboot_base(image_offset, rom_bt_dev);
size = ALIGN(sizeof(struct image_header), pagesize);
- ret = g_rom_api->download_image((u8 *)header, offset, size,
- ((uintptr_t)header) ^ offset ^ size);
- set_gd(pgd);
+ ret = rom_api_download_image((u8 *)header, offset, size);
if (ret != ROM_API_OKAY) {
printf("ROMAPI: download failure offset 0x%x size 0x%x\n",
struct spl_boot_device *bootdev)
{
struct spl_load_info load;
- volatile gd_t *pgd = gd;
u32 pagesize, pg;
int ret;
int i = 0;
int imagesize;
int total;
- ret = g_rom_api->query_boot_infor(QUERY_PAGE_SZ, &pagesize,
- ((uintptr_t)&pagesize) ^ QUERY_PAGE_SZ);
- set_gd(pgd);
+ ret = rom_api_query_boot_infor(QUERY_PAGE_SZ, &pagesize);
if (ret != ROM_API_OKAY)
puts("failure at query_boot_info\n");
pg = 1024;
for (i = 0; i < 640; i++) {
- ret = g_rom_api->download_image(p, 0, pg,
- ((uintptr_t)p) ^ pg);
- set_gd(pgd);
+ ret = rom_api_download_image(p, 0, pg);
if (ret != ROM_API_OKAY) {
puts("Steam(USB) download failure\n");
}
if (p - phdr < img_header_size()) {
- ret = g_rom_api->download_image(p, 0, pg, ((uintptr_t)p) ^ pg);
- set_gd(pgd);
+ ret = rom_api_download_image(p, 0, pg);
if (ret != ROM_API_OKAY) {
puts("Steam(USB) download failure\n");
printf("Need continue download %d\n", imagesize);
- ret = g_rom_api->download_image(p, 0, imagesize,
- ((uintptr_t)p) ^ imagesize);
- set_gd(pgd);
+ ret = rom_api_download_image(p, 0, imagesize);
p += imagesize;
printf("Download %d, Total size %d\n", imagesize, total);
- ret = g_rom_api->download_image(p, 0, imagesize,
- ((uintptr_t)p) ^ imagesize);
- set_gd(pgd);
+ ret = rom_api_download_image(p, 0, imagesize);
if (ret != ROM_API_OKAY)
printf("ROM download failure %d\n", imagesize);
int board_return_to_bootrom(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev)
{
- volatile gd_t *pgd = gd;
int ret;
u32 boot;
- ret = g_rom_api->query_boot_infor(QUERY_BT_DEV, &boot,
- ((uintptr_t)&boot) ^ QUERY_BT_DEV);
- set_gd(pgd);
+ ret = rom_api_query_boot_infor(QUERY_BT_DEV, &boot);
if (ret != ROM_API_OKAY) {
puts("ROMAPI: failure at query_boot_info\n");