History log of /u-boot/arch/sandbox/cpu/sdl.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 460b2c06 14-Dec-2023 Tom Rini <trini@konsulko.com>

sandbox: Audit config.h and common.h usage

Remove and replace common.h and config.h in sandbox when it's not needed
and add some explicit includes where needed.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 06d3414a 01-Jun-2023 Simon Glass <sjg@chromium.org>

sandbox: Fix quiting when the LCD window is closed

With recent changes to how sandbox handles reset, closing the window
currently just restarts sandbox.

Use the correct sysreset type to tell it to shut down.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 304bc9f4 04-Dec-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: fix sound driver

In the callback function we have to use memcpy(). Otherwise we add
the new samples on top of what is stored in the stream buffer.

If we don't have enough data, zero out the rest of the stream buffer.

Our sampling frequency is 48000. Let the batch size for the callback
function be 960. If we play a multiple of 20 ms, this will always be
a full batch.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 250e735c 19-Nov-2021 Simon Glass <sjg@chromium.org>

video: sandbox: Avoid duplicate display windows

When unit tests are run they currently create a new window. Update the
code so that the old one is removed first. This avoids the confusion as to
which one is active.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 0fe5e948 19-Nov-2021 Simon Glass <sjg@chromium.org>

sandbox: video: Support 8bpp depth

At present sandbox only supports 16 and 32bpp depths, since those are the
easy ones with SDL.

We can support other depths by manually converting the pixel formats. Add
support for this, to enable an 8ppp (monochrome) format.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 350b1d3b 05-Jul-2021 Simon Glass <sjg@chromium.org>

sandbox: Use hinting with the display

SDL provides a hinting feature which provides a higher-quality image
with the double-display option (-K). Enable it.

Signed-off-by: Simon Glass <sjg@chromium.org>

# fcb7e310 05-Jul-2021 Simon Glass <sjg@chromium.org>

sandbox: Add work-around for SDL2 display

At present the display does not show on some machines, e.g. Ubunutu
20.04 but the reason is unknown. Add a work-around until this can be
determined.

Also include more error checking just in case.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 35b65dd8 15-Dec-2020 Harald Seiler <hws@denx.de>

reset: Remove addr parameter from reset_cpu()

Historically, the reset_cpu() function had an `addr` parameter which was
meant to pass in an address of the reset vector location, where the CPU
should reset to. This feature is no longer used anywhere in U-Boot as
all reset_cpu() implementations now ignore the passed value. Generic
code has been added which always calls reset_cpu() with `0` which means
this feature can no longer be used easily anyway.

Over time, many implementations seem to have "misunderstood" the
existence of this parameter as a way to customize/parameterize the reset
(e.g. COLD vs WARM resets). As this is not properly supported, the
code will almost always not do what it is intended to (because all
call-sites just call reset_cpu() with 0).

To avoid confusion and to clean up the codebase from unused left-overs
of the past, remove the `addr` parameter entirely. Code which intends
to support different kinds of resets should be rewritten as a sysreset
driver instead.

This transformation was done with the following coccinelle patch:

@@
expression argvalue;
@@
- reset_cpu(argvalue)
+ reset_cpu()

@@
identifier argname;
type argtype;
@@
- reset_cpu(argtype argname)
+ reset_cpu(void)
{ ... }

Signed-off-by: Harald Seiler <hws@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 18bca1f1 09-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: make SDL window resizable

Without resizing the SDL window showed by

./u-boot -D -l

is not legible on a high resolution screen.

Allow resizing the window

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c4216219 28-Sep-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: add missing SDL key scan codes

Add missing SDL key scan codes, e.g.

* shift, ctrl, meta, alt
* brace/bracket

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6be88c72 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Add an option to double the screen size

On high-DPI displays U-Boot's LCD window can look very small. Add a
-K flag to expand it to make things easier to read, while still using
the existing resolution internally.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>

# 96d0cd46 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Move to use SDL2

Sandbox currently uses SDL1.2. SDL2 has been around for quite a while and
is widely supported. It has a number of useful features. It seems
appropriate to move sandbox over.

Update the code to use SDL2 instead of SDL1.2.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7b7302 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Support waiting for audio to complete

At present when audio stops, any in-progress output is cut off. Fix this
by waiting for output to finish.

Also use booleans for the boolean variables.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 5f736f8e 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Improve error handling

A few errors are not checked. Fix these and use my preferred spelling for
init.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c127f191 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: Add comments to the sdl struct

Add comments for each struct member. Drop frequency since it is not used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 398ae026 17-Dec-2018 Simon Glass <sjg@chromium.org>

sandbox: Correct SDL build flags

The check for CONFIG_SANDBOX_SDL in config.mk does not work since the
build config is not available by the time that file is included. Remove it
so that we always call sdl-config except when NO_SDL is used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e221cdcf 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Allow selection of sample rate and channels

At present these parameters are hard-coded in the sdl interface code.
Allow them to be specified by the driver instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f2b25c9b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sound: Complete migration to driver model

All users of sound are converted to use driver model. Drop the old code
and the CONFIG_DM_SOUND option.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 282e29eb 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: sound: Convert to use driver model

Update sandbox's device tree and config to use driver model for sound. Use
the double buffer for sound output so that we don't need to wait for the
sound to complete before returning.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e625b68b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Update sound to use two buffers

At present we use a single buffer for sound which means we cannot be
playing one sound while queueing up the next. This wouldn't matter except
that a long sound (more than a second) has to be created as a single
buffer, thus using a lot of memory. To better mimic what real sound
drivers do, add support for double buffering in sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1180030d 15-Nov-2018 Simon Glass <sjg@chromium.org>

sandbox: Enable sound

Now that the buffer-overflow bug is fixed, we can enable sound on sandbox.
Drop the code which exits early.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 856b8f56 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: sandbox: Use the correct frequency

