blob: 191077e4235ccc4700857cb6a32025dceedde33e [file] [log] [blame]
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -07001/*
2 * Copyright (c) 2008 Travis Geiselbrecht
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files
6 * (the "Software"), to deal in the Software without restriction,
7 * including without limitation the rights to use, copy, modify, merge,
8 * publish, distribute, sublicense, and/or sell copies of the Software,
9 * and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23#ifndef __PLATFORM_H
24#define __PLATFORM_H
25
Deepa Dinamani20cb9e52012-10-18 12:20:47 -070026#define PA(x) platform_get_virt_to_phys_mapping(x)
27#define VA(x) platform_get_phys_to_virt_mapping(x)
28
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070029time_t current_time(void);
30bigtime_t current_time_hires(void);
31
32/* super early platform initialization, before almost everything */
33void platform_early_init(void);
34
35/* later init, after the kernel has come up */
36void platform_init(void);
37
38/* called by the arch init code to get the platform to set up any mmu mappings it may need */
Deepa Dinamani3e5cf0d2012-10-29 12:15:17 -070039int platform_use_identity_mmu_mappings(void);
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070040void platform_init_mmu_mappings(void);
Deepa Dinamani20cb9e52012-10-18 12:20:47 -070041addr_t platform_get_virt_to_phys_mapping(addr_t virt_addr);
42addr_t platform_get_phys_to_virt_mapping(addr_t phys_addr);
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070043
Greg Griscod6250552011-06-29 14:40:23 -070044void display_init(void);
45void display_shutdown(void);
46void display_image_on_screen(void);
47
48unsigned board_machtype(void);
Amol Jadia63aaff2012-02-01 15:51:50 -080049unsigned board_platform_id(void);
Greg Griscod6250552011-06-29 14:40:23 -070050unsigned check_reboot_mode(void);
51void platform_uninit_timer(void);
52void reboot_device(unsigned);
53
54
Travis Geiselbrecht1d0df692008-09-01 02:26:09 -070055#endif