Skip to content

Commit

Permalink
Merge tag 'dm-pull-10feb19' of git://git.denx.de/u-boot-dm
Browse files Browse the repository at this point in the history
Samsung sound patches (applied for Samsung maintainer)
Common sound support
buildman environment support
of-platdata documentation improvements
  • Loading branch information
trini committed Feb 10, 2019
2 parents 2e85607 + afcd645 commit 151b833
Show file tree
Hide file tree
Showing 42 changed files with 829 additions and 240 deletions.
77 changes: 57 additions & 20 deletions arch/arm/dts/exynos5250-spring.dts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,46 @@
reg = <0x40000000 0x80000000>;
};

iram {
reg = <0x02020000 0x60000>;
};

config {
samsung,bl1-offset = <0x1400>;
samsung,bl2-offset = <0x3400>;
u-boot-memory = "/memory";
u-boot-offset = <0x3e00000 0x100000>;
};

flash@0 {
spl { /* spl size override */
size = <0x8000>;
reg = <0 0x100000>;
#address-cells = <1>;
#size-cells = <1>;
pre-boot {
label = "bl1 pre-boot";
reg = <0 0x2000>;
read-only;
filename = "e5250.nbl1.bin";
type = "blob exynos-bl1";
required;
};

spl {
label = "bl2 spl";
reg = <0x2000 0x8000>;
read-only;
filename = "bl2.bin";
type = "blob exynos-bl2 boot,dtb";
payload = "/flash/ro-boot";
required;
};

ro-boot {
label = "u-boot";
reg = <0xa000 0xb0000>;
read-only;
type = "blob boot,dtb";
required;
};
};

Expand Down Expand Up @@ -93,6 +130,22 @@
samsung,vbus-gpio = <&gpx2 7 GPIO_ACTIVE_HIGH>;
};

sound {
compatible = "google,spring-audio-max98088";

samsung,model = "Spring-I2S-MAX98088";
samsung,audio-codec = <&max98088>;
codec-enable-gpio = <&gpx1 7 0>;

cpu {
sound-dai = <&i2s1 0>;
};

codec {
sound-dai = <&max98088 0>;
};
};

spi@12d30000 {
spi-max-frequency = <50000000>;
firmware_storage_spi: flash@0 {
Expand Down Expand Up @@ -638,27 +691,11 @@
};
};

max98095: soundcodec@10 {
max98088: soundcodec@10 {
reg = <0x10>;
compatible = "maxim,max98095";
compatible = "maxim,max98088";
#sound-dai-cells = <1>;
};

sound {
compatible = "google,spring-audio-max98095";

samsung,model = "Spring-I2S-MAX98095";
samsung,audio-codec = <&max98095>;

cpu {
sound-dai = <&i2s0 0>;
};

codec {
sound-dai = <&max98095 0>;
};
};

};

#include "cros-ec-keyboard.dtsi"
7 changes: 7 additions & 0 deletions arch/arm/mach-exynos/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ config ARCH_EXYNOS4
bool "Exynos4 SoC family"
select BOARD_EARLY_INIT_F
select CPU_V7A
select BLK
select DM_MMC
help
Samsung Exynos4 SoC family are based on ARM Cortex-A9 CPU. There
are multiple SoCs in this family including Exynos4210, Exynos4412,
Expand All @@ -24,6 +26,9 @@ config ARCH_EXYNOS5
imply USB_ETHER_ASIX
imply USB_ETHER_RTL8152
imply USB_ETHER_SMSC95XX
select BLK
select DM_MMC

help
Samsung Exynos5 SoC family are based on ARM Cortex-A15 CPU (and
Cortex-A7 CPU in big.LITTLE configuration). There are multiple SoCs
Expand All @@ -33,6 +38,8 @@ config ARCH_EXYNOS7
bool "Exynos7 SoC family"
select ARM64
select BOARD_EARLY_INIT_F
select BLK
select DM_MMC
help
Samsung Exynos7 SoC family are based on ARM Cortex-A57 CPU or
Cortex-A53 CPU (and some in a big.LITTLE configuration). There are
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-exynos/include/mach/mmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,4 @@ static inline int s5p_mmc_init(int index, int bus_width)
return s5p_sdhci_init(base, index, bus_width);
}

int exynos_mmc_init(const void *blob);

#endif
2 changes: 2 additions & 0 deletions arch/arm/mach-s5pc1xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ choice
config TARGET_S5P_GONI
bool "S5P Goni board"
select OF_CONTROL
select BLK
select DM_MMC