At present we request a particular frequency but we may not get the exact
same frequency in response. So use the actual frequency for generation of
the square wave. This ensures that the pitch remains accurate on all host
machines.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7d92b060 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: Add sample rate as a parameter for square wave

At present this value is hard-coded in the function that generates a
square wave. Since sample rates vary between different hardware, it makes
more sense to have this as a parameter.

Update the function and its users.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# bbc09bf2 27-Feb-2014 Simon Glass <sjg@chromium.org>

sandbox: Add SDL library for LCD, keyboard, audio

SDL (Simple DirectMedia Layer - see www.libsdl.org) is a library which
provides simple graphics and sound features. It works under X11 and also
with a simple frame buffer interface. It is ideally suited to sandbox
U-Boot since it fits nicely with the low-level feature set required by
U-Boot. For example, U-Boot has its own font drawing routines, its own
keyboard processing and just needs raw sound output.

We can use SDL to provide emulation of these basic functions for sandbox.
This significantly expands the testing that is possible with sandbox.

Add a basic SDL library which we will use in future commits.

Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>

# 06d3414a 01-Jun-2023 Simon Glass <sjg@chromium.org>

sandbox: Fix quiting when the LCD window is closed

With recent changes to how sandbox handles reset, closing the window
currently just restarts sandbox.

Use the correct sysreset type to tell it to shut down.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 304bc9f4 04-Dec-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: fix sound driver

In the callback function we have to use memcpy(). Otherwise we add
the new samples on top of what is stored in the stream buffer.

If we don't have enough data, zero out the rest of the stream buffer.

Our sampling frequency is 48000. Let the batch size for the callback
function be 960. If we play a multiple of 20 ms, this will always be
a full batch.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 250e735c 19-Nov-2021 Simon Glass <sjg@chromium.org>

video: sandbox: Avoid duplicate display windows

When unit tests are run they currently create a new window. Update the
code so that the old one is removed first. This avoids the confusion as to
which one is active.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 0fe5e948 19-Nov-2021 Simon Glass <sjg@chromium.org>

sandbox: video: Support 8bpp depth

At present sandbox only supports 16 and 32bpp depths, since those are the
easy ones with SDL.

We can support other depths by manually converting the pixel formats. Add
support for this, to enable an 8ppp (monochrome) format.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 350b1d3b 05-Jul-2021 Simon Glass <sjg@chromium.org>

sandbox: Use hinting with the display

SDL provides a hinting feature which provides a higher-quality image
with the double-display option (-K). Enable it.

Signed-off-by: Simon Glass <sjg@chromium.org>

# fcb7e310 05-Jul-2021 Simon Glass <sjg@chromium.org>

sandbox: Add work-around for SDL2 display

At present the display does not show on some machines, e.g. Ubunutu
20.04 but the reason is unknown. Add a work-around until this can be
determined.

Also include more error checking just in case.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 35b65dd8 15-Dec-2020 Harald Seiler <hws@denx.de>

reset: Remove addr parameter from reset_cpu()

Historically, the reset_cpu() function had an `addr` parameter which was
meant to pass in an address of the reset vector location, where the CPU
should reset to. This feature is no longer used anywhere in U-Boot as
all reset_cpu() implementations now ignore the passed value. Generic
code has been added which always calls reset_cpu() with `0` which means
this feature can no longer be used easily anyway.

Over time, many implementations seem to have "misunderstood" the
existence of this parameter as a way to customize/parameterize the reset
(e.g. COLD vs WARM resets). As this is not properly supported, the
code will almost always not do what it is intended to (because all
call-sites just call reset_cpu() with 0).

To avoid confusion and to clean up the codebase from unused left-overs
of the past, remove the `addr` parameter entirely. Code which intends
to support different kinds of resets should be rewritten as a sysreset
driver instead.

This transformation was done with the following coccinelle patch:

@@
expression argvalue;
@@
- reset_cpu(argvalue)
+ reset_cpu()

@@
identifier argname;
type argtype;
@@
- reset_cpu(argtype argname)
+ reset_cpu(void)
{ ... }

Signed-off-by: Harald Seiler <hws@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 18bca1f1 09-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: make SDL window resizable

Without resizing the SDL window showed by

./u-boot -D -l

is not legible on a high resolution screen.

Allow resizing the window

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c4216219 28-Sep-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: add missing SDL key scan codes

Add missing SDL key scan codes, e.g.

* shift, ctrl, meta, alt
* brace/bracket

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6be88c72 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Add an option to double the screen size

On high-DPI displays U-Boot's LCD window can look very small. Add a
-K flag to expand it to make things easier to read, while still using
the existing resolution internally.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>

# 96d0cd46 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Move to use SDL2

Sandbox currently uses SDL1.2. SDL2 has been around for quite a while and
is widely supported. It has a number of useful features. It seems
appropriate to move sandbox over.

Update the code to use SDL2 instead of SDL1.2.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7b7302 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Support waiting for audio to complete

At present when audio stops, any in-progress output is cut off. Fix this
by waiting for output to finish.

Also use booleans for the boolean variables.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 5f736f8e 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Improve error handling

A few errors are not checked. Fix these and use my preferred spelling for
init.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c127f191 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: Add comments to the sdl struct

Add comments for each struct member. Drop frequency since it is not used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 398ae026 17-Dec-2018 Simon Glass <sjg@chromium.org>

sandbox: Correct SDL build flags

The check for CONFIG_SANDBOX_SDL in config.mk does not work since the
build config is not available by the time that file is included. Remove it
so that we always call sdl-config except when NO_SDL is used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e221cdcf 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Allow selection of sample rate and channels

At present these parameters are hard-coded in the sdl interface code.
Allow them to be specified by the driver instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f2b25c9b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sound: Complete migration to driver model

