17baff11fSYatharth Kochar /* 27baff11fSYatharth Kochar * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. 37baff11fSYatharth Kochar * 47baff11fSYatharth Kochar * Redistribution and use in source and binary forms, with or without 57baff11fSYatharth Kochar * modification, are permitted provided that the following conditions are met: 67baff11fSYatharth Kochar * 77baff11fSYatharth Kochar * Redistributions of source code must retain the above copyright notice, this 87baff11fSYatharth Kochar * list of conditions and the following disclaimer. 97baff11fSYatharth Kochar * 107baff11fSYatharth Kochar * Redistributions in binary form must reproduce the above copyright notice, 117baff11fSYatharth Kochar * this list of conditions and the following disclaimer in the documentation 127baff11fSYatharth Kochar * and/or other materials provided with the distribution. 137baff11fSYatharth Kochar * 147baff11fSYatharth Kochar * Neither the name of ARM nor the names of its contributors may be used 157baff11fSYatharth Kochar * to endorse or promote products derived from this software without specific 167baff11fSYatharth Kochar * prior written permission. 177baff11fSYatharth Kochar * 187baff11fSYatharth Kochar * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 197baff11fSYatharth Kochar * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 207baff11fSYatharth Kochar * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 217baff11fSYatharth Kochar * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 227baff11fSYatharth Kochar * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 237baff11fSYatharth Kochar * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 247baff11fSYatharth Kochar * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 257baff11fSYatharth Kochar * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 267baff11fSYatharth Kochar * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 277baff11fSYatharth Kochar * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 287baff11fSYatharth Kochar * POSSIBILITY OF SUCH DAMAGE. 297baff11fSYatharth Kochar */ 3048bfb88eSYatharth Kochar 3148bfb88eSYatharth Kochar #include <arch_helpers.h> 3248bfb88eSYatharth Kochar #include <assert.h> 337baff11fSYatharth Kochar #include <bl_common.h> 347baff11fSYatharth Kochar #include <debug.h> 3548bfb88eSYatharth Kochar #include <errno.h> 367baff11fSYatharth Kochar #include <platform_def.h> 377baff11fSYatharth Kochar 387baff11fSYatharth Kochar /* 397baff11fSYatharth Kochar * The following platform functions are weakly defined. They 4048bfb88eSYatharth Kochar * are default implementations that allow BL1 to compile in 417baff11fSYatharth Kochar * absence of real definitions. The Platforms may override 427baff11fSYatharth Kochar * with more complex definitions. 437baff11fSYatharth Kochar */ 447baff11fSYatharth Kochar #pragma weak bl1_plat_get_next_image_id 457baff11fSYatharth Kochar #pragma weak bl1_plat_set_ep_info 467baff11fSYatharth Kochar #pragma weak bl1_plat_get_image_desc 4748bfb88eSYatharth Kochar #pragma weak bl1_plat_fwu_done 487baff11fSYatharth Kochar 497baff11fSYatharth Kochar 507baff11fSYatharth Kochar unsigned int bl1_plat_get_next_image_id(void) 517baff11fSYatharth Kochar { 527baff11fSYatharth Kochar /* BL2 load will be done by default. */ 537baff11fSYatharth Kochar return BL2_IMAGE_ID; 547baff11fSYatharth Kochar } 557baff11fSYatharth Kochar 567baff11fSYatharth Kochar void bl1_plat_set_ep_info(unsigned int image_id, 577baff11fSYatharth Kochar entry_point_info_t *ep_info) 587baff11fSYatharth Kochar { 597baff11fSYatharth Kochar 607baff11fSYatharth Kochar } 617baff11fSYatharth Kochar 627baff11fSYatharth Kochar /* 637baff11fSYatharth Kochar * Following is the default definition that always 647baff11fSYatharth Kochar * returns BL2 image details. 657baff11fSYatharth Kochar */ 667baff11fSYatharth Kochar image_desc_t *bl1_plat_get_image_desc(unsigned int image_id) 677baff11fSYatharth Kochar { 687baff11fSYatharth Kochar static image_desc_t bl2_img_desc = BL2_IMAGE_DESC; 697baff11fSYatharth Kochar return &bl2_img_desc; 707baff11fSYatharth Kochar } 7148bfb88eSYatharth Kochar 72*1f37b944SDan Handley __dead2 void bl1_plat_fwu_done(void *client_cookie, void *reserved) 7348bfb88eSYatharth Kochar { 7448bfb88eSYatharth Kochar while (1) 7548bfb88eSYatharth Kochar wfi(); 7648bfb88eSYatharth Kochar } 7748bfb88eSYatharth Kochar 7848bfb88eSYatharth Kochar /* 7948bfb88eSYatharth Kochar * The Platforms must override with real definition. 8048bfb88eSYatharth Kochar */ 8148bfb88eSYatharth Kochar #pragma weak bl1_plat_mem_check 8248bfb88eSYatharth Kochar 8348bfb88eSYatharth Kochar int bl1_plat_mem_check(uintptr_t mem_base, unsigned int mem_size, 8448bfb88eSYatharth Kochar unsigned int flags) 8548bfb88eSYatharth Kochar { 8648bfb88eSYatharth Kochar assert(0); 8748bfb88eSYatharth Kochar return -ENOMEM; 8848bfb88eSYatharth Kochar } 89