config TARGET_SMDKC100
bool "Support smdkc100 board"
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-s5pc1xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ obj-y = cache.o
obj-y += reset.o

obj-y += clock.o
obj-y += pinmux.o
20 changes: 20 additions & 0 deletions arch/arm/mach-s5pc1xx/pinmux.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Dummy functions to keep s5p_goni building (although it won't work)
*
* Copyright 2018 Google LLC
* Written by Simon Glass <[email protected]>
*/

#include <common.h>
#include <asm/arch/pinmux.h>

int exynos_pinmux_config(int peripheral, int flags)
{
return 0;
}

int pinmux_decode_periph_id(const void *blob, int node)
{
return 0;
}
52 changes: 6 additions & 46 deletions board/samsung/common/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,56 +249,16 @@ int board_eth_init(bd_t *bis)
return 0;
}

#ifdef CONFIG_MMC
static int init_mmc(void)
{
#ifdef CONFIG_MMC_SDHCI
return exynos_mmc_init(gd->fdt_blob);
#else
return 0;
#endif
}

static int init_dwmmc(void)
{
#ifdef CONFIG_MMC_DW
return exynos_dwmmc_init(gd->fdt_blob);
#else
return 0;
#endif
}

int board_mmc_init(bd_t *bis)
{
int ret;

if (get_boot_mode() == BOOT_MODE_SD) {
ret = init_mmc();
ret |= init_dwmmc();
} else {
ret = init_dwmmc();
ret |= init_mmc();
}

if (ret)
debug("mmc init failed\n");

return ret;
}
#endif

#ifdef CONFIG_DISPLAY_BOARDINFO
int checkboard(void)
{
const char *board_info;
if (IS_ENABLED(CONFIG_BOARD_TYPES)) {
const char *board_info = get_board_type();

if (board_info)
printf("Type: %s\n", board_info);
}

board_info = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
printf("Board: %s\n", board_info ? board_info : "unknown");
#ifdef CONFIG_BOARD_TYPES
board_info = get_board_type();
if (board_info)
printf("Type: %s\n", board_info);
#endif
return 0;
}
#endif
Expand Down
29 changes: 0 additions & 29 deletions board/samsung/common/exynos5-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,8 @@

DECLARE_GLOBAL_DATA_PTR;