All users of sound are converted to use driver model. Drop the old code
and the CONFIG_DM_SOUND option.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 282e29eb 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: sound: Convert to use driver model

Update sandbox's device tree and config to use driver model for sound. Use
the double buffer for sound output so that we don't need to wait for the
sound to complete before returning.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e625b68b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Update sound to use two buffers

At present we use a single buffer for sound which means we cannot be
playing one sound while queueing up the next. This wouldn't matter except
that a long sound (more than a second) has to be created as a single
buffer, thus using a lot of memory. To better mimic what real sound
drivers do, add support for double buffering in sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1180030d 15-Nov-2018 Simon Glass <sjg@chromium.org>

sandbox: Enable sound

Now that the buffer-overflow bug is fixed, we can enable sound on sandbox.
Drop the code which exits early.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 856b8f56 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: sandbox: Use the correct frequency

At present we request a particular frequency but we may not get the exact
same frequency in response. So use the actual frequency for generation of
the square wave. This ensures that the pitch remains accurate on all host
machines.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7d92b060 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: Add sample rate as a parameter for square wave

At present this value is hard-coded in the function that generates a
square wave. Since sample rates vary between different hardware, it makes
more sense to have this as a parameter.

Update the function and its users.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# bbc09bf2 27-Feb-2014 Simon Glass <sjg@chromium.org>

sandbox: Add SDL library for LCD, keyboard, audio

SDL (Simple DirectMedia Layer - see www.libsdl.org) is a library which
provides simple graphics and sound features. It works under X11 and also
with a simple frame buffer interface. It is ideally suited to sandbox
U-Boot since it fits nicely with the low-level feature set required by
U-Boot. For example, U-Boot has its own font drawing routines, its own
keyboard processing and just needs raw sound output.

We can use SDL to provide emulation of these basic functions for sandbox.
This significantly expands the testing that is possible with sandbox.

Add a basic SDL library which we will use in future commits.

Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>

# 304bc9f4 04-Dec-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: fix sound driver

In the callback function we have to use memcpy(). Otherwise we add
the new samples on top of what is stored in the stream buffer.

If we don't have enough data, zero out the rest of the stream buffer.

Our sampling frequency is 48000. Let the batch size for the callback
function be 960. If we play a multiple of 20 ms, this will always be
a full batch.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 250e735c 19-Nov-2021 Simon Glass <sjg@chromium.org>

video: sandbox: Avoid duplicate display windows

When unit tests are run they currently create a new window. Update the
code so that the old one is removed first. This avoids the confusion as to
which one is active.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 0fe5e948 19-Nov-2021 Simon Glass <sjg@chromium.org>

sandbox: video: Support 8bpp depth

At present sandbox only supports 16 and 32bpp depths, since those are the
easy ones with SDL.

We can support other depths by manually converting the pixel formats. Add
support for this, to enable an 8ppp (monochrome) format.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 350b1d3b 05-Jul-2021 Simon Glass <sjg@chromium.org>

sandbox: Use hinting with the display

SDL provides a hinting feature which provides a higher-quality image
with the double-display option (-K). Enable it.

Signed-off-by: Simon Glass <sjg@chromium.org>

# fcb7e310 05-Jul-2021 Simon Glass <sjg@chromium.org>

sandbox: Add work-around for SDL2 display

At present the display does not show on some machines, e.g. Ubunutu
20.04 but the reason is unknown. Add a work-around until this can be
determined.

Also include more error checking just in case.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 35b65dd8 15-Dec-2020 Harald Seiler <hws@denx.de>

reset: Remove addr parameter from reset_cpu()

Historically, the reset_cpu() function had an `addr` parameter which was
meant to pass in an address of the reset vector location, where the CPU
should reset to. This feature is no longer used anywhere in U-Boot as
all reset_cpu() implementations now ignore the passed value. Generic
code has been added which always calls reset_cpu() with `0` which means
this feature can no longer be used easily anyway.

Over time, many implementations seem to have "misunderstood" the
existence of this parameter as a way to customize/parameterize the reset
(e.g. COLD vs WARM resets). As this is not properly supported, the
code will almost always not do what it is intended to (because all
call-sites just call reset_cpu() with 0).

To avoid confusion and to clean up the codebase from unused left-overs
of the past, remove the `addr` parameter entirely. Code which intends
to support different kinds of resets should be rewritten as a sysreset
driver instead.

This transformation was done with the following coccinelle patch:

@@
expression argvalue;
@@
- reset_cpu(argvalue)
+ reset_cpu()

@@
identifier argname;
type argtype;
@@
- reset_cpu(argtype argname)
+ reset_cpu(void)
{ ... }

Signed-off-by: Harald Seiler <hws@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 18bca1f1 09-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: make SDL window resizable

Without resizing the SDL window showed by

./u-boot -D -l

is not legible on a high resolution screen.

Allow resizing the window

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c4216219 28-Sep-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: add missing SDL key scan codes

Add missing SDL key scan codes, e.g.

* shift, ctrl, meta, alt
* brace/bracket

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6be88c72 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Add an option to double the screen size

On high-DPI displays U-Boot's LCD window can look very small. Add a
-K flag to expand it to make things easier to read, while still using
the existing resolution internally.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>

# 96d0cd46 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Move to use SDL2

Sandbox currently uses SDL1.2. SDL2 has been around for quite a while and
is widely supported. It has a number of useful features. It seems
appropriate to move sandbox over.

Update the code to use SDL2 instead of SDL1.2.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7b7302 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Support waiting for audio to complete

At present when audio stops, any in-progress output is cut off. Fix this
by waiting for output to finish.

Also use booleans for the boolean variables.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 5f736f8e 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Improve error handling

A few errors are not checked. Fix these and use my preferred spelling for
init.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c127f191 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: Add comments to the sdl struct

