Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Rafal Jaworowski | 500856e | 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 | 500856e | 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 | 78acc47 | 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 | 500856e | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 9 | * existing code e.g. operations on strings and similar. |
Rafal Jaworowski | 500856e | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 10 | */ |
11 | |||||
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 12 | #include <command.h> |
Simon Glass | db41d65 | 2019-12-28 10:45:07 -0700 | [diff] [blame] | 13 | #include <hang.h> |
Simon Glass | c05ed00 | 2020-05-10 11:40:11 -0600 | [diff] [blame] | 14 | #include <linux/delay.h> |
Rafal Jaworowski | 500856e | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 15 | #include <linux/types.h> |
16 | #include <api_public.h> | ||||
17 | |||||
18 | #include "glue.h" | ||||
19 | |||||
Stefan Roese | 7d9cde1 | 2015-11-23 07:00:22 +0100 | [diff] [blame] | 20 | void putc(const char c) |
Rafal Jaworowski | 500856e | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 21 | { |
22 | ub_putc(c); | ||||
23 | } | ||||
24 | |||||
Stefan Roese | 7d9cde1 | 2015-11-23 07:00:22 +0100 | [diff] [blame] | 25 | void puts(const char *s) |
26 | { | ||||
27 | ub_puts(s); | ||||
28 | } | ||||
29 | |||||
Ingo van Lil | 3eb90ba | 2009-11-24 14:09:21 +0100 | [diff] [blame] | 30 | void __udelay(unsigned long usec) |
Rafal Jaworowski | 500856e | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 31 | { |
32 | ub_udelay(usec); | ||||
33 | } | ||||
34 | |||||
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 35 | int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
Rafal Jaworowski | 500856e | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 36 | { |
37 | ub_reset(); | ||||
Mike Frysinger | e0306ca | 2010-12-19 17:16:53 -0500 | [diff] [blame] | 38 | return 0; |
Rafal Jaworowski | 500856e | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 39 | } |
40 | |||||
Rafal Jaworowski | 63f732d | 2008-01-29 17:00:34 +0100 | [diff] [blame] | 41 | void *malloc (size_t len) |
Rafal Jaworowski | 500856e | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 42 | { |
43 | return NULL; | ||||
44 | } | ||||
Rafal Jaworowski | 63f732d | 2008-01-29 17:00:34 +0100 | [diff] [blame] | 45 | |
Simon Glass | db41d65 | 2019-12-28 10:45:07 -0700 | [diff] [blame] | 46 | void hang(void) |
Rafal Jaworowski | 63f732d | 2008-01-29 17:00:34 +0100 | [diff] [blame] | 47 | { |
48 | while (1) ; | ||||
49 | } |