blob: 3aa222866ff50bbf5f6f37866348e282b30659af [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Rafal Jaworowskia19be782008-01-09 19:39:36 +01002/*
3 * (C) Copyright 2007 Semihalf
4 *
5 * Written by: Rafal Jaworowski <raj@semihalf.com>
6 *
Rafal Jaworowskia19be782008-01-09 19:39:36 +01007 * This is is a set of wrappers/stubs that allow to use certain routines from
Peter Tyser685b7f52010-04-12 22:28:05 -05008 * U-Boot's lib in the standalone app. This way way we can re-use
Rafal Jaworowskia19be782008-01-09 19:39:36 +01009 * existing code e.g. operations on strings and similar.
Rafal Jaworowskia19be782008-01-09 19:39:36 +010010 */
11
12#include <common.h>
Simon Glassed38aef2020-05-10 11:40:03 -060013#include <command.h>
Simon Glassf11478f2019-12-28 10:45:07 -070014#include <hang.h>
Simon Glassdbd79542020-05-10 11:40:11 -060015#include <linux/delay.h>
Rafal Jaworowskia19be782008-01-09 19:39:36 +010016#include <linux/types.h>
17#include <api_public.h>
18
19#include "glue.h"
20
Stefan Roese363ab7b2015-11-23 07:00:22 +010021void putc(const char c)
Rafal Jaworowskia19be782008-01-09 19:39:36 +010022{
Stefan Roese363ab7b2015-11-23 07:00:22 +010023 ub_putc(c);
Rafal Jaworowskia19be782008-01-09 19:39:36 +010024}
25
Stefan Roese363ab7b2015-11-23 07:00:22 +010026void puts(const char *s)
Rafal Jaworowskia19be782008-01-09 19:39:36 +010027{
Stefan Roese363ab7b2015-11-23 07:00:22 +010028 ub_puts(s);
Rafal Jaworowskia19be782008-01-09 19:39:36 +010029}
30
Ingo van Lilf0f778a2009-11-24 14:09:21 +010031void __udelay(unsigned long usec)
Rafal Jaworowskia19be782008-01-09 19:39:36 +010032{
33 ub_udelay(usec);
34}
35
Simon Glassed38aef2020-05-10 11:40:03 -060036int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
Rafal Jaworowskia19be782008-01-09 19:39:36 +010037{
38 ub_reset();
Mike Frysinger1f0a7e32010-12-19 17:16:53 -050039 return 0;
Rafal Jaworowskia19be782008-01-09 19:39:36 +010040}
41
Rafal Jaworowski35e4e8d2008-01-29 17:00:34 +010042void *malloc (size_t len)
Rafal Jaworowskia19be782008-01-09 19:39:36 +010043{
44 return NULL;
45}
Rafal Jaworowski35e4e8d2008-01-29 17:00:34 +010046
Simon Glassf11478f2019-12-28 10:45:07 -070047void hang(void)
Rafal Jaworowski35e4e8d2008-01-29 17:00:34 +010048{
49 while (1) ;
50}