Add comments for each struct member. Drop frequency since it is not used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 398ae026 17-Dec-2018 Simon Glass <sjg@chromium.org>

sandbox: Correct SDL build flags

The check for CONFIG_SANDBOX_SDL in config.mk does not work since the
build config is not available by the time that file is included. Remove it
so that we always call sdl-config except when NO_SDL is used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e221cdcf 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Allow selection of sample rate and channels

At present these parameters are hard-coded in the sdl interface code.
Allow them to be specified by the driver instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f2b25c9b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sound: Complete migration to driver model

All users of sound are converted to use driver model. Drop the old code
and the CONFIG_DM_SOUND option.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 282e29eb 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: sound: Convert to use driver model

Update sandbox's device tree and config to use driver model for sound. Use
the double buffer for sound output so that we don't need to wait for the
sound to complete before returning.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e625b68b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Update sound to use two buffers

At present we use a single buffer for sound which means we cannot be
playing one sound while queueing up the next. This wouldn't matter except
that a long sound (more than a second) has to be created as a single
buffer, thus using a lot of memory. To better mimic what real sound
drivers do, add support for double buffering in sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1180030d 15-Nov-2018 Simon Glass <sjg@chromium.org>

sandbox: Enable sound

Now that the buffer-overflow bug is fixed, we can enable sound on sandbox.
Drop the code which exits early.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 856b8f56 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: sandbox: Use the correct frequency

At present we request a particular frequency but we may not get the exact
same frequency in response. So use the actual frequency for generation of
the square wave. This ensures that the pitch remains accurate on all host
machines.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7d92b060 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: Add sample rate as a parameter for square wave

At present this value is hard-coded in the function that generates a
square wave. Since sample rates vary between different hardware, it makes
more sense to have this as a parameter.

Update the function and its users.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# bbc09bf2 27-Feb-2014 Simon Glass <sjg@chromium.org>

sandbox: Add SDL library for LCD, keyboard, audio

SDL (Simple DirectMedia Layer - see www.libsdl.org) is a library which
provides simple graphics and sound features. It works under X11 and also
with a simple frame buffer interface. It is ideally suited to sandbox
U-Boot since it fits nicely with the low-level feature set required by
U-Boot. For example, U-Boot has its own font drawing routines, its own
keyboard processing and just needs raw sound output.

We can use SDL to provide emulation of these basic functions for sandbox.
This significantly expands the testing that is possible with sandbox.

Add a basic SDL library which we will use in future commits.

Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>

# 250e735c 19-Nov-2021 Simon Glass <sjg@chromium.org>

video: sandbox: Avoid duplicate display windows

When unit tests are run they currently create a new window. Update the
code so that the old one is removed first. This avoids the confusion as to
which one is active.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 0fe5e948 19-Nov-2021 Simon Glass <sjg@chromium.org>

sandbox: video: Support 8bpp depth

At present sandbox only supports 16 and 32bpp depths, since those are the
easy ones with SDL.

We can support other depths by manually converting the pixel formats. Add
support for this, to enable an 8ppp (monochrome) format.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 350b1d3b 05-Jul-2021 Simon Glass <sjg@chromium.org>

sandbox: Use hinting with the display

SDL provides a hinting feature which provides a higher-quality image
with the double-display option (-K). Enable it.

Signed-off-by: Simon Glass <sjg@chromium.org>

# fcb7e310 05-Jul-2021 Simon Glass <sjg@chromium.org>

sandbox: Add work-around for SDL2 display

At present the display does not show on some machines, e.g. Ubunutu
20.04 but the reason is unknown. Add a work-around until this can be
determined.

Also include more error checking just in case.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 35b65dd8 15-Dec-2020 Harald Seiler <hws@denx.de>

reset: Remove addr parameter from reset_cpu()

Historically, the reset_cpu() function had an `addr` parameter which was
meant to pass in an address of the reset vector location, where the CPU
should reset to. This feature is no longer used anywhere in U-Boot as
all reset_cpu() implementations now ignore the passed value. Generic
code has been added which always calls reset_cpu() with `0` which means
this feature can no longer be used easily anyway.

Over time, many implementations seem to have "misunderstood" the
existence of this parameter as a way to customize/parameterize the reset
(e.g. COLD vs WARM resets). As this is not properly supported, the
code will almost always not do what it is intended to (because all
call-sites just call reset_cpu() with 0).

To avoid confusion and to clean up the codebase from unused left-overs
of the past, remove the `addr` parameter entirely. Code which intends
to support different kinds of resets should be rewritten as a sysreset
driver instead.

This transformation was done with the following coccinelle patch:

@@
expression argvalue;
@@
- reset_cpu(argvalue)
+ reset_cpu()

@@
identifier argname;
type argtype;
@@
- reset_cpu(argtype argname)
+ reset_cpu(void)
{ ... }

Signed-off-by: Harald Seiler <hws@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 18bca1f1 09-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: make SDL window resizable

Without resizing the SDL window showed by

./u-boot -D -l

is not legible on a high resolution screen.

Allow resizing the window

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c4216219 28-Sep-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: add missing SDL key scan codes

Add missing SDL key scan codes, e.g.

* shift, ctrl, meta, alt
* brace/bracket

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6be88c72 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Add an option to double the screen size

On high-DPI displays U-Boot's LCD window can look very small. Add a
-K flag to expand it to make things easier to read, while still using
the existing resolution internally.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>

# 96d0cd46 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Move to use SDL2

Sandbox currently uses SDL1.2. SDL2 has been around for quite a while and
is widely supported. It has a number of useful features. It seems
appropriate to move sandbox over.

Update the code to use SDL2 instead of SDL1.2.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7b7302 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Support waiting for audio to complete

At present when audio stops, any in-progress output is cut off. Fix this
by waiting for output to finish.

