blob: bfd88e100d6ed7d5029dfa42028a5f3e4b3f1938 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Rafal Jaworowski500856e2008-01-09 19:39:36 +01002/*
3 * (C) Copyright 2007 Semihalf
4 *
5 * Written by: Rafal Jaworowski <raj@semihalf.com>
6 *
Rafal Jaworowski500856e2008-01-09 19:39:36 +01007 * This is is a set of wrappers/stubs that allow to use certain routines from
Peter Tyser78acc472010-04-12 22:28:05 -05008 * U-Boot's lib in the standalone app. This way way we can re-use
Rafal Jaworowski500856e2008-01-09 19:39:36 +01009 * existing code e.g. operations on strings and similar.
Rafal Jaworowski500856e2008-01-09 19:39:36 +010010 */
11
Simon Glass09140112020-05-10 11:40:03 -060012#include <command.h>
Simon Glassdb41d652019-12-28 10:45:07 -070013#include <hang.h>
Simon Glassc05ed002020-05-10 11:40:11 -060014#include <linux/delay.h>
Rafal Jaworowski500856e2008-01-09 19:39:36 +010015#include <linux/types.h>
16#include <api_public.h>
17
18#include "glue.h"
19
Stefan Roese7d9cde12015-11-23 07:00:22 +010020void putc(const char c)
Rafal Jaworowski500856e2008-01-09 19:39:36 +010021{
22 ub_putc(c);
23}
24
Stefan Roese7d9cde12015-11-23 07:00:22 +010025void puts(const char *s)
26{
27 ub_puts(s);
28}
29
Ingo van Lil3eb90ba2009-11-24 14:09:21 +010030void __udelay(unsigned long usec)
Rafal Jaworowski500856e2008-01-09 19:39:36 +010031{
32 ub_udelay(usec);
33}
34
Simon Glass09140112020-05-10 11:40:03 -060035int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
Rafal Jaworowski500856e2008-01-09 19:39:36 +010036{
37 ub_reset();
Mike Frysingere0306ca2010-12-19 17:16:53 -050038 return 0;
Rafal Jaworowski500856e2008-01-09 19:39:36 +010039}
40
Rafal Jaworowski63f732d2008-01-29 17:00:34 +010041void *malloc (size_t len)
Rafal Jaworowski500856e2008-01-09 19:39:36 +010042{
43 return NULL;
44}
Rafal Jaworowski63f732d2008-01-29 17:00:34 +010045
Simon Glassdb41d652019-12-28 10:45:07 -070046void hang(void)
Rafal Jaworowski63f732d2008-01-29 17:00:34 +010047{
48 while (1) ;
49}