static void board_enable_audio_codec(void)
{
int node, ret;
struct gpio_desc en_gpio;

node = fdtdec_next_compatible(gd->fdt_blob, 0,
COMPAT_SAMSUNG_EXYNOS5_SOUND);
if (node <= 0)
return;

ret = gpio_request_by_name_nodev(offset_to_ofnode(node),
"codec-enable-gpio", 0, &en_gpio,
GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
if (ret == -FDT_ERR_NOTFOUND)
return;

/* Turn on the GPIO which connects to the codec's "enable" line. */
gpio_set_pull(gpio_get_number(&en_gpio), S5P_GPIO_PULL_NONE);

#ifdef CONFIG_SOUND_MAX98095
/* Enable MAX98095 Codec */
gpio_request(EXYNOS5_GPIO_X17, "max98095_enable");
gpio_direction_output(EXYNOS5_GPIO_X17, 1);
gpio_set_pull(EXYNOS5_GPIO_X17, S5P_GPIO_PULL_NONE);
#endif
}

int exynos_init(void)
{
board_enable_audio_codec();

return 0;
}

Expand Down
8 changes: 8 additions & 0 deletions common/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,14 @@ config BOUNCE_BUFFER
A second possible use of bounce buffers is their ability to
provide aligned buffers for DMA operations.

config BOARD_TYPES
bool "Call get_board_type() to get and display the board type"
help
If this option is enabled, checkboard() will call get_board_type()
to get a string containing the board type and this will be
displayed immediately after the model is shown on the console
early in boot.

menu "Start-up hooks"

config ARCH_EARLY_INIT_R
Expand Down
1 change: 1 addition & 0 deletions configs/axs101_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ CONFIG_DEBUG_UART=y
CONFIG_BOOTDELAY=3
CONFIG_USE_BOOTARGS=y
CONFIG_BOOTARGS="console=ttyS3,115200n8"
CONFIG_BOARD_TYPES=y
CONFIG_BOARD_EARLY_INIT_F=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="AXS# "
Expand Down
1 change: 1 addition & 0 deletions configs/axs103_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ CONFIG_DEBUG_UART=y
CONFIG_BOOTDELAY=3
CONFIG_USE_BOOTARGS=y
CONFIG_BOOTARGS="console=ttyS3,115200n8"
CONFIG_BOARD_TYPES=y
CONFIG_BOARD_EARLY_INIT_F=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="AXS# "
Expand Down
1 change: 1 addition & 0 deletions configs/odroid-xu3_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ CONFIG_ARM=y
CONFIG_ARCH_EXYNOS=y
CONFIG_SYS_TEXT_BASE=0x43E00000
CONFIG_ARCH_EXYNOS5=y
CONFIG_BOARD_TYPES=y
CONFIG_IDENT_STRING=" for ODROID-XU3/XU4/HC1/HC2"
CONFIG_DISTRO_DEFAULTS=y
CONFIG_NR_DRAM_BANKS=8
Expand Down
1 change: 1 addition & 0 deletions configs/odroid_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CONFIG_ARCH_EXYNOS=y
CONFIG_SYS_TEXT_BASE=0x43e00000
CONFIG_ARCH_EXYNOS4=y
CONFIG_TARGET_ODROID=y
CONFIG_BOARD_TYPES=y
CONFIG_DISTRO_DEFAULTS=y
CONFIG_NR_DRAM_BANKS=8
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
Expand Down
1 change: 1 addition & 0 deletions configs/spring_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ CONFIG_DEBUG_UART_S5P=y
CONFIG_SOUND=y
CONFIG_I2S=y
CONFIG_I2S_SAMSUNG=y
CONFIG_SOUND_MAX98088=y
CONFIG_SOUND_MAX98095=y
CONFIG_SOUND_WM8994=y
CONFIG_EXYNOS_SPI=y
Expand Down
31 changes: 20 additions & 11 deletions doc/driver-model/of-plat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,24 @@ strictly necessary. Notable problems include:
normally also supports device tree it must use #ifdef to separate
out this code, since the structures are only available in SPL.

- Correct relations between nodes are not implemented. This means that
parent/child relations (like bus device iteration) do not work yet.
Some phandles (those that are recognised as such) are converted into
a pointer to platform data. This pointer can potentially be used to
access the referenced device (by searching for the pointer value).
This feature is not yet implemented, however.


How it works
------------

The feature is enabled by CONFIG SPL_OF_PLATDATA. This is only available
in SPL and should be tested with:
The feature is enabled by CONFIG OF_PLATDATA. This is only available in
SPL/TPL and should be tested with:

#if CONFIG_IS_ENABLED(SPL_OF_PLATDATA)
#if CONFIG_IS_ENABLED(OF_PLATDATA)

A new tool called 'dtoc' converts a device tree file either into a set of
struct declarations, one for each compatible node, or a set of
struct declarations, one for each compatible node, and a set of
U_BOOT_DEVICE() declarations along with the actual platform data for each
device. As an example, consider this MMC node:

Expand Down Expand Up @@ -156,6 +163,13 @@ This avoids the code overhead of converting the device tree data to
platform data in the driver. The ofdata_to_platdata() method should
therefore do nothing in such a driver.

Note that for the platform data to be matched with a driver, the 'name'
property of the U_BOOT_DEVICE() declaration has to match a driver declared
via U_BOOT_DRIVER(). This effectively means that a U_BOOT_DRIVER() with a
'name' corresponding to the devicetree 'compatible' string (after converting
it to a valid name for C) is needed, so a dedicated driver is required for
each 'compatible' string.

Where a node has multiple compatible strings, a #define is used to make them
equivalent, e.g.:

Expand All @@ -165,8 +179,8 @@ equivalent, e.g.:
Converting of-platdata to a useful form
---------------------------------------

Of course it would be possible use the of-platdata directly in your driver
whenever configuration information is required. However this meands that the
Of course it would be possible to use the of-platdata directly in your driver
whenever configuration information is required. However this means that the
driver will not be able to support device tree, since the of-platdata
structure is not available when device tree is used. It would make no sense
to use this structure if device tree were available, since the structure has
Expand Down Expand Up @@ -282,11 +296,6 @@ prevents them being used inadvertently. All usage must be bracketed with
The dt-platdata.c file contains the device declarations and is is built in
spl/dt-platdata.c.

Some phandles (thsoe that are recognised as such) are converted into
points to platform data. This pointer can potentially be used to access the
referenced device (by searching for the pointer value). This feature is not
yet implemented, however.

The beginnings of a libfdt Python module are provided. So far this only
implements a subset of the features.

Expand Down
Loading

0 comments on commit 151b833

Please sign in to comment.