Also use booleans for the boolean variables.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 5f736f8e 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Improve error handling

A few errors are not checked. Fix these and use my preferred spelling for
init.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c127f191 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: Add comments to the sdl struct

Add comments for each struct member. Drop frequency since it is not used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 398ae026 17-Dec-2018 Simon Glass <sjg@chromium.org>

sandbox: Correct SDL build flags

The check for CONFIG_SANDBOX_SDL in config.mk does not work since the
build config is not available by the time that file is included. Remove it
so that we always call sdl-config except when NO_SDL is used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e221cdcf 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Allow selection of sample rate and channels

At present these parameters are hard-coded in the sdl interface code.
Allow them to be specified by the driver instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f2b25c9b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sound: Complete migration to driver model

All users of sound are converted to use driver model. Drop the old code
and the CONFIG_DM_SOUND option.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 282e29eb 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: sound: Convert to use driver model

Update sandbox's device tree and config to use driver model for sound. Use
the double buffer for sound output so that we don't need to wait for the
sound to complete before returning.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e625b68b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Update sound to use two buffers

At present we use a single buffer for sound which means we cannot be
playing one sound while queueing up the next. This wouldn't matter except
that a long sound (more than a second) has to be created as a single
buffer, thus using a lot of memory. To better mimic what real sound
drivers do, add support for double buffering in sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1180030d 15-Nov-2018 Simon Glass <sjg@chromium.org>

sandbox: Enable sound

Now that the buffer-overflow bug is fixed, we can enable sound on sandbox.
Drop the code which exits early.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 856b8f56 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: sandbox: Use the correct frequency

At present we request a particular frequency but we may not get the exact
same frequency in response. So use the actual frequency for generation of
the square wave. This ensures that the pitch remains accurate on all host
machines.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7d92b060 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: Add sample rate as a parameter for square wave

At present this value is hard-coded in the function that generates a
square wave. Since sample rates vary between different hardware, it makes
more sense to have this as a parameter.

Update the function and its users.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# bbc09bf2 27-Feb-2014 Simon Glass <sjg@chromium.org>

sandbox: Add SDL library for LCD, keyboard, audio

SDL (Simple DirectMedia Layer - see www.libsdl.org) is a library which
provides simple graphics and sound features. It works under X11 and also
with a simple frame buffer interface. It is ideally suited to sandbox
U-Boot since it fits nicely with the low-level feature set required by
U-Boot. For example, U-Boot has its own font drawing routines, its own
keyboard processing and just needs raw sound output.

We can use SDL to provide emulation of these basic functions for sandbox.
This significantly expands the testing that is possible with sandbox.

Add a basic SDL library which we will use in future commits.

Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>

# 350b1d3b 05-Jul-2021 Simon Glass <sjg@chromium.org>

sandbox: Use hinting with the display

SDL provides a hinting feature which provides a higher-quality image
with the double-display option (-K). Enable it.

Signed-off-by: Simon Glass <sjg@chromium.org>

# fcb7e310 05-Jul-2021 Simon Glass <sjg@chromium.org>

sandbox: Add work-around for SDL2 display

At present the display does not show on some machines, e.g. Ubunutu
20.04 but the reason is unknown. Add a work-around until this can be
determined.

Also include more error checking just in case.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 35b65dd8 15-Dec-2020 Harald Seiler <hws@denx.de>

reset: Remove addr parameter from reset_cpu()

Historically, the reset_cpu() function had an `addr` parameter which was
meant to pass in an address of the reset vector location, where the CPU
should reset to. This feature is no longer used anywhere in U-Boot as
all reset_cpu() implementations now ignore the passed value. Generic
code has been added which always calls reset_cpu() with `0` which means
this feature can no longer be used easily anyway.

Over time, many implementations seem to have "misunderstood" the
existence of this parameter as a way to customize/parameterize the reset
(e.g. COLD vs WARM resets). As this is not properly supported, the
code will almost always not do what it is intended to (because all
call-sites just call reset_cpu() with 0).

To avoid confusion and to clean up the codebase from unused left-overs
of the past, remove the `addr` parameter entirely. Code which intends
to support different kinds of resets should be rewritten as a sysreset
driver instead.

This transformation was done with the following coccinelle patch:

@@
expression argvalue;
@@
- reset_cpu(argvalue)
+ reset_cpu()

@@
identifier argname;
type argtype;
@@
- reset_cpu(argtype argname)
+ reset_cpu(void)
{ ... }

Signed-off-by: Harald Seiler <hws@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 18bca1f1 09-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: make SDL window resizable

Without resizing the SDL window showed by

./u-boot -D -l

is not legible on a high resolution screen.

Allow resizing the window

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c4216219 28-Sep-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: add missing SDL key scan codes

Add missing SDL key scan codes, e.g.

* shift, ctrl, meta, alt
* brace/bracket

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6be88c72 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Add an option to double the screen size

On high-DPI displays U-Boot's LCD window can look very small. Add a
-K flag to expand it to make things easier to read, while still using
the existing resolution internally.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>

# 96d0cd46 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Move to use SDL2

Sandbox currently uses SDL1.2. SDL2 has been around for quite a while and
is widely supported. It has a number of useful features. It seems
appropriate to move sandbox over.

Update the code to use SDL2 instead of SDL1.2.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7b7302 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Support waiting for audio to complete

At present when audio stops, any in-progress output is cut off. Fix this
by waiting for output to finish.

Also use booleans for the boolean variables.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 5f736f8e 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Improve error handling

A few errors are not checked. Fix these and use my preferred spelling for
init.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c127f191 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: Add comments to the sdl struct

Add comments for each struct member. Drop frequency since it is not used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 398ae026 17-Dec-2018 Simon Glass <sjg@chromium.org>

sandbox: Correct SDL build flags

