Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 2 | /* |
3 | * (C) Copyright 2007 Semihalf | ||||
4 | * | ||||
5 | * Written by: Rafal Jaworowski <raj@semihalf.com> | ||||
6 | * | ||||
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 7 | * This is is a set of wrappers/stubs that allow to use certain routines from |
Peter Tyser | 685b7f5 | 2010-04-12 22:28:05 -0500 | [diff] [blame] | 8 | * U-Boot's lib in the standalone app. This way way we can re-use |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 9 | * existing code e.g. operations on strings and similar. |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 10 | */ |
11 | |||||
12 | #include <common.h> | ||||
Simon Glass | ed38aef | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 13 | #include <command.h> |
Simon Glass | f11478f | 2019-12-28 10:45:07 -0700 | [diff] [blame] | 14 | #include <hang.h> |
Simon Glass | dbd7954 | 2020-05-10 11:40:11 -0600 | [diff] [blame] | 15 | #include <linux/delay.h> |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 16 | #include <linux/types.h> |
17 | #include <api_public.h> | ||||
18 | |||||
19 | #include "glue.h" | ||||
20 | |||||
Stefan Roese | 363ab7b | 2015-11-23 07:00:22 +0100 | [diff] [blame] | 21 | void putc(const char c) |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 22 | { |
Stefan Roese | 363ab7b | 2015-11-23 07:00:22 +0100 | [diff] [blame] | 23 | ub_putc(c); |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 24 | } |
25 | |||||
Stefan Roese | 363ab7b | 2015-11-23 07:00:22 +0100 | [diff] [blame] | 26 | void puts(const char *s) |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 27 | { |
Stefan Roese | 363ab7b | 2015-11-23 07:00:22 +0100 | [diff] [blame] | 28 | ub_puts(s); |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 29 | } |
30 | |||||
Ingo van Lil | f0f778a | 2009-11-24 14:09:21 +0100 | [diff] [blame] | 31 | void __udelay(unsigned long usec) |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 32 | { |
33 | ub_udelay(usec); | ||||
34 | } | ||||
35 | |||||
Simon Glass | ed38aef | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 36 | int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 37 | { |
38 | ub_reset(); | ||||
Mike Frysinger | 1f0a7e3 | 2010-12-19 17:16:53 -0500 | [diff] [blame] | 39 | return 0; |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 40 | } |
41 | |||||
Rafal Jaworowski | 35e4e8d | 2008-01-29 17:00:34 +0100 | [diff] [blame] | 42 | void *malloc (size_t len) |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 43 | { |
44 | return NULL; | ||||
45 | } | ||||
Rafal Jaworowski | 35e4e8d | 2008-01-29 17:00:34 +0100 | [diff] [blame] | 46 | |
Simon Glass | f11478f | 2019-12-28 10:45:07 -0700 | [diff] [blame] | 47 | void hang(void) |
Rafal Jaworowski | 35e4e8d | 2008-01-29 17:00:34 +0100 | [diff] [blame] | 48 | { |
49 | while (1) ; | ||||
50 | } |