The check for CONFIG_SANDBOX_SDL in config.mk does not work since the
build config is not available by the time that file is included. Remove it
so that we always call sdl-config except when NO_SDL is used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e221cdcf 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Allow selection of sample rate and channels

At present these parameters are hard-coded in the sdl interface code.
Allow them to be specified by the driver instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f2b25c9b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sound: Complete migration to driver model

All users of sound are converted to use driver model. Drop the old code
and the CONFIG_DM_SOUND option.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 282e29eb 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: sound: Convert to use driver model

Update sandbox's device tree and config to use driver model for sound. Use
the double buffer for sound output so that we don't need to wait for the
sound to complete before returning.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e625b68b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Update sound to use two buffers

At present we use a single buffer for sound which means we cannot be
playing one sound while queueing up the next. This wouldn't matter except
that a long sound (more than a second) has to be created as a single
buffer, thus using a lot of memory. To better mimic what real sound
drivers do, add support for double buffering in sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1180030d 15-Nov-2018 Simon Glass <sjg@chromium.org>

sandbox: Enable sound

Now that the buffer-overflow bug is fixed, we can enable sound on sandbox.
Drop the code which exits early.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 856b8f56 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: sandbox: Use the correct frequency

At present we request a particular frequency but we may not get the exact
same frequency in response. So use the actual frequency for generation of
the square wave. This ensures that the pitch remains accurate on all host
machines.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7d92b060 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: Add sample rate as a parameter for square wave

At present this value is hard-coded in the function that generates a
square wave. Since sample rates vary between different hardware, it makes
more sense to have this as a parameter.

Update the function and its users.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# bbc09bf2 27-Feb-2014 Simon Glass <sjg@chromium.org>

sandbox: Add SDL library for LCD, keyboard, audio

SDL (Simple DirectMedia Layer - see www.libsdl.org) is a library which
provides simple graphics and sound features. It works under X11 and also
with a simple frame buffer interface. It is ideally suited to sandbox
U-Boot since it fits nicely with the low-level feature set required by
U-Boot. For example, U-Boot has its own font drawing routines, its own
keyboard processing and just needs raw sound output.

We can use SDL to provide emulation of these basic functions for sandbox.
This significantly expands the testing that is possible with sandbox.

Add a basic SDL library which we will use in future commits.

Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>

# 35b65dd8 15-Dec-2020 Harald Seiler <hws@denx.de>

reset: Remove addr parameter from reset_cpu()

Historically, the reset_cpu() function had an `addr` parameter which was
meant to pass in an address of the reset vector location, where the CPU
should reset to. This feature is no longer used anywhere in U-Boot as
all reset_cpu() implementations now ignore the passed value. Generic
code has been added which always calls reset_cpu() with `0` which means
this feature can no longer be used easily anyway.

Over time, many implementations seem to have "misunderstood" the
existence of this parameter as a way to customize/parameterize the reset
(e.g. COLD vs WARM resets). As this is not properly supported, the
code will almost always not do what it is intended to (because all
call-sites just call reset_cpu() with 0).

To avoid confusion and to clean up the codebase from unused left-overs
of the past, remove the `addr` parameter entirely. Code which intends
to support different kinds of resets should be rewritten as a sysreset
driver instead.

This transformation was done with the following coccinelle patch:

@@
expression argvalue;
@@
- reset_cpu(argvalue)
+ reset_cpu()

@@
identifier argname;
type argtype;
@@
- reset_cpu(argtype argname)
+ reset_cpu(void)
{ ... }

Signed-off-by: Harald Seiler <hws@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 18bca1f1 09-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: make SDL window resizable

Without resizing the SDL window showed by

./u-boot -D -l

is not legible on a high resolution screen.

Allow resizing the window

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c4216219 28-Sep-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: add missing SDL key scan codes

Add missing SDL key scan codes, e.g.

* shift, ctrl, meta, alt
* brace/bracket

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6be88c72 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Add an option to double the screen size

On high-DPI displays U-Boot's LCD window can look very small. Add a
-K flag to expand it to make things easier to read, while still using
the existing resolution internally.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>

# 96d0cd46 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Move to use SDL2

Sandbox currently uses SDL1.2. SDL2 has been around for quite a while and
is widely supported. It has a number of useful features. It seems
appropriate to move sandbox over.

Update the code to use SDL2 instead of SDL1.2.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7b7302 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Support waiting for audio to complete

At present when audio stops, any in-progress output is cut off. Fix this
by waiting for output to finish.

Also use booleans for the boolean variables.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 5f736f8e 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Improve error handling

A few errors are not checked. Fix these and use my preferred spelling for
init.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c127f191 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: Add comments to the sdl struct

Add comments for each struct member. Drop frequency since it is not used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 398ae026 17-Dec-2018 Simon Glass <sjg@chromium.org>

sandbox: Correct SDL build flags

The check for CONFIG_SANDBOX_SDL in config.mk does not work since the
build config is not available by the time that file is included. Remove it
so that we always call sdl-config except when NO_SDL is used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e221cdcf 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Allow selection of sample rate and channels

At present these parameters are hard-coded in the sdl interface code.
Allow them to be specified by the driver instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f2b25c9b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sound: Complete migration to driver model

All users of sound are converted to use driver model. Drop the old code
and the CONFIG_DM_SOUND option.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 282e29eb 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: sound: Convert to use driver model

Update sandbox's device tree and config to use driver model for sound. Use
the double buffer for sound output so that we don't need to wait for the
sound to complete before returning.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e625b68b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Update sound to use two buffers

At present we use a single buffer for sound which means we cannot be
playing one sound while queueing up the next. This wouldn't matter except
that a long sound (more than a second) has to be created as a single
buffer, thus using a lot of memory. To better mimic what real sound
drivers do, add support for double buffering in sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1180030d 15-Nov-2018 Simon Glass <sjg@chromium.org>

sandbox: Enable sound

Now that the buffer-overflow bug is fixed, we can enable sound on sandbox.
Drop the code which exits early.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 856b8f56 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: sandbox: Use the correct frequency

At present we request a particular frequency but we may not get the exact
same frequency in response. So use the actual frequency for generation of
the square wave. This ensures that the pitch remains accurate on all host
machines.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7d92b060 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: Add sample rate as a parameter for square wave

At present this value is hard-coded in the function that generates a
square wave. Since sample rates vary between different hardware, it makes
more sense to have this as a parameter.

Update the function and its users.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# bbc09bf2 27-Feb-2014 Simon Glass <sjg@chromium.org>

sandbox: Add SDL library for LCD, keyboard, audio

SDL (Simple DirectMedia Layer - see www.libsdl.org) is a library which
provides simple graphics and sound features. It works under X11 and also
with a simple frame buffer interface. It is ideally suited to sandbox
U-Boot since it fits nicely with the low-level feature set required by
U-Boot. For example, U-Boot has its own font drawing routines, its own
keyboard processing and just needs raw sound output.

We can use SDL to provide emulation of these basic functions for sandbox.
This significantly expands the testing that is possible with sandbox.

Add a basic SDL library which we will use in future commits.

Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>

# 18bca1f1 09-Oct-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: make SDL window resizable

Without resizing the SDL window showed by

./u-boot -D -l

is not legible on a high resolution screen.

Allow resizing the window

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# c4216219 28-Sep-2020 Heinrich Schuchardt <xypron.glpk@gmx.de>

sandbox: add missing SDL key scan codes

Add missing SDL key scan codes, e.g.

* shift, ctrl, meta, alt
* brace/bracket

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6be88c72 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Add an option to double the screen size

On high-DPI displays U-Boot's LCD window can look very small. Add a
-K flag to expand it to make things easier to read, while still using
the existing resolution internally.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>

# 96d0cd46 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Move to use SDL2

Sandbox currently uses SDL1.2. SDL2 has been around for quite a while and
is widely supported. It has a number of useful features. It seems
appropriate to move sandbox over.

Update the code to use SDL2 instead of SDL1.2.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7b7302 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Support waiting for audio to complete

At present when audio stops, any in-progress output is cut off. Fix this
by waiting for output to finish.

Also use booleans for the boolean variables.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 5f736f8e 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Improve error handling

A few errors are not checked. Fix these and use my preferred spelling for
init.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c127f191 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: Add comments to the sdl struct

Add comments for each struct member. Drop frequency since it is not used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 398ae026 17-Dec-2018 Simon Glass <sjg@chromium.org>

sandbox: Correct SDL build flags

The check for CONFIG_SANDBOX_SDL in config.mk does not work since the
build config is not available by the time that file is included. Remove it
so that we always call sdl-config except when NO_SDL is used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e221cdcf 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Allow selection of sample rate and channels

At present these parameters are hard-coded in the sdl interface code.
Allow them to be specified by the driver instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f2b25c9b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sound: Complete migration to driver model

All users of sound are converted to use driver model. Drop the old code
and the CONFIG_DM_SOUND option.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 282e29eb 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: sound: Convert to use driver model

Update sandbox's device tree and config to use driver model for sound. Use
the double buffer for sound output so that we don't need to wait for the
sound to complete before returning.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e625b68b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Update sound to use two buffers

At present we use a single buffer for sound which means we cannot be
playing one sound while queueing up the next. This wouldn't matter except
that a long sound (more than a second) has to be created as a single
buffer, thus using a lot of memory. To better mimic what real sound
drivers do, add support for double buffering in sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1180030d 15-Nov-2018 Simon Glass <sjg@chromium.org>

sandbox: Enable sound

Now that the buffer-overflow bug is fixed, we can enable sound on sandbox.
Drop the code which exits early.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 856b8f56 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: sandbox: Use the correct frequency

At present we request a particular frequency but we may not get the exact
same frequency in response. So use the actual frequency for generation of
the square wave. This ensures that the pitch remains accurate on all host
machines.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7d92b060 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: Add sample rate as a parameter for square wave

At present this value is hard-coded in the function that generates a
square wave. Since sample rates vary between different hardware, it makes
more sense to have this as a parameter.

Update the function and its users.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# bbc09bf2 27-Feb-2014 Simon Glass <sjg@chromium.org>

sandbox: Add SDL library for LCD, keyboard, audio

SDL (Simple DirectMedia Layer - see www.libsdl.org) is a library which
provides simple graphics and sound features. It works under X11 and also
with a simple frame buffer interface. It is ideally suited to sandbox
U-Boot since it fits nicely with the low-level feature set required by
U-Boot. For example, U-Boot has its own font drawing routines, its own
keyboard processing and just needs raw sound output.

We can use SDL to provide emulation of these basic functions for sandbox.
This significantly expands the testing that is possible with sandbox.

Add a basic SDL library which we will use in future commits.

Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>

# 6be88c72 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Add an option to double the screen size

On high-DPI displays U-Boot's LCD window can look very small. Add a
-K flag to expand it to make things easier to read, while still using
the existing resolution internally.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>

# 96d0cd46 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Move to use SDL2

Sandbox currently uses SDL1.2. SDL2 has been around for quite a while and
is widely supported. It has a number of useful features. It seems
appropriate to move sandbox over.

Update the code to use SDL2 instead of SDL1.2.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ac7b7302 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Support waiting for audio to complete

At present when audio stops, any in-progress output is cut off. Fix this
by waiting for output to finish.

Also use booleans for the boolean variables.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 5f736f8e 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: sdl: Improve error handling

A few errors are not checked. Fix these and use my preferred spelling for
init.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c127f191 03-Feb-2020 Simon Glass <sjg@chromium.org>

sandbox: Add comments to the sdl struct

Add comments for each struct member. Drop frequency since it is not used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 398ae026 17-Dec-2018 Simon Glass <sjg@chromium.org>

sandbox: Correct SDL build flags

The check for CONFIG_SANDBOX_SDL in config.mk does not work since the
build config is not available by the time that file is included. Remove it
so that we always call sdl-config except when NO_SDL is used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e221cdcf 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Allow selection of sample rate and channels

At present these parameters are hard-coded in the sdl interface code.
Allow them to be specified by the driver instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f2b25c9b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sound: Complete migration to driver model

All users of sound are converted to use driver model. Drop the old code
and the CONFIG_DM_SOUND option.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 282e29eb 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: sound: Convert to use driver model

Update sandbox's device tree and config to use driver model for sound. Use
the double buffer for sound output so that we don't need to wait for the
sound to complete before returning.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e625b68b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Update sound to use two buffers

At present we use a single buffer for sound which means we cannot be
playing one sound while queueing up the next. This wouldn't matter except
that a long sound (more than a second) has to be created as a single
buffer, thus using a lot of memory. To better mimic what real sound
drivers do, add support for double buffering in sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1180030d 15-Nov-2018 Simon Glass <sjg@chromium.org>

sandbox: Enable sound

Now that the buffer-overflow bug is fixed, we can enable sound on sandbox.
Drop the code which exits early.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 856b8f56 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: sandbox: Use the correct frequency

At present we request a particular frequency but we may not get the exact
same frequency in response. So use the actual frequency for generation of
the square wave. This ensures that the pitch remains accurate on all host
machines.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7d92b060 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: Add sample rate as a parameter for square wave

At present this value is hard-coded in the function that generates a
square wave. Since sample rates vary between different hardware, it makes
more sense to have this as a parameter.

Update the function and its users.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# bbc09bf2 27-Feb-2014 Simon Glass <sjg@chromium.org>

sandbox: Add SDL library for LCD, keyboard, audio

SDL (Simple DirectMedia Layer - see www.libsdl.org) is a library which
provides simple graphics and sound features. It works under X11 and also
with a simple frame buffer interface. It is ideally suited to sandbox
U-Boot since it fits nicely with the low-level feature set required by
U-Boot. For example, U-Boot has its own font drawing routines, its own
keyboard processing and just needs raw sound output.

We can use SDL to provide emulation of these basic functions for sandbox.
This significantly expands the testing that is possible with sandbox.

Add a basic SDL library which we will use in future commits.

Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>

# 398ae026 17-Dec-2018 Simon Glass <sjg@chromium.org>

sandbox: Correct SDL build flags

The check for CONFIG_SANDBOX_SDL in config.mk does not work since the
build config is not available by the time that file is included. Remove it
so that we always call sdl-config except when NO_SDL is used.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e221cdcf 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Allow selection of sample rate and channels

At present these parameters are hard-coded in the sdl interface code.
Allow them to be specified by the driver instead.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f2b25c9b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sound: Complete migration to driver model

All users of sound are converted to use driver model. Drop the old code
and the CONFIG_DM_SOUND option.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 282e29eb 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: sound: Convert to use driver model

Update sandbox's device tree and config to use driver model for sound. Use
the double buffer for sound output so that we don't need to wait for the
sound to complete before returning.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e625b68b 10-Dec-2018 Simon Glass <sjg@chromium.org>

dm: sandbox: Update sound to use two buffers

At present we use a single buffer for sound which means we cannot be
playing one sound while queueing up the next. This wouldn't matter except
that a long sound (more than a second) has to be created as a single
buffer, thus using a lot of memory. To better mimic what real sound
drivers do, add support for double buffering in sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1180030d 15-Nov-2018 Simon Glass <sjg@chromium.org>

sandbox: Enable sound

Now that the buffer-overflow bug is fixed, we can enable sound on sandbox.
Drop the code which exits early.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 856b8f56 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: sandbox: Use the correct frequency

At present we request a particular frequency but we may not get the exact
same frequency in response. So use the actual frequency for generation of
the square wave. This ensures that the pitch remains accurate on all host
machines.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7d92b060 15-Nov-2018 Simon Glass <sjg@chromium.org>

sound: Add sample rate as a parameter for square wave

At present this value is hard-coded in the function that generates a
square wave. Since sample rates vary between different hardware, it makes
more sense to have this as a parameter.

Update the function and its users.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# bbc09bf2 27-Feb-2014 Simon Glass <sjg@chromium.org>

sandbox: Add SDL library for LCD, keyboard, audio

SDL (Simple DirectMedia Layer - see www.libsdl.org) is a library which
provides simple graphics and sound features. It works under X11 and also
with a simple frame buffer interface. It is ideally suited to sandbox
U-Boot since it fits nicely with the low-level feature set required by
U-Boot. For example, U-Boot has its own font drawing routines, its own
keyboard processing and just needs raw sound output.

We can use SDL to provide emulation of these basic functions for sandbox.
This significantly expands the testing that is possible with sandbox.

Add a basic SDL library which we will use in future commits.

Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>


# bbc09bf2 27-Feb-2014 Simon Glass <sjg@chromium.org>

sandbox: Add SDL library for LCD, keyboard, audio

SDL (Simple DirectMedia Layer - see www.libsdl.org) is a library which
provides simple graphics and sound features. It works under X11 and also
with a simple frame buffer interface. It is ideally suited to sandbox
U-Boot since it fits nicely with the low-level feature set required by
U-Boot. For example, U-Boot has its own font drawing routines, its own
keyboard processing and just needs raw sound output.

We can use SDL to provide emulation of these basic functions for sandbox.
This significantly expands the testing that is possible with sandbox.

Add a basic SDL library which we will use in future commits